import{m as C,n as h,f as L,r as a,t as N,j as r,v as b,w as B,q as V,c$ as Y}from"./index-e6164346.js";import{e as x,h as j}from"./Select-9c2d8cd2.js";import{i as J}from"./isMuiElement-5779af4f.js";function K(e){return C("MuiListItem",e)}h("MuiListItem",["root","container","dense","alignItemsFlexStart","divider","gutters","padding","secondaryAction"]);function dt(e){return C("MuiListItemButton",e)}const O=h("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),Q=O;function W(e){return C("MuiListItemSecondaryAction",e)}h("MuiListItemSecondaryAction",["root","disableGutters"]);const X=e=>{const{disableGutters:t,classes:s}=e;return B({root:["root",t&&"disableGutters"]},W,s)},Z=L("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:s}=e;return[t.root,s.disableGutters&&t.disableGutters]}})({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",variants:[{props:({ownerState:e})=>e.disableGutters,style:{right:0}}]}),U=a.forwardRef(function(t,s){const o=N({props:t,name:"MuiListItemSecondaryAction"}),{className:n,...c}=o,p=a.useContext(x),i={...o,disableGutters:p.disableGutters},g=X(i);return r.jsx(Z,{className:b(g.root,n),ownerState:i,ref:s,...c})});U.muiName="ListItemSecondaryAction";const _=U,tt=(e,t)=>{const{ownerState:s}=e;return[t.root,s.dense&&t.dense,s.alignItems==="flex-start"&&t.alignItemsFlexStart,s.divider&&t.divider,!s.disableGutters&&t.gutters,!s.disablePadding&&t.padding,s.hasSecondaryAction&&t.secondaryAction]},et=e=>{const{alignItems:t,classes:s,dense:o,disableGutters:n,disablePadding:c,divider:p,hasSecondaryAction:i}=e;return B({root:["root",o&&"dense",!n&&"gutters",!c&&"padding",p&&"divider",t==="flex-start"&&"alignItemsFlexStart",i&&"secondaryAction"],container:["container"]},K,s)},st=L("div",{name:"MuiListItem",slot:"Root",overridesResolver:tt})(V(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",variants:[{props:({ownerState:t})=>!t.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:t})=>!t.disablePadding&&t.dense,style:{paddingTop:4,paddingBottom:4}},{props:({ownerState:t})=>!t.disablePadding&&!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>!t.disablePadding&&!!t.secondaryAction,style:{paddingRight:48}},{props:({ownerState:t})=>!!t.secondaryAction,style:{[`& > .${Q.root}`]:{paddingRight:48}}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:t})=>t.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:t})=>t.button,style:{transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}}},{props:({ownerState:t})=>t.hasSecondaryAction,style:{paddingRight:48}}]}))),ot=L("li",{name:"MuiListItem",slot:"Container",overridesResolver:(e,t)=>t.container})({position:"relative"}),nt=a.forwardRef(function(t,s){const o=N({props:t,name:"MuiListItem"}),{alignItems:n="center",children:c,className:p,component:i,components:g={},componentsProps:$={},ContainerComponent:S="li",ContainerProps:{className:k,...F}={},dense:A=!1,disableGutters:y=!1,disablePadding:D=!1,divider:E=!1,secondaryAction:R,slotProps:T={},slots:q={},...z}=o,P=a.useContext(x),v=a.useMemo(()=>({dense:A||P.dense||!1,alignItems:n,disableGutters:y}),[n,P.dense,A,y]),H=a.useRef(null),d=a.Children.toArray(c),M=d.length&&J(d[d.length-1],["ListItemSecondaryAction"]),f={...o,alignItems:n,dense:v.dense,disableGutters:y,disablePadding:D,divider:E,hasSecondaryAction:M},G=et(f),w=Y(H,s),I=q.root||g.Root||st,m=T.root||$.root||{},u={className:b(G.root,m.className,p),...z};let l=i||"li";return M?(l=!u.component&&!i?"div":l,S==="li"&&(l==="li"?l="div":u.component==="li"&&(u.component="div")),r.jsx(x.Provider,{value:v,children:r.jsxs(ot,{as:S,className:b(G.container,k),ref:w,ownerState:f,...F,children:[r.jsx(I,{...m,...!j(I)&&{as:l,ownerState:{...f,...m.ownerState}},...u,children:d}),d.pop()]})})):r.jsx(x.Provider,{value:v,children:r.jsxs(I,{...m,as:l,ref:w,...!j(I)&&{ownerState:{...f,...m.ownerState}},...u,children:[d,R&&r.jsx(_,{children:R})]})})}),lt=nt;export{lt as L,_ as a,dt as g,Q as l};
