import{ai as F,aj as w,a5 as B,ag as C,r as l,aS as j,ae as W,j as e,at as z,aq as R,o as r,q as T,w as d,H as k,aA as H,u as M,A as $,k as U,B as x,y as q}from"./index-7722cded.js";import{u as D}from"./useConfig-0b1ac990.js";import{b as E,p as I}from"./env-198ff0f3.js";import{d as L,C as P,G as f}from"./MoreVert-88a310d0.js";import{C as v}from"./Card-8cb1ba72.js";import{C as _}from"./CardHeader-7462ad92.js";import{A as N}from"./Avatar-d3970144.js";import{C as y}from"./CardContent-66d7052f.js";import{a as G}from"./pwdpromptLogo-90b3250a.js";function J(t){return F("MuiCardActions",t)}w("MuiCardActions",["root","spacing"]);const X=["disableSpacing","className"],K=t=>{const{classes:o,disableSpacing:s}=t;return R({root:["root",!s&&"spacing"]},J,o)},Q=B("div",{name:"MuiCardActions",slot:"Root",overridesResolver:(t,o)=>{const{ownerState:s}=t;return[o.root,!s.disableSpacing&&o.spacing]}})(({ownerState:t})=>C({display:"flex",alignItems:"center",padding:8},!t.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})),V=l.forwardRef(function(o,s){const n=j({props:o,name:"MuiCardActions"}),{disableSpacing:u=!1,className:p}=n,g=W(n,X),c=C({},n,{disableSpacing:u}),m=K(c);return e(Q,C({className:z(m.root,p),ownerState:c,ref:s},g))}),Y=V;function Z({user:t}){return r(v,{sx:{maxWidth:300,height:"220px",backgroundColor:"#71A63C",color:"#FFF"},children:[e(_,{avatar:e(N,{src:"",sx:{width:56,height:56},"aria-label":"recipe",alt:"user"}),action:e(T,{"aria-label":"settings",children:e(L,{})}),title:t.nombre,subheader:t.rol,sx:{color:"#FFF","& .MuiCardHeader-subheader":{color:"#FFF"}}}),r(y,{sx:{},children:[e(d,{color:"#FFF",fontWeight:700,gutterBottom:!0,fontSize:"1.2rem",component:"div",letterSpacing:1,sx:{textShadow:"0.4px 0.4px 0.4px #000"},children:"Bandeja de tramites"}),e(d,{color:"#FFF",gutterBottom:!0,fontSize:"0.8rem",component:"div",children:"Bandeja de tramites"})]}),e(Y,{sx:{backgroundColor:"#84BF49",height:"100%"},disableSpacing:!0})]})}const O="/WizardJS/assets/Recurso3-b9afce00.png";function ee({imgBackground:t,imgIcon:o,cardText:s}){return r(v,{variant:"elevation",sx:{maxWidth:300,height:"220px",position:"relative"},children:[e("div",{style:{backgroundImage:`url(${t||O})`,backgroundRepeat:"no-repeat",backgroundSize:"cover",objectFit:"cover",height:"150px",backgroundPositionX:"center",position:"relative"},children:e("div",{style:{display:"flex",textAlign:"center",justifyContent:"center"},children:e("img",{style:{width:"100px",marginTop:"1.5em"},src:`./assets/${o}.png`,loading:"lazy"})})}),e(y,{sx:{},children:e(d,{noWrap:!0,fontWeight:"700",fontSize:"1rem",textAlign:"center",sx:{},children:s})})]})}const le=()=>{const{loading:t,data:o,load:s}=D(),n=k();H();const[u,p]=l.useState([]),g=async()=>{await s()},{logout:c,user:m}=M(),{empresaActual:i}=l.useContext($);l.useEffect(()=>{g(),U.post(`${E}/${I}/Engine?paquete=std.extjs&clase=Tree2JSon&metodo=getMenusRapidos&parametros=`).then(a=>{if(a.data.msg==="Acceso Denegado"){console.log("Sesión expirada"),c();return}p(a.data)})},[]);const A=()=>{const a=new Date().getHours();return a<6||a>20?"¡Buenas noches":a<12?"¡Buenos días":"¡Buenas tardes"};return r(P,{sx:{minHeight:"100vh"},children:[r(x,{sx:{},marginTop:"3rem",width:"100%",children:[e(x,{margin:"1rem auto",width:"300px",children:e("img",{style:{objectFit:"cover",maxWidth:"100%"},src:(i==null?void 0:i.EmpLogo)||G,loading:"lazy",alt:"Prompt logo"})}),r(d,{fontWeight:"bolder",noWrap:!0,fontSize:"1.7rem",textAlign:"center",children:[A(),", ",r("span",{children:["equipo ",(i==null?void 0:i.empNombre)||""]}),"!"]})]}),r(x,{sx:{marginTop:"2rem"},children:[e(d,{fontSize:"2rem",textAlign:"center",children:"Categorias"}),e(f,{container:!0,spacing:{xs:2,md:3},columns:{xs:4,sm:8,md:12},mt:2,children:u.map(({ObjIcon:a,ObjNom:h,ObjMenuLink:S},b)=>h==="Bandeja de Trámites"?e(f,{sx:{cursor:"pointer"},onClick:()=>{n(S)},xs:2,sm:2,md:3,children:e(Z,{user:m})},b):e(f,{sx:{cursor:"pointer"},onClick:()=>{h==="Salir"?q(c):n(S)},xs:2,sm:2,md:3,children:e(ee,{cardText:h,imgIcon:a})},b))})]})]})};export{le as default};
