import { jsx as r, Fragment as N, jsxs as b } from "react/jsx-runtime";
import { useState as J, useMemo as Q, createElement as U } from "react";
import { c as W, s as X, a as Y } from "../tools/tools.js";
import { N as t } from "./navbar-brand.js";
import { N as C } from "./navbar-collapse.js";
import { N as T } from "./navbar-container.js";
import { N as I } from "./navbar-nav-item.js";
import { N as f } from "./navbar-nav-link.js";
import { N as B } from "./navbar-nav.js";
import { N as O } from "./navbar-text.js";
import { N as L } from "./navbar-toggler-icon.js";
import { N as $ } from "./navbar-toggler.js";
const o = function(j) {
  const {
    as: K = "nav",
    brand: e,
    brandPosition: n,
    brandProps: i,
    className: m,
    collapse: l,
    collapseProps: S,
    container: h,
    containerProps: E,
    dropOldClass: g,
    expand: s,
    externalContent: x,
    fixed: c,
    nav: d,
    navProps: F,
    options: M,
    scroll: R,
    skipItem: V,
    sticky: p,
    style: y,
    text: P,
    textProps: _,
    toggler: q,
    togglerIconProps: w,
    togglerProps: z,
    variables: k,
    ...A
  } = j, D = (M ?? []).map((a, v) => ({
    ...a,
    id: a.id ?? v
  })), [u] = J(D), G = Q(() => {
    const a = W(
      !g && "navbar",
      s && (typeof s == "boolean" ? "navbar-expand" : `navbar-expand-${s}`),
      c && `fixed-${c}`,
      p && `sticky-${p}`,
      m
    ), v = X((aa, H) => ({ tKey: Y(H) }), k, y);
    return {
      className: a,
      style: v
    };
  }, [m, g, s, c, p, y, k]);
  return /* @__PURE__ */ r(N, { children: /* @__PURE__ */ b(K, { ...A, ...G, children: [
    x && x,
    /* @__PURE__ */ b(T, { ...E, children: [
      e && (!n || n === "left") && /* @__PURE__ */ r(t, { ...i, children: e }),
      q && /* @__PURE__ */ r($, { ...z, children: /* @__PURE__ */ r(L, { ...w }) }),
      e && n === "right" && /* @__PURE__ */ r(t, { ...i, children: e }),
      h || /* @__PURE__ */ r(N, { children: (l || d || !!u.length) && /* @__PURE__ */ b(C, { ...S, children: [
        e && n === "hidden" && /* @__PURE__ */ r(t, { ...i, children: e }),
        /* @__PURE__ */ r(B, { ...F, scroll: R, children: d || /* @__PURE__ */ r(N, { children: u.map((a) => V || typeof a.item == "boolean" && !a.item ? /* @__PURE__ */ r(
          f,
          {
            active: a.active,
            "aria-current": a.active ? "page" : void 0,
            disabled: a.disabled,
            href: a.href,
            ...a.linkProps,
            children: a.link
          },
          a.id
        ) : /* @__PURE__ */ U(I, { ...a.itemProps, key: a.id }, /* @__PURE__ */ r(
          f,
          {
            active: a.active,
            "aria-current": a.active ? "page" : void 0,
            disabled: a.disabled,
            href: a.href,
            ...a.linkProps,
            children: a.link
          }
        ), a.item && a.item)) }) }),
        P && /* @__PURE__ */ r(O, { ..._, children: P }),
        l && l
      ] }) })
    ] })
  ] }) });
};
o.Text = O;
o.Brand = t;
o.Toggler = $;
o.TogglerIcon = L;
o.Collapse = C;
o.Nav = B;
o.NavItem = I;
o.NavLink = f;
o.Container = T;
o.displayName = "BRL.Navbar";
export {
  o as N
};
//# sourceMappingURL=navbar.js.map
