import{m as T,n as V,f as j,dh as P,cY as E,q as F,r as l,t as G,d0 as L,c$ as N,j as y,v as C,w as U,y as d}from"./index-6f149d0c.js";import{e as $}from"./Select-70a66099.js";import{d as x}from"./dividerClasses-aa25d579.js";import{l as I}from"./listItemTextClasses-6dace016.js";import{l as M}from"./listItemIconClasses-4d219f9a.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},[`& + .${x.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${x.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"}}}]}))),Y=l.forwardRef(function(t,s){const a=G({props:t,name:"MuiMenuItem"}),{autoFocus:i=!1,component:c="li",dense:o=!1,divider:f=!1,disableGutters:n=!1,focusVisibleClassName:O,role:k="menuitem",tabIndex:m,className:R,...w}=a,g=l.useContext($),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:f,disableGutters:n},u=q(a),S=N(p,s);let b;return a.disabled||(b=m!==void 0?m:-1),y.jsx($.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=Y;export{Z as M};
