import{j as s}from"./Button.BVfR1y85.js";import{r as d}from"./index.eCxJ45ll.js";import{k as l,s as p}from"./index.CAChmxYj.js";import{c as v,b as x,e as b,N as f,d as u}from"./PageSidebarBody.DgDLnRuY.js";/* empty css                        */import"./angle-left-icon.CfKwuSCS.js";import"./divider.BP4XR7uq.js";import"./index.BQFV5hT1.js";import"./resizeObserver.BgQpxO8W.js";import"./page.BTC3Kf3x.js";import"./PageContext.BUbWpNW2.js";const m=t=>t.replace("PatternFly","Patternfly"),c=t=>l(m(t)),j=t=>p(m(t)).replace("Patternfly","PatternFly"),N=({entry:t,isActive:o})=>{const{id:e}=t,{id:r,section:i}=t.data,a=c(r),n=c(i);return s.jsx(v,{itemId:e,to:`/${n}/${a}`,isActive:o,id:`nav-entry-${e}`,"data-astro-reload":!0,children:r})},h=({entries:t,sectionId:o,activeItem:e})=>{const r=window.location.pathname.includes(c(o)),i=t.some(n=>n.id===e),a=t.map(n=>s.jsx(N,{entry:n,isActive:e===n.id||window.location.pathname.includes(c(n.data.id))},n.id));return s.jsx(x,{title:j(o),isActive:i,isExpanded:r,id:`nav-section-${o}`,children:a})},F=({navData:t})=>{const[o,e]=d.useState("");d.useEffect(()=>{e(window.location.pathname.split("/").reverse()[0])},[]);const r=(i,a)=>{e(a.itemId.toString())};return s.jsx(b,{id:"page-sidebar-body",children:s.jsx(f,{onSelect:r,children:s.jsx(u,{children:t.map(i=>{const{section:a}=i[0].data;return s.jsx(h,{entries:i,sectionId:a,activeItem:o},a)})})})})};export{F as Navigation};
