@codebit-programando-solucoes/codebit-web-antd 1.1.5 → 1.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs ADDED
@@ -0,0 +1,1184 @@
1
+ /*! For license information please see index.cjs.LICENSE.txt */
2
+ "use strict";
3
+ var __webpack_modules__ = {
4
+ "../../node_modules/.pnpm/react@19.2.0/node_modules/react/cjs/react-jsx-runtime.development.js": function(__unused_webpack_module, exports1, __webpack_require__) {
5
+ /**
6
+ * @license React
7
+ * react-jsx-runtime.development.js
8
+ *
9
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
10
+ *
11
+ * This source code is licensed under the MIT license found in the
12
+ * LICENSE file in the root directory of this source tree.
13
+ */ "production" !== process.env.NODE_ENV && function() {
14
+ function getComponentNameFromType(type) {
15
+ if (null == type) return null;
16
+ if ("function" == typeof type) return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
17
+ if ("string" == typeof type) return type;
18
+ switch(type){
19
+ case REACT_FRAGMENT_TYPE:
20
+ return "Fragment";
21
+ case REACT_PROFILER_TYPE:
22
+ return "Profiler";
23
+ case REACT_STRICT_MODE_TYPE:
24
+ return "StrictMode";
25
+ case REACT_SUSPENSE_TYPE:
26
+ return "Suspense";
27
+ case REACT_SUSPENSE_LIST_TYPE:
28
+ return "SuspenseList";
29
+ case REACT_ACTIVITY_TYPE:
30
+ return "Activity";
31
+ }
32
+ if ("object" == typeof type) switch("number" == typeof type.tag && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), type.$$typeof){
33
+ case REACT_PORTAL_TYPE:
34
+ return "Portal";
35
+ case REACT_CONTEXT_TYPE:
36
+ return type.displayName || "Context";
37
+ case REACT_CONSUMER_TYPE:
38
+ return (type._context.displayName || "Context") + ".Consumer";
39
+ case REACT_FORWARD_REF_TYPE:
40
+ var innerType = type.render;
41
+ type = type.displayName;
42
+ type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
43
+ return type;
44
+ case REACT_MEMO_TYPE:
45
+ return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
46
+ case REACT_LAZY_TYPE:
47
+ innerType = type._payload;
48
+ type = type._init;
49
+ try {
50
+ return getComponentNameFromType(type(innerType));
51
+ } catch (x) {}
52
+ }
53
+ return null;
54
+ }
55
+ function testStringCoercion(value) {
56
+ return "" + value;
57
+ }
58
+ function checkKeyStringCoercion(value) {
59
+ try {
60
+ testStringCoercion(value);
61
+ var JSCompiler_inline_result = !1;
62
+ } catch (e) {
63
+ JSCompiler_inline_result = !0;
64
+ }
65
+ if (JSCompiler_inline_result) {
66
+ JSCompiler_inline_result = console;
67
+ var JSCompiler_temp_const = JSCompiler_inline_result.error;
68
+ var JSCompiler_inline_result$jscomp$0 = "function" == typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
69
+ JSCompiler_temp_const.call(JSCompiler_inline_result, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", JSCompiler_inline_result$jscomp$0);
70
+ return testStringCoercion(value);
71
+ }
72
+ }
73
+ function getTaskName(type) {
74
+ if (type === REACT_FRAGMENT_TYPE) return "<>";
75
+ if ("object" == typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE) return "<...>";
76
+ try {
77
+ var name = getComponentNameFromType(type);
78
+ return name ? "<" + name + ">" : "<...>";
79
+ } catch (x) {
80
+ return "<...>";
81
+ }
82
+ }
83
+ function getOwner() {
84
+ var dispatcher = ReactSharedInternals.A;
85
+ return null === dispatcher ? null : dispatcher.getOwner();
86
+ }
87
+ function UnknownOwner() {
88
+ return Error("react-stack-top-frame");
89
+ }
90
+ function hasValidKey(config) {
91
+ if (hasOwnProperty.call(config, "key")) {
92
+ var getter = Object.getOwnPropertyDescriptor(config, "key").get;
93
+ if (getter && getter.isReactWarning) return !1;
94
+ }
95
+ return void 0 !== config.key;
96
+ }
97
+ function defineKeyPropWarningGetter(props, displayName) {
98
+ function warnAboutAccessingKey() {
99
+ specialPropKeyWarningShown || (specialPropKeyWarningShown = !0, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", displayName));
100
+ }
101
+ warnAboutAccessingKey.isReactWarning = !0;
102
+ Object.defineProperty(props, "key", {
103
+ get: warnAboutAccessingKey,
104
+ configurable: !0
105
+ });
106
+ }
107
+ function elementRefGetterWithDeprecationWarning() {
108
+ var componentName = getComponentNameFromType(this.type);
109
+ didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = !0, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."));
110
+ componentName = this.props.ref;
111
+ return void 0 !== componentName ? componentName : null;
112
+ }
113
+ function ReactElement(type, key, props, owner, debugStack, debugTask) {
114
+ var refProp = props.ref;
115
+ type = {
116
+ $$typeof: REACT_ELEMENT_TYPE,
117
+ type: type,
118
+ key: key,
119
+ props: props,
120
+ _owner: owner
121
+ };
122
+ null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
123
+ enumerable: !1,
124
+ get: elementRefGetterWithDeprecationWarning
125
+ }) : Object.defineProperty(type, "ref", {
126
+ enumerable: !1,
127
+ value: null
128
+ });
129
+ type._store = {};
130
+ Object.defineProperty(type._store, "validated", {
131
+ configurable: !1,
132
+ enumerable: !1,
133
+ writable: !0,
134
+ value: 0
135
+ });
136
+ Object.defineProperty(type, "_debugInfo", {
137
+ configurable: !1,
138
+ enumerable: !1,
139
+ writable: !0,
140
+ value: null
141
+ });
142
+ Object.defineProperty(type, "_debugStack", {
143
+ configurable: !1,
144
+ enumerable: !1,
145
+ writable: !0,
146
+ value: debugStack
147
+ });
148
+ Object.defineProperty(type, "_debugTask", {
149
+ configurable: !1,
150
+ enumerable: !1,
151
+ writable: !0,
152
+ value: debugTask
153
+ });
154
+ Object.freeze && (Object.freeze(type.props), Object.freeze(type));
155
+ return type;
156
+ }
157
+ function jsxDEVImpl(type, config, maybeKey, isStaticChildren, debugStack, debugTask) {
158
+ var children = config.children;
159
+ if (void 0 !== children) if (isStaticChildren) if (isArrayImpl(children)) {
160
+ for(isStaticChildren = 0; isStaticChildren < children.length; isStaticChildren++)validateChildKeys(children[isStaticChildren]);
161
+ Object.freeze && Object.freeze(children);
162
+ } else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
163
+ else validateChildKeys(children);
164
+ if (hasOwnProperty.call(config, "key")) {
165
+ children = getComponentNameFromType(type);
166
+ var keys = Object.keys(config).filter(function(k) {
167
+ return "key" !== k;
168
+ });
169
+ isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
170
+ didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />', isStaticChildren, children, keys, children), didWarnAboutKeySpread[children + isStaticChildren] = !0);
171
+ }
172
+ children = null;
173
+ void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
174
+ hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
175
+ if ("key" in config) {
176
+ maybeKey = {};
177
+ for(var propName in config)"key" !== propName && (maybeKey[propName] = config[propName]);
178
+ } else maybeKey = config;
179
+ children && defineKeyPropWarningGetter(maybeKey, "function" == typeof type ? type.displayName || type.name || "Unknown" : type);
180
+ return ReactElement(type, children, maybeKey, getOwner(), debugStack, debugTask);
181
+ }
182
+ function validateChildKeys(node) {
183
+ isValidElement(node) ? node._store && (node._store.validated = 1) : "object" == typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
184
+ }
185
+ function isValidElement(object) {
186
+ return "object" == typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
187
+ }
188
+ var React = __webpack_require__("react"), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
189
+ return null;
190
+ };
191
+ React = {
192
+ react_stack_bottom_frame: function(callStackForError) {
193
+ return callStackForError();
194
+ }
195
+ };
196
+ var specialPropKeyWarningShown;
197
+ var didWarnAboutElementRef = {};
198
+ var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(React, UnknownOwner)();
199
+ var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
200
+ var didWarnAboutKeySpread = {};
201
+ exports1.Fragment = REACT_FRAGMENT_TYPE;
202
+ exports1.jsx = function(type, config, maybeKey) {
203
+ var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
204
+ return jsxDEVImpl(type, config, maybeKey, !1, trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
205
+ };
206
+ exports1.jsxs = function(type, config, maybeKey) {
207
+ var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
208
+ return jsxDEVImpl(type, config, maybeKey, !0, trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
209
+ };
210
+ }();
211
+ },
212
+ "../../node_modules/.pnpm/react@19.2.0/node_modules/react/cjs/react-jsx-runtime.production.js": function(__unused_webpack_module, exports1) {
213
+ /**
214
+ * @license React
215
+ * react-jsx-runtime.production.js
216
+ *
217
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
218
+ *
219
+ * This source code is licensed under the MIT license found in the
220
+ * LICENSE file in the root directory of this source tree.
221
+ */ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
222
+ function jsxProd(type, config, maybeKey) {
223
+ var key = null;
224
+ void 0 !== maybeKey && (key = "" + maybeKey);
225
+ void 0 !== config.key && (key = "" + config.key);
226
+ if ("key" in config) {
227
+ maybeKey = {};
228
+ for(var propName in config)"key" !== propName && (maybeKey[propName] = config[propName]);
229
+ } else maybeKey = config;
230
+ config = maybeKey.ref;
231
+ return {
232
+ $$typeof: REACT_ELEMENT_TYPE,
233
+ type: type,
234
+ key: key,
235
+ ref: void 0 !== config ? config : null,
236
+ props: maybeKey
237
+ };
238
+ }
239
+ exports1.Fragment = REACT_FRAGMENT_TYPE;
240
+ exports1.jsx = jsxProd;
241
+ exports1.jsxs = jsxProd;
242
+ },
243
+ "../../node_modules/.pnpm/react@19.2.0/node_modules/react/jsx-runtime.js": function(module, __unused_webpack_exports, __webpack_require__) {
244
+ if ('production' === process.env.NODE_ENV) module.exports = __webpack_require__("../../node_modules/.pnpm/react@19.2.0/node_modules/react/cjs/react-jsx-runtime.production.js");
245
+ else module.exports = __webpack_require__("../../node_modules/.pnpm/react@19.2.0/node_modules/react/cjs/react-jsx-runtime.development.js");
246
+ },
247
+ react: function(module) {
248
+ module.exports = require("react");
249
+ }
250
+ };
251
+ var __webpack_module_cache__ = {};
252
+ function __webpack_require__(moduleId) {
253
+ var cachedModule = __webpack_module_cache__[moduleId];
254
+ if (void 0 !== cachedModule) return cachedModule.exports;
255
+ var module = __webpack_module_cache__[moduleId] = {
256
+ exports: {}
257
+ };
258
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
259
+ return module.exports;
260
+ }
261
+ (()=>{
262
+ __webpack_require__.n = (module)=>{
263
+ var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
264
+ __webpack_require__.d(getter, {
265
+ a: getter
266
+ });
267
+ return getter;
268
+ };
269
+ })();
270
+ (()=>{
271
+ __webpack_require__.d = (exports1, definition)=>{
272
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
273
+ enumerable: true,
274
+ get: definition[key]
275
+ });
276
+ };
277
+ })();
278
+ (()=>{
279
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
280
+ })();
281
+ (()=>{
282
+ __webpack_require__.r = (exports1)=>{
283
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
284
+ value: 'Module'
285
+ });
286
+ Object.defineProperty(exports1, '__esModule', {
287
+ value: true
288
+ });
289
+ };
290
+ })();
291
+ var __webpack_exports__ = {};
292
+ (()=>{
293
+ __webpack_require__.r(__webpack_exports__);
294
+ __webpack_require__.d(__webpack_exports__, {
295
+ TableContainer: ()=>TableContainer,
296
+ CssTokenBridge: ()=>CssTokenBridge,
297
+ LoggedMainContainer: ()=>LoggedMainContainer,
298
+ Login: ()=>Login,
299
+ FilterContainer: ()=>FilterContainer,
300
+ HandleError: ()=>HandleError,
301
+ ErrorRetry: ()=>ErrorRetry,
302
+ CodebitConfigProvider: ()=>CodebitConfigProvider,
303
+ CodebitConfigContext: ()=>CodebitConfigContext,
304
+ ListCard: ()=>ListCard,
305
+ ThemeToggle: ()=>ThemeToggle,
306
+ LoginContainer: ()=>LoginContainer
307
+ });
308
+ var jsx_runtime = __webpack_require__("../../node_modules/.pnpm/react@19.2.0/node_modules/react/jsx-runtime.js");
309
+ const icons_namespaceObject = require("@ant-design/icons");
310
+ const external_antd_namespaceObject = require("antd");
311
+ const external_prop_types_namespaceObject = require("prop-types");
312
+ var external_prop_types_default = /*#__PURE__*/ __webpack_require__.n(external_prop_types_namespaceObject);
313
+ var external_react_ = __webpack_require__("react");
314
+ const external_react_router_namespaceObject = require("react-router");
315
+ const external_i18next_namespaceObject = require("i18next");
316
+ const external_react_i18next_namespaceObject = require("react-i18next");
317
+ const pt = {
318
+ codebitWebAntd: {
319
+ LoggedMainContainer: {
320
+ theme: 'Tema',
321
+ logout: 'Sair',
322
+ version: 'Versão'
323
+ },
324
+ HandleError: {
325
+ notFoundTitle: 'Página não encontrada',
326
+ forbiddenTitle: 'Acesso negado',
327
+ internalTitle: 'Erro interno',
328
+ genericTitle: 'Erro inesperado',
329
+ notFoundMessage: 'A página que você estava procurando não existe.',
330
+ forbiddenMessage: 'Você não tem permissão para acessar esta página.',
331
+ internalMessage: 'Ocorreu um erro interno no servidor.',
332
+ genericMessage: 'Ocorreu um erro inesperado.',
333
+ backHome: 'Voltar para página inicial'
334
+ },
335
+ ErrorRetry: {
336
+ defaultError: 'Erro ao carregar',
337
+ retryButton: 'Tentar novamente',
338
+ reloadPageButton: 'Recarregar página',
339
+ networkError: 'Falha de conexão',
340
+ timeoutError: 'Servidor demorou para responder',
341
+ badRequestError: 'Requisição inválida',
342
+ forbiddenError: 'Recurso negado pelo servidor',
343
+ notFoundError: 'Recurso não encontrado pelo servidor',
344
+ internalServerError: 'Erro interno no servidor',
345
+ sessionExpiredError: 'Sessão expirada'
346
+ },
347
+ Login: {
348
+ loginTitle: 'Entrar',
349
+ googleLogin: 'Entrar com o Google'
350
+ },
351
+ LoginContainer: {
352
+ theme: 'Tema',
353
+ signIn: 'Entrar'
354
+ },
355
+ NotFound: {
356
+ pageNotFound: 'Página não encontrada',
357
+ sorryTheSearchPageDoesntExistOrRemoved: 'Desculpe, a página que você está procurando não existe ou foi removida.',
358
+ back: 'Voltar',
359
+ company: '© 2025 Codebit - Todos os direitos reservados'
360
+ },
361
+ ListCard: {
362
+ clearFilters: 'Limpar filtros'
363
+ }
364
+ }
365
+ };
366
+ const en = {
367
+ codebitWebAntd: {
368
+ LoggedMainContainer: {
369
+ theme: 'Theme',
370
+ logout: 'Logout',
371
+ version: 'Version'
372
+ },
373
+ HandleError: {
374
+ notFoundTitle: 'Page not found',
375
+ forbiddenTitle: 'Access denied',
376
+ internalTitle: 'Internal error',
377
+ genericTitle: 'Unexpected error',
378
+ notFoundMessage: 'The page you were looking for does not exist.',
379
+ forbiddenMessage: 'You do not have permission to access this page.',
380
+ internalMessage: 'An internal server error occurred.',
381
+ genericMessage: 'An unexpected error occurred.',
382
+ backHome: 'Back to home'
383
+ },
384
+ ErrorRetry: {
385
+ defaultError: 'Failed to load',
386
+ retryButton: 'Try again',
387
+ reloadPageButton: 'Reload page',
388
+ networkError: 'Connection failed',
389
+ timeoutError: 'Server took too long to respond',
390
+ badRequestError: 'Invalid request',
391
+ forbiddenError: 'Resource denied by server',
392
+ notFoundError: 'Resource not found by server',
393
+ internalServerError: 'Internal server error',
394
+ sessionExpiredError: 'Session expired'
395
+ },
396
+ Login: {
397
+ loginTitle: 'Login',
398
+ googleLogin: 'Login with Google'
399
+ },
400
+ LoginContainer: {
401
+ theme: 'Theme',
402
+ signIn: 'Sign in'
403
+ },
404
+ NotFound: {
405
+ pageNotFound: 'Page not found',
406
+ sorryTheSearchPageDoesntExistOrRemoved: 'Sorry, the page you are looking for does not exist or has been removed.',
407
+ back: 'Back',
408
+ company: '© 2025 Codebit - All rights reserved'
409
+ },
410
+ ListCard: {
411
+ clearFilters: 'Clear filters'
412
+ }
413
+ }
414
+ };
415
+ const i18nLib = external_i18next_namespaceObject.createInstance();
416
+ i18nLib.use(external_react_i18next_namespaceObject.initReactI18next).init({
417
+ resources: {
418
+ pt: pt,
419
+ en: en
420
+ },
421
+ lng: 'pt',
422
+ fallbackLng: 'pt',
423
+ defaultNS: 'codebitWebAntd',
424
+ ns: [
425
+ 'codebitWebAntd'
426
+ ],
427
+ interpolation: {
428
+ escapeValue: false
429
+ }
430
+ });
431
+ const i18n = i18nLib;
432
+ const CodebitConfigContext = /*#__PURE__*/ (0, external_react_.createContext)(null);
433
+ function CodebitConfigProvider({ children, menuItems, user, onLogout, toggleTheme, isDarkMode, oauthCallbackUrl, version = '1.0', showVersion = true, secondarySidebar, secondarySidebarWidth = 280 }) {
434
+ const contextValue = (0, external_react_.useMemo)(()=>({
435
+ menuItems,
436
+ user,
437
+ onLogout,
438
+ toggleTheme,
439
+ isDarkMode,
440
+ oauthCallbackUrl,
441
+ version,
442
+ showVersion,
443
+ i18n: i18n,
444
+ secondarySidebar,
445
+ secondarySidebarWidth
446
+ }), [
447
+ menuItems,
448
+ user,
449
+ onLogout,
450
+ toggleTheme,
451
+ isDarkMode,
452
+ version,
453
+ showVersion,
454
+ oauthCallbackUrl,
455
+ secondarySidebar,
456
+ secondarySidebarWidth
457
+ ]);
458
+ return /*#__PURE__*/ (0, jsx_runtime.jsxs)(CodebitConfigContext.Provider, {
459
+ value: contextValue,
460
+ children: [
461
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(CssTokenBridge, {}),
462
+ children
463
+ ]
464
+ });
465
+ }
466
+ CodebitConfigProvider.propTypes = {
467
+ children: external_prop_types_default().node.isRequired,
468
+ menuItems: external_prop_types_default().arrayOf(external_prop_types_default().shape({
469
+ key: external_prop_types_default().string.isRequired,
470
+ icon: external_prop_types_default().node,
471
+ label: external_prop_types_default().string.isRequired,
472
+ roles: external_prop_types_default().arrayOf(external_prop_types_default().string)
473
+ })).isRequired,
474
+ user: external_prop_types_default().shape({
475
+ name: external_prop_types_default().string.isRequired,
476
+ email: external_prop_types_default().string.isRequired,
477
+ id: external_prop_types_default().string.isRequired,
478
+ roles: external_prop_types_default().arrayOf(external_prop_types_default().string).isRequired
479
+ }).isRequired,
480
+ onLogout: external_prop_types_default().func.isRequired,
481
+ version: external_prop_types_default().string,
482
+ showVersion: external_prop_types_default().bool,
483
+ toggleTheme: external_prop_types_default().func.isRequired,
484
+ isDarkMode: external_prop_types_default().bool.isRequired,
485
+ oauthCallbackUrl: external_prop_types_default().string.isRequired,
486
+ secondarySidebar: external_prop_types_default().node,
487
+ secondarySidebarWidth: external_prop_types_default().number
488
+ };
489
+ const ThemeToggle = ()=>{
490
+ const config = (0, external_react_.useContext)(CodebitConfigContext);
491
+ if (!config) throw new Error('ThemeToggle must be used within CodebitConfigProvider');
492
+ (0, external_react_.useEffect)(()=>{
493
+ document.documentElement.style.colorScheme = config.isDarkMode ? 'dark' : 'light';
494
+ }, [
495
+ config.isDarkMode
496
+ ]);
497
+ return /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Switch, {
498
+ theme: config.isDarkMode ? 'dark' : 'light',
499
+ checked: config.isDarkMode,
500
+ onChange: config.toggleTheme,
501
+ checkedChildren: /*#__PURE__*/ (0, jsx_runtime.jsx)(icons_namespaceObject.MoonOutlined, {}),
502
+ unCheckedChildren: /*#__PURE__*/ (0, jsx_runtime.jsx)(icons_namespaceObject.SunOutlined, {})
503
+ });
504
+ };
505
+ const LoggedMainContainer_module = {
506
+ layout: "layout-mL5o6I",
507
+ drawer: "drawer-oj0mJX",
508
+ drawerBody: "drawerBody-YtAN37",
509
+ drawerFlex: "drawerFlex-AGTAax",
510
+ sider: "sider-BDy1Bs",
511
+ siderLayout: "siderLayout-C8H0uI",
512
+ secondarySidebar: "secondarySidebar-P6J_Xn",
513
+ menu: "menu-KMvPt7",
514
+ menuContainer: "menuContainer-ahnhBu",
515
+ menuLabel: "menuLabel-csBJTc",
516
+ menuDescription: "menuDescription-d6BFBO",
517
+ menuSpacer: "menuSpacer-RIB3II",
518
+ versionMenu: "versionMenu-NM4uyG",
519
+ logoutMenu: "logoutMenu-_RLfGo",
520
+ header: "header-vgc67L",
521
+ mobile: "mobile-mKGxb5",
522
+ headerSpace: "headerSpace-Fd_iha",
523
+ content: "content-OZHp2h"
524
+ };
525
+ const useCodebitWebAntdTranslation = ()=>(0, external_react_i18next_namespaceObject.useTranslation)('codebitWebAntd', {
526
+ i18n: i18n
527
+ });
528
+ const { Header, Sider, Content } = external_antd_namespaceObject.Layout;
529
+ const { Text } = external_antd_namespaceObject.Typography;
530
+ function LoggedMainContainer({ children }) {
531
+ const [collapsed, setCollapsed] = (0, external_react_.useState)(false);
532
+ const [isMobile, setIsMobile] = (0, external_react_.useState)(false);
533
+ const [drawerVisible, setDrawerVisible] = (0, external_react_.useState)(false);
534
+ const [secondarySidebarDrawerVisible, setSecondarySidebarDrawerVisible] = (0, external_react_.useState)(false);
535
+ const { t } = useCodebitWebAntdTranslation();
536
+ const navigate = (0, external_react_router_namespaceObject.useNavigate)();
537
+ const location = (0, external_react_router_namespaceObject.useLocation)();
538
+ const config = (0, external_react_.useContext)(CodebitConfigContext);
539
+ if (!config) throw new Error('LoggedContainer must be used within CodebitConfigProvider');
540
+ const { menuItems, user, onLogout, version, showVersion, isDarkMode, secondarySidebar, secondarySidebarWidth = 280 } = config;
541
+ const systemTheme = isDarkMode ? 'dark' : 'light';
542
+ const filteredMenuItems = (0, external_react_.useMemo)(()=>menuItems.filter((item)=>{
543
+ if (!item.roles) return true;
544
+ if (!user || !user.roles) return false;
545
+ if (item.roles) return item.roles.some((role)=>user.roles.includes(role));
546
+ return false;
547
+ }), [
548
+ menuItems,
549
+ user
550
+ ]);
551
+ (0, external_react_.useEffect)(()=>{
552
+ const checkScreenSize = ()=>{
553
+ setIsMobile(window.innerWidth < 768);
554
+ };
555
+ checkScreenSize();
556
+ window.addEventListener('resize', checkScreenSize);
557
+ return ()=>window.removeEventListener('resize', checkScreenSize);
558
+ }, []);
559
+ const handleLogout = async ()=>{
560
+ if (onLogout) await onLogout();
561
+ if (isMobile) setDrawerVisible(false);
562
+ navigate('/');
563
+ };
564
+ const handleMenuClick = (key)=>{
565
+ navigate(key);
566
+ if (isMobile) setDrawerVisible(false);
567
+ };
568
+ const getSelectedKey = ()=>{
569
+ const path = location.pathname;
570
+ const exactMatch = filteredMenuItems.find((item)=>item.key === path);
571
+ if (exactMatch) return exactMatch.key;
572
+ const prefixMatch = filteredMenuItems.find((item)=>path.startsWith(item.key) && '/' !== item.key);
573
+ if (prefixMatch) return prefixMatch.key;
574
+ return path;
575
+ };
576
+ const menuContent = /*#__PURE__*/ (0, jsx_runtime.jsxs)(jsx_runtime.Fragment, {
577
+ children: [
578
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Menu, {
579
+ theme: systemTheme,
580
+ mode: 'inline',
581
+ selectedKeys: [
582
+ getSelectedKey()
583
+ ],
584
+ onClick: ({ key })=>handleMenuClick(key),
585
+ items: filteredMenuItems,
586
+ className: LoggedMainContainer_module.menu
587
+ }),
588
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Layout.Content, {
589
+ className: LoggedMainContainer_module.menuSpacer
590
+ }),
591
+ showVersion && version && /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Menu, {
592
+ theme: systemTheme,
593
+ mode: 'horizontal',
594
+ className: LoggedMainContainer_module.versionMenu,
595
+ disabled: true,
596
+ items: [
597
+ {
598
+ icon: collapsed ? `${t('LoggedMainContainer.version')}: ${version}` : version,
599
+ title: ''
600
+ }
601
+ ]
602
+ }),
603
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Menu, {
604
+ theme: systemTheme,
605
+ mode: 'horizontal',
606
+ onClick: handleLogout,
607
+ className: LoggedMainContainer_module.logoutMenu,
608
+ items: [
609
+ {
610
+ key: 'logout',
611
+ icon: /*#__PURE__*/ (0, jsx_runtime.jsx)(icons_namespaceObject.LogoutOutlined, {}),
612
+ label: t('LoggedMainContainer.logout'),
613
+ danger: true
614
+ }
615
+ ]
616
+ })
617
+ ]
618
+ });
619
+ return /*#__PURE__*/ (0, jsx_runtime.jsxs)(external_antd_namespaceObject.Layout, {
620
+ className: LoggedMainContainer_module.layout,
621
+ children: [
622
+ isMobile ? /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Drawer, {
623
+ placement: 'left',
624
+ onClose: ()=>setDrawerVisible(false),
625
+ open: drawerVisible,
626
+ width: 250,
627
+ className: LoggedMainContainer_module.drawer,
628
+ classNames: {
629
+ body: LoggedMainContainer_module.drawerBody
630
+ },
631
+ children: /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Flex, {
632
+ vertical: true,
633
+ className: LoggedMainContainer_module.drawerFlex,
634
+ children: menuContent
635
+ })
636
+ }) : /*#__PURE__*/ (0, jsx_runtime.jsx)(Sider, {
637
+ theme: systemTheme,
638
+ trigger: null,
639
+ collapsible: true,
640
+ collapsed: !collapsed,
641
+ breakpoint: 'lg',
642
+ collapsedWidth: 80,
643
+ className: LoggedMainContainer_module.sider,
644
+ children: /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Layout, {
645
+ className: LoggedMainContainer_module.siderLayout,
646
+ children: menuContent
647
+ })
648
+ }),
649
+ secondarySidebar && !isMobile ? /*#__PURE__*/ (0, jsx_runtime.jsx)(Sider, {
650
+ theme: systemTheme,
651
+ width: secondarySidebarWidth,
652
+ className: `${LoggedMainContainer_module.secondarySidebar} ${isDarkMode ? LoggedMainContainer_module.secondarySidebarDark : ''}`,
653
+ children: secondarySidebar
654
+ }) : /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Drawer, {
655
+ placement: 'right',
656
+ onClose: ()=>setSecondarySidebarDrawerVisible(false),
657
+ open: secondarySidebarDrawerVisible,
658
+ width: 280,
659
+ className: LoggedMainContainer_module.drawer,
660
+ title: null,
661
+ closeIcon: /*#__PURE__*/ (0, jsx_runtime.jsx)(icons_namespaceObject.CloseOutlined, {}),
662
+ children: secondarySidebar
663
+ }),
664
+ /*#__PURE__*/ (0, jsx_runtime.jsxs)(external_antd_namespaceObject.Layout, {
665
+ children: [
666
+ /*#__PURE__*/ (0, jsx_runtime.jsxs)(Header, {
667
+ className: `${LoggedMainContainer_module.header} ${isMobile ? LoggedMainContainer_module.mobile : ''}`,
668
+ children: [
669
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Space, {
670
+ children: isMobile ? /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Button, {
671
+ type: 'text',
672
+ icon: /*#__PURE__*/ (0, jsx_runtime.jsx)(icons_namespaceObject.MenuOutlined, {}),
673
+ onClick: ()=>setDrawerVisible(true)
674
+ }) : /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Button, {
675
+ type: 'text',
676
+ icon: collapsed ? /*#__PURE__*/ (0, jsx_runtime.jsx)(icons_namespaceObject.MenuUnfoldOutlined, {}) : /*#__PURE__*/ (0, jsx_runtime.jsx)(icons_namespaceObject.MenuFoldOutlined, {}),
677
+ onClick: ()=>setCollapsed(!collapsed)
678
+ })
679
+ }),
680
+ /*#__PURE__*/ (0, jsx_runtime.jsxs)(external_antd_namespaceObject.Space, {
681
+ size: isMobile ? 'small' : 'middle',
682
+ className: `${LoggedMainContainer_module.headerSpace} ${isMobile ? LoggedMainContainer_module.mobile : ''}`,
683
+ children: [
684
+ secondarySidebar && isMobile && /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Button, {
685
+ type: 'text',
686
+ icon: /*#__PURE__*/ (0, jsx_runtime.jsx)(icons_namespaceObject.MenuOutlined, {}),
687
+ onClick: ()=>setSecondarySidebarDrawerVisible(true)
688
+ }),
689
+ !isMobile && /*#__PURE__*/ (0, jsx_runtime.jsx)(Text, {
690
+ children: t('LoggedMainContainer.theme')
691
+ }),
692
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(ThemeToggle, {})
693
+ ]
694
+ })
695
+ ]
696
+ }),
697
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(Content, {
698
+ className: `${LoggedMainContainer_module.content} ${isMobile ? LoggedMainContainer_module.mobile : ''}`,
699
+ children: children
700
+ })
701
+ ]
702
+ })
703
+ ]
704
+ });
705
+ }
706
+ LoggedMainContainer.propTypes = {
707
+ children: external_prop_types_default().node.isRequired
708
+ };
709
+ const codebit_web_namespaceObject = require("@codebit-programando-solucoes/codebit-web");
710
+ const react_namespaceObject = require("@sentry/react");
711
+ function ErrorRetry({ error, onRetry }) {
712
+ const { t } = useCodebitWebAntdTranslation();
713
+ if (error && error instanceof Error) {
714
+ console.error('Fail to load.', error);
715
+ react_namespaceObject.captureException(error);
716
+ }
717
+ const responseStatus = error?.response?.status || null;
718
+ let errorMessage = t('ErrorRetry.defaultError');
719
+ let retryText = t('ErrorRetry.retryButton');
720
+ let status = 'error';
721
+ if (error?.errorCode) switch(error.errorCode){
722
+ case codebit_web_namespaceObject.ErrorCode.ERR_NETWORK:
723
+ errorMessage = t('ErrorRetry.networkError');
724
+ break;
725
+ case codebit_web_namespaceObject.ErrorCode.ERR_TIMEOUT:
726
+ errorMessage = t('ErrorRetry.timeoutError');
727
+ break;
728
+ }
729
+ else if (responseStatus) switch(responseStatus){
730
+ case 400:
731
+ errorMessage = t('ErrorRetry.badRequestError');
732
+ break;
733
+ case 403:
734
+ errorMessage = t('ErrorRetry.forbiddenError');
735
+ retryText = t('ErrorRetry.reloadPageButton');
736
+ onRetry = ()=>{
737
+ globalThis.location.reload();
738
+ };
739
+ status = 403;
740
+ break;
741
+ case 404:
742
+ errorMessage = t('ErrorRetry.notFoundError');
743
+ status = 404;
744
+ break;
745
+ case 500:
746
+ errorMessage = t('ErrorRetry.internalServerError');
747
+ status = 500;
748
+ break;
749
+ case 401:
750
+ errorMessage = t('ErrorRetry.sessionExpiredError');
751
+ retryText = t('ErrorRetry.reloadPageButton');
752
+ onRetry = ()=>{
753
+ globalThis.location.reload();
754
+ };
755
+ break;
756
+ }
757
+ return /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Card, {
758
+ children: /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Result, {
759
+ status: status,
760
+ title: errorMessage,
761
+ extra: [
762
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Button, {
763
+ type: 'primary',
764
+ onClick: onRetry,
765
+ icon: /*#__PURE__*/ (0, jsx_runtime.jsx)(icons_namespaceObject.ReloadOutlined, {}),
766
+ children: retryText
767
+ }, 'retry')
768
+ ]
769
+ })
770
+ });
771
+ }
772
+ ErrorRetry.propTypes = {
773
+ error: external_prop_types_default().object.isRequired,
774
+ onRetry: external_prop_types_default().func.isRequired
775
+ };
776
+ const ListCard_module = {
777
+ listCard: "listCard-ISftFd",
778
+ headerRow: "headerRow-UsZAzP",
779
+ actions: "actions-ig53s2",
780
+ filtersRow: "filtersRow-f3Xk5a",
781
+ expandArea: "expandArea-czOoFS"
782
+ };
783
+ const { Title } = external_antd_namespaceObject.Typography;
784
+ function ListCard({ title, onClearFilters, headerContainer, tableContainer, actions }) {
785
+ const { token } = external_antd_namespaceObject.theme.useToken();
786
+ const { t } = (0, external_react_i18next_namespaceObject.useTranslation)('codebitWebAntd');
787
+ const margin = token['margin'];
788
+ return /*#__PURE__*/ (0, jsx_runtime.jsxs)(external_antd_namespaceObject.Card, {
789
+ className: ListCard_module.listCard,
790
+ children: [
791
+ /*#__PURE__*/ (0, jsx_runtime.jsxs)(external_antd_namespaceObject.Row, {
792
+ gutter: margin,
793
+ align: 'middle',
794
+ className: ListCard_module.headerRow,
795
+ children: [
796
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Col, {
797
+ xs: 24,
798
+ sm: 24,
799
+ md: 12,
800
+ children: /*#__PURE__*/ (0, jsx_runtime.jsx)(Title, {
801
+ level: 4,
802
+ children: title
803
+ })
804
+ }),
805
+ (!!onClearFilters || !!actions) && /*#__PURE__*/ (0, jsx_runtime.jsxs)(external_antd_namespaceObject.Col, {
806
+ xs: 24,
807
+ sm: 24,
808
+ md: 12,
809
+ className: ListCard_module.actions,
810
+ children: [
811
+ !!onClearFilters && /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Button, {
812
+ icon: /*#__PURE__*/ (0, jsx_runtime.jsx)(icons_namespaceObject.ClearOutlined, {}),
813
+ onClick: onClearFilters,
814
+ children: t('ListCard.clearFilters')
815
+ }),
816
+ actions
817
+ ]
818
+ })
819
+ ]
820
+ }),
821
+ !!headerContainer && /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Row, {
822
+ gutter: margin,
823
+ className: ListCard_module.filtersRow,
824
+ children: headerContainer
825
+ }),
826
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Layout, {
827
+ className: ListCard_module.expandArea,
828
+ children: tableContainer
829
+ })
830
+ ]
831
+ });
832
+ }
833
+ ListCard.propTypes = {
834
+ title: external_prop_types_default().string.isRequired,
835
+ onClearFilters: external_prop_types_default().func,
836
+ headerContainer: external_prop_types_default().node,
837
+ tableContainer: external_prop_types_default().node,
838
+ actions: external_prop_types_default().node
839
+ };
840
+ ListCard.defaultProps = {
841
+ onClearFilters: null,
842
+ headerContainer: null,
843
+ tableContainer: null,
844
+ actions: null
845
+ };
846
+ const CssTokenBridge = ()=>{
847
+ const { token } = external_antd_namespaceObject.theme.useToken();
848
+ (0, external_react_.useLayoutEffect)(()=>{
849
+ const root = document.documentElement;
850
+ root.style.setProperty('--antd-color-bg-container', token['colorBgContainer']);
851
+ root.style.setProperty('--antd-color-bg-elevated', token['colorBgElevated']);
852
+ root.style.setProperty('--antd-color-bg-layout', token['colorBgLayout']);
853
+ root.style.setProperty('--antd-color-border', token['colorBorder']);
854
+ root.style.setProperty('--antd-color-primary', token['colorPrimary']);
855
+ root.style.setProperty('--antd-color-text', token['colorText']);
856
+ root.style.setProperty('--antd-color-text-secondary', token['colorTextSecondary']);
857
+ root.style.setProperty('--antd-color-split', token['colorSplit']);
858
+ root.style.setProperty('--antd-margin-xxs', `${token['marginXXS']}px`);
859
+ root.style.setProperty('--antd-margin-xs', `${token['marginXS']}px`);
860
+ root.style.setProperty('--antd-margin-sm', `${token['marginSM']}px`);
861
+ root.style.setProperty('--antd-margin', `${token['margin']}px`);
862
+ root.style.setProperty('--antd-margin-md', `${token['marginMD']}px`);
863
+ root.style.setProperty('--antd-margin-lg', `${token['marginLG']}px`);
864
+ root.style.setProperty('--antd-margin-xl', `${token['marginXL']}px`);
865
+ root.style.setProperty('--antd-margin-xxl', `${token['marginXXL']}px`);
866
+ root.style.setProperty('--antd-padding-xxs', `${token['paddingXXS']}px`);
867
+ root.style.setProperty('--antd-padding-xs', `${token['paddingXS']}px`);
868
+ root.style.setProperty('--antd-padding-sm', `${token['paddingSM']}px`);
869
+ root.style.setProperty('--antd-padding', `${token['padding']}px`);
870
+ root.style.setProperty('--antd-padding-md', `${token['paddingMD']}px`);
871
+ root.style.setProperty('--antd-padding-lg', `${token['paddingLG']}px`);
872
+ root.style.setProperty('--antd-padding-xl', `${token['paddingXL']}px`);
873
+ root.style.setProperty('--antd-font-size-sm', `${token['fontSizeSM']}px`);
874
+ root.style.setProperty('--antd-font-size', `${token['fontSize']}px`);
875
+ root.style.setProperty('--antd-font-size-lg', `${token['fontSizeLG']}px`);
876
+ root.style.setProperty('--antd-font-size-xl', `${token['fontSizeXL']}px`);
877
+ root.style.setProperty('--antd-line-height', token['lineHeight']);
878
+ root.style.setProperty('--antd-line-height-lg', token['lineHeightLG']);
879
+ root.style.setProperty('--antd-control-height-sm', `${token['controlHeightSM']}px`);
880
+ root.style.setProperty('--antd-control-height', `${token['controlHeight']}px`);
881
+ root.style.setProperty('--antd-control-height-lg', `${token['controlHeightLG']}px`);
882
+ root.style.setProperty('--antd-border-radius-sm', `${token['borderRadiusSM']}px`);
883
+ root.style.setProperty('--antd-border-radius', `${token['borderRadius']}px`);
884
+ root.style.setProperty('--antd-border-radius-lg', `${token['borderRadiusLG']}px`);
885
+ }, [
886
+ token
887
+ ]);
888
+ return null;
889
+ };
890
+ const TableContainer_module = {
891
+ tableContainer: "tableContainer-EhNwOm"
892
+ };
893
+ function isPaginationNode(node) {
894
+ if (node.nodeType !== Node.ELEMENT_NODE) return false;
895
+ const element = node;
896
+ return element.classList?.contains('ant-table-pagination') || element.querySelector?.('.ant-table-pagination');
897
+ }
898
+ function hasPaginationInMutation(mutation) {
899
+ return Array.from(mutation.addedNodes).some(isPaginationNode);
900
+ }
901
+ function TableContainer({ children }) {
902
+ const containerRef = (0, external_react_.useRef)(null);
903
+ const containerHeightRef = (0, external_react_.useRef)(null);
904
+ const [scrollY, setScrollY] = (0, external_react_.useState)(void 0);
905
+ (0, external_react_.useLayoutEffect)(()=>{
906
+ const calculateHeights = ()=>{
907
+ if (!containerRef.current) return;
908
+ containerHeightRef.current = containerRef.current.offsetHeight;
909
+ const thead = containerRef.current.querySelector('thead');
910
+ let theadHeight = 0;
911
+ if (thead) {
912
+ const rect = thead.getBoundingClientRect();
913
+ const styles = globalThis.getComputedStyle(thead);
914
+ const marginTop = Number.parseFloat(styles.marginTop) || 0;
915
+ const marginBottom = Number.parseFloat(styles.marginBottom) || 0;
916
+ theadHeight = rect.height + marginTop + marginBottom;
917
+ }
918
+ const pagination = containerRef.current.querySelector('.ant-table-pagination');
919
+ let paginationHeight = 0;
920
+ if (pagination) {
921
+ const rect = pagination.getBoundingClientRect();
922
+ const styles = globalThis.getComputedStyle(pagination);
923
+ const marginTop = Number.parseFloat(styles.marginTop) || 0;
924
+ const marginBottom = Number.parseFloat(styles.marginBottom) || 0;
925
+ paginationHeight = rect.height + marginTop + marginBottom;
926
+ }
927
+ const availableHeight = Math.ceil(containerHeightRef.current) - Math.ceil(theadHeight) - Math.ceil(paginationHeight) - 1;
928
+ setScrollY(availableHeight);
929
+ };
930
+ calculateHeights();
931
+ const observer = new MutationObserver((mutations)=>{
932
+ const hasPagination = mutations.some(hasPaginationInMutation);
933
+ if (hasPagination) calculateHeights();
934
+ });
935
+ if (containerRef.current) observer.observe(containerRef.current, {
936
+ childList: true,
937
+ subtree: true
938
+ });
939
+ globalThis.addEventListener('resize', calculateHeights);
940
+ return ()=>{
941
+ observer.disconnect();
942
+ globalThis.removeEventListener('resize', calculateHeights);
943
+ };
944
+ }, []);
945
+ const enhancedChildren = scrollY ? /*#__PURE__*/ (0, external_react_.cloneElement)(children, {
946
+ scroll: {
947
+ ...children.props?.scroll,
948
+ y: scrollY,
949
+ x: 'max-content'
950
+ }
951
+ }) : children;
952
+ return /*#__PURE__*/ (0, jsx_runtime.jsx)("div", {
953
+ ref: containerRef,
954
+ className: TableContainer_module.tableContainer,
955
+ children: enhancedChildren
956
+ });
957
+ }
958
+ TableContainer.propTypes = {
959
+ children: external_prop_types_default().element.isRequired
960
+ };
961
+ function FilterContainer({ children, ...props }) {
962
+ const { token } = external_antd_namespaceObject.theme.useToken();
963
+ return /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Card, {
964
+ styles: {
965
+ body: {
966
+ padding: token['paddingXS'] + 'px'
967
+ }
968
+ },
969
+ ...props,
970
+ children: children
971
+ });
972
+ }
973
+ FilterContainer.propTypes = {
974
+ children: external_prop_types_default().node.isRequired,
975
+ ...external_antd_namespaceObject.Card.propTypes
976
+ };
977
+ const Login_module = {
978
+ containerRow: "containerRow-lnjnDt",
979
+ themeRow: "themeRow-ZhL0jS",
980
+ loginCard: "loginCard-k07Wjb",
981
+ dark: "dark-JBf6Fe",
982
+ titleRow: "titleRow-XMkFzo",
983
+ appTitle: "appTitle-tL41k9",
984
+ divider: "divider-oJpEKR",
985
+ loginHeader: "loginHeader-bBGO5B"
986
+ };
987
+ function LoginContainer({ title, children }) {
988
+ const config = (0, external_react_.useContext)(CodebitConfigContext);
989
+ if (!config) throw new Error('Login must be used within CodebitConfigProvider');
990
+ const { t } = useCodebitWebAntdTranslation();
991
+ const classList = [
992
+ Login_module.loginCard
993
+ ];
994
+ if (config.isDarkMode) classList.push(Login_module.dark);
995
+ return /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Row, {
996
+ justify: 'center',
997
+ align: 'middle',
998
+ className: Login_module.containerRow,
999
+ children: /*#__PURE__*/ (0, jsx_runtime.jsxs)(external_antd_namespaceObject.Col, {
1000
+ xs: 22,
1001
+ sm: 18,
1002
+ md: 14,
1003
+ lg: 10,
1004
+ xl: 8,
1005
+ children: [
1006
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Row, {
1007
+ justify: 'end',
1008
+ className: Login_module.themeRow,
1009
+ children: /*#__PURE__*/ (0, jsx_runtime.jsxs)(external_antd_namespaceObject.Space, {
1010
+ children: [
1011
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Typography.Text, {
1012
+ children: t('LoginContainer.theme')
1013
+ }),
1014
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(ThemeToggle, {})
1015
+ ]
1016
+ })
1017
+ }),
1018
+ /*#__PURE__*/ (0, jsx_runtime.jsxs)(external_antd_namespaceObject.Card, {
1019
+ className: classList.join(' '),
1020
+ children: [
1021
+ /*#__PURE__*/ (0, jsx_runtime.jsxs)(external_antd_namespaceObject.Row, {
1022
+ justify: 'center',
1023
+ className: Login_module.titleRow,
1024
+ children: [
1025
+ 'string' == typeof title ? /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Typography.Title, {
1026
+ level: 3,
1027
+ className: Login_module.appTitle,
1028
+ children: title
1029
+ }) : title,
1030
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Divider, {
1031
+ className: Login_module.divider
1032
+ })
1033
+ ]
1034
+ }),
1035
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Typography.Title, {
1036
+ level: 4,
1037
+ className: `login-header ${Login_module.loginHeader}`,
1038
+ children: t('LoginContainer.signIn')
1039
+ }),
1040
+ children
1041
+ ]
1042
+ })
1043
+ ]
1044
+ })
1045
+ });
1046
+ }
1047
+ LoginContainer.propTypes = {
1048
+ title: external_prop_types_default().oneOfType([
1049
+ external_prop_types_default().string,
1050
+ external_prop_types_default().node
1051
+ ]).isRequired,
1052
+ children: external_prop_types_default().node
1053
+ };
1054
+ function Login({ title }) {
1055
+ const [loading, setLoading] = (0, external_react_.useState)(false);
1056
+ const config = (0, external_react_.useContext)(CodebitConfigContext);
1057
+ if (!config) throw new Error('Login must be used within CodebitConfigProvider');
1058
+ const { oauthCallbackUrl } = config;
1059
+ const { t } = useCodebitWebAntdTranslation();
1060
+ const handleGoogleLogin = ()=>{
1061
+ setLoading(true);
1062
+ setTimeout(()=>{
1063
+ console.debug('Redirecting to Google Login...');
1064
+ globalThis.location.assign(oauthCallbackUrl);
1065
+ }, 1000);
1066
+ };
1067
+ return /*#__PURE__*/ (0, jsx_runtime.jsx)(LoginContainer, {
1068
+ title: title || t('Login.loginTitle'),
1069
+ children: /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Flex, {
1070
+ vertical: true,
1071
+ align: 'center',
1072
+ gap: 20,
1073
+ children: /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Button, {
1074
+ type: 'primary',
1075
+ size: 'large',
1076
+ icon: /*#__PURE__*/ (0, jsx_runtime.jsx)(icons_namespaceObject.GoogleOutlined, {}),
1077
+ loading: loading,
1078
+ onClick: handleGoogleLogin,
1079
+ block: true,
1080
+ children: t('Login.googleLogin')
1081
+ })
1082
+ })
1083
+ });
1084
+ }
1085
+ Login.propTypes = {
1086
+ title: external_prop_types_default().oneOfType([
1087
+ external_prop_types_default().string,
1088
+ external_prop_types_default().node
1089
+ ])
1090
+ };
1091
+ const HandleError_module = {
1092
+ container: "container-A_JXAc",
1093
+ content: "content-yh3y0U",
1094
+ title: "title-rFxsxp",
1095
+ errorDetails: "errorDetails-DjtTbH",
1096
+ errorStack: "errorStack-DJzbWD"
1097
+ };
1098
+ function HandleError({ title }) {
1099
+ const error = (0, external_react_router_namespaceObject.useRouteError)();
1100
+ const navigate = (0, external_react_router_namespaceObject.useNavigate)();
1101
+ const { t } = useCodebitWebAntdTranslation();
1102
+ const handleGoHome = ()=>{
1103
+ navigate('/');
1104
+ };
1105
+ const getErrorStatus = ()=>{
1106
+ if (error && 404 === error.status) return 404;
1107
+ if (error && 403 === error.status) return 403;
1108
+ if (error && 500 === error.status) return 500;
1109
+ return 'error';
1110
+ };
1111
+ const getErrorMessage = ()=>{
1112
+ if (error && 404 === error.status) return t('HandleError.notFoundMessage');
1113
+ if (error && 403 === error.status) return t('HandleError.forbiddenMessage');
1114
+ if (error && 500 === error.status) return t('HandleError.internalMessage');
1115
+ return error && error.message || t('HandleError.genericMessage');
1116
+ };
1117
+ const getErrorTitle = ()=>{
1118
+ if (error && 404 === error.status) return t('HandleError.notFoundTitle');
1119
+ if (error && 403 === error.status) return t('HandleError.forbiddenTitle');
1120
+ if (error && 500 === error.status) return t('HandleError.internalTitle');
1121
+ return t('HandleError.genericTitle');
1122
+ };
1123
+ return /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Flex, {
1124
+ justify: 'center',
1125
+ align: 'center',
1126
+ className: HandleError_module.container,
1127
+ children: /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Flex, {
1128
+ className: HandleError_module.content,
1129
+ children: /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Result, {
1130
+ status: getErrorStatus(),
1131
+ title: /*#__PURE__*/ (0, jsx_runtime.jsxs)(jsx_runtime.Fragment, {
1132
+ children: [
1133
+ /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Typography.Title, {
1134
+ level: 2,
1135
+ className: HandleError_module.title,
1136
+ children: title
1137
+ }),
1138
+ getErrorTitle()
1139
+ ]
1140
+ }),
1141
+ subTitle: getErrorMessage(),
1142
+ extra: /*#__PURE__*/ (0, jsx_runtime.jsx)(external_antd_namespaceObject.Button, {
1143
+ type: 'primary',
1144
+ size: 'large',
1145
+ onClick: handleGoHome,
1146
+ children: t('HandleError.backHome')
1147
+ })
1148
+ })
1149
+ })
1150
+ });
1151
+ }
1152
+ HandleError.propTypes = {
1153
+ title: external_prop_types_default().string
1154
+ };
1155
+ })();
1156
+ exports.CodebitConfigContext = __webpack_exports__.CodebitConfigContext;
1157
+ exports.CodebitConfigProvider = __webpack_exports__.CodebitConfigProvider;
1158
+ exports.CssTokenBridge = __webpack_exports__.CssTokenBridge;
1159
+ exports.ErrorRetry = __webpack_exports__.ErrorRetry;
1160
+ exports.FilterContainer = __webpack_exports__.FilterContainer;
1161
+ exports.HandleError = __webpack_exports__.HandleError;
1162
+ exports.ListCard = __webpack_exports__.ListCard;
1163
+ exports.LoggedMainContainer = __webpack_exports__.LoggedMainContainer;
1164
+ exports.Login = __webpack_exports__.Login;
1165
+ exports.LoginContainer = __webpack_exports__.LoginContainer;
1166
+ exports.TableContainer = __webpack_exports__.TableContainer;
1167
+ exports.ThemeToggle = __webpack_exports__.ThemeToggle;
1168
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
1169
+ "CodebitConfigContext",
1170
+ "CodebitConfigProvider",
1171
+ "CssTokenBridge",
1172
+ "ErrorRetry",
1173
+ "FilterContainer",
1174
+ "HandleError",
1175
+ "ListCard",
1176
+ "LoggedMainContainer",
1177
+ "Login",
1178
+ "LoginContainer",
1179
+ "TableContainer",
1180
+ "ThemeToggle"
1181
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
1182
+ Object.defineProperty(exports, '__esModule', {
1183
+ value: true
1184
+ });