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Q,CAAC,cAAc,CAAC,aAAY;IACxE,IAAI,cAAC,UAAU,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,yCAAW;IAC9C,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,iCAAO,EAAE;QACrC,YAAY,cAAc,iBAAiB,MAAM,UAAU;IAC7D;IAEA,qBACE,0DAAC;QAAI,GAAG,SAAS;QAAE,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;qBAC/C,0DAAC;QACE,GAAG,CAAA,GAAA,qCAAS,EAAE,aAAa,YAAY,WAAW;QACnD,KAAK;QACL,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG,0BAA0B;YACtD,YAAY,CAAA,GAAA,oCAAM,EAAE,MAAM,IAAI,EAAE,MAAM,QAAQ;YAC9C,eAAe;YACf,cAAc,aAAa;YAC3B,gFAAgF;YAChF,2DAA2D;YAC3D,eAAe,cAAc,CAAC;YAC9B,kBAAkB,iBAAkB,aAAa;YACjD,mBAAmB,CAAC,CAAA,GAAA,wCAAU,EAAE,MAAM,IAAI,EAAE;YAC5C,kBAAkB;YAClB,gBAAgB;YAChB,sBAAsB,cAAc,sBAAsB;YAC1D,sBAAsB;YACtB,oBAAoB;YACpB,cAAc;YACd,cAAc,aAAa,CAAC,MAAM,UAAU;YAC5C,cAAc;QAChB;qBACA,0DAAC;QAAK,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;qBAClC,0DAAC,cAAM;AAKjB","sources":["packages/@adobe/react-spectrum/src/calendar/CalendarCell.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaCalendarCellProps, useCalendarCell} from 'react-aria/useCalendar';\nimport {CalendarDate, getDayOfWeek, isSameDay, isSameMonth, isToday} from '@internationalized/date';\nimport {CalendarState} from 'react-stately/useCalendarState';\nimport {classNames} from '../utils/classNames';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {RangeCalendarState} from 'react-stately/useRangeCalendarState';\nimport React, {JSX, useRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/calendar/vars.css';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useHover} from 'react-aria/useHover';\nimport {useLocale} from 'react-aria/I18nProvider';\n\ninterface CalendarCellProps extends AriaCalendarCellProps {\n  state: CalendarState | RangeCalendarState;\n  currentMonth: CalendarDate;\n  firstDayOfWeek?: 'sun' | 'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat';\n}\n\nexport function CalendarCell({\n  state,\n  currentMonth,\n  firstDayOfWeek,\n  ...props\n}: CalendarCellProps): JSX.Element {\n  let ref = useRef<HTMLElement>(null);\n  let {\n    cellProps,\n    buttonProps,\n    isPressed,\n    isSelected,\n    isDisabled,\n    isFocused,\n    isInvalid,\n    formattedDate\n  } = useCalendarCell(\n    {\n      ...props,\n      isDisabled: !isSameMonth(props.date, currentMonth)\n    },\n    state,\n    ref\n  );\n  let isUnavailable = state.isCellUnavailable(props.date) && !isDisabled;\n  let isLastSelectedBeforeDisabled =\n    !isDisabled && !isInvalid && state.isCellUnavailable(props.date.add({days: 1}));\n  let isFirstSelectedAfterDisabled =\n    !isDisabled && !isInvalid && state.isCellUnavailable(props.date.subtract({days: 1}));\n  let highlightedRange = 'highlightedRange' in state && state.highlightedRange;\n  let isSelectionStart =\n    isSelected && highlightedRange && isSameDay(props.date, highlightedRange.start);\n  let isSelectionEnd =\n    isSelected && highlightedRange && isSameDay(props.date, highlightedRange.end);\n  let {locale} = useLocale();\n  let dayOfWeek = getDayOfWeek(props.date, locale, firstDayOfWeek);\n  let isRangeStart =\n    isSelected && (isFirstSelectedAfterDisabled || dayOfWeek === 0 || props.date.day === 1);\n  let isRangeEnd =\n    isSelected &&\n    (isLastSelectedBeforeDisabled ||\n      dayOfWeek === 6 ||\n      props.date.day === currentMonth.calendar.getDaysInMonth(currentMonth));\n  let {focusProps, isFocusVisible} = useFocusRing();\n  let {hoverProps, isHovered} = useHover({\n    isDisabled: isDisabled || isUnavailable || state.isReadOnly\n  });\n\n  return (\n    <td {...cellProps} className={classNames(styles, 'spectrum-Calendar-tableCell')}>\n      <span\n        {...mergeProps(buttonProps, hoverProps, focusProps)}\n        ref={ref}\n        className={classNames(styles, 'spectrum-Calendar-date', {\n          'is-today': isToday(props.date, state.timeZone),\n          'is-selected': isSelected,\n          'is-focused': isFocused && isFocusVisible,\n          // Style disabled (i.e. out of min/max range), but selected dates as unavailable\n          // since it is more clear than trying to dim the selection.\n          'is-disabled': isDisabled && !isInvalid,\n          'is-unavailable': isUnavailable || (isInvalid && isDisabled),\n          'is-outsideMonth': !isSameMonth(props.date, currentMonth),\n          'is-range-start': isRangeStart,\n          'is-range-end': isRangeEnd,\n          'is-range-selection': isSelected && 'highlightedRange' in state,\n          'is-selection-start': isSelectionStart,\n          'is-selection-end': isSelectionEnd,\n          'is-hovered': isHovered,\n          'is-pressed': isPressed && !state.isReadOnly,\n          'is-invalid': isInvalid\n        })}>\n        <span className={classNames(styles, 'spectrum-Calendar-dateText')}>\n          <span>{formattedDate}</span>\n        </span>\n      </span>\n    </td>\n  );\n}\n"],"names":[],"version":3,"file":"CalendarCell.cjs.map"}