import{j as t,f as p,d8 as P,q as $,dK as R,n as z,m as E,T as N,r as i,t as T,v as A,w as U}from"./index-ba11e6ab.js";import"./index-e5978b8b.js";import{c as q,b as H}from"./Grow-1038181b.js";const L=q(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"}),"MoreHoriz"),O=p(P)($(({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:R(e.palette.grey[200],.12)}:{backgroundColor:R(e.palette.grey[600],.12)}}}))),D=p(L)({width:24,height:16});function K(e){const{slots:r={},slotProps:a={},...l}=e,s=e;return t.jsx("li",{children:t.jsx(O,{focusRipple:!0,...l,ownerState:s,children:t.jsx(D,{as:r.CollapsedIcon,ownerState:s,...a.collapsedIcon})})})}function V(e){return E("MuiBreadcrumbs",e)}const W=z("MuiBreadcrumbs",["root","ol","li","separator"]),F=W,G=e=>{const{classes:r}=e;return U({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},V,r)},J=p(N,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,r)=>[{[`& .${F.li}`]:r.li},r.root]})({}),Q=p("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(e,r)=>r.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),X=p("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(e,r)=>r.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function Y(e,r,a,l){return e.reduce((s,d,n)=>(n<e.length-1?s=s.concat(d,t.jsx(X,{"aria-hidden":!0,className:r,ownerState:l,children:a},`separator-${n}`)):s.push(d),s),[])}const Z=i.forwardRef(function(r,a){const l=T({props:r,name:"MuiBreadcrumbs"}),{children:s,className:d,component:n="nav",slots:C={},slotProps:j={},expandText:h="Show path",itemsAfterCollapse:m=1,itemsBeforeCollapse:g=1,maxItems:f=8,separator:y="/",...v}=l,[B,I]=i.useState(!1),c={...l,component:n,expanded:B,expandText:h,itemsAfterCollapse:m,itemsBeforeCollapse:g,maxItems:f,separator:y},u=G(c),M=H({elementType:C.CollapsedIcon,externalSlotProps:j.collapsedIcon,ownerState:c}),S=i.useRef(null),k=o=>{const x=()=>{I(!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(K,{"aria-label":h,slots:{CollapsedIcon:C.CollapsedIcon},slotProps:{collapsedIcon:M},onClick:x},"ellipsis"),...o.slice(o.length-m,o.length)]},b=i.Children.toArray(s).filter(o=>i.isValidElement(o)).map((o,x)=>t.jsx("li",{className:u.li,children:o},`child-${x}`));return t.jsx(J,{ref:a,component:n,color:"textSecondary",className:A(u.root,d),ownerState:c,...v,children:t.jsx(Q,{className:u.ol,ref:S,ownerState:c,children:Y(B||f&&b.length<=f?b:k(b),u.separator,y,c)})})}),oe=Z;export{oe as B};
