"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const React = require("react");
const styles = require("./styles.cjs");
const useProps = require("../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/core/MantineProvider/use-props/use-props.cjs");
function MediaQuery(props) {
  var _a;
  const { children, smallerThan, largerThan, query, styles: styles$1, className } = useProps.useProps("MediaQuery", {}, props);
  const { classes, cx } = styles.default({ smallerThan, largerThan, query, styles: styles$1 });
  if (children === void 0) {
    return null;
  }
  const child = React.Children.only(children);
  if (typeof child === "object" && child !== null && "props" in child) {
    return React.cloneElement(child, {
      className: cx(classes.media, (_a = child.props) == null ? void 0 : _a.className, className)
    });
  }
  return child;
}
exports.MediaQuery = MediaQuery;
