import{r as d,ao as F,ap as V,aq as m,ar as G,as as u,at as N,V as I,au as j,av as $,aw as P,ax as w,ay as E,az as _,aA as p,aB as n}from"./index-DWFi48i_.js";const D=["alignItems","autoFocus","component","children","dense","disableGutters","divider","focusVisibleClassName","selected","className"],M=(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]},S=t=>{const{alignItems:a,classes:e,dense:s,disabled:o,disableGutters:l,divider:c,selected:f}=t,i=P({root:["root",s&&"dense",!l&&"gutters",c&&"divider",o&&"disabled",a==="flex-start"&&"alignItemsFlexStart",f&&"selected"]},w,e);return u({},e,i)},z=j(E,{shouldForwardProp:t=>_(t)||t==="classes",name:"MuiListItemButton",slot:"Root",overridesResolver:M})(({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})),T=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:B=!1,focusVisibleClassName:O,selected:k=!1,className:L}=s,r=V(s,D),x=d.useContext(m),y=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 C=u({},s,{alignItems:o,dense:y.dense,disableGutters:i,divider:B,selected:k}),g=S(C),R=N(b,e);return I.jsx(m.Provider,{value:y,children:I.jsx(z,u({ref:R,href:r.href||r.to,component:(r.href||r.to)&&c==="div"?"button":c,focusVisibleClassName:$(g.focusVisible,O),ownerState:C,className:$(g.root,L)},r,{classes:g,children:f}))})});export{T as L};
