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,CAAUA,CAAAA,CAAC1D,MAAOA,MAGzB,sCCnhBe,SAASJ,eAAe5D,CAAa,EAElD,IAAM2H,EAAY3H,EAAM4H,OAAO,CAAC,KAAM,KACtC,OAAO,IAAI/H,KAAK8H,EAClB,+HCbO,IAAMlE,eAAiB,CAC5B7E,EACAiJ,KAEA,IAAMC,EAAI,IAAIjI,KAAKjB,GACbyE,EAAQyE,EAAE3I,QAAQ,GAAK,EACvB4I,EAAMD,EAAEvI,OAAO,GACf+D,EAAOwE,EAAE/I,WAAW,UAE1B,EACS,GAAwCgJ,MAAAA,CAArC1E,EAAM2E,QAAQ,GAAGC,QAAQ,CAAC,EAAG,KAAK,KAErB3E,MAAAA,CAFwByE,EAC5CC,QAAQ,GACRC,QAAQ,CAAC,EAAG,KAAK,KAAQzE,MAAA,CAALF,GAElB,GAAYyE,MAAAA,CAAT1E,EAAM,KAAUC,MAAAA,CAAPyE,EAAI,KAAQvE,MAAA,CAALF,EAC5B,qBCtBA4E,EAAAC,OAAA,EAAkB","sources":["webpack://_N_E/./src/lib/hooks/useDateRangeSelection/useDateRangeSelection.ts","webpack://_N_E/./src/components/atoms/InputFieldDateSelector/CustomCalendarContainer.tsx","webpack://_N_E/./src/components/atoms/InputFieldDateSelector/CustomHeader.tsx","webpack://_N_E/./src/components/atoms/InputFieldDateSelector/InputFieldDateSelector.tsx","webpack://_N_E/./src/lib/utils/dates/UtcDateToLocal.ts","webpack://_N_E/./src/lib/utils/helpers/dateHelpers/dateToMMDDYYYY.ts","webpack://_N_E/./src/components/atoms/InputFieldDate/InputFieldDate.module.css","webpack://_N_E/<anon>"],"sourcesContent":["import { useEffect, useMemo, useState } from 'react';\n\n/** The date selection value */\nexport type DateSelectionValue = Date | null;\n\n/** The date range selection value */\nexport type DateRangeSelectionValue = [DateSelectionValue, DateSelectionValue];\n\n/** The change range function */\nexport type ChangeRangeValue = (dates: DateRangeSelectionValue) => void;\n\n/** The max range in years */\ntype MaxRangeInYears = {\n /**\n * The number of years allowed for the date range\n *\n * @memberof MaxRangeInYears\n * @member {number} years\n */\n years: number;\n /**\n * The number of months allowed for the date range\n *\n * @memberof MaxRangeInYears\n * @member {never} [months]\n */\n months?: never;\n /**\n * The number of days allowed for the date range\n *\n * @memberof MaxRangeInYears\n * @member {never} [days]\n */\n days?: never;\n};\n\n/** The max range in years */\ntype MaxRangeInMonths = {\n /**\n * The number of years allowed for the date range\n *\n * @memberof MaxRangeInMonths\n * @member {never} [years]\n */\n years?: never;\n /**\n * The number of months allowed for the date range\n *\n * @memberof MaxRangeInMonths\n * @member {number} months\n */\n months: number;\n /**\n * The number of days allowed for the date range\n *\n * @memberof MaxRangeInMonths\n * @member {never} [days]\n */\n days?: never;\n};\n\n/** The max range in days */\ntype MaxRangeInDays = {\n /**\n * The number of years allowed for the date range\n *\n * @memberof MaxRangeInYears\n * @member {never} [years]\n */\n years?: never;\n /**\n * The number of months allowed for the date range\n *\n * @memberof MaxRangeInYears\n * @member {never} [months]\n */\n months?: never;\n /**\n * The number of days allowed for the date range\n *\n * @memberof MaxRangeInYears\n * @member {number} days\n */\n days: number;\n};\n\n/** The max range */\nexport type MaxRange = {\n /**\n * The number of years allowed for the date range\n *\n * @memberof MaxRange\n * @member {number} [years]\n */\n years?: number;\n /**\n * The number of months allowed for the date range\n *\n * @memberof MaxRange\n * @member {number} [months]\n */\n months?: number;\n /**\n * The number of days allowed for the date range\n *\n * @memberof MaxRangeInYears\n * @member {number} [days]\n */\n days?: number;\n} & (MaxRangeInYears | MaxRangeInMonths | MaxRangeInDays);\n\n/**\n * The date range options\n *\n * @interface IDateRangeOptions\n */\nexport interface IDateRangeOptions {\n /**\n * The max range allowed\n *\n * @memberof IDateRangeOptions\n * @member {MaxRange} maxRange\n */\n maxRange: MaxRange;\n}\n\n/**\n * The Date Range Value\n *\n * @interface IDateRangeValue\n */\nexport interface IDateRangeValue {\n /** The start date */\n startDate: string;\n /** The end date */\n endDate: string;\n}\n\n/**\n * The Date Range Selection Props\n *\n * @interface IUseDateRangeSelectionProps\n */\nexport interface IUseDateRangeSelectionProps {\n /**\n * The value of the input\n *\n * @memberof IUseDateRangeSelectionProps\n * @member {IDateRangeValue} [value]\n */\n value?: IDateRangeValue;\n /**\n * The options for the use date range selection\n *\n * @memberof IUseDateRangeSelectionProps\n * @member {IDateRangeOptions} [options]\n */\n options?: IDateRangeOptions;\n}\n\n/**\n * The Date Range Selection Hook return type\n *\n * @interface IUseDateRangeSelection\n */\ninterface IUseDateRangeSelection {\n /**\n * The start date\n *\n * @memberof IUseDateRangeSelection\n * @member {Date | null} startDate\n */\n startDate: Date | null;\n /**\n * The end date\n *\n * @memberof IUseDateRangeSelection\n * @member {Date | null} startDate\n */\n endDate: Date | null;\n /**\n * The max date\n *\n * @memberof IUseDateRangeSelection\n * @member {Date | null} maxDate\n */\n maxDate: Date | null;\n /**\n * The function to change the range value\n *\n * @memberof IUseDateRangeSelection\n * @member {ChangeRangeValue} changeRangeValue\n */\n changeRangeValue: ChangeRangeValue;\n /**\n * The function to reset the date range\n *\n * @memberof IUseDateRangeSelection\n * @member {() => void} resetRange\n */\n resetRange: () => void;\n}\n\n/**\n * The max range props\n *\n * @interface IUseMaxRangeProps\n */\ninterface IUseMaxRangeProps {\n /**\n * The max range options\n *\n * @memberof IUseMaxRangeProps\n * @member {MaxRange} [maxRange]\n */\n maxRange?: MaxRange;\n /**\n * The current start date\n *\n * @memberof IUseMaxRangeProps\n * @member {Date | null} startDate\n */\n startDate: Date | null;\n}\n\n/**\n * Increment the years of a date\n *\n * @param {Date} date - The date\n * @param {number} years - The number of years to increment\n * @returns {Date} Date - The date with increment\n */\nconst incrementDateYears = (date: Date, years: number): Date => {\n date.setFullYear(date.getFullYear() + years);\n\n return date;\n};\n\n/**\n * Increment the months of a date\n *\n * @param {Date} date - The date\n * @param {number} months - The number of months to increment\n * @returns {Date} Date - The date with increment\n */\nconst incrementDateMonths = (date: Date, months: number): Date => {\n date.setMonth(date.getMonth() + months);\n\n return date;\n};\n\n/**\n * Increment the days of a date\n *\n * @param {Date} date - The date\n * @param {number} days - The number of days to increment\n * @returns {Date} Date - The date with increment\n */\nconst incrementDateDays = (date: Date, days: number): Date => {\n date.setDate(date.getDate() + days);\n\n return date;\n};\n\n/**\n * A hook to get the max date\n *\n * @param {IUseMaxRangeProps} props - The hook props\n * @returns {Date | null} The max date\n */\nexport const useMaxRange = ({\n maxRange,\n startDate,\n}: IUseMaxRangeProps): Date | null => {\n return useMemo((): Date | null => {\n if (!startDate) {\n return null;\n }\n const { years, months, days } = maxRange ?? {};\n /**\n * Cloned date of the start date\n *\n * @constant {Date}\n */\n const date = new Date(startDate.getTime());\n\n if (days) {\n return incrementDateDays(date, days);\n }\n if (months) {\n return incrementDateMonths(date, months);\n }\n if (years) {\n return incrementDateYears(date, years);\n }\n\n return null;\n }, [maxRange, startDate]);\n};\n\n/**\n * A hook to handle the date range selection\n *\n * @param {IUseDateRangeSelectionProps} props - The props to pass to the hook\n * @returns {IUseDateRangeSelection} The date range selection hook\n */\nconst useDateRangeSelection = ({\n value,\n options,\n}: IUseDateRangeSelectionProps): IUseDateRangeSelection => {\n // The state for the date range selection\n const [startDate, setStartDate] = useState<Date | null>(null);\n const [endDate, setEndDate] = useState<Date | null>(null);\n /**\n * The max date\n *\n * @constant {Date | null}\n */\n const maxDate = useMaxRange({\n maxRange: options?.maxRange,\n startDate,\n });\n\n // If value is passed in props, set input value\n useEffect(() => {\n if (value) {\n /**\n * @property {string} startDate - The start date\n * @property {string} endDate - The end date\n */\n const { startDate, endDate } = value;\n\n setStartDate(new Date(startDate));\n setEndDate(new Date(endDate));\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n /**\n * Updates component state and calls onRangeChange passed in props.\n *\n * @param {DateRangeSelectionValue} dates - The dates to change the value to\n */\n const changeRangeValue = (dates: DateRangeSelectionValue) => {\n const [startDate, endDate] = dates;\n\n setStartDate(startDate);\n setEndDate(endDate);\n };\n\n /**\n * Resets the date range\n *\n * @returns {void}\n */\n const resetRange = (): void => {\n const { startDate, endDate } = value ?? {};\n\n setStartDate(startDate ? new Date(startDate) : null);\n setEndDate(endDate ? new Date(endDate) : null);\n };\n\n return {\n startDate,\n endDate,\n maxDate,\n changeRangeValue,\n resetRange,\n };\n};\n\nexport default useDateRangeSelection;\n","import { useComponentFocused } from '@/lib/utils/ComponentFocused/ComponentFocused';\nimport { useEffect } from 'react';\nimport { CalendarContainerProps } from 'react-datepicker';\n\n/**\n * ICustomCalendarContainer\n *\n * @augments CalendarContainerProps\n * @interface ICustomCalendarContainer\n */\nexport interface ICustomCalendarContainer extends CalendarContainerProps {\n /**\n * The function to call on focus change\n *\n * @memberof ICustomCalendarContainer\n * @member {() => void} onBlur\n */\n onBlur: () => void;\n}\n\n/**\n * The calendar container component\n *\n * @param {CalendarContainerProps} props - The container props\n * @returns {React.ReactNode} - The container\n */\nconst CustomCalendarContainer: React.FC<ICustomCalendarContainer> = ({\n children,\n onBlur,\n}: ICustomCalendarContainer) => {\n /**\n * @property {React.RefObject} ref - The reference\n * @property {boolean} isComponentFocused - The focussed state of the\n * component\n */\n const { ref, isComponentFocused } = useComponentFocused(true);\n\n /** Hook to close the date picker when selecting range and click outside */\n useEffect(() => {\n if (!isComponentFocused) {\n onBlur();\n }\n }, [isComponentFocused, onBlur]);\n\n return (\n <div data-testid=\"calendarCustomContainer\" ref={ref}>\n {children}\n </div>\n );\n};\n\nexport default CustomCalendarContainer;\n","import Icon from '@/components/atoms/Icon/Icon';\nimport { dateToMMDDYYYY } from '@/lib/utils/helpers/dateHelpers/dateToMMDDYYYY';\nimport React, { useState } from 'react';\nimport { ReactDatePickerCustomHeaderProps } from 'react-datepicker';\nimport {\n determineColorShade,\n OnRangeChangeCallback,\n} from './InputFieldDateSelector';\n\n/**\n * ICustomHeader\n *\n * @augments ReactDatePickerCustomHeaderProps\n * @interface ICustomHeader\n */\nexport interface ICustomHeader\n extends Partial<ReactDatePickerCustomHeaderProps> {\n /**\n * The date to be displayed in the header\n *\n * @memberof ICustomHeader\n * @member {Date} date\n */\n date: Date;\n /**\n * The function to decrease the month\n *\n * @memberof ICustomHeader\n * @member {() => void} decreaseMonth\n * @returns {void}\n */\n decreaseMonth: () => void;\n /**\n * The function to increase the month\n *\n * @memberof ICustomHeader\n * @member {() => void} increaseMonth\n * @returns {void}\n */\n increaseMonth: () => void;\n /**\n * A boolean to disable the previous month button\n *\n * @memberof ICustomHeader\n * @member {boolean} prevMonthButtonDisabled\n */\n prevMonthButtonDisabled: boolean;\n /**\n * A boolean to disable the next month button\n *\n * @memberof ICustomHeader\n * @member {boolean} nextMonthButtonDisabled\n */\n nextMonthButtonDisabled: boolean;\n /**\n * The function to handle the range change\n *\n * @memberof ICustomHeader\n * @member {OnRangeChangeCallback} [onRangeChange]\n */\n onRangeChange?: OnRangeChangeCallback;\n /**\n * The input field does not select a range\n *\n * @memberof ICustomHeader\n * @member {boolean} selectsRange\n */\n selectsRange: boolean;\n /**\n * The start date\n *\n * @memberof ICustomHeader\n * @member {Date | null} startDate\n */\n startDate: Date | null;\n /**\n * The end date\n *\n * @memberof ICustomHeader\n * @member {Date | null} endDate\n */\n endDate: Date | null;\n /**\n * The function to reset the date range\n *\n * @memberof ICustomHeader\n * @member {() => void} resetRange\n */\n resetRange: () => void;\n /**\n * The date picker open setter\n *\n * @memberof ICustomHeader\n * @member {React.Dispatch<boolean>} setDatePickerOpen\n */\n setDatePickerOpen: React.Dispatch<boolean>;\n}\n/**\n * The classes for the links\n *\n * @constant {string}\n */\nconst linkClasses =\n 'text-overline hover:text-base-300 font-petco underline ml-6 cursor-pointer';\n\n/**\n * This is the custom header for the date picker this will display our\n * month/year as well as the next and previous month buttons\n *\n * @param {ICustomHeader} props - The props for the CustomHeader component\n * @returns {React.ReactNode} Component\n */\nconst CustomHeader: React.FC<ICustomHeader> = ({\n date,\n decreaseMonth,\n increaseMonth,\n prevMonthButtonDisabled,\n nextMonthButtonDisabled,\n selectsRange,\n startDate,\n endDate,\n onRangeChange,\n resetRange,\n setDatePickerOpen,\n}: ICustomHeader) => {\n // Used to set whether the previous or next month button is being hovered over\n const [prevMonthHover, setPrevMonthHover] = useState(false);\n const [nextMonthHover, setNextMonthHover] = useState(false);\n /**\n * @param {string} button - The button to set the hover state for\n * @param {boolean} isHovering - Is the button being hovered over\n */\n const setHovering = (button: string, isHovering: boolean) => {\n if (button === 'prevMonth') {\n setPrevMonthHover(isHovering);\n } else if (button === 'nextMonth') {\n setNextMonthHover(isHovering);\n }\n };\n\n /**\n * The handle apply function\n *\n * @returns {void}\n */\n const handleApply = (): void => {\n if (applyButtonDisabled) return;\n\n if (selectsRange && startDate && endDate) {\n onRangeChange?.([\n dateToMMDDYYYY(startDate, true),\n dateToMMDDYYYY(endDate, true),\n ]);\n }\n setDatePickerOpen(false);\n };\n\n /**\n * The handle cancel function\n *\n * @returns {void}\n */\n const handleCancel = (): void => {\n setDatePickerOpen(false);\n resetRange();\n };\n\n /**\n * The disabled state for the apply button\n *\n * @constant {boolean}\n */\n const applyButtonDisabled = !startDate || !endDate;\n\n return (\n <div\n className=\"flex flex-row justify-between px-1 pt-3 pb-1\"\n data-testid=\"customHeader\"\n >\n <button\n aria-label=\"Previous Month\"\n data-testid={`prev-month-button${prevMonthHover ? '-hover' : ''}`}\n type=\"button\"\n onClick={decreaseMonth}\n disabled={prevMonthButtonDisabled}\n onMouseEnter={() => setHovering('prevMonth', true)}\n onMouseLeave={() => setHovering('prevMonth', false)}\n >\n <Icon\n icon=\"chevronLeft\"\n size={32}\n colorType=\"base\"\n colorShade={determineColorShade(\n prevMonthButtonDisabled,\n prevMonthHover\n )}\n />\n </button>\n\n <span\n data-testid=\"date-header-label\"\n className=\"font-petco font-bold text-body3 my-auto text-mkNavy-400\"\n >\n {new Date(date).toLocaleString('en-US', {\n month: 'long',\n year: 'numeric',\n })}\n </span>\n <button\n type=\"button\"\n aria-label=\"Next Month\"\n data-testid={`next-month-button${nextMonthHover ? '-hover' : ''}`}\n onClick={increaseMonth}\n disabled={nextMonthButtonDisabled}\n onMouseEnter={() => setHovering('nextMonth', true)}\n onMouseLeave={() => setHovering('nextMonth', false)}\n >\n <Icon\n icon=\"chevronRight\"\n size={32}\n colorType={nextMonthButtonDisabled ? 'neutral' : 'base'}\n colorShade={determineColorShade(\n nextMonthButtonDisabled,\n nextMonthHover\n )}\n />\n </button>\n {selectsRange && (\n <div className=\"absolute flex flex-row-reverse bottom-0 right-0 w-full mr-3 mb-1 text-neutral-800\">\n <a\n data-testid={`apply-button${\n applyButtonDisabled ? '-disabled' : ''\n }`}\n className={`${linkClasses} ml-6 ${\n applyButtonDisabled\n ? '!cursor-not-allowed text-neutral-600 hover:text-neutral-600'\n : ''\n }`}\n onClick={handleApply}\n >\n Apply\n </a>\n <a\n data-testid=\"cancel-button\"\n className={linkClasses}\n onClick={handleCancel}\n >\n Cancel\n </a>\n </div>\n )}\n </div>\n );\n};\n\nexport default CustomHeader;\n","/* istanbul ignore file */\nimport Icon from '@/components/atoms/Icon/Icon';\nimport InputError from '@/components/atoms/InputError/InputError';\nimport {\n inputClasses,\n inputDisabledClasses,\n inputErrorClasses,\n labelDisabledClasses,\n} from '@/components/atoms/InputField/InputStyling';\nimport styles from '@/components/atoms/InputFieldDate/InputFieldDate.module.css';\nimport useDateRangeSelection, {\n DateRangeSelectionValue,\n DateSelectionValue,\n IDateRangeOptions,\n IDateRangeValue,\n IUseDateRangeSelectionProps,\n} from '@/lib/hooks/useDateRangeSelection/useDateRangeSelection';\nimport UtcDateToLocal from '@/lib/utils/dates/UtcDateToLocal';\nimport { dateToMMDDYYYY } from '@/lib/utils/helpers/dateHelpers/dateToMMDDYYYY';\nimport appendAttributeIfExists from '@/lib/utils/helpers/ObjectsHelpers/AppendAttributeIfExists';\nimport clsx from 'clsx';\nimport React, {\n forwardRef,\n LegacyRef,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport DatePicker, {\n CalendarContainerProps,\n ReactDatePickerCustomHeaderProps,\n} from 'react-datepicker';\nimport { FieldError, FieldErrorsImpl, Merge } from 'react-hook-form';\nimport CustomCalendarContainer from './CustomCalendarContainer';\nimport DateSelectorCustomHeader from './CustomHeader';\n\n/**\n * The base data test id\n *\n * @constant {string} baseDataTestId\n */\nexport const baseDataTestId = 'date-selector';\n\n/** The on range change callback */\nexport type OnRangeChangeCallback = (dates: [string, string]) => void;\n\n/**\n * The Base Input Field Date Selector\n *\n * @interface IBaseInputFieldDateSelector\n */\ninterface IBaseInputFieldDateSelector {\n /**\n * The Label of the Input\n *\n * @memberof IBaseInputFieldDateSelector\n * @member {string} label\n */\n label: string;\n /**\n * The Name of the Input\n *\n * @memberof IBaseInputFieldDateSelector\n * @member {string} name\n */\n name: string;\n /**\n * If the input selects a range\n *\n * @memberof IBaseInputFieldDateSelector\n * @member {boolean} selectsRange\n */\n selectsRange: boolean;\n /**\n * If the input is required\n *\n * @memberof IBaseInputFieldDateSelector\n * @member {boolean} [required]\n */\n required?: boolean;\n /**\n * If the input is read only\n *\n * @memberof IBaseInputFieldDateSelector\n * @member {boolean} [readOnly]\n */\n readOnly?: boolean;\n /**\n * If the input is locked\n *\n * @memberof IBaseInputFieldDateSelector\n * @default false\n * @member {boolean} [isLocked]\n */\n isLocked?: boolean;\n /**\n * The ref of the input\n *\n * @memberof IBaseInputFieldDateSelector\n * @member {LegacyRef<HTMLInputElement> | undefined} [inputRef]\n */\n inputRef?: LegacyRef<HTMLInputElement> | undefined;\n /**\n * Minimum date\n *\n * @memberof IBaseInputFieldDateSelector\n * @member {string} [min]\n */\n min?: string;\n /**\n * Maximum date\n *\n * @memberof IBaseInputFieldDateSelector\n * @member {string} [max]\n */\n max?: string;\n /**\n * The error message to display\n *\n * @memberof IBaseInputFieldDateSelector\n * @member {FieldError | Merge<FieldError, FieldErrorsImpl<FieldError>>} [error]\n */\n error?:\n | FieldError\n | Merge<FieldError, FieldErrorsImpl<FieldError>>\n | undefined;\n /**\n * The optional force bottom position for the popper\n *\n * @memberof IBaseInputFieldDateSelector\n * @member {boolean} [forceDatePickerPopperBottom]\n */\n forceDatePickerPopperBottom?: boolean;\n}\n\n/**\n * IInputFieldDateSelector - The interface for a Date Selector\n *\n * @augments IBaseInputFieldDateSelector\n * @interface IInputFieldDateSelector\n */\nexport interface IInputFieldDateSelector extends IBaseInputFieldDateSelector {\n /**\n * The input field does not select a range\n *\n * @memberof IInputFieldDateSelector\n * @member {boolean} selectsRange\n */\n selectsRange: false;\n /**\n * The function to handle the date change\n *\n * @memberof IInputFieldDateSelector\n * @member {Function} [onChange]\n * @param {string} date\n * @returns {void}\n */\n onChange?: (date: string) => void;\n /**\n * Passed in Value for the Input\n *\n * @memberof IInputFieldDateSelector\n * @member {string} [value]\n */\n value?: string;\n}\n\n/**\n * IInputFieldDateRangeSelector - The interface for a Date Range Selector\n *\n * @augments IBaseInputFieldDateSelector\n * @augments IUseDateRangeSelectionProps\n * @interface IInputFieldDateRangeSelector\n */\nexport interface IInputFieldDateRangeSelector\n extends IBaseInputFieldDateSelector,\n IUseDateRangeSelectionProps {\n /**\n * The input field does not select a range\n *\n * @memberof IInputFieldDateRangeSelector\n * @member {boolean} selectsRange\n */\n selectsRange: true;\n /**\n * The function to handle the range change\n *\n * @memberof IInputFieldDateRangeSelector\n * @member {OnRangeChangeCallback} [onRangeChange]\n */\n onRangeChange?: OnRangeChangeCallback;\n}\n\n/** The DatePickerFieldSelectorProps */\nexport type DatePickerFieldSelectorProps =\n | IInputFieldDateSelector\n | IInputFieldDateRangeSelector;\n\n/**\n * ICustomInput\n *\n * @interface ICustomInput\n */\ninterface ICustomInput {\n /**\n * The value of the input\n *\n * @memberof ICustomInput\n * @member {Date} [value]\n */\n value?: Date;\n /**\n * The function to handle the onClick event\n *\n * @memberof ICustomInput\n * @member {Function} [onClick]\n * @returns {void}\n */\n onClick?: () => void;\n}\n\n/**\n * @param {boolean} disabled - Is the button disabled\n * @param {boolean} hover - Is the button being hovered over\n * @returns {number} The color shade to use\n */\nexport const determineColorShade = (disabled: boolean, hover: boolean) => {\n if (disabled) {\n return 500;\n } else if (hover) {\n return 300;\n } else {\n return 400;\n }\n};\n\n/**\n * This utility formats the date value on a string to display, if the date\n * format is YYYY-MM-DD it will return MM/DD/YYYY, if not it will return the\n * original string\n *\n * @param {string} date - The date string to format\n * @returns {string} Formatted date\n */\nconst formatDateValue = (date: string): string =>\n dateToMMDDYYYY(UtcDateToLocal(date), true);\n\n/**\n * The default date range options\n *\n * @constant {IDateRangeOptions}\n */\nconst defaultDateRangeOptions: IDateRangeOptions = {\n maxRange: {\n years: 2,\n },\n};\n\n/**\n * Calendar An input to select a date from a calendar\n *\n * @param {IInputFieldDateSelector} props - The props for the Calendar component\n * @returns {React.FC<IInputFieldDateSelector>} Component\n */\nconst InputFieldDateSelector: React.FC<DatePickerFieldSelectorProps> = ({\n label,\n error,\n name,\n max,\n min,\n readOnly,\n isLocked,\n forceDatePickerPopperBottom = false,\n ...rest\n}: DatePickerFieldSelectorProps) => {\n const [inputValue, setInputValue] = useState<DateSelectionValue>(null);\n const [datePickerOpen, setDatePickerOpen] = useState(false);\n\n const { selectsRange, value } = rest;\n\n /**\n * @property {DateSelectionValue} startDate - The start date\n * @property {DateSelectionValue} endDate - The end date\n * @property {Date | null} maxDate - The max date for the date range\n * @property {Function} changeRangeValue -\n */\n const {\n startDate,\n endDate,\n maxDate: maxDateFromRange,\n changeRangeValue,\n resetRange,\n } = useDateRangeSelection({\n value: selectsRange ? value : undefined,\n options:\n selectsRange && rest?.options ? rest.options : defaultDateRangeOptions,\n });\n\n /**\n * The max date for the date picker\n *\n * @constant {Date}\n */\n const maxDate = useMemo(() => {\n /**\n * The default max date\n *\n * @constant {Date}\n */\n const maxDate = max ? new Date(max) : new Date();\n\n if (selectsRange && maxDateFromRange) {\n return maxDateFromRange < maxDate ? maxDateFromRange : maxDate;\n }\n return maxDate;\n }, [max, maxDateFromRange, selectsRange]);\n\n // If value is passed in props, set input value\n useEffect(() => {\n if (!selectsRange && value) {\n setInputValue(UtcDateToLocal(value));\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n /**\n * Used to handle resetting the date value\n *\n * (e.g. when calling the `reset` method from react-hook-form)\n */\n useEffect(() => {\n if (value === undefined || value === null) {\n setInputValue(null);\n }\n }, [value]);\n\n /**\n * Updates component state and calls onChange passed in props.\n *\n * @param {DateSelectionValue} date - The date to change the value to\n */\n const changeValue = (date: DateSelectionValue) => {\n /**\n * If selectsRange is false, rest can only be of type\n * IInputFieldDateSelector according to the type of\n * DatePickerFieldSelectorProps, so we can safely cast it\n */\n const { onChange } = rest as IInputFieldDateSelector;\n\n setInputValue(date ? date : null);\n\n if (onChange && date) {\n onChange(dateToMMDDYYYY(date, true));\n }\n };\n\n /**\n * The input field on change handler. It conditionally calls changeRangeValue\n * or changeValue based on the value of selectsRange\n *\n * @param {Date | DateRangeSelectionValue | null} event - The event from the\n * date picker input field\n * @returns {void}\n */\n const handleChange = (\n event: DateSelectionValue | DateRangeSelectionValue\n ): void => {\n selectsRange\n ? changeRangeValue(event as DateRangeSelectionValue)\n : changeValue(event as DateSelectionValue);\n };\n\n /**\n * Handle blur of the date picker\n *\n * @returns {void}\n */\n const handleBlur = (): void => {\n setDatePickerOpen(false);\n resetRange();\n };\n\n const defaultLabelClasses = `font-petco text-body-4 absolute text-neutral-700 duration-300 -translate-y-1 top-5 z-10 origin-[0] bg-white px-3 left-0 transition-all ${\n (value || inputValue) && 'text-xs -translate-y-3'\n } `;\n\n // Set the default Label Class and Input Classes\n let labelClass = defaultLabelClasses;\n let inputClass = inputClasses + ' text-start';\n\n // Error classes\n if (error) {\n labelClass = `${labelClass} !text-error-200`;\n inputClass = `${inputErrorClasses} ${inputClass}`;\n }\n\n // If there is a read only value apply additional classes\n if (readOnly || isLocked) {\n inputClass = `${inputClass} ${inputDisabledClasses}`;\n labelClass = `${labelClass} ${labelDisabledClasses}`;\n }\n\n /**\n * The value for custom input field of the date selector\n *\n * @constant {string} dateSelectorCustomInputValue - The value for the custom\n */\n const dateSelectorCustomInputValue = useMemo(() => {\n if (!value) {\n return;\n }\n if (!selectsRange) {\n return formatDateValue(value as string);\n }\n /**\n * If selectsRange is true, value can only be of type IDateRangeValue\n * according to the type of DatePickerFieldSelectorProps, so we can safely\n * cast it\n */\n const { startDate, endDate } = value as IDateRangeValue;\n\n return `${formatDateValue(startDate)} – ${formatDateValue(endDate)}`;\n }, [selectsRange, value]);\n\n /**\n * CustomInput\n *\n * Custom input component for the date selector this should match the rest of\n * our input fields this is passed into the customInput prop of the date\n * picker to replace the default input\n *\n * @constant\n * @param {ICustomInput} props - The props for the CustomInput component\n * @returns {React.FC<ICustomInput>} Component\n */\n const CustomInput = forwardRef(({ onClick }: ICustomInput, ref) => (\n <div\n className=\"relative block pointer-events-none touch-none\"\n data-testid={`${baseDataTestId}-custom-input`}\n >\n <input\n ref={ref as LegacyRef<HTMLInputElement>}\n type=\"text\"\n id={name}\n value={dateSelectorCustomInputValue}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n onClick?.();\n setDatePickerOpen(true);\n }\n }}\n aria-invalid={error ? 'true' : 'false'}\n readOnly={true}\n disabled={readOnly || isLocked}\n onClick={() => {\n onClick?.();\n setDatePickerOpen(true);\n }}\n className={`${inputClass} ${styles.inputDate} block cursor-pointer pointer-events-auto touch-auto`}\n data-testid=\"input-field-input-date\"\n key={`input-field-date-${name}`}\n onChange={(e) => {\n handleChange(new Date(e.target.value));\n }}\n />\n <label\n data-testid=\"input-field-label\"\n className={`${labelClass} pointer-events-none touch-none`}\n htmlFor={name}\n >\n {label || 'mm/dd/yyyy'}\n </label>\n <span className=\"absolute top-1/2 right-2.5 transform -translate-y-1/2 z-100 pointer-events-none touch-none\">\n <Icon\n icon=\"calendar\"\n size={24}\n colorType={isLocked ? 'neutral' : 'base'}\n colorShade={isLocked ? 500 : 400}\n ></Icon>\n </span>\n </div>\n ));\n CustomInput.displayName = 'CustomInput';\n\n return (\n <div\n data-testid={`${baseDataTestId}${isLocked ? '-locked' : ''}`}\n id=\"dateSelector\"\n className=\"relative block pointer-events-none touch-none\"\n >\n {/** Third party package 'react-datepicker' reference: https://reactdatepicker.com */}\n <DatePicker\n selectsRange={selectsRange}\n selected={inputValue || startDate || null}\n onChange={handleChange}\n portalId=\"input-field-date-selector-portal\"\n popperClassName={clsx(\n 'pointer-events-auto touch-auto pb-6',\n forceDatePickerPopperBottom ? 'force-bottom-popper' : ''\n )}\n maxDate={maxDate}\n minDate={min ? new Date(min) : new Date('1900-01-01')}\n popperPlacement=\"bottom-end\"\n popperProps={{\n transform: forceDatePickerPopperBottom ? false : true,\n strategy: forceDatePickerPopperBottom ? 'absolute' : 'fixed',\n }}\n dateFormat=\"MMDDYYYY\"\n shouldCloseOnSelect={!selectsRange}\n value={!inputValue ? undefined : dateToMMDDYYYY(inputValue)}\n {...(selectsRange ? { open: datePickerOpen } : {})}\n {...appendAttributeIfExists('startDate', startDate)}\n {...appendAttributeIfExists('endDate', endDate)}\n customInput={<CustomInput />}\n calendarContainer={({ children }: CalendarContainerProps) => (\n <CustomCalendarContainer onBlur={handleBlur}>\n {children}\n </CustomCalendarContainer>\n )}\n renderCustomHeader={({\n date,\n decreaseMonth,\n increaseMonth,\n prevMonthButtonDisabled,\n nextMonthButtonDisabled,\n }: ReactDatePickerCustomHeaderProps) => (\n <DateSelectorCustomHeader\n {...{\n date,\n decreaseMonth,\n increaseMonth,\n prevMonthButtonDisabled,\n nextMonthButtonDisabled,\n selectsRange,\n startDate,\n endDate,\n onRangeChange: selectsRange\n ? (rest as IInputFieldDateRangeSelector).onRangeChange\n : undefined,\n resetRange,\n setDatePickerOpen,\n }}\n />\n )}\n />\n <InputError error={error} />\n </div>\n );\n};\n\nexport default InputFieldDateSelector;\n","/**\n * Convert UTC date to local\n *\n * There is a strange behavior is JS that looks at a date string in this format\n * '2022-01-01' and assumes that it is in UTC time. This function will convert\n * that string to a local date using the format '2022/01/01'.\n *\n * NOTE: Date strings that use slashes instead of dashes as separators are\n * non-standard to the ECMA specs and the parsing behavior could vary depending\n * on the engine implementation.\n *\n * See:\n * https://tc39.es/ecma262/multipage/numbers-and-dates.html#sec-date-time-string-format\n *\n * @param {string} value - The string value of the date\n * @returns {Date} - The local date\n */\nexport default function UtcDateToLocal(value: string): Date {\n /** Replace any '-' with '/' */\n const localDate = value.replace(/-/g, '/');\n return new Date(localDate);\n}\n","/**\n * Converts a date string to a string in the format MM/DD/YYYY\n *\n * @param {string | Date} date - The date to convert\n * @param {boolean} withLeadingZero - If the month and day should have a leading\n * zero\n * @returns {string} - The date in the format MM/DD/YYYY\n */\nexport const dateToMMDDYYYY = (\n date: string | Date,\n withLeadingZero?: boolean\n): string => {\n const d = new Date(date);\n const month = d.getMonth() + 1;\n const day = d.getDate();\n const year = d.getFullYear();\n\n if (withLeadingZero) {\n return `${month.toString().padStart(2, '0')}/${day\n .toString()\n .padStart(2, '0')}/${year}`;\n }\n return `${month}/${day}/${year}`;\n};\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"inputDate\":\"InputFieldDate_inputDate__Zh0Dj\"};"],"names":["incrementDateYears","date","years","setFullYear","getFullYear","incrementDateMonths","months","setMonth","getMonth","incrementDateDays","days","setDate","getDate","useMaxRange","maxRange","startDate","param","useMemo","Date","getTime","useDateRangeSelection_useDateRangeSelection","value","options","setStartDate","useState","endDate","setEndDate","maxDate","useEffect","changeRangeValue","dates","resetRange","InputFieldDateSelector_CustomCalendarContainer","children","onBlur","ref","isComponentFocused","useComponentFocused","jsx_runtime","jsx","div","linkClasses","InputFieldDateSelector_CustomHeader","decreaseMonth","increaseMonth","prevMonthButtonDisabled","nextMonthButtonDisabled","selectsRange","onRangeChange","setDatePickerOpen","prevMonthHover","setPrevMonthHover","nextMonthHover","setNextMonthHover","setHovering","button","isHovering","applyButtonDisabled","jsxs","className","aria-label","type","onClick","disabled","onMouseEnter","onMouseLeave","Icon","icon","size","colorType","colorShade","determineColorShade","span","toLocaleString","month","year","a","concat","dateToMMDDYYYY","hover","formatDateValue","UtcDateToLocal","defaultDateRangeOptions","InputFieldDateSelector_InputFieldDateSelector","label","error","name","max","min","readOnly","isLocked","forceDatePickerPopperBottom","rest","inputValue","setInputValue","datePickerOpen","maxDateFromRange","useDateRangeSelection","undefined","changeValue","onChange","handleChange","event","handleBlur","defaultLabelClasses","labelClass","inputClass","inputClasses","inputErrorClasses","inputDisabledClasses","labelDisabledClasses","dateSelectorCustomInputValue","CustomInput","forwardRef","input","id","onKeyDown","e","key","aria-invalid","styles","target","htmlFor","displayName","DatePicker","selected","portalId","popperClassName","clsx","minDate","popperPlacement","popperProps","transform","strategy","dateFormat","shouldCloseOnSelect","open","appendAttributeIfExists","customInput","calendarContainer","CustomCalendarContainer","renderCustomHeader","DateSelectorCustomHeader","InputError","localDate","replace","withLeadingZero","d","day","toString","padStart","module","exports"],"sourceRoot":""}