frontend-plus-react 0.3.0 → 0.4.1

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.js CHANGED
@@ -3457,6 +3457,10 @@ var VerticalEditorPage = ({
3457
3457
  ] });
3458
3458
  };
3459
3459
 
3460
+ // src/rutaBase.ts
3461
+ var baseDelBundler = import.meta.env?.BASE_URL ?? "/";
3462
+ var rutaBase = baseDelBundler.replace(/\/+$/, "");
3463
+
3460
3464
  // src/components/grid/GenericDataGrid.tsx
3461
3465
  import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
3462
3466
  var SUMMARY_ROW_HEIGHT = 35;
@@ -3846,7 +3850,7 @@ var GenericDataGrid = ({
3846
3850
  const abrirWScreenEnPestana = useCallback11((row, detailTable) => {
3847
3851
  const parametros = new URLSearchParams();
3848
3852
  calcularFixedFieldsDetalle(detailTable, row).forEach((ff) => parametros.set(ff.fieldName, String(ff.value)));
3849
- window.open(`${window.location.origin}/wScreens/${detailTable.wScreen}?${parametros}`, "_blank");
3853
+ window.open(`${window.location.origin}${rutaBase}/wScreens/${detailTable.wScreen}?${parametros}`, "_blank");
3850
3854
  }, []);
3851
3855
  const alternarDetalle = useCallback11((row, rowId, detailTable, enOtraPestana) => {
3852
3856
  if (enOtraPestana && detailTable.wScreen) {
@@ -4189,8 +4193,8 @@ var GenericDataGrid = ({
4189
4193
  var GenericDataGrid_default = GenericDataGrid;
4190
4194
 
4191
4195
  // src/App.tsx
4192
- import React25, { useEffect as useEffect13, useMemo as useMemo14 } from "react";
4193
- import { BrowserRouter, Routes, Route, useLocation as useLocation6, Navigate as Navigate2, Outlet as Outlet2 } from "react-router-dom";
4196
+ import React28, { useEffect as useEffect16, useMemo as useMemo14 } from "react";
4197
+ import { BrowserRouter, Routes, Route, useLocation as useLocation7, Navigate as Navigate4, Outlet as Outlet2 } from "react-router-dom";
4194
4198
 
4195
4199
  // src/components/MainLayout.tsx
4196
4200
  import { useEffect as useEffect8 } from "react";
@@ -4322,13 +4326,33 @@ import ExpandMore from "@mui/icons-material/ExpandMore";
4322
4326
  import TableChartIcon from "@mui/icons-material/TableChart";
4323
4327
  import FolderIcon from "@mui/icons-material/Folder";
4324
4328
  import DnsIcon from "@mui/icons-material/Dns";
4325
- import HomeIcon from "@mui/icons-material/Home";
4326
4329
  import WarningAmberIcon3 from "@mui/icons-material/WarningAmber";
4327
4330
  import DesktopWindowsIcon from "@mui/icons-material/DesktopWindows";
4328
4331
  import UnfoldMoreIcon from "@mui/icons-material/UnfoldMore";
4329
4332
  import UnfoldLessIcon from "@mui/icons-material/UnfoldLess";
4330
4333
  import { useNavigate as useNavigate2, useLocation as useLocation2 } from "react-router-dom";
4331
4334
  import { blue, orange, teal, red, grey } from "@mui/material/colors";
4335
+
4336
+ // src/utils/menuInicial.ts
4337
+ function rutaDeItemDeMenu(item) {
4338
+ if (item.menuType === "table") {
4339
+ const consulta = new URLSearchParams();
4340
+ if (item.td) consulta.append("td", JSON.stringify(item.td));
4341
+ if (item.fc) consulta.append("fc", JSON.stringify(item.fc));
4342
+ return `/menu/${item.name}${consulta.size ? `?${consulta.toString()}` : ""}`;
4343
+ }
4344
+ if (item.menuType === "proc") return `/procedures/${item.name}`;
4345
+ if (wScreens[item.menuType] !== void 0) return `/wScreens/${item.menuType}`;
4346
+ console.warn(`Menu type '${item.menuType}' no reconocido o WScreen no mapeada.`);
4347
+ return `/wScreens-fallback/${item.menuType}`;
4348
+ }
4349
+ function itemInicial(menu) {
4350
+ const elegido = menu.find((item) => item.selectedByDefault);
4351
+ if (!elegido) return void 0;
4352
+ return elegido.menuType === "menu" ? itemInicial(elegido.menuContent) : elegido;
4353
+ }
4354
+
4355
+ // src/components/SideMenu.tsx
4332
4356
  import { jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
4333
4357
  var MenuListItem = ({ item, level, onMenuItemClick }) => {
4334
4358
  const navigate = useNavigate2();
@@ -4339,29 +4363,7 @@ var MenuListItem = ({ item, level, onMenuItemClick }) => {
4339
4363
  if (item.menuType === "menu") {
4340
4364
  dispatch(toggleSubMenu(item.name));
4341
4365
  } else {
4342
- let path = "";
4343
- const queryParams = new URLSearchParams();
4344
- if (item.menuType === "table") {
4345
- path = `/menu/${item.name}`;
4346
- if (item.td) queryParams.append("td", JSON.stringify(item.td));
4347
- if (item.fc) queryParams.append("fc", JSON.stringify(item.fc));
4348
- if (queryParams.toString()) {
4349
- path = `${path}?${queryParams.toString()}`;
4350
- }
4351
- } else if (item.menuType === "proc") {
4352
- path = `/procedures/${item.name}`;
4353
- } else {
4354
- const WScreenComponent = wScreens[item.menuType];
4355
- if (WScreenComponent !== void 0) {
4356
- path = `/wScreens/${item.menuType}`;
4357
- } else {
4358
- path = `/wScreens-fallback/${item.menuType}`;
4359
- console.warn(`Menu type '${item.menuType}' no reconocido o WScreen no mapeada.`);
4360
- }
4361
- }
4362
- if (path) {
4363
- navigate(path);
4364
- }
4366
+ navigate(rutaDeItemDeMenu(item));
4365
4367
  if (onMenuItemClick) {
4366
4368
  onMenuItemClick();
4367
4369
  }
@@ -4434,19 +4436,12 @@ var SideMenu = ({ onMenuItemClick }) => {
4434
4436
  const allSubMenusKeys = Object.keys(subMenuOpenStates);
4435
4437
  const openSubMenusCount = allSubMenusKeys.filter((key) => subMenuOpenStates[key]).length;
4436
4438
  const isMostlyOpen = allSubMenusKeys.length > 0 && openSubMenusCount / allSubMenusKeys.length > 0.5;
4437
- const handleHomeClick = () => {
4438
- navigate("/home");
4439
- if (onMenuItemClick) {
4440
- onMenuItemClick();
4441
- }
4442
- };
4443
4439
  const handleToggleAllSubMenus = () => {
4444
4440
  dispatch(setAllSubMenusOpen(!isMostlyOpen));
4445
4441
  };
4446
4442
  if (!clientContext || !clientContext.menu) {
4447
4443
  return /* @__PURE__ */ jsx20(Box13, { sx: { p: 2, textAlign: "center" }, children: /* @__PURE__ */ jsx20(Typography9, { variant: "body2", color: "text.secondary", children: "Cargando men\xFA..." }) });
4448
4444
  }
4449
- const isHomeSelected = location.pathname === "/home";
4450
4445
  useEffect7(() => {
4451
4446
  if (!clientContext?.menu) return;
4452
4447
  const expandParents = (items, targetPath, parentNames = []) => {
@@ -4482,22 +4477,15 @@ var SideMenu = ({ onMenuItemClick }) => {
4482
4477
  /* @__PURE__ */ jsx20(ListItemText2, { primary: isMostlyOpen ? "colapsar " : "expandir" })
4483
4478
  ] }) }),
4484
4479
  /* @__PURE__ */ jsx20(Divider2, {}),
4485
- /* @__PURE__ */ jsxs14(List2, { children: [
4486
- /* @__PURE__ */ jsx20(ListItem, { disablePadding: true, children: /* @__PURE__ */ jsxs14(ListItemButton2, { onClick: handleHomeClick, selected: isHomeSelected, children: [
4487
- /* @__PURE__ */ jsx20(ListItemIcon2, { sx: { minWidth: "38px" }, children: /* @__PURE__ */ jsx20(HomeIcon, {}) }),
4488
- /* @__PURE__ */ jsx20(ListItemText2, { primary: "Inicio" })
4489
- ] }) }),
4490
- /* @__PURE__ */ jsx20(Divider2, {}),
4491
- clientContext.menu.map((menuItem) => /* @__PURE__ */ jsx20(
4492
- MenuListItem,
4493
- {
4494
- item: menuItem,
4495
- level: 1,
4496
- onMenuItemClick
4497
- },
4498
- menuItem.name
4499
- ))
4500
- ] })
4480
+ /* @__PURE__ */ jsx20(List2, { children: clientContext.menu.map((menuItem) => /* @__PURE__ */ jsx20(
4481
+ MenuListItem,
4482
+ {
4483
+ item: menuItem,
4484
+ level: 1,
4485
+ onMenuItemClick
4486
+ },
4487
+ menuItem.name
4488
+ )) })
4501
4489
  ] });
4502
4490
  };
4503
4491
  var SideMenu_default = SideMenu;
@@ -4556,7 +4544,6 @@ var MainLayout = () => {
4556
4544
  if (!clientContext) {
4557
4545
  return /* @__PURE__ */ jsx21(Box14, { sx: { display: "flex", justifyContent: "center", alignItems: "center", height: "100vh" }, children: /* @__PURE__ */ jsx21(Typography10, { children: "Cargando dise\xF1o de la aplicaci\xF3n..." }) });
4558
4546
  }
4559
- const appBarOffset = theme.mixins.toolbar;
4560
4547
  return /* @__PURE__ */ jsxs15(Box14, { sx: { display: "flex", height: "100vh" }, children: [
4561
4548
  /* @__PURE__ */ jsx21(CssBaseline, {}),
4562
4549
  /* @__PURE__ */ jsx21(
@@ -4660,7 +4647,7 @@ var MainLayout = () => {
4660
4647
  ]
4661
4648
  }
4662
4649
  ),
4663
- /* @__PURE__ */ jsx21(
4650
+ /* @__PURE__ */ jsxs15(
4664
4651
  Box14,
4665
4652
  {
4666
4653
  component: "main",
@@ -4680,15 +4667,16 @@ var MainLayout = () => {
4680
4667
  },
4681
4668
  minWidth: 0,
4682
4669
  flexShrink: 0,
4683
- // Asegúrate de que el paddingTop sea suficiente para la AppBar
4684
- paddingTop: `${appBarOffset.minHeight}px`,
4685
4670
  height: "100%",
4686
4671
  boxSizing: "border-box",
4687
4672
  display: "flex",
4688
4673
  flexDirection: "column",
4689
4674
  width: isDrawerOpen ? `calc(100% - ${drawerWidth}px)` : "100%"
4690
4675
  },
4691
- children: /* @__PURE__ */ jsx21(Outlet, {})
4676
+ children: [
4677
+ /* @__PURE__ */ jsx21(Toolbar, {}),
4678
+ /* @__PURE__ */ jsx21(Box14, { sx: { flex: 1, minHeight: 0, overflowY: "auto", display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ jsx21(Outlet, {}) })
4679
+ ]
4692
4680
  }
4693
4681
  )
4694
4682
  ] });
@@ -4746,28 +4734,26 @@ var SessionExpiredMessage = () => {
4746
4734
  };
4747
4735
  var SessionExpiredMessage_default = SessionExpiredMessage;
4748
4736
 
4749
- // src/pages/HomePage.tsx
4750
- import { Box as Box16, Typography as Typography12 } from "@mui/material";
4751
- import { jsx as jsx23, jsxs as jsxs17 } from "react/jsx-runtime";
4752
- var HomePage = () => {
4737
+ // src/pages/PantallaInicial.tsx
4738
+ import { Navigate } from "react-router-dom";
4739
+ import { jsx as jsx23 } from "react/jsx-runtime";
4740
+ var PantallaInicial = () => {
4753
4741
  const { clientContext } = useApp();
4754
- return /* @__PURE__ */ jsxs17(Box16, { sx: { p: 3 }, children: [
4755
- /* @__PURE__ */ jsx23(Typography12, { variant: "h4", component: "h1", gutterBottom: true, children: `Bienvenido/a ${clientContext?.username}` }),
4756
- /* @__PURE__ */ jsx23(Typography12, { variant: "body1", children: "Usa el men\xFA lateral para navegar por las diferentes secciones." })
4757
- ] });
4742
+ const item = clientContext.menu ? itemInicial(clientContext.menu) : void 0;
4743
+ return item ? /* @__PURE__ */ jsx23(Navigate, { to: rutaDeItemDeMenu(item), replace: true }) : null;
4758
4744
  };
4759
- var HomePage_default = HomePage;
4745
+ var PantallaInicial_default = PantallaInicial;
4760
4746
 
4761
4747
  // src/pages/LogoutPage.tsx
4762
4748
  import { useEffect as useEffect9 } from "react";
4763
- import { Box as Box17, Typography as Typography13, CircularProgress as CircularProgress5 } from "@mui/material";
4764
- import { jsx as jsx24, jsxs as jsxs18 } from "react/jsx-runtime";
4749
+ import { Box as Box16, Typography as Typography12, CircularProgress as CircularProgress5 } from "@mui/material";
4750
+ import { jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
4765
4751
  var LogoutPage = () => {
4766
4752
  const logout = useLogout_default();
4767
4753
  useEffect9(() => {
4768
4754
  logout();
4769
4755
  }, [logout]);
4770
- return /* @__PURE__ */ jsxs18(Box17, { sx: {
4756
+ return /* @__PURE__ */ jsxs17(Box16, { sx: {
4771
4757
  display: "flex",
4772
4758
  flexDirection: "column",
4773
4759
  justifyContent: "center",
@@ -4776,20 +4762,20 @@ var LogoutPage = () => {
4776
4762
  textAlign: "center"
4777
4763
  }, children: [
4778
4764
  /* @__PURE__ */ jsx24(CircularProgress5, { size: 60 }),
4779
- /* @__PURE__ */ jsx24(Typography13, { variant: "h6", sx: { mt: 2 }, children: "Cerrando sesi\xF3n..." })
4765
+ /* @__PURE__ */ jsx24(Typography12, { variant: "h6", sx: { mt: 2 }, children: "Cerrando sesi\xF3n..." })
4780
4766
  ] });
4781
4767
  };
4782
4768
  var LogoutPage_default = LogoutPage;
4783
4769
 
4784
4770
  // src/pages/LoginPage.tsx
4785
4771
  import { useState as useState14 } from "react";
4786
- import { Button as Button8, TextField as TextField2, Typography as Typography14, Alert as Alert3, AlertTitle, Box as Box18, CircularProgress as CircularProgress6 } from "@mui/material";
4772
+ import { Button as Button8, TextField as TextField2, Typography as Typography13, Alert as Alert3, AlertTitle, Box as Box17, CircularProgress as CircularProgress6 } from "@mui/material";
4787
4773
  import { useForm, Controller } from "react-hook-form";
4788
4774
  import { zodResolver } from "@hookform/resolvers/zod";
4789
4775
  import * as z from "zod";
4790
4776
  import { useNavigate as useNavigate4 } from "react-router-dom";
4791
4777
  import { useDispatch as useDispatch4 } from "react-redux";
4792
- import { Fragment as Fragment3, jsx as jsx25, jsxs as jsxs19 } from "react/jsx-runtime";
4778
+ import { Fragment as Fragment3, jsx as jsx25, jsxs as jsxs18 } from "react/jsx-runtime";
4793
4779
  var loginSchema = z.object({
4794
4780
  username: z.string().min(1, "El usuario es requerido"),
4795
4781
  // Añadir validación básica
@@ -4835,7 +4821,7 @@ var LoginPage = () => {
4835
4821
  setIsLoggedIn(true);
4836
4822
  await dispatch(fetchClientContext()).unwrap();
4837
4823
  console.log("Login exitoso y clientContext cargado.");
4838
- navigate("/home");
4824
+ navigate("/");
4839
4825
  reset();
4840
4826
  } catch (error) {
4841
4827
  console.error("Error al iniciar sesi\xF3n:", error);
@@ -4846,15 +4832,15 @@ var LoginPage = () => {
4846
4832
  }
4847
4833
  };
4848
4834
  return /* @__PURE__ */ jsx25(
4849
- Box18,
4835
+ Box17,
4850
4836
  {
4851
4837
  display: "flex",
4852
4838
  alignItems: "center",
4853
4839
  justifyContent: "center",
4854
4840
  minHeight: "100vh",
4855
4841
  bgcolor: "#f5f5f5",
4856
- children: /* @__PURE__ */ jsxs19(
4857
- Box18,
4842
+ children: /* @__PURE__ */ jsxs18(
4843
+ Box17,
4858
4844
  {
4859
4845
  width: "100%",
4860
4846
  maxWidth: "400px",
@@ -4863,7 +4849,7 @@ var LoginPage = () => {
4863
4849
  borderRadius: 8,
4864
4850
  boxShadow: 3,
4865
4851
  children: [
4866
- /* @__PURE__ */ jsx25(Box18, { sx: { display: "flex", justifyContent: "center", mb: 3 }, children: /* @__PURE__ */ jsx25(
4852
+ /* @__PURE__ */ jsx25(Box17, { sx: { display: "flex", justifyContent: "center", mb: 3 }, children: /* @__PURE__ */ jsx25(
4867
4853
  "img",
4868
4854
  {
4869
4855
  src: `${envConfig.backendUrl}/img/login-logo-icon.png`,
@@ -4871,10 +4857,10 @@ var LoginPage = () => {
4871
4857
  style: { height: "192px", maxWidth: "100%", objectFit: "contain" }
4872
4858
  }
4873
4859
  ) }),
4874
- /* @__PURE__ */ jsx25(Typography14, { variant: "h5", align: "center", gutterBottom: true, sx: { fontWeight: "bold", color: "primary.main" }, children: "Iniciar Sesi\xF3n" }),
4875
- /* @__PURE__ */ jsxs19("form", { onSubmit: handleSubmit(onSubmit), className: "space-y-4", children: [
4876
- /* @__PURE__ */ jsxs19("div", { children: [
4877
- /* @__PURE__ */ jsx25("label", { htmlFor: "username", children: /* @__PURE__ */ jsx25(Typography14, { variant: "subtitle1", component: "div", sx: { fontWeight: "medium" }, children: "Usuario" }) }),
4860
+ /* @__PURE__ */ jsx25(Typography13, { variant: "h5", align: "center", gutterBottom: true, sx: { fontWeight: "bold", color: "primary.main" }, children: "Iniciar Sesi\xF3n" }),
4861
+ /* @__PURE__ */ jsxs18("form", { onSubmit: handleSubmit(onSubmit), className: "space-y-4", children: [
4862
+ /* @__PURE__ */ jsxs18("div", { children: [
4863
+ /* @__PURE__ */ jsx25("label", { htmlFor: "username", children: /* @__PURE__ */ jsx25(Typography13, { variant: "subtitle1", component: "div", sx: { fontWeight: "medium" }, children: "Usuario" }) }),
4878
4864
  /* @__PURE__ */ jsx25(
4879
4865
  Controller,
4880
4866
  {
@@ -4896,8 +4882,8 @@ var LoginPage = () => {
4896
4882
  }
4897
4883
  )
4898
4884
  ] }),
4899
- /* @__PURE__ */ jsxs19("div", { children: [
4900
- /* @__PURE__ */ jsx25("label", { htmlFor: "password", children: /* @__PURE__ */ jsx25(Typography14, { variant: "subtitle1", component: "div", sx: { fontWeight: "medium" }, children: "Contrase\xF1a" }) }),
4885
+ /* @__PURE__ */ jsxs18("div", { children: [
4886
+ /* @__PURE__ */ jsx25("label", { htmlFor: "password", children: /* @__PURE__ */ jsx25(Typography13, { variant: "subtitle1", component: "div", sx: { fontWeight: "medium" }, children: "Contrase\xF1a" }) }),
4901
4887
  /* @__PURE__ */ jsx25(
4902
4888
  Controller,
4903
4889
  {
@@ -4919,12 +4905,12 @@ var LoginPage = () => {
4919
4905
  }
4920
4906
  )
4921
4907
  ] }),
4922
- /* @__PURE__ */ jsx25(Button8, { type: "submit", fullWidth: true, variant: "contained", color: "primary", disabled: isSubmitting, sx: { mt: 2 }, children: isSubmitting ? /* @__PURE__ */ jsxs19(Fragment3, { children: [
4908
+ /* @__PURE__ */ jsx25(Button8, { type: "submit", fullWidth: true, variant: "contained", color: "primary", disabled: isSubmitting, sx: { mt: 2 }, children: isSubmitting ? /* @__PURE__ */ jsxs18(Fragment3, { children: [
4923
4909
  /* @__PURE__ */ jsx25(CircularProgress6, { size: 20, sx: { mr: 1 } }),
4924
4910
  "Iniciando sesi\xF3n..."
4925
4911
  ] }) : "Iniciar Sesi\xF3n" })
4926
4912
  ] }),
4927
- loginError && /* @__PURE__ */ jsxs19(Alert3, { severity: "error", sx: { mt: 2, maxHeight: "200px" }, children: [
4913
+ loginError && /* @__PURE__ */ jsxs18(Alert3, { severity: "error", sx: { mt: 2, maxHeight: "200px" }, children: [
4928
4914
  " ",
4929
4915
  /* @__PURE__ */ jsx25(AlertTitle, { children: "Error" }),
4930
4916
  loginError
@@ -4950,8 +4936,8 @@ import {
4950
4936
  Checkbox as Checkbox3,
4951
4937
  FormControlLabel as FormControlLabel3,
4952
4938
  FormHelperText as FormHelperText2,
4953
- Typography as Typography16,
4954
- Box as Box20,
4939
+ Typography as Typography15,
4940
+ Box as Box19,
4955
4941
  CircularProgress as CircularProgress7,
4956
4942
  Alert as Alert4,
4957
4943
  Divider as Divider3,
@@ -4959,14 +4945,14 @@ import {
4959
4945
  } from "@mui/material";
4960
4946
 
4961
4947
  // src/pages/procedure-results/SuccessDisplay.tsx
4962
- import { Box as Box19, Typography as Typography15, Paper as Paper3 } from "@mui/material";
4963
- import { jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
4948
+ import { Box as Box18, Typography as Typography14, Paper as Paper3 } from "@mui/material";
4949
+ import { jsx as jsx26, jsxs as jsxs19 } from "react/jsx-runtime";
4964
4950
  var SuccessDisplay = ({ data }) => {
4965
- return /* @__PURE__ */ jsxs20(Paper3, { elevation: 2, sx: { p: 2, mt: 2, bgcolor: "success.light", color: "success.contrastText" }, children: [
4966
- /* @__PURE__ */ jsx26(Typography15, { variant: "h6", sx: { fontSize: "1rem", mb: 1 }, children: "\xA1Operaci\xF3n Exitosa!" }),
4967
- /* @__PURE__ */ jsx26(Typography15, { variant: "body2", sx: { fontSize: "0.85rem" }, children: "Detalles del resultado:" }),
4968
- /* @__PURE__ */ jsx26(Box19, { sx: { bgcolor: "success.dark", p: 1, borderRadius: 1, mt: 1, overflowX: "auto" }, children: /* @__PURE__ */ jsx26("pre", { style: { margin: 0, fontSize: "0.75rem", color: "white" }, children: JSON.stringify(data, null, 2) }) }),
4969
- /* @__PURE__ */ jsx26(Typography15, { variant: "body2", sx: { fontSize: "0.8rem", mt: 1 }, children: "Puedes revisar los detalles anteriores o cerrar este mensaje." })
4951
+ return /* @__PURE__ */ jsxs19(Paper3, { elevation: 2, sx: { p: 2, mt: 2, bgcolor: "success.light", color: "success.contrastText" }, children: [
4952
+ /* @__PURE__ */ jsx26(Typography14, { variant: "h6", sx: { fontSize: "1rem", mb: 1 }, children: "\xA1Operaci\xF3n Exitosa!" }),
4953
+ /* @__PURE__ */ jsx26(Typography14, { variant: "body2", sx: { fontSize: "0.85rem" }, children: "Detalles del resultado:" }),
4954
+ /* @__PURE__ */ jsx26(Box18, { sx: { bgcolor: "success.dark", p: 1, borderRadius: 1, mt: 1, overflowX: "auto" }, children: /* @__PURE__ */ jsx26("pre", { style: { margin: 0, fontSize: "0.75rem", color: "white" }, children: JSON.stringify(data, null, 2) }) }),
4955
+ /* @__PURE__ */ jsx26(Typography14, { variant: "body2", sx: { fontSize: "0.8rem", mt: 1 }, children: "Puedes revisar los detalles anteriores o cerrar este mensaje." })
4970
4956
  ] });
4971
4957
  };
4972
4958
  var SuccessDisplay_default = SuccessDisplay;
@@ -4980,7 +4966,7 @@ var extendResultsOk = (newComponents) => {
4980
4966
  };
4981
4967
 
4982
4968
  // src/components/ProcedureForm.tsx
4983
- import { jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
4969
+ import { jsx as jsx27, jsxs as jsxs20 } from "react/jsx-runtime";
4984
4970
  var ProcedureForm = () => {
4985
4971
  const { procedureName } = useParams();
4986
4972
  const { clientContext } = useApp();
@@ -5195,9 +5181,9 @@ var ProcedureForm = () => {
5195
5181
  sx: { fontSize: "0.8rem" }
5196
5182
  };
5197
5183
  if (param.options && param.options.length > 0) {
5198
- return /* @__PURE__ */ jsxs21(FormControl3, { fullWidth: true, margin: "dense", size: "small", error: hasError, required: commonProps.required, children: [
5184
+ return /* @__PURE__ */ jsxs20(FormControl3, { fullWidth: true, margin: "dense", size: "small", error: hasError, required: commonProps.required, children: [
5199
5185
  /* @__PURE__ */ jsx27(InputLabel2, { id: `${param.name}-label`, sx: { fontSize: "0.8rem" }, children: param.label || param.name }),
5200
- /* @__PURE__ */ jsxs21(
5186
+ /* @__PURE__ */ jsxs20(
5201
5187
  Select2,
5202
5188
  {
5203
5189
  labelId: `${param.name}-label`,
@@ -5208,7 +5194,7 @@ var ProcedureForm = () => {
5208
5194
  label: param.label || param.name,
5209
5195
  disabled: apiLoading,
5210
5196
  sx: { fontSize: "0.8rem" },
5211
- renderValue: (selected) => /* @__PURE__ */ jsx27(Typography16, { sx: { fontSize: "0.8rem" }, children: selected }),
5197
+ renderValue: (selected) => /* @__PURE__ */ jsx27(Typography15, { sx: { fontSize: "0.8rem" }, children: selected }),
5212
5198
  children: [
5213
5199
  (!commonProps.required || formValues[param.name] === "") && /* @__PURE__ */ jsx27(MenuItem2, { value: "", sx: { fontSize: "0.8rem" }, children: /* @__PURE__ */ jsx27("em", { children: "Seleccione..." }) }),
5214
5200
  param.options.map((option) => /* @__PURE__ */ jsx27(MenuItem2, { value: option, sx: { fontSize: "0.8rem" }, children: option }, option))
@@ -5246,7 +5232,7 @@ var ProcedureForm = () => {
5246
5232
  size: "small"
5247
5233
  }
5248
5234
  ),
5249
- label: /* @__PURE__ */ jsx27(Typography16, { sx: { fontSize: "0.8rem", color: hasError ? "error.main" : "inherit" }, children: param.label || param.name }),
5235
+ label: /* @__PURE__ */ jsx27(Typography15, { sx: { fontSize: "0.8rem", color: hasError ? "error.main" : "inherit" }, children: param.label || param.name }),
5250
5236
  sx: { mt: 1, mb: 0 }
5251
5237
  }
5252
5238
  );
@@ -5258,8 +5244,8 @@ var ProcedureForm = () => {
5258
5244
  case "jsona":
5259
5245
  return /* @__PURE__ */ jsx27(TextField3, { multiline: true, rows: 5, value: formValues[param.name] || "", ...commonProps, InputProps: { sx: { fontSize: "0.8rem" } } });
5260
5246
  case "bytea":
5261
- return /* @__PURE__ */ jsxs21(FormControl3, { fullWidth: true, margin: "dense", error: hasError, required: commonProps.required, children: [
5262
- /* @__PURE__ */ jsx27(Typography16, { variant: "body2", color: "textSecondary", component: "label", htmlFor: param.name, sx: { fontSize: "0.8rem", color: hasError ? "error.main" : "text.secondary" }, children: param.label || param.name }),
5247
+ return /* @__PURE__ */ jsxs20(FormControl3, { fullWidth: true, margin: "dense", error: hasError, required: commonProps.required, children: [
5248
+ /* @__PURE__ */ jsx27(Typography15, { variant: "body2", color: "textSecondary", component: "label", htmlFor: param.name, sx: { fontSize: "0.8rem", color: hasError ? "error.main" : "text.secondary" }, children: param.label || param.name }),
5263
5249
  /* @__PURE__ */ jsx27(
5264
5250
  "input",
5265
5251
  {
@@ -5286,13 +5272,13 @@ var ProcedureForm = () => {
5286
5272
  if (ComponentToRender) {
5287
5273
  return /* @__PURE__ */ jsx27(ComponentToRender, { data: procedureResultData });
5288
5274
  } else {
5289
- return /* @__PURE__ */ jsxs21(Paper4, { elevation: 2, sx: { p: 2, mt: 0, bgcolor: "warning.light" }, children: [
5290
- /* @__PURE__ */ jsxs21(Typography16, { variant: "h6", sx: { fontSize: "1rem", mb: 1 }, children: [
5275
+ return /* @__PURE__ */ jsxs20(Paper4, { elevation: 2, sx: { p: 2, mt: 0, bgcolor: "warning.light" }, children: [
5276
+ /* @__PURE__ */ jsxs20(Typography15, { variant: "h6", sx: { fontSize: "1rem", mb: 1 }, children: [
5291
5277
  "el componente para resolver el resultOk: '",
5292
5278
  procedure.resultOk,
5293
5279
  "' definido en el procedure no existe o no est\xE1 mapeado."
5294
5280
  ] }),
5295
- /* @__PURE__ */ jsx27(Box20, { sx: {
5281
+ /* @__PURE__ */ jsx27(Box19, { sx: {
5296
5282
  bgcolor: "warning.dark",
5297
5283
  p: 1,
5298
5284
  borderRadius: 1
@@ -5301,7 +5287,7 @@ var ProcedureForm = () => {
5301
5287
  }
5302
5288
  }, [procedureResultData, procedure]);
5303
5289
  if (!procedure) {
5304
- return /* @__PURE__ */ jsxs21(Box20, { sx: {
5290
+ return /* @__PURE__ */ jsxs20(Box19, { sx: {
5305
5291
  p: 2,
5306
5292
  width: "100%",
5307
5293
  boxSizing: "border-box",
@@ -5312,12 +5298,12 @@ var ProcedureForm = () => {
5312
5298
  textAlign: "center"
5313
5299
  }, children: [
5314
5300
  /* @__PURE__ */ jsx27(CircularProgress7, { sx: { mb: 2 } }),
5315
- /* @__PURE__ */ jsx27(Typography16, { variant: "h6", color: "text.secondary", children: "Cargando procedimiento o no encontrado..." })
5301
+ /* @__PURE__ */ jsx27(Typography15, { variant: "h6", color: "text.secondary", children: "Cargando procedimiento o no encontrado..." })
5316
5302
  ] });
5317
5303
  }
5318
5304
  return (
5319
5305
  // Esta es la Box más externa que ahora controlará el scroll
5320
- /* @__PURE__ */ jsxs21(Box20, { sx: {
5306
+ /* @__PURE__ */ jsxs20(Box19, { sx: {
5321
5307
  p: 2,
5322
5308
  ml: 1,
5323
5309
  mt: 2,
@@ -5334,14 +5320,14 @@ var ProcedureForm = () => {
5334
5320
  overflowX: "hidden"
5335
5321
  // Oculta el scroll horizontal si no es necesario para el contenedor principal
5336
5322
  }, children: [
5337
- /* @__PURE__ */ jsx27(Typography16, { variant: "h5", component: "h2", gutterBottom: true, align: "left", children: cambiarGuionesBajosPorEspacios(procedure.proceedLabel || procedure.action) }),
5338
- Object.values(validationErrors).some((err) => err !== null) && /* @__PURE__ */ jsxs21(Alert4, { severity: "error", sx: { mb: 2, fontSize: "0.8rem" }, children: [
5323
+ /* @__PURE__ */ jsx27(Typography15, { variant: "h5", component: "h2", gutterBottom: true, align: "left", children: cambiarGuionesBajosPorEspacios(procedure.proceedLabel || procedure.action) }),
5324
+ Object.values(validationErrors).some((err) => err !== null) && /* @__PURE__ */ jsxs20(Alert4, { severity: "error", sx: { mb: 2, fontSize: "0.8rem" }, children: [
5339
5325
  "Por favor, corrige los errores en el formulario antes de enviar.",
5340
5326
  /* @__PURE__ */ jsx27("ul", { children: Object.values(validationErrors).map((err, idx) => err && /* @__PURE__ */ jsx27("li", { children: err }, idx)) })
5341
5327
  ] }),
5342
5328
  !Object.values(validationErrors).some((err) => err !== null) && apiError && /* @__PURE__ */ jsx27(Alert4, { severity: "error", sx: { mb: 2, fontSize: "0.8rem" }, children: apiError.message }),
5343
5329
  !Object.values(validationErrors).some((err) => err !== null) && !apiError && successMessage && /* @__PURE__ */ jsx27(Alert4, { severity: "success", sx: { mb: 2, fontSize: "0.8rem" }, children: successMessage }),
5344
- /* @__PURE__ */ jsxs21("form", { onSubmit: handleSubmit, children: [
5330
+ /* @__PURE__ */ jsxs20("form", { onSubmit: handleSubmit, children: [
5345
5331
  procedure.parameters.map((param) => /* @__PURE__ */ jsx27("div", { children: renderInputField(param) }, param.name)),
5346
5332
  /* @__PURE__ */ jsx27(
5347
5333
  Button9,
@@ -5357,15 +5343,15 @@ var ProcedureForm = () => {
5357
5343
  }
5358
5344
  )
5359
5345
  ] }),
5360
- ResultDisplayContent && /* @__PURE__ */ jsxs21(Box20, { sx: { mt: 2 }, children: [
5346
+ ResultDisplayContent && /* @__PURE__ */ jsxs20(Box19, { sx: { mt: 2 }, children: [
5361
5347
  " ",
5362
5348
  ResultDisplayContent
5363
5349
  ] }),
5364
- executionLog.length > 0 && /* @__PURE__ */ jsxs21(Box20, { sx: { mt: 3 }, children: [
5350
+ executionLog.length > 0 && /* @__PURE__ */ jsxs20(Box19, { sx: { mt: 3 }, children: [
5365
5351
  /* @__PURE__ */ jsx27(Divider3, { sx: { mb: 2 } }),
5366
- /* @__PURE__ */ jsx27(Typography16, { variant: "h6", gutterBottom: true, sx: { fontSize: "0.9rem" }, children: "Registro de Ejecuci\xF3n" }),
5352
+ /* @__PURE__ */ jsx27(Typography15, { variant: "h6", gutterBottom: true, sx: { fontSize: "0.9rem" }, children: "Registro de Ejecuci\xF3n" }),
5367
5353
  /* @__PURE__ */ jsx27(
5368
- Box20,
5354
+ Box19,
5369
5355
  {
5370
5356
  sx: {
5371
5357
  bgcolor: "grey.100",
@@ -5379,7 +5365,7 @@ var ProcedureForm = () => {
5379
5365
  whiteSpace: "pre-wrap"
5380
5366
  },
5381
5367
  children: executionLog.map((log, index) => /* @__PURE__ */ jsx27(
5382
- Typography16,
5368
+ Typography15,
5383
5369
  {
5384
5370
  component: "pre",
5385
5371
  sx: {
@@ -5405,7 +5391,7 @@ import { PersistGate } from "redux-persist/integration/react";
5405
5391
 
5406
5392
  // src/components/PrivateRoute.tsx
5407
5393
  import { useEffect as useEffect10 } from "react";
5408
- import { Navigate, useLocation as useLocation3 } from "react-router-dom";
5394
+ import { Navigate as Navigate2, useLocation as useLocation3 } from "react-router-dom";
5409
5395
  import { Fragment as Fragment4, jsx as jsx28 } from "react/jsx-runtime";
5410
5396
  var PrivateRoute = ({ children }) => {
5411
5397
  const location = useLocation3();
@@ -5417,7 +5403,7 @@ var PrivateRoute = ({ children }) => {
5417
5403
  useEffect10(() => {
5418
5404
  console.log(`[PrivateRoute] Effect: Path=${location.pathname}, AuthStatus=${clientContextStatus}, IsAuthenticated=${isAuthenticated}, IsLoadingAuth=${isLoadingAuth}`);
5419
5405
  if (!isAuthenticated && !isLoadingAuth && location.pathname !== "/login") {
5420
- const path = location.pathname + location.search;
5406
+ const path = location.pathname + location.search + location.hash;
5421
5407
  console.log(`[PrivateRoute] ACTION: Dispatching setRedirectPath(${path})`);
5422
5408
  dispatch(setRedirectPath(path));
5423
5409
  } else if (isAuthenticated) {
@@ -5434,7 +5420,7 @@ var PrivateRoute = ({ children }) => {
5434
5420
  }
5435
5421
  if (!isAuthenticated) {
5436
5422
  console.log(`[PrivateRoute] User not authenticated, navigating to /login`);
5437
- return /* @__PURE__ */ jsx28(Navigate, { to: "/login", replace: true });
5423
+ return /* @__PURE__ */ jsx28(Navigate2, { to: "/login", replace: true });
5438
5424
  }
5439
5425
  console.log(`[PrivateRoute] User authenticated, rendering children.`);
5440
5426
  return /* @__PURE__ */ jsx28(Fragment4, { children });
@@ -5464,9 +5450,9 @@ var InitialRedirectHandler = () => {
5464
5450
  navegandoRef.current = true;
5465
5451
  navigate(redirectPath);
5466
5452
  dispatch(setRedirectPath(null));
5467
- } else if (!navegandoRef.current && (location.pathname === "/login" || location.pathname === "/")) {
5468
- console.log("Usuario autenticado, redirigiendo a /home por defecto.");
5469
- navigate("/home");
5453
+ } else if (!navegandoRef.current && location.pathname === "/login") {
5454
+ console.log("Usuario autenticado, redirigiendo a la pantalla de inicio.");
5455
+ navigate("/");
5470
5456
  }
5471
5457
  }
5472
5458
  }, [clientContextStatus, redirectPath, location.pathname, navigate, dispatch]);
@@ -5477,9 +5463,9 @@ var InitialRedirectHandler_default = InitialRedirectHandler;
5477
5463
  // src/pages/GenericDataGridPage.tsx
5478
5464
  import React22, { useState as useState16, useCallback as useCallback15 } from "react";
5479
5465
  import { useParams as useParams2, useLocation as useLocation5 } from "react-router-dom";
5480
- import { Box as Box21, Alert as Alert5, Typography as Typography17, Tabs, Tab, IconButton as IconButton5 } from "@mui/material";
5466
+ import { Box as Box20, Alert as Alert5, Typography as Typography16, Tabs, Tab, IconButton as IconButton5 } from "@mui/material";
5481
5467
  import CloseIcon2 from "@mui/icons-material/Close";
5482
- import { jsx as jsx29, jsxs as jsxs22 } from "react/jsx-runtime";
5468
+ import { jsx as jsx29, jsxs as jsxs21 } from "react/jsx-runtime";
5483
5469
  var GenericDataGridPage = ({
5484
5470
  initialTableName,
5485
5471
  initialFixedFields = []
@@ -5525,21 +5511,21 @@ var GenericDataGridPage = ({
5525
5511
  else if (activeTabIdx === index) setActiveTabIdx(index - 1);
5526
5512
  };
5527
5513
  if (!effectiveTableName) {
5528
- return /* @__PURE__ */ jsx29(Box21, { p: 3, children: /* @__PURE__ */ jsx29(Alert5, { severity: "error", children: "No se especific\xF3 una tabla." }) });
5514
+ return /* @__PURE__ */ jsx29(Box20, { p: 3, children: /* @__PURE__ */ jsx29(Alert5, { severity: "error", children: "No se especific\xF3 una tabla." }) });
5529
5515
  }
5530
- return /* @__PURE__ */ jsxs22(Box21, { sx: { width: "100%", height: "calc(100vh - 64px)", display: "flex", flexDirection: "column" }, children: [
5531
- /* @__PURE__ */ jsx29(Box21, { sx: { borderBottom: 1, borderColor: "divider", bgcolor: "background.paper" }, children: /* @__PURE__ */ jsx29(Tabs, { value: activeTabIdx, onChange: (_, v) => setActiveTabIdx(v), variant: "scrollable", children: tabs.map((tab, index) => /* @__PURE__ */ jsx29(
5516
+ return /* @__PURE__ */ jsxs21(Box20, { sx: { width: "100%", height: "calc(100vh - 64px)", display: "flex", flexDirection: "column" }, children: [
5517
+ /* @__PURE__ */ jsx29(Box20, { sx: { borderBottom: 1, borderColor: "divider", bgcolor: "background.paper" }, children: /* @__PURE__ */ jsx29(Tabs, { value: activeTabIdx, onChange: (_, v) => setActiveTabIdx(v), variant: "scrollable", children: tabs.map((tab, index) => /* @__PURE__ */ jsx29(
5532
5518
  Tab,
5533
5519
  {
5534
- label: /* @__PURE__ */ jsxs22(Box21, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
5535
- /* @__PURE__ */ jsx29(Typography17, { variant: "caption", sx: { fontWeight: "bold" }, children: tab.label }),
5520
+ label: /* @__PURE__ */ jsxs21(Box20, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
5521
+ /* @__PURE__ */ jsx29(Typography16, { variant: "caption", sx: { fontWeight: "bold" }, children: tab.label }),
5536
5522
  index !== 0 && /* @__PURE__ */ jsx29(IconButton5, { size: "small", onClick: (e) => handleCloseTab(index, e), children: /* @__PURE__ */ jsx29(CloseIcon2, { fontSize: "inherit" }) })
5537
5523
  ] })
5538
5524
  },
5539
5525
  tab.id
5540
5526
  )) }) }),
5541
5527
  tabs.map((tab, index) => /* @__PURE__ */ jsx29(
5542
- Box21,
5528
+ Box20,
5543
5529
  {
5544
5530
  role: "tabpanel",
5545
5531
  hidden: activeTabIdx !== index,
@@ -5563,20 +5549,20 @@ var GenericDataGridPage_default = GenericDataGridPage;
5563
5549
  // src/pages/PantallaDeRuta.tsx
5564
5550
  import { useMemo as useMemo12 } from "react";
5565
5551
  import { useSearchParams } from "react-router-dom";
5566
- import { Box as Box22 } from "@mui/material";
5552
+ import { Box as Box21 } from "@mui/material";
5567
5553
  import { jsx as jsx30 } from "react/jsx-runtime";
5568
5554
  var PantallaDeRuta = ({ screenName }) => {
5569
5555
  const [busqueda] = useSearchParams();
5570
5556
  const params = useMemo12(() => Object.fromEntries(busqueda.entries()), [busqueda]);
5571
5557
  const Pantalla = wScreens[screenName];
5572
- return /* @__PURE__ */ jsx30(Box22, { sx: { pt: 3, pl: 4 }, children: Pantalla ? /* @__PURE__ */ jsx30(Pantalla, { screenName, params }) : /* @__PURE__ */ jsx30(FallbackWScreen, { screenName }) });
5558
+ return /* @__PURE__ */ jsx30(Box21, { sx: { pt: 3, pl: 4 }, children: Pantalla ? /* @__PURE__ */ jsx30(Pantalla, { screenName, params }) : /* @__PURE__ */ jsx30(FallbackWScreen, { screenName }) });
5573
5559
  };
5574
5560
 
5575
5561
  // src/pages/MenuTablePage.tsx
5576
5562
  import { useMemo as useMemo13 } from "react";
5577
5563
  import { useParams as useParams3 } from "react-router-dom";
5578
- import { Box as Box23, Alert as Alert6, Typography as Typography18 } from "@mui/material";
5579
- import { jsx as jsx31, jsxs as jsxs23 } from "react/jsx-runtime";
5564
+ import { Box as Box22, Alert as Alert6, Typography as Typography17 } from "@mui/material";
5565
+ import { jsx as jsx31, jsxs as jsxs22 } from "react/jsx-runtime";
5580
5566
  function fixedFieldsDeMenu(ff) {
5581
5567
  if (!ff) return [];
5582
5568
  if (Array.isArray(ff)) {
@@ -5617,9 +5603,9 @@ var MenuTablePage = () => {
5617
5603
  };
5618
5604
  }, [menuName, clientContext]);
5619
5605
  if (!currentTableName) {
5620
- return /* @__PURE__ */ jsx31(Box23, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: /* @__PURE__ */ jsxs23(Alert6, { severity: "error", children: [
5621
- /* @__PURE__ */ jsx31(Typography18, { variant: "h6", children: "Error: No se pudo cargar la informaci\xF3n de la tabla." }),
5622
- /* @__PURE__ */ jsx31(Typography18, { variant: "body1", children: "Verifique la configuraci\xF3n del men\xFA o el nombre de la tabla en la URL." })
5606
+ return /* @__PURE__ */ jsx31(Box22, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: /* @__PURE__ */ jsxs22(Alert6, { severity: "error", children: [
5607
+ /* @__PURE__ */ jsx31(Typography17, { variant: "h6", children: "Error: No se pudo cargar la informaci\xF3n de la tabla." }),
5608
+ /* @__PURE__ */ jsx31(Typography17, { variant: "body1", children: "Verifique la configuraci\xF3n del men\xFA o el nombre de la tabla en la URL." })
5623
5609
  ] }) });
5624
5610
  }
5625
5611
  return /* @__PURE__ */ jsx31(
@@ -5632,62 +5618,424 @@ var MenuTablePage = () => {
5632
5618
  };
5633
5619
  var MenuTablePage_default = MenuTablePage;
5634
5620
 
5621
+ // src/puente/PantallaBP.tsx
5622
+ import { useEffect as useEffect14, useRef as useRef9, useState as useState17 } from "react";
5623
+ import { Navigate as Navigate3, useLocation as useLocation6, useNavigate as useNavigate6, useParams as useParams4 } from "react-router-dom";
5624
+ import { Alert as Alert7, Box as Box24, CircularProgress as CircularProgress8 } from "@mui/material";
5625
+
5626
+ // src/puente/clienteBP.ts
5627
+ function extraerRecursos(html) {
5628
+ const documento = new DOMParser().parseFromString(html, "text/html");
5629
+ const referencias = (selector, atributo) => Array.from(documento.querySelectorAll(selector)).map((elemento) => elemento.getAttribute(atributo)).filter((ruta) => !!ruta);
5630
+ return {
5631
+ hojasDeEstilo: referencias("link[rel=stylesheet]", "href"),
5632
+ scripts: referencias("script[src]", "src")
5633
+ };
5634
+ }
5635
+ function fijarBase(urlBackend) {
5636
+ const href = new URL(urlBackend.replace(/\/*$/, "/"), window.location.href).href;
5637
+ let base = document.querySelector("base");
5638
+ if (!base) {
5639
+ base = document.createElement("base");
5640
+ document.head.prepend(base);
5641
+ }
5642
+ base.href = href;
5643
+ }
5644
+ function cargarScript(ruta) {
5645
+ return new Promise((resolver, rechazar) => {
5646
+ const script = document.createElement("script");
5647
+ script.async = false;
5648
+ script.src = ruta;
5649
+ script.onload = () => resolver();
5650
+ script.onerror = () => rechazar(new Error(`No se pudo cargar ${ruta}`));
5651
+ document.head.appendChild(script);
5652
+ });
5653
+ }
5654
+ function esperarCargaDeVentana() {
5655
+ if (document.readyState === "complete") return Promise.resolve();
5656
+ return new Promise((resolver) => window.addEventListener("load", () => resolver(), { once: true }));
5657
+ }
5658
+ var carga = null;
5659
+ function cargarClienteBP(urlBackend) {
5660
+ if (!carga) {
5661
+ carga = cargarSinMemoria(urlBackend).catch((error) => {
5662
+ carga = null;
5663
+ throw error;
5664
+ });
5665
+ }
5666
+ return carga;
5667
+ }
5668
+ async function cargarSinMemoria(urlBackend) {
5669
+ const destino = new URL(urlBackend, window.location.href);
5670
+ if (destino.origin !== window.location.origin) {
5671
+ throw new Error(`El cliente de backend-plus solo se puede usar desde el mismo origen que el backend (${destino.origin} no es ${window.location.origin}).`);
5672
+ }
5673
+ fijarBase(urlBackend);
5674
+ const respuesta = await fetch(`${destino.pathname.replace(/\/*$/, "")}/menu`, { credentials: "include" });
5675
+ if (!respuesta.ok || /\/login\/?$/.test(new URL(respuesta.url).pathname)) {
5676
+ throw new Error("No hay una sesi\xF3n iniciada en el backend.");
5677
+ }
5678
+ const recursos = extraerRecursos(await respuesta.text());
5679
+ recursos.hojasDeEstilo.forEach((ruta) => {
5680
+ const enlace = document.createElement("link");
5681
+ enlace.rel = "stylesheet";
5682
+ enlace.href = ruta;
5683
+ document.head.appendChild(enlace);
5684
+ });
5685
+ await esperarCargaDeVentana();
5686
+ for (const ruta of recursos.scripts) {
5687
+ await cargarScript(ruta);
5688
+ }
5689
+ const myOwn = window.myOwn;
5690
+ if (!myOwn) throw new Error("El backend no defini\xF3 myOwn.");
5691
+ window.my = myOwn;
5692
+ await myOwn.autoSetup();
5693
+ return myOwn;
5694
+ }
5695
+
5696
+ // src/puente/ConsolaBP.tsx
5697
+ import { useEffect as useEffect13 } from "react";
5698
+ import { Box as Box23 } from "@mui/material";
5699
+ import { jsx as jsx32 } from "react/jsx-runtime";
5700
+ var MARGEN_DE_REPETIDO_MS = 1e3;
5701
+ function descartarRepetidos(consola, agregados, ahora) {
5702
+ for (const nodo of agregados) {
5703
+ if (!(nodo instanceof HTMLElement)) continue;
5704
+ const repetido = Array.from(consola.children).find(
5705
+ (otro) => otro instanceof HTMLElement && otro !== nodo && otro.className === nodo.className && otro.textContent === nodo.textContent && ahora - Number(otro.dataset.instante) < MARGEN_DE_REPETIDO_MS
5706
+ );
5707
+ if (repetido) nodo.remove();
5708
+ else nodo.dataset.instante = String(ahora);
5709
+ }
5710
+ }
5711
+ var ConsolaBP = () => {
5712
+ useEffect13(() => {
5713
+ const consola = document.getElementById("mini-console");
5714
+ if (!consola) return;
5715
+ const observador = new MutationObserver(
5716
+ (registros) => descartarRepetidos(consola, registros.flatMap((registro) => Array.from(registro.addedNodes)), Date.now())
5717
+ );
5718
+ observador.observe(consola, { childList: true });
5719
+ return () => observador.disconnect();
5720
+ }, []);
5721
+ return /* @__PURE__ */ jsx32(
5722
+ Box23,
5723
+ {
5724
+ id: "mini-console",
5725
+ sx: (tema) => ({
5726
+ "&#mini-console": {
5727
+ position: "fixed",
5728
+ top: { xs: 64, sm: 72 },
5729
+ left: "auto",
5730
+ right: 16,
5731
+ bottom: "auto",
5732
+ float: "none",
5733
+ zIndex: tema.zIndex.snackbar,
5734
+ width: "auto",
5735
+ minWidth: 0,
5736
+ maxWidth: "min(480px, calc(100vw - 32px))",
5737
+ minHeight: 0,
5738
+ maxHeight: "none",
5739
+ overflow: "visible",
5740
+ padding: 0,
5741
+ border: "none",
5742
+ borderRadius: 0,
5743
+ boxShadow: "none",
5744
+ backgroundColor: "transparent",
5745
+ fontSize: "inherit",
5746
+ display: "flex",
5747
+ flexDirection: "column",
5748
+ gap: 1
5749
+ },
5750
+ "&#mini-console:not(:empty)": { display: "flex" },
5751
+ "&#mini-console:empty": { display: "none" },
5752
+ "& > div": {
5753
+ p: "6px 12px",
5754
+ borderRadius: 1,
5755
+ boxShadow: tema.shadows[3],
5756
+ fontSize: "0.875rem",
5757
+ whiteSpace: "pre-wrap",
5758
+ overflowWrap: "anywhere",
5759
+ backgroundColor: tema.palette.grey[800],
5760
+ color: tema.palette.common.white
5761
+ },
5762
+ "& > .status-error": {
5763
+ backgroundColor: tema.palette.error.main,
5764
+ color: tema.palette.error.contrastText
5765
+ }
5766
+ })
5767
+ }
5768
+ );
5769
+ };
5770
+
5771
+ // src/puente/pantallaDeBP.ts
5772
+ var RUTA_PANTALLA_BP = "/bp/menu";
5773
+ function rutaDePantallaBP(nombre, parametros = "") {
5774
+ const resto = parametros.replace(/^[#?]/, "").replace(/(^|&)w=[^&]*/, "").replace(/^&/, "");
5775
+ return `${RUTA_PANTALLA_BP}#w=${encodeURIComponent(nombre)}${resto ? `&${resto}` : ""}`;
5776
+ }
5777
+ function rutaDeEnlaceBP(href, baseDelDocumento, urlBackend) {
5778
+ const enlace = new URL(href, baseDelDocumento);
5779
+ const base = `${urlBackend.replace(/\/*$/, "/")}`;
5780
+ const pagina = (nombre2) => new URL(`${base}${nombre2}`, baseDelDocumento);
5781
+ if (enlace.origin !== pagina("menu").origin) return null;
5782
+ if (enlace.pathname === pagina("login").pathname) return "/login";
5783
+ if (enlace.pathname === pagina("logout").pathname) return "/logout";
5784
+ if (enlace.pathname !== pagina("menu").pathname) return null;
5785
+ const texto = (enlace.hash || enlace.search).slice(1);
5786
+ const nombre = new URLSearchParams(texto).get("w");
5787
+ return nombre ? rutaDePantallaBP(nombre, texto) : null;
5788
+ }
5789
+ function resolverPantallaBP(myOwn, nombre, contenedor) {
5790
+ const registrada = myOwn.wScreens[nombre];
5791
+ if (!registrada) return null;
5792
+ if (typeof registrada === "function") {
5793
+ return { definicion: { mainFunction: registrada }, ejecutar: registrada };
5794
+ }
5795
+ if (registrada.mainFunction) {
5796
+ return { definicion: registrada, ejecutar: registrada.mainFunction };
5797
+ }
5798
+ const { parameters, mainAction, resultClass, proceedLabel } = registrada;
5799
+ const procAux = myOwn.wScreens.procAux;
5800
+ const mostrarParametros = typeof procAux === "object" ? procAux.showParams : void 0;
5801
+ if (parameters && mostrarParametros) {
5802
+ return {
5803
+ definicion: registrada,
5804
+ ejecutar: (parametros) => mostrarParametros({ parameters, resultClass, proceedLabel }, contenedor, parametros, mainAction)
5805
+ };
5806
+ }
5807
+ return null;
5808
+ }
5809
+
5810
+ // src/puente/capturaDeNavegacion.ts
5811
+ function apiDeNavegacion() {
5812
+ const api = Reflect.get(window, "navigation");
5813
+ return typeof api === "object" && api !== null && "addEventListener" in api && typeof api.addEventListener === "function" ? api : null;
5814
+ }
5815
+ function capturarNavegacionBP(urlBackend, navegar) {
5816
+ const alHacerClick = (evento) => {
5817
+ if (evento.defaultPrevented || evento.button !== 0 || evento.ctrlKey || evento.metaKey || evento.shiftKey) return;
5818
+ const enlace = evento.target instanceof Element ? evento.target.closest("a[href]") : null;
5819
+ if (!enlace || enlace.hasAttribute("download") || (enlace.getAttribute("target") ?? "_self") !== "_self") return;
5820
+ const ruta = rutaDeEnlaceBP(enlace.getAttribute("href") ?? "", document.baseURI, urlBackend);
5821
+ if (ruta) {
5822
+ evento.preventDefault();
5823
+ evento.stopPropagation();
5824
+ navegar(ruta);
5825
+ }
5826
+ };
5827
+ document.addEventListener("click", alHacerClick, true);
5828
+ const navegacion = apiDeNavegacion();
5829
+ const alNavegar = (evento) => {
5830
+ if (!evento.cancelable || evento.destination.sameDocument || evento.downloadRequest !== null) return;
5831
+ const ruta = rutaDeEnlaceBP(evento.destination.url, document.baseURI, urlBackend);
5832
+ if (ruta) {
5833
+ evento.preventDefault();
5834
+ navegar(ruta);
5835
+ }
5836
+ };
5837
+ navegacion?.addEventListener("navigate", alNavegar);
5838
+ const reemplazarOriginal = history.replaceState;
5839
+ const reemplazar = (estado, titulo, url) => {
5840
+ const ruta = url === void 0 || url === null ? null : rutaDeEnlaceBP(String(url), document.baseURI, urlBackend);
5841
+ reemplazarOriginal.call(history, estado, titulo, ruta === null ? url : rutaBase + ruta);
5842
+ };
5843
+ history.replaceState = reemplazar;
5844
+ return () => {
5845
+ if (history.replaceState === reemplazar) history.replaceState = reemplazarOriginal;
5846
+ document.removeEventListener("click", alHacerClick, true);
5847
+ navegacion?.removeEventListener("navigate", alNavegar);
5848
+ };
5849
+ }
5850
+
5851
+ // src/puente/habilitacion.ts
5852
+ var habilitado = false;
5853
+ var habilitarPuenteBP = () => {
5854
+ habilitado = true;
5855
+ };
5856
+ var puenteBPHabilitado = () => habilitado;
5857
+
5858
+ // src/puente/PantallaBP.tsx
5859
+ import { jsx as jsx33, jsxs as jsxs23 } from "react/jsx-runtime";
5860
+ function buscarItemDeMenu(items, tipo) {
5861
+ for (const item of items) {
5862
+ if (item.menuType === tipo) return item;
5863
+ if (item.menuType === "menu") {
5864
+ const encontrado = buscarItemDeMenu(item.menuContent, tipo);
5865
+ if (encontrado) return encontrado;
5866
+ }
5867
+ }
5868
+ return void 0;
5869
+ }
5870
+ var PantallaBP = ({ nombre, direccion }) => {
5871
+ const navigate = useNavigate6();
5872
+ const { clientContext } = useApp();
5873
+ const [cargando, setCargando] = useState17(true);
5874
+ const [error, setError] = useState17(null);
5875
+ const [noExiste, setNoExiste] = useState17(false);
5876
+ const contenedor = useRef9(null);
5877
+ const menu = clientContext.menu;
5878
+ useEffect14(() => {
5879
+ const elemento = contenedor.current;
5880
+ if (!elemento) return;
5881
+ let vigente = true;
5882
+ setError(null);
5883
+ setNoExiste(false);
5884
+ setCargando(true);
5885
+ const dejarDeCapturar = capturarNavegacionBP(envConfig.backendUrl, navigate);
5886
+ cargarClienteBP(envConfig.backendUrl).then((myOwn) => {
5887
+ if (!vigente) return;
5888
+ setCargando(false);
5889
+ const pantalla = resolverPantallaBP(myOwn, nombre, elemento);
5890
+ if (!pantalla) {
5891
+ setNoExiste(true);
5892
+ return;
5893
+ }
5894
+ elemento.replaceChildren();
5895
+ const item = menu ? buscarItemDeMenu(menu, nombre) : void 0;
5896
+ const desdeLaDireccion = myOwn.UriSearchToObject?.(direccion) ?? Object.fromEntries(new URLSearchParams(direccion.replace(/^[#?]/, "")).entries());
5897
+ const parametros = { ...item, ...desdeLaDireccion };
5898
+ myOwn.preDisplayPage?.(parametros, pantalla.definicion, nombre);
5899
+ pantalla.ejecutar.call(myOwn, parametros);
5900
+ }).catch((err) => {
5901
+ if (!vigente) return;
5902
+ setCargando(false);
5903
+ setError(mensajeDeError(err));
5904
+ });
5905
+ return () => {
5906
+ vigente = false;
5907
+ dejarDeCapturar();
5908
+ elemento.replaceChildren();
5909
+ };
5910
+ }, [nombre, direccion, menu, navigate]);
5911
+ if (noExiste) return /* @__PURE__ */ jsx33(FallbackWScreen, { screenName: nombre });
5912
+ return (
5913
+ // 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
5914
+ /* @__PURE__ */ jsxs23(Box24, { sx: { position: "relative" }, children: [
5915
+ cargando && /* @__PURE__ */ jsx33(CircularProgress8, { size: 24, sx: { position: "absolute", top: 16, left: 16 } }),
5916
+ error && /* @__PURE__ */ jsx33(Alert7, { severity: "error", sx: { m: 2 }, children: error }),
5917
+ /* @__PURE__ */ jsx33("div", { id: "main_layout", ref: contenedor }),
5918
+ /* @__PURE__ */ jsx33(ConsolaBP, {})
5919
+ ] })
5920
+ );
5921
+ };
5922
+ var PantallaDeRespaldo = () => {
5923
+ const { screenName = "" } = useParams4();
5924
+ const { search } = useLocation6();
5925
+ if (!puenteBPHabilitado()) {
5926
+ return /* @__PURE__ */ jsx33(Box24, { sx: { p: 3 }, children: /* @__PURE__ */ jsx33(FallbackWScreen, { screenName }) });
5927
+ }
5928
+ return /* @__PURE__ */ jsx33(Navigate3, { to: rutaDePantallaBP(screenName, search), replace: true });
5929
+ };
5930
+ var PaginaBP = () => {
5931
+ const { hash, search } = useLocation6();
5932
+ const direccion = hash || search;
5933
+ const nombre = new URLSearchParams(direccion.replace(/^[#?]/, "")).get("w");
5934
+ if (!puenteBPHabilitado()) return /* @__PURE__ */ jsx33(Navigate3, { to: "/", replace: true });
5935
+ if (!nombre) return /* @__PURE__ */ jsx33(Box24, { sx: { p: 3 }, children: /* @__PURE__ */ jsxs23(Alert7, { severity: "warning", children: [
5936
+ "Falta la pantalla de backend-plus (",
5937
+ /* @__PURE__ */ jsx33("code", { children: "#w=..." }),
5938
+ ")."
5939
+ ] }) });
5940
+ return /* @__PURE__ */ jsx33(PantallaBP, { nombre, direccion }, nombre);
5941
+ };
5942
+
5943
+ // src/puente/GrillaBP.tsx
5944
+ import { useEffect as useEffect15, useRef as useRef10, useState as useState18 } from "react";
5945
+ import { useParams as useParams5 } from "react-router-dom";
5946
+ import { Alert as Alert8, Box as Box25, CircularProgress as CircularProgress9 } from "@mui/material";
5947
+ import { jsx as jsx34, jsxs as jsxs24 } from "react/jsx-runtime";
5948
+ var GrillaBP = ({ tabla, fixedFields }) => {
5949
+ const contenedor = useRef10(null);
5950
+ const [cargando, setCargando] = useState18(true);
5951
+ const [error, setError] = useState18(null);
5952
+ const clave = JSON.stringify(fixedFields ?? []);
5953
+ useEffect15(() => {
5954
+ const elemento = contenedor.current;
5955
+ if (!elemento) return;
5956
+ let vigente = true;
5957
+ setError(null);
5958
+ setCargando(true);
5959
+ cargarClienteBP(envConfig.backendUrl).then((myOwn) => {
5960
+ if (!vigente) return;
5961
+ setCargando(false);
5962
+ elemento.replaceChildren();
5963
+ myOwn.tableGrid(tabla, elemento, { fixedFields: JSON.parse(clave) });
5964
+ }).catch((err) => {
5965
+ if (!vigente) return;
5966
+ setCargando(false);
5967
+ setError(mensajeDeError(err));
5968
+ });
5969
+ return () => {
5970
+ vigente = false;
5971
+ elemento.replaceChildren();
5972
+ };
5973
+ }, [tabla, clave]);
5974
+ return (
5975
+ // 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
5976
+ /* @__PURE__ */ jsxs24(Box25, { sx: { position: "relative" }, children: [
5977
+ cargando && /* @__PURE__ */ jsx34(CircularProgress9, { size: 24, sx: { position: "absolute", top: 16, left: 16 } }),
5978
+ error && /* @__PURE__ */ jsx34(Alert8, { severity: "error", sx: { m: 2 }, children: error }),
5979
+ /* @__PURE__ */ jsx34("div", { ref: contenedor }),
5980
+ /* @__PURE__ */ jsx34(ConsolaBP, {})
5981
+ ] })
5982
+ );
5983
+ };
5984
+ var PaginaGrillaBP = () => {
5985
+ const { tableName = "" } = useParams5();
5986
+ return /* @__PURE__ */ jsx34(GrillaBP, { tabla: tableName }, tableName);
5987
+ };
5988
+
5635
5989
  // src/App.tsx
5636
- import { Box as Box24 } from "@mui/material";
5637
5990
  import typeStore6 from "type-store";
5638
- import { Fragment as Fragment5, jsx as jsx32, jsxs as jsxs24 } from "react/jsx-runtime";
5991
+ import { Fragment as Fragment5, jsx as jsx35, jsxs as jsxs25 } from "react/jsx-runtime";
5639
5992
  var LocationTracker = () => {
5640
- const location = useLocation6();
5993
+ const location = useLocation7();
5641
5994
  const dispatch = useAppDispatch();
5642
- useEffect13(() => {
5995
+ useEffect16(() => {
5643
5996
  dispatch(setCurrentPath(location.pathname + location.search));
5644
5997
  }, [location, dispatch]);
5645
5998
  return null;
5646
5999
  };
5647
6000
  function FrontendPlusReactRoutes({ myRoutes, myUnloggedRoutes, layout: Layout = MainLayout_default, unloggedLayout: UnloggedLayout }) {
5648
- return /* @__PURE__ */ jsxs24(Fragment5, { children: [
5649
- /* @__PURE__ */ jsx32(InitialRedirectHandler_default, {}),
5650
- /* @__PURE__ */ jsxs24(Routes, { children: [
5651
- /* @__PURE__ */ jsxs24(Route, { element: UnloggedLayout ? /* @__PURE__ */ jsx32(UnloggedLayout, {}) : /* @__PURE__ */ jsx32(Outlet2, {}), children: [
5652
- /* @__PURE__ */ jsx32(Route, { path: "/login", element: /* @__PURE__ */ jsx32(LoginPage_default, {}) }),
5653
- /* @__PURE__ */ jsx32(Route, { path: "/logout", element: /* @__PURE__ */ jsx32(LogoutPage_default, {}) }),
6001
+ return /* @__PURE__ */ jsxs25(Fragment5, { children: [
6002
+ /* @__PURE__ */ jsx35(InitialRedirectHandler_default, {}),
6003
+ /* @__PURE__ */ jsxs25(Routes, { children: [
6004
+ /* @__PURE__ */ jsxs25(Route, { element: UnloggedLayout ? /* @__PURE__ */ jsx35(UnloggedLayout, {}) : /* @__PURE__ */ jsx35(Outlet2, {}), children: [
6005
+ /* @__PURE__ */ jsx35(Route, { path: "/login", element: /* @__PURE__ */ jsx35(LoginPage_default, {}) }),
6006
+ /* @__PURE__ */ jsx35(Route, { path: "/logout", element: /* @__PURE__ */ jsx35(LogoutPage_default, {}) }),
5654
6007
  myUnloggedRoutes
5655
6008
  ] }),
5656
- /* @__PURE__ */ jsxs24(Route, { element: /* @__PURE__ */ jsx32(PrivateRoute_default, { children: /* @__PURE__ */ jsx32(Layout, {}) }), children: [
5657
- /* @__PURE__ */ jsx32(Route, { path: "/", element: /* @__PURE__ */ jsx32(HomePage_default, {}) }),
5658
- /* @__PURE__ */ jsx32(Route, { path: "/home", element: /* @__PURE__ */ jsx32(HomePage_default, {}) }),
5659
- /* @__PURE__ */ jsx32(Route, { path: "/table/:tableName", element: /* @__PURE__ */ jsx32(GenericDataGridPage_default, {}) }),
5660
- /* @__PURE__ */ jsx32(Route, { path: "/menu/:menuName", element: /* @__PURE__ */ jsx32(MenuTablePage_default, {}) }),
5661
- /* @__PURE__ */ jsx32(Route, { path: "/procedures/:procedureName", element: /* @__PURE__ */ jsx32(ProcedureForm_default, {}) }),
5662
- Object.keys(wScreens).map((screenName) => /* @__PURE__ */ jsx32(
6009
+ /* @__PURE__ */ jsxs25(Route, { element: /* @__PURE__ */ jsx35(PrivateRoute_default, { children: /* @__PURE__ */ jsx35(Layout, {}) }), children: [
6010
+ /* @__PURE__ */ jsx35(Route, { path: "/", element: /* @__PURE__ */ jsx35(PantallaInicial_default, {}) }),
6011
+ /* @__PURE__ */ jsx35(Route, { path: "/table/:tableName", element: /* @__PURE__ */ jsx35(GenericDataGridPage_default, {}) }),
6012
+ /* @__PURE__ */ jsx35(Route, { path: "/menu/:menuName", element: /* @__PURE__ */ jsx35(MenuTablePage_default, {}) }),
6013
+ /* @__PURE__ */ jsx35(Route, { path: "/procedures/:procedureName", element: /* @__PURE__ */ jsx35(ProcedureForm_default, {}) }),
6014
+ Object.keys(wScreens).map((screenName) => /* @__PURE__ */ jsx35(
5663
6015
  Route,
5664
6016
  {
5665
6017
  path: `/wScreens/${screenName}`,
5666
- element: /* @__PURE__ */ jsx32(PantallaDeRuta, { screenName })
6018
+ element: /* @__PURE__ */ jsx35(PantallaDeRuta, { screenName })
5667
6019
  },
5668
6020
  screenName
5669
6021
  )),
5670
- /* @__PURE__ */ jsx32(
5671
- Route,
5672
- {
5673
- path: "/wScreens-fallback/:screenName",
5674
- element: /* @__PURE__ */ jsx32(Box24, { sx: { p: 3 }, children: /* @__PURE__ */ jsx32(FallbackWScreen, { screenName: ":screenName" }) })
5675
- }
5676
- ),
6022
+ /* @__PURE__ */ jsx35(Route, { path: "/wScreens-fallback/:screenName", element: /* @__PURE__ */ jsx35(PantallaDeRespaldo, {}) }),
6023
+ puenteBPHabilitado() && /* @__PURE__ */ jsx35(Route, { path: "/bp/menu", element: /* @__PURE__ */ jsx35(PaginaBP, {}) }),
6024
+ puenteBPHabilitado() && /* @__PURE__ */ jsx35(Route, { path: "/bp/table/:tableName", element: /* @__PURE__ */ jsx35(PaginaGrillaBP, {}) }),
5677
6025
  myRoutes,
5678
- /* @__PURE__ */ jsx32(Route, { path: "*", element: /* @__PURE__ */ jsx32("div", { style: { marginTop: "20px", marginLeft: "10px" }, children: "404 - Recurso No Encontrado" }) })
6026
+ /* @__PURE__ */ jsx35(Route, { path: "*", element: /* @__PURE__ */ jsx35("div", { style: { marginTop: "20px", marginLeft: "10px" }, children: "404 - Recurso No Encontrado" }) })
5679
6027
  ] }),
5680
- /* @__PURE__ */ jsx32(Route, { path: "*", element: /* @__PURE__ */ jsx32(Navigate2, { to: "/", replace: true }) })
6028
+ /* @__PURE__ */ jsx35(Route, { path: "*", element: /* @__PURE__ */ jsx35(Navigate4, { to: "/", replace: true }) })
5681
6029
  ] })
5682
6030
  ] });
5683
6031
  }
5684
6032
  var FrontendPlusProviders = ({ children, publicPaths }) => {
5685
- return /* @__PURE__ */ jsx32(Provider, { store, children: /* @__PURE__ */ jsx32(PersistGate, { loading: null, persistor, children: /* @__PURE__ */ jsxs24(BrowserRouter, { children: [
5686
- /* @__PURE__ */ jsx32(LocationTracker, {}),
6033
+ return /* @__PURE__ */ jsx35(Provider, { store, children: /* @__PURE__ */ jsx35(PersistGate, { loading: null, persistor, children: /* @__PURE__ */ jsxs25(BrowserRouter, { basename: rutaBase, children: [
6034
+ /* @__PURE__ */ jsx35(LocationTracker, {}),
5687
6035
  " ",
5688
- /* @__PURE__ */ jsx32(AppProvider, { publicPaths, children: /* @__PURE__ */ jsxs24(SnackbarProvider, { children: [
6036
+ /* @__PURE__ */ jsx35(AppProvider, { publicPaths, children: /* @__PURE__ */ jsxs25(SnackbarProvider, { children: [
5689
6037
  children,
5690
- /* @__PURE__ */ jsx32(SessionExpiredMessage_default, {})
6038
+ /* @__PURE__ */ jsx35(SessionExpiredMessage_default, {})
5691
6039
  ] }) })
5692
6040
  ] }) }) });
5693
6041
  };
@@ -5698,7 +6046,8 @@ var App = ({
5698
6046
  myWScreens,
5699
6047
  myClientSides,
5700
6048
  myResultsOk,
5701
- myConditions
6049
+ myConditions,
6050
+ puenteBP
5702
6051
  }) => {
5703
6052
  useMemo14(() => {
5704
6053
  if (myClientSides) {
@@ -5713,8 +6062,11 @@ var App = ({
5713
6062
  if (myConditions) {
5714
6063
  extendConditions(myConditions);
5715
6064
  }
5716
- }, [myClientSides, myResultsOk, myWScreens, myConditions]);
5717
- useEffect13(() => {
6065
+ if (puenteBP) {
6066
+ habilitarPuenteBP();
6067
+ }
6068
+ }, [myClientSides, myResultsOk, myWScreens, myConditions, puenteBP]);
6069
+ useEffect16(() => {
5718
6070
  typeStore6.messages = typeStore6.i18n.messages.es;
5719
6071
  typeStore6.locale = typeStore6.i18n.locale.es;
5720
6072
  const link = document.querySelector("link[rel*='icon']") || document.createElement("link");
@@ -5723,11 +6075,11 @@ var App = ({
5723
6075
  link.href = `${envConfig.backendUrl}/img/logo-128.png`;
5724
6076
  document.getElementsByTagName("head")[0].appendChild(link);
5725
6077
  }, []);
5726
- const safePaths = React25.useMemo(() => {
6078
+ const safePaths = React28.useMemo(() => {
5727
6079
  const extracted = extractPathsFromRoutes(myUnloggedRoutes);
5728
6080
  return ["/login", "/logout", ...extracted];
5729
6081
  }, [myUnloggedRoutes]);
5730
- return /* @__PURE__ */ jsx32(FrontendPlusProviders, { publicPaths: safePaths, children: /* @__PURE__ */ jsx32(
6082
+ return /* @__PURE__ */ jsx35(FrontendPlusProviders, { publicPaths: safePaths, children: /* @__PURE__ */ jsx35(
5731
6083
  FrontendPlusReactRoutes,
5732
6084
  {
5733
6085
  myRoutes,
@@ -5745,6 +6097,7 @@ export {
5745
6097
  FrontendPlusProviders,
5746
6098
  FrontendPlusReactRoutes,
5747
6099
  GenericDataGrid_default as GenericDataGrid,
6100
+ GrillaBP,
5748
6101
  MainLayout_default as MainLayout,
5749
6102
  SnackbarProvider,
5750
6103
  cambiarGuionesBajosPorEspacios,
@@ -5754,6 +6107,7 @@ export {
5754
6107
  extendResultsOk,
5755
6108
  extendWScreens,
5756
6109
  extractPathsFromRoutes,
6110
+ habilitarPuenteBP,
5757
6111
  resultsOk as resultComponents,
5758
6112
  useApiCall,
5759
6113
  useApiCallWithoutSnackbar,