frontend-plus-react 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -378,7 +378,7 @@ var useApiCallWithoutSnackbar = () => {
378
378
  };
379
379
 
380
380
  // src/components/grid/GenericDataGrid.tsx
381
- var import_material18 = require("@mui/material");
381
+ var import_material19 = require("@mui/material");
382
382
 
383
383
  // src/store/index.ts
384
384
  var import_toolkit4 = require("@reduxjs/toolkit");
@@ -1420,7 +1420,7 @@ function BotonDetalle({ row, rowId, detailTable, deshabilitado }) {
1420
1420
  const { abiertos, alternarDetalle } = useDetallesGrilla();
1421
1421
  if (!cumpleCondicion(detailTable.condition, row)) return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "fpr-boton-detalle" });
1422
1422
  const abierto = abiertos.has(claveDetalle(rowId, detailTable));
1423
- const titulo = deshabilitado ? "Grab\xE1 la fila para ver sus detalles" : `${detailTable.label || detailTable.abr}${abierto ? " (replegar)" : ""} \u2014 Ctrl+click: en otra pesta\xF1a`;
1423
+ const titulo = deshabilitado ? "Grab\xE1 la fila para ver sus detalles" : "";
1424
1424
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material3.Tooltip, { title: titulo, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "fpr-boton-detalle", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1425
1425
  import_material3.IconButton,
1426
1426
  {
@@ -1856,7 +1856,8 @@ var useGridMenu = ({
1856
1856
  callApi,
1857
1857
  resetSorting,
1858
1858
  triggerImport,
1859
- triggerExport
1859
+ triggerExport,
1860
+ abrirColumnas
1860
1861
  }) => {
1861
1862
  const { showSuccess, showError, showWarning } = useSnackbar();
1862
1863
  const menuOptions = (0, import_react10.useMemo)(() => {
@@ -1892,7 +1893,7 @@ var useGridMenu = ({
1892
1893
  label: "ocultar o mostrar columnas",
1893
1894
  icon: import_react10.default.createElement(import_VisibilityOff.default),
1894
1895
  handler: async () => {
1895
- console.log("Ocultar/mostrar columnas");
1896
+ abrirColumnas?.();
1896
1897
  },
1897
1898
  visible: true
1898
1899
  });
@@ -1941,7 +1942,7 @@ var useGridMenu = ({
1941
1942
  visible: true
1942
1943
  });
1943
1944
  return options;
1944
- }, [tableDefinition, tableName, fixedFields, setTableData, callApi, resetSorting, triggerImport, triggerExport, showSuccess, showError, showWarning]);
1945
+ }, [tableDefinition, tableName, fixedFields, setTableData, callApi, resetSorting, triggerImport, triggerExport, abrirColumnas, showSuccess, showError, showWarning]);
1945
1946
  return { menuOptions };
1946
1947
  };
1947
1948
 
@@ -2012,7 +2013,7 @@ var useVistaGrilla = () => (0, import_react11.useContext)(VistaGrillaContext);
2012
2013
 
2013
2014
  // src/components/grid/renderers/headerCellRenderers.tsx
2014
2015
  var import_jsx_runtime6 = require("react/jsx-runtime");
2015
- var defaultColumnHeaderCellRenderer = (props, fieldDef) => {
2016
+ var defaultColumnHeaderCellRenderer = (props, fieldDef, ocultarColumna) => {
2016
2017
  const { column, sortDirection, priority } = props;
2017
2018
  const isPrimaryKey = fieldDef.isPk;
2018
2019
  const sorted = sortDirection !== void 0;
@@ -2027,6 +2028,11 @@ var defaultColumnHeaderCellRenderer = (props, fieldDef) => {
2027
2028
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
2028
2029
  import_material4.Box,
2029
2030
  {
2031
+ onClickCapture: (e) => {
2032
+ if (!e.altKey || !ocultarColumna) return;
2033
+ e.stopPropagation();
2034
+ ocultarColumna(fieldDef.name);
2035
+ },
2030
2036
  sx: {
2031
2037
  display: "flex",
2032
2038
  alignItems: "center",
@@ -3324,6 +3330,14 @@ var allColumnsEditCellRenderer = (props, allColumns) => {
3324
3330
  }
3325
3331
  };
3326
3332
 
3333
+ // src/utils/columnasOcultas.ts
3334
+ function columnasOcultasIniciales(tableDefinition) {
3335
+ return Array.from(new Set(tableDefinition.hiddenColumns ?? []));
3336
+ }
3337
+ function campoDibujable(field) {
3338
+ return field.visible !== false;
3339
+ }
3340
+
3327
3341
  // src/hooks/grid/useGridColumns.ts
3328
3342
  var estimateTextWidth = (text) => text.length * 8 + 16;
3329
3343
  var calcularAnchosDeColumnas = (tableDefinition, filas) => {
@@ -3361,6 +3375,8 @@ var useGridColumns = ({
3361
3375
  tableDefinition,
3362
3376
  anchosCalculados,
3363
3377
  fixedFields,
3378
+ columnasOcultas,
3379
+ ocultarColumna,
3364
3380
  primaryKey,
3365
3381
  setTableData,
3366
3382
  handleKeyPressInEditor,
@@ -3374,7 +3390,7 @@ var useGridColumns = ({
3374
3390
  const columns = (0, import_react22.useMemo)(() => {
3375
3391
  if (!tableDefinition) return [];
3376
3392
  const fieldsToShow = tableDefinition.fields.filter((field) => {
3377
- return !columnaOcultaPorFixedField(fixedFields, field.name) && field.visible !== false;
3393
+ return campoDibujable(field) && !columnaOcultaPorFixedField(fixedFields, field.name) && !columnasOcultas.has(field.name);
3378
3394
  });
3379
3395
  const defaultColumns = fieldsToShow.map((fieldDef) => {
3380
3396
  const isFixedField = valorFijoDe(fixedFields, fieldDef.name) !== void 0;
@@ -3399,7 +3415,7 @@ var useGridColumns = ({
3399
3415
  registrarEditor,
3400
3416
  width: colWidth,
3401
3417
  minWidth: 40,
3402
- renderHeaderCell: (props) => defaultColumnHeaderCellRenderer(props, fieldDef),
3418
+ renderHeaderCell: (props) => defaultColumnHeaderCellRenderer(props, fieldDef, ocultarColumna),
3403
3419
  renderSummaryCell: (props) => defaultColumnSummaryCellRenderer(props, fixedFields)
3404
3420
  };
3405
3421
  return column;
@@ -3462,7 +3478,7 @@ var useGridColumns = ({
3462
3478
  renderEditCell: (props) => allColumnsEditCellRenderer(props, allColumns),
3463
3479
  renderCell: (props) => allColumnsCellRenderer(props)
3464
3480
  }));
3465
- }, [tableDefinition, anchosCalculados, fixedFields, primaryKey, setTableData, handleKeyPressInEditor, registrarEditor, handleDeleteRow, handleAddRow, handleVerticalEditRow, toggleFilterVisibility, abrirOpcionesDeGrilla]);
3481
+ }, [tableDefinition, anchosCalculados, fixedFields, columnasOcultas, ocultarColumna, primaryKey, setTableData, handleKeyPressInEditor, registrarEditor, handleDeleteRow, handleAddRow, handleVerticalEditRow, toggleFilterVisibility, abrirOpcionesDeGrilla]);
3466
3482
  return { columns };
3467
3483
  };
3468
3484
 
@@ -3610,6 +3626,7 @@ var ExportDialog = ({
3610
3626
  open,
3611
3627
  onClose,
3612
3628
  tableDefinition,
3629
+ columnasOcultas,
3613
3630
  tableData,
3614
3631
  filteredRows,
3615
3632
  username = "anonymous"
@@ -3640,8 +3657,7 @@ var ExportDialog = ({
3640
3657
  };
3641
3658
  const executeExport = async () => {
3642
3659
  const fieldsDef2Export = tableDefinition.fields.filter((fieldDef) => {
3643
- const isVisible = fieldDef.visible !== false;
3644
- return (fieldDef.inTable !== false || options.fromOtherTables) && isVisible && (fieldDef.editable !== false || options.readOnly || tableDefinition.primaryKey?.includes(fieldDef.name)) && (isVisible || options.hiddens);
3660
+ return (fieldDef.inTable !== false || options.fromOtherTables) && campoDibujable(fieldDef) && (fieldDef.editable !== false || options.readOnly || tableDefinition.primaryKey?.includes(fieldDef.name)) && (!columnasOcultas.has(fieldDef.name) || options.hiddens);
3645
3661
  });
3646
3662
  if (format === "xlsx") {
3647
3663
  await excelExport(fieldsDef2Export);
@@ -3805,16 +3821,36 @@ var ExportDialog = ({
3805
3821
  ] });
3806
3822
  };
3807
3823
 
3824
+ // src/components/grid/DialogoDeColumnas.tsx
3825
+ var import_material17 = require("@mui/material");
3826
+ var import_jsx_runtime21 = require("react/jsx-runtime");
3827
+ var DialogoDeColumnas = ({ open, onClose, columnas, ocultas, alternarColumna }) => {
3828
+ const lista = (titulo, nombres, idDeLista) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_material17.Box, { sx: { flex: 1, minWidth: 0 }, children: [
3829
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material17.Typography, { variant: "subtitle2", sx: { mb: 1 }, children: titulo }),
3830
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material17.List, { dense: true, "data-testid": idDeLista, sx: { maxHeight: 360, overflow: "auto", border: 1, borderColor: "divider", borderRadius: 1 }, children: nombres.map((nombre) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material17.ListItemButton, { onClick: () => alternarColumna(nombre), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material17.ListItemText, { primary: nombre }) }, nombre)) })
3831
+ ] });
3832
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_material17.Dialog, { open, onClose, maxWidth: "sm", fullWidth: true, children: [
3833
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material17.DialogTitle, { children: "Ocultar o mostrar columnas" }),
3834
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material17.DialogContent, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_material17.Box, { sx: { display: "flex", gap: 2, pt: 1 }, children: [
3835
+ lista("Columnas mostradas", columnas.filter((nombre) => !ocultas.has(nombre)), "columnas-mostradas"),
3836
+ lista("Columnas ocultas", columnas.filter((nombre) => ocultas.has(nombre)), "columnas-ocultas")
3837
+ ] }) }),
3838
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material17.DialogActions, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material17.Button, { onClick: onClose, children: "Cerrar" }) })
3839
+ ] });
3840
+ };
3841
+
3808
3842
  // src/pages/VerticalEditorPage.tsx
3809
3843
  var import_react25 = require("react");
3810
- var import_material17 = require("@mui/material");
3844
+ var import_material18 = require("@mui/material");
3811
3845
  var import_Close = __toESM(require("@mui/icons-material/Close"), 1);
3812
- var import_jsx_runtime21 = require("react/jsx-runtime");
3846
+ var import_jsx_runtime22 = require("react/jsx-runtime");
3847
+ var SIN_OCULTAS = /* @__PURE__ */ new Set();
3813
3848
  var VerticalEditorPage = ({
3814
3849
  tableName,
3815
3850
  tableDefinition,
3816
3851
  initialData,
3817
3852
  fixedFields,
3853
+ columnasOcultas = SIN_OCULTAS,
3818
3854
  isNewRow = false,
3819
3855
  onSaveSuccess,
3820
3856
  onClose
@@ -3936,21 +3972,21 @@ var VerticalEditorPage = ({
3936
3972
  tableDefinition,
3937
3973
  onSaveSuccess
3938
3974
  ]);
3939
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_material17.Box, { sx: { p: 2, display: "flex", flexDirection: "column", height: "100%" }, children: [
3940
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_material17.DialogTitle, { sx: { px: 0, pt: 0, display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
3941
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_material17.Typography, { component: "div", variant: "h6", children: [
3975
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_material18.Box, { sx: { p: 2, display: "flex", flexDirection: "column", height: "100%" }, children: [
3976
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_material18.DialogTitle, { sx: { px: 0, pt: 0, display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
3977
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_material18.Typography, { component: "div", variant: "h6", children: [
3942
3978
  isNewRow ? "Nuevo Registro" : "Editar Registro",
3943
3979
  " - ",
3944
3980
  tableDefinition.title || tableName
3945
3981
  ] }),
3946
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material17.IconButton, { onClick: onClose, size: "small", edge: "end", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_Close.default, {}) })
3982
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_material18.IconButton, { onClick: onClose, size: "small", edge: "end", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_Close.default, {}) })
3947
3983
  ] }),
3948
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_material17.DialogContent, { dividers: true, sx: { px: 2, flexGrow: 1, py: 1 }, children: [
3949
- globalError && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material17.Alert, { severity: "error", sx: { mb: 2 }, children: globalError }),
3950
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material17.Box, { sx: { display: "flex", flexDirection: "column", gap: 0.5 }, children: tableDefinition.fields.map((field) => {
3984
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_material18.DialogContent, { dividers: true, sx: { px: 2, flexGrow: 1, py: 1 }, children: [
3985
+ globalError && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_material18.Alert, { severity: "error", sx: { mb: 2 }, children: globalError }),
3986
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_material18.Box, { sx: { display: "flex", flexDirection: "column", gap: 0.5 }, children: tableDefinition.fields.filter((field) => campoDibujable(field) && !columnasOcultas.has(field.name)).map((field) => {
3951
3987
  const isFixed = fixedFields?.some((ff) => ff.fieldName === field.name);
3952
3988
  const isMandatory = field.nullable === false || tableDefinition.primaryKey.includes(field.name);
3953
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material17.Box, { sx: { width: "100%", maxWidth: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
3989
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_material18.Box, { sx: { width: "100%", maxWidth: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
3954
3990
  TypedField,
3955
3991
  {
3956
3992
  fieldDef: field,
@@ -3964,12 +4000,12 @@ var VerticalEditorPage = ({
3964
4000
  ) }, field.name);
3965
4001
  }) })
3966
4002
  ] }),
3967
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_material17.DialogActions, { sx: { px: 0, pb: 0, pt: 2, justifyContent: "space-between", alignItems: "center" }, children: [
3968
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_material17.Box, { children: [
3969
- isSaving && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material17.CircularProgress, { size: 20, sx: { ml: 2 } }),
3970
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { style: { marginLeft: 10, fontSize: "0.8rem", color: "#666" }, children: isSaving ? "Guardando..." : "Cambios auto-guardados" })
4003
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_material18.DialogActions, { sx: { px: 0, pb: 0, pt: 2, justifyContent: "space-between", alignItems: "center" }, children: [
4004
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_material18.Box, { children: [
4005
+ isSaving && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_material18.CircularProgress, { size: 20, sx: { ml: 2 } }),
4006
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { style: { marginLeft: 10, fontSize: "0.8rem", color: "#666" }, children: isSaving ? "Guardando..." : "Cambios auto-guardados" })
3971
4007
  ] }),
3972
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material17.Button, { variant: "outlined", onClick: onClose, children: "Cerrar" })
4008
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_material18.Button, { variant: "outlined", onClick: onClose, children: "Cerrar" })
3973
4009
  ] })
3974
4010
  ] });
3975
4011
  };
@@ -4047,7 +4083,7 @@ var baseDelBundler = import_meta2.env?.BASE_URL ?? "/";
4047
4083
  var rutaBase = baseDelBundler.replace(/\/+$/, "");
4048
4084
 
4049
4085
  // src/components/grid/GenericDataGrid.tsx
4050
- var import_jsx_runtime22 = require("react/jsx-runtime");
4086
+ var import_jsx_runtime23 = require("react/jsx-runtime");
4051
4087
  var SUMMARY_ROW_HEIGHT = 35;
4052
4088
  var FILTER_ROW_HEIGHT = 35;
4053
4089
  var HEADER_ROW_HEIGHT = 30;
@@ -4066,7 +4102,7 @@ var esColumnaPropia = (columna) => "customType" in columna;
4066
4102
  var SIN_ANCESTROS = [];
4067
4103
  var cargasEnCurso = /* @__PURE__ */ new Map();
4068
4104
  var StaticAncestorGrid = ({ ancestor, index, fieldsToHide }) => {
4069
- const theme = (0, import_material18.useTheme)();
4105
+ const theme = (0, import_material19.useTheme)();
4070
4106
  const { tableDefinition, row } = ancestor;
4071
4107
  const columns = (0, import_react26.useMemo)(() => {
4072
4108
  const filteredFields = tableDefinition.fields.filter(
@@ -4079,8 +4115,8 @@ var StaticAncestorGrid = ({ ancestor, index, fieldsToHide }) => {
4079
4115
  name: field.label || cambiarGuionesBajosPorEspacios(field.name),
4080
4116
  width: 150,
4081
4117
  editable: false,
4082
- renderHeaderCell: () => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_material18.Box, { sx: { p: 0.5, height: "100%", display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
4083
- import_material18.Typography,
4118
+ renderHeaderCell: () => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_material19.Box, { sx: { p: 0.5, height: "100%", display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
4119
+ import_material19.Typography,
4084
4120
  {
4085
4121
  variant: "caption",
4086
4122
  sx: {
@@ -4091,11 +4127,11 @@ var StaticAncestorGrid = ({ ancestor, index, fieldsToHide }) => {
4091
4127
  children: field.label || cambiarGuionesBajosPorEspacios(field.name)
4092
4128
  }
4093
4129
  ) }),
4094
- renderCell: (props) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_material18.Box, { sx: { px: 1, height: "100%", display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_material18.Typography, { variant: "body2", sx: { fontSize: "0.875rem" }, noWrap: true, children: String(props.row[field.name] ?? "") }) })
4130
+ renderCell: (props) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_material19.Box, { sx: { px: 1, height: "100%", display: "flex", alignItems: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_material19.Typography, { variant: "body2", sx: { fontSize: "0.875rem" }, noWrap: true, children: String(props.row[field.name] ?? "") }) })
4095
4131
  };
4096
4132
  });
4097
4133
  }, [tableDefinition, fieldsToHide]);
4098
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_material18.Box, { sx: {
4134
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_material19.Box, { sx: {
4099
4135
  mb: 1.5,
4100
4136
  ml: index * 4,
4101
4137
  // El primer ancestro (index 0) no tiene margen, los siguientes sí
@@ -4106,7 +4142,7 @@ var StaticAncestorGrid = ({ ancestor, index, fieldsToHide }) => {
4106
4142
  boxShadow: theme.shadows[1],
4107
4143
  bgcolor: "background.paper"
4108
4144
  }, children: [
4109
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_material18.Box, { sx: {
4145
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_material19.Box, { sx: {
4110
4146
  bgcolor: "primary.main",
4111
4147
  color: "primary.contrastText",
4112
4148
  px: 1.5,
@@ -4117,8 +4153,8 @@ var StaticAncestorGrid = ({ ancestor, index, fieldsToHide }) => {
4117
4153
  alignItems: "center",
4118
4154
  fontWeight: "bold",
4119
4155
  gap: 1
4120
- }, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_material18.Typography, { variant: "subtitle2", component: "div", children: cambiarGuionesBajosPorEspacios(ancestor.tableName) }) }),
4121
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
4156
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_material19.Typography, { variant: "subtitle2", component: "div", children: cambiarGuionesBajosPorEspacios(ancestor.tableName) }) }),
4157
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
4122
4158
  import_react_data_grid.DataGrid,
4123
4159
  {
4124
4160
  className: "rdg-light",
@@ -4168,13 +4204,19 @@ var GenericDataGrid = ({
4168
4204
  const [cargandoInicial, setCargandoInicial] = (0, import_react26.useState)(!guardada);
4169
4205
  const [errorDeCarga, setErrorDeCarga] = (0, import_react26.useState)(null);
4170
4206
  const [anchosCalculados, setAnchosCalculados] = (0, import_react26.useState)(() => guardada?.anchosCalculados ?? /* @__PURE__ */ new Map());
4207
+ const [columnasOcultas, setColumnasOcultas] = (0, import_react26.useState)(() => guardada?.columnasOcultas ?? []);
4208
+ const [openDialogoDeColumnas, setOpenDialogoDeColumnas] = (0, import_react26.useState)(false);
4209
+ const conjuntoDeOcultas = (0, import_react26.useMemo)(() => new Set(columnasOcultas), [columnasOcultas]);
4210
+ const ocultarColumna = (0, import_react26.useCallback)((columna) => setColumnasOcultas((anteriores) => anteriores.includes(columna) ? anteriores : [...anteriores, columna]), []);
4211
+ const alternarColumna = (0, import_react26.useCallback)((columna) => setColumnasOcultas((anteriores) => anteriores.includes(columna) ? anteriores.filter((oculta) => oculta !== columna) : [...anteriores, columna]), []);
4212
+ const abrirDialogoDeColumnas = (0, import_react26.useCallback)(() => setOpenDialogoDeColumnas(true), []);
4171
4213
  const [detallesAbiertos, setDetallesAbiertos] = (0, import_react26.useState)(guardada?.detallesAbiertos ?? []);
4172
4214
  const [altosDetalle, setAltosDetalle] = (0, import_react26.useState)(() => guardada?.altosDetalle ?? /* @__PURE__ */ new Map());
4173
4215
  const [anchosDetalle, setAnchosDetalle] = (0, import_react26.useState)(() => /* @__PURE__ */ new Map());
4174
4216
  const [selectedRows, setSelectedRows] = (0, import_react26.useState)(() => /* @__PURE__ */ new Set());
4175
4217
  const [, setSelectedCell] = (0, import_react26.useState)(void 0);
4176
4218
  const [estadoGrilla] = (0, import_react26.useState)(crearEstadoGrilla);
4177
- const theme = (0, import_material18.useTheme)();
4219
+ const theme = (0, import_material19.useTheme)();
4178
4220
  const [openDataGridOptions, setOpenDataGridOptions] = (0, import_react26.useState)(false);
4179
4221
  const [dataGridOptionsAnchorEl, setDataGridOptionsAnchorEl] = (0, import_react26.useState)(null);
4180
4222
  const [exitingRowIds, setExitingRowIds] = (0, import_react26.useState)(/* @__PURE__ */ new Set());
@@ -4362,6 +4404,7 @@ var GenericDataGrid = ({
4362
4404
  setTableDefinition(definition);
4363
4405
  setSortColumns(getInitialSortColumns(definition));
4364
4406
  setAnchosCalculados(calcularAnchosDeColumnas(definition, data));
4407
+ setColumnasOcultas(columnasOcultasIniciales(definition));
4365
4408
  setTableData(data);
4366
4409
  const filasDeFiltros = parametros.filterColumns ?? aFiltrosIniciales(definition.filterColumns);
4367
4410
  if (filasDeFiltros.length > 1) console.warn(`'${tableName}': varias filas de filtros (alternativas) todav\xEDa no est\xE1n soportadas; se aplica la primera`);
@@ -4384,8 +4427,8 @@ var GenericDataGrid = ({
4384
4427
  }, [tableName, claveFixedFields, fixedFields, claveParametros, parametros, showError, callApi, getInitialSortColumns, setSortColumns, aplicarFiltrosIniciales, guardada]);
4385
4428
  (0, import_react26.useEffect)(() => {
4386
4429
  if (!claveCache || !tableDefinition || cargandoInicial) return;
4387
- cache.set(claveCache, { tableDefinition, tableData, anchosCalculados, sortColumns, detallesAbiertos, altosDetalle });
4388
- }, [cache, claveCache, tableDefinition, tableData, anchosCalculados, sortColumns, detallesAbiertos, altosDetalle, cargandoInicial]);
4430
+ cache.set(claveCache, { tableDefinition, tableData, anchosCalculados, columnasOcultas, sortColumns, detallesAbiertos, altosDetalle });
4431
+ }, [cache, claveCache, tableDefinition, tableData, anchosCalculados, columnasOcultas, sortColumns, detallesAbiertos, altosDetalle, cargandoInicial]);
4389
4432
  (0, import_react26.useEffect)(() => {
4390
4433
  let timer = null;
4391
4434
  const desuscribir = estadoGrilla.suscribir(() => {
@@ -4424,7 +4467,8 @@ var GenericDataGrid = ({
4424
4467
  callApi,
4425
4468
  resetSorting: tableDefinition ? resetSortingDeLaTabla : void 0,
4426
4469
  triggerImport: abrirImportacion,
4427
- triggerExport: abrirExportacion
4470
+ triggerExport: abrirExportacion,
4471
+ abrirColumnas: abrirDialogoDeColumnas
4428
4472
  });
4429
4473
  const abrirOpcionesDeGrilla = (0, import_react26.useCallback)((anchorEl) => {
4430
4474
  setDataGridOptionsAnchorEl(anchorEl);
@@ -4438,6 +4482,8 @@ var GenericDataGrid = ({
4438
4482
  tableDefinition,
4439
4483
  anchosCalculados,
4440
4484
  fixedFields,
4485
+ columnasOcultas: conjuntoDeOcultas,
4486
+ ocultarColumna,
4441
4487
  primaryKey,
4442
4488
  setTableData,
4443
4489
  handleKeyPressInEditor,
@@ -4511,13 +4557,13 @@ var GenericDataGrid = ({
4511
4557
  }, [altoMaximoDetalleEfectivo]);
4512
4558
  const renderDetalle = (0, import_react26.useCallback)((fila) => {
4513
4559
  const { detailTable } = fila;
4514
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
4560
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
4515
4561
  "div",
4516
4562
  {
4517
4563
  className: "fpr-detalle",
4518
4564
  style: { maxWidth: anchoVisible ? anchoVisible - 2 : void 0 },
4519
4565
  onKeyDown: (e) => e.stopPropagation(),
4520
- children: detailTable.table ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
4566
+ children: detailTable.table ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
4521
4567
  GenericDataGrid,
4522
4568
  {
4523
4569
  tableName: detailTable.table,
@@ -4530,7 +4576,7 @@ var GenericDataGrid = ({
4530
4576
  onOpenDetail,
4531
4577
  ancestors: tableDefinition ? [...ancestors, { tableName: tableDefinition.name, row: fila.filaPadre, tableDefinition, fixedFields: fila.fixedFields }] : ancestors
4532
4578
  }
4533
- ) : detailTable.wScreen ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
4579
+ ) : detailTable.wScreen ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
4534
4580
  DetalleWScreen,
4535
4581
  {
4536
4582
  fila,
@@ -4538,7 +4584,7 @@ var GenericDataGrid = ({
4538
4584
  onAlto: (alto) => cambiarAltoDetalle(fila.clave, alto),
4539
4585
  onAncho: (ancho) => cambiarAnchoDetalle(fila.clave, ancho)
4540
4586
  }
4541
- ) : /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_material18.Alert, { severity: "warning", children: [
4587
+ ) : /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_material19.Alert, { severity: "warning", children: [
4542
4588
  "El detalle '",
4543
4589
  detailTable.abr,
4544
4590
  "' no tiene ni tabla ni wScreen."
@@ -4584,19 +4630,19 @@ var GenericDataGrid = ({
4584
4630
  };
4585
4631
  const fallBackMessage = getFallBackMessage();
4586
4632
  if (cargandoInicial) {
4587
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_material18.Box, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: [
4588
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_material18.CircularProgress, {}),
4589
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_material18.Typography, { variant: "h6", sx: { ml: 2 }, children: "Cargando tabla..." })
4633
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_material19.Box, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: [
4634
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_material19.CircularProgress, {}),
4635
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_material19.Typography, { variant: "h6", sx: { ml: 2 }, children: "Cargando tabla..." })
4590
4636
  ] });
4591
4637
  }
4592
4638
  if (errorDeCarga) {
4593
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_material18.Box, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_material18.Alert, { severity: "error", children: errorDeCarga }) });
4639
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_material19.Box, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_material19.Alert, { severity: "error", children: errorDeCarga }) });
4594
4640
  }
4595
4641
  if (!tableDefinition) {
4596
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_material18.Box, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_material18.Alert, { severity: "warning", children: "No se pudo cargar la definici\xF3n de la tabla." }) });
4642
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_material19.Box, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_material19.Alert, { severity: "warning", children: "No se pudo cargar la definici\xF3n de la tabla." }) });
4597
4643
  }
4598
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CacheGrillasContext.Provider, { value: cache, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_material18.Box, { sx: { pt: anidada ? 0 : 2, display: "flex", flexDirection: "column", height: "100%", boxSizing: "border-box", width: anchoContenido ?? void 0, maxWidth: "100%" }, children: [
4599
- !anidada && ancestors.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_material18.Box, { sx: { px: 2, pt: 0, pb: 1, display: "flex", flexDirection: "column" }, children: ancestors.map((ancestor, index) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
4644
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CacheGrillasContext.Provider, { value: cache, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_material19.Box, { sx: { pt: anidada ? 0 : 2, display: "flex", flexDirection: "column", height: "100%", boxSizing: "border-box", width: anchoContenido ?? void 0, maxWidth: "100%" }, children: [
4645
+ !anidada && ancestors.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_material19.Box, { sx: { px: 2, pt: 0, pb: 1, display: "flex", flexDirection: "column" }, children: ancestors.map((ancestor, index) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
4600
4646
  StaticAncestorGrid,
4601
4647
  {
4602
4648
  ancestor,
@@ -4605,8 +4651,8 @@ var GenericDataGrid = ({
4605
4651
  },
4606
4652
  index
4607
4653
  )) }),
4608
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
4609
- import_material18.Box,
4654
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
4655
+ import_material19.Box,
4610
4656
  {
4611
4657
  sx: {
4612
4658
  backgroundColor: theme.palette.primary.main,
@@ -4628,17 +4674,17 @@ var GenericDataGrid = ({
4628
4674
  gap: 1
4629
4675
  },
4630
4676
  children: [
4631
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_material18.Typography, { variant: "subtitle2", component: "div", children: [
4677
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_material19.Typography, { variant: "subtitle2", component: "div", children: [
4632
4678
  titulo ?? cambiarGuionesBajosPorEspacios(tableDefinition.title || tableDefinition.name),
4633
4679
  " - ",
4634
4680
  filteredRows.length === tableData.length ? `${tableData.length} registros` : `${filteredRows.length} (F)`
4635
4681
  ] }),
4636
- loading && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_material18.CircularProgress, { size: 14, color: "inherit" })
4682
+ loading && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_material19.CircularProgress, { size: 14, color: "inherit" })
4637
4683
  ]
4638
4684
  }
4639
4685
  ),
4640
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
4641
- import_material18.Box,
4686
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
4687
+ import_material19.Box,
4642
4688
  {
4643
4689
  sx: {
4644
4690
  // Una grilla anidada se acota con px (el alto que le dio la de arriba, o el de una wScreen): una wScreen
@@ -4656,7 +4702,7 @@ var GenericDataGrid = ({
4656
4702
  pb: anidada ? 0 : 3
4657
4703
  },
4658
4704
  children: [
4659
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(EstadoGrillaContext.Provider, { value: estadoGrilla, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(VistaGrillaContext.Provider, { value: vistaGrilla, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DetallesGrillaContext.Provider, { value: detallesGrilla, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
4705
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(EstadoGrillaContext.Provider, { value: estadoGrilla, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(VistaGrillaContext.Provider, { value: vistaGrilla, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DetallesGrillaContext.Provider, { value: detallesGrilla, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
4660
4706
  import_react_data_grid.DataGrid,
4661
4707
  {
4662
4708
  className: "rdg-light",
@@ -4686,8 +4732,8 @@ var GenericDataGrid = ({
4686
4732
  onCellKeyDown: handleCellKeyDown
4687
4733
  }
4688
4734
  ) }) }) }),
4689
- fallBackMessage && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
4690
- import_material18.Box,
4735
+ fallBackMessage && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
4736
+ import_material19.Box,
4691
4737
  {
4692
4738
  sx: {
4693
4739
  position: "absolute",
@@ -4703,24 +4749,35 @@ var GenericDataGrid = ({
4703
4749
  zIndex: tableData.length === 0 ? 10 : 1
4704
4750
  // Mantenemos el zIndex superior para el estado vacío total
4705
4751
  },
4706
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_material18.Typography, { variant: "body2", color: "textSecondary", children: fallBackMessage })
4752
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_material19.Typography, { variant: "body2", color: "textSecondary", children: fallBackMessage })
4707
4753
  }
4708
4754
  )
4709
4755
  ]
4710
4756
  }
4711
4757
  ),
4712
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
4758
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
4713
4759
  ExportDialog,
4714
4760
  {
4715
4761
  open: openExportDialog,
4716
4762
  onClose: () => setOpenExportDialog(false),
4717
4763
  tableDefinition,
4764
+ columnasOcultas: conjuntoDeOcultas,
4718
4765
  tableData,
4719
4766
  filteredRows,
4720
4767
  username: usuario || "anonymous"
4721
4768
  }
4722
4769
  ),
4723
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
4770
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
4771
+ DialogoDeColumnas,
4772
+ {
4773
+ open: openDialogoDeColumnas,
4774
+ onClose: () => setOpenDialogoDeColumnas(false),
4775
+ columnas: (tableDefinition?.fields ?? []).filter(campoDibujable).map((field) => field.name).filter((nombre) => !columnaOcultaPorFixedField(fixedFields, nombre)),
4776
+ ocultas: conjuntoDeOcultas,
4777
+ alternarColumna
4778
+ }
4779
+ ),
4780
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
4724
4781
  ConfirmDialog,
4725
4782
  {
4726
4783
  open: openConfirmDialog,
@@ -4729,7 +4786,7 @@ var GenericDataGrid = ({
4729
4786
  message: rowToDelete && rowToDelete[NEW_ROW_INDICATOR] ? `\xBFEst\xE1s seguro de que quieres eliminar esta nueva fila (ID: ${getPrimaryKeyValues(rowToDelete, primaryKey)}) localmente?` : rowToDelete ? `\xBFEst\xE1s seguro de que quieres eliminar la fila con ID: ${getPrimaryKeyValues(rowToDelete, primaryKey)} de la base de datos? Esta acci\xF3n es irreversible.` : "\xBFEst\xE1s seguro de que quieres eliminar este registro? Esta acci\xF3n es irreversible."
4730
4787
  }
4731
4788
  ),
4732
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
4789
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
4733
4790
  DataGridOptionsDialog,
4734
4791
  {
4735
4792
  open: openDataGridOptions,
@@ -4738,7 +4795,7 @@ var GenericDataGrid = ({
4738
4795
  anchorEl: dataGridOptionsAnchorEl
4739
4796
  }
4740
4797
  ),
4741
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
4798
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
4742
4799
  ImportDialog,
4743
4800
  {
4744
4801
  open: openImportDialog,
@@ -4747,20 +4804,21 @@ var GenericDataGrid = ({
4747
4804
  loading
4748
4805
  }
4749
4806
  ),
4750
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
4751
- import_material18.Dialog,
4807
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
4808
+ import_material19.Dialog,
4752
4809
  {
4753
4810
  open: openVerticalEditDialog,
4754
4811
  onClose: () => setOpenVerticalEditDialog(false),
4755
4812
  maxWidth: "sm",
4756
4813
  fullWidth: true,
4757
- children: rowToEditVertical && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
4814
+ children: rowToEditVertical && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
4758
4815
  VerticalEditorPage,
4759
4816
  {
4760
4817
  tableName,
4761
4818
  tableDefinition,
4762
4819
  initialData: rowToEditVertical,
4763
4820
  fixedFields,
4821
+ columnasOcultas: conjuntoDeOcultas,
4764
4822
  isNewRow: !!rowToEditVertical[NEW_ROW_INDICATOR],
4765
4823
  onSaveSuccess: (savedRow, isNewItem) => {
4766
4824
  setRowToEditVertical(savedRow);
@@ -4799,7 +4857,7 @@ var GenericDataGrid = ({
4799
4857
  )
4800
4858
  }
4801
4859
  ),
4802
- contenidoDeCelda && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(VentanaDeTexto, { anclaje: contenidoDeCelda.anclaje, texto: contenidoDeCelda.texto, editable: false, onAceptar: cerrarContenidoDeCelda, onCerrar: cerrarContenidoDeCelda })
4860
+ contenidoDeCelda && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(VentanaDeTexto, { anclaje: contenidoDeCelda.anclaje, texto: contenidoDeCelda.texto, editable: false, onAceptar: cerrarContenidoDeCelda, onCerrar: cerrarContenidoDeCelda })
4803
4861
  ] }) });
4804
4862
  };
4805
4863
  var GenericDataGrid_default = GenericDataGrid;
@@ -4811,13 +4869,13 @@ var import_react_router_dom15 = require("react-router-dom");
4811
4869
  // src/components/MainLayout.tsx
4812
4870
  var import_react30 = require("react");
4813
4871
  var import_react_router_dom4 = require("react-router-dom");
4814
- var import_material20 = require("@mui/material");
4872
+ var import_material21 = require("@mui/material");
4815
4873
 
4816
4874
  // src/contexts/AppContext.tsx
4817
4875
  var import_react27 = require("react");
4818
4876
  var import_react_router_dom = require("react-router-dom");
4819
4877
  var import_react_redux2 = require("react-redux");
4820
- var import_jsx_runtime23 = require("react/jsx-runtime");
4878
+ var import_jsx_runtime24 = require("react/jsx-runtime");
4821
4879
  var AuthContext = (0, import_react27.createContext)(void 0);
4822
4880
  var useApp = () => {
4823
4881
  const context = (0, import_react27.useContext)(AuthContext);
@@ -4911,7 +4969,7 @@ var AppProvider = ({ children, publicPaths = [] }) => {
4911
4969
  setShowSessionExpiredMessage,
4912
4970
  handleExpiredSessionRedirect
4913
4971
  ]);
4914
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(AuthContext.Provider, { value: authContextValue, children });
4972
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(AuthContext.Provider, { value: authContextValue, children });
4915
4973
  };
4916
4974
 
4917
4975
  // src/components/MainLayout.tsx
@@ -4921,7 +4979,7 @@ var import_ChevronLeft = __toESM(require("@mui/icons-material/ChevronLeft"), 1);
4921
4979
 
4922
4980
  // src/components/SideMenu.tsx
4923
4981
  var import_react28 = __toESM(require("react"), 1);
4924
- var import_material19 = require("@mui/material");
4982
+ var import_material20 = require("@mui/material");
4925
4983
  var import_ExpandLess = __toESM(require("@mui/icons-material/ExpandLess"), 1);
4926
4984
  var import_ExpandMore = __toESM(require("@mui/icons-material/ExpandMore"), 1);
4927
4985
  var import_TableChart = __toESM(require("@mui/icons-material/TableChart"), 1);
@@ -4935,12 +4993,43 @@ var import_react_router_dom2 = require("react-router-dom");
4935
4993
  var import_colors = require("@mui/material/colors");
4936
4994
 
4937
4995
  // src/utils/menuInicial.ts
4938
- function rutaDeItemDeMenu(item) {
4996
+ function rutaDeTablaDeMenu(camino) {
4997
+ return `/menu/${camino.map(encodeURIComponent).join("/")}`;
4998
+ }
4999
+ function gruposDeItem(menu, item) {
5000
+ for (const candidato of menu) {
5001
+ if (candidato === item) return [];
5002
+ if (candidato.menuType === "menu") {
5003
+ const grupos = gruposDeItem(candidato.menuContent, item);
5004
+ if (grupos) return [candidato.name, ...grupos];
5005
+ }
5006
+ }
5007
+ return void 0;
5008
+ }
5009
+ function itemDeCamino(menu, camino) {
5010
+ const [nombre, ...resto] = camino;
5011
+ const item = menu.find((candidato) => candidato.name === nombre && candidato.menuType === (resto.length ? "menu" : "table"));
5012
+ return item && resto.length ? itemDeCamino(item.menuContent, resto) : item;
5013
+ }
5014
+ function primeraTablaConNombre(menu, nombre) {
5015
+ for (const item of menu) {
5016
+ if (item.menuType === "table" && item.name === nombre) return item;
5017
+ const encontrado = item.menuType === "menu" ? primeraTablaConNombre(item.menuContent, nombre) : void 0;
5018
+ if (encontrado) return encontrado;
5019
+ }
5020
+ return void 0;
5021
+ }
5022
+ function itemDeRuta(menu, camino) {
5023
+ if (camino.length === 0) return void 0;
5024
+ const item = itemDeCamino(menu, camino) ?? primeraTablaConNombre(menu, camino[camino.length - 1]);
5025
+ return item;
5026
+ }
5027
+ function rutaDeItemDeMenu(item, grupos = []) {
4939
5028
  if (item.menuType === "table") {
4940
5029
  const consulta = new URLSearchParams();
4941
5030
  if (item.td) consulta.append("td", JSON.stringify(item.td));
4942
5031
  if (item.fc) consulta.append("fc", JSON.stringify(item.fc));
4943
- return `/menu/${item.name}${consulta.size ? `?${consulta.toString()}` : ""}`;
5032
+ return `${rutaDeTablaDeMenu([...grupos, item.name])}${consulta.size ? `?${consulta.toString()}` : ""}`;
4944
5033
  }
4945
5034
  if (item.menuType === "proc") return `/procedures/${item.name}`;
4946
5035
  if (wScreens[item.menuType] !== void 0) return `/wScreens/${item.menuType}`;
@@ -4954,8 +5043,8 @@ function itemInicial(menu) {
4954
5043
  }
4955
5044
 
4956
5045
  // src/components/SideMenu.tsx
4957
- var import_jsx_runtime24 = require("react/jsx-runtime");
4958
- var MenuListItem = ({ item, level, onMenuItemClick }) => {
5046
+ var import_jsx_runtime25 = require("react/jsx-runtime");
5047
+ var MenuListItem = ({ item, level, grupos = [], onMenuItemClick }) => {
4959
5048
  const navigate = (0, import_react_router_dom2.useNavigate)();
4960
5049
  const location = (0, import_react_router_dom2.useLocation)();
4961
5050
  const open = useSubMenuOpenState(item.name);
@@ -4964,7 +5053,7 @@ var MenuListItem = ({ item, level, onMenuItemClick }) => {
4964
5053
  if (item.menuType === "menu") {
4965
5054
  dispatch(toggleSubMenu(item.name));
4966
5055
  } else {
4967
- navigate(rutaDeItemDeMenu(item));
5056
+ navigate(rutaDeItemDeMenu(item, grupos));
4968
5057
  if (onMenuItemClick) {
4969
5058
  onMenuItemClick();
4970
5059
  }
@@ -4973,17 +5062,17 @@ var MenuListItem = ({ item, level, onMenuItemClick }) => {
4973
5062
  const getIcon = (item2) => {
4974
5063
  switch (item2.menuType) {
4975
5064
  case "table":
4976
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_TableChart.default, { sx: { color: import_colors.blue[700] } });
5065
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_TableChart.default, { sx: { color: import_colors.blue[700] } });
4977
5066
  case "proc":
4978
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_Dns.default, { sx: { color: import_colors.teal[700] } });
5067
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_Dns.default, { sx: { color: import_colors.teal[700] } });
4979
5068
  case "menu":
4980
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_Folder.default, { sx: { color: import_colors.orange[800] } });
5069
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_Folder.default, { sx: { color: import_colors.orange[800] } });
4981
5070
  default:
4982
5071
  const WScreenComponent = wScreens[item2.menuType];
4983
5072
  if (WScreenComponent !== void 0) {
4984
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_DesktopWindows.default, { sx: { color: import_colors.grey[700] } });
5073
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_DesktopWindows.default, { sx: { color: import_colors.grey[700] } });
4985
5074
  }
4986
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_WarningAmber3.default, { sx: { color: import_colors.red[500] } });
5075
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_WarningAmber3.default, { sx: { color: import_colors.red[500] } });
4987
5076
  }
4988
5077
  };
4989
5078
  const currentPath = location.pathname;
@@ -4991,7 +5080,7 @@ var MenuListItem = ({ item, level, onMenuItemClick }) => {
4991
5080
  const pathParts = currentPath.split("/");
4992
5081
  const urlTableName = pathParts[1] === "table" ? pathParts[2] : null;
4993
5082
  if (item.menuType === "table") {
4994
- isSelected = currentPath === `/menu/${item.name}` || urlTableName === (item.table || item.name);
5083
+ isSelected = currentPath === rutaDeTablaDeMenu([...grupos, item.name]) || urlTableName === (item.table || item.name);
4995
5084
  } else if (item.menuType === "proc") {
4996
5085
  isSelected = currentPath === `/procedures/${item.name}`;
4997
5086
  } else if (item.menuType !== "menu") {
@@ -5003,25 +5092,26 @@ var MenuListItem = ({ item, level, onMenuItemClick }) => {
5003
5092
  itemRef.current.scrollIntoView({ behavior: "smooth", block: "nearest" });
5004
5093
  }
5005
5094
  }, [isSelected]);
5006
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { ref: itemRef, children: [
5007
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
5008
- import_material19.ListItemButton,
5095
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { ref: itemRef, children: [
5096
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
5097
+ import_material20.ListItemButton,
5009
5098
  {
5010
5099
  onClick: handleClick,
5011
5100
  sx: { pl: level * 2 },
5012
5101
  selected: isSelected,
5013
5102
  children: [
5014
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_material19.ListItemIcon, { sx: { minWidth: "38px" }, children: getIcon(item) }),
5015
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_material19.ListItemText, { primary: item.label || item.name }),
5016
- item.menuType === "menu" ? open ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_ExpandLess.default, {}) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_ExpandMore.default, {}) : null
5103
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material20.ListItemIcon, { sx: { minWidth: "38px" }, children: getIcon(item) }),
5104
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material20.ListItemText, { primary: item.label || item.name }),
5105
+ item.menuType === "menu" ? open ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_ExpandLess.default, {}) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_ExpandMore.default, {}) : null
5017
5106
  ]
5018
5107
  }
5019
5108
  ),
5020
- item.menuType === "menu" && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_material19.Collapse, { in: open, timeout: "auto", unmountOnExit: true, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_material19.List, { component: "div", disablePadding: true, children: item.menuContent.map((subItem) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
5109
+ item.menuType === "menu" && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material20.Collapse, { in: open, timeout: "auto", unmountOnExit: true, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material20.List, { component: "div", disablePadding: true, children: item.menuContent.map((subItem) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
5021
5110
  MenuListItem,
5022
5111
  {
5023
5112
  item: subItem,
5024
5113
  level: level + 1,
5114
+ grupos: [...grupos, item.name],
5025
5115
  onMenuItemClick
5026
5116
  },
5027
5117
  subItem.name
@@ -5041,7 +5131,7 @@ var SideMenu = ({ onMenuItemClick }) => {
5041
5131
  dispatch(setAllSubMenusOpen(!isMostlyOpen));
5042
5132
  };
5043
5133
  if (!clientContext || !clientContext.menu) {
5044
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_material19.Box, { sx: { p: 2, textAlign: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_material19.Typography, { variant: "body2", color: "text.secondary", children: "Cargando men\xFA..." }) });
5134
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material20.Box, { sx: { p: 2, textAlign: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material20.Typography, { variant: "body2", color: "text.secondary", children: "Cargando men\xFA..." }) });
5045
5135
  }
5046
5136
  (0, import_react28.useEffect)(() => {
5047
5137
  if (!clientContext?.menu) return;
@@ -5051,7 +5141,7 @@ var SideMenu = ({ onMenuItemClick }) => {
5051
5141
  for (const item of items) {
5052
5142
  let matches = false;
5053
5143
  if (item.menuType === "table") {
5054
- matches = targetPath === `/menu/${item.name}` || urlTableName === (item.table || item.name);
5144
+ matches = targetPath === rutaDeTablaDeMenu([...parentNames, item.name]) || urlTableName === (item.table || item.name);
5055
5145
  } else if (item.menuType === "proc") {
5056
5146
  matches = targetPath === `/procedures/${item.name}`;
5057
5147
  } else if (item.menuType !== "menu") {
@@ -5072,13 +5162,13 @@ var SideMenu = ({ onMenuItemClick }) => {
5072
5162
  };
5073
5163
  expandParents(clientContext.menu, location.pathname);
5074
5164
  }, [location.pathname, clientContext, dispatch]);
5075
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_material19.Box, { sx: { width: "100%", flexShrink: 0 }, children: [
5076
- clientContext.menu.some((item) => item.menuType === "menu") && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_material19.ListItem, { disablePadding: true, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_material19.ListItemButton, { onClick: handleToggleAllSubMenus, children: [
5077
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_material19.ListItemIcon, { sx: { minWidth: "38px" }, children: isMostlyOpen ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_UnfoldLess.default, {}) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_UnfoldMore.default, {}) }),
5078
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_material19.ListItemText, { primary: isMostlyOpen ? "colapsar " : "expandir" })
5165
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_material20.Box, { sx: { width: "100%", flexShrink: 0 }, children: [
5166
+ clientContext.menu.some((item) => item.menuType === "menu") && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material20.ListItem, { disablePadding: true, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_material20.ListItemButton, { onClick: handleToggleAllSubMenus, children: [
5167
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material20.ListItemIcon, { sx: { minWidth: "38px" }, children: isMostlyOpen ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_UnfoldLess.default, {}) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_UnfoldMore.default, {}) }),
5168
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material20.ListItemText, { primary: isMostlyOpen ? "colapsar " : "expandir" })
5079
5169
  ] }) }),
5080
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_material19.Divider, {}),
5081
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_material19.List, { children: clientContext.menu.map((menuItem) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
5170
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material20.Divider, {}),
5171
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material20.List, { children: clientContext.menu.map((menuItem) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
5082
5172
  MenuListItem,
5083
5173
  {
5084
5174
  item: menuItem,
@@ -5120,15 +5210,15 @@ var useLogout = () => {
5120
5210
  var useLogout_default = useLogout;
5121
5211
 
5122
5212
  // src/components/MainLayout.tsx
5123
- var import_jsx_runtime25 = require("react/jsx-runtime");
5213
+ var import_jsx_runtime26 = require("react/jsx-runtime");
5124
5214
  var drawerWidth = 240;
5125
5215
  var MainLayout = () => {
5126
5216
  const { clientContext } = useApp();
5127
5217
  const logout = useLogout_default();
5128
5218
  const isDrawerOpen = useIsDrawerOpen();
5129
5219
  const dispatch = useAppDispatch();
5130
- const theme = (0, import_material20.useTheme)();
5131
- const isMobile = (0, import_material20.useMediaQuery)(theme.breakpoints.down("sm"));
5220
+ const theme = (0, import_material21.useTheme)();
5221
+ const isMobile = (0, import_material21.useMediaQuery)(theme.breakpoints.down("sm"));
5132
5222
  (0, import_react30.useEffect)(() => {
5133
5223
  if (isMobile && isDrawerOpen) {
5134
5224
  dispatch(setDrawerOpen(false));
@@ -5143,12 +5233,12 @@ var MainLayout = () => {
5143
5233
  }
5144
5234
  };
5145
5235
  if (!clientContext) {
5146
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material20.Box, { sx: { display: "flex", justifyContent: "center", alignItems: "center", height: "100vh" }, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material20.Typography, { children: "Cargando dise\xF1o de la aplicaci\xF3n..." }) });
5236
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.Box, { sx: { display: "flex", justifyContent: "center", alignItems: "center", height: "100vh" }, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.Typography, { children: "Cargando dise\xF1o de la aplicaci\xF3n..." }) });
5147
5237
  }
5148
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_material20.Box, { sx: { display: "flex", height: "100vh" }, children: [
5149
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material20.CssBaseline, {}),
5150
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
5151
- import_material20.AppBar,
5238
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_material21.Box, { sx: { display: "flex", height: "100vh" }, children: [
5239
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.CssBaseline, {}),
5240
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
5241
+ import_material21.AppBar,
5152
5242
  {
5153
5243
  position: "fixed",
5154
5244
  sx: {
@@ -5166,9 +5256,9 @@ var MainLayout = () => {
5166
5256
  })
5167
5257
  }
5168
5258
  },
5169
- children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_material20.Toolbar, { children: [
5170
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
5171
- import_material20.IconButton,
5259
+ children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_material21.Toolbar, { children: [
5260
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
5261
+ import_material21.IconButton,
5172
5262
  {
5173
5263
  color: "inherit",
5174
5264
  "aria-label": "open drawer",
@@ -5177,10 +5267,10 @@ var MainLayout = () => {
5177
5267
  sx: {
5178
5268
  marginRight: 2
5179
5269
  },
5180
- children: isDrawerOpen ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_ChevronLeft.default, {}) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_Menu.default, {})
5270
+ children: isDrawerOpen ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_ChevronLeft.default, {}) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_Menu.default, {})
5181
5271
  }
5182
5272
  ),
5183
- !isDrawerOpen && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
5273
+ !isDrawerOpen && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
5184
5274
  "img",
5185
5275
  {
5186
5276
  src: `${envConfig.backendUrl}/img/logo-128.png`,
@@ -5188,22 +5278,22 @@ var MainLayout = () => {
5188
5278
  style: { height: "32px", marginRight: "12px", objectFit: "contain" }
5189
5279
  }
5190
5280
  ),
5191
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material20.Typography, { variant: "h6", noWrap: true, component: "div", sx: { flexGrow: 1 }, children: isDrawerOpen ? "" : clientContext.config.title }),
5192
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material20.Typography, { variant: "subtitle1", component: "div", sx: { mr: 2 }, children: clientContext.username }),
5193
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
5194
- import_material20.Button,
5281
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.Typography, { variant: "h6", noWrap: true, component: "div", sx: { flexGrow: 1 }, children: isDrawerOpen ? "" : clientContext.config.title }),
5282
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.Typography, { variant: "subtitle1", component: "div", sx: { mr: 2 }, children: clientContext.username }),
5283
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
5284
+ import_material21.Button,
5195
5285
  {
5196
5286
  color: "inherit",
5197
5287
  onClick: logout,
5198
- startIcon: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_Logout.default, {}),
5288
+ startIcon: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_Logout.default, {}),
5199
5289
  children: "Salir"
5200
5290
  }
5201
5291
  )
5202
5292
  ] })
5203
5293
  }
5204
5294
  ),
5205
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
5206
- import_material20.Drawer,
5295
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
5296
+ import_material21.Drawer,
5207
5297
  {
5208
5298
  variant: "persistent",
5209
5299
  anchor: "left",
@@ -5219,8 +5309,8 @@ var MainLayout = () => {
5219
5309
  }
5220
5310
  },
5221
5311
  children: [
5222
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
5223
- import_material20.Toolbar,
5312
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
5313
+ import_material21.Toolbar,
5224
5314
  {
5225
5315
  sx: {
5226
5316
  display: "flex",
@@ -5232,7 +5322,7 @@ var MainLayout = () => {
5232
5322
  gap: 1.5
5233
5323
  },
5234
5324
  children: [
5235
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
5325
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
5236
5326
  "img",
5237
5327
  {
5238
5328
  src: `${envConfig.backendUrl}/img/logo-128.png`,
@@ -5240,16 +5330,16 @@ var MainLayout = () => {
5240
5330
  style: { height: "32px", objectFit: "contain" }
5241
5331
  }
5242
5332
  ),
5243
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material20.Typography, { variant: "h6", sx: { fontWeight: "bold" }, children: clientContext.config.title })
5333
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.Typography, { variant: "h6", sx: { fontWeight: "bold" }, children: clientContext.config.title })
5244
5334
  ]
5245
5335
  }
5246
5336
  ),
5247
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SideMenu_default, { onMenuItemClick: handleDrawerCloseMobile })
5337
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SideMenu_default, { onMenuItemClick: handleDrawerCloseMobile })
5248
5338
  ]
5249
5339
  }
5250
5340
  ),
5251
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
5252
- import_material20.Box,
5341
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
5342
+ import_material21.Box,
5253
5343
  {
5254
5344
  component: "main",
5255
5345
  sx: {
@@ -5275,8 +5365,8 @@ var MainLayout = () => {
5275
5365
  width: isDrawerOpen ? `calc(100% - ${drawerWidth}px)` : "100%"
5276
5366
  },
5277
5367
  children: [
5278
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material20.Toolbar, {}),
5279
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material20.Box, { sx: { flex: 1, minHeight: 0, overflowY: "auto", display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react_router_dom4.Outlet, {}) })
5368
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.Toolbar, {}),
5369
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.Box, { sx: { flex: 1, minHeight: 0, overflowY: "auto", display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_router_dom4.Outlet, {}) })
5280
5370
  ]
5281
5371
  }
5282
5372
  )
@@ -5285,8 +5375,8 @@ var MainLayout = () => {
5285
5375
  var MainLayout_default = MainLayout;
5286
5376
 
5287
5377
  // src/components/SessionExpiredMessage.tsx
5288
- var import_material21 = require("@mui/material");
5289
- var import_jsx_runtime26 = require("react/jsx-runtime");
5378
+ var import_material22 = require("@mui/material");
5379
+ var import_jsx_runtime27 = require("react/jsx-runtime");
5290
5380
  var style = {
5291
5381
  position: "absolute",
5292
5382
  top: "50%",
@@ -5305,8 +5395,8 @@ var SessionExpiredMessage = () => {
5305
5395
  const handleClose = () => {
5306
5396
  handleExpiredSessionRedirect();
5307
5397
  };
5308
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
5309
- import_material21.Modal,
5398
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5399
+ import_material22.Modal,
5310
5400
  {
5311
5401
  open: showSessionExpiredMessage,
5312
5402
  onClose: () => {
@@ -5325,10 +5415,10 @@ var SessionExpiredMessage = () => {
5325
5415
  }
5326
5416
  }
5327
5417
  },
5328
- children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_material21.Box, { sx: style, children: [
5329
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.Typography, { id: "session-expired-modal-title", variant: "h6", component: "h2", gutterBottom: true, children: "\xA1Sesi\xF3n Expirada!" }),
5330
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.Typography, { id: "session-expired-modal-description", sx: { mt: 2, mb: 3 }, children: "Tu sesi\xF3n ha expirado por inactividad o por seguridad. Por favor, inicia sesi\xF3n de nuevo." }),
5331
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.Button, { variant: "contained", color: "primary", onClick: handleClose, children: "Ir al Login" })
5418
+ children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material22.Box, { sx: style, children: [
5419
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material22.Typography, { id: "session-expired-modal-title", variant: "h6", component: "h2", gutterBottom: true, children: "\xA1Sesi\xF3n Expirada!" }),
5420
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material22.Typography, { id: "session-expired-modal-description", sx: { mt: 2, mb: 3 }, children: "Tu sesi\xF3n ha expirado por inactividad o por seguridad. Por favor, inicia sesi\xF3n de nuevo." }),
5421
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material22.Button, { variant: "contained", color: "primary", onClick: handleClose, children: "Ir al Login" })
5332
5422
  ] })
5333
5423
  }
5334
5424
  );
@@ -5337,24 +5427,24 @@ var SessionExpiredMessage_default = SessionExpiredMessage;
5337
5427
 
5338
5428
  // src/pages/PantallaInicial.tsx
5339
5429
  var import_react_router_dom5 = require("react-router-dom");
5340
- var import_jsx_runtime27 = require("react/jsx-runtime");
5430
+ var import_jsx_runtime28 = require("react/jsx-runtime");
5341
5431
  var PantallaInicial = () => {
5342
5432
  const { clientContext } = useApp();
5343
5433
  const item = clientContext.menu ? itemInicial(clientContext.menu) : void 0;
5344
- return item ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react_router_dom5.Navigate, { to: rutaDeItemDeMenu(item), replace: true }) : null;
5434
+ return item && clientContext.menu ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_router_dom5.Navigate, { to: rutaDeItemDeMenu(item, gruposDeItem(clientContext.menu, item)), replace: true }) : null;
5345
5435
  };
5346
5436
  var PantallaInicial_default = PantallaInicial;
5347
5437
 
5348
5438
  // src/pages/LogoutPage.tsx
5349
5439
  var import_react31 = require("react");
5350
- var import_material22 = require("@mui/material");
5351
- var import_jsx_runtime28 = require("react/jsx-runtime");
5440
+ var import_material23 = require("@mui/material");
5441
+ var import_jsx_runtime29 = require("react/jsx-runtime");
5352
5442
  var LogoutPage = () => {
5353
5443
  const logout = useLogout_default();
5354
5444
  (0, import_react31.useEffect)(() => {
5355
5445
  logout();
5356
5446
  }, [logout]);
5357
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_material22.Box, { sx: {
5447
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_material23.Box, { sx: {
5358
5448
  display: "flex",
5359
5449
  flexDirection: "column",
5360
5450
  justifyContent: "center",
@@ -5362,20 +5452,20 @@ var LogoutPage = () => {
5362
5452
  height: "100vh",
5363
5453
  textAlign: "center"
5364
5454
  }, children: [
5365
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_material22.CircularProgress, { size: 60 }),
5366
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_material22.Typography, { variant: "h6", sx: { mt: 2 }, children: "Cerrando sesi\xF3n..." })
5455
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_material23.CircularProgress, { size: 60 }),
5456
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_material23.Typography, { variant: "h6", sx: { mt: 2 }, children: "Cerrando sesi\xF3n..." })
5367
5457
  ] });
5368
5458
  };
5369
5459
  var LogoutPage_default = LogoutPage;
5370
5460
 
5371
5461
  // src/pages/LoginPage.tsx
5372
5462
  var import_react32 = require("react");
5373
- var import_material23 = require("@mui/material");
5463
+ var import_material24 = require("@mui/material");
5374
5464
  var import_react_hook_form = require("react-hook-form");
5375
5465
  var import_zod = require("@hookform/resolvers/zod");
5376
5466
  var z = __toESM(require("zod"), 1);
5377
5467
  var import_react_redux4 = require("react-redux");
5378
- var import_jsx_runtime29 = require("react/jsx-runtime");
5468
+ var import_jsx_runtime30 = require("react/jsx-runtime");
5379
5469
  var loginSchema = z.object({
5380
5470
  username: z.string().min(1, "El usuario es requerido"),
5381
5471
  // Añadir validación básica
@@ -5429,16 +5519,16 @@ var LoginPage = () => {
5429
5519
  setIsSubmitting(false);
5430
5520
  }
5431
5521
  };
5432
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
5433
- import_material23.Box,
5522
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
5523
+ import_material24.Box,
5434
5524
  {
5435
5525
  display: "flex",
5436
5526
  alignItems: "center",
5437
5527
  justifyContent: "center",
5438
5528
  minHeight: "100vh",
5439
5529
  bgcolor: "#f5f5f5",
5440
- children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
5441
- import_material23.Box,
5530
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
5531
+ import_material24.Box,
5442
5532
  {
5443
5533
  width: "100%",
5444
5534
  maxWidth: "400px",
@@ -5447,7 +5537,7 @@ var LoginPage = () => {
5447
5537
  borderRadius: 8,
5448
5538
  boxShadow: 3,
5449
5539
  children: [
5450
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_material23.Box, { sx: { display: "flex", justifyContent: "center", mb: 3 }, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
5540
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_material24.Box, { sx: { display: "flex", justifyContent: "center", mb: 3 }, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
5451
5541
  "img",
5452
5542
  {
5453
5543
  src: `${envConfig.backendUrl}/img/login-logo-icon.png`,
@@ -5455,17 +5545,17 @@ var LoginPage = () => {
5455
5545
  style: { height: "192px", maxWidth: "100%", objectFit: "contain" }
5456
5546
  }
5457
5547
  ) }),
5458
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_material23.Typography, { variant: "h5", align: "center", gutterBottom: true, sx: { fontWeight: "bold", color: "primary.main" }, children: "Iniciar Sesi\xF3n" }),
5459
- /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("form", { onSubmit: handleSubmit(onSubmit), className: "space-y-4", children: [
5460
- /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { children: [
5461
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("label", { htmlFor: "username", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_material23.Typography, { variant: "subtitle1", component: "div", sx: { fontWeight: "medium" }, children: "Usuario" }) }),
5462
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
5548
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_material24.Typography, { variant: "h5", align: "center", gutterBottom: true, sx: { fontWeight: "bold", color: "primary.main" }, children: "Iniciar Sesi\xF3n" }),
5549
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("form", { onSubmit: handleSubmit(onSubmit), className: "space-y-4", children: [
5550
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { children: [
5551
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("label", { htmlFor: "username", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_material24.Typography, { variant: "subtitle1", component: "div", sx: { fontWeight: "medium" }, children: "Usuario" }) }),
5552
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
5463
5553
  import_react_hook_form.Controller,
5464
5554
  {
5465
5555
  name: "username",
5466
5556
  control,
5467
- render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
5468
- import_material23.TextField,
5557
+ render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
5558
+ import_material24.TextField,
5469
5559
  {
5470
5560
  ...field,
5471
5561
  type: "text",
@@ -5480,15 +5570,15 @@ var LoginPage = () => {
5480
5570
  }
5481
5571
  )
5482
5572
  ] }),
5483
- /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { children: [
5484
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("label", { htmlFor: "password", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_material23.Typography, { variant: "subtitle1", component: "div", sx: { fontWeight: "medium" }, children: "Contrase\xF1a" }) }),
5485
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
5573
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { children: [
5574
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("label", { htmlFor: "password", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_material24.Typography, { variant: "subtitle1", component: "div", sx: { fontWeight: "medium" }, children: "Contrase\xF1a" }) }),
5575
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
5486
5576
  import_react_hook_form.Controller,
5487
5577
  {
5488
5578
  name: "password",
5489
5579
  control,
5490
- render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
5491
- import_material23.TextField,
5580
+ render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
5581
+ import_material24.TextField,
5492
5582
  {
5493
5583
  ...field,
5494
5584
  type: "password",
@@ -5503,14 +5593,14 @@ var LoginPage = () => {
5503
5593
  }
5504
5594
  )
5505
5595
  ] }),
5506
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_material23.Button, { type: "submit", fullWidth: true, variant: "contained", color: "primary", disabled: isSubmitting, sx: { mt: 2 }, children: isSubmitting ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
5507
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_material23.CircularProgress, { size: 20, sx: { mr: 1 } }),
5596
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_material24.Button, { type: "submit", fullWidth: true, variant: "contained", color: "primary", disabled: isSubmitting, sx: { mt: 2 }, children: isSubmitting ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
5597
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_material24.CircularProgress, { size: 20, sx: { mr: 1 } }),
5508
5598
  "Iniciando sesi\xF3n..."
5509
5599
  ] }) : "Iniciar Sesi\xF3n" })
5510
5600
  ] }),
5511
- loginError && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_material23.Alert, { severity: "error", sx: { mt: 2, maxHeight: "200px" }, children: [
5601
+ loginError && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_material24.Alert, { severity: "error", sx: { mt: 2, maxHeight: "200px" }, children: [
5512
5602
  " ",
5513
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_material23.AlertTitle, { children: "Error" }),
5603
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_material24.AlertTitle, { children: "Error" }),
5514
5604
  loginError
5515
5605
  ] })
5516
5606
  ]
@@ -5524,17 +5614,17 @@ var LoginPage_default = LoginPage;
5524
5614
  // src/components/ProcedureForm.tsx
5525
5615
  var import_react33 = __toESM(require("react"), 1);
5526
5616
  var import_react_router_dom6 = require("react-router-dom");
5527
- var import_material25 = require("@mui/material");
5617
+ var import_material26 = require("@mui/material");
5528
5618
 
5529
5619
  // src/pages/procedure-results/SuccessDisplay.tsx
5530
- var import_material24 = require("@mui/material");
5531
- var import_jsx_runtime30 = require("react/jsx-runtime");
5620
+ var import_material25 = require("@mui/material");
5621
+ var import_jsx_runtime31 = require("react/jsx-runtime");
5532
5622
  var SuccessDisplay = ({ data }) => {
5533
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_material24.Paper, { elevation: 2, sx: { p: 2, mt: 2, bgcolor: "success.light", color: "success.contrastText" }, children: [
5534
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_material24.Typography, { variant: "h6", sx: { fontSize: "1rem", mb: 1 }, children: "\xA1Operaci\xF3n Exitosa!" }),
5535
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_material24.Typography, { variant: "body2", sx: { fontSize: "0.85rem" }, children: "Detalles del resultado:" }),
5536
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_material24.Box, { sx: { bgcolor: "success.dark", p: 1, borderRadius: 1, mt: 1, overflowX: "auto" }, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("pre", { style: { margin: 0, fontSize: "0.75rem", color: "white" }, children: JSON.stringify(data, null, 2) }) }),
5537
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_material24.Typography, { variant: "body2", sx: { fontSize: "0.8rem", mt: 1 }, children: "Puedes revisar los detalles anteriores o cerrar este mensaje." })
5623
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material25.Paper, { elevation: 2, sx: { p: 2, mt: 2, bgcolor: "success.light", color: "success.contrastText" }, children: [
5624
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material25.Typography, { variant: "h6", sx: { fontSize: "1rem", mb: 1 }, children: "\xA1Operaci\xF3n Exitosa!" }),
5625
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material25.Typography, { variant: "body2", sx: { fontSize: "0.85rem" }, children: "Detalles del resultado:" }),
5626
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material25.Box, { sx: { bgcolor: "success.dark", p: 1, borderRadius: 1, mt: 1, overflowX: "auto" }, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("pre", { style: { margin: 0, fontSize: "0.75rem", color: "white" }, children: JSON.stringify(data, null, 2) }) }),
5627
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material25.Typography, { variant: "body2", sx: { fontSize: "0.8rem", mt: 1 }, children: "Puedes revisar los detalles anteriores o cerrar este mensaje." })
5538
5628
  ] });
5539
5629
  };
5540
5630
  var SuccessDisplay_default = SuccessDisplay;
@@ -5548,7 +5638,7 @@ var extendResultsOk = (newComponents) => {
5548
5638
  };
5549
5639
 
5550
5640
  // src/components/ProcedureForm.tsx
5551
- var import_jsx_runtime31 = require("react/jsx-runtime");
5641
+ var import_jsx_runtime32 = require("react/jsx-runtime");
5552
5642
  var ProcedureForm = () => {
5553
5643
  const { procedureName } = (0, import_react_router_dom6.useParams)();
5554
5644
  const { clientContext } = useApp();
@@ -5763,10 +5853,10 @@ var ProcedureForm = () => {
5763
5853
  sx: { fontSize: "0.8rem" }
5764
5854
  };
5765
5855
  if (param.options && param.options.length > 0) {
5766
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material25.FormControl, { fullWidth: true, margin: "dense", size: "small", error: hasError, required: commonProps.required, children: [
5767
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material25.InputLabel, { id: `${param.name}-label`, sx: { fontSize: "0.8rem" }, children: param.label || param.name }),
5768
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
5769
- import_material25.Select,
5856
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_material26.FormControl, { fullWidth: true, margin: "dense", size: "small", error: hasError, required: commonProps.required, children: [
5857
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material26.InputLabel, { id: `${param.name}-label`, sx: { fontSize: "0.8rem" }, children: param.label || param.name }),
5858
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
5859
+ import_material26.Select,
5770
5860
  {
5771
5861
  labelId: `${param.name}-label`,
5772
5862
  value: formValues[param.name] === void 0 ? "" : formValues[param.name],
@@ -5776,14 +5866,14 @@ var ProcedureForm = () => {
5776
5866
  label: param.label || param.name,
5777
5867
  disabled: apiLoading,
5778
5868
  sx: { fontSize: "0.8rem" },
5779
- renderValue: (selected) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material25.Typography, { sx: { fontSize: "0.8rem" }, children: selected }),
5869
+ renderValue: (selected) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material26.Typography, { sx: { fontSize: "0.8rem" }, children: selected }),
5780
5870
  children: [
5781
- (!commonProps.required || formValues[param.name] === "") && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material25.MenuItem, { value: "", sx: { fontSize: "0.8rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("em", { children: "Seleccione..." }) }),
5782
- param.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material25.MenuItem, { value: option, sx: { fontSize: "0.8rem" }, children: option }, option))
5871
+ (!commonProps.required || formValues[param.name] === "") && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material26.MenuItem, { value: "", sx: { fontSize: "0.8rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("em", { children: "Seleccione..." }) }),
5872
+ param.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material26.MenuItem, { value: option, sx: { fontSize: "0.8rem" }, children: option }, option))
5783
5873
  ]
5784
5874
  }
5785
5875
  ),
5786
- (param.description || errorMessage) && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material25.FormHelperText, { sx: { fontSize: "0.7rem" }, children: errorMessage || param.description })
5876
+ (param.description || errorMessage) && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material26.FormHelperText, { sx: { fontSize: "0.7rem" }, children: errorMessage || param.description })
5787
5877
  ] });
5788
5878
  }
5789
5879
  switch (param.typeName) {
@@ -5792,19 +5882,19 @@ var ProcedureForm = () => {
5792
5882
  case "tsrange":
5793
5883
  case "time_range":
5794
5884
  case "daterange":
5795
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material25.TextField, { type: "text", value: formValues[param.name] || "", ...commonProps });
5885
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material26.TextField, { type: "text", value: formValues[param.name] || "", ...commonProps });
5796
5886
  case "decimal":
5797
5887
  case "double":
5798
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material25.TextField, { type: "number", inputProps: { step: "any", style: { fontSize: "0.8rem" } }, value: formValues[param.name] || "", ...commonProps });
5888
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material26.TextField, { type: "number", inputProps: { step: "any", style: { fontSize: "0.8rem" } }, value: formValues[param.name] || "", ...commonProps });
5799
5889
  case "integer":
5800
5890
  case "bigint":
5801
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material25.TextField, { type: "number", inputProps: { step: "1", style: { fontSize: "0.8rem" } }, value: formValues[param.name] || "", ...commonProps });
5891
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material26.TextField, { type: "number", inputProps: { step: "1", style: { fontSize: "0.8rem" } }, value: formValues[param.name] || "", ...commonProps });
5802
5892
  case "boolean":
5803
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5804
- import_material25.FormControlLabel,
5893
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
5894
+ import_material26.FormControlLabel,
5805
5895
  {
5806
- control: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5807
- import_material25.Checkbox,
5896
+ control: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
5897
+ import_material26.Checkbox,
5808
5898
  {
5809
5899
  checked: !!formValues[param.name],
5810
5900
  onChange: handleChange,
@@ -5814,21 +5904,21 @@ var ProcedureForm = () => {
5814
5904
  size: "small"
5815
5905
  }
5816
5906
  ),
5817
- label: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material25.Typography, { sx: { fontSize: "0.8rem", color: hasError ? "error.main" : "inherit" }, children: param.label || param.name }),
5907
+ label: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material26.Typography, { sx: { fontSize: "0.8rem", color: hasError ? "error.main" : "inherit" }, children: param.label || param.name }),
5818
5908
  sx: { mt: 1, mb: 0 }
5819
5909
  }
5820
5910
  );
5821
5911
  case "date":
5822
5912
  case "timestamp":
5823
5913
  case "time":
5824
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material25.TextField, { type: param.typeName === "date" ? "date" : param.typeName === "timestamp" ? "datetime-local" : "time", value: formValues[param.name] || "", ...commonProps, InputLabelProps: { shrink: true, sx: { fontSize: "0.8rem" } } });
5914
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material26.TextField, { type: param.typeName === "date" ? "date" : param.typeName === "timestamp" ? "datetime-local" : "time", value: formValues[param.name] || "", ...commonProps, InputLabelProps: { shrink: true, sx: { fontSize: "0.8rem" } } });
5825
5915
  case "jsonb":
5826
5916
  case "jsona":
5827
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material25.TextField, { multiline: true, rows: 5, value: formValues[param.name] || "", ...commonProps, InputProps: { sx: { fontSize: "0.8rem" } } });
5917
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material26.TextField, { multiline: true, rows: 5, value: formValues[param.name] || "", ...commonProps, InputProps: { sx: { fontSize: "0.8rem" } } });
5828
5918
  case "bytea":
5829
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material25.FormControl, { fullWidth: true, margin: "dense", error: hasError, required: commonProps.required, children: [
5830
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material25.Typography, { variant: "body2", color: "textSecondary", component: "label", htmlFor: param.name, sx: { fontSize: "0.8rem", color: hasError ? "error.main" : "text.secondary" }, children: param.label || param.name }),
5831
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5919
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_material26.FormControl, { fullWidth: true, margin: "dense", error: hasError, required: commonProps.required, children: [
5920
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material26.Typography, { variant: "body2", color: "textSecondary", component: "label", htmlFor: param.name, sx: { fontSize: "0.8rem", color: hasError ? "error.main" : "text.secondary" }, children: param.label || param.name }),
5921
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
5832
5922
  "input",
5833
5923
  {
5834
5924
  type: "file",
@@ -5842,34 +5932,34 @@ var ProcedureForm = () => {
5842
5932
  style: { padding: "6px 0", fontSize: "0.8rem" }
5843
5933
  }
5844
5934
  ),
5845
- (param.description || errorMessage) && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material25.FormHelperText, { sx: { fontSize: "0.7rem" }, children: errorMessage || param.description })
5935
+ (param.description || errorMessage) && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material26.FormHelperText, { sx: { fontSize: "0.7rem" }, children: errorMessage || param.description })
5846
5936
  ] });
5847
5937
  default:
5848
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material25.TextField, { type: "text", value: formValues[param.name] || "", ...commonProps });
5938
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material26.TextField, { type: "text", value: formValues[param.name] || "", ...commonProps });
5849
5939
  }
5850
5940
  }, [formValues, handleChange, apiLoading, validationErrors]);
5851
5941
  const ResultDisplayContent = (0, import_react33.useMemo)(() => {
5852
5942
  if (!procedureResultData || !procedure?.resultOk) return null;
5853
5943
  const ComponentToRender = resultsOk[procedure.resultOk];
5854
5944
  if (ComponentToRender) {
5855
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ComponentToRender, { data: procedureResultData });
5945
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ComponentToRender, { data: procedureResultData });
5856
5946
  } else {
5857
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material25.Paper, { elevation: 2, sx: { p: 2, mt: 0, bgcolor: "warning.light" }, children: [
5858
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material25.Typography, { variant: "h6", sx: { fontSize: "1rem", mb: 1 }, children: [
5947
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_material26.Paper, { elevation: 2, sx: { p: 2, mt: 0, bgcolor: "warning.light" }, children: [
5948
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_material26.Typography, { variant: "h6", sx: { fontSize: "1rem", mb: 1 }, children: [
5859
5949
  "el componente para resolver el resultOk: '",
5860
5950
  procedure.resultOk,
5861
5951
  "' definido en el procedure no existe o no est\xE1 mapeado."
5862
5952
  ] }),
5863
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material25.Box, { sx: {
5953
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material26.Box, { sx: {
5864
5954
  bgcolor: "warning.dark",
5865
5955
  p: 1,
5866
5956
  borderRadius: 1
5867
- }, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("pre", { style: { margin: 0, fontSize: "0.75rem", color: "white" }, children: JSON.stringify(procedureResultData, null, 2) }) })
5957
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("pre", { style: { margin: 0, fontSize: "0.75rem", color: "white" }, children: JSON.stringify(procedureResultData, null, 2) }) })
5868
5958
  ] });
5869
5959
  }
5870
5960
  }, [procedureResultData, procedure]);
5871
5961
  if (!procedure) {
5872
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material25.Box, { sx: {
5962
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_material26.Box, { sx: {
5873
5963
  p: 2,
5874
5964
  width: "100%",
5875
5965
  boxSizing: "border-box",
@@ -5879,13 +5969,13 @@ var ProcedureForm = () => {
5879
5969
  boxShadow: 3,
5880
5970
  textAlign: "center"
5881
5971
  }, children: [
5882
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material25.CircularProgress, { sx: { mb: 2 } }),
5883
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material25.Typography, { variant: "h6", color: "text.secondary", children: "Cargando procedimiento o no encontrado..." })
5972
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material26.CircularProgress, { sx: { mb: 2 } }),
5973
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material26.Typography, { variant: "h6", color: "text.secondary", children: "Cargando procedimiento o no encontrado..." })
5884
5974
  ] });
5885
5975
  }
5886
5976
  return (
5887
5977
  // Esta es la Box más externa que ahora controlará el scroll
5888
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material25.Box, { sx: {
5978
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_material26.Box, { sx: {
5889
5979
  p: 2,
5890
5980
  ml: 1,
5891
5981
  mt: 2,
@@ -5902,17 +5992,17 @@ var ProcedureForm = () => {
5902
5992
  overflowX: "hidden"
5903
5993
  // Oculta el scroll horizontal si no es necesario para el contenedor principal
5904
5994
  }, children: [
5905
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material25.Typography, { variant: "h5", component: "h2", gutterBottom: true, align: "left", children: cambiarGuionesBajosPorEspacios(procedure.proceedLabel || procedure.action) }),
5906
- Object.values(validationErrors).some((err) => err !== null) && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material25.Alert, { severity: "error", sx: { mb: 2, fontSize: "0.8rem" }, children: [
5995
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material26.Typography, { variant: "h5", component: "h2", gutterBottom: true, align: "left", children: cambiarGuionesBajosPorEspacios(procedure.proceedLabel || procedure.action) }),
5996
+ Object.values(validationErrors).some((err) => err !== null) && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_material26.Alert, { severity: "error", sx: { mb: 2, fontSize: "0.8rem" }, children: [
5907
5997
  "Por favor, corrige los errores en el formulario antes de enviar.",
5908
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("ul", { children: Object.values(validationErrors).map((err, idx) => err && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("li", { children: err }, idx)) })
5998
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("ul", { children: Object.values(validationErrors).map((err, idx) => err && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("li", { children: err }, idx)) })
5909
5999
  ] }),
5910
- !Object.values(validationErrors).some((err) => err !== null) && apiError && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material25.Alert, { severity: "error", sx: { mb: 2, fontSize: "0.8rem" }, children: apiError.message }),
5911
- !Object.values(validationErrors).some((err) => err !== null) && !apiError && successMessage && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material25.Alert, { severity: "success", sx: { mb: 2, fontSize: "0.8rem" }, children: successMessage }),
5912
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("form", { onSubmit: handleSubmit, children: [
5913
- procedure.parameters.map((param) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { children: renderInputField(param) }, param.name)),
5914
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5915
- import_material25.Button,
6000
+ !Object.values(validationErrors).some((err) => err !== null) && apiError && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material26.Alert, { severity: "error", sx: { mb: 2, fontSize: "0.8rem" }, children: apiError.message }),
6001
+ !Object.values(validationErrors).some((err) => err !== null) && !apiError && successMessage && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material26.Alert, { severity: "success", sx: { mb: 2, fontSize: "0.8rem" }, children: successMessage }),
6002
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("form", { onSubmit: handleSubmit, children: [
6003
+ procedure.parameters.map((param) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { children: renderInputField(param) }, param.name)),
6004
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
6005
+ import_material26.Button,
5916
6006
  {
5917
6007
  type: "submit",
5918
6008
  variant: "contained",
@@ -5920,20 +6010,20 @@ var ProcedureForm = () => {
5920
6010
  disabled: apiLoading || Object.values(validationErrors).some((err) => err !== null),
5921
6011
  sx: { mt: 2 },
5922
6012
  size: "medium",
5923
- startIcon: apiLoading ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material25.CircularProgress, { size: 20, color: "inherit" }) : null,
6013
+ startIcon: apiLoading ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material26.CircularProgress, { size: 20, color: "inherit" }) : null,
5924
6014
  children: apiLoading ? "Ejecutando..." : procedure.proceedLabel || "Ejecutar"
5925
6015
  }
5926
6016
  )
5927
6017
  ] }),
5928
- ResultDisplayContent && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material25.Box, { sx: { mt: 2 }, children: [
6018
+ ResultDisplayContent && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_material26.Box, { sx: { mt: 2 }, children: [
5929
6019
  " ",
5930
6020
  ResultDisplayContent
5931
6021
  ] }),
5932
- executionLog.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material25.Box, { sx: { mt: 3 }, children: [
5933
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material25.Divider, { sx: { mb: 2 } }),
5934
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material25.Typography, { variant: "h6", gutterBottom: true, sx: { fontSize: "0.9rem" }, children: "Registro de Ejecuci\xF3n" }),
5935
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5936
- import_material25.Box,
6022
+ executionLog.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_material26.Box, { sx: { mt: 3 }, children: [
6023
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material26.Divider, { sx: { mb: 2 } }),
6024
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material26.Typography, { variant: "h6", gutterBottom: true, sx: { fontSize: "0.9rem" }, children: "Registro de Ejecuci\xF3n" }),
6025
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
6026
+ import_material26.Box,
5937
6027
  {
5938
6028
  sx: {
5939
6029
  bgcolor: "grey.100",
@@ -5946,8 +6036,8 @@ var ProcedureForm = () => {
5946
6036
  fontSize: "0.75rem",
5947
6037
  whiteSpace: "pre-wrap"
5948
6038
  },
5949
- children: executionLog.map((log, index) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5950
- import_material25.Typography,
6039
+ children: executionLog.map((log, index) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
6040
+ import_material26.Typography,
5951
6041
  {
5952
6042
  component: "pre",
5953
6043
  sx: {
@@ -5974,7 +6064,7 @@ var import_react44 = require("redux-persist/integration/react");
5974
6064
  // src/components/PrivateRoute.tsx
5975
6065
  var import_react34 = require("react");
5976
6066
  var import_react_router_dom7 = require("react-router-dom");
5977
- var import_jsx_runtime32 = require("react/jsx-runtime");
6067
+ var import_jsx_runtime33 = require("react/jsx-runtime");
5978
6068
  var PrivateRoute = ({ children }) => {
5979
6069
  const location = (0, import_react_router_dom7.useLocation)();
5980
6070
  const dispatch = useAppDispatch();
@@ -5998,14 +6088,14 @@ var PrivateRoute = ({ children }) => {
5998
6088
  }, [isAuthenticated, isLoadingAuth, location, dispatch, clientContextStatus]);
5999
6089
  if (isLoadingAuth) {
6000
6090
  console.log(`[PrivateRoute] Returning loading state...`);
6001
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { children: "Verificando autenticaci\xF3n..." });
6091
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { children: "Verificando autenticaci\xF3n..." });
6002
6092
  }
6003
6093
  if (!isAuthenticated) {
6004
6094
  console.log(`[PrivateRoute] User not authenticated, navigating to /login`);
6005
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_router_dom7.Navigate, { to: "/login", replace: true });
6095
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_router_dom7.Navigate, { to: "/login", replace: true });
6006
6096
  }
6007
6097
  console.log(`[PrivateRoute] User authenticated, rendering children.`);
6008
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_jsx_runtime32.Fragment, { children });
6098
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_jsx_runtime33.Fragment, { children });
6009
6099
  };
6010
6100
  var PrivateRoute_default = PrivateRoute;
6011
6101
 
@@ -6045,9 +6135,9 @@ var InitialRedirectHandler_default = InitialRedirectHandler;
6045
6135
  // src/pages/GenericDataGridPage.tsx
6046
6136
  var import_react36 = __toESM(require("react"), 1);
6047
6137
  var import_react_router_dom9 = require("react-router-dom");
6048
- var import_material26 = require("@mui/material");
6138
+ var import_material27 = require("@mui/material");
6049
6139
  var import_Close2 = __toESM(require("@mui/icons-material/Close"), 1);
6050
- var import_jsx_runtime33 = require("react/jsx-runtime");
6140
+ var import_jsx_runtime34 = require("react/jsx-runtime");
6051
6141
  var GenericDataGridPage = ({
6052
6142
  initialTableName,
6053
6143
  initialFixedFields = [],
@@ -6098,26 +6188,26 @@ var GenericDataGridPage = ({
6098
6188
  else if (activeTabIdx === index) setActiveTabIdx(index - 1);
6099
6189
  };
6100
6190
  if (!effectiveTableName) {
6101
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_material26.Box, { p: 3, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_material26.Alert, { severity: "error", children: "No se especific\xF3 una tabla." }) });
6191
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_material27.Box, { p: 3, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_material27.Alert, { severity: "error", children: "No se especific\xF3 una tabla." }) });
6102
6192
  }
6103
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_material26.Box, { sx: { width: "100%", height: "calc(100vh - 64px)", display: "flex", flexDirection: "column" }, children: [
6104
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_material26.Box, { sx: { borderBottom: 1, borderColor: "divider", bgcolor: "background.paper" }, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_material26.Tabs, { value: activeTabIdx, onChange: (_, v) => setActiveTabIdx(v), variant: "scrollable", children: tabs.map((tab, index) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6105
- import_material26.Tab,
6193
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_material27.Box, { sx: { width: "100%", height: "calc(100vh - 64px)", display: "flex", flexDirection: "column" }, children: [
6194
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_material27.Box, { sx: { borderBottom: 1, borderColor: "divider", bgcolor: "background.paper" }, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_material27.Tabs, { value: activeTabIdx, onChange: (_, v) => setActiveTabIdx(v), variant: "scrollable", children: tabs.map((tab, index) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6195
+ import_material27.Tab,
6106
6196
  {
6107
- label: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_material26.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
6108
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_material26.Typography, { variant: "caption", sx: { fontWeight: "bold" }, children: tab.label }),
6109
- index !== 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_material26.IconButton, { size: "small", onClick: (e) => handleCloseTab(index, e), children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_Close2.default, { fontSize: "inherit" }) })
6197
+ label: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_material27.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
6198
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_material27.Typography, { variant: "caption", sx: { fontWeight: "bold" }, children: tab.label }),
6199
+ index !== 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_material27.IconButton, { size: "small", onClick: (e) => handleCloseTab(index, e), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_Close2.default, { fontSize: "inherit" }) })
6110
6200
  ] })
6111
6201
  },
6112
6202
  tab.id
6113
6203
  )) }) }),
6114
- tabs.map((tab, index) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6115
- import_material26.Box,
6204
+ tabs.map((tab, index) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6205
+ import_material27.Box,
6116
6206
  {
6117
6207
  role: "tabpanel",
6118
6208
  hidden: activeTabIdx !== index,
6119
6209
  sx: { flexGrow: 1, display: activeTabIdx === index ? "flex" : "none", flexDirection: "column", overflow: "hidden" },
6120
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
6210
+ children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6121
6211
  GenericDataGrid_default,
6122
6212
  {
6123
6213
  tableName: tab.tableName,
@@ -6140,42 +6230,30 @@ var GenericDataGridPage_default = GenericDataGridPage;
6140
6230
  // src/pages/PantallaDeRuta.tsx
6141
6231
  var import_react37 = require("react");
6142
6232
  var import_react_router_dom10 = require("react-router-dom");
6143
- var import_material27 = require("@mui/material");
6144
- var import_jsx_runtime34 = require("react/jsx-runtime");
6233
+ var import_material28 = require("@mui/material");
6234
+ var import_jsx_runtime35 = require("react/jsx-runtime");
6145
6235
  var PantallaDeRuta = ({ screenName }) => {
6146
6236
  const [busqueda] = (0, import_react_router_dom10.useSearchParams)();
6147
6237
  const params = (0, import_react37.useMemo)(() => Object.fromEntries(busqueda.entries()), [busqueda]);
6148
6238
  const Pantalla = wScreens[screenName];
6149
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_material27.Box, { sx: { pt: 3, pl: 4 }, children: Pantalla ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Pantalla, { screenName, params }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(FallbackWScreen, { screenName }) });
6239
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_material28.Box, { sx: { pt: 3, pl: 4 }, children: Pantalla ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Pantalla, { screenName, params }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(FallbackWScreen, { screenName }) });
6150
6240
  };
6151
6241
 
6152
6242
  // src/pages/MenuTablePage.tsx
6153
6243
  var import_react38 = require("react");
6154
6244
  var import_react_router_dom11 = require("react-router-dom");
6155
- var import_material28 = require("@mui/material");
6156
- var import_jsx_runtime35 = require("react/jsx-runtime");
6245
+ var import_material29 = require("@mui/material");
6246
+ var import_jsx_runtime36 = require("react/jsx-runtime");
6157
6247
  var MenuTablePage = () => {
6158
- const { menuName } = (0, import_react_router_dom11.useParams)();
6248
+ const { "*": menuName } = (0, import_react_router_dom11.useParams)();
6159
6249
  const { clientContext } = useApp();
6160
6250
  const { search } = (0, import_react_router_dom11.useLocation)();
6161
- const findMenuItem = (items, nameToFind) => {
6162
- for (const item of items) {
6163
- if (item.name === nameToFind && item.menuType === "table") {
6164
- return item;
6165
- }
6166
- if (item.menuType === "menu" && item.menuContent) {
6167
- const found = findMenuItem(item.menuContent, nameToFind);
6168
- if (found) return found;
6169
- }
6170
- }
6171
- return void 0;
6172
- };
6173
6251
  const { currentTableName, currentFixedFields, parametros } = (0, import_react38.useMemo)(() => {
6174
6252
  let tableName = void 0;
6175
6253
  let fixedFields = [];
6176
6254
  let parametros2 = {};
6177
6255
  if (menuName && clientContext && clientContext.menu) {
6178
- const menuItem = findMenuItem(clientContext.menu, menuName);
6256
+ const menuItem = itemDeRuta(clientContext.menu, menuName.split("/").filter((tramo) => tramo !== ""));
6179
6257
  if (menuItem) {
6180
6258
  tableName = menuItem.table || menuItem.name;
6181
6259
  parametros2 = parametrosDeTabla(menuItem, search);
@@ -6191,12 +6269,12 @@ var MenuTablePage = () => {
6191
6269
  };
6192
6270
  }, [menuName, clientContext, search]);
6193
6271
  if (!currentTableName) {
6194
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_material28.Box, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_material28.Alert, { severity: "error", children: [
6195
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_material28.Typography, { variant: "h6", children: "Error: No se pudo cargar la informaci\xF3n de la tabla." }),
6196
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_material28.Typography, { variant: "body1", children: "Verifique la configuraci\xF3n del men\xFA o el nombre de la tabla en la URL." })
6272
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_material29.Box, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_material29.Alert, { severity: "error", children: [
6273
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_material29.Typography, { variant: "h6", children: "Error: No se pudo cargar la informaci\xF3n de la tabla." }),
6274
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_material29.Typography, { variant: "body1", children: "Verifique la configuraci\xF3n del men\xFA o el nombre de la tabla en la URL." })
6197
6275
  ] }) });
6198
6276
  }
6199
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
6277
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
6200
6278
  GenericDataGridPage_default,
6201
6279
  {
6202
6280
  initialTableName: currentTableName,
@@ -6210,7 +6288,7 @@ var MenuTablePage_default = MenuTablePage;
6210
6288
  // src/puente/PantallaBP.tsx
6211
6289
  var import_react40 = require("react");
6212
6290
  var import_react_router_dom12 = require("react-router-dom");
6213
- var import_material30 = require("@mui/material");
6291
+ var import_material31 = require("@mui/material");
6214
6292
 
6215
6293
  // src/puente/clienteBP.ts
6216
6294
  function extraerRecursos(html) {
@@ -6300,8 +6378,8 @@ async function cargarSinMemoria(urlBackend) {
6300
6378
 
6301
6379
  // src/puente/ConsolaBP.tsx
6302
6380
  var import_react39 = require("react");
6303
- var import_material29 = require("@mui/material");
6304
- var import_jsx_runtime36 = require("react/jsx-runtime");
6381
+ var import_material30 = require("@mui/material");
6382
+ var import_jsx_runtime37 = require("react/jsx-runtime");
6305
6383
  var MARGEN_DE_REPETIDO_MS = 1e3;
6306
6384
  function descartarRepetidos(consola, agregados, ahora) {
6307
6385
  for (const nodo of agregados) {
@@ -6323,8 +6401,8 @@ var ConsolaBP = () => {
6323
6401
  observador.observe(consola, { childList: true });
6324
6402
  return () => observador.disconnect();
6325
6403
  }, []);
6326
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
6327
- import_material29.Box,
6404
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
6405
+ import_material30.Box,
6328
6406
  {
6329
6407
  id: "mini-console",
6330
6408
  sx: (tema) => ({
@@ -6420,7 +6498,7 @@ var habilitarPuenteBP = () => {
6420
6498
  var puenteBPHabilitado = () => habilitado;
6421
6499
 
6422
6500
  // src/puente/PantallaBP.tsx
6423
- var import_jsx_runtime37 = require("react/jsx-runtime");
6501
+ var import_jsx_runtime38 = require("react/jsx-runtime");
6424
6502
  function buscarItemDeMenu(items, tipo) {
6425
6503
  for (const item of items) {
6426
6504
  if (item.menuType === tipo) return item;
@@ -6469,14 +6547,14 @@ var PantallaBP = ({ nombre, direccion }) => {
6469
6547
  elemento.replaceChildren();
6470
6548
  };
6471
6549
  }, [nombre, direccion, menu]);
6472
- if (noExiste) return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(FallbackWScreen, { screenName: nombre });
6550
+ if (noExiste) return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FallbackWScreen, { screenName: nombre });
6473
6551
  return (
6474
6552
  // el indicador de carga flota: si ocupara lugar, el contenido de backend-plus empezaría más abajo mientras carga y subiría al terminar
6475
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_material30.Box, { sx: { position: "relative" }, children: [
6476
- cargando && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_material30.CircularProgress, { size: 24, sx: { position: "absolute", top: 16, left: 16 } }),
6477
- error && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_material30.Alert, { severity: "error", sx: { m: 2 }, children: error }),
6478
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { id: "main_layout", ref: contenedor }),
6479
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ConsolaBP, {})
6553
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_material31.Box, { sx: { position: "relative" }, children: [
6554
+ cargando && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_material31.CircularProgress, { size: 24, sx: { position: "absolute", top: 16, left: 16 } }),
6555
+ error && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_material31.Alert, { severity: "error", sx: { m: 2 }, children: error }),
6556
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { id: "main_layout", ref: contenedor }),
6557
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ConsolaBP, {})
6480
6558
  ] })
6481
6559
  );
6482
6560
  };
@@ -6484,28 +6562,28 @@ var PantallaDeRespaldo = () => {
6484
6562
  const { screenName = "" } = (0, import_react_router_dom12.useParams)();
6485
6563
  const { search } = (0, import_react_router_dom12.useLocation)();
6486
6564
  if (!puenteBPHabilitado()) {
6487
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_material30.Box, { sx: { p: 3 }, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(FallbackWScreen, { screenName }) });
6565
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_material31.Box, { sx: { p: 3 }, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(FallbackWScreen, { screenName }) });
6488
6566
  }
6489
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react_router_dom12.Navigate, { to: rutaDePantallaBP(screenName, search), replace: true });
6567
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react_router_dom12.Navigate, { to: rutaDePantallaBP(screenName, search), replace: true });
6490
6568
  };
6491
6569
  var PaginaBP = () => {
6492
6570
  const { hash, search } = (0, import_react_router_dom12.useLocation)();
6493
6571
  const direccion = hash || search;
6494
6572
  const nombre = new URLSearchParams(direccion.replace(/^[#?]/, "")).get("w");
6495
- if (!puenteBPHabilitado()) return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react_router_dom12.Navigate, { to: "/", replace: true });
6496
- if (!nombre) return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_material30.Box, { sx: { p: 3 }, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_material30.Alert, { severity: "warning", children: [
6573
+ if (!puenteBPHabilitado()) return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react_router_dom12.Navigate, { to: "/", replace: true });
6574
+ if (!nombre) return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_material31.Box, { sx: { p: 3 }, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_material31.Alert, { severity: "warning", children: [
6497
6575
  "Falta la pantalla de backend-plus (",
6498
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("code", { children: "#w=..." }),
6576
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("code", { children: "#w=..." }),
6499
6577
  ")."
6500
6578
  ] }) });
6501
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(PantallaBP, { nombre, direccion }, nombre);
6579
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(PantallaBP, { nombre, direccion }, nombre);
6502
6580
  };
6503
6581
 
6504
6582
  // src/puente/GrillaBP.tsx
6505
6583
  var import_react41 = require("react");
6506
6584
  var import_react_router_dom13 = require("react-router-dom");
6507
- var import_material31 = require("@mui/material");
6508
- var import_jsx_runtime38 = (
6585
+ var import_material32 = require("@mui/material");
6586
+ var import_jsx_runtime39 = (
6509
6587
  // el indicador de carga flota: si ocupara lugar, el contenido de backend-plus empezaría más abajo mientras carga y subiría al terminar
6510
6588
  require("react/jsx-runtime")
6511
6589
  );
@@ -6535,16 +6613,16 @@ var GrillaBP = ({ tabla, fixedFields }) => {
6535
6613
  elemento.replaceChildren();
6536
6614
  };
6537
6615
  }, [tabla, clave]);
6538
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_material31.Box, { sx: { position: "relative" }, children: [
6539
- cargando && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_material31.CircularProgress, { size: 24, sx: { position: "absolute", top: 16, left: 16 } }),
6540
- error && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_material31.Alert, { severity: "error", sx: { m: 2 }, children: error }),
6541
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { ref: contenedor }),
6542
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ConsolaBP, {})
6616
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_material32.Box, { sx: { position: "relative" }, children: [
6617
+ cargando && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_material32.CircularProgress, { size: 24, sx: { position: "absolute", top: 16, left: 16 } }),
6618
+ error && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_material32.Alert, { severity: "error", sx: { m: 2 }, children: error }),
6619
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { ref: contenedor }),
6620
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ConsolaBP, {})
6543
6621
  ] });
6544
6622
  };
6545
6623
  var PaginaGrillaBP = () => {
6546
6624
  const { tableName = "" } = (0, import_react_router_dom13.useParams)();
6547
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(GrillaBP, { tabla: tableName }, tableName);
6625
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GrillaBP, { tabla: tableName }, tableName);
6548
6626
  };
6549
6627
 
6550
6628
  // src/puente/CapturaBP.tsx
@@ -6601,7 +6679,7 @@ var CapturaBP = () => {
6601
6679
 
6602
6680
  // src/App.tsx
6603
6681
  var import_type_store6 = __toESM(require("type-store"), 1);
6604
- var import_jsx_runtime39 = require("react/jsx-runtime");
6682
+ var import_jsx_runtime40 = require("react/jsx-runtime");
6605
6683
  var LocationTracker = () => {
6606
6684
  const location = (0, import_react_router_dom15.useLocation)();
6607
6685
  const dispatch = useAppDispatch();
@@ -6611,45 +6689,45 @@ var LocationTracker = () => {
6611
6689
  return null;
6612
6690
  };
6613
6691
  function FrontendPlusReactRoutes({ myRoutes, myUnloggedRoutes, layout: Layout = MainLayout_default, unloggedLayout: UnloggedLayout }) {
6614
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
6615
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(InitialRedirectHandler_default, {}),
6616
- puenteBPHabilitado() && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(CapturaBP, {}),
6617
- /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_react_router_dom15.Routes, { children: [
6618
- /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_react_router_dom15.Route, { element: UnloggedLayout ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(UnloggedLayout, {}) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react_router_dom15.Outlet, {}), children: [
6619
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react_router_dom15.Route, { path: "/login", element: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(LoginPage_default, {}) }),
6620
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react_router_dom15.Route, { path: "/logout", element: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(LogoutPage_default, {}) }),
6692
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
6693
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(InitialRedirectHandler_default, {}),
6694
+ puenteBPHabilitado() && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(CapturaBP, {}),
6695
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_react_router_dom15.Routes, { children: [
6696
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_react_router_dom15.Route, { element: UnloggedLayout ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(UnloggedLayout, {}) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react_router_dom15.Outlet, {}), children: [
6697
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react_router_dom15.Route, { path: "/login", element: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(LoginPage_default, {}) }),
6698
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react_router_dom15.Route, { path: "/logout", element: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(LogoutPage_default, {}) }),
6621
6699
  myUnloggedRoutes
6622
6700
  ] }),
6623
- /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_react_router_dom15.Route, { element: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PrivateRoute_default, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Layout, {}) }), children: [
6624
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react_router_dom15.Route, { path: "/", element: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PantallaInicial_default, {}) }),
6625
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react_router_dom15.Route, { path: "/table/:tableName", element: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(GenericDataGridPage_default, {}) }),
6626
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react_router_dom15.Route, { path: "/menu/:menuName", element: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MenuTablePage_default, {}) }),
6627
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react_router_dom15.Route, { path: "/procedures/:procedureName", element: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ProcedureForm_default, {}) }),
6628
- Object.keys(wScreens).map((screenName) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
6701
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_react_router_dom15.Route, { element: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(PrivateRoute_default, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Layout, {}) }), children: [
6702
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react_router_dom15.Route, { path: "/", element: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(PantallaInicial_default, {}) }),
6703
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react_router_dom15.Route, { path: "/table/:tableName", element: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(GenericDataGridPage_default, {}) }),
6704
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react_router_dom15.Route, { path: "/menu/*", element: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(MenuTablePage_default, {}) }),
6705
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react_router_dom15.Route, { path: "/procedures/:procedureName", element: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ProcedureForm_default, {}) }),
6706
+ Object.keys(wScreens).map((screenName) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
6629
6707
  import_react_router_dom15.Route,
6630
6708
  {
6631
6709
  path: `/wScreens/${screenName}`,
6632
- element: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PantallaDeRuta, { screenName })
6710
+ element: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(PantallaDeRuta, { screenName })
6633
6711
  },
6634
6712
  screenName
6635
6713
  )),
6636
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react_router_dom15.Route, { path: "/wScreens-fallback/:screenName", element: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PantallaDeRespaldo, {}) }),
6637
- puenteBPHabilitado() && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react_router_dom15.Route, { path: "/bp/menu", element: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PaginaBP, {}) }),
6638
- puenteBPHabilitado() && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react_router_dom15.Route, { path: "/bp/table/:tableName", element: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(PaginaGrillaBP, {}) }),
6714
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react_router_dom15.Route, { path: "/wScreens-fallback/:screenName", element: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(PantallaDeRespaldo, {}) }),
6715
+ puenteBPHabilitado() && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react_router_dom15.Route, { path: "/bp/menu", element: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(PaginaBP, {}) }),
6716
+ puenteBPHabilitado() && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react_router_dom15.Route, { path: "/bp/table/:tableName", element: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(PaginaGrillaBP, {}) }),
6639
6717
  myRoutes,
6640
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react_router_dom15.Route, { path: "*", element: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { style: { marginTop: "20px", marginLeft: "10px" }, children: "404 - Recurso No Encontrado" }) })
6718
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react_router_dom15.Route, { path: "*", element: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { style: { marginTop: "20px", marginLeft: "10px" }, children: "404 - Recurso No Encontrado" }) })
6641
6719
  ] }),
6642
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react_router_dom15.Route, { path: "*", element: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react_router_dom15.Navigate, { to: "/", replace: true }) })
6720
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react_router_dom15.Route, { path: "*", element: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react_router_dom15.Navigate, { to: "/", replace: true }) })
6643
6721
  ] })
6644
6722
  ] });
6645
6723
  }
6646
6724
  var FrontendPlusProviders = ({ children, publicPaths }) => {
6647
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react_redux5.Provider, { store, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react44.PersistGate, { loading: null, persistor, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_react_router_dom15.BrowserRouter, { basename: rutaBase, children: [
6648
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(LocationTracker, {}),
6725
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react_redux5.Provider, { store, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react44.PersistGate, { loading: null, persistor, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_react_router_dom15.BrowserRouter, { basename: rutaBase, children: [
6726
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(LocationTracker, {}),
6649
6727
  " ",
6650
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(AppProvider, { publicPaths, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(SnackbarProvider, { children: [
6728
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(AppProvider, { publicPaths, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(SnackbarProvider, { children: [
6651
6729
  children,
6652
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(SessionExpiredMessage_default, {})
6730
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SessionExpiredMessage_default, {})
6653
6731
  ] }) })
6654
6732
  ] }) }) });
6655
6733
  };
@@ -6693,7 +6771,7 @@ var App = ({
6693
6771
  const extracted = extractPathsFromRoutes(myUnloggedRoutes);
6694
6772
  return ["/login", "/logout", ...extracted];
6695
6773
  }, [myUnloggedRoutes]);
6696
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(FrontendPlusProviders, { publicPaths: safePaths, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
6774
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(FrontendPlusProviders, { publicPaths: safePaths, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
6697
6775
  FrontendPlusReactRoutes,
6698
6776
  {
6699
6777
  myRoutes,