Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_chunk = require("../../chunk-BN4qSVkS.cjs");
const require_styles_breakpoints = require("../../styles/breakpoints.cjs");
const require_styles_colors = require("../../styles/colors.cjs");
const require_components_Icon_Icon = require("../Icon/Icon.cjs");
const require_components_TextButton = require("../TextButton.cjs");
require("./constants.cjs");
let _emotion_styled = require("@emotion/styled");
_emotion_styled = require_chunk.__toESM(_emotion_styled);
let _emotion_react_jsx_runtime = require("@emotion/react/jsx-runtime");
let _lightsparkdev_core = require("@lightsparkdev/core");
//#region src/components/PageSection/PageSectionNav.tsx
const StyledPageSectionNav = _emotion_styled.default.div`
  display: none;
  flex-direction: column;
  margin-right: 32px;
  position: relative;

  ${require_styles_breakpoints.bp.minMd(`
    display: flex;
    width: 150px;
  `)}

  ${require_styles_breakpoints.bp.lg(`
    width: 200px;
  `)}
`;
const PageSectionList = _emotion_styled.default.ul`
  margin: 0;
  padding: 0;
  position: sticky;
  top: ${({ top }) => top}px;
`;
const StyledPageSectionNavItem = _emotion_styled.default.li`
  align-items: center;
  color: ${require_styles_colors.colors.gray40};
  display: flex;
  list-style: none;

  ${require_components_Icon_Icon.IconContainer}:not(:first-of-type) {
    visibility: hidden;
  }

  &:hover {
    color: ${({ theme }) => theme.hcNeutral};

    ${require_components_Icon_Icon.IconContainer} {
      visibility: visible;
    }
  }
`;
const PageSectionListItem = ({ leftIcon, label, sectionId }) => /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(StyledPageSectionNavItem, { children: /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(require_components_TextButton.TextButton, {
	text: label,
	padding: "8px 0",
	leftIcon: { name: leftIcon },
	onClick: () => {
		if (sectionId) window.location.replace(`#${sectionId}`);
		else window.location.replace("#");
	}
}) });
function PageSectionNav({ headerOffset = 0, pageSectionNavItems }) {
	return /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(StyledPageSectionNav, { children: /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(PageSectionList, {
		top: headerOffset + 20,
		children: pageSectionNavItems.filter(_lightsparkdev_core.notNullUndefined).map((item) => {
			return /* @__PURE__ */ (0, _emotion_react_jsx_runtime.jsx)(PageSectionListItem, {
				leftIcon: item.leftIcon,
				label: item.label,
				sectionId: item.sectionId
			}, item.sectionId);
		})
	}) });
}
//#endregion
exports.PageSectionNav = PageSectionNav;
