"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
const filterProps = require("../../core/utils/filter-props/filter-props.cjs");
require("react");
require("clsx");
const MantineThemeProvider = require("../../core/MantineProvider/MantineThemeProvider/MantineThemeProvider.cjs");
const useProps = require("../../core/MantineProvider/use-props/use-props.cjs");
const useStyles = require("../../core/styles-api/use-styles/use-styles.cjs");
const InlineStyles = require("../../core/InlineStyles/InlineStyles.cjs");
const parseStyleProps = require("../../core/Box/style-props/parse-style-props/parse-style-props.cjs");
const useRandomClassname = require("../../core/Box/use-random-classname/use-random-classname.cjs");
const Box = require("../../core/Box/Box.cjs");
const polymorphicFactory = require("../../core/factory/polymorphic-factory.cjs");
const flexProps = require("./flex-props.cjs");
const Flex_module_css = require("./Flex.module.css.cjs");
const defaultProps = {};
const Flex = polymorphicFactory.polymorphicFactory((_props, ref) => {
  const props = useProps.useProps("Flex", defaultProps, _props);
  const {
    classNames,
    className,
    style,
    styles,
    unstyled,
    vars,
    gap,
    rowGap,
    columnGap,
    align,
    justify,
    wrap,
    direction,
    ...others
  } = props;
  const getStyles = useStyles.useStyles({
    name: "Flex",
    classes: Flex_module_css.default,
    props,
    className,
    style,
    classNames,
    styles,
    unstyled,
    vars
  });
  const theme = MantineThemeProvider.useMantineTheme();
  const responsiveClassName = useRandomClassname.useRandomClassName();
  const parsedStyleProps = parseStyleProps.parseStyleProps({
    styleProps: { gap, rowGap, columnGap, align, justify, wrap, direction },
    theme,
    data: flexProps.FLEX_STYLE_PROPS_DATA
  });
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
    parsedStyleProps.hasResponsiveStyles && /* @__PURE__ */ jsxRuntime.jsx(
      InlineStyles.InlineStyles,
      {
        selector: `.${responsiveClassName}`,
        styles: parsedStyleProps.styles,
        media: parsedStyleProps.media
      }
    ),
    /* @__PURE__ */ jsxRuntime.jsx(
      Box.Box,
      {
        ref,
        ...getStyles("root", {
          className: responsiveClassName,
          style: filterProps.filterProps(parsedStyleProps.inlineStyles)
        }),
        ...others
      }
    )
  ] });
});
Flex.classes = Flex_module_css.default;
Flex.displayName = "@mantine/core/Flex";
exports.Flex = Flex;
