import{r as d,c1 as L,fS as C,d8 as S,ck as w,j as m,b8 as F,c3 as I,c4 as j,fT as G,bY as V,cc as E,bZ as N,av as p,fU as n}from"./index-DQhyMeoV.js";const P=(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]},T=t=>{const{alignItems:a,classes:e,dense:i,disabled:s,disableGutters:l,divider:c,selected:u}=t,o=j({root:["root",i&&"dense",!l&&"gutters",c&&"divider",s&&"disabled",a==="flex-start"&&"alignItemsFlexStart",u&&"selected"]},G,e);return{...e,...o}},D=F(V,{shouldForwardProp:t=>E(t)||t==="classes",name:"MuiListItemButton",slot:"Root",overridesResolver:P})(N(({theme:t})=>({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},variants:[{props:({ownerState:a})=>a.divider,style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`,backgroundClip:"padding-box"}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:a})=>!a.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:a})=>a.dense,style:{paddingTop:4,paddingBottom:4}}]}))),U=d.forwardRef(function(a,e){const i=L({props:a,name:"MuiListItemButton"}),{alignItems:s="center",autoFocus:l=!1,component:c="div",children:u,dense:f=!1,disableGutters:o=!1,divider:$=!1,focusVisibleClassName:O,selected:B=!1,className:k,...r}=i,g=d.useContext(C),x=d.useMemo(()=>({dense:f||g.dense||!1,alignItems:s,disableGutters:o}),[s,g.dense,f,o]),v=d.useRef(null);S(()=>{l&&v.current&&v.current.focus()},[l]);const y={...i,alignItems:s,dense:x.dense,disableGutters:o,divider:$,selected:B},b=T(y),R=w(v,e);return m.jsx(C.Provider,{value:x,children:m.jsx(D,{ref:R,href:r.href||r.to,component:(r.href||r.to)&&c==="div"?"button":c,focusVisibleClassName:I(b.focusVisible,O),ownerState:y,className:I(b.root,k),...r,classes:b,children:u})})});export{U as L};
