import{n as C,o as M,r,p as R,_ as E,q as o,j as w,s as N,t as L,v as j,w as b}from"./index-BTeXlNCi.js";function U(t){return C("MuiImageList",t)}M("MuiImageList",["root","masonry","quilted","standard","woven"]);const $=r.createContext({}),S=["children","className","cols","component","rowHeight","gap","style","variant"],_=t=>{const{classes:e,variant:s}=t;return j({root:["root",s]},U,e)},k=N("ul",{name:"MuiImageList",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:s}=t;return[e.root,e[s.variant]]}})(({ownerState:t})=>o({display:"grid",overflowY:"auto",listStyle:"none",padding:0,WebkitOverflowScrolling:"touch"},t.variant==="masonry"&&{display:"block"})),V=r.forwardRef(function(e,s){const a=R({props:e,name:"MuiImageList"}),{children:f,className:h,cols:g=2,component:d="ul",rowHeight:i="auto",gap:m=4,style:y,variant:n="standard"}=a,p=E(a,S),l=r.useMemo(()=>({rowHeight:i,gap:m,variant:n}),[i,m,n]);r.useEffect(()=>{},[]);const v=n==="masonry"?o({columnCount:g,columnGap:m},y):o({gridTemplateColumns:`repeat(${g}, 1fr)`,gap:m},y),I=o({},a,{component:d,gap:m,rowHeight:i,variant:n}),c=_(I);return w.jsx(k,o({as:d,className:L(c.root,c[n],h),ref:s,style:v,ownerState:I},p,{children:w.jsx($.Provider,{value:l,children:f})}))});function P(t){return C("MuiImageListItem",t)}const x=M("MuiImageListItem",["root","img","standard","woven","masonry","quilted"]),q=["children","className","cols","component","rows","style"],H=t=>{const{classes:e,variant:s}=t;return j({root:["root",s],img:["img"]},P,e)},G=N("li",{name:"MuiImageListItem",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:s}=t;return[{[`& .${x.img}`]:e.img},e.root,e[s.variant]]}})(({ownerState:t})=>o({display:"block",position:"relative"},t.variant==="standard"&&{display:"flex",flexDirection:"column"},t.variant==="woven"&&{height:"100%",alignSelf:"center","&:nth-of-type(even)":{height:"70%"}},{[`& .${x.img}`]:o({objectFit:"cover",width:"100%",height:"100%",display:"block"},t.variant==="standard"&&{height:"auto",flexGrow:1})})),W=r.forwardRef(function(e,s){const a=R({props:e,name:"MuiImageListItem"}),{children:f,className:h,cols:g=1,component:d="li",rows:i=1,style:m}=a,y=E(a,q),{rowHeight:n="auto",gap:p,variant:l}=r.useContext($);let v="auto";l==="woven"?v=void 0:n!=="auto"&&(v=n*i+p*(i-1));const I=o({},a,{cols:g,component:d,gap:p,rowHeight:n,rows:i,variant:l}),c=H(I);return w.jsx(G,o({as:d,className:L(c.root,c[l],h),ref:s,style:o({height:v,gridColumnEnd:l!=="masonry"?`span ${g}`:void 0,gridRowEnd:l!=="masonry"?`span ${i}`:void 0,marginBottom:l==="masonry"?p:void 0},m),ownerState:I},y,{children:r.Children.map(f,u=>r.isValidElement(u)?u.type==="img"||b(u,["Image"])?r.cloneElement(u,{className:L(c.img,u.props.className)}):u:null)}))});export{V as I,W as a};