import { h as e } from "./chunk.BlbRoQQ3.js";
import { J as t, ai as n } from "./use-page-data.Cb2SuuwJ.js";
import "./chunk-LSPN22SI.D75E3zS-.js";
import { c as r } from "./twind.BiM9xcCd.js";
import { b as i } from "./jsx-runtime.DF4K5VCp.js";
import "./chroma-js.Dcir27CH.js";
import "./color-system.Dp99zR0T.js";
import "./react.BZZIbN3T.js";
import "./iconBase.C7m0emOO.js";
import { d as a, e as o, f as s, g as c, j as l } from "./schema-resolver.p7B_pu36.js";
import { f as u } from "./rx.CwXTGsxR.js";
import { b as d } from "./use-brick-style.DDPl-_C1.js";
import "./use-brick-manifest.Iv9SG-7-.js";
import { b as f } from "./TextContent.B1cB93wj.js";
import { b as p } from "./BrickRoot.DbISziyH.js";
var m = "__lodash_hash_undefined__";
function h(e) {
	return this.__data__.set(e, m), this;
}
function g(e) {
	return this.__data__.has(e);
}
function _(e) {
	var t = -1, n = e == null ? 0 : e.length;
	for (this.__data__ = new o(); ++t < n;) this.add(e[t]);
}
_.prototype.add = _.prototype.push = h, _.prototype.has = g;
function v(e, t, n, r) {
	for (var i = e.length, a = n + (r ? 1 : -1); r ? a-- : ++a < i;) if (t(e[a], a, e)) return a;
	return -1;
}
function y(e) {
	return e !== e;
}
function b(e, t, n) {
	for (var r = n - 1, i = e.length; ++r < i;) if (e[r] === t) return r;
	return -1;
}
function x(e, t, n) {
	return t === t ? b(e, t, n) : v(e, y, n);
}
function S(e, t) {
	var n = e == null ? 0 : e.length;
	return !!n && x(e, t, 0) > -1;
}
function C(e, t, n) {
	for (var r = -1, i = e == null ? 0 : e.length; ++r < i;) if (n(t, e[r])) return !0;
	return !1;
}
function w(e) {
	return function(t) {
		return e(t);
	};
}
function T(e, t) {
	return e.has(t);
}
var E = Math.min;
function D(e, t, n) {
	for (var r = n ? C : S, i = e[0].length, o = e.length, s = o, c = Array(o), l = Infinity, u = []; s--;) {
		var d = e[s];
		s && t && (d = a(d, w(t))), l = E(d.length, l), c[s] = !n && (t || i >= 120 && d.length >= 120) ? new _(s && d) : void 0;
	}
	d = e[0];
	var f = -1, p = c[0];
	outer: for (; ++f < i && u.length < l;) {
		var m = d[f], h = t ? t(m) : m;
		if (m = n || m !== 0 ? m : 0, !(p ? T(p, h) : r(u, h, n))) {
			for (s = o; --s;) {
				var g = c[s];
				if (!(g ? T(g, h) : r(e[s], h, n))) continue outer;
			}
			p && p.push(h), u.push(m);
		}
	}
	return u;
}
function O(e) {
	return e;
}
function k(e, t, n) {
	switch (n.length) {
		case 0: return e.call(t);
		case 1: return e.call(t, n[0]);
		case 2: return e.call(t, n[0], n[1]);
		case 3: return e.call(t, n[0], n[1], n[2]);
	}
	return e.apply(t, n);
}
var A = Math.max;
function j(e, t, n) {
	return t = A(t === void 0 ? e.length - 1 : t, 0), function() {
		for (var r = arguments, i = -1, a = A(r.length - t, 0), o = Array(a); ++i < a;) o[i] = r[t + i];
		i = -1;
		for (var s = Array(t + 1); ++i < t;) s[i] = r[i];
		return s[t] = n(o), k(e, this, s);
	};
}
function M(e) {
	return function() {
		return e;
	};
}
var N = function() {
	try {
		var e = s(Object, "defineProperty");
		return e({}, "", {}), e;
	} catch {}
}(), P = N ? function(e, t) {
	return N(e, "toString", {
		configurable: !0,
		enumerable: !1,
		value: M(t),
		writable: !0
	});
} : O, F = 800, I = 16, L = Date.now;
function R(e) {
	var t = 0, n = 0;
	return function() {
		var r = L(), i = I - (r - n);
		if (n = r, i > 0) {
			if (++t >= F) return arguments[0];
		} else t = 0;
		return e.apply(void 0, arguments);
	};
}
var z = R(P);
function B(e, t) {
	return z(j(e, t, O), e + "");
}
var V = 9007199254740991;
function H(e) {
	return typeof e == "number" && e > -1 && e % 1 == 0 && e <= V;
}
function U(e) {
	return e != null && H(e.length) && !c(e);
}
function W(e) {
	return l(e) && U(e);
}
function G(e) {
	return W(e) ? e : [];
}
var K = B(function(e) {
	var t = a(e, G);
	return t.length && t[0] === e[0] ? D(t) : [];
}), q = /* @__PURE__ */ e(i());
function J({ brick: e, editable: i }) {
	let a = d(e), o = e.props, s = t(), c = s.filter((e) => K(e.tags, o.linksTagsFilter ?? []).length > 0).map((e) => ({
		urlOrPageId: e.id,
		label: e.label
	})) ?? [], l = [...c, ...o.staticNavItems ?? []].map((e) => {
		let t = s.find((t) => t.id === e.urlOrPageId)?.path ?? e.urlOrPageId;
		return {
			href: t,
			label: e.label
		};
	}), m = (e) => {
		i && e.preventDefault();
	};
	return /* @__PURE__ */ (0, q.jsx)(p, {
		brick: e,
		editable: i,
		manifest: n,
		as: "header",
		"data-brick-group": "container",
		"data-no-section-padding": !0,
		className: r("flex px-4 brick basis-full h-[60px]", Object.values(a)),
		children: /* @__PURE__ */ (0, q.jsxs)("div", {
			className: r("flex flex-1 items-center justify-between @lg:justify-start", o.linksPosition !== "center" && "@lg:gap-4"),
			children: [
				/* @__PURE__ */ (0, q.jsxs)("div", {
					className: r("flex items-center gap-3"),
					"data-brick-group": "brand",
					"data-brick-menu-offset": "70",
					children: [o.logo?.src && /* @__PURE__ */ (0, q.jsx)("img", {
						src: o.logo.src,
						alt: o.logo.alt ?? "Logo",
						className: "h-full max-h-[60px] w-auto flex-1"
					}), o.brand && !o.hideBrand && /* @__PURE__ */ (0, q.jsx)(f, {
						as: "h1",
						propPath: "brand.name",
						className: r("text-2xl font-bold flex-1"),
						brickId: e.id,
						content: o.brand,
						rawContent: o.brand,
						editable: i,
						noTextAlign: !0,
						noTextType: !0,
						noTextStrike: !0,
						inline: !0
					})]
				}),
				/* @__PURE__ */ (0, q.jsx)("nav", {
					"data-brick-group": "navigation",
					className: r("hidden @desktop:flex items-center gap-2", o.linksPosition === "right" && "ml-auto", o.linksPosition === "center" && "mx-auto"),
					children: l.map((e, t) => /* @__PURE__ */ (0, q.jsx)("a", {
						onClick: m,
						href: e.href,
						className: r("font-semibold py-2 px-4 self-stretch rounded-md", "hover:brightness-125"),
						children: e.label
					}, t))
				}),
				/* @__PURE__ */ (0, q.jsx)("div", {
					role: "menu",
					className: "ml-auto @desktop:hidden items-center gap-4",
					"data-brick-group": "actions",
					children: /* @__PURE__ */ (0, q.jsx)(u, { className: "w-6 h-6" })
				})
			]
		})
	});
}
export { J as default };

//# sourceMappingURL=navbar.CDzyyPaq.js.map