import{j as t,f as p,c$ as $,cI as v,dC as j,cG as z,cF as E,T as N,r as i,cJ as T,cL as A,cM as U}from"./index-5768b108.js";import{c as L}from"./createSvgIcon-51b522b8.js";import{u as O}from"./useSlotProps-ed538db1.js";const q=L(t.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),D=p($)(v(({theme:e})=>({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`,...e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},borderRadius:2,"&:hover, &:focus":{...e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}},"&:active":{boxShadow:e.shadows[0],...e.palette.mode==="light"?{backgroundColor:j(e.palette.grey[200],.12)}:{backgroundColor:j(e.palette.grey[600],.12)}}}))),F=p(q)({width:24,height:16});function G(e){const{slots:s={},slotProps:a={},...l}=e,r=e;return t.jsx("li",{children:t.jsx(D,{focusRipple:!0,...l,ownerState:r,children:t.jsx(F,{as:s.CollapsedIcon,ownerState:r,...a.collapsedIcon})})})}function H(e){return E("MuiBreadcrumbs",e)}const J=z("MuiBreadcrumbs",["root","ol","li","separator"]),V=J,W=e=>{const{classes:s}=e;return U({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},H,s)},K=p(N,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,s)=>[{[`& .${V.li}`]:s.li},s.root]})({}),Q=p("ol",{name:"MuiBreadcrumbs",slot:"Ol"})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),X=p("li",{name:"MuiBreadcrumbs",slot:"Separator"})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function Y(e,s,a,l){return e.reduce((r,d,n)=>(n<e.length-1?r=r.concat(d,t.jsx(X,{"aria-hidden":!0,className:s,ownerState:l,children:a},`separator-${n}`)):r.push(d),r),[])}const Z=i.forwardRef(function(s,a){const l=T({props:s,name:"MuiBreadcrumbs"}),{children:r,className:d,component:n="nav",slots:C={},slotProps:I={},expandText:h="Show path",itemsAfterCollapse:m=1,itemsBeforeCollapse:g=1,maxItems:f=8,separator:y="/",...R}=l,[B,M]=i.useState(!1),c={...l,component:n,expanded:B,expandText:h,itemsAfterCollapse:m,itemsBeforeCollapse:g,maxItems:f,separator:y},u=W(c),k=O({elementType:C.CollapsedIcon,externalSlotProps:I.collapsedIcon,ownerState:c}),S=i.useRef(null),P=o=>{const x=()=>{M(!0);const w=S.current.querySelector("a[href],button,[tabindex]");w&&w.focus()};return g+m>=o.length?o:[...o.slice(0,g),t.jsx(G,{"aria-label":h,slots:{CollapsedIcon:C.CollapsedIcon},slotProps:{collapsedIcon:k},onClick:x},"ellipsis"),...o.slice(o.length-m,o.length)]},b=i.Children.toArray(r).filter(o=>i.isValidElement(o)).map((o,x)=>t.jsx("li",{className:u.li,children:o},`child-${x}`));return t.jsx(K,{ref:a,component:n,color:"textSecondary",className:A(u.root,d),ownerState:c,...R,children:t.jsx(Q,{className:u.ol,ref:S,ownerState:c,children:Y(B||f&&b.length<=f?b:P(b),u.separator,y,c)})})}),oe=Z;export{oe as B};
