import{aT as l,cl as g,cf as j,j as e,F as b,Y as M,Q as C,Z as F,er as P}from"./app-BgLa5dit.js";import{P as k}from"./CPXlV0fg.chunk.js";const y="shared.breadcrumbComponent",B=b.encloseNamespace(y),R=64,h=48,o=l.forwardRef((a,n)=>{const{breadcrumb:{name:t,appLink:s,active:u},withBackIcon:m,linkClassName:d}=a;let c=t,r=null;return c.length>h&&(c=t.slice(0,h)+"...",r=t),e.jsx("li",{className:`breadcrumb-item${u?" active":""}`,title:r,children:u?e.jsx("strong",{children:c}):e.jsxs(M,{appLink:s,ref:n,className:s?d:"",children:[m&&e.jsx(C,{svg:P,size:F.Small}),e.jsx("span",{className:m?"ms-2":"",children:c})]})})}),A=({breadcrumbs:a,linkClassName:n})=>{const t=g(j.XS),s=(a==null?void 0:a.length)||0,[u,m]=l.useState(!1),[d,c]=l.useState(!1),r=l.useRef(null);l.useEffect(()=>{const i=(a==null?void 0:a.reduce((x,E)=>x+E.name.length,0))??0;s>4&&i>R&&m(!0)},[a==null?void 0:a.length]),l.useLayoutEffect(()=>{var i;d&&((i=r.current)==null||i.focus())},[r.current,d]);function p(){m(!1),c(!0)}if(!s||t&&s<2)return e.jsx(e.Fragment,{});if(t)return e.jsx("nav",{"aria-label":"breadcrumb",children:e.jsx("ol",{className:"breadcrumb m-0 p-0",children:e.jsx(o,{breadcrumb:a[s-2],withBackIcon:!0,linkClassName:n})})});const f=e.jsx(o,{breadcrumb:a[0],linkClassName:n}),S=s>2?e.jsx(o,{breadcrumb:a[1],linkClassName:n}):e.jsx(e.Fragment,{}),L=s>3?e.jsx(o,{breadcrumb:a[s-2],linkClassName:n}):e.jsx(e.Fragment,{}),v=s>1?e.jsx(o,{breadcrumb:a[s-1],linkClassName:n}):e.jsx(e.Fragment,{}),N=a.slice(2,s-2);return e.jsx("nav",{"aria-label":"breadcrumb",children:e.jsxs("ol",{className:"breadcrumb m-0 p-0",children:[f,S,u?e.jsx("li",{className:"breadcrumb-item",children:e.jsx("button",{className:"btn-link",onClick:p,"aria-label":B("expand"),children:"..."})}):N.map((i,x)=>e.jsx(o,{breadcrumb:i,ref:x===0?r:null,linkClassName:n},x)),L,v]})})},I=l.memo(function({numItems:a=3}){return g(j.XS)?e.jsx("div",{className:"partial-loading-background",style:{height:"1.3125rem",width:"6rem"}}):e.jsx("nav",{"aria-label":"breadcrumb",children:e.jsx("ol",{className:"breadcrumb m-0 p-0",children:k.getPartialLoadingItems({numItems:a}).map(({width:t},s)=>e.jsx("li",{className:"breadcrumb-item",children:e.jsx("span",{className:"d-inline-block partial-loading-background",style:{width:t},dangerouslySetInnerHTML:{__html:"&nbsp"}})},s))})})});export{A as B,I as P};
//# sourceMappingURL=3nM7jLnE.chunk.js.map
