"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
const React = require("react");
const MantineThemeProvider = 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/MantineThemeProvider/MantineThemeProvider.cjs");
const Loader = 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/components/Loader/Loader.cjs");
const Button$1 = 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/components/Button/Button.cjs");
const _Button = React.forwardRef((props, ref) => {
  const theme = MantineThemeProvider.useMantineTheme();
  const {
    leftSection,
    loading,
    disabled,
    loaderProps,
    ["data-disabled"]: dataDisabled,
    ["data-loading"]: dataLoading,
    ...rest
  } = props;
  const loader = /* @__PURE__ */ jsxRuntime.jsx(Loader.Loader, { size: 16, color: `${props.color ?? theme.primaryColor}.6`, ...loaderProps });
  const isLoading = loading || dataLoading;
  const isDisabled = disabled || dataDisabled || isLoading;
  return /* @__PURE__ */ jsxRuntime.jsx(Button$1.Button, { ...rest, ref, leftSection: isLoading ? loader : leftSection, disabled: isDisabled });
});
const Button = _Button;
Button.Group = Button$1.Button.Group;
Button.classes = Button$1.Button.classes;
Button.displayName = Button$1.Button.displayName;
Button.extend = Button$1.Button.extend;
Button.withProps = Button$1.Button.withProps;
exports.Button = Button;
