'use client';import { a as a$1 } from './chunk-MO7ADHF3.js';
import { a as a$2 } from './chunk-UPX6JFOI.js';
import { a } from './chunk-TWGPE4V7.js';
import { cx } from '@onbeam/styled-system/css';
import { BeamNetworkIcon } from '@onbeam/icons';
import { useState, useEffect } from 'react';
import { topNav } from '@onbeam/styled-system/recipes';
import { jsxs, jsx } from 'react/jsx-runtime';

var N=a(({as:d="header",linkComponent:l="a",title:s,homeHref:v="/",navItems:r,activePath:t,isNavigationItemActive:u,onRouteChange:p,children:h,className:g,...y},T)=>{let[x,k]=useState(t),a=topNav();useEffect(()=>{!r||r.findIndex(n=>n.href===t)===-1||k(t);},[t,r]);let S=e=>{if(!r||!p)return;let n=r.find(C=>C.href===e.target.value);n&&p(n);};return jsxs(d,{ref:T,className:cx(a.root,g),...y,children:[jsxs("div",{className:a.logo,children:[jsxs(l,{href:v,className:a.homeLink,children:[jsx(BeamNetworkIcon,{height:28,width:28}),s&&jsx("span",{className:a.title,children:s})]}),r&&jsx(a$1,{width:90,className:a.select,"aria-label":"Navigation",onChange:S,value:x,children:r.map(({label:e,href:n})=>jsx("option",{value:n,children:e},n))})]}),r&&jsx("nav",{className:a.nav,children:jsx("ul",{className:a.navList,children:r.map(e=>jsx("li",{children:jsx(a$2,{as:l,size:"sm",variant:u?.(e)?"primary":"secondary",href:e.href,target:e.isExternal?"_blank":"_self",rel:"noopener noreferrer",children:e.label})},e.href))})}),jsx("div",{className:a.childrenContainer,children:h})]})});N.displayName="TopNav";

export { N as a };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=chunk-G7ZRABGR.js.map