import{m as T,n as V,f as j,dt as P,d2 as E,q as F,r as l,t as G,d6 as L,d5 as N,j as y,v as C,w as U,y as d}from"./index-952e178b.js";import{m as x}from"./Select-41d78585.js";import{d as $}from"./dividerClasses-8e897c94.js";import{l as I}from"./listItemTextClasses-ca40551b.js";import{l as M}from"./listItemIconClasses-3e4286ad.js";function D(e){return T("MuiMenuItem",e)}const H=V("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),r=H,z=(e,t)=>{const{ownerState:s}=e;return[t.root,s.dense&&t.dense,s.divider&&t.divider,!s.disableGutters&&t.gutters]},q=e=>{const{disabled:t,dense:s,divider:a,disableGutters:i,selected:c,classes:o}=e,n=U({root:["root",s&&"dense",t&&"disabled",!i&&"gutters",a&&"divider",c&&"selected"]},D,o);return{...o,...n}},W=j(P,{shouldForwardProp:e=>E(e)||e==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:z})(F(({theme:e})=>({...e.typography.body1,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap","&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${r.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:d(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${r.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:d(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${r.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:d(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:d(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${r.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${r.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${$.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${$.inset}`]:{marginLeft:52},[`& .${I.root}`]:{marginTop:0,marginBottom:0},[`& .${I.inset}`]:{paddingLeft:36},[`& .${M.root}`]:{minWidth:36},variants:[{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>t.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:t})=>!t.dense,style:{[e.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:({ownerState:t})=>t.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...e.typography.body2,[`& .${M.root} svg`]:{fontSize:"1.25rem"}}}]}))),A=l.forwardRef(function(t,s){const a=G({props:t,name:"MuiMenuItem"}),{autoFocus:i=!1,component:c="li",dense:o=!1,divider:m=!1,disableGutters:n=!1,focusVisibleClassName:O,role:k="menuitem",tabIndex:f,className:R,...w}=a,g=l.useContext(x),v=l.useMemo(()=>({dense:o||g.dense||!1,disableGutters:n}),[g.dense,o,n]),p=l.useRef(null);L(()=>{i&&p.current&&p.current.focus()},[i]);const B={...a,dense:v.dense,divider:m,disableGutters:n},u=q(a),S=N(p,s);let b;return a.disabled||(b=f!==void 0?f:-1),y.jsx(x.Provider,{value:v,children:y.jsx(W,{ref:S,role:k,tabIndex:b,component:c,focusVisibleClassName:C(u.focusVisible,O),className:C(u.root,R),...w,ownerState:B,classes:u})})}),Z=A;export{Z as M};
