"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StaticCalendarGridButton = void 0;
const Button_1 = require("@mui/material/Button");
const styled_1 = require("../../styled");
const StaticCalendarButton_1 = require("../StaticCalendarButton");
const utils_1 = require("./utils");
const nonForwardableProps = new Set([
    'isPreviousItemInSelectedRange',
    'isNextItemInSelectedRange',
    'isCurrentInUserLocalTime',
    'isOutOfAvailableRange',
    'isInSelectedRange',
    'isInHoveredRange',
    'lengthInRow',
    '$isNotInteractable',
    '$isDraggable',
    'isHoliday',
    'isPreviousItemInHoveredRange',
    'isNextItemInHoveredRange',
]);
exports.StaticCalendarGridButton = (0, styled_1.styled)(StaticCalendarButton_1.StaticCalendarButton, {
    shouldForwardProp: (propName) => !nonForwardableProps.has(propName),
}) `
  /* Причина игнора: Не поддерживается на мобильных устройствах. Не критично */
  /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
  cursor: ${({ $isNotInteractable, $isDraggable }) => ($isDraggable && 'grab') || ($isNotInteractable && 'initial')};

  position: relative;

  width: 40px;

  font-weight: ${({ theme }) => theme.typography.fontWeightRegular};

  border-radius: ${(props) => (0, utils_1.getLeftBorderRadius)(props)}
    ${(props) => (0, utils_1.getRightBorderRadius)(props)}
    ${(props) => (0, utils_1.getRightBorderRadius)(props)}
    ${(props) => (0, utils_1.getLeftBorderRadius)(props)};
  
  transition: unset;

  &::after {
    content: '';

    position: absolute;
    bottom: ${({ theme }) => theme.spacing(1)};
    left: ${({ theme }) => theme.spacing(2)};

    display: ${({ isCurrentInUserLocalTime }) => isCurrentInUserLocalTime ? 'block' : 'none'};

    width: calc(100% - ${({ theme }) => theme.spacing(4)});
    height: 2px;

    color: currentColor;

    background-color: currentColor;
  }
  
  &:hover {
    border-radius: ${(props) => (0, utils_1.getLeftBorderRadius)({ isHovered: true, ...props })}
    ${(props) => (0, utils_1.getRightBorderRadius)({ isHovered: true, ...props })}
    ${(props) => (0, utils_1.getRightBorderRadius)({ isHovered: true, ...props })}
    ${(props) => (0, utils_1.getLeftBorderRadius)({ isHovered: true, ...props })};
  }

  &,
  &.${Button_1.buttonClasses.disabled} {
    background-color: ${(props) => (0, utils_1.getBgColor)(props)};
  }

  &,
  &.${Button_1.buttonClasses.disabled}, &:hover {
    color: ${(props) => (0, utils_1.getTextColor)(props)};
  }

  ${({ theme }) => theme.breakpoints.down('sm')} {
    width: 100%;
    min-width: 48px;
    height: 48px;
  }
`;
