import{m as V,n as T,f as j,da as P,cR as U,q as E,r as l,t as F,cV as G,cU as L,j as y,v as C,w as N,y as c}from"./index-0698dbe6.js";import{e as x}from"./Select-371fc2c6.js";import{d as $}from"./dividerClasses-2d12c750.js";import{l as I}from"./listItemTextClasses-d0728874.js";import{l as M}from"./listItemIconClasses-6eed47b3.js";function D(e){return V("MuiMenuItem",e)}const H=T("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:d,classes:o}=e,n=N({root:["root",s&&"dense",t&&"disabled",!i&&"gutters",a&&"divider",d&&"selected"]},D,o);return{...o,...n}},W=j(P,{shouldForwardProp:e=>U(e)||e==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:z})(E(({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})`:c(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}))`:c(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}))`:c(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})`:c(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=F({props:t,name:"MuiMenuItem"}),{autoFocus:i=!1,component:d="li",dense:o=!1,divider:f=!1,disableGutters:n=!1,focusVisibleClassName:O,role:R="menuitem",tabIndex:m,className:k,...w}=a,g=l.useContext(x),v=l.useMemo(()=>({dense:o||g.dense||!1,disableGutters:n}),[g.dense,o,n]),p=l.useRef(null);G(()=>{i&&p.current&&p.current.focus()},[i]);const B={...a,dense:v.dense,divider:f,disableGutters:n},u=q(a),S=L(p,s);let b;return a.disabled||(b=m!==void 0?m:-1),y.jsx(x.Provider,{value:v,children:y.jsx(W,{ref:S,role:R,tabIndex:b,component:d,focusVisibleClassName:C(u.focusVisible,O),className:C(u.root,k),...w,ownerState:B,classes:u})})}),Z=A;export{Z as M};
