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,GAAG,KAAK,aAAa,QAAQ,CAAC,cAAc,CAAC,aAAY;IACvJ,IAAI,cAAC,UAAU,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,yCAAW;IAC9C,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,iCAAO,EAAE;QAAC,YAAY,cAAc,iBAAiB,MAAM,UAAU;IAAA;IAEnG,qBACE,0DAAC;QACE,GAAG,SAAS;QACb,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;qBAC9B,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({state, currentMonth, firstDayOfWeek, ...props}: 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    ...props,\n    isDisabled: !isSameMonth(props.date, currentMonth)\n  }, state, ref);\n  let isUnavailable = state.isCellUnavailable(props.date) && !isDisabled;\n  let isLastSelectedBeforeDisabled = !isDisabled && !isInvalid && state.isCellUnavailable(props.date.add({days: 1}));\n  let isFirstSelectedAfterDisabled = !isDisabled && !isInvalid && state.isCellUnavailable(props.date.subtract({days: 1}));\n  let highlightedRange = 'highlightedRange' in state && state.highlightedRange;\n  let isSelectionStart = isSelected && highlightedRange && isSameDay(props.date, highlightedRange.start);\n  let isSelectionEnd = isSelected && highlightedRange && isSameDay(props.date, highlightedRange.end);\n  let {locale} = useLocale();\n  let dayOfWeek = getDayOfWeek(props.date, locale, firstDayOfWeek);\n  let isRangeStart = isSelected && (isFirstSelectedAfterDisabled || dayOfWeek === 0 || props.date.day === 1);\n  let isRangeEnd = isSelected && (isLastSelectedBeforeDisabled || dayOfWeek === 6 || props.date.day === currentMonth.calendar.getDaysInMonth(currentMonth));\n  let {focusProps, isFocusVisible} = useFocusRing();\n  let {hoverProps, isHovered} = useHover({isDisabled: isDisabled || isUnavailable || state.isReadOnly});\n\n  return (\n    <td\n      {...cellProps}\n      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"}