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