import{cH as O,cG as k,f as T,d2 as V,cP as j,cJ as E,r as l,cK as F,cE as G,cC as U,j as y,cL as C,cM as H,n as c}from"./index-d895656a.js";import{b as I}from"./Menu-1728e1dd.js";import{d as x}from"./dividerClasses-f4dcf412.js";import{l as $}from"./listItemTextClasses-1ed38b44.js";function Z(e){return O("MuiListItemIcon",e)}const N=k("MuiListItemIcon",["root","alignItemsFlexStart"]),M=N;function D(e){return O("MuiMenuItem",e)}const z=k("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),i=z,J=(e,t)=>{const{ownerState:s}=e;return[t.root,s.dense&&t.dense,s.divider&&t.divider,!s.disableGutters&&t.gutters]},K=e=>{const{disabled:t,dense:s,divider:a,disableGutters:r,selected:d,classes:o}=e,n=H({root:["root",s&&"dense",t&&"disabled",!r&&"gutters",a&&"divider",d&&"selected"]},D,o);return{...o,...n}},W=T(V,{shouldForwardProp:e=>j(e)||e==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:J})(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"}},[`&.${i.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:c(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${i.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)}},[`&.${i.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)}},[`&.${i.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${i.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${x.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${x.inset}`]:{marginLeft:52},[`& .${$.root}`]:{marginTop:0,marginBottom:0},[`& .${$.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"}}}]}))),q=l.forwardRef(function(t,s){const a=F({props:t,name:"MuiMenuItem"}),{autoFocus:r=!1,component:d="li",dense:o=!1,divider:m=!1,disableGutters:n=!1,focusVisibleClassName:R,role:w="menuitem",tabIndex:g,className:L,...S}=a,f=l.useContext(I),b=l.useMemo(()=>({dense:o||f.dense||!1,disableGutters:n}),[f.dense,o,n]),p=l.useRef(null);G(()=>{r&&p.current&&p.current.focus()},[r]);const B={...a,dense:b.dense,divider:m,disableGutters:n},u=K(a),P=U(p,s);let v;return a.disabled||(v=g!==void 0?g:-1),y.jsx(I.Provider,{value:b,children:y.jsx(W,{ref:P,role:w,tabIndex:v,component:d,focusVisibleClassName:C(u.focusVisible,R),className:C(u.root,L),...S,ownerState:B,classes:u})})}),_=q;export{_ as M,Z as g};
