import{g as j,a as S,r as d,u as T,ah as V,Q as L,j as m,d as y,e as N,s as P,ae as E,N as F,m as G}from"./main-BMMRv56V.js";import{L as C,j as x}from"./TextField-CWEE-Dgp.js";import{l as I,a as $}from"./listItemTextClasses-CLRRC5Y4.js";function U(s){return j("MuiMenuItem",s)}const i=S("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),D=(s,e)=>{const{ownerState:o}=s;return[e.root,o.dense&&e.dense,o.divider&&e.divider,!o.disableGutters&&e.gutters]},H=s=>{const{disabled:e,dense:o,divider:a,disableGutters:n,selected:l,classes:t}=s,r=N({root:["root",o&&"dense",e&&"disabled",!n&&"gutters",a&&"divider",l&&"selected"]},U,t);return{...t,...r}},z=P(E,{shouldForwardProp:s=>F(s)||s==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:D})(G(({theme:s})=>({...s.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:(s.vars||s).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${i.selected}`]:{backgroundColor:s.alpha((s.vars||s).palette.primary.main,(s.vars||s).palette.action.selectedOpacity),[`&.${i.focusVisible}`]:{backgroundColor:s.alpha((s.vars||s).palette.primary.main,`${(s.vars||s).palette.action.selectedOpacity} + ${(s.vars||s).palette.action.focusOpacity}`)}},[`&.${i.selected}:hover`]:{backgroundColor:s.alpha((s.vars||s).palette.primary.main,`${(s.vars||s).palette.action.selectedOpacity} + ${(s.vars||s).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:s.alpha((s.vars||s).palette.primary.main,(s.vars||s).palette.action.selectedOpacity)}},[`&.${i.focusVisible}`]:{backgroundColor:(s.vars||s).palette.action.focus},[`&.${i.disabled}`]:{opacity:(s.vars||s).palette.action.disabledOpacity},[`& + .${x.root}`]:{marginTop:s.spacing(1),marginBottom:s.spacing(1)},[`& + .${x.inset}`]:{marginLeft:52},[`& .${$.root}`]:{marginTop:0,marginBottom:0},[`& .${$.inset}`]:{paddingLeft:36},[`& .${I.root}`]:{minWidth:36},variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:e})=>e.divider,style:{borderBottom:`1px solid ${(s.vars||s).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:e})=>!e.dense,style:{[s.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:({ownerState:e})=>e.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...s.typography.body2,[`& .${I.root} svg`]:{fontSize:"1.25rem"}}}]}))),A=d.forwardRef(function(e,o){const a=T({props:e,name:"MuiMenuItem"}),{autoFocus:n=!1,component:l="li",dense:t=!1,divider:u=!1,disableGutters:r=!1,focusVisibleClassName:M,role:k="menuitem",tabIndex:f,className:R,...w}=a,g=d.useContext(C),v=d.useMemo(()=>({dense:t||g.dense||!1,disableGutters:r}),[g.dense,t,r]),c=d.useRef(null);V(()=>{n&&c.current&&c.current.focus()},[n]);const B={...a,dense:v.dense,divider:u,disableGutters:r},p=H(a),O=L(c,o);let b;return a.disabled||(b=f!==void 0?f:-1),m.jsx(C.Provider,{value:v,children:m.jsx(z,{ref:O,role:k,tabIndex:b,component:l,focusVisibleClassName:y(p.focusVisible,M),className:y(p.root,R),...w,ownerState:B,classes:p})})});export{A as M};
