"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
;/* empty css                                                                                                                                                                                        */
;/* empty css                                                                                                                                                                                         */
;/* empty css                                                                                                                                                                                                 */
;/* empty css                                                                                                                                                                                            */
;/* empty css                                                                                                                                                                                            */
require("clsx");
const styles = require("../../utils/styles.cjs");
const PageShellBaseBackButton = require("../PageShellBase/PageShellBaseBackButton.cjs");
const PageShellBaseBody = require("../PageShellBase/PageShellBaseBody.cjs");
const PageShellBaseHeader = require("../PageShellBase/PageShellBaseHeader.cjs");
const PageShellBaseRoot = require("../PageShellBase/PageShellBaseRoot.cjs");
const PageShellBaseTitle = require("../PageShellBase/PageShellBaseTitle.cjs");
const ExpandNavbarButtonPlaceholder = require("./navbar/ExpandNavbarButtonPlaceholder.cjs");
const Group = require("../../node_modules/.pnpm/@mantine_core@7.17.8_patch_hash_3qirwkgu3wxhvd6hnr2gb24yzq_@mantine_hooks@7.17.8_react@18.3.1_e5yvlgwhmeykc75dkphi7jou6q/node_modules/@mantine/core/esm/components/Group/Group.cjs");
const DEFAULT_PAGE_MAX_WIDTH = 1920;
const AppPageShell = ({
  withHeader = true,
  headerProps,
  bodyProps,
  wrapperProps,
  maxWidth = `${DEFAULT_PAGE_MAX_WIDTH}px`,
  ...rest
}) => {
  if (!withHeader) {
    return /* @__PURE__ */ jsxRuntime.jsx(
      PageShellBaseRoot.PageShellBaseRoot,
      {
        ...bodyProps,
        sx: styles.mergeSxList([
          {
            "--app-shell-page-max-width": maxWidth
          },
          {
            height: "100%",
            maxWidth: `min(100%, ${maxWidth})`,
            margin: "0 auto",
            padding: 24,
            overflowX: "auto"
          },
          bodyProps == null ? void 0 : bodyProps.sx
        ]),
        children: rest.children
      }
    );
  }
  const { withBack, onBackClick, ...headerPropsWithoutBack } = headerProps ?? {};
  return /* @__PURE__ */ jsxRuntime.jsxs(
    PageShellBaseRoot.PageShellBaseRoot,
    {
      ...wrapperProps,
      sx: styles.mergeSxList([
        {
          "--app-shell-page-max-width": maxWidth
        },
        (theme) => ({
          display: "flex",
          flexDirection: "column",
          height: "100%",
          maxWidth: `min(100%, ${maxWidth})`,
          margin: "0 auto",
          minWidth: `calc(${theme.breakpoints.md} - var(--app-shell-navbar-offset))`,
          overflowX: "auto"
        }),
        wrapperProps == null ? void 0 : wrapperProps.sx
      ]),
      children: [
        /* @__PURE__ */ jsxRuntime.jsx(
          PageShellBaseHeader.PageShellBaseHeader,
          {
            ...headerPropsWithoutBack,
            leftSection: /* @__PURE__ */ jsxRuntime.jsxs(Group.Group, { wrap: "nowrap", gap: 0, children: [
              /* @__PURE__ */ jsxRuntime.jsx(ExpandNavbarButtonPlaceholder.ExpandNavbarButtonPlaceholder, {}),
              withBack && /* @__PURE__ */ jsxRuntime.jsx(PageShellBaseBackButton.PageShellBaseBackButton, { onClick: onBackClick, mr: "md" })
            ] }),
            sx: styles.mergeSxList([
              (theme) => ({
                backgroundColor: theme.colors.carbon[1],
                flexShrink: 0
              }),
              headerProps == null ? void 0 : headerProps.sx
            ]),
            children: /* @__PURE__ */ jsxRuntime.jsx(PageShellBaseTitle.PageShellBaseTitle, { children: rest.title })
          }
        ),
        /* @__PURE__ */ jsxRuntime.jsx(
          PageShellBaseBody.PageShellBaseBody,
          {
            ...bodyProps,
            sx: styles.mergeSxList([
              {
                paddingTop: 0,
                paddingBottom: 64,
                flex: 1
              },
              bodyProps == null ? void 0 : bodyProps.sx
            ]),
            children: rest.children
          }
        )
      ]
    }
  );
};
exports.AppPageShell = AppPageShell;
