"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.StyledDialog = void 0;
const Backdrop_1 = require("@mui/material/Backdrop");
const Dialog_1 = __importDefault(require("@mui/material/Dialog"));
const DialogActions_1 = require("../DialogActions");
const DialogContent_1 = require("../DialogContent");
const styled_1 = require("../styled");
const constants_1 = require("./constants");
const getSize = (size) => {
    return constants_1.DIALOG_SIZES[size] || constants_1.DIALOG_SIZES.md;
};
exports.StyledDialog = (0, styled_1.styled)(Dialog_1.default, {
    shouldForwardProp: (prop) => !['$size'].includes(prop),
}) `
  &.${constants_1.dialogClassnames.root} .${Backdrop_1.backdropClasses.root} {
    background-color: ${({ theme }) => theme.palette.background.modalShadow};
  }

  &.${constants_1.dialogClassnames.withoutTitle} {
    & .${DialogContent_1.dialogContentClassnames.root} {
      padding-top: ${({ theme }) => theme.spacing(6)};
    }
  }

  .${constants_1.dialogClassnames.paper} {
    min-width: ${({ $size }) => getSize($size).minWidth};
    max-width: ${({ $size }) => getSize($size).maxWidth};

    border-radius: calc(${({ theme }) => theme.shape.medium} * 2);
    box-shadow: ${({ theme }) => theme.elevation[300]};
  }

  /* Причина игнора: Не критично для отображения */
  /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
  &:not(:has(.${DialogActions_1.dialogActionsClassnames.root})) .${DialogContent_1.dialogContentClassnames.root} {
    padding-bottom:  ${({ theme }) => theme.spacing(6)};
  }
`;
