import{b as y,j as t,c as w,n as O,R as L,r as j,cW as S,cX as W,aT as B,aR as T,I as _,aS as A,l as D}from"./main-239552ae.js";const X=y(t.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6-6-6z"}),"ChevronRightOutlined");function K(o){const{isCurrent:b,sizeStyle:i,isMenuTrigger:f,isClickable:z,isDisabled:d,onSelected:u,className:E,isMenuItem:m,isLink:e}=o,x=typeof o.children=="function"?o.children({isMenuItem:m}):o.children;if(m)return x;const I=f?{}:{tabIndex:e&&!d?0:void 0,role:e?"link":void 0,"aria-disabled":e?d:void 0,"aria-current":b&&e?"page":void 0,onClick:()=>u==null?void 0:u()};return t.jsxs("li",{className:w(`relative inline-flex min-w-0 flex-shrink-0 items-center justify-start ${i==null?void 0:i.font}`,(!z||d)&&"pointer-events-none",!b&&d&&"text-disabled"),children:[t.jsx("div",{...I,className:w(E,"cursor-pointer overflow-hidden whitespace-nowrap rounded px-8",!f&&"py-4 hover:bg-hover",!f&&e&&"outline-none focus-visible:ring"),children:x}),b===!1&&t.jsx(X,{size:i==null?void 0:i.icon,className:w(d?"text-disabled":"text-muted")})]})}const P=y(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"}),"MoreHorizOutlined"),q=1,F=10;function Q(o){const{size:b="md",children:i,isDisabled:f,className:z,currentIsClickable:d,isNavigation:u}=o,{trans:E}=O(),m=G(b),e=[];L.Children.forEach(i,s=>{L.isValidElement(s)&&e.push(s)});const x=j.useRef(null),I=j.useRef(null),[V,k]=S(e.length),R=j.useCallback(()=>{const s=l=>{var C;const c=I.current;if(!c)return;const n=Array.from(c.children);if(!n.length)return;const h=c.offsetWidth,v=e.length>l;let r=0,a=0,p=F;if(r+=n.shift().offsetWidth,a++,v&&(r+=((C=n.shift())==null?void 0:C.offsetWidth)??0,p--),r>=h&&a--,n.length>0){const M=n.pop();M.style.overflow="visible",r+=M.offsetWidth,r<h&&a++,M.style.overflow=""}for(const M of n.reverse())r+=M.offsetWidth,r<h&&a++;return Math.max(q,Math.min(p,a))};k(function*(){yield e.length;const l=s(e.length);yield l,l<e.length&&l>1&&(yield s(l))})},[I,i,k]);W({ref:x,onResize:R}),B(R,[i]);let g=e;if(e.length>V){const s=e.length-1;g=[t.jsx(K,{sizeStyle:m,isMenuTrigger:!0,children:t.jsxs(T,{selectionMode:"single",selectedValue:s,children:[t.jsx(_,{"aria-label":"…",disabled:f,size:m.btn,children:t.jsx(P,{})}),t.jsx(A,{children:e.map((h,v)=>{const r=s===v;return t.jsx(D,{value:v,onSelected:()=>{var a,p;r||(p=(a=h.props).onSelected)==null||p.call(a)},children:j.cloneElement(h,{isMenuItem:!0})},v)})})]})},"menu")];const c=[...e];let n=V;V>1&&(g.unshift(c.shift()),n--),g.push(...c.slice(-n))}const N=g.length-1,H=g.map((s,l)=>{const c=l===N,n=!c||d;return j.cloneElement(s,{key:s.key||l,isCurrent:c,sizeStyle:m,isClickable:n,isDisabled:f,isLink:u&&s.key!=="menu"})}),$=u?"nav":"div";return t.jsx($,{className:w(z,"w-full min-w-0"),"aria-label":E({message:"Breadcrumbs"}),ref:x,children:t.jsx("ol",{ref:I,className:w("flex flex-nowrap justify-start",m.minHeight),children:H})})}function G(o){switch(o){case"sm":return{font:"text-sm",icon:"sm",btn:"sm",minHeight:"min-h-36"};case"lg":return{font:"text-lg",icon:"md",btn:"md",minHeight:"min-h-42"};case"xl":return{font:"text-xl",icon:"md",btn:"md",minHeight:"min-h-42"};default:return{font:"text-base",icon:"md",btn:"md",minHeight:"min-h-42"}}}const U=y(t.jsx("path",{d:"m14.06 9.02.92.92L5.92 19H5v-.92l9.06-9.06M17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29zm-3.6 3.19L3 17.25V21h3.75L17.81 9.94l-3.75-3.75z"}),"EditOutlined"),Y=y(t.jsx("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"}),"OpenInNewOutlined");export{Q as B,X as C,U as E,P as M,Y as O,K as a};
//# sourceMappingURL=OpenInNew-32d7773a.js.map
