"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _chunk46AVXTFOcjs = require('./chunk-46AVXTFO.cjs');


var _chunk6DYK4XKYcjs = require('./chunk-6DYK4XKY.cjs');


var _chunkZUAUG74Vcjs = require('./chunk-ZUAUG74V.cjs');


var _chunkAEJ7VTL4cjs = require('./chunk-AEJ7VTL4.cjs');



var _chunkJRZVXLTFcjs = require('./chunk-JRZVXLTF.cjs');


var _chunkDDGSFIWAcjs = require('./chunk-DDGSFIWA.cjs');



var _chunkKU2ZI6TIcjs = require('./chunk-KU2ZI6TI.cjs');


var _chunkOA2TKY4Kcjs = require('./chunk-OA2TKY4K.cjs');


var _chunkSNSG4HBQcjs = require('./chunk-SNSG4HBQ.cjs');


var _chunkWF7Z2VITcjs = require('./chunk-WF7Z2VIT.cjs');



var _chunkRSHN4K6Ncjs = require('./chunk-RSHN4K6N.cjs');


var _chunk6VA4SAHQcjs = require('./chunk-6VA4SAHQ.cjs');


var _chunkKW3JYLRIcjs = require('./chunk-KW3JYLRI.cjs');


var _chunkQQDRBCBYcjs = require('./chunk-QQDRBCBY.cjs');


var _chunkZ6EUSUADcjs = require('./chunk-Z6EUSUAD.cjs');

// src/components/PageSection/PageSection.tsx
var _react = require('@emotion/react');
var _styled = require('@emotion/styled'); var _styled2 = _interopRequireDefault(_styled);
var _react3 = require('react');
var _jsxruntime = require('@emotion/react/jsx-runtime');
function PageSection({
  children,
  title,
  sectionId,
  headerOffset = 0
}) {
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, StyledPageSection, { scrollMarginTop: headerOffset + _chunk46AVXTFOcjs.pageSectionScrollOffset, children: [
    title ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkKU2ZI6TIcjs.Heading, { type: "h3", id: sectionId, mt: 0, mb: 40, children: title }) : null,
    children
  ] });
}
var StyledPageSection = _styled2.default.div`
  &:first-of-type {
    ${_chunkKW3JYLRIcjs.bp.minSm(`
      margin-top: 4px;
    `)}
  }

  &:not(:first-of-type) {
    margin-top: 72px;
  }

  h3,
  h4 {
    scroll-margin-top: ${({ scrollMarginTop }) => scrollMarginTop}px !important;
  }
`;
var PageSectionSubheading = _chunkKU2ZI6TIcjs.headingWithDefaults.call(void 0, {
  type: "h4",
  mb: 32
});
var PageSectionBoxActionColumn = ({
  label,
  value,
  valueId
}) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, StyledPageSectionBoxActionColumn, { children: [
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PageSectionBoxActionColumnLabel, { children: label }),
  value ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PageSectionBoxActionColumnValue, { id: valueId, children: value }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PageSectionBoxActionColumnNoValue, { children: "Unknown" })
] });
var StyledPageSectionBoxActionColumn = _styled2.default.div``;
var PageSectionBoxActionColumnLabel = _styled2.default.div`
  color: ${_chunkQQDRBCBYcjs.colors.gray40};
  font-weight: 500;
  margin: 0;
`;
var PageSectionBoxActionColumnValue = _styled2.default.div`
  font-weight: 700;
  margin-bottom: 0;
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
`;
var PageSectionBoxActionColumnNoValue = _styled2.default.call(void 0, 
  PageSectionBoxActionColumnValue
)`
  color: ${_chunkQQDRBCBYcjs.colors.gray80};
  font-style: italic;
`;
function PageSectionBoxAction({
  dropdownItems,
  icon,
  isDelete = false,
  label,
  loading = false,
  onClick,
  to,
  toParams
}) {
  const theme = _react.useTheme.call(void 0, );
  return loading ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOA2TKY4Kcjs.Loading, { size: 12, center: false }) }) : icon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkSNSG4HBQcjs.UnstyledButton, { onClick: icon.onClick, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWF7Z2VITcjs.Icon, { name: icon.name, width: 12, color: "mcNeutral" }) }) }) : dropdownItems ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, 
    _chunkZUAUG74Vcjs.Dropdown,
    {
      button: {
        getContent: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWF7Z2VITcjs.Icon, { name: "DotGrid1x3Horizontal", width: 16 })
      },
      dropdownItems
    }
  ) : isDelete ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkSNSG4HBQcjs.UnstyledButton, { css: { color: theme.mcNeutral }, onClick, children: "Delete" }) : label ? (
    /* Extra div for proper default alignment inside flex contexts */
    /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, 
      _chunk6DYK4XKYcjs.TextButton,
      {
        leftIcon: icon,
        text: label,
        to,
        toParams,
        onClick
      }
    ) })
  ) : null;
}
var PageSectionBoxActionRow = ({
  title,
  titleBadge,
  titleBadgeKind = "default",
  titleRightContent,
  description,
  separator,
  children,
  action,
  smFlexColumn = true
}) => {
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react3.Fragment, { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, 
    SPageSectionBoxActionRow,
    {
      separator: Boolean(separator),
      smFlexColumn: Boolean(smFlexColumn),
      children: [
        title ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { css: { flex: 1 }, children: [
          /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, PageSectionBoxTitle, { children: [
            /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
              title,
              titleBadge ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJRZVXLTFcjs.Badge, { content: titleBadge, ml: 4, kind: titleBadgeKind }) : null
            ] }),
            titleRightContent
          ] }),
          description ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PageSectionBoxDescription, { children: description }) : null
        ] }) : null,
        children,
        /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PageSectionBoxAction, _chunkZ6EUSUADcjs.__spreadValues.call(void 0, {}, action))
      ]
    }
  ) });
};
var SPageSectionBoxActionRow = _styled2.default.div`
  display: flex;
  gap: 12px;
  align-items: top;
  flex-direction: row;
  justify-content: space-between;

  & + & {
    margin-top: 32px;
  }

  ${({ smFlexColumn }) => smFlexColumn ? _chunkKW3JYLRIcjs.bp.sm(`flex-direction: column;`) : ""}

  &:has(> ${StyledPageSectionBoxActionColumn}) {
    ${_chunk6VA4SAHQcjs.select.call(void 0, StyledPageSectionBoxActionColumn)} {
      width: 150px;
    }
    ${_chunkKW3JYLRIcjs.bp.maxMd(`
      ${_chunk6VA4SAHQcjs.select.call(void 0, StyledPageSectionBoxActionColumn)} {
        width: auto;
      }
    `)}
  }

  ${({ separator, theme }) => separator && `
      border-top: 1px solid;
      ${_chunkAEJ7VTL4cjs.standardBorderColor.call(void 0, { theme }).styles};
      padding-top: 32px;
    `}
`;
var PageSectionBoxColumn = _styled2.default.div``;
var PageSectionBoxRow = _styled2.default.div`
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(215px, 1fr)
  ); /* This creates as many columns as can fit, each at least 150px wide */
`;
function PageSectionBox({
  action,
  description,
  children
}) {
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, StyledPageSectionBox, { children: [
    description && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PageSectionBoxDescription, { children: _chunkDDGSFIWAcjs.toReactNodes.call(void 0, description) }),
    children,
    (action == null ? void 0 : action.label) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { css: { marginTop: "12px" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PageSectionBoxAction, _chunkZ6EUSUADcjs.__spreadValues.call(void 0, {}, action)) }) : null
  ] });
}
var StyledPageSectionBox = _styled2.default.div`
  & + & {
    margin-top: 32px;
  }

  & > ${PageSectionBoxRow}, & {
    border: 1px solid;
    ${_chunkAEJ7VTL4cjs.standardBorderColor}
  }

  ${_chunkRSHN4K6Ncjs.standardBorderRadius.call(void 0, 8)}
  padding: 16px;

  /* PageSectionBoxRow and PageSectionBoxColumn manage their own borders: */
  &:has(> ${PageSectionBoxRow}) {
    border: none;
    padding: 0;
    ${_chunkRSHN4K6Ncjs.standardBorderRadius.call(void 0, 0)}
  }

  & > ${PageSectionBoxRow} {
    &:first-of-type {
      ${_chunkRSHN4K6Ncjs.standardBorderRadius.call(void 0, [12, 12, 0, 0])}
    }

    &:last-of-type {
      ${_chunkRSHN4K6Ncjs.standardBorderRadius.call(void 0, [0, 0, 12, 12])}
    }

    &:only-of-type {
      ${_chunkRSHN4K6Ncjs.standardBorderRadius.call(void 0, 12)}
    }

    &:not(:last-of-type) {
      border-bottom: 0;
    }

    ${PageSectionBoxColumn} {
      padding: 32px;
      ${_chunkKW3JYLRIcjs.bp.sm(`padding: 16px;`)}
      &:not(:first-of-type) {
        border-left: solid 1px;
        ${_chunkAEJ7VTL4cjs.standardBorderColor}
      }
    }

    ${({ theme }) => _chunkKW3JYLRIcjs.bp.maxMd(`
        grid-template-columns: none;
        ${_chunk6VA4SAHQcjs.select.call(void 0, PageSectionBoxColumn)} {
          &:not(:first-of-type) {
            border-left: 0 !important;
            border-top: solid 1px;
            ${_chunkAEJ7VTL4cjs.standardBorderColor.call(void 0, { theme }).styles};
          }
        }
      `)}
  }
`;
var PageSectionBoxTitle = _styled2.default.div`
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: space-between;
  font-size: ${({ lg }) => lg ? 14 : 12}px;
  font-weight: 600;
  line-height: ${({ lg }) => _chunkRSHN4K6Ncjs.standardLineHeightEms * (lg ? 14 : 12) + _chunkJRZVXLTFcjs.badgeSmVPadding * 2}px;
`;
var PageSectionBoxDescription = _styled2.default.div`
  color: ${({ theme }) => theme.mcNeutral};
  ${PageSectionBoxTitle} + & {
    margin-top: 6px;
  }
`;
var gapPx = 24;
var PageSectionRow = _styled2.default.div`
  display: flex;
  flex-direction: column;
  gap: ${gapPx}px;

  ${_chunkKW3JYLRIcjs.bp.minSm(`
    flex-direction: row;
  `)}

  margin-top: 40px;
  &:first-of-type {
    margin-top: 0;
  }
`;
var PageSectionRowSubSection = _styled2.default.div`
  box-sizing: border-box;
  width: 100%;

  &:first-of-type {
    margin-right: 0px;
  }

  &:last-of-type {
    margin-left: 0px;
    margin-top: ${gapPx}px;
  }

  ${StyledPageSectionBox} + ${StyledPageSectionBox} {
    /* Less margin for boxes within a single SubSection: */
    margin-top: 16px;
  }

  ${_chunkKW3JYLRIcjs.bp.minSm(`
    width: calc(50% - ${gapPx / 2}px);

    &:last-of-type {
      margin-top: 0;
    }
  `)}

  ${({ fullWidth }) => fullWidth ? "width: 100% !important;" : ""}
`;














exports.PageSection = PageSection; exports.PageSectionSubheading = PageSectionSubheading; exports.PageSectionBoxActionColumn = PageSectionBoxActionColumn; exports.PageSectionBoxActionRow = PageSectionBoxActionRow; exports.PageSectionBoxColumn = PageSectionBoxColumn; exports.PageSectionBoxRow = PageSectionBoxRow; exports.PageSectionBox = PageSectionBox; exports.StyledPageSectionBox = StyledPageSectionBox; exports.PageSectionBoxTitle = PageSectionBoxTitle; exports.PageSectionBoxDescription = PageSectionBoxDescription; exports.PageSectionRow = PageSectionRow; exports.PageSectionRowSubSection = PageSectionRowSubSection;
