import{bh as C,bi as A,d as h,r as a,bk as U,j as r,bm as S,bn as k,bj as K,cH as O,bt as Q,bl as W,bz as B}from"./index-d2b25495.js";import{a as f}from"./List-863f013e.js";function X(e){return C("MuiListItem",e)}A("MuiListItem",["root","container","dense","alignItemsFlexStart","divider","gutters","padding","secondaryAction"]);function pt(e){return C("MuiListItemButton",e)}const Z=A("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),_=Z;function tt(e){return C("MuiListItemSecondaryAction",e)}A("MuiListItemSecondaryAction",["root","disableGutters"]);const et=e=>{const{disableGutters:t,classes:s}=e;return k({root:["root",t&&"disableGutters"]},tt,s)},st=h("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}}]}),F=a.forwardRef(function(t,s){const o=U({props:t,name:"MuiListItemSecondaryAction"}),{className:n,...l}=o,p=a.useContext(f),i={...o,disableGutters:p.disableGutters},y=et(i);return r.jsx(st,{className:S(y.root,n),ownerState:i,ref:s,...l})});F.muiName="ListItemSecondaryAction";const ot=F,nt=(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]},it=e=>{const{alignItems:t,classes:s,dense:o,disableGutters:n,disablePadding:l,divider:p,hasSecondaryAction:i}=e;return k({root:["root",o&&"dense",!n&&"gutters",!l&&"padding",p&&"divider",t==="flex-start"&&"alignItemsFlexStart",i&&"secondaryAction"],container:["container"],secondaryAction:["secondaryAction"]},X,s)},rt=h("div",{name:"MuiListItem",slot:"Root",overridesResolver:nt})(K(({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:{[`& > .${_.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}}]}))),at=h("li",{name:"MuiListItem",slot:"Container"})({position:"relative"}),dt=a.forwardRef(function(t,s){const o=U({props:t,name:"MuiListItem"}),{alignItems:n="center",children:l,className:p,component:i,components:y={},componentsProps:$={},ContainerComponent:L="li",ContainerProps:{className:T,...D}={},dense:P=!1,disableGutters:I=!1,disablePadding:E=!1,divider:z=!1,secondaryAction:R,slotProps:M={},slots:G={},...H}=o,j=a.useContext(f),x=a.useMemo(()=>({dense:P||j.dense||!1,alignItems:n,disableGutters:I}),[n,j.dense,P,I]),V=a.useRef(null),d=a.Children.toArray(l),w=d.length&&O(d[d.length-1],["ListItemSecondaryAction"]),m={...o,alignItems:n,dense:x.dense,disableGutters:I,disablePadding:E,divider:z,hasSecondaryAction:w},v=it(m),N=Q(V,s),Y={slots:G,slotProps:M},[q,J]=W("secondaryAction",{elementType:ot,externalForwardedProps:Y,ownerState:m,className:v.secondaryAction}),b=G.root||y.Root||rt,u=M.root||$.root||{},g={className:S(v.root,u.className,p),...H};let c=i||"li";return w?(c=!g.component&&!i?"div":c,L==="li"&&(c==="li"?c="div":g.component==="li"&&(g.component="div")),r.jsx(f.Provider,{value:x,children:r.jsxs(at,{as:L,className:S(v.container,T),ref:N,ownerState:m,...D,children:[r.jsx(b,{...u,...!B(b)&&{as:c,ownerState:{...m,...u.ownerState}},...g,children:d}),d.pop()]})})):r.jsx(f.Provider,{value:x,children:r.jsxs(b,{...u,as:c,ref:N,...!B(b)&&{ownerState:{...m,...u.ownerState}},...g,children:[d,R&&r.jsx(q,{...J,children:R})]})})}),mt=dt;export{mt as L,ot as a,pt as g,_ as l};
