import { a as __rest, _ as __assign } from '../tslib.es6-20a2a300.js';
import { jsx } from 'react/jsx-runtime';
import colors from '../theme/colors.js';
import { m as makeStyles } from '../makeStyles-c9a99c7a.js';
import { a as createStyles } from '../createStyles-16423e9e.js';
import { d as _objectWithoutProperties, b as _extends, P as PropTypes } from '../defaultTheme-49a26576.js';
import * as React from 'react';
import { c as clsx } from '../clsx.m-6243b874.js';
import { a as withStyles } from '../withStyles-99aeb25b.js';
import { M as MuiPaper } from '../Paper-cfd8f963.js';
import '../hoist-non-react-statics.cjs-b718ab87.js';

var styles = {
  /* Styles applied to the root element. */
  root: {
    overflow: 'hidden'
  }
};
var Card$1 = /*#__PURE__*/React.forwardRef(function Card(props, ref) {
  var classes = props.classes,
      className = props.className,
      _props$raised = props.raised,
      raised = _props$raised === void 0 ? false : _props$raised,
      other = _objectWithoutProperties(props, ["classes", "className", "raised"]);

  return /*#__PURE__*/React.createElement(MuiPaper, _extends({
    className: clsx(classes.root, className),
    elevation: raised ? 8 : 1,
    ref: ref
  }, other));
});
process.env.NODE_ENV !== "production" ? Card$1.propTypes = {
  // ----------------------------- Warning --------------------------------
  // | These PropTypes are generated from the TypeScript type definitions |
  // |     To update them edit the d.ts file and run "yarn proptypes"     |
  // ----------------------------------------------------------------------

  /**
   * The content of the component.
   */
  children: PropTypes.node,

  /**
   * Override or extend the styles applied to the component.
   * See [CSS API](#css) below for more details.
   */
  classes: PropTypes.object,

  /**
   * @ignore
   */
  className: PropTypes.string,

  /**
   * If `true`, the card will use raised styling.
   */
  raised: PropTypes.bool
} : void 0;
var MuiCard = withStyles(styles, {
  name: 'MuiCard'
})(Card$1);

var CardSizeVariants;
(function (CardSizeVariants) {
    CardSizeVariants["Initial"] = "initial";
    CardSizeVariants["Small"] = "small";
    CardSizeVariants["Medium"] = "medium";
    CardSizeVariants["Large"] = "large";
})(CardSizeVariants || (CardSizeVariants = {}));
var CardColorVariants;
(function (CardColorVariants) {
    CardColorVariants["Initial"] = "initial";
    CardColorVariants["Muted"] = "muted";
    CardColorVariants["Primary"] = "primary";
    CardColorVariants["Secondary"] = "secondary";
    CardColorVariants["Positive"] = "positive";
    CardColorVariants["Negative"] = "negative";
})(CardColorVariants || (CardColorVariants = {}));
var sizeMap = new Map([
    [CardSizeVariants.Initial, { y: 0, x: 0 }],
    [CardSizeVariants.Small, { y: 3, x: 3.3 }],
    [CardSizeVariants.Medium, { y: 4, x: 4 }],
    [CardSizeVariants.Large, { y: 6, x: 8 }]
]);
var colorMap = new Map([
    [CardColorVariants.Initial, colors.text.primary],
    [CardColorVariants.Muted, colors.text.primary],
    [CardColorVariants.Primary, colors.text.primary],
    [CardColorVariants.Secondary, colors.text.primary],
    [CardColorVariants.Positive, colors.text.primary],
    [CardColorVariants.Negative, colors.text.inversePrimary]
]);
var backgroundMap = new Map([
    [CardColorVariants.Initial, colors.gray.white],
    [CardColorVariants.Muted, colors.gray[200]],
    [CardColorVariants.Primary, colors.primary.light],
    [CardColorVariants.Secondary, colors.green.light + "33"],
    [CardColorVariants.Positive, colors.red.light + "33"],
    [CardColorVariants.Negative, colors.secondary.light]
]);
var useStyles = makeStyles(function (theme) {
    return createStyles({
        root: function (_a) {
            var _b = _a.color, color = _b === void 0 ? CardColorVariants.Initial : _b, _c = _a.size, size = _c === void 0 ? CardSizeVariants.Medium : _c, selected = _a.selected;
            var padding = sizeMap.get(size);
            return {
                padding: padding ? theme.spacing(padding.y, padding.x) : "0",
                marginBottom: theme.spacing(0.8),
                borderRadius: theme.spacing(3),
                color: colorMap.get(color),
                backgroundColor: backgroundMap.get(color),
                boxShadow: selected ? "inset 0 0 0 3px " + theme.palette.primary.dark : "none"
            };
        }
    });
});
var Card = function (_a) {
    var children = _a.children, color = _a.color, size = _a.size, selected = _a.selected, props = __rest(_a, ["children", "color", "size", "selected"]);
    var classes = useStyles({ color: color, size: size, selected: selected });
    return (jsx(MuiCard, __assign({ className: classes.root }, props, { children: children }), void 0));
};

export { CardColorVariants, CardSizeVariants, backgroundMap, colorMap, Card as default, sizeMap };
