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