import{r as d,aO as F,aP as V,aQ as y,aR as G,aS as u,aT as N,ao as I,aU as P,aV as $,aW as j,aX as _,aY as E,aZ as S,a_ as p,a$ as n}from"./index-DlNZgIG9.js";const w=["alignItems","autoFocus","component","children","dense","disableGutters","divider","focusVisibleClassName","selected","className"],D=(t,a)=>{const{ownerState:e}=t;return[a.root,e.dense&&a.dense,e.alignItems==="flex-start"&&a.alignItemsFlexStart,e.divider&&a.divider,!e.disableGutters&&a.gutters]},M=t=>{const{alignItems:a,classes:e,dense:s,disabled:o,disableGutters:l,divider:c,selected:f}=t,i=j({root:["root",s&&"dense",!l&&"gutters",c&&"divider",o&&"disabled",a==="flex-start"&&"alignItemsFlexStart",f&&"selected"]},_,e);return u({},e,i)},T=P(E,{shouldForwardProp:t=>S(t)||t==="classes",name:"MuiListItemButton",slot:"Root",overridesResolver:D})(({theme:t,ownerState:a})=>u({display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${n.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:p(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${n.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:p(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}},[`&.${n.selected}:hover`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:p(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:p(t.palette.primary.main,t.palette.action.selectedOpacity)}},[`&.${n.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${n.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},a.divider&&{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"},a.alignItems==="flex-start"&&{alignItems:"flex-start"},!a.disableGutters&&{paddingLeft:16,paddingRight:16},a.dense&&{paddingTop:4,paddingBottom:4})),W=d.forwardRef(function(a,e){const s=F({props:a,name:"MuiListItemButton"}),{alignItems:o="center",autoFocus:l=!1,component:c="div",children:f,dense:v=!1,disableGutters:i=!1,divider:O=!1,focusVisibleClassName:B,selected:R=!1,className:k}=s,r=V(s,w),x=d.useContext(y),C=d.useMemo(()=>({dense:v||x.dense||!1,alignItems:o,disableGutters:i}),[o,x.dense,v,i]),b=d.useRef(null);G(()=>{l&&b.current&&b.current.focus()},[l]);const m=u({},s,{alignItems:o,dense:C.dense,disableGutters:i,divider:O,selected:R}),g=M(m),L=N(b,e);return I.jsx(y.Provider,{value:C,children:I.jsx(T,u({ref:L,href:r.href||r.to,component:(r.href||r.to)&&c==="div"?"button":c,focusVisibleClassName:$(g.focusVisible,B),ownerState:m,className:$(g.root,k)},r,{classes:g,children:f}))})});export{W as L};
