import{ap as F,aq as B,a8 as w,an as C,r as l,a_ as j,al as W,j as e,aA as z,ax as R,o as r,a9 as v,t as T,aa as y,y as d,K as k,aH as H,u as M,A as $,k as E,b0 as U,b1 as _,B as x,E as D}from"./index-e47c07e2.js";import{u as I}from"./useConfig-cb63f7b6.js";import{d as L,C as P,G as f}from"./MoreVert-1c5fc15f.js";import{C as q}from"./CardHeader-c1b748f1.js";import{A as N}from"./Avatar-fd463fc7.js";import{a as G}from"./pwdpromptLogo-90b3250a.js";function J(t){return F("MuiCardActions",t)}B("MuiCardActions",["root","spacing"]);const K=["disableSpacing","className"],X=t=>{const{classes:a,disableSpacing:s}=t;return R({root:["root",!s&&"spacing"]},J,a)},Q=w("div",{name:"MuiCardActions",slot:"Root",overridesResolver:(t,a)=>{const{ownerState:s}=t;return[a.root,!s.disableSpacing&&a.spacing]}})(({ownerState:t})=>C({display:"flex",alignItems:"center",padding:8},!t.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})),V=l.forwardRef(function(a,s){const n=j({props:a,name:"MuiCardActions"}),{disableSpacing:u=!1,className:g}=n,p=W(n,K),c=C({},n,{disableSpacing:u}),m=X(c);return e(Q,C({className:z(m.root,g),ownerState:c,ref:s},p))}),Y=V;function Z({user:t}){return r(v,{sx:{maxWidth:300,height:"220px",backgroundColor:"#71A63C",color:"#FFF"},children:[e(q,{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:a,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/${a}.png`,loading:"lazy"})})}),e(y,{sx:{},children:e(d,{noWrap:!0,fontWeight:"700",fontSize:"1rem",textAlign:"center",sx:{},children:s})})]})}const ie=()=>{const{loading:t,data:a,load:s}=I(),n=k();H();const[u,g]=l.useState([]),p=async()=>{await s()},{logout:c,user:m}=M(),{empresaActual:i}=l.useContext($);l.useEffect(()=>{p(),E.post(`${U}/${_}/Engine?paquete=std.extjs&clase=Tree2JSon&metodo=getMenusRapidos&parametros=`).then(o=>{if(o.data.msg==="Acceso Denegado"){console.log("Sesión expirada"),c();return}g(o.data)})},[]);const A=()=>{const o=new Date().getHours();return o<6||o>20?"¡Buenas noches":o<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:o,ObjNom:h,ObjMenuLink:b},S)=>h==="Bandeja de Trámites"?e(f,{sx:{cursor:"pointer"},onClick:()=>{n(b)},xs:2,sm:2,md:3,children:e(Z,{user:m})},S):e(f,{sx:{cursor:"pointer"},onClick:()=>{h==="Salir"?D(c):n(b)},xs:2,sm:2,md:3,children:e(ee,{cardText:h,imgIcon:o})},S))})]})]})};export{ie as default};
