@helsenorge/datepicker 9.4.3 → 10.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1245 -745
- package/components/DatePicker/DatePicker.d.ts +3 -3
- package/components/DatePicker/DatePickerPopup.d.ts +2 -2
- package/components/DatePicker/index.js +1594 -1339
- package/components/DatePicker/index.js.map +1 -1
- package/components/DatePicker/styles.module.scss +83 -79
- package/components/DatePicker/styles.module.scss.d.ts +8 -7
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../node_modules/react-day-picker/dist/index.esm.js","../../../src/components/DatePicker/position-utils.ts","../../../src/components/DatePicker/DatePickerPopup.tsx","../../../src/components/DatePicker/DatePicker.tsx","../../../src/components/DatePicker/DateTime.tsx","../../../src/components/DatePicker/DateTimePickerWrapper.tsx","../../../src/components/DatePicker/validate-utils.ts"],"sourcesContent":["import { jsx, jsxs, Fragment } from 'react/jsx-runtime';\nimport { createContext, useContext, useState, forwardRef, useEffect, useRef, useLayoutEffect } from 'react';\nimport { format, startOfMonth, endOfMonth, startOfDay, isSameYear, setMonth, setYear, startOfYear, differenceInCalendarMonths, addMonths, isSameMonth, isBefore, startOfISOWeek, startOfWeek, addDays, isSameDay, isAfter, subDays, differenceInCalendarDays, isDate, max, min, addWeeks, addYears, endOfISOWeek, endOfWeek, getUnixTime, getISOWeek, getWeek, getWeeksInMonth, parse } from 'date-fns';\nimport { enUS } from 'date-fns/locale';\n\n/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol */\r\n\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nfunction __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\ntypeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\n\n/** Returns true when the props are of type {@link DayPickerMultipleProps}. */\nfunction isDayPickerMultiple(props) {\n return props.mode === 'multiple';\n}\n\n/** Returns true when the props are of type {@link DayPickerRangeProps}. */\nfunction isDayPickerRange(props) {\n return props.mode === 'range';\n}\n\n/** Returns true when the props are of type {@link DayPickerSingleProps}. */\nfunction isDayPickerSingle(props) {\n return props.mode === 'single';\n}\n\n/**\n * The name of the default CSS classes.\n */\nvar defaultClassNames = {\n root: 'rdp',\n multiple_months: 'rdp-multiple_months',\n with_weeknumber: 'rdp-with_weeknumber',\n vhidden: 'rdp-vhidden',\n button_reset: 'rdp-button_reset',\n button: 'rdp-button',\n caption: 'rdp-caption',\n caption_start: 'rdp-caption_start',\n caption_end: 'rdp-caption_end',\n caption_between: 'rdp-caption_between',\n caption_label: 'rdp-caption_label',\n caption_dropdowns: 'rdp-caption_dropdowns',\n dropdown: 'rdp-dropdown',\n dropdown_month: 'rdp-dropdown_month',\n dropdown_year: 'rdp-dropdown_year',\n dropdown_icon: 'rdp-dropdown_icon',\n months: 'rdp-months',\n month: 'rdp-month',\n table: 'rdp-table',\n tbody: 'rdp-tbody',\n tfoot: 'rdp-tfoot',\n head: 'rdp-head',\n head_row: 'rdp-head_row',\n head_cell: 'rdp-head_cell',\n nav: 'rdp-nav',\n nav_button: 'rdp-nav_button',\n nav_button_previous: 'rdp-nav_button_previous',\n nav_button_next: 'rdp-nav_button_next',\n nav_icon: 'rdp-nav_icon',\n row: 'rdp-row',\n weeknumber: 'rdp-weeknumber',\n cell: 'rdp-cell',\n day: 'rdp-day',\n day_today: 'rdp-day_today',\n day_outside: 'rdp-day_outside',\n day_selected: 'rdp-day_selected',\n day_disabled: 'rdp-day_disabled',\n day_hidden: 'rdp-day_hidden',\n day_range_start: 'rdp-day_range_start',\n day_range_end: 'rdp-day_range_end',\n day_range_middle: 'rdp-day_range_middle'\n};\n\n/**\n * The default formatter for the caption.\n */\nfunction formatCaption(month, options) {\n return format(month, 'LLLL y', options);\n}\n\n/**\n * The default formatter for the Day button.\n */\nfunction formatDay(day, options) {\n return format(day, 'd', options);\n}\n\n/**\n * The default formatter for the Month caption.\n */\nfunction formatMonthCaption(month, options) {\n return format(month, 'LLLL', options);\n}\n\n/**\n * The default formatter for the week number.\n */\nfunction formatWeekNumber(weekNumber) {\n return \"\".concat(weekNumber);\n}\n\n/**\n * The default formatter for the name of the weekday.\n */\nfunction formatWeekdayName(weekday, options) {\n return format(weekday, 'cccccc', options);\n}\n\n/**\n * The default formatter for the Year caption.\n */\nfunction formatYearCaption(year, options) {\n return format(year, 'yyyy', options);\n}\n\nvar formatters = /*#__PURE__*/Object.freeze({\n __proto__: null,\n formatCaption: formatCaption,\n formatDay: formatDay,\n formatMonthCaption: formatMonthCaption,\n formatWeekNumber: formatWeekNumber,\n formatWeekdayName: formatWeekdayName,\n formatYearCaption: formatYearCaption\n});\n\n/**\n * The default ARIA label for the day button.\n */\nvar labelDay = function (day, activeModifiers, options) {\n return format(day, 'do MMMM (EEEE)', options);\n};\n\n/**\n * The default ARIA label for the WeekNumber element.\n */\nvar labelMonthDropdown = function () {\n return 'Month: ';\n};\n\n/**\n * The default ARIA label for next month button in navigation\n */\nvar labelNext = function () {\n return 'Go to next month';\n};\n\n/**\n * The default ARIA label for previous month button in navigation\n */\nvar labelPrevious = function () {\n return 'Go to previous month';\n};\n\n/**\n * The default ARIA label for the Weekday element.\n */\nvar labelWeekday = function (day, options) {\n return format(day, 'cccc', options);\n};\n\n/**\n * The default ARIA label for the WeekNumber element.\n */\nvar labelWeekNumber = function (n) {\n return \"Week n. \".concat(n);\n};\n\n/**\n * The default ARIA label for the WeekNumber element.\n */\nvar labelYearDropdown = function () {\n return 'Year: ';\n};\n\nvar labels = /*#__PURE__*/Object.freeze({\n __proto__: null,\n labelDay: labelDay,\n labelMonthDropdown: labelMonthDropdown,\n labelNext: labelNext,\n labelPrevious: labelPrevious,\n labelWeekNumber: labelWeekNumber,\n labelWeekday: labelWeekday,\n labelYearDropdown: labelYearDropdown\n});\n\n/**\n * Returns the default values to use in the DayPickerContext, in case they are\n * not passed down with the DayPicker initial props.\n */\nfunction getDefaultContextValues() {\n var captionLayout = 'buttons';\n var classNames = defaultClassNames;\n var locale = enUS;\n var modifiersClassNames = {};\n var modifiers = {};\n var numberOfMonths = 1;\n var styles = {};\n var today = new Date();\n return {\n captionLayout: captionLayout,\n classNames: classNames,\n formatters: formatters,\n labels: labels,\n locale: locale,\n modifiersClassNames: modifiersClassNames,\n modifiers: modifiers,\n numberOfMonths: numberOfMonths,\n styles: styles,\n today: today,\n mode: 'default'\n };\n}\n\n/** Return the `fromDate` and `toDate` prop values values parsing the DayPicker props. */\nfunction parseFromToProps(props) {\n var fromYear = props.fromYear, toYear = props.toYear, fromMonth = props.fromMonth, toMonth = props.toMonth;\n var fromDate = props.fromDate, toDate = props.toDate;\n if (fromMonth) {\n fromDate = startOfMonth(fromMonth);\n }\n else if (fromYear) {\n fromDate = new Date(fromYear, 0, 1);\n }\n if (toMonth) {\n toDate = endOfMonth(toMonth);\n }\n else if (toYear) {\n toDate = new Date(toYear, 11, 31);\n }\n return {\n fromDate: fromDate ? startOfDay(fromDate) : undefined,\n toDate: toDate ? startOfDay(toDate) : undefined\n };\n}\n\n/**\n * The DayPicker context shares the props passed to DayPicker within internal\n * and custom components. It is used to set the default values and perform\n * one-time calculations required to render the days.\n *\n * Access to this context from the {@link useDayPicker} hook.\n */\nvar DayPickerContext = createContext(undefined);\n/**\n * The provider for the {@link DayPickerContext}, assigning the defaults from the\n * initial DayPicker props.\n */\nfunction DayPickerProvider(props) {\n var _a;\n var initialProps = props.initialProps;\n var defaultContextValues = getDefaultContextValues();\n var _b = parseFromToProps(initialProps), fromDate = _b.fromDate, toDate = _b.toDate;\n var captionLayout = (_a = initialProps.captionLayout) !== null && _a !== void 0 ? _a : defaultContextValues.captionLayout;\n if (captionLayout !== 'buttons' && (!fromDate || !toDate)) {\n // When no from/to dates are set, the caption is always buttons\n captionLayout = 'buttons';\n }\n var onSelect;\n if (isDayPickerSingle(initialProps) ||\n isDayPickerMultiple(initialProps) ||\n isDayPickerRange(initialProps)) {\n onSelect = initialProps.onSelect;\n }\n var value = __assign(__assign(__assign({}, defaultContextValues), initialProps), { captionLayout: captionLayout, classNames: __assign(__assign({}, defaultContextValues.classNames), initialProps.classNames), components: __assign({}, initialProps.components), formatters: __assign(__assign({}, defaultContextValues.formatters), initialProps.formatters), fromDate: fromDate, labels: __assign(__assign({}, defaultContextValues.labels), initialProps.labels), mode: initialProps.mode || defaultContextValues.mode, modifiers: __assign(__assign({}, defaultContextValues.modifiers), initialProps.modifiers), modifiersClassNames: __assign(__assign({}, defaultContextValues.modifiersClassNames), initialProps.modifiersClassNames), onSelect: onSelect, styles: __assign(__assign({}, defaultContextValues.styles), initialProps.styles), toDate: toDate });\n return (jsx(DayPickerContext.Provider, { value: value, children: props.children }));\n}\n/**\n * Hook to access the {@link DayPickerContextValue}.\n *\n * Use the DayPicker context to access to the props passed to DayPicker inside\n * internal or custom components.\n */\nfunction useDayPicker() {\n var context = useContext(DayPickerContext);\n if (!context) {\n throw new Error(\"useDayPicker must be used within a DayPickerProvider.\");\n }\n return context;\n}\n\n/** Render the caption for the displayed month. This component is used when `captionLayout=\"buttons\"`. */\nfunction CaptionLabel(props) {\n var _a = useDayPicker(), locale = _a.locale, classNames = _a.classNames, styles = _a.styles, formatCaption = _a.formatters.formatCaption;\n return (jsx(\"div\", { className: classNames.caption_label, style: styles.caption_label, \"aria-live\": \"polite\", role: \"presentation\", id: props.id, children: formatCaption(props.displayMonth, { locale: locale }) }));\n}\n\n/**\n * Render the icon in the styled drop-down.\n */\nfunction IconDropdown(props) {\n return (jsx(\"svg\", __assign({ width: \"8px\", height: \"8px\", viewBox: \"0 0 120 120\", \"data-testid\": \"iconDropdown\" }, props, { children: jsx(\"path\", { d: \"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z\", fill: \"currentColor\", fillRule: \"nonzero\" }) })));\n}\n\n/**\n * Render a styled select component – displaying a caption and a custom\n * drop-down icon.\n */\nfunction Dropdown(props) {\n var _a, _b;\n var onChange = props.onChange, value = props.value, children = props.children, caption = props.caption, className = props.className, style = props.style;\n var dayPicker = useDayPicker();\n var IconDropdownComponent = (_b = (_a = dayPicker.components) === null || _a === void 0 ? void 0 : _a.IconDropdown) !== null && _b !== void 0 ? _b : IconDropdown;\n return (jsxs(\"div\", { className: className, style: style, children: [jsx(\"span\", { className: dayPicker.classNames.vhidden, children: props['aria-label'] }), jsx(\"select\", { name: props.name, \"aria-label\": props['aria-label'], className: dayPicker.classNames.dropdown, style: dayPicker.styles.dropdown, value: value, onChange: onChange, children: children }), jsxs(\"div\", { className: dayPicker.classNames.caption_label, style: dayPicker.styles.caption_label, \"aria-hidden\": \"true\", children: [caption, jsx(IconDropdownComponent, { className: dayPicker.classNames.dropdown_icon, style: dayPicker.styles.dropdown_icon })] })] }));\n}\n\n/** Render the dropdown to navigate between months. */\nfunction MonthsDropdown(props) {\n var _a;\n var _b = useDayPicker(), fromDate = _b.fromDate, toDate = _b.toDate, styles = _b.styles, locale = _b.locale, formatMonthCaption = _b.formatters.formatMonthCaption, classNames = _b.classNames, components = _b.components, labelMonthDropdown = _b.labels.labelMonthDropdown;\n // Dropdown should appear only when both from/toDate is set\n if (!fromDate)\n return jsx(Fragment, {});\n if (!toDate)\n return jsx(Fragment, {});\n var dropdownMonths = [];\n if (isSameYear(fromDate, toDate)) {\n // only display the months included in the range\n var date = startOfMonth(fromDate);\n for (var month = fromDate.getMonth(); month <= toDate.getMonth(); month++) {\n dropdownMonths.push(setMonth(date, month));\n }\n }\n else {\n // display all the 12 months\n var date = startOfMonth(new Date()); // Any date should be OK, as we just need the year\n for (var month = 0; month <= 11; month++) {\n dropdownMonths.push(setMonth(date, month));\n }\n }\n var handleChange = function (e) {\n var selectedMonth = Number(e.target.value);\n var newMonth = setMonth(startOfMonth(props.displayMonth), selectedMonth);\n props.onChange(newMonth);\n };\n var DropdownComponent = (_a = components === null || components === void 0 ? void 0 : components.Dropdown) !== null && _a !== void 0 ? _a : Dropdown;\n return (jsx(DropdownComponent, { name: \"months\", \"aria-label\": labelMonthDropdown(), className: classNames.dropdown_month, style: styles.dropdown_month, onChange: handleChange, value: props.displayMonth.getMonth(), caption: formatMonthCaption(props.displayMonth, { locale: locale }), children: dropdownMonths.map(function (m) { return (jsx(\"option\", { value: m.getMonth(), children: formatMonthCaption(m, { locale: locale }) }, m.getMonth())); }) }));\n}\n\n/**\n * Render a dropdown to change the year. Take in account the `nav.fromDate` and\n * `toDate` from context.\n */\nfunction YearsDropdown(props) {\n var _a;\n var displayMonth = props.displayMonth;\n var _b = useDayPicker(), fromDate = _b.fromDate, toDate = _b.toDate, locale = _b.locale, styles = _b.styles, classNames = _b.classNames, components = _b.components, formatYearCaption = _b.formatters.formatYearCaption, labelYearDropdown = _b.labels.labelYearDropdown;\n var years = [];\n // Dropdown should appear only when both from/toDate is set\n if (!fromDate)\n return jsx(Fragment, {});\n if (!toDate)\n return jsx(Fragment, {});\n var fromYear = fromDate.getFullYear();\n var toYear = toDate.getFullYear();\n for (var year = fromYear; year <= toYear; year++) {\n years.push(setYear(startOfYear(new Date()), year));\n }\n var handleChange = function (e) {\n var newMonth = setYear(startOfMonth(displayMonth), Number(e.target.value));\n props.onChange(newMonth);\n };\n var DropdownComponent = (_a = components === null || components === void 0 ? void 0 : components.Dropdown) !== null && _a !== void 0 ? _a : Dropdown;\n return (jsx(DropdownComponent, { name: \"years\", \"aria-label\": labelYearDropdown(), className: classNames.dropdown_year, style: styles.dropdown_year, onChange: handleChange, value: displayMonth.getFullYear(), caption: formatYearCaption(displayMonth, { locale: locale }), children: years.map(function (year) { return (jsx(\"option\", { value: year.getFullYear(), children: formatYearCaption(year, { locale: locale }) }, year.getFullYear())); }) }));\n}\n\n/**\n * Helper hook for using controlled/uncontrolled values from a component props.\n *\n * When the value is not controlled, pass `undefined` as `controlledValue` and\n * use the returned setter to update it.\n *\n * When the value is controlled, pass the controlled value as second\n * argument, which will be always returned as `value`.\n */\nfunction useControlledValue(defaultValue, controlledValue) {\n var _a = useState(defaultValue), uncontrolledValue = _a[0], setValue = _a[1];\n var value = controlledValue === undefined ? uncontrolledValue : controlledValue;\n return [value, setValue];\n}\n\n/** Return the initial month according to the given options. */\nfunction getInitialMonth(context) {\n var month = context.month, defaultMonth = context.defaultMonth, today = context.today;\n var initialMonth = month || defaultMonth || today || new Date();\n var toDate = context.toDate, fromDate = context.fromDate, _a = context.numberOfMonths, numberOfMonths = _a === void 0 ? 1 : _a;\n // Fix the initialMonth if is after the to-date\n if (toDate && differenceInCalendarMonths(toDate, initialMonth) < 0) {\n var offset = -1 * (numberOfMonths - 1);\n initialMonth = addMonths(toDate, offset);\n }\n // Fix the initialMonth if is before the from-date\n if (fromDate && differenceInCalendarMonths(initialMonth, fromDate) < 0) {\n initialMonth = fromDate;\n }\n return startOfMonth(initialMonth);\n}\n\n/** Controls the navigation state. */\nfunction useNavigationState() {\n var context = useDayPicker();\n var initialMonth = getInitialMonth(context);\n var _a = useControlledValue(initialMonth, context.month), month = _a[0], setMonth = _a[1];\n var goToMonth = function (date) {\n var _a;\n if (context.disableNavigation)\n return;\n var month = startOfMonth(date);\n setMonth(month);\n (_a = context.onMonthChange) === null || _a === void 0 ? void 0 : _a.call(context, month);\n };\n return [month, goToMonth];\n}\n\n/**\n * Return the months to display in the component according to the number of\n * months and the from/to date.\n */\nfunction getDisplayMonths(month, _a) {\n var reverseMonths = _a.reverseMonths, numberOfMonths = _a.numberOfMonths;\n var start = startOfMonth(month);\n var end = startOfMonth(addMonths(start, numberOfMonths));\n var monthsDiff = differenceInCalendarMonths(end, start);\n var months = [];\n for (var i = 0; i < monthsDiff; i++) {\n var nextMonth = addMonths(start, i);\n months.push(nextMonth);\n }\n if (reverseMonths)\n months = months.reverse();\n return months;\n}\n\n/**\n * Returns the next month the user can navigate to according to the given\n * options.\n *\n * Please note that the next month is not always the next calendar month:\n *\n * - if after the `toDate` range, is undefined;\n * - if the navigation is paged, is the number of months displayed ahead.\n *\n */\nfunction getNextMonth(startingMonth, options) {\n if (options.disableNavigation) {\n return undefined;\n }\n var toDate = options.toDate, pagedNavigation = options.pagedNavigation, _a = options.numberOfMonths, numberOfMonths = _a === void 0 ? 1 : _a;\n var offset = pagedNavigation ? numberOfMonths : 1;\n var month = startOfMonth(startingMonth);\n if (!toDate) {\n return addMonths(month, offset);\n }\n var monthsDiff = differenceInCalendarMonths(toDate, startingMonth);\n if (monthsDiff < numberOfMonths) {\n return undefined;\n }\n // Jump forward as the number of months when paged navigation\n return addMonths(month, offset);\n}\n\n/**\n * Returns the next previous the user can navigate to, according to the given\n * options.\n *\n * Please note that the previous month is not always the previous calendar\n * month:\n *\n * - if before the `fromDate` date, is `undefined`;\n * - if the navigation is paged, is the number of months displayed before.\n *\n */\nfunction getPreviousMonth(startingMonth, options) {\n if (options.disableNavigation) {\n return undefined;\n }\n var fromDate = options.fromDate, pagedNavigation = options.pagedNavigation, _a = options.numberOfMonths, numberOfMonths = _a === void 0 ? 1 : _a;\n var offset = pagedNavigation ? numberOfMonths : 1;\n var month = startOfMonth(startingMonth);\n if (!fromDate) {\n return addMonths(month, -offset);\n }\n var monthsDiff = differenceInCalendarMonths(month, fromDate);\n if (monthsDiff <= 0) {\n return undefined;\n }\n // Jump back as the number of months when paged navigation\n return addMonths(month, -offset);\n}\n\n/**\n * The Navigation context shares details and methods to navigate the months in DayPicker.\n * Access this context from the {@link useNavigation} hook.\n */\nvar NavigationContext = createContext(undefined);\n/** Provides the values for the {@link NavigationContext}. */\nfunction NavigationProvider(props) {\n var dayPicker = useDayPicker();\n var _a = useNavigationState(), currentMonth = _a[0], goToMonth = _a[1];\n var displayMonths = getDisplayMonths(currentMonth, dayPicker);\n var nextMonth = getNextMonth(currentMonth, dayPicker);\n var previousMonth = getPreviousMonth(currentMonth, dayPicker);\n var isDateDisplayed = function (date) {\n return displayMonths.some(function (displayMonth) {\n return isSameMonth(date, displayMonth);\n });\n };\n var goToDate = function (date, refDate) {\n if (isDateDisplayed(date)) {\n return;\n }\n if (refDate && isBefore(date, refDate)) {\n goToMonth(addMonths(date, 1 + dayPicker.numberOfMonths * -1));\n }\n else {\n goToMonth(date);\n }\n };\n var value = {\n currentMonth: currentMonth,\n displayMonths: displayMonths,\n goToMonth: goToMonth,\n goToDate: goToDate,\n previousMonth: previousMonth,\n nextMonth: nextMonth,\n isDateDisplayed: isDateDisplayed\n };\n return (jsx(NavigationContext.Provider, { value: value, children: props.children }));\n}\n/**\n * Hook to access the {@link NavigationContextValue}. Use this hook to navigate\n * between months or years in DayPicker.\n *\n * This hook is meant to be used inside internal or custom components.\n */\nfunction useNavigation() {\n var context = useContext(NavigationContext);\n if (!context) {\n throw new Error('useNavigation must be used within a NavigationProvider');\n }\n return context;\n}\n\n/**\n * Render a caption with the dropdowns to navigate between months and years.\n */\nfunction CaptionDropdowns(props) {\n var _a;\n var _b = useDayPicker(), classNames = _b.classNames, styles = _b.styles, components = _b.components;\n var goToMonth = useNavigation().goToMonth;\n var handleMonthChange = function (newMonth) {\n goToMonth(addMonths(newMonth, props.displayIndex ? -props.displayIndex : 0));\n };\n var CaptionLabelComponent = (_a = components === null || components === void 0 ? void 0 : components.CaptionLabel) !== null && _a !== void 0 ? _a : CaptionLabel;\n var captionLabel = (jsx(CaptionLabelComponent, { id: props.id, displayMonth: props.displayMonth }));\n return (jsxs(\"div\", { className: classNames.caption_dropdowns, style: styles.caption_dropdowns, children: [jsx(\"div\", { className: classNames.vhidden, children: captionLabel }), jsx(MonthsDropdown, { onChange: handleMonthChange, displayMonth: props.displayMonth }), jsx(YearsDropdown, { onChange: handleMonthChange, displayMonth: props.displayMonth })] }));\n}\n\n/**\n * Render the \"previous month\" button in the navigation.\n */\nfunction IconLeft(props) {\n return (jsx(\"svg\", __assign({ width: \"16px\", height: \"16px\", viewBox: \"0 0 120 120\" }, props, { children: jsx(\"path\", { d: \"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z\", fill: \"currentColor\", fillRule: \"nonzero\" }) })));\n}\n\n/**\n * Render the \"next month\" button in the navigation.\n */\nfunction IconRight(props) {\n return (jsx(\"svg\", __assign({ width: \"16px\", height: \"16px\", viewBox: \"0 0 120 120\" }, props, { children: jsx(\"path\", { d: \"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z\", fill: \"currentColor\" }) })));\n}\n\n/** Render a button HTML element applying the reset class name. */\nvar Button = forwardRef(function (props, ref) {\n var _a = useDayPicker(), classNames = _a.classNames, styles = _a.styles;\n var classNamesArr = [classNames.button_reset, classNames.button];\n if (props.className) {\n classNamesArr.push(props.className);\n }\n var className = classNamesArr.join(' ');\n var style = __assign(__assign({}, styles.button_reset), styles.button);\n if (props.style) {\n Object.assign(style, props.style);\n }\n return (jsx(\"button\", __assign({}, props, { ref: ref, type: \"button\", className: className, style: style })));\n});\n\n/** A component rendering the navigation buttons or the drop-downs. */\nfunction Navigation(props) {\n var _a, _b;\n var _c = useDayPicker(), dir = _c.dir, locale = _c.locale, classNames = _c.classNames, styles = _c.styles, _d = _c.labels, labelPrevious = _d.labelPrevious, labelNext = _d.labelNext, components = _c.components;\n if (!props.nextMonth && !props.previousMonth) {\n return jsx(Fragment, {});\n }\n var previousLabel = labelPrevious(props.previousMonth, { locale: locale });\n var previousClassName = [\n classNames.nav_button,\n classNames.nav_button_previous\n ].join(' ');\n var nextLabel = labelNext(props.nextMonth, { locale: locale });\n var nextClassName = [\n classNames.nav_button,\n classNames.nav_button_next\n ].join(' ');\n var IconRightComponent = (_a = components === null || components === void 0 ? void 0 : components.IconRight) !== null && _a !== void 0 ? _a : IconRight;\n var IconLeftComponent = (_b = components === null || components === void 0 ? void 0 : components.IconLeft) !== null && _b !== void 0 ? _b : IconLeft;\n return (jsxs(\"div\", { className: classNames.nav, style: styles.nav, children: [!props.hidePrevious && (jsx(Button, { name: \"previous-month\", \"aria-label\": previousLabel, className: previousClassName, style: styles.nav_button_previous, disabled: !props.previousMonth, onClick: props.onPreviousClick, children: dir === 'rtl' ? (jsx(IconRightComponent, { className: classNames.nav_icon, style: styles.nav_icon })) : (jsx(IconLeftComponent, { className: classNames.nav_icon, style: styles.nav_icon })) })), !props.hideNext && (jsx(Button, { name: \"next-month\", \"aria-label\": nextLabel, className: nextClassName, style: styles.nav_button_next, disabled: !props.nextMonth, onClick: props.onNextClick, children: dir === 'rtl' ? (jsx(IconLeftComponent, { className: classNames.nav_icon, style: styles.nav_icon })) : (jsx(IconRightComponent, { className: classNames.nav_icon, style: styles.nav_icon })) }))] }));\n}\n\n/**\n * Render a caption with a button-based navigation.\n */\nfunction CaptionNavigation(props) {\n var numberOfMonths = useDayPicker().numberOfMonths;\n var _a = useNavigation(), previousMonth = _a.previousMonth, nextMonth = _a.nextMonth, goToMonth = _a.goToMonth, displayMonths = _a.displayMonths;\n var displayIndex = displayMonths.findIndex(function (month) {\n return isSameMonth(props.displayMonth, month);\n });\n var isFirst = displayIndex === 0;\n var isLast = displayIndex === displayMonths.length - 1;\n var hideNext = numberOfMonths > 1 && (isFirst || !isLast);\n var hidePrevious = numberOfMonths > 1 && (isLast || !isFirst);\n var handlePreviousClick = function () {\n if (!previousMonth)\n return;\n goToMonth(previousMonth);\n };\n var handleNextClick = function () {\n if (!nextMonth)\n return;\n goToMonth(nextMonth);\n };\n return (jsx(Navigation, { displayMonth: props.displayMonth, hideNext: hideNext, hidePrevious: hidePrevious, nextMonth: nextMonth, previousMonth: previousMonth, onPreviousClick: handlePreviousClick, onNextClick: handleNextClick }));\n}\n\n/**\n * Render the caption of a month. The caption has a different layout when\n * setting the {@link DayPickerBase.captionLayout} prop.\n */\nfunction Caption(props) {\n var _a;\n var _b = useDayPicker(), classNames = _b.classNames, disableNavigation = _b.disableNavigation, styles = _b.styles, captionLayout = _b.captionLayout, components = _b.components;\n var CaptionLabelComponent = (_a = components === null || components === void 0 ? void 0 : components.CaptionLabel) !== null && _a !== void 0 ? _a : CaptionLabel;\n var caption;\n if (disableNavigation) {\n caption = (jsx(CaptionLabelComponent, { id: props.id, displayMonth: props.displayMonth }));\n }\n else if (captionLayout === 'dropdown') {\n caption = (jsx(CaptionDropdowns, { displayMonth: props.displayMonth, id: props.id }));\n }\n else if (captionLayout === 'dropdown-buttons') {\n caption = (jsxs(Fragment, { children: [jsx(CaptionDropdowns, { displayMonth: props.displayMonth, displayIndex: props.displayIndex, id: props.id }), jsx(CaptionNavigation, { displayMonth: props.displayMonth, displayIndex: props.displayIndex, id: props.id })] }));\n }\n else {\n caption = (jsxs(Fragment, { children: [jsx(CaptionLabelComponent, { id: props.id, displayMonth: props.displayMonth, displayIndex: props.displayIndex }), jsx(CaptionNavigation, { displayMonth: props.displayMonth, id: props.id })] }));\n }\n return (jsx(\"div\", { className: classNames.caption, style: styles.caption, children: caption }));\n}\n\n/** Render the Footer component (empty as default).*/\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction Footer(props) {\n var _a = useDayPicker(), footer = _a.footer, styles = _a.styles, tfoot = _a.classNames.tfoot;\n if (!footer)\n return jsx(Fragment, {});\n return (jsx(\"tfoot\", { className: tfoot, style: styles.tfoot, children: jsx(\"tr\", { children: jsx(\"td\", { colSpan: 8, children: footer }) }) }));\n}\n\n/**\n * Generate a series of 7 days, starting from the week, to use for formatting\n * the weekday names (Monday, Tuesday, etc.).\n */\nfunction getWeekdays(locale, \n/** The index of the first day of the week (0 - Sunday). */\nweekStartsOn, \n/** Use ISOWeek instead of locale/ */\nISOWeek) {\n var start = ISOWeek\n ? startOfISOWeek(new Date())\n : startOfWeek(new Date(), { locale: locale, weekStartsOn: weekStartsOn });\n var days = [];\n for (var i = 0; i < 7; i++) {\n var day = addDays(start, i);\n days.push(day);\n }\n return days;\n}\n\n/**\n * Render the HeadRow component - i.e. the table head row with the weekday names.\n */\nfunction HeadRow() {\n var _a = useDayPicker(), classNames = _a.classNames, styles = _a.styles, showWeekNumber = _a.showWeekNumber, locale = _a.locale, weekStartsOn = _a.weekStartsOn, ISOWeek = _a.ISOWeek, formatWeekdayName = _a.formatters.formatWeekdayName, labelWeekday = _a.labels.labelWeekday;\n var weekdays = getWeekdays(locale, weekStartsOn, ISOWeek);\n return (jsxs(\"tr\", { style: styles.head_row, className: classNames.head_row, children: [showWeekNumber && (jsx(\"td\", { style: styles.head_cell, className: classNames.head_cell })), weekdays.map(function (weekday, i) { return (jsx(\"th\", { scope: \"col\", className: classNames.head_cell, style: styles.head_cell, \"aria-label\": labelWeekday(weekday, { locale: locale }), children: formatWeekdayName(weekday, { locale: locale }) }, i)); })] }));\n}\n\n/** Render the table head. */\nfunction Head() {\n var _a;\n var _b = useDayPicker(), classNames = _b.classNames, styles = _b.styles, components = _b.components;\n var HeadRowComponent = (_a = components === null || components === void 0 ? void 0 : components.HeadRow) !== null && _a !== void 0 ? _a : HeadRow;\n return (jsx(\"thead\", { style: styles.head, className: classNames.head, children: jsx(HeadRowComponent, {}) }));\n}\n\n/** Render the content of the day cell. */\nfunction DayContent(props) {\n var _a = useDayPicker(), locale = _a.locale, formatDay = _a.formatters.formatDay;\n return jsx(Fragment, { children: formatDay(props.date, { locale: locale }) });\n}\n\n/**\n * The SelectMultiple context shares details about the selected days when in\n * multiple selection mode.\n *\n * Access this context from the {@link useSelectMultiple} hook.\n */\nvar SelectMultipleContext = createContext(undefined);\n/** Provides the values for the {@link SelectMultipleContext}. */\nfunction SelectMultipleProvider(props) {\n if (!isDayPickerMultiple(props.initialProps)) {\n var emptyContextValue = {\n selected: undefined,\n modifiers: {\n disabled: []\n }\n };\n return (jsx(SelectMultipleContext.Provider, { value: emptyContextValue, children: props.children }));\n }\n return (jsx(SelectMultipleProviderInternal, { initialProps: props.initialProps, children: props.children }));\n}\nfunction SelectMultipleProviderInternal(_a) {\n var initialProps = _a.initialProps, children = _a.children;\n var selected = initialProps.selected, min = initialProps.min, max = initialProps.max;\n var onDayClick = function (day, activeModifiers, e) {\n var _a, _b;\n (_a = initialProps.onDayClick) === null || _a === void 0 ? void 0 : _a.call(initialProps, day, activeModifiers, e);\n var isMinSelected = Boolean(activeModifiers.selected && min && (selected === null || selected === void 0 ? void 0 : selected.length) === min);\n if (isMinSelected) {\n return;\n }\n var isMaxSelected = Boolean(!activeModifiers.selected && max && (selected === null || selected === void 0 ? void 0 : selected.length) === max);\n if (isMaxSelected) {\n return;\n }\n var selectedDays = selected ? __spreadArray([], selected, true) : [];\n if (activeModifiers.selected) {\n var index = selectedDays.findIndex(function (selectedDay) {\n return isSameDay(day, selectedDay);\n });\n selectedDays.splice(index, 1);\n }\n else {\n selectedDays.push(day);\n }\n (_b = initialProps.onSelect) === null || _b === void 0 ? void 0 : _b.call(initialProps, selectedDays, day, activeModifiers, e);\n };\n var modifiers = {\n disabled: []\n };\n if (selected) {\n modifiers.disabled.push(function (day) {\n var isMaxSelected = max && selected.length > max - 1;\n var isSelected = selected.some(function (selectedDay) {\n return isSameDay(selectedDay, day);\n });\n return Boolean(isMaxSelected && !isSelected);\n });\n }\n var contextValue = {\n selected: selected,\n onDayClick: onDayClick,\n modifiers: modifiers\n };\n return (jsx(SelectMultipleContext.Provider, { value: contextValue, children: children }));\n}\n/**\n * Hook to access the {@link SelectMultipleContextValue}.\n *\n * This hook is meant to be used inside internal or custom components.\n */\nfunction useSelectMultiple() {\n var context = useContext(SelectMultipleContext);\n if (!context) {\n throw new Error('useSelectMultiple must be used within a SelectMultipleProvider');\n }\n return context;\n}\n\n/**\n * Add a day to an existing range.\n *\n * The returned range takes in account the `undefined` values and if the added\n * day is already present in the range.\n */\nfunction addToRange(day, range) {\n var _a = range || {}, from = _a.from, to = _a.to;\n if (from && to) {\n if (isSameDay(to, day) && isSameDay(from, day)) {\n return undefined;\n }\n if (isSameDay(to, day)) {\n return { from: to, to: undefined };\n }\n if (isSameDay(from, day)) {\n return undefined;\n }\n if (isAfter(from, day)) {\n return { from: day, to: to };\n }\n return { from: from, to: day };\n }\n if (to) {\n if (isAfter(day, to)) {\n return { from: to, to: day };\n }\n return { from: day, to: to };\n }\n if (from) {\n if (isBefore(day, from)) {\n return { from: day, to: from };\n }\n return { from: from, to: day };\n }\n return { from: day, to: undefined };\n}\n\n/**\n * The SelectRange context shares details about the selected days when in\n * range selection mode.\n *\n * Access this context from the {@link useSelectRange} hook.\n */\nvar SelectRangeContext = createContext(undefined);\n/** Provides the values for the {@link SelectRangeProvider}. */\nfunction SelectRangeProvider(props) {\n if (!isDayPickerRange(props.initialProps)) {\n var emptyContextValue = {\n selected: undefined,\n modifiers: {\n range_start: [],\n range_end: [],\n range_middle: [],\n disabled: []\n }\n };\n return (jsx(SelectRangeContext.Provider, { value: emptyContextValue, children: props.children }));\n }\n return (jsx(SelectRangeProviderInternal, { initialProps: props.initialProps, children: props.children }));\n}\nfunction SelectRangeProviderInternal(_a) {\n var initialProps = _a.initialProps, children = _a.children;\n var selected = initialProps.selected;\n var _b = selected || {}, selectedFrom = _b.from, selectedTo = _b.to;\n var min = initialProps.min;\n var max = initialProps.max;\n var onDayClick = function (day, activeModifiers, e) {\n var _a, _b;\n (_a = initialProps.onDayClick) === null || _a === void 0 ? void 0 : _a.call(initialProps, day, activeModifiers, e);\n var newRange = addToRange(day, selected);\n (_b = initialProps.onSelect) === null || _b === void 0 ? void 0 : _b.call(initialProps, newRange, day, activeModifiers, e);\n };\n var modifiers = {\n range_start: [],\n range_end: [],\n range_middle: [],\n disabled: []\n };\n if (selectedFrom) {\n modifiers.range_start = [selectedFrom];\n if (!selectedTo) {\n modifiers.range_end = [selectedFrom];\n }\n else {\n modifiers.range_end = [selectedTo];\n if (!isSameDay(selectedFrom, selectedTo)) {\n modifiers.range_middle = [\n {\n after: selectedFrom,\n before: selectedTo\n }\n ];\n }\n }\n }\n else if (selectedTo) {\n modifiers.range_start = [selectedTo];\n modifiers.range_end = [selectedTo];\n }\n if (min) {\n if (selectedFrom && !selectedTo) {\n modifiers.disabled.push({\n after: subDays(selectedFrom, min - 1),\n before: addDays(selectedFrom, min - 1)\n });\n }\n if (selectedFrom && selectedTo) {\n modifiers.disabled.push({\n after: selectedFrom,\n before: addDays(selectedFrom, min - 1)\n });\n }\n if (!selectedFrom && selectedTo) {\n modifiers.disabled.push({\n after: subDays(selectedTo, min - 1),\n before: addDays(selectedTo, min - 1)\n });\n }\n }\n if (max) {\n if (selectedFrom && !selectedTo) {\n modifiers.disabled.push({\n before: addDays(selectedFrom, -max + 1)\n });\n modifiers.disabled.push({\n after: addDays(selectedFrom, max - 1)\n });\n }\n if (selectedFrom && selectedTo) {\n var selectedCount = differenceInCalendarDays(selectedTo, selectedFrom) + 1;\n var offset = max - selectedCount;\n modifiers.disabled.push({\n before: subDays(selectedFrom, offset)\n });\n modifiers.disabled.push({\n after: addDays(selectedTo, offset)\n });\n }\n if (!selectedFrom && selectedTo) {\n modifiers.disabled.push({\n before: addDays(selectedTo, -max + 1)\n });\n modifiers.disabled.push({\n after: addDays(selectedTo, max - 1)\n });\n }\n }\n return (jsx(SelectRangeContext.Provider, { value: { selected: selected, onDayClick: onDayClick, modifiers: modifiers }, children: children }));\n}\n/**\n * Hook to access the {@link SelectRangeContextValue}.\n *\n * This hook is meant to be used inside internal or custom components.\n */\nfunction useSelectRange() {\n var context = useContext(SelectRangeContext);\n if (!context) {\n throw new Error('useSelectRange must be used within a SelectRangeProvider');\n }\n return context;\n}\n\n/** Normalize to array a matcher input. */\nfunction matcherToArray(matcher) {\n if (Array.isArray(matcher)) {\n return __spreadArray([], matcher, true);\n }\n else if (matcher !== undefined) {\n return [matcher];\n }\n else {\n return [];\n }\n}\n\n/** Create CustomModifiers from dayModifiers */\nfunction getCustomModifiers(dayModifiers) {\n var customModifiers = {};\n Object.entries(dayModifiers).forEach(function (_a) {\n var modifier = _a[0], matcher = _a[1];\n customModifiers[modifier] = matcherToArray(matcher);\n });\n return customModifiers;\n}\n\n/** The name of the modifiers that are used internally by DayPicker. */\nvar InternalModifier;\n(function (InternalModifier) {\n InternalModifier[\"Outside\"] = \"outside\";\n /** Name of the modifier applied to the disabled days, using the `disabled` prop. */\n InternalModifier[\"Disabled\"] = \"disabled\";\n /** Name of the modifier applied to the selected days using the `selected` prop). */\n InternalModifier[\"Selected\"] = \"selected\";\n /** Name of the modifier applied to the hidden days using the `hidden` prop). */\n InternalModifier[\"Hidden\"] = \"hidden\";\n /** Name of the modifier applied to the day specified using the `today` prop). */\n InternalModifier[\"Today\"] = \"today\";\n /** The modifier applied to the day starting a selected range, when in range selection mode. */\n InternalModifier[\"RangeStart\"] = \"range_start\";\n /** The modifier applied to the day ending a selected range, when in range selection mode. */\n InternalModifier[\"RangeEnd\"] = \"range_end\";\n /** The modifier applied to the days between the start and the end of a selected range, when in range selection mode. */\n InternalModifier[\"RangeMiddle\"] = \"range_middle\";\n})(InternalModifier || (InternalModifier = {}));\n\nvar Selected = InternalModifier.Selected, Disabled = InternalModifier.Disabled, Hidden = InternalModifier.Hidden, Today = InternalModifier.Today, RangeEnd = InternalModifier.RangeEnd, RangeMiddle = InternalModifier.RangeMiddle, RangeStart = InternalModifier.RangeStart, Outside = InternalModifier.Outside;\n/** Return the {@link InternalModifiers} from the DayPicker and select contexts. */\nfunction getInternalModifiers(dayPicker, selectMultiple, selectRange) {\n var _a;\n var internalModifiers = (_a = {},\n _a[Selected] = matcherToArray(dayPicker.selected),\n _a[Disabled] = matcherToArray(dayPicker.disabled),\n _a[Hidden] = matcherToArray(dayPicker.hidden),\n _a[Today] = [dayPicker.today],\n _a[RangeEnd] = [],\n _a[RangeMiddle] = [],\n _a[RangeStart] = [],\n _a[Outside] = [],\n _a);\n if (dayPicker.fromDate) {\n internalModifiers[Disabled].push({ before: dayPicker.fromDate });\n }\n if (dayPicker.toDate) {\n internalModifiers[Disabled].push({ after: dayPicker.toDate });\n }\n if (isDayPickerMultiple(dayPicker)) {\n internalModifiers[Disabled] = internalModifiers[Disabled].concat(selectMultiple.modifiers[Disabled]);\n }\n else if (isDayPickerRange(dayPicker)) {\n internalModifiers[Disabled] = internalModifiers[Disabled].concat(selectRange.modifiers[Disabled]);\n internalModifiers[RangeStart] = selectRange.modifiers[RangeStart];\n internalModifiers[RangeMiddle] = selectRange.modifiers[RangeMiddle];\n internalModifiers[RangeEnd] = selectRange.modifiers[RangeEnd];\n }\n return internalModifiers;\n}\n\n/** The Modifiers context store the modifiers used in DayPicker. To access the value of this context, use {@link useModifiers}. */\nvar ModifiersContext = createContext(undefined);\n/** Provide the value for the {@link ModifiersContext}. */\nfunction ModifiersProvider(props) {\n var dayPicker = useDayPicker();\n var selectMultiple = useSelectMultiple();\n var selectRange = useSelectRange();\n var internalModifiers = getInternalModifiers(dayPicker, selectMultiple, selectRange);\n var customModifiers = getCustomModifiers(dayPicker.modifiers);\n var modifiers = __assign(__assign({}, internalModifiers), customModifiers);\n return (jsx(ModifiersContext.Provider, { value: modifiers, children: props.children }));\n}\n/**\n * Return the modifiers used by DayPicker.\n *\n * This hook is meant to be used inside internal or custom components.\n * Requires to be wrapped into {@link ModifiersProvider}.\n *\n */\nfunction useModifiers() {\n var context = useContext(ModifiersContext);\n if (!context) {\n throw new Error('useModifiers must be used within a ModifiersProvider');\n }\n return context;\n}\n\n/** Returns true if `matcher` is of type {@link DateInterval}. */\nfunction isDateInterval(matcher) {\n return Boolean(matcher &&\n typeof matcher === 'object' &&\n 'before' in matcher &&\n 'after' in matcher);\n}\n/** Returns true if `value` is a {@link DateRange} type. */\nfunction isDateRange(value) {\n return Boolean(value && typeof value === 'object' && 'from' in value);\n}\n/** Returns true if `value` is of type {@link DateAfter}. */\nfunction isDateAfterType(value) {\n return Boolean(value && typeof value === 'object' && 'after' in value);\n}\n/** Returns true if `value` is of type {@link DateBefore}. */\nfunction isDateBeforeType(value) {\n return Boolean(value && typeof value === 'object' && 'before' in value);\n}\n/** Returns true if `value` is a {@link DayOfWeek} type. */\nfunction isDayOfWeekType(value) {\n return Boolean(value && typeof value === 'object' && 'dayOfWeek' in value);\n}\n\n/** Return `true` whether `date` is inside `range`. */\nfunction isDateInRange(date, range) {\n var _a;\n var from = range.from, to = range.to;\n if (from && to) {\n var isRangeInverted = differenceInCalendarDays(to, from) < 0;\n if (isRangeInverted) {\n _a = [to, from], from = _a[0], to = _a[1];\n }\n var isInRange = differenceInCalendarDays(date, from) >= 0 &&\n differenceInCalendarDays(to, date) >= 0;\n return isInRange;\n }\n if (to) {\n return isSameDay(to, date);\n }\n if (from) {\n return isSameDay(from, date);\n }\n return false;\n}\n\n/** Returns true if `value` is a Date type. */\nfunction isDateType(value) {\n return isDate(value);\n}\n/** Returns true if `value` is an array of valid dates. */\nfunction isArrayOfDates(value) {\n return Array.isArray(value) && value.every(isDate);\n}\n/**\n * Returns whether a day matches against at least one of the given Matchers.\n *\n * ```\n * const day = new Date(2022, 5, 19);\n * const matcher1: DateRange = {\n * from: new Date(2021, 12, 21),\n * to: new Date(2021, 12, 30)\n * }\n * const matcher2: DateRange = {\n * from: new Date(2022, 5, 1),\n * to: new Date(2022, 5, 23)\n * }\n *\n * const isMatch(day, [matcher1, matcher2]); // true, since day is in the matcher1 range.\n * ```\n * */\nfunction isMatch(day, matchers) {\n return matchers.some(function (matcher) {\n if (typeof matcher === 'boolean') {\n return matcher;\n }\n if (isDateType(matcher)) {\n return isSameDay(day, matcher);\n }\n if (isArrayOfDates(matcher)) {\n return matcher.includes(day);\n }\n if (isDateRange(matcher)) {\n return isDateInRange(day, matcher);\n }\n if (isDayOfWeekType(matcher)) {\n return matcher.dayOfWeek.includes(day.getDay());\n }\n if (isDateInterval(matcher)) {\n var diffBefore = differenceInCalendarDays(matcher.before, day);\n var diffAfter = differenceInCalendarDays(matcher.after, day);\n var isDayBefore = diffBefore > 0;\n var isDayAfter = diffAfter < 0;\n var isClosedInterval = isAfter(matcher.before, matcher.after);\n if (isClosedInterval) {\n return isDayAfter && isDayBefore;\n }\n else {\n return isDayBefore || isDayAfter;\n }\n }\n if (isDateAfterType(matcher)) {\n return differenceInCalendarDays(day, matcher.after) > 0;\n }\n if (isDateBeforeType(matcher)) {\n return differenceInCalendarDays(matcher.before, day) > 0;\n }\n if (typeof matcher === 'function') {\n return matcher(day);\n }\n return false;\n });\n}\n\n/** Return the active modifiers for the given day. */\nfunction getActiveModifiers(day, \n/** The modifiers to match for the given date. */\nmodifiers, \n/** The month where the day is displayed, to add the \"outside\" modifiers. */\ndisplayMonth) {\n var matchedModifiers = Object.keys(modifiers).reduce(function (result, key) {\n var modifier = modifiers[key];\n if (isMatch(day, modifier)) {\n result.push(key);\n }\n return result;\n }, []);\n var activeModifiers = {};\n matchedModifiers.forEach(function (modifier) { return (activeModifiers[modifier] = true); });\n if (displayMonth && !isSameMonth(day, displayMonth)) {\n activeModifiers.outside = true;\n }\n return activeModifiers;\n}\n\n/**\n * Returns the day that should be the target of the focus when DayPicker is\n * rendered the first time.\n *\n * TODO: this function doesn't consider if the day is outside the month. We\n * implemented this check in `useDayRender` but it should probably go here. See\n * https://github.com/gpbl/react-day-picker/pull/1576\n */\nfunction getInitialFocusTarget(displayMonths, modifiers) {\n var firstDayInMonth = startOfMonth(displayMonths[0]);\n var lastDayInMonth = endOfMonth(displayMonths[displayMonths.length - 1]);\n // TODO: cleanup code\n var firstFocusableDay;\n var today;\n var date = firstDayInMonth;\n while (date <= lastDayInMonth) {\n var activeModifiers = getActiveModifiers(date, modifiers);\n var isFocusable = !activeModifiers.disabled && !activeModifiers.hidden;\n if (!isFocusable) {\n date = addDays(date, 1);\n continue;\n }\n if (activeModifiers.selected) {\n return date;\n }\n if (activeModifiers.today && !today) {\n today = date;\n }\n if (!firstFocusableDay) {\n firstFocusableDay = date;\n }\n date = addDays(date, 1);\n }\n if (today) {\n return today;\n }\n else {\n return firstFocusableDay;\n }\n}\n\nvar MAX_RETRY = 365;\n/** Return the next date to be focused. */\nfunction getNextFocus(focusedDay, options) {\n var moveBy = options.moveBy, direction = options.direction, context = options.context, modifiers = options.modifiers, _a = options.retry, retry = _a === void 0 ? { count: 0, lastFocused: focusedDay } : _a;\n var weekStartsOn = context.weekStartsOn, fromDate = context.fromDate, toDate = context.toDate, locale = context.locale;\n var moveFns = {\n day: addDays,\n week: addWeeks,\n month: addMonths,\n year: addYears,\n startOfWeek: function (date) {\n return context.ISOWeek\n ? startOfISOWeek(date)\n : startOfWeek(date, { locale: locale, weekStartsOn: weekStartsOn });\n },\n endOfWeek: function (date) {\n return context.ISOWeek\n ? endOfISOWeek(date)\n : endOfWeek(date, { locale: locale, weekStartsOn: weekStartsOn });\n }\n };\n var newFocusedDay = moveFns[moveBy](focusedDay, direction === 'after' ? 1 : -1);\n if (direction === 'before' && fromDate) {\n newFocusedDay = max([fromDate, newFocusedDay]);\n }\n else if (direction === 'after' && toDate) {\n newFocusedDay = min([toDate, newFocusedDay]);\n }\n var isFocusable = true;\n if (modifiers) {\n var activeModifiers = getActiveModifiers(newFocusedDay, modifiers);\n isFocusable = !activeModifiers.disabled && !activeModifiers.hidden;\n }\n if (isFocusable) {\n return newFocusedDay;\n }\n else {\n if (retry.count > MAX_RETRY) {\n return retry.lastFocused;\n }\n return getNextFocus(newFocusedDay, {\n moveBy: moveBy,\n direction: direction,\n context: context,\n modifiers: modifiers,\n retry: __assign(__assign({}, retry), { count: retry.count + 1 })\n });\n }\n}\n\n/**\n * The Focus context shares details about the focused day for the keyboard\n *\n * Access this context from the {@link useFocusContext} hook.\n */\nvar FocusContext = createContext(undefined);\n/** The provider for the {@link FocusContext}. */\nfunction FocusProvider(props) {\n var navigation = useNavigation();\n var modifiers = useModifiers();\n var _a = useState(), focusedDay = _a[0], setFocusedDay = _a[1];\n var _b = useState(), lastFocused = _b[0], setLastFocused = _b[1];\n var initialFocusTarget = getInitialFocusTarget(navigation.displayMonths, modifiers);\n // TODO: cleanup and test obscure code below\n var focusTarget = (focusedDay !== null && focusedDay !== void 0 ? focusedDay : (lastFocused && navigation.isDateDisplayed(lastFocused)))\n ? lastFocused\n : initialFocusTarget;\n var blur = function () {\n setLastFocused(focusedDay);\n setFocusedDay(undefined);\n };\n var focus = function (date) {\n setFocusedDay(date);\n };\n var context = useDayPicker();\n var moveFocus = function (moveBy, direction) {\n if (!focusedDay)\n return;\n var nextFocused = getNextFocus(focusedDay, {\n moveBy: moveBy,\n direction: direction,\n context: context,\n modifiers: modifiers\n });\n if (isSameDay(focusedDay, nextFocused))\n return undefined;\n navigation.goToDate(nextFocused, focusedDay);\n focus(nextFocused);\n };\n var value = {\n focusedDay: focusedDay,\n focusTarget: focusTarget,\n blur: blur,\n focus: focus,\n focusDayAfter: function () { return moveFocus('day', 'after'); },\n focusDayBefore: function () { return moveFocus('day', 'before'); },\n focusWeekAfter: function () { return moveFocus('week', 'after'); },\n focusWeekBefore: function () { return moveFocus('week', 'before'); },\n focusMonthBefore: function () { return moveFocus('month', 'before'); },\n focusMonthAfter: function () { return moveFocus('month', 'after'); },\n focusYearBefore: function () { return moveFocus('year', 'before'); },\n focusYearAfter: function () { return moveFocus('year', 'after'); },\n focusStartOfWeek: function () { return moveFocus('startOfWeek', 'before'); },\n focusEndOfWeek: function () { return moveFocus('endOfWeek', 'after'); }\n };\n return (jsx(FocusContext.Provider, { value: value, children: props.children }));\n}\n/**\n * Hook to access the {@link FocusContextValue}. Use this hook to handle the\n * focus state of the elements.\n *\n * This hook is meant to be used inside internal or custom components.\n */\nfunction useFocusContext() {\n var context = useContext(FocusContext);\n if (!context) {\n throw new Error('useFocusContext must be used within a FocusProvider');\n }\n return context;\n}\n\n/**\n * Return the active modifiers for the specified day.\n *\n * This hook is meant to be used inside internal or custom components.\n *\n * @param day\n * @param displayMonth\n */\nfunction useActiveModifiers(day, \n/**\n * The month where the date is displayed. If not the same as `date`, the day\n * is an \"outside day\".\n */\ndisplayMonth) {\n var modifiers = useModifiers();\n var activeModifiers = getActiveModifiers(day, modifiers, displayMonth);\n return activeModifiers;\n}\n\n/**\n * The SelectSingle context shares details about the selected days when in\n * single selection mode.\n *\n * Access this context from the {@link useSelectSingle} hook.\n */\nvar SelectSingleContext = createContext(undefined);\n/** Provides the values for the {@link SelectSingleProvider}. */\nfunction SelectSingleProvider(props) {\n if (!isDayPickerSingle(props.initialProps)) {\n var emptyContextValue = {\n selected: undefined\n };\n return (jsx(SelectSingleContext.Provider, { value: emptyContextValue, children: props.children }));\n }\n return (jsx(SelectSingleProviderInternal, { initialProps: props.initialProps, children: props.children }));\n}\nfunction SelectSingleProviderInternal(_a) {\n var initialProps = _a.initialProps, children = _a.children;\n var onDayClick = function (day, activeModifiers, e) {\n var _a, _b, _c;\n (_a = initialProps.onDayClick) === null || _a === void 0 ? void 0 : _a.call(initialProps, day, activeModifiers, e);\n if (activeModifiers.selected && !initialProps.required) {\n (_b = initialProps.onSelect) === null || _b === void 0 ? void 0 : _b.call(initialProps, undefined, day, activeModifiers, e);\n return;\n }\n (_c = initialProps.onSelect) === null || _c === void 0 ? void 0 : _c.call(initialProps, day, day, activeModifiers, e);\n };\n var contextValue = {\n selected: initialProps.selected,\n onDayClick: onDayClick\n };\n return (jsx(SelectSingleContext.Provider, { value: contextValue, children: children }));\n}\n/**\n * Hook to access the {@link SelectSingleContextValue}.\n *\n * This hook is meant to be used inside internal or custom components.\n */\nfunction useSelectSingle() {\n var context = useContext(SelectSingleContext);\n if (!context) {\n throw new Error('useSelectSingle must be used within a SelectSingleProvider');\n }\n return context;\n}\n\n/**\n * This hook returns details about the content to render in the day cell.\n *\n *\n * When a day cell is rendered in the table, DayPicker can either:\n *\n * - render nothing: when the day is outside the month or has matched the\n * \"hidden\" modifier.\n * - render a button when `onDayClick` or a selection mode is set.\n * - render a non-interactive element: when no selection mode is set, the day\n * cell shouldn’t respond to any interaction. DayPicker should render a `div`\n * or a `span`.\n *\n * ### Usage\n *\n * Use this hook to customize the behavior of the {@link Day} component. Create a\n * new `Day` component using this hook and pass it to the `components` prop.\n * The source of {@link Day} can be a good starting point.\n *\n */\nfunction useDayEventHandlers(date, activeModifiers) {\n var dayPicker = useDayPicker();\n var single = useSelectSingle();\n var multiple = useSelectMultiple();\n var range = useSelectRange();\n var _a = useFocusContext(), focusDayAfter = _a.focusDayAfter, focusDayBefore = _a.focusDayBefore, focusWeekAfter = _a.focusWeekAfter, focusWeekBefore = _a.focusWeekBefore, blur = _a.blur, focus = _a.focus, focusMonthBefore = _a.focusMonthBefore, focusMonthAfter = _a.focusMonthAfter, focusYearBefore = _a.focusYearBefore, focusYearAfter = _a.focusYearAfter, focusStartOfWeek = _a.focusStartOfWeek, focusEndOfWeek = _a.focusEndOfWeek;\n var onClick = function (e) {\n var _a, _b, _c, _d;\n if (isDayPickerSingle(dayPicker)) {\n (_a = single.onDayClick) === null || _a === void 0 ? void 0 : _a.call(single, date, activeModifiers, e);\n }\n else if (isDayPickerMultiple(dayPicker)) {\n (_b = multiple.onDayClick) === null || _b === void 0 ? void 0 : _b.call(multiple, date, activeModifiers, e);\n }\n else if (isDayPickerRange(dayPicker)) {\n (_c = range.onDayClick) === null || _c === void 0 ? void 0 : _c.call(range, date, activeModifiers, e);\n }\n else {\n (_d = dayPicker.onDayClick) === null || _d === void 0 ? void 0 : _d.call(dayPicker, date, activeModifiers, e);\n }\n };\n var onFocus = function (e) {\n var _a;\n focus(date);\n (_a = dayPicker.onDayFocus) === null || _a === void 0 ? void 0 : _a.call(dayPicker, date, activeModifiers, e);\n };\n var onBlur = function (e) {\n var _a;\n blur();\n (_a = dayPicker.onDayBlur) === null || _a === void 0 ? void 0 : _a.call(dayPicker, date, activeModifiers, e);\n };\n var onMouseEnter = function (e) {\n var _a;\n (_a = dayPicker.onDayMouseEnter) === null || _a === void 0 ? void 0 : _a.call(dayPicker, date, activeModifiers, e);\n };\n var onMouseLeave = function (e) {\n var _a;\n (_a = dayPicker.onDayMouseLeave) === null || _a === void 0 ? void 0 : _a.call(dayPicker, date, activeModifiers, e);\n };\n var onPointerEnter = function (e) {\n var _a;\n (_a = dayPicker.onDayPointerEnter) === null || _a === void 0 ? void 0 : _a.call(dayPicker, date, activeModifiers, e);\n };\n var onPointerLeave = function (e) {\n var _a;\n (_a = dayPicker.onDayPointerLeave) === null || _a === void 0 ? void 0 : _a.call(dayPicker, date, activeModifiers, e);\n };\n var onTouchCancel = function (e) {\n var _a;\n (_a = dayPicker.onDayTouchCancel) === null || _a === void 0 ? void 0 : _a.call(dayPicker, date, activeModifiers, e);\n };\n var onTouchEnd = function (e) {\n var _a;\n (_a = dayPicker.onDayTouchEnd) === null || _a === void 0 ? void 0 : _a.call(dayPicker, date, activeModifiers, e);\n };\n var onTouchMove = function (e) {\n var _a;\n (_a = dayPicker.onDayTouchMove) === null || _a === void 0 ? void 0 : _a.call(dayPicker, date, activeModifiers, e);\n };\n var onTouchStart = function (e) {\n var _a;\n (_a = dayPicker.onDayTouchStart) === null || _a === void 0 ? void 0 : _a.call(dayPicker, date, activeModifiers, e);\n };\n var onKeyUp = function (e) {\n var _a;\n (_a = dayPicker.onDayKeyUp) === null || _a === void 0 ? void 0 : _a.call(dayPicker, date, activeModifiers, e);\n };\n var onKeyDown = function (e) {\n var _a;\n switch (e.key) {\n case 'ArrowLeft':\n e.preventDefault();\n e.stopPropagation();\n dayPicker.dir === 'rtl' ? focusDayAfter() : focusDayBefore();\n break;\n case 'ArrowRight':\n e.preventDefault();\n e.stopPropagation();\n dayPicker.dir === 'rtl' ? focusDayBefore() : focusDayAfter();\n break;\n case 'ArrowDown':\n e.preventDefault();\n e.stopPropagation();\n focusWeekAfter();\n break;\n case 'ArrowUp':\n e.preventDefault();\n e.stopPropagation();\n focusWeekBefore();\n break;\n case 'PageUp':\n e.preventDefault();\n e.stopPropagation();\n e.shiftKey ? focusYearBefore() : focusMonthBefore();\n break;\n case 'PageDown':\n e.preventDefault();\n e.stopPropagation();\n e.shiftKey ? focusYearAfter() : focusMonthAfter();\n break;\n case 'Home':\n e.preventDefault();\n e.stopPropagation();\n focusStartOfWeek();\n break;\n case 'End':\n e.preventDefault();\n e.stopPropagation();\n focusEndOfWeek();\n break;\n }\n (_a = dayPicker.onDayKeyDown) === null || _a === void 0 ? void 0 : _a.call(dayPicker, date, activeModifiers, e);\n };\n var eventHandlers = {\n onClick: onClick,\n onFocus: onFocus,\n onBlur: onBlur,\n onKeyDown: onKeyDown,\n onKeyUp: onKeyUp,\n onMouseEnter: onMouseEnter,\n onMouseLeave: onMouseLeave,\n onPointerEnter: onPointerEnter,\n onPointerLeave: onPointerLeave,\n onTouchCancel: onTouchCancel,\n onTouchEnd: onTouchEnd,\n onTouchMove: onTouchMove,\n onTouchStart: onTouchStart\n };\n return eventHandlers;\n}\n\n/**\n * Return the current selected days when DayPicker is in selection mode. Days\n * selected by the custom selection mode are not returned.\n *\n * This hook is meant to be used inside internal or custom components.\n *\n */\nfunction useSelectedDays() {\n var dayPicker = useDayPicker();\n var single = useSelectSingle();\n var multiple = useSelectMultiple();\n var range = useSelectRange();\n var selectedDays = isDayPickerSingle(dayPicker)\n ? single.selected\n : isDayPickerMultiple(dayPicker)\n ? multiple.selected\n : isDayPickerRange(dayPicker)\n ? range.selected\n : undefined;\n return selectedDays;\n}\n\nfunction isInternalModifier(modifier) {\n return Object.values(InternalModifier).includes(modifier);\n}\n/**\n * Return the class names for the Day element, according to the given active\n * modifiers.\n *\n * Custom class names are set via `modifiersClassNames` or `classNames`,\n * where the first have the precedence.\n */\nfunction getDayClassNames(dayPicker, activeModifiers) {\n var classNames = [dayPicker.classNames.day];\n Object.keys(activeModifiers).forEach(function (modifier) {\n var customClassName = dayPicker.modifiersClassNames[modifier];\n if (customClassName) {\n classNames.push(customClassName);\n }\n else if (isInternalModifier(modifier)) {\n var internalClassName = dayPicker.classNames[\"day_\".concat(modifier)];\n if (internalClassName) {\n classNames.push(internalClassName);\n }\n }\n });\n return classNames;\n}\n\n/** Return the style for the Day element, according to the given active modifiers. */\nfunction getDayStyle(dayPicker, activeModifiers) {\n var style = __assign({}, dayPicker.styles.day);\n Object.keys(activeModifiers).forEach(function (modifier) {\n var _a;\n style = __assign(__assign({}, style), (_a = dayPicker.modifiersStyles) === null || _a === void 0 ? void 0 : _a[modifier]);\n });\n return style;\n}\n\n/**\n * Return props and data used to render the {@link Day} component.\n *\n * Use this hook when creating a component to replace the built-in `Day`\n * component.\n */\nfunction useDayRender(\n/** The date to render. */\nday, \n/** The month where the date is displayed (if not the same as `date`, it means it is an \"outside\" day). */\ndisplayMonth, \n/** A ref to the button element that will be target of focus when rendered (if required). */\nbuttonRef) {\n var _a;\n var _b, _c;\n var dayPicker = useDayPicker();\n var focusContext = useFocusContext();\n var activeModifiers = useActiveModifiers(day, displayMonth);\n var eventHandlers = useDayEventHandlers(day, activeModifiers);\n var selectedDays = useSelectedDays();\n var isButton = Boolean(dayPicker.onDayClick || dayPicker.mode !== 'default');\n // Focus the button if the day is focused according to the focus context\n useEffect(function () {\n var _a;\n if (activeModifiers.outside)\n return;\n if (!focusContext.focusedDay)\n return;\n if (!isButton)\n return;\n if (isSameDay(focusContext.focusedDay, day)) {\n (_a = buttonRef.current) === null || _a === void 0 ? void 0 : _a.focus();\n }\n }, [\n focusContext.focusedDay,\n day,\n buttonRef,\n isButton,\n activeModifiers.outside\n ]);\n var className = getDayClassNames(dayPicker, activeModifiers).join(' ');\n var style = getDayStyle(dayPicker, activeModifiers);\n var isHidden = Boolean((activeModifiers.outside && !dayPicker.showOutsideDays) ||\n activeModifiers.hidden);\n var DayContentComponent = (_c = (_b = dayPicker.components) === null || _b === void 0 ? void 0 : _b.DayContent) !== null && _c !== void 0 ? _c : DayContent;\n var children = (jsx(DayContentComponent, { date: day, displayMonth: displayMonth, activeModifiers: activeModifiers }));\n var divProps = {\n style: style,\n className: className,\n children: children,\n role: 'gridcell'\n };\n var isFocusTarget = focusContext.focusTarget &&\n isSameDay(focusContext.focusTarget, day) &&\n !activeModifiers.outside;\n var isFocused = focusContext.focusedDay && isSameDay(focusContext.focusedDay, day);\n var buttonProps = __assign(__assign(__assign({}, divProps), (_a = { disabled: activeModifiers.disabled, role: 'gridcell' }, _a['aria-selected'] = activeModifiers.selected, _a.tabIndex = isFocused || isFocusTarget ? 0 : -1, _a)), eventHandlers);\n var dayRender = {\n isButton: isButton,\n isHidden: isHidden,\n activeModifiers: activeModifiers,\n selectedDays: selectedDays,\n buttonProps: buttonProps,\n divProps: divProps\n };\n return dayRender;\n}\n\n/**\n * The content of a day cell – as a button or span element according to its\n * modifiers.\n */\nfunction Day(props) {\n var buttonRef = useRef(null);\n var dayRender = useDayRender(props.date, props.displayMonth, buttonRef);\n if (dayRender.isHidden) {\n return jsx(\"div\", { role: \"gridcell\" });\n }\n if (!dayRender.isButton) {\n return jsx(\"div\", __assign({}, dayRender.divProps));\n }\n return jsx(Button, __assign({ name: \"day\", ref: buttonRef }, dayRender.buttonProps));\n}\n\n/**\n * Render the week number element. If `onWeekNumberClick` is passed to DayPicker, it\n * renders a button, otherwise a span element.\n */\nfunction WeekNumber(props) {\n var weekNumber = props.number, dates = props.dates;\n var _a = useDayPicker(), onWeekNumberClick = _a.onWeekNumberClick, styles = _a.styles, classNames = _a.classNames, locale = _a.locale, labelWeekNumber = _a.labels.labelWeekNumber, formatWeekNumber = _a.formatters.formatWeekNumber;\n var content = formatWeekNumber(Number(weekNumber), { locale: locale });\n if (!onWeekNumberClick) {\n return (jsx(\"span\", { className: classNames.weeknumber, style: styles.weeknumber, children: content }));\n }\n var label = labelWeekNumber(Number(weekNumber), { locale: locale });\n var handleClick = function (e) {\n onWeekNumberClick(weekNumber, dates, e);\n };\n return (jsx(Button, { name: \"week-number\", \"aria-label\": label, className: classNames.weeknumber, style: styles.weeknumber, onClick: handleClick, children: content }));\n}\n\n/** Render a row in the calendar, with the days and the week number. */\nfunction Row(props) {\n var _a, _b;\n var _c = useDayPicker(), styles = _c.styles, classNames = _c.classNames, showWeekNumber = _c.showWeekNumber, components = _c.components;\n var DayComponent = (_a = components === null || components === void 0 ? void 0 : components.Day) !== null && _a !== void 0 ? _a : Day;\n var WeeknumberComponent = (_b = components === null || components === void 0 ? void 0 : components.WeekNumber) !== null && _b !== void 0 ? _b : WeekNumber;\n var weekNumberCell;\n if (showWeekNumber) {\n weekNumberCell = (jsx(\"td\", { className: classNames.cell, style: styles.cell, children: jsx(WeeknumberComponent, { number: props.weekNumber, dates: props.dates }) }));\n }\n return (jsxs(\"tr\", { className: classNames.row, style: styles.row, children: [weekNumberCell, props.dates.map(function (date) { return (jsx(\"td\", { className: classNames.cell, style: styles.cell, role: \"presentation\", children: jsx(DayComponent, { displayMonth: props.displayMonth, date: date }) }, getUnixTime(date))); })] }));\n}\n\n/** Return the weeks between two dates. */\nfunction daysToMonthWeeks(fromDate, toDate, options) {\n var toWeek = (options === null || options === void 0 ? void 0 : options.ISOWeek)\n ? endOfISOWeek(toDate)\n : endOfWeek(toDate, options);\n var fromWeek = (options === null || options === void 0 ? void 0 : options.ISOWeek)\n ? startOfISOWeek(fromDate)\n : startOfWeek(fromDate, options);\n var nOfDays = differenceInCalendarDays(toWeek, fromWeek);\n var days = [];\n for (var i = 0; i <= nOfDays; i++) {\n days.push(addDays(fromWeek, i));\n }\n var weeksInMonth = days.reduce(function (result, date) {\n var weekNumber = (options === null || options === void 0 ? void 0 : options.ISOWeek)\n ? getISOWeek(date)\n : getWeek(date, options);\n var existingWeek = result.find(function (value) { return value.weekNumber === weekNumber; });\n if (existingWeek) {\n existingWeek.dates.push(date);\n return result;\n }\n result.push({\n weekNumber: weekNumber,\n dates: [date]\n });\n return result;\n }, []);\n return weeksInMonth;\n}\n\n/**\n * Return the weeks belonging to the given month, adding the \"outside days\" to\n * the first and last week.\n */\nfunction getMonthWeeks(month, options) {\n var weeksInMonth = daysToMonthWeeks(startOfMonth(month), endOfMonth(month), options);\n if (options === null || options === void 0 ? void 0 : options.useFixedWeeks) {\n // Add extra weeks to the month, up to 6 weeks\n var nrOfMonthWeeks = getWeeksInMonth(month, options);\n if (nrOfMonthWeeks < 6) {\n var lastWeek = weeksInMonth[weeksInMonth.length - 1];\n var lastDate = lastWeek.dates[lastWeek.dates.length - 1];\n var toDate = addWeeks(lastDate, 6 - nrOfMonthWeeks);\n var extraWeeks = daysToMonthWeeks(addWeeks(lastDate, 1), toDate, options);\n weeksInMonth.push.apply(weeksInMonth, extraWeeks);\n }\n }\n return weeksInMonth;\n}\n\n/** Render the table with the calendar. */\nfunction Table(props) {\n var _a, _b, _c;\n var _d = useDayPicker(), locale = _d.locale, classNames = _d.classNames, styles = _d.styles, hideHead = _d.hideHead, fixedWeeks = _d.fixedWeeks, components = _d.components, weekStartsOn = _d.weekStartsOn, firstWeekContainsDate = _d.firstWeekContainsDate, ISOWeek = _d.ISOWeek;\n var weeks = getMonthWeeks(props.displayMonth, {\n useFixedWeeks: Boolean(fixedWeeks),\n ISOWeek: ISOWeek,\n locale: locale,\n weekStartsOn: weekStartsOn,\n firstWeekContainsDate: firstWeekContainsDate\n });\n var HeadComponent = (_a = components === null || components === void 0 ? void 0 : components.Head) !== null && _a !== void 0 ? _a : Head;\n var RowComponent = (_b = components === null || components === void 0 ? void 0 : components.Row) !== null && _b !== void 0 ? _b : Row;\n var FooterComponent = (_c = components === null || components === void 0 ? void 0 : components.Footer) !== null && _c !== void 0 ? _c : Footer;\n return (jsxs(\"table\", { id: props.id, className: classNames.table, style: styles.table, role: \"grid\", \"aria-labelledby\": props['aria-labelledby'], children: [!hideHead && jsx(HeadComponent, {}), jsx(\"tbody\", { className: classNames.tbody, style: styles.tbody, children: weeks.map(function (week) { return (jsx(RowComponent, { displayMonth: props.displayMonth, dates: week.dates, weekNumber: week.weekNumber }, week.weekNumber)); }) }), jsx(FooterComponent, { displayMonth: props.displayMonth })] }));\n}\n\n/*\nThe MIT License (MIT)\n\nCopyright (c) 2018-present, React Training LLC\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n*/\n/* eslint-disable prefer-const */\n/* eslint-disable @typescript-eslint/ban-ts-comment */\n/*\n * Welcome to @reach/auto-id!\n * Let's see if we can make sense of why this hook exists and its\n * implementation.\n *\n * Some background:\n * 1. Accessibility APIs rely heavily on element IDs\n * 2. Requiring developers to put IDs on every element in Reach UI is both\n * cumbersome and error-prone\n * 3. With a component model, we can generate IDs for them!\n *\n * Solution 1: Generate random IDs.\n *\n * This works great as long as you don't server render your app. When React (in\n * the client) tries to reuse the markup from the server, the IDs won't match\n * and React will then recreate the entire DOM tree.\n *\n * Solution 2: Increment an integer\n *\n * This sounds great. Since we're rendering the exact same tree on the server\n * and client, we can increment a counter and get a deterministic result between\n * client and server. Also, JS integers can go up to nine-quadrillion. I'm\n * pretty sure the tab will be closed before an app never needs\n * 10 quadrillion IDs!\n *\n * Problem solved, right?\n *\n * Ah, but there's a catch! React's concurrent rendering makes this approach\n * non-deterministic. While the client and server will end up with the same\n * elements in the end, depending on suspense boundaries (and possibly some user\n * input during the initial render) the incrementing integers won't always match\n * up.\n *\n * Solution 3: Don't use IDs at all on the server; patch after first render.\n *\n * What we've done here is solution 2 with some tricks. With this approach, the\n * ID returned is an empty string on the first render. This way the server and\n * client have the same markup no matter how wild the concurrent rendering may\n * have gotten.\n *\n * After the render, we patch up the components with an incremented ID. This\n * causes a double render on any components with `useId`. Shouldn't be a problem\n * since the components using this hook should be small, and we're only updating\n * the ID attribute on the DOM, nothing big is happening.\n *\n * It doesn't have to be an incremented number, though--we could do generate\n * random strings instead, but incrementing a number is probably the cheapest\n * thing we can do.\n *\n * Additionally, we only do this patchup on the very first client render ever.\n * Any calls to `useId` that happen dynamically in the client will be\n * populated immediately with a value. So, we only get the double render after\n * server hydration and never again, SO BACK OFF ALRIGHT?\n */\nfunction canUseDOM() {\n return !!(typeof window !== 'undefined' &&\n window.document &&\n window.document.createElement);\n}\n/**\n * React currently throws a warning when using useLayoutEffect on the server. To\n * get around it, we can conditionally useEffect on the server (no-op) and\n * useLayoutEffect in the browser. We occasionally need useLayoutEffect to\n * ensure we don't get a render flash for certain operations, but we may also\n * need affected components to render on the server. One example is when setting\n * a component's descendants to retrieve their index values.\n *\n * Important to note that using this hook as an escape hatch will break the\n * eslint dependency warnings unless you rename the import to `useLayoutEffect`.\n * Use sparingly only when the effect won't effect the rendered HTML to avoid\n * any server/client mismatch.\n *\n * If a useLayoutEffect is needed and the result would create a mismatch, it's\n * likely that the component in question shouldn't be rendered on the server at\n * all, so a better approach would be to lazily render those in a parent\n * component after client-side hydration.\n *\n * https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85\n * https://github.com/reduxjs/react-redux/blob/master/src/utils/useIsomorphicLayoutEffect.js\n *\n * @param effect\n * @param deps\n */\nvar useIsomorphicLayoutEffect = canUseDOM() ? useLayoutEffect : useEffect;\nvar serverHandoffComplete = false;\nvar id = 0;\nfunction genId() {\n return \"react-day-picker-\".concat(++id);\n}\nfunction useId(providedId) {\n // TODO: Remove error flag when updating internal deps to React 18. None of\n // our tricks will play well with concurrent rendering anyway.\n var _a;\n // If this instance isn't part of the initial render, we don't have to do the\n // double render/patch-up dance. We can just generate the ID and return it.\n var initialId = providedId !== null && providedId !== void 0 ? providedId : (serverHandoffComplete ? genId() : null);\n var _b = useState(initialId), id = _b[0], setId = _b[1];\n useIsomorphicLayoutEffect(function () {\n if (id === null) {\n // Patch the ID after render. We do this in `useLayoutEffect` to avoid any\n // rendering flicker, though it'll make the first render slower (unlikely\n // to matter, but you're welcome to measure your app and let us know if\n // it's a problem).\n setId(genId());\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n useEffect(function () {\n if (serverHandoffComplete === false) {\n // Flag all future uses of `useId` to skip the update dance. This is in\n // `useEffect` because it goes after `useLayoutEffect`, ensuring we don't\n // accidentally bail out of the patch-up dance prematurely.\n serverHandoffComplete = true;\n }\n }, []);\n return (_a = providedId !== null && providedId !== void 0 ? providedId : id) !== null && _a !== void 0 ? _a : undefined;\n}\n\n/** Render a month. */\nfunction Month(props) {\n var _a;\n var _b;\n var dayPicker = useDayPicker();\n var dir = dayPicker.dir, classNames = dayPicker.classNames, styles = dayPicker.styles, components = dayPicker.components;\n var displayMonths = useNavigation().displayMonths;\n var captionId = useId(dayPicker.id ? \"\".concat(dayPicker.id, \"-\").concat(props.displayIndex) : undefined);\n var tableId = dayPicker.id\n ? \"\".concat(dayPicker.id, \"-grid-\").concat(props.displayIndex)\n : undefined;\n var className = [classNames.month];\n var style = styles.month;\n var isStart = props.displayIndex === 0;\n var isEnd = props.displayIndex === displayMonths.length - 1;\n var isCenter = !isStart && !isEnd;\n if (dir === 'rtl') {\n _a = [isStart, isEnd], isEnd = _a[0], isStart = _a[1];\n }\n if (isStart) {\n className.push(classNames.caption_start);\n style = __assign(__assign({}, style), styles.caption_start);\n }\n if (isEnd) {\n className.push(classNames.caption_end);\n style = __assign(__assign({}, style), styles.caption_end);\n }\n if (isCenter) {\n className.push(classNames.caption_between);\n style = __assign(__assign({}, style), styles.caption_between);\n }\n var CaptionComponent = (_b = components === null || components === void 0 ? void 0 : components.Caption) !== null && _b !== void 0 ? _b : Caption;\n return (jsxs(\"div\", { className: className.join(' '), style: style, children: [jsx(CaptionComponent, { id: captionId, displayMonth: props.displayMonth, displayIndex: props.displayIndex }), jsx(Table, { id: tableId, \"aria-labelledby\": captionId, displayMonth: props.displayMonth })] }, props.displayIndex));\n}\n\n/**\n * Render the wrapper for the month grids.\n */\nfunction Months(props) {\n var _a = useDayPicker(), classNames = _a.classNames, styles = _a.styles;\n return (jsx(\"div\", { className: classNames.months, style: styles.months, children: props.children }));\n}\n\n/** Render the container with the months according to the number of months to display. */\nfunction Root(_a) {\n var _b, _c;\n var initialProps = _a.initialProps;\n var dayPicker = useDayPicker();\n var focusContext = useFocusContext();\n var navigation = useNavigation();\n var _d = useState(false), hasInitialFocus = _d[0], setHasInitialFocus = _d[1];\n // Focus the focus target when initialFocus is passed in\n useEffect(function () {\n if (!dayPicker.initialFocus)\n return;\n if (!focusContext.focusTarget)\n return;\n if (hasInitialFocus)\n return;\n focusContext.focus(focusContext.focusTarget);\n setHasInitialFocus(true);\n }, [\n dayPicker.initialFocus,\n hasInitialFocus,\n focusContext.focus,\n focusContext.focusTarget,\n focusContext\n ]);\n // Apply classnames according to props\n var classNames = [dayPicker.classNames.root, dayPicker.className];\n if (dayPicker.numberOfMonths > 1) {\n classNames.push(dayPicker.classNames.multiple_months);\n }\n if (dayPicker.showWeekNumber) {\n classNames.push(dayPicker.classNames.with_weeknumber);\n }\n var style = __assign(__assign({}, dayPicker.styles.root), dayPicker.style);\n var dataAttributes = Object.keys(initialProps)\n .filter(function (key) { return key.startsWith('data-'); })\n .reduce(function (attrs, key) {\n var _a;\n return __assign(__assign({}, attrs), (_a = {}, _a[key] = initialProps[key], _a));\n }, {});\n var MonthsComponent = (_c = (_b = initialProps.components) === null || _b === void 0 ? void 0 : _b.Months) !== null && _c !== void 0 ? _c : Months;\n return (jsx(\"div\", __assign({ className: classNames.join(' '), style: style, dir: dayPicker.dir, id: dayPicker.id, nonce: initialProps.nonce, title: initialProps.title, lang: initialProps.lang }, dataAttributes, { children: jsx(MonthsComponent, { children: navigation.displayMonths.map(function (month, i) { return (jsx(Month, { displayIndex: i, displayMonth: month }, i)); }) }) })));\n}\n\n/** Provide the value for all the context providers. */\nfunction RootProvider(props) {\n var children = props.children, initialProps = __rest(props, [\"children\"]);\n return (jsx(DayPickerProvider, { initialProps: initialProps, children: jsx(NavigationProvider, { children: jsx(SelectSingleProvider, { initialProps: initialProps, children: jsx(SelectMultipleProvider, { initialProps: initialProps, children: jsx(SelectRangeProvider, { initialProps: initialProps, children: jsx(ModifiersProvider, { children: jsx(FocusProvider, { children: children }) }) }) }) }) }) }));\n}\n\n/**\n * DayPicker render a date picker component to let users pick dates from a\n * calendar. See http://react-day-picker.js.org for updated documentation and\n * examples.\n *\n * ### Customization\n *\n * DayPicker offers different customization props. For example,\n *\n * - show multiple months using `numberOfMonths`\n * - display a dropdown to navigate the months via `captionLayout`\n * - display the week numbers with `showWeekNumbers`\n * - disable or hide days with `disabled` or `hidden`\n *\n * ### Controlling the months\n *\n * Change the initially displayed month using the `defaultMonth` prop. The\n * displayed months are controlled by DayPicker and stored in its internal\n * state. To control the months yourself, use `month` instead of `defaultMonth`\n * and use the `onMonthChange` event to set it.\n *\n * To limit the months the user can navigate to, use\n * `fromDate`/`fromMonth`/`fromYear` or `toDate`/`toMonth`/`toYear`.\n *\n * ### Selection modes\n *\n * DayPicker supports different selection mode that can be toggled using the\n * `mode` prop:\n *\n * - `mode=\"single\"`: only one day can be selected. Use `required` to make the\n * selection required. Use the `onSelect` event handler to get the selected\n * days.\n * - `mode=\"multiple\"`: users can select one or more days. Limit the amount of\n * days that can be selected with the `min` or the `max` props.\n * - `mode=\"range\"`: users can select a range of days. Limit the amount of days\n * in the range with the `min` or the `max` props.\n * - `mode=\"default\"` (default): the built-in selections are disabled. Implement\n * your own selection mode with `onDayClick`.\n *\n * The selection modes should cover the most common use cases. In case you\n * need a more refined way of selecting days, use `mode=\"default\"`. Use the\n * `selected` props and add the day event handlers to add/remove days from the\n * selection.\n *\n * ### Modifiers\n *\n * A _modifier_ represents different styles or states for the days displayed in\n * the calendar (like \"selected\" or \"disabled\"). Define custom modifiers using\n * the `modifiers` prop.\n *\n * ### Formatters and custom component\n *\n * You can customize how the content is displayed in the date picker by using\n * either the formatters or replacing the internal components.\n *\n * For the most common cases you want to use the `formatters` prop to change how\n * the content is formatted in the calendar. Use the `components` prop to\n * replace the internal components, like the navigation icons.\n *\n * ### Styling\n *\n * DayPicker comes with a default, basic style in `react-day-picker/style` – use\n * it as template for your own style.\n *\n * If you are using CSS modules, pass the imported styles object the\n * `classNames` props.\n *\n * You can also style the elements via inline styles using the `styles` prop.\n *\n * ### Form fields\n *\n * If you need to bind the date picker to a form field, you can use the\n * `useInput` hooks for a basic behavior. See the `useInput` source as an\n * example to bind the date picker with form fields.\n *\n * ### Localization\n *\n * To localize DayPicker, import the locale from `date-fns` package and use the\n * `locale` prop.\n *\n * For example, to use Spanish locale:\n *\n * ```\n * import { es } from 'date-fns/locale';\n * <DayPicker locale={es} />\n * ```\n */\nfunction DayPicker(props) {\n return (jsx(RootProvider, __assign({}, props, { children: jsx(Root, { initialProps: props }) })));\n}\n\n/** @private */\nfunction isValidDate(day) {\n return !isNaN(day.getTime());\n}\n\n/** Return props and setters for binding an input field to DayPicker. */\nfunction useInput(options) {\n if (options === void 0) { options = {}; }\n var _a = options.locale, locale = _a === void 0 ? enUS : _a, required = options.required, _b = options.format, format$1 = _b === void 0 ? 'PP' : _b, defaultSelected = options.defaultSelected, _c = options.today, today = _c === void 0 ? new Date() : _c;\n var _d = parseFromToProps(options), fromDate = _d.fromDate, toDate = _d.toDate;\n // Shortcut to the DateFns functions\n var parseValue = function (value) { return parse(value, format$1, today, { locale: locale }); };\n // Initialize states\n var _e = useState(defaultSelected !== null && defaultSelected !== void 0 ? defaultSelected : today), month = _e[0], setMonth = _e[1];\n var _f = useState(defaultSelected), selectedDay = _f[0], setSelectedDay = _f[1];\n var defaultInputValue = defaultSelected\n ? format(defaultSelected, format$1, { locale: locale })\n : '';\n var _g = useState(defaultInputValue), inputValue = _g[0], setInputValue = _g[1];\n var reset = function () {\n setSelectedDay(defaultSelected);\n setMonth(defaultSelected !== null && defaultSelected !== void 0 ? defaultSelected : today);\n setInputValue(defaultInputValue !== null && defaultInputValue !== void 0 ? defaultInputValue : '');\n };\n var setSelected = function (date) {\n setSelectedDay(date);\n setMonth(date !== null && date !== void 0 ? date : today);\n setInputValue(date ? format(date, format$1, { locale: locale }) : '');\n };\n var handleDayClick = function (day, _a) {\n var selected = _a.selected;\n if (!required && selected) {\n setSelectedDay(undefined);\n setInputValue('');\n return;\n }\n setSelectedDay(day);\n setInputValue(day ? format(day, format$1, { locale: locale }) : '');\n };\n var handleMonthChange = function (month) {\n setMonth(month);\n };\n // When changing the input field, save its value in state and check if the\n // string is a valid date. If it is a valid day, set it as selected and update\n // the calendar’s month.\n var handleChange = function (e) {\n setInputValue(e.target.value);\n var day = parseValue(e.target.value);\n var isBefore = fromDate && differenceInCalendarDays(fromDate, day) > 0;\n var isAfter = toDate && differenceInCalendarDays(day, toDate) > 0;\n if (!isValidDate(day) || isBefore || isAfter) {\n setSelectedDay(undefined);\n return;\n }\n setSelectedDay(day);\n setMonth(day);\n };\n // Special case for _required_ fields: on blur, if the value of the input is not\n // a valid date, reset the calendar and the input value.\n var handleBlur = function (e) {\n var day = parseValue(e.target.value);\n if (!isValidDate(day)) {\n reset();\n }\n };\n // When focusing, make sure DayPicker visualizes the month of the date in the\n // input field.\n var handleFocus = function (e) {\n if (!e.target.value) {\n reset();\n return;\n }\n var day = parseValue(e.target.value);\n if (isValidDate(day)) {\n setMonth(day);\n }\n };\n var dayPickerProps = {\n month: month,\n onDayClick: handleDayClick,\n onMonthChange: handleMonthChange,\n selected: selectedDay,\n locale: locale,\n fromDate: fromDate,\n toDate: toDate,\n today: today\n };\n var inputProps = {\n onBlur: handleBlur,\n onChange: handleChange,\n onFocus: handleFocus,\n value: inputValue,\n placeholder: format(new Date(), format$1, { locale: locale })\n };\n return { dayPickerProps: dayPickerProps, inputProps: inputProps, reset: reset, setSelected: setSelected };\n}\n\n/** Returns true when the props are of type {@link DayPickerDefaultProps}. */\nfunction isDayPickerDefault(props) {\n return props.mode === undefined || props.mode === 'default';\n}\n\nexport { Button, Caption, CaptionDropdowns, CaptionLabel, CaptionNavigation, Day, DayContent, DayPicker, DayPickerContext, DayPickerProvider, Dropdown, FocusContext, FocusProvider, Footer, Head, HeadRow, IconDropdown, IconLeft, IconRight, InternalModifier, Months, NavigationContext, NavigationProvider, RootProvider, Row, SelectMultipleContext, SelectMultipleProvider, SelectMultipleProviderInternal, SelectRangeContext, SelectRangeProvider, SelectRangeProviderInternal, SelectSingleContext, SelectSingleProvider, SelectSingleProviderInternal, WeekNumber, addToRange, isDateAfterType, isDateBeforeType, isDateInterval, isDateRange, isDayOfWeekType, isDayPickerDefault, isDayPickerMultiple, isDayPickerRange, isDayPickerSingle, isMatch, useActiveModifiers, useDayPicker, useDayRender, useFocusContext, useInput, useNavigation, useSelectMultiple, useSelectRange, useSelectSingle };\n//# sourceMappingURL=index.esm.js.map\n","import { CSSProperties } from 'react';\n\nimport { PopOverVariant } from '@helsenorge/designsystem-react/components/PopOver';\n\ntype HorizontalPosition = 'left' | 'right' | 'floating';\ntype BubblePosition = 'leftabove' | 'leftbelow' | 'rightabove' | 'rightbelow' | 'floatingabove' | 'floatingbelow';\n\n/** Bredde på hjelpeboble */\nconst BUBBLE_WIDTH_PX = 329;\n/** Hjelpeboblen skal holde avstand til venstre/høyre kant på vinduet */\nconst WINDOW_MARGIN_PX = 12;\n/** Vertikal avstand fra hjelpeboble til kontroller */\nconst BUBBLE_VERTICAL_OFFSET_PX = 26;\n/** Høyde/bredde på pil */\nconst ARROW_WIDTH_PX = 20;\n/** Avstand fra pil til hjelpeboble */\nconst ARROW_VERTICAL_OFFSET_PX = 9;\n/** Pilen skal holde avstand til venstre/høyre kant av hjelpeboblen */\nconst ARROW_HORIZONTAL_MARGIN_PX = 12;\n\n// @todo these functions are similar to the ones in utils in PopOver, should be moved to a shared location\n/**\n * Beregn om hjelpeboblen skal vises over eller under kontrolleren\n * @param controllerSize DOMRect for controlleren\n * @param bubbleSize DOMRect for hjelpeboblen\n * @param variant Ønsket plassering av hjelpeboblen (over/under/automatisk)\n * @returns Om hjelpeboblen skal vises over eller under\n */\nexport const getVerticalPosition = (\n controllerSize: DOMRect,\n bubbleSize: DOMRect,\n variant?: keyof typeof PopOverVariant\n): keyof typeof PopOverVariant => {\n if (variant !== PopOverVariant.positionautomatic && variant !== undefined) {\n return variant;\n }\n if (controllerSize.top > bubbleSize.height + BUBBLE_VERTICAL_OFFSET_PX) {\n return PopOverVariant.positionabove;\n } else {\n return PopOverVariant.positionbelow;\n }\n};\n\n/**\n * Finn horisontalt midtpunkt på kontrolleren i forhold til venstre kant av vinduet\n * @param controllerSize DOMRect for controlleren\n * @returns Horisontalt senter av controlleren i px\n */\nconst getControllerLeftEdgePx = (controllerSize: DOMRect): number => controllerSize.left + controllerSize.width / 4;\n\n/**\n * Finn horisontalt midtpunkt på kontrolleren i forhold til høyre kant av vinduet\n * @param controllerSize DOMRect for controlleren\n * @returns Horisontalt senter av controlleren i px\n */\nconst getControllerRightEdgePx = (controllerSize: DOMRect): number =>\n document.documentElement.clientWidth - controllerSize.right + controllerSize.width / 4;\n\n/**\n * Finn venstre kant av hjelpeboblen i forhold til kontrolleren\n * @param controllerSize DOMRect for controlleren\n * @param bubbleSize DOMRect for hjelpeboblen\n * @returns Venstre kant av hjelpeboblen i px\n */\n\n/**\n * Finn høyre kant av hjelpeboblen i forhold til kontrolleren\n * @param controllerSize DOMRect for controlleren\n * @param bubbleSize DOMRect for hjelpeboblen\n * @returns Høyre kant av hjelpeboblen i px\n */\nconst getBubbleRightPx = (controllerSize: DOMRect, bubbleSize: DOMRect): number => {\n return controllerSize.left + bubbleSize.width;\n};\n\n/**\n * Sjekk om venstre kant av hjelpeboblen er innenfor vinduet\n * @param controllerSize DOMRect for controlleren\n * @param bubbleSize DOMRect for hjelpeboblen\n * @returns true dersom venstre kant er innenfor vinduet\n */\nconst getBubbleLeftVisible = (controllerSize: DOMRect): boolean => {\n return controllerSize.left > WINDOW_MARGIN_PX;\n};\n\n/**\n * Sjekk om høyre kant av hjelpeboblen er innenfor vinduet\n * @param controllerSize DOMRect for controlleren\n * @param bubbleSize DOMRect for hjelpeboblen\n * @returns true dersom høyre kant er innenfor vinduet\n */\nconst getBubbleRightIsVisible = (controllerSize: DOMRect, bubbleSize: DOMRect): boolean => {\n const bubbleRightPx = getBubbleRightPx(controllerSize, bubbleSize);\n\n return bubbleRightPx < document.documentElement.clientWidth - WINDOW_MARGIN_PX;\n};\n\n/**\n * Finn riktig horisontal plassering til hjelpeboblen\n * @param controllerSize DOMRect for controlleren\n * @param bubbleSize DOMRect for hjelpeboblen\n * @returns left, right eller floating\n */\nconst getHorizontalPosition = (controllerSize: DOMRect, bubbleSize: DOMRect): HorizontalPosition => {\n if (!getBubbleRightIsVisible(controllerSize, bubbleSize)) {\n return 'right';\n }\n if (!getBubbleLeftVisible(controllerSize)) {\n return 'left';\n }\n\n return 'floating';\n};\n\n/**\n * Finn vertikal plassering av hjelpeboblen når den skal vises over\n * @param controllerSize DOMRect for controlleren\n * @param bubbleSize DOMRect for hjelpeboblen\n * @returns \"Top\" for hjelpeboblen i px\n */\nconst getBubbleAbovePx = (controllerSize: DOMRect, bubbleSize: DOMRect): number =>\n controllerSize.top - BUBBLE_VERTICAL_OFFSET_PX - bubbleSize.height;\n\n/**\n * Finn vertikal plassering av hjelpeboblen når den skal vises under\n * @param controllerSize DOMRect for controlleren\n * @param bubbleSize DOMRect for hjelpeboblen\n * @returns \"Top\" for hjelpeboblen i px\n */\nconst getBubbleBelowPx = (controllerSize: DOMRect): number => controllerSize.bottom + BUBBLE_VERTICAL_OFFSET_PX;\n\n/**\n * Finn maks bredde på hjelpeboblen i forhold til vinduet\n * @returns Bredde på hjelpeboblen i px\n */\nconst getBubbleWidth = (): number => document.documentElement.clientWidth - WINDOW_MARGIN_PX * 2;\n\n/**\n * Sjekk om hjelpeboblen har plass i vinduet\n * @returns true dersom det er plass til hjelpeboblen i vinduet\n */\nconst getBubbleFitsInWindow = (): boolean => {\n return document.documentElement.clientWidth > BUBBLE_WIDTH_PX + WINDOW_MARGIN_PX * 2;\n};\n\n/**\n * Finn vertikal plassering av pilen når den skal vises over\n * @param controllerSize DOMRect for controlleren\n * @returns \"Top\" for pilen i px\n */\nconst getArrowTopxPx = (controllerSize: DOMRect): number => controllerSize.top - BUBBLE_VERTICAL_OFFSET_PX - ARROW_VERTICAL_OFFSET_PX + 5;\n\n/**\n * Finn horisontal plassering av pilen i forhold til venstre kant av vinduet\n * @param controllerSize DOMRect for controlleren\n * @returns Venstre kant av pilen i px\n */\nconst getArrowLeftPx = (controllerSize: DOMRect): number => getControllerLeftEdgePx(controllerSize) - ARROW_WIDTH_PX / 2;\n\n/**\n * Finn horisontal plassering av pilen\n * @param controllerSize DOMRect for controlleren\n * @returns Venstre kant av pilen i px\n */\nconst getArrowRightPx = (controllerSize: DOMRect): number => getControllerRightEdgePx(controllerSize) - ARROW_WIDTH_PX / 2;\n\n/**\n * Finn riktig plassering av hjelpeboblen\n * @param controllerSize DOMRect for controlleren\n * @param bubbleSize DOMRect for hjelpeboblen\n * @param variant Ønsket plassering av hjelpeboblen (over/under)\n * @returns Beste mulige plassering av hjelpeboblen\n */\nconst getBubblePosition = (controllerSize: DOMRect, bubbleSize: DOMRect, variant: keyof typeof PopOverVariant): BubblePosition => {\n const horizontalPosition = getHorizontalPosition(controllerSize, bubbleSize);\n const verticalPosition = getVerticalPosition(controllerSize, bubbleSize, variant);\n\n if (horizontalPosition === 'left') {\n if (verticalPosition === PopOverVariant.positionabove) {\n return 'leftabove';\n }\n return 'leftbelow';\n }\n\n if (horizontalPosition === 'right') {\n if (verticalPosition === PopOverVariant.positionabove) {\n return 'rightabove';\n }\n return 'rightbelow';\n }\n\n if (verticalPosition === PopOverVariant.positionabove) {\n return 'floatingabove';\n }\n\n return 'floatingbelow';\n};\n\n/**\n * Finn riktig plassering av hjelpeboblen\n * @param controllerSize DOMRect for controlleren\n * @param bubbleSize DOMRect for hjelpeboblen\n * @param variant Ønsket plassering av hjelpeboblen (over/under)\n * @returns CSSProperties som plasserer hjelpeboblen riktig\n */\nexport const getBubbleStyle = (controllerSize: DOMRect, bubbleSize: DOMRect, variant: keyof typeof PopOverVariant): CSSProperties => {\n const bubblePosition = getBubblePosition(controllerSize, bubbleSize, variant);\n const bubbleWidth = !getBubbleFitsInWindow() ? getBubbleWidth() : undefined;\n\n if (bubblePosition === 'leftabove') {\n return {\n left: WINDOW_MARGIN_PX,\n top: getBubbleAbovePx(controllerSize, bubbleSize),\n width: bubbleWidth,\n };\n }\n if (bubblePosition === 'leftbelow') {\n return { left: WINDOW_MARGIN_PX, top: getBubbleBelowPx(controllerSize), width: bubbleWidth };\n }\n if (bubblePosition === 'rightabove') {\n return { right: WINDOW_MARGIN_PX, top: getBubbleAbovePx(controllerSize, bubbleSize), width: bubbleWidth };\n }\n if (bubblePosition === 'rightbelow') {\n return { right: WINDOW_MARGIN_PX, top: getBubbleBelowPx(controllerSize), width: bubbleWidth };\n }\n\n if (bubblePosition === 'floatingbelow') {\n return { left: getBubbleLeftPx(controllerSize, bubbleSize), top: getBubbleBelowPx(controllerSize), width: bubbleWidth };\n }\n\n return { left: getBubbleLeftPx(controllerSize, bubbleSize), top: getBubbleAbovePx(controllerSize, bubbleSize), width: bubbleWidth };\n};\n\n/**\n * Finn venstre kant av hjelpeboblen i forhold til kontrolleren\n * @param controllerSize DOMRect for controlleren\n * @param bubbleSize DOMRect for hjelpeboblen\n * @returns Venstre kant av hjelpeboblen i px\n */\nconst getBubbleLeftPx = (controllerSize: DOMRect, bubbleSize: DOMRect): number => {\n const controllerHorizontalCenterPx = getControllerLeftCenterPx(controllerSize);\n\n return controllerHorizontalCenterPx - bubbleSize.width / 2;\n};\n\n/**\n * Finn horisontalt midtpunkt på kontrolleren i forhold til venstre kant av vinduet\n * @param controllerSize DOMRect for controlleren\n * @returns Horisontalt senter av controlleren i px\n */\nconst getControllerLeftCenterPx = (controllerSize: DOMRect): number => controllerSize.left + controllerSize.width / 2;\n\n/**\n * Finn riktig plassering av pilen\n * @param bubbleStyle CSSProperties for hjelpeboblen\n * @param controllerSize DOMRect for kontrolleren\n * @param verticalPosition Ønsket plassering av hjelpeboblen (over/under)\n * @returns CSSProperties som plasserer pilen riktig\n */\nexport const getArrowStyle = (\n bubbleStyle: CSSProperties,\n controllerSize: DOMRect,\n verticalPosition: keyof typeof PopOverVariant\n): CSSProperties => {\n const leftPx = getArrowLeftPx(controllerSize);\n const rightPx = getArrowRightPx(controllerSize);\n const minLeftPx = (bubbleStyle.left as number) + ARROW_HORIZONTAL_MARGIN_PX;\n const minRightPx = (bubbleStyle.right as number) + ARROW_HORIZONTAL_MARGIN_PX;\n\n if (bubbleStyle.right) {\n if (verticalPosition === PopOverVariant.positionabove) {\n return {\n right: rightPx > minRightPx ? rightPx : minRightPx,\n top: getArrowTopxPx(controllerSize),\n };\n }\n\n return {\n right: rightPx > minRightPx ? rightPx : minRightPx,\n top: controllerSize.bottom + ARROW_VERTICAL_OFFSET_PX,\n };\n }\n\n if (verticalPosition === PopOverVariant.positionabove) {\n return {\n left: leftPx > minLeftPx ? leftPx : minLeftPx,\n top: getArrowTopxPx(controllerSize),\n };\n }\n\n return {\n left: leftPx > minLeftPx ? leftPx : minLeftPx,\n top: controllerSize.bottom + ARROW_VERTICAL_OFFSET_PX,\n };\n};\n","import React, { useState, useRef } from 'react';\n\nimport classNames from 'classnames';\nimport { DayPicker, DayPickerSingleProps } from 'react-day-picker';\nimport reactdaypickerstyles from 'react-day-picker/dist/style.module.css';\n\nimport { PopOverVariant } from '@helsenorge/designsystem-react/components/PopOver';\nimport { useFocusTrap } from '@helsenorge/designsystem-react/hooks/useFocusTrap';\nimport { useInterval } from '@helsenorge/designsystem-react/hooks/useInterval';\nimport { useIsVisible } from '@helsenorge/designsystem-react/hooks/useIsVisible';\nimport { useLayoutEvent } from '@helsenorge/designsystem-react/hooks/useLayoutEvent';\nimport { useSize } from '@helsenorge/designsystem-react/hooks/useSize';\nimport { getSpacer } from '@helsenorge/designsystem-react/theme/currys/spacing';\n\nimport { getArrowStyle, getBubbleStyle, getVerticalPosition } from './position-utils';\n\nimport styles from './styles.module.scss';\n\ninterface DatePickerPopupProps\n extends Pick<\n DayPickerSingleProps,\n 'dir' | 'disabled' | 'footer' | 'fromDate' | 'initialFocus' | 'locale' | 'month' | 'selected' | 'onSelect' | 'onMonthChange' | 'toDate'\n > {\n datepickerWrapperRef: React.RefObject<HTMLDivElement>;\n inputRef: React.RefObject<HTMLInputElement>;\n testId?: string;\n variant: keyof typeof PopOverVariant;\n zIndex?: number;\n}\n\nconst DatePickerPopup: React.FC<DatePickerPopupProps> = props => {\n const { datepickerWrapperRef, footer, inputRef, testId, variant, zIndex, ...rest } = props;\n const arrowRef = useRef<HTMLDivElement>(null);\n const [controllerSize, setControllerSize] = useState<DOMRect>();\n const bubbleSize = useSize(datepickerWrapperRef);\n const controllerisVisible = useIsVisible(inputRef, 0);\n useFocusTrap(datepickerWrapperRef, true);\n\n const updateControllerSize = (): void => {\n setControllerSize(inputRef.current?.getBoundingClientRect());\n };\n\n React.useEffect(() => {\n updateControllerSize();\n }, []);\n\n useInterval(updateControllerSize, 500);\n useLayoutEvent(updateControllerSize, ['scroll', 'resize'], 10);\n\n const datepickerPopupContainerClasses = classNames(styles['datepicker-popup-container'], {\n [styles['datepicker-popup-container--visible']]: controllerisVisible,\n });\n const verticalPosition = controllerSize && bubbleSize && getVerticalPosition(controllerSize, bubbleSize, variant);\n const popupArrowClasses = classNames(styles['datepicker-popup-arrow'], {\n [styles['datepicker-popup-arrow--visible']]: controllerisVisible,\n [styles['datepicker-popup-arrow--over']]: verticalPosition === PopOverVariant.positionbelow,\n [styles['datepicker-popup-arrow--under']]: verticalPosition === PopOverVariant.positionabove,\n });\n\n const bubbleStyle = controllerSize && bubbleSize && getBubbleStyle(controllerSize, bubbleSize, variant);\n const arrowStyle = bubbleStyle && controllerSize && verticalPosition && getArrowStyle(bubbleStyle, controllerSize, verticalPosition);\n\n const datePickerClassNames = {\n ...reactdaypickerstyles,\n ...styles,\n };\n\n return (\n <>\n <div className={datepickerPopupContainerClasses} data-testid={testId} ref={datepickerWrapperRef} style={{ ...bubbleStyle, zIndex }}>\n <DayPicker\n captionLayout=\"dropdown-buttons\"\n classNames={datePickerClassNames}\n mode={'single'}\n style={{ '--rdp-cell-size': getSpacer('l') } as React.CSSProperties}\n modifiersClassNames={{ today: styles['day--today'], selected: styles['day_selected'], disabled: styles['day--disabled'] }}\n footer={<span className={styles['footer-wrapper']}>{footer}</span>}\n fixedWeeks\n {...rest}\n />\n </div>\n <div ref={arrowRef} className={popupArrowClasses} style={{ ...arrowStyle, zIndex }} />\n </>\n );\n};\n\nexport default DatePickerPopup;\n","import React, { useState, useRef, useEffect } from 'react';\n\nimport { Locale, format, isValid, parse } from 'date-fns';\nimport { nb } from 'date-fns/locale';\nimport { ActiveModifiers, DayOfWeek, DayPickerSingleProps, SelectSingleEventHandler } from 'react-day-picker';\n\nimport Button from '@helsenorge/designsystem-react/components/Button';\nimport { ErrorWrapperClassNameProps } from '@helsenorge/designsystem-react/components/ErrorWrapper';\nimport Icon from '@helsenorge/designsystem-react/components/Icon';\nimport Calendar from '@helsenorge/designsystem-react/components/Icons/Calendar';\nimport Input from '@helsenorge/designsystem-react/components/Input';\nimport { PopOverVariant } from '@helsenorge/designsystem-react/components/PopOver';\nimport { KeyboardEventKey, ZIndex } from '@helsenorge/designsystem-react/constants';\nimport { useKeyboardEvent } from '@helsenorge/designsystem-react/hooks/useKeyboardEvent';\nimport { useOutsideEvent } from '@helsenorge/designsystem-react/hooks/useOutsideEvent';\nimport { usePseudoClasses } from '@helsenorge/designsystem-react/hooks/usePseudoClasses';\nimport { isMobileUA } from '@helsenorge/designsystem-react/utils/mobile';\nimport { isMutableRefObject, mergeRefs } from '@helsenorge/designsystem-react/utils/refs';\n\nimport DatePickerPopup from './DatePickerPopup';\n\nimport styles from './styles.module.scss';\n\nexport type DateFormat = 'dd.MM.yyyy';\n\nexport interface DatePickerProps\n extends ErrorWrapperClassNameProps,\n Pick<React.InputHTMLAttributes<HTMLInputElement>, 'name' | 'aria-describedby' | 'onBlur' | 'autoComplete'>,\n Pick<DayPickerSingleProps, 'dir' | 'initialFocus'> {\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets aria-label on the button that opens the datepicker dialogue */\n dateButtonAriaLabel?: string;\n /** Sets the format of the date - only applies for desktop use. Native mobile date fields base their formats on the device */\n dateFormat?: DateFormat;\n /** Sets the date of the component */\n dateValue?: Date;\n /** Sets the current month */\n defaultMonth?: Date;\n /** Disables the datepicker */\n disabled?: boolean;\n /** Disables the days in the datepicker */\n disableDays?: Date[];\n /** Disables weekends in the datepicker */\n disableWeekends?: boolean;\n /** Activates Error style for the input */\n error?: boolean;\n /** Error text to show above the component */\n errorText?: string;\n /** Error text id */\n errorTextId?: string;\n /** Content to be rendered in the footer of the datepicker popup */\n footerContent?: React.ReactNode;\n /** Label of the input */\n label?: React.ReactNode;\n /** Input element id */\n inputId?: string;\n /** Sets the locale of the datepicker */\n locale?: Locale;\n /** Maximum date allowed to be selected */\n maxDate?: Date;\n /** Minimum date allowed to be selected */\n minDate?: Date;\n /** onChange callback triggered by change in chosen date */\n onChange?: (event: React.ChangeEvent<HTMLInputElement> | React.MouseEvent<Element, MouseEvent>, date: Date | string | undefined) => void;\n /** Only use this to trigger validation. Callback triggered by change in chosen date via the datepicker popup */\n onDatePopupClosed?: (date: Date | string | undefined) => void;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Determines the placement of the DatePicker popup. Default: automatic positioning. */\n variant?: keyof typeof PopOverVariant;\n /** Overrides the default z-index of DatePicker */\n zIndex?: number;\n}\n\nexport const DatePicker = React.forwardRef((props: DatePickerProps, ref: React.Ref<HTMLInputElement>) => {\n const {\n className,\n dateButtonAriaLabel,\n dateFormat = 'dd.MM.yyyy',\n dateValue,\n defaultMonth,\n dir,\n disabled,\n disableDays = [],\n disableWeekends,\n error,\n errorText,\n errorTextId,\n errorWrapperClassName,\n footerContent,\n label,\n inputId,\n locale = nb,\n maxDate,\n minDate,\n onBlur,\n onChange,\n onDatePopupClosed,\n testId,\n autoComplete = 'off',\n variant = PopOverVariant.positionautomatic,\n zIndex = ZIndex.PopOver,\n ...rest\n } = props;\n\n const [dateState, setDateState] = useState<Date | undefined>(dateValue);\n const [inputValue, setInputValue] = useState<string>(dateState ? format(dateState, dateFormat) : '');\n const [month, setMonth] = useState<Date | undefined>(defaultMonth);\n const [datePickerOpen, setDatePickerOpen] = useState<boolean>(false);\n const [returnInputFocus, setReturnInputFocus] = useState<boolean>(false);\n\n const weekendMatcher: DayOfWeek = {\n dayOfWeek: [0, 6],\n };\n const disabledDays: (Date | DayOfWeek)[] = disableWeekends ? [...disableDays, weekendMatcher] : disableDays;\n\n const inputWrapperRef = useRef<HTMLDivElement>(null);\n const inputContainerRef = useRef<HTMLDivElement>(null);\n const datepickerWrapperRef = useRef<HTMLDivElement>(null);\n const { refObject } = usePseudoClasses<HTMLInputElement>(isMutableRefObject(ref) ? ref : null);\n const mergedRefs = mergeRefs([ref, refObject]);\n const isTyping = useRef<boolean>(false);\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n useOutsideEvent(inputContainerRef, (e: any) => {\n if (\n inputContainerRef.current &&\n datepickerWrapperRef.current &&\n !e?.composedPath().includes(inputContainerRef.current) &&\n !e?.composedPath().includes(datepickerWrapperRef.current)\n ) {\n setDatePickerOpen(false);\n }\n });\n\n useEffect(() => {\n if (isValid(dateValue)) {\n setInputValue(dateValue ? format(dateValue, dateFormat) : '');\n setDateState(dateValue);\n setMonth(dateValue);\n } else {\n setInputValue('');\n setDateState(undefined);\n setMonth(undefined);\n }\n }, [dateValue, dateFormat]);\n\n useEffect(() => {\n if (returnInputFocus && refObject.current) {\n refObject.current.focus();\n }\n }, [returnInputFocus]);\n\n const handleEscapeKeyDown = (): void => {\n refObject?.current && refObject.current.focus();\n setDatePickerOpen(false);\n };\n\n useKeyboardEvent(datepickerWrapperRef, handleEscapeKeyDown, [KeyboardEventKey.Escape]);\n useKeyboardEvent(inputWrapperRef, handleEscapeKeyDown, [KeyboardEventKey.Escape]);\n\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>, inputFormat: string): void => {\n setInputValue(event.currentTarget.value);\n const newDate = parse(event.currentTarget.value, inputFormat, new Date());\n\n if (isValid(newDate)) {\n setDateState(newDate);\n setMonth(newDate);\n } else {\n setDateState(undefined);\n }\n\n onChange && onChange(event, event.currentTarget.value);\n };\n\n const handleInputFocus = (): void => {\n if (!returnInputFocus) {\n setDatePickerOpen(true);\n } else {\n setReturnInputFocus(false);\n }\n };\n\n /* eslint-disable @typescript-eslint/no-unused-vars */\n const handleSingleDatePickerSelect: SelectSingleEventHandler = (\n date: Date | undefined,\n _selectedDay: Date,\n _activeModifiers: ActiveModifiers,\n e: React.MouseEvent<Element, MouseEvent>\n ): void => {\n setReturnInputFocus(true);\n\n if (!date) {\n setDatePickerOpen(false);\n return;\n }\n\n setDateState(date);\n\n if (refObject.current) {\n setInputValue(format(date, dateFormat));\n setDatePickerOpen(false);\n }\n\n onChange && onChange(e, date);\n triggerSyntheticInputEvents(refObject, format(date, dateFormat), date);\n onDatePopupClosed && onDatePopupClosed(date);\n };\n\n // We do this to make sure selecting from the DatePickerPopup triggers the onChange events properly, and works with react-hook-form\n const triggerSyntheticInputEvents = (\n inputRef: React.RefObject<HTMLInputElement>,\n value: string,\n date: Date,\n _onChange?: (event: React.ChangeEvent<HTMLInputElement>, date: Date) => void\n ): void => {\n if (inputRef.current) {\n inputRef.current.value = value;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const inputEvent = new Event('change', { bubbles: true });\n\n // Since the event is synthetic we have to add the target for webcomponents to not throw an error\n Object.defineProperty(inputEvent, 'target', {\n value: inputRef.current,\n writable: false,\n enumerable: true,\n configurable: true,\n });\n\n Object.defineProperty(inputEvent, 'currentTarget', {\n value: inputRef.current,\n writable: false,\n enumerable: true,\n configurable: true,\n });\n\n inputRef.current.dispatchEvent(inputEvent);\n\n if (onChange) {\n onChange(inputEvent as unknown as React.ChangeEvent<HTMLInputElement>, date);\n }\n }\n };\n\n const handleInputBlur = (e: React.FocusEvent<HTMLInputElement, Element>): void => {\n // We don't trigger the native onBlur event if the user select via the datepicker and the onDatePopupClosed callback is used (usually to trigger validation manually)\n if (!datePickerOpen && (typeof onDatePopupClosed === 'undefined' || isTyping.current)) {\n onBlur && onBlur(e);\n }\n\n isTyping.current = false;\n };\n\n const handleButtonClick = (\n e?: React.MouseEvent<HTMLElement, MouseEvent> | React.FormEvent<{}> | React.KeyboardEvent<HTMLUListElement> | null | undefined\n ): void => {\n e?.stopPropagation();\n setDatePickerOpen(!datePickerOpen);\n };\n\n // This differentiates between typing in the input field and selecting a date from the datepicker, especially on native mobile date fields\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent): void => {\n if (!['Escape', 'Enter', 'Tab'].includes(e.key)) {\n isTyping.current = true;\n setDatePickerOpen(false);\n }\n };\n\n const inputElement = refObject.current;\n if (inputElement) {\n inputElement.addEventListener('keydown', handleKeyDown);\n }\n\n return (): void => {\n if (inputElement) {\n inputElement.removeEventListener('keydown', handleKeyDown);\n }\n };\n }, [refObject]);\n\n const handleMobileInputChange = (e: React.ChangeEvent<HTMLInputElement>): void => {\n handleInputChange(e, 'yyyy-MM-dd');\n\n if (!isTyping.current) {\n onDatePopupClosed && onDatePopupClosed(dateState);\n }\n };\n\n const renderMobile = (\n <Input\n disabled={disabled}\n error={error}\n errorText={errorText}\n errorTextId={errorTextId}\n inputId={inputId}\n label={label}\n max={maxDate ? format(maxDate, 'yyyy-MM-dd') : ''}\n min={minDate ? format(minDate, 'yyyy-MM-dd') : ''}\n type=\"date\"\n ref={mergedRefs}\n value={dateState ? format(dateState, 'yyyy-MM-dd') : ''}\n width={14}\n {...rest}\n onBlur={handleInputBlur}\n onChange={handleMobileInputChange}\n autoComplete={autoComplete ? autoComplete : undefined}\n />\n );\n\n const renderDesktop = (\n <>\n <div>\n <Input\n errorWrapperClassName={errorWrapperClassName}\n disabled={disabled}\n error={error}\n errorText={errorText}\n errorTextId={errorTextId}\n inputId={inputId}\n inputContainerRef={inputContainerRef}\n inputWrapperRef={inputWrapperRef}\n label={label}\n onFocus={handleInputFocus}\n type=\"text\"\n ref={mergedRefs}\n value={inputValue}\n width={12}\n {...rest}\n onBlur={handleInputBlur}\n onChange={e => handleInputChange(e, 'yyyy-MM-dd')}\n rightOfInput={\n <Button\n disabled={disabled}\n ariaLabel={dateButtonAriaLabel ?? 'Velg dato'}\n onClick={handleButtonClick}\n tabIndex={datePickerOpen ? -1 : 0}\n variant={'borderless'}\n wrapperClassName={styles['date-button']}\n className={styles['date-button__inner']}\n >\n <Icon color={'black'} svgIcon={Calendar} />\n </Button>\n }\n autoComplete={autoComplete ? autoComplete : undefined}\n />\n </div>\n {datePickerOpen && !disabled && (\n <DatePickerPopup\n dir={dir}\n disabled={disabledDays}\n datepickerWrapperRef={datepickerWrapperRef}\n footer={footerContent}\n fromDate={minDate}\n toDate={maxDate}\n inputRef={refObject}\n locale={locale}\n month={month}\n selected={dateState}\n onSelect={handleSingleDatePickerSelect}\n onMonthChange={setMonth}\n variant={variant}\n zIndex={zIndex}\n />\n )}\n </>\n );\n\n return (\n <div className={className} data-testid={testId}>\n {isMobileUA() ? renderMobile : renderDesktop}\n </div>\n );\n});\n\nDatePicker.displayName = 'DatePicker';\n\nexport default DatePicker;\n","import React, { useEffect, useState } from 'react';\n\nimport { ErrorWrapperClassNameProps } from '@helsenorge/designsystem-react/components/ErrorWrapper';\nimport Input from '@helsenorge/designsystem-react/components/Input';\nimport { usePseudoClasses } from '@helsenorge/designsystem-react/hooks/usePseudoClasses';\nimport { isMutableRefObject, mergeRefs } from '@helsenorge/designsystem-react/utils/refs';\n\nimport styles from './styles.module.scss';\n\nexport type TimeUnit = 'hours' | 'minutes';\n\nexport interface DateTimeProps\n extends ErrorWrapperClassNameProps,\n Pick<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'name' | 'aria-describedby' | 'aria-labelledby' | 'onBlur' | 'onChange' | 'disabled' | 'autoComplete'\n > {\n /** Default value that is set on the input field */\n defaultValue?: number;\n /** Activates Error style for the input */\n error?: boolean;\n /** Error text to show above the component */\n errorText?: string;\n /** Error text id */\n errorTextId?: string;\n /** input id of the checkbox */\n inputId?: string;\n /** Label of the input */\n label?: React.ReactNode;\n /** Sets the unit of time for the input field */\n timeUnit: TimeUnit;\n /** Value that is set on the input field */\n value?: number;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nconst formatAsTwoDigits = (value: string | number): string => {\n const stringValue = String(value);\n return stringValue.length === 1 ? '0' + stringValue : stringValue;\n};\n\nconst isNumericString = (str: string): boolean => {\n return !str || (/^\\d+$/.test(str) && str.length <= 2);\n};\n\nexport const DateTime = React.forwardRef((props: DateTimeProps, ref: React.Ref<HTMLInputElement>) => {\n const {\n error,\n errorText,\n errorTextId,\n errorWrapperClassName,\n label,\n onBlur,\n onChange,\n timeUnit,\n testId,\n inputId,\n value,\n autoComplete = 'off',\n ...rest\n } = props;\n\n const [inputValue, setInputValue] = useState<number | string | undefined>(\n typeof value !== 'undefined' ? formatAsTwoDigits(value) : undefined\n );\n const { refObject } = usePseudoClasses<HTMLInputElement>(isMutableRefObject(ref) ? ref : null);\n const mergedRefs = mergeRefs([ref, refObject]);\n\n useEffect(() => {\n setInputValue(value ? formatAsTwoDigits(value) : undefined);\n }, [value]);\n\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n const value = event.target.value;\n\n if (isNumericString(value)) {\n setInputValue(value);\n onChange && onChange(event);\n }\n };\n\n const handleInputBlur = (event: React.FocusEvent<HTMLInputElement>): void => {\n const formattedValue = formatAsTwoDigits(event.target.value);\n setInputValue(formattedValue);\n onChange && onChange(event);\n onBlur && onBlur(event);\n };\n\n /** Firefox stopper ikke vanlige characters fra å skrives til input type number - derfor håndterer vi det selv her */\n const handleInputOnKeyDown = (event: React.KeyboardEvent) => {\n const validChars = /[0-9]/;\n const allowedKeys = ['Backspace', ' ', 'Enter', 'Tab', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'];\n if (!validChars.test(event.key) && !allowedKeys.includes(event.key)) {\n event.preventDefault();\n }\n };\n\n const renderTimeSeparator = (): React.ReactNode => {\n return timeUnit === 'hours' && <span className={styles['time-separator']}>{':'}</span>;\n };\n\n return (\n <div data-testid={testId}>\n <Input\n inputId={inputId}\n error={error}\n errorText={errorText}\n errorTextId={errorTextId}\n errorWrapperClassName={errorWrapperClassName}\n label={label}\n max={timeUnit === 'hours' ? 23 : 59}\n min={0}\n type=\"number\"\n ref={mergedRefs}\n value={inputValue}\n width={5}\n defaultValue={typeof props.defaultValue !== 'undefined' ? formatAsTwoDigits(props.defaultValue) : undefined}\n {...rest}\n onChange={handleInputChange}\n onBlur={handleInputBlur}\n rightOfInput={renderTimeSeparator()}\n onKeyDown={handleInputOnKeyDown}\n autoComplete={autoComplete ? autoComplete : undefined}\n />\n </div>\n );\n});\n\nDateTime.displayName = 'DateTime';\n\nexport default DateTime;\n","import React from 'react';\n\nimport classNames from 'classnames';\n\nimport ErrorWrapper, { ErrorWrapperClassNameProps } from '@helsenorge/designsystem-react/components/ErrorWrapper';\nimport { useUuid } from '@helsenorge/designsystem-react/hooks/useUuid';\nimport { isComponent } from '@helsenorge/designsystem-react/utils/component';\n\nimport DatePicker, { DatePickerProps } from './DatePicker';\nimport DateTime, { DateTimeProps } from './DateTime';\n\nimport styles from './styles.module.scss';\n\nexport type TimeUnits = 'hours' | 'minutes';\n\ninterface DateTimePickerWrapperProps extends ErrorWrapperClassNameProps {\n /** Sets the children of the datetimepicker - the DatePicker and DateTime components go here */\n children?: React.ReactNode;\n /** Error text to show above the component */\n errorText?: string;\n /** text placed in the legend tag of the fieldset */\n legend?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nexport const DateTimePickerWrapper = React.forwardRef((props: DateTimePickerWrapperProps, ref: React.ForwardedRef<HTMLDivElement>) => {\n const { children, errorWrapperClassName, errorText, legend, testId } = props;\n const errorTextId = useUuid();\n\n const mapDateComponents = (child: React.ReactNode): React.ReactNode => {\n if (isComponent<DatePickerProps>(child, DatePicker)) {\n return React.cloneElement(child, {\n className: classNames(styles['date-time-picker-wrapper__date-picker']),\n error: !!errorText,\n errorTextId,\n });\n } else if (isComponent<DateTimeProps>(child, DateTime)) {\n return React.cloneElement(child, {\n error: !!errorText,\n errorTextId,\n });\n }\n return child;\n };\n\n return (\n <div ref={ref} tabIndex={-1}>\n <ErrorWrapper className={errorWrapperClassName} errorText={errorText} errorTextId={errorTextId}>\n {props.legend ? (\n <fieldset className={styles['date-time-picker-wrapper']} data-testid={testId}>\n {props.legend && <legend className={styles['date-time-picker-wrapper__legend']}>{legend}</legend>}\n {React.Children.map(children, mapDateComponents)}\n </fieldset>\n ) : (\n <div className={styles['date-time-picker-wrapper']}>{React.Children.map(children, mapDateComponents)}</div>\n )}\n </ErrorWrapper>\n </div>\n );\n});\n\nDateTimePickerWrapper.displayName = 'DateTimePickerWrapper';\n\nexport default DateTimePickerWrapper;\n","import { isWithinInterval, isAfter, isBefore, isSameDay, parse, isValid } from 'date-fns';\n\nexport const parseInputDate = (dateString: string): Date | null => {\n const possibleFormats = ['yyyy-MM-dd', 'dd.MM.yyyy'];\n\n for (const format of possibleFormats) {\n const parsedDate = parse(dateString, format, new Date());\n if (isValid(parsedDate)) {\n return parsedDate;\n }\n }\n\n return null;\n};\n\nexport const isValidDate = (dateString: string): boolean => {\n const date = new Date(dateString);\n return date instanceof Date && !isNaN(date.getTime());\n};\n\n/** react-hook-form fromDate and toDate validation */\nexport const validateMinMaxDate = (\n date: string,\n outsideRangeErrorMessage: string,\n invalidFormatErrorMessage?: string,\n minDate?: Date,\n maxDate?: Date\n): string | true => {\n const formattedDate = parseInputDate(date);\n const hasMinDate = typeof minDate !== 'undefined';\n const hasMaxDate = typeof maxDate !== 'undefined';\n if (!formattedDate || (hasMinDate && !isValid(minDate)) || (hasMaxDate && !isValid(maxDate))) {\n return invalidFormatErrorMessage || 'Invalid date format';\n }\n\n if (hasMinDate && !hasMaxDate && (isSameDay(formattedDate, minDate) || isAfter(formattedDate, minDate))) return true;\n else if (hasMaxDate && !hasMinDate && (isSameDay(formattedDate, maxDate) || isBefore(formattedDate, maxDate))) return true;\n else if (\n hasMinDate &&\n hasMaxDate &&\n (isSameDay(formattedDate, minDate) ||\n isSameDay(formattedDate, maxDate) ||\n isWithinInterval(formattedDate, { start: minDate, end: maxDate }))\n ) {\n return true;\n }\n\n return outsideRangeErrorMessage;\n};\n\n/** react-hook-form fromDate and toDate validation */\nexport const validateDisabledDates = (\n date: string,\n disabledDates: Date[],\n isDisabledErrorMessage: string,\n invalidFormatErrorMessage?: string\n): string | true => {\n const formattedDate = parseInputDate(date);\n if (!formattedDate) {\n return invalidFormatErrorMessage || 'Invalid date format';\n }\n if (!disabledDates.some(d => isSameDay(d, formattedDate))) {\n return true;\n }\n\n return isDisabledErrorMessage;\n};\n\n/** react-hook-form fromTime and toTime validation */\nexport const validateMinTimeMaxTime = (\n time: { hour: number; minute: number },\n errorMessage: string,\n minTime?: { hour: number; minute: number },\n maxTime?: { hour: number; minute: number }\n): string | true => {\n const timeParsed = parse((time.hour + ':' + time.minute).toString(), 'HH:mm', new Date());\n const minTimeParsed = parse((minTime?.hour + ':' + minTime?.minute).toString(), 'HH:mm', new Date());\n const maxTimeParsed = parse((maxTime?.hour + ':' + maxTime?.minute).toString(), 'HH:mm', new Date());\n\n if ((typeof minTime === 'undefined' || timeParsed >= minTimeParsed) && (typeof maxTime === 'undefined' || timeParsed <= maxTimeParsed)) {\n return true;\n }\n\n return errorMessage;\n};\n"],"names":["__assign","classNames","styles","formatCaption","formatMonthCaption","labelMonthDropdown","formatYearCaption","labelYearDropdown","year","setMonth","_a","month","labelPrevious","labelNext","formatWeekdayName","labelWeekday","formatDay","min","max","_b","InternalModifier","labelWeekNumber","formatWeekNumber","id","Button","value","format"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,IAAI,WAAW,WAAW;AACtB,aAAW,OAAO,UAAU,SAASA,UAAS,GAAG;AAC7C,aAAS,GAAG,IAAI,GAAG,IAAI,UAAU,QAAQ,IAAI,GAAG,KAAK;AACjD,UAAI,UAAU,CAAC;AACf,eAAS,KAAK,EAAG,KAAI,OAAO,UAAU,eAAe,KAAK,GAAG,CAAC,EAAG,GAAE,CAAC,IAAI,EAAE,CAAC;AAAA,IAC9E;AACD,WAAO;AAAA,EACf;AACI,SAAO,SAAS,MAAM,MAAM,SAAS;AACzC;AAEA,SAAS,OAAO,GAAG,GAAG;AAClB,MAAI,IAAI,CAAA;AACR,WAAS,KAAK,EAAG,KAAI,OAAO,UAAU,eAAe,KAAK,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI;AAC9E,MAAE,CAAC,IAAI,EAAE,CAAC;AACd,MAAI,KAAK,QAAQ,OAAO,OAAO,0BAA0B;AACrD,aAAS,IAAI,GAAG,IAAI,OAAO,sBAAsB,CAAC,G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;AAGF,SAAA;AACT;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../node_modules/react-day-picker/dist/esm/UI.js","../../../../../node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.js","../../../../../node_modules/react-day-picker/dist/esm/helpers/startOfBroadcastWeek.js","../../../../../node_modules/react-day-picker/dist/esm/helpers/endOfBroadcastWeek.js","../../../../../node_modules/react-day-picker/dist/esm/classes/DateLib.js","../../../../../node_modules/react-day-picker/dist/esm/helpers/getClassNamesForModifiers.js","../../../../../node_modules/react-day-picker/dist/esm/components/Button.js","../../../../../node_modules/react-day-picker/dist/esm/components/CaptionLabel.js","../../../../../node_modules/react-day-picker/dist/esm/components/Chevron.js","../../../../../node_modules/react-day-picker/dist/esm/components/Day.js","../../../../../node_modules/react-day-picker/dist/esm/components/DayButton.js","../../../../../node_modules/react-day-picker/dist/esm/components/Dropdown.js","../../../../../node_modules/react-day-picker/dist/esm/components/DropdownNav.js","../../../../../node_modules/react-day-picker/dist/esm/components/Footer.js","../../../../../node_modules/react-day-picker/dist/esm/components/Month.js","../../../../../node_modules/react-day-picker/dist/esm/components/MonthCaption.js","../../../../../node_modules/react-day-picker/dist/esm/components/MonthGrid.js","../../../../../node_modules/react-day-picker/dist/esm/components/Months.js","../../../../../node_modules/react-day-picker/dist/esm/useDayPicker.js","../../../../../node_modules/react-day-picker/dist/esm/components/MonthsDropdown.js","../../../../../node_modules/react-day-picker/dist/esm/components/Nav.js","../../../../../node_modules/react-day-picker/dist/esm/components/NextMonthButton.js","../../../../../node_modules/react-day-picker/dist/esm/components/Option.js","../../../../../node_modules/react-day-picker/dist/esm/components/PreviousMonthButton.js","../../../../../node_modules/react-day-picker/dist/esm/components/Root.js","../../../../../node_modules/react-day-picker/dist/esm/components/Select.js","../../../../../node_modules/react-day-picker/dist/esm/components/Week.js","../../../../../node_modules/react-day-picker/dist/esm/components/Weekday.js","../../../../../node_modules/react-day-picker/dist/esm/components/Weekdays.js","../../../../../node_modules/react-day-picker/dist/esm/components/WeekNumber.js","../../../../../node_modules/react-day-picker/dist/esm/components/WeekNumberHeader.js","../../../../../node_modules/react-day-picker/dist/esm/components/Weeks.js","../../../../../node_modules/react-day-picker/dist/esm/components/YearsDropdown.js","../../../../../node_modules/react-day-picker/dist/esm/helpers/getComponents.js","../../../../../node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.js","../../../../../node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.js","../../../../../node_modules/react-day-picker/dist/esm/formatters/formatCaption.js","../../../../../node_modules/react-day-picker/dist/esm/formatters/formatDay.js","../../../../../node_modules/react-day-picker/dist/esm/formatters/formatMonthDropdown.js","../../../../../node_modules/react-day-picker/dist/esm/formatters/formatWeekNumber.js","../../../../../node_modules/react-day-picker/dist/esm/formatters/formatWeekNumberHeader.js","../../../../../node_modules/react-day-picker/dist/esm/formatters/formatWeekdayName.js","../../../../../node_modules/react-day-picker/dist/esm/formatters/formatYearDropdown.js","../../../../../node_modules/react-day-picker/dist/esm/helpers/getFormatters.js","../../../../../node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.js","../../../../../node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.js","../../../../../node_modules/@date-fns/tz/tzOffset/index.js","../../../../../node_modules/@date-fns/tz/date/mini.js","../../../../../node_modules/@date-fns/tz/date/index.js","../../../../../node_modules/react-day-picker/dist/esm/helpers/getWeekdays.js","../../../../../node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js","../../../../../node_modules/react-day-picker/dist/esm/labels/labelGrid.js","../../../../../node_modules/react-day-picker/dist/esm/labels/labelGridcell.js","../../../../../node_modules/react-day-picker/dist/esm/labels/labelDayButton.js","../../../../../node_modules/react-day-picker/dist/esm/labels/labelNav.js","../../../../../node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.js","../../../../../node_modules/react-day-picker/dist/esm/labels/labelNext.js","../../../../../node_modules/react-day-picker/dist/esm/labels/labelPrevious.js","../../../../../node_modules/react-day-picker/dist/esm/labels/labelWeekday.js","../../../../../node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.js","../../../../../node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.js","../../../../../node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.js","../../../../../node_modules/react-day-picker/dist/esm/helpers/getDates.js","../../../../../node_modules/react-day-picker/dist/esm/helpers/getDays.js","../../../../../node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.js","../../../../../node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js","../../../../../node_modules/react-day-picker/dist/esm/classes/CalendarDay.js","../../../../../node_modules/react-day-picker/dist/esm/classes/CalendarMonth.js","../../../../../node_modules/react-day-picker/dist/esm/classes/CalendarWeek.js","../../../../../node_modules/react-day-picker/dist/esm/helpers/getMonths.js","../../../../../node_modules/react-day-picker/dist/esm/helpers/getNavMonth.js","../../../../../node_modules/react-day-picker/dist/esm/helpers/getNextMonth.js","../../../../../node_modules/react-day-picker/dist/esm/helpers/getPreviousMonth.js","../../../../../node_modules/react-day-picker/dist/esm/helpers/getWeeks.js","../../../../../node_modules/react-day-picker/dist/esm/helpers/useControlledValue.js","../../../../../node_modules/react-day-picker/dist/esm/useCalendar.js","../../../../../node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.js","../../../../../node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.js","../../../../../node_modules/react-day-picker/dist/esm/utils/typeguards.js","../../../../../node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.js","../../../../../node_modules/react-day-picker/dist/esm/helpers/getFocusableDate.js","../../../../../node_modules/react-day-picker/dist/esm/helpers/getNextFocus.js","../../../../../node_modules/react-day-picker/dist/esm/useFocus.js","../../../../../node_modules/react-day-picker/dist/esm/useGetModifiers.js","../../../../../node_modules/react-day-picker/dist/esm/selection/useMulti.js","../../../../../node_modules/react-day-picker/dist/esm/utils/addToRange.js","../../../../../node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.js","../../../../../node_modules/react-day-picker/dist/esm/utils/rangeOverlaps.js","../../../../../node_modules/react-day-picker/dist/esm/utils/rangeContainsModifiers.js","../../../../../node_modules/react-day-picker/dist/esm/selection/useRange.js","../../../../../node_modules/react-day-picker/dist/esm/selection/useSingle.js","../../../../../node_modules/react-day-picker/dist/esm/useSelection.js","../../../../../node_modules/react-day-picker/dist/esm/DayPicker.js","../../../src/components/DatePicker/position-utils.ts","../../../src/components/DatePicker/DatePickerPopup.tsx","../../../src/components/DatePicker/DatePicker.tsx","../../../src/components/DatePicker/DateTime.tsx","../../../src/components/DatePicker/DateTimePickerWrapper.tsx","../../../src/components/DatePicker/validate-utils.ts"],"sourcesContent":["/**\n * The UI elements composing DayPicker. These elements are mapped to\n * {@link CustomComponents}, the {@link ClassNames} and the {@link Styles} used by\n * DayPicker.\n *\n * Some of these elements are extended by flags and modifiers.\n */\nexport var UI;\n(function (UI) {\n /** The root component displaying the months and the navigation bar. */\n UI[\"Root\"] = \"root\";\n /** The Chevron SVG element used by navigation buttons and dropdowns. */\n UI[\"Chevron\"] = \"chevron\";\n /**\n * The grid cell with the day's date. Extended by {@link DayFlag} and\n * {@link SelectionFlag}.\n */\n UI[\"Day\"] = \"day\";\n /** The button containing the formatted day's date, inside the grid cell. */\n UI[\"DayButton\"] = \"day_button\";\n /** The caption label of the month (when not showing the dropdown navigation). */\n UI[\"CaptionLabel\"] = \"caption_label\";\n /** The container of the dropdown navigation (when enabled). */\n UI[\"Dropdowns\"] = \"dropdowns\";\n /** The dropdown element to select for years and months. */\n UI[\"Dropdown\"] = \"dropdown\";\n /** The container element of the dropdown. */\n UI[\"DropdownRoot\"] = \"dropdown_root\";\n /** The root element of the footer. */\n UI[\"Footer\"] = \"footer\";\n /** The month grid. */\n UI[\"MonthGrid\"] = \"month_grid\";\n /** Contains the dropdown navigation or the caption label. */\n UI[\"MonthCaption\"] = \"month_caption\";\n /** The dropdown with the months. */\n UI[\"MonthsDropdown\"] = \"months_dropdown\";\n /** Wrapper of the month grid. */\n UI[\"Month\"] = \"month\";\n /** The container of the displayed months. */\n UI[\"Months\"] = \"months\";\n /** The navigation bar with the previous and next buttons. */\n UI[\"Nav\"] = \"nav\";\n /**\n * The next month button in the navigation. *\n *\n * @since 9.1.0\n */\n UI[\"NextMonthButton\"] = \"button_next\";\n /**\n * The previous month button in the navigation.\n *\n * @since 9.1.0\n */\n UI[\"PreviousMonthButton\"] = \"button_previous\";\n /** The row containing the week. */\n UI[\"Week\"] = \"week\";\n /** The group of row weeks in a month (`tbody`). */\n UI[\"Weeks\"] = \"weeks\";\n /** The column header with the weekday. */\n UI[\"Weekday\"] = \"weekday\";\n /** The row grouping the weekdays in the column headers. */\n UI[\"Weekdays\"] = \"weekdays\";\n /** The cell containing the week number. */\n UI[\"WeekNumber\"] = \"week_number\";\n /** The cell header of the week numbers column. */\n UI[\"WeekNumberHeader\"] = \"week_number_header\";\n /** The dropdown with the years. */\n UI[\"YearsDropdown\"] = \"years_dropdown\";\n})(UI || (UI = {}));\n/** The flags for the {@link UI.Day}. */\nexport var DayFlag;\n(function (DayFlag) {\n /** The day is disabled. */\n DayFlag[\"disabled\"] = \"disabled\";\n /** The day is hidden. */\n DayFlag[\"hidden\"] = \"hidden\";\n /** The day is outside the current month. */\n DayFlag[\"outside\"] = \"outside\";\n /** The day is focused. */\n DayFlag[\"focused\"] = \"focused\";\n /** The day is today. */\n DayFlag[\"today\"] = \"today\";\n})(DayFlag || (DayFlag = {}));\n/**\n * The state that can be applied to the {@link UI.Day} element when in selection\n * mode.\n */\nexport var SelectionState;\n(function (SelectionState) {\n /** The day is at the end of a selected range. */\n SelectionState[\"range_end\"] = \"range_end\";\n /** The day is at the middle of a selected range. */\n SelectionState[\"range_middle\"] = \"range_middle\";\n /** The day is at the start of a selected range. */\n SelectionState[\"range_start\"] = \"range_start\";\n /** The day is selected. */\n SelectionState[\"selected\"] = \"selected\";\n})(SelectionState || (SelectionState = {}));\n//# sourceMappingURL=UI.js.map","const FIVE_WEEKS = 5;\nconst FOUR_WEEKS = 4;\n/**\n * Return the number of weeks to display in the broadcast calendar.\n *\n * @since 9.4.0\n */\nexport function getBroadcastWeeksInMonth(month, dateLib) {\n // Get the first day of the month\n const firstDayOfMonth = dateLib.startOfMonth(month);\n // Get the day of the week for the first day of the month (1-7, where 1 is Monday)\n const firstDayOfWeek = firstDayOfMonth.getDay() > 0 ? firstDayOfMonth.getDay() : 7;\n const broadcastStartDate = dateLib.addDays(month, -firstDayOfWeek + 1);\n const lastDateOfLastWeek = dateLib.addDays(broadcastStartDate, FIVE_WEEKS * 7 - 1);\n const numberOfWeeks = month.getMonth() === lastDateOfLastWeek.getMonth()\n ? FIVE_WEEKS\n : FOUR_WEEKS;\n return numberOfWeeks;\n}\n//# sourceMappingURL=getBroadcastWeeksInMonth.js.map","/**\n * Return the start date of the week in the broadcast calendar.\n *\n * @since 9.4.0\n */\nexport function startOfBroadcastWeek(date, dateLib) {\n const firstOfMonth = dateLib.startOfMonth(date);\n const dayOfWeek = firstOfMonth.getDay();\n if (dayOfWeek === 1) {\n return firstOfMonth;\n }\n else if (dayOfWeek === 0) {\n return dateLib.addDays(firstOfMonth, -1 * 6);\n }\n else {\n return dateLib.addDays(firstOfMonth, -1 * (dayOfWeek - 1));\n }\n}\n//# sourceMappingURL=startOfBroadcastWeek.js.map","import { getBroadcastWeeksInMonth } from \"./getBroadcastWeeksInMonth.js\";\nimport { startOfBroadcastWeek } from \"./startOfBroadcastWeek.js\";\n/**\n * Return the end date of the week in the broadcast calendar.\n *\n * @since 9.4.0\n */\nexport function endOfBroadcastWeek(date, dateLib) {\n const startDate = startOfBroadcastWeek(date, dateLib);\n const numberOfWeeks = getBroadcastWeeksInMonth(date, dateLib);\n const endDate = dateLib.addDays(startDate, numberOfWeeks * 7 - 1);\n return endDate;\n}\n//# sourceMappingURL=endOfBroadcastWeek.js.map","import { addDays, addMonths, addWeeks, addYears, differenceInCalendarDays, differenceInCalendarMonths, endOfISOWeek, endOfMonth, endOfWeek, endOfYear, format, getISOWeek, getWeek, isAfter, isBefore, isDate, isSameDay, isSameMonth, isSameYear, max, min, setMonth, setYear, startOfDay, startOfISOWeek, startOfMonth, startOfWeek, startOfYear } from \"date-fns\";\nimport { enUS } from \"date-fns/locale\";\nimport { endOfBroadcastWeek } from \"../helpers/endOfBroadcastWeek.js\";\nimport { startOfBroadcastWeek } from \"../helpers/startOfBroadcastWeek.js\";\n/**\n * A wrapper class around [date-fns](http://date-fns.org) sharing the same\n * options. Methods of this class can be overridden using the\n * {@link PropsBase.dateLib} prop.\n *\n * @since 9.2.0\n * @example\n * const dateLib = new DateLib({ locale: es });\n * const newDate = dateLib.addDays(new Date(), 5);\n */\nexport class DateLib {\n /**\n * Creates an instance of DateLib.\n *\n * @param options The options for the date library.\n * @param overrides Overrides for the date library functions.\n */\n constructor(options, overrides) {\n /** Reference to the built-in Date constructor. */\n this.Date = Date;\n /**\n * Adds the specified number of days to the given date.\n *\n * @param date The date to add days to.\n * @param amount The number of days to add.\n * @returns The new date with the days added.\n */\n this.addDays = (date, amount) => {\n return this.overrides?.addDays\n ? this.overrides.addDays(date, amount)\n : addDays(date, amount);\n };\n /**\n * Adds the specified number of months to the given date.\n *\n * @param date The date to add months to.\n * @param amount The number of months to add.\n * @returns The new date with the months added.\n */\n this.addMonths = (date, amount) => {\n return this.overrides?.addMonths\n ? this.overrides.addMonths(date, amount)\n : addMonths(date, amount);\n };\n /**\n * Adds the specified number of weeks to the given date.\n *\n * @param date The date to add weeks to.\n * @param amount The number of weeks to add.\n * @returns The new date with the weeks added.\n */\n this.addWeeks = (date, amount) => {\n return this.overrides?.addWeeks\n ? this.overrides.addWeeks(date, amount)\n : addWeeks(date, amount);\n };\n /**\n * Adds the specified number of years to the given date.\n *\n * @param date The date to add years to.\n * @param amount The number of years to add.\n * @returns The new date with the years added.\n */\n this.addYears = (date, amount) => {\n return this.overrides?.addYears\n ? this.overrides.addYears(date, amount)\n : addYears(date, amount);\n };\n /**\n * Returns the number of calendar days between the given dates.\n *\n * @param dateLeft The later date.\n * @param dateRight The earlier date.\n * @returns The number of calendar days between the dates.\n */\n this.differenceInCalendarDays = (dateLeft, dateRight) => {\n return this.overrides?.differenceInCalendarDays\n ? this.overrides.differenceInCalendarDays(dateLeft, dateRight)\n : differenceInCalendarDays(dateLeft, dateRight);\n };\n /**\n * Returns the number of calendar months between the given dates.\n *\n * @param dateLeft The later date.\n * @param dateRight The earlier date.\n * @returns The number of calendar months between the dates.\n */\n this.differenceInCalendarMonths = (dateLeft, dateRight) => {\n return this.overrides?.differenceInCalendarMonths\n ? this.overrides.differenceInCalendarMonths(dateLeft, dateRight)\n : differenceInCalendarMonths(dateLeft, dateRight);\n };\n /**\n * Returns the end of the broadcast week for the given date.\n *\n * @param date The original date.\n * @returns The end of the broadcast week.\n */\n this.endOfBroadcastWeek = (date) => {\n return this.overrides?.endOfBroadcastWeek\n ? this.overrides.endOfBroadcastWeek(date, this)\n : endOfBroadcastWeek(date, this);\n };\n /**\n * Returns the end of the ISO week for the given date.\n *\n * @param date The original date.\n * @returns The end of the ISO week.\n */\n this.endOfISOWeek = (date) => {\n return this.overrides?.endOfISOWeek\n ? this.overrides.endOfISOWeek(date)\n : endOfISOWeek(date);\n };\n /**\n * Returns the end of the month for the given date.\n *\n * @param date The original date.\n * @returns The end of the month.\n */\n this.endOfMonth = (date) => {\n return this.overrides?.endOfMonth\n ? this.overrides.endOfMonth(date)\n : endOfMonth(date);\n };\n /**\n * Returns the end of the week for the given date.\n *\n * @param date The original date.\n * @returns The end of the week.\n */\n this.endOfWeek = (date) => {\n return this.overrides?.endOfWeek\n ? this.overrides.endOfWeek(date, this.options)\n : endOfWeek(date, this.options);\n };\n /**\n * Returns the end of the year for the given date.\n *\n * @param date The original date.\n * @returns The end of the year.\n */\n this.endOfYear = (date) => {\n return this.overrides?.endOfYear\n ? this.overrides.endOfYear(date)\n : endOfYear(date);\n };\n /**\n * Formats the given date using the specified format string.\n *\n * @param date The date to format.\n * @param formatStr The format string.\n * @returns The formatted date string.\n */\n this.format = (date, formatStr) => {\n return this.overrides?.format\n ? this.overrides.format(date, formatStr, this.options)\n : format(date, formatStr, this.options);\n };\n /**\n * Returns the ISO week number for the given date.\n *\n * @param date The date to get the ISO week number for.\n * @returns The ISO week number.\n */\n this.getISOWeek = (date) => {\n return this.overrides?.getISOWeek\n ? this.overrides.getISOWeek(date)\n : getISOWeek(date);\n };\n /**\n * Returns the local week number for the given date.\n *\n * @param date The date to get the week number for.\n * @returns The week number.\n */\n this.getWeek = (date) => {\n return this.overrides?.getWeek\n ? this.overrides.getWeek(date, this.options)\n : getWeek(date, this.options);\n };\n /**\n * Checks if the first date is after the second date.\n *\n * @param date The date to compare.\n * @param dateToCompare The date to compare with.\n * @returns True if the first date is after the second date.\n */\n this.isAfter = (date, dateToCompare) => {\n return this.overrides?.isAfter\n ? this.overrides.isAfter(date, dateToCompare)\n : isAfter(date, dateToCompare);\n };\n /**\n * Checks if the first date is before the second date.\n *\n * @param date The date to compare.\n * @param dateToCompare The date to compare with.\n * @returns True if the first date is before the second date.\n */\n this.isBefore = (date, dateToCompare) => {\n return this.overrides?.isBefore\n ? this.overrides.isBefore(date, dateToCompare)\n : isBefore(date, dateToCompare);\n };\n /**\n * Checks if the given value is a Date object.\n *\n * @param value The value to check.\n * @returns True if the value is a Date object.\n */\n this.isDate = (value) => {\n return this.overrides?.isDate\n ? this.overrides.isDate(value)\n : isDate(value);\n };\n /**\n * Checks if the given dates are on the same day.\n *\n * @param dateLeft The first date to compare.\n * @param dateRight The second date to compare.\n * @returns True if the dates are on the same day.\n */\n this.isSameDay = (dateLeft, dateRight) => {\n return this.overrides?.isSameDay\n ? this.overrides.isSameDay(dateLeft, dateRight)\n : isSameDay(dateLeft, dateRight);\n };\n /**\n * Checks if the given dates are in the same month.\n *\n * @param dateLeft The first date to compare.\n * @param dateRight The second date to compare.\n * @returns True if the dates are in the same month.\n */\n this.isSameMonth = (dateLeft, dateRight) => {\n return this.overrides?.isSameMonth\n ? this.overrides.isSameMonth(dateLeft, dateRight)\n : isSameMonth(dateLeft, dateRight);\n };\n /**\n * Checks if the given dates are in the same year.\n *\n * @param dateLeft The first date to compare.\n * @param dateRight The second date to compare.\n * @returns True if the dates are in the same year.\n */\n this.isSameYear = (dateLeft, dateRight) => {\n return this.overrides?.isSameYear\n ? this.overrides.isSameYear(dateLeft, dateRight)\n : isSameYear(dateLeft, dateRight);\n };\n /**\n * Returns the latest date in the given array of dates.\n *\n * @param dates The array of dates to compare.\n * @returns The latest date.\n */\n this.max = (dates) => {\n return this.overrides?.max ? this.overrides.max(dates) : max(dates);\n };\n /**\n * Returns the earliest date in the given array of dates.\n *\n * @param dates The array of dates to compare.\n * @returns The earliest date.\n */\n this.min = (dates) => {\n return this.overrides?.min ? this.overrides.min(dates) : min(dates);\n };\n /**\n * Sets the month of the given date.\n *\n * @param date The date to set the month on.\n * @param month The month to set (0-11).\n * @returns The new date with the month set.\n */\n this.setMonth = (date, month) => {\n return this.overrides?.setMonth\n ? this.overrides.setMonth(date, month)\n : setMonth(date, month);\n };\n /**\n * Sets the year of the given date.\n *\n * @param date The date to set the year on.\n * @param year The year to set.\n * @returns The new date with the year set.\n */\n this.setYear = (date, year) => {\n return this.overrides?.setYear\n ? this.overrides.setYear(date, year)\n : setYear(date, year);\n };\n /**\n * Returns the start of the broadcast week for the given date.\n *\n * @param date The original date.\n * @returns The start of the broadcast week.\n */\n this.startOfBroadcastWeek = (date) => {\n return this.overrides?.startOfBroadcastWeek\n ? this.overrides.startOfBroadcastWeek(date, this)\n : startOfBroadcastWeek(date, this);\n };\n /**\n * Returns the start of the day for the given date.\n *\n * @param date The original date.\n * @returns The start of the day.\n */\n this.startOfDay = (date) => {\n return this.overrides?.startOfDay\n ? this.overrides.startOfDay(date)\n : startOfDay(date);\n };\n /**\n * Returns the start of the ISO week for the given date.\n *\n * @param date The original date.\n * @returns The start of the ISO week.\n */\n this.startOfISOWeek = (date) => {\n return this.overrides?.startOfISOWeek\n ? this.overrides.startOfISOWeek(date)\n : startOfISOWeek(date);\n };\n /**\n * Returns the start of the month for the given date.\n *\n * @param date The original date.\n * @returns The start of the month.\n */\n this.startOfMonth = (date) => {\n return this.overrides?.startOfMonth\n ? this.overrides.startOfMonth(date)\n : startOfMonth(date);\n };\n /**\n * Returns the start of the week for the given date.\n *\n * @param date The original date.\n * @returns The start of the week.\n */\n this.startOfWeek = (date) => {\n return this.overrides?.startOfWeek\n ? this.overrides.startOfWeek(date, this.options)\n : startOfWeek(date, this.options);\n };\n /**\n * Returns the start of the year for the given date.\n *\n * @param date The original date.\n * @returns The start of the year.\n */\n this.startOfYear = (date) => {\n return this.overrides?.startOfYear\n ? this.overrides.startOfYear(date)\n : startOfYear(date);\n };\n this.options = { locale: enUS, ...options };\n this.overrides = overrides;\n }\n}\n/** The default locale (English). */\nexport { enUS as defaultLocale } from \"date-fns/locale/en-US\";\n/**\n * The default date library with English locale.\n *\n * @since 9.2.0\n */\nexport const defaultDateLib = new DateLib();\n/** @deprecated Use `defaultDateLib`. */\nexport const dateLib = defaultDateLib;\n//# sourceMappingURL=DateLib.js.map","import { DayFlag, SelectionState, UI } from \"../UI.js\";\nexport function getClassNamesForModifiers(modifiers, classNames, modifiersClassNames = {}) {\n const modifierClassNames = Object.entries(modifiers)\n .filter(([, active]) => active === true)\n .reduce((previousValue, [key]) => {\n if (modifiersClassNames[key]) {\n previousValue.push(modifiersClassNames[key]);\n }\n else if (classNames[DayFlag[key]]) {\n previousValue.push(classNames[DayFlag[key]]);\n }\n else if (classNames[SelectionState[key]]) {\n previousValue.push(classNames[SelectionState[key]]);\n }\n return previousValue;\n }, [classNames[UI.Day]]);\n return modifierClassNames;\n}\n//# sourceMappingURL=getClassNamesForModifiers.js.map","import React from \"react\";\n/**\n * Render the button elements in the calendar.\n *\n * @private\n * @deprecated Use `PreviousMonthButton` or `@link NextMonthButton` instead.\n */\nexport function Button(props) {\n return React.createElement(\"button\", { ...props });\n}\n//# sourceMappingURL=Button.js.map","import React from \"react\";\n/**\n * Render the label in the month caption.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function CaptionLabel(props) {\n return React.createElement(\"span\", { ...props });\n}\n//# sourceMappingURL=CaptionLabel.js.map","import React from \"react\";\n/**\n * Render the chevron icon used in the navigation buttons and dropdowns.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function Chevron(props) {\n const { size = 24, orientation = \"left\", className } = props;\n return (React.createElement(\"svg\", { className: className, width: size, height: size, viewBox: \"0 0 24 24\" },\n orientation === \"up\" && (React.createElement(\"polygon\", { points: \"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28\" })),\n orientation === \"down\" && (React.createElement(\"polygon\", { points: \"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72\" })),\n orientation === \"left\" && (React.createElement(\"polygon\", { points: \"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20\" })),\n orientation === \"right\" && (React.createElement(\"polygon\", { points: \"8 18.612 14.1888889 12.5 8 6.37733333 9.91111111 4.5 18 12.5 9.91111111 20.5\" }))));\n}\n//# sourceMappingURL=Chevron.js.map","import React from \"react\";\n/**\n * Render the gridcell of a day in the calendar and handle the interaction and\n * the focus with they day.\n *\n * If you need to just change the content of the day cell, consider swapping the\n * `DayDate` component instead.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function Day(props) {\n const { day, modifiers, ...tdProps } = props;\n return React.createElement(\"td\", { ...tdProps });\n}\n//# sourceMappingURL=Day.js.map","import React from \"react\";\n/**\n * Render the button for a day in the calendar.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function DayButton(props) {\n const { day, modifiers, ...buttonProps } = props;\n const ref = React.useRef(null);\n React.useEffect(() => {\n if (modifiers.focused)\n ref.current?.focus();\n }, [modifiers.focused]);\n return React.createElement(\"button\", { ref: ref, ...buttonProps });\n}\n//# sourceMappingURL=DayButton.js.map","import React from \"react\";\nimport { UI } from \"../UI.js\";\n/**\n * Render a dropdown component to use in the navigation bar.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function Dropdown(props) {\n const { options, className, components, classNames, ...selectProps } = props;\n const cssClassSelect = [classNames[UI.Dropdown], className].join(\" \");\n const selectedOption = options?.find(({ value }) => value === selectProps.value);\n return (React.createElement(\"span\", { \"data-disabled\": selectProps.disabled, className: classNames[UI.DropdownRoot] },\n React.createElement(components.Select, { className: cssClassSelect, ...selectProps }, options?.map(({ value, label, disabled }) => (React.createElement(components.Option, { key: value, value: value, disabled: disabled }, label)))),\n React.createElement(\"span\", { className: classNames[UI.CaptionLabel], \"aria-hidden\": true },\n selectedOption?.label,\n React.createElement(components.Chevron, { orientation: \"down\", size: 18, className: classNames[UI.Chevron] }))));\n}\n//# sourceMappingURL=Dropdown.js.map","import React from \"react\";\n/**\n * Render the the navigation dropdowns.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function DropdownNav(props) {\n return React.createElement(\"div\", { ...props });\n}\n//# sourceMappingURL=DropdownNav.js.map","import React from \"react\";\n/**\n * Component wrapping the footer.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function Footer(props) {\n return React.createElement(\"div\", { ...props });\n}\n//# sourceMappingURL=Footer.js.map","import React from \"react\";\n/**\n * Render the grid with the weekday header row and the weeks for the given\n * month.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function Month(props) {\n const { calendarMonth, displayIndex, ...divProps } = props;\n return React.createElement(\"div\", { ...divProps }, props.children);\n}\n//# sourceMappingURL=Month.js.map","import React from \"react\";\n/**\n * Render the caption of a month in the calendar.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function MonthCaption(props) {\n const { calendarMonth, displayIndex, ...divProps } = props;\n return React.createElement(\"div\", { ...divProps });\n}\n//# sourceMappingURL=MonthCaption.js.map","import React from \"react\";\n/**\n * Render the grid of days in a month.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function MonthGrid(props) {\n return React.createElement(\"table\", { ...props });\n}\n//# sourceMappingURL=MonthGrid.js.map","import React from \"react\";\n/**\n * Component wrapping the month grids.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function Months(props) {\n return React.createElement(\"div\", { ...props });\n}\n//# sourceMappingURL=Months.js.map","import { createContext, useContext } from \"react\";\n/** @ignore */\nexport const dayPickerContext = createContext(undefined);\n/**\n * Returns the context to work with `<DayPicker />` inside custom components.\n *\n * This hook provides access to the DayPicker context, which includes various\n * properties and methods to interact with the DayPicker component. It must be\n * used within a custom component.\n *\n * @template T - Use this type to refine the returned context type with a\n * specific selection mode.\n * @returns {DayPickerContext<T>} The context to work with DayPicker.\n * @throws {Error} If the hook is used outside of a DayPicker provider.\n * @group Hooks\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function useDayPicker() {\n const context = useContext(dayPickerContext);\n if (context === undefined) {\n throw new Error(\"useDayPicker() must be used within a custom component.\");\n }\n return context;\n}\n//# sourceMappingURL=useDayPicker.js.map","import React from \"react\";\nimport { useDayPicker } from \"../useDayPicker.js\";\n/**\n * Render the dropdown to navigate between months.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function MonthsDropdown(props) {\n const { components } = useDayPicker();\n return React.createElement(components.Dropdown, { ...props });\n}\n//# sourceMappingURL=MonthsDropdown.js.map","import React from \"react\";\nimport { UI } from \"../UI.js\";\nimport { useDayPicker } from \"../useDayPicker.js\";\n/**\n * Render the toolbar with the navigation button.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function Nav(props) {\n const { onPreviousClick, onNextClick, previousMonth, nextMonth, ...navProps } = props;\n const { components, classNames, labels: { labelPrevious, labelNext } } = useDayPicker();\n return (React.createElement(\"nav\", { ...navProps },\n React.createElement(components.PreviousMonthButton, { type: \"button\", className: classNames[UI.PreviousMonthButton], tabIndex: previousMonth ? undefined : -1, disabled: previousMonth ? undefined : true, \"aria-label\": labelPrevious(previousMonth), onClick: props.onPreviousClick },\n React.createElement(components.Chevron, { disabled: previousMonth ? undefined : true, className: classNames[UI.Chevron], orientation: \"left\" })),\n React.createElement(components.NextMonthButton, { type: \"button\", className: classNames[UI.NextMonthButton], tabIndex: nextMonth ? undefined : -1, disabled: nextMonth ? undefined : true, \"aria-label\": labelNext(nextMonth), onClick: props.onNextClick },\n React.createElement(components.Chevron, { disabled: nextMonth ? undefined : true, orientation: \"right\", className: classNames[UI.Chevron] }))));\n}\n//# sourceMappingURL=Nav.js.map","import React from \"react\";\nimport { useDayPicker } from \"../useDayPicker.js\";\n/**\n * Render the next month button element in the calendar.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function NextMonthButton(props) {\n const { components } = useDayPicker();\n return React.createElement(components.Button, { ...props });\n}\n//# sourceMappingURL=NextMonthButton.js.map","import React from \"react\";\n/**\n * Render the `option` element.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function Option(props) {\n return React.createElement(\"option\", { ...props });\n}\n//# sourceMappingURL=Option.js.map","import React from \"react\";\nimport { useDayPicker } from \"../useDayPicker.js\";\n/**\n * Render the previous month button element in the calendar.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function PreviousMonthButton(props) {\n const { components } = useDayPicker();\n return React.createElement(components.Button, { ...props });\n}\n//# sourceMappingURL=PreviousMonthButton.js.map","import React from \"react\";\n/**\n * Render the root element.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function Root(props) {\n return React.createElement(\"div\", { ...props });\n}\n//# sourceMappingURL=Root.js.map","import React from \"react\";\n/**\n * Render the `select` element.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function Select(props) {\n return React.createElement(\"select\", { ...props });\n}\n//# sourceMappingURL=Select.js.map","import React from \"react\";\n/**\n * Render a row in the calendar, with the days and the week number.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function Week(props) {\n const { week, ...trProps } = props;\n return React.createElement(\"tr\", { ...trProps });\n}\n//# sourceMappingURL=Week.js.map","import React from \"react\";\n/**\n * Render the column header with the weekday name (e.g. \"Mo\", \"Tu\", etc.).\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function Weekday(props) {\n return React.createElement(\"th\", { ...props });\n}\n//# sourceMappingURL=Weekday.js.map","import React from \"react\";\n/**\n * Render the row with the weekday names.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function Weekdays(props) {\n return (React.createElement(\"thead\", { \"aria-hidden\": true },\n React.createElement(\"tr\", { ...props })));\n}\n//# sourceMappingURL=Weekdays.js.map","import React from \"react\";\n/**\n * Render the cell with the number of the week.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function WeekNumber(props) {\n const { week, ...thProps } = props;\n return React.createElement(\"th\", { ...thProps });\n}\n//# sourceMappingURL=WeekNumber.js.map","import React from \"react\";\n/**\n * Render the column header for the week numbers.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function WeekNumberHeader(props) {\n return React.createElement(\"th\", { ...props });\n}\n//# sourceMappingURL=WeekNumberHeader.js.map","import React from \"react\";\n/**\n * Render the weeks in the month grid.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function Weeks(props) {\n return React.createElement(\"tbody\", { ...props });\n}\n//# sourceMappingURL=Weeks.js.map","import React from \"react\";\nimport { useDayPicker } from \"../useDayPicker.js\";\n/**\n * Render the dropdown to navigate between years.\n *\n * @group Components\n * @see https://daypicker.dev/guides/custom-components\n */\nexport function YearsDropdown(props) {\n const { components } = useDayPicker();\n return React.createElement(components.Dropdown, { ...props });\n}\n//# sourceMappingURL=YearsDropdown.js.map","import * as components from \"../components/custom-components.js\";\nexport function getComponents(customComponents) {\n return {\n ...components,\n ...customComponents\n };\n}\n//# sourceMappingURL=getComponents.js.map","/** Return the `data-` attributes from the props. */\nexport function getDataAttributes(props) {\n const dataAttributes = {\n \"data-mode\": props.mode ?? undefined,\n \"data-required\": \"required\" in props ? props.required : undefined,\n \"data-multiple-months\": (props.numberOfMonths && props.numberOfMonths > 1) || undefined,\n \"data-week-numbers\": props.showWeekNumber || undefined,\n \"data-broadcast-calendar\": props.broadcastCalendar || undefined\n };\n Object.entries(props).forEach(([key, val]) => {\n if (key.startsWith(\"data-\")) {\n dataAttributes[key] = val;\n }\n });\n return dataAttributes;\n}\n//# sourceMappingURL=getDataAttributes.js.map","import { UI, DayFlag, SelectionState } from \"../UI.js\";\n/**\n * Get the default class names for the UI elements.\n *\n * @group Utilities\n */\nexport function getDefaultClassNames() {\n const classNames = {};\n for (const key in UI) {\n classNames[UI[key]] =\n `rdp-${UI[key]}`;\n }\n for (const key in DayFlag) {\n classNames[DayFlag[key]] =\n `rdp-${DayFlag[key]}`;\n }\n for (const key in SelectionState) {\n classNames[SelectionState[key]] =\n `rdp-${SelectionState[key]}`;\n }\n return classNames;\n}\n//# sourceMappingURL=getDefaultClassNames.js.map","import { DateLib } from \"../classes/DateLib.js\";\n/**\n * Format the caption of the month.\n *\n * @defaultValue `LLLL y` (e.g. \"November 2022\")\n * @group Formatters\n * @see https://daypicker.dev/docs/translation#custom-formatters\n */\nexport function formatCaption(month, options, dateLib) {\n return (dateLib ?? new DateLib(options)).format(month, \"LLLL y\");\n}\n/**\n * @private\n * @deprecated Use {@link formatCaption} instead.\n * @group Formatters\n */\nexport const formatMonthCaption = formatCaption;\n//# sourceMappingURL=formatCaption.js.map","import { DateLib } from \"../classes/DateLib.js\";\n/**\n * Format the day date shown in the day cell.\n *\n * @defaultValue `d` (e.g. \"1\")\n * @group Formatters\n * @see https://daypicker.dev/docs/translation#custom-formatters\n */\nexport function formatDay(date, options, dateLib) {\n return (dateLib ?? new DateLib(options)).format(date, \"d\");\n}\n//# sourceMappingURL=formatDay.js.map","/**\n * Format the month number for the dropdown option label.\n *\n * @defaultValue The localized month name\n * @group Formatters\n * @see https://daypicker.dev/docs/translation#custom-formatters\n */\nexport function formatMonthDropdown(\n/** The month number to format. */\nmonthNumber, \n/** The locale to use for formatting. */\nlocale) {\n return locale.localize?.month(monthNumber);\n}\n//# sourceMappingURL=formatMonthDropdown.js.map","/**\n * Format the week number.\n *\n * @defaultValue `weekNumber.toLocaleString()` with a leading zero for single-digit numbers\n * @group Formatters\n * @see https://daypicker.dev/docs/translation#custom-formatters\n */\nexport function formatWeekNumber(weekNumber) {\n if (weekNumber < 10) {\n return `0${weekNumber.toLocaleString()}`;\n }\n return `${weekNumber.toLocaleString()}`;\n}\n//# sourceMappingURL=formatWeekNumber.js.map","/**\n * Format the week number header.\n *\n * @defaultValue `\"\"`\n * @group Formatters\n * @see https://daypicker.dev/docs/translation#custom-formatters\n */\nexport function formatWeekNumberHeader() {\n return ``;\n}\n//# sourceMappingURL=formatWeekNumberHeader.js.map","import { DateLib } from \"../classes/DateLib.js\";\n/**\n * Format the weekday name to be displayed in the weekdays header.\n *\n * @defaultValue `cccccc` (e.g. \"Mo\" for Monday)\n * @group Formatters\n * @see https://daypicker.dev/docs/translation#custom-formatters\n */\nexport function formatWeekdayName(weekday, options, dateLib) {\n return (dateLib ?? new DateLib(options)).format(weekday, \"cccccc\");\n}\n//# sourceMappingURL=formatWeekdayName.js.map","/**\n * Format the years for the dropdown option label.\n *\n * @defaultValue `year.toString()`\n * @group Formatters\n * @see https://daypicker.dev/docs/translation#custom-formatters\n */\nexport function formatYearDropdown(year) {\n return year.toString();\n}\n/**\n * @private\n * @deprecated Use `formatYearDropdown` instead.\n * @group Formatters\n */\nexport const formatYearCaption = formatYearDropdown;\n//# sourceMappingURL=formatYearDropdown.js.map","import * as defaultFormatters from \"../formatters/index.js\";\n/** Return the formatters from the props merged with the default formatters. */\nexport function getFormatters(customFormatters) {\n if (customFormatters?.formatMonthCaption && !customFormatters.formatCaption) {\n customFormatters.formatCaption = customFormatters.formatMonthCaption;\n }\n if (customFormatters?.formatYearCaption &&\n !customFormatters.formatYearDropdown) {\n customFormatters.formatYearDropdown = customFormatters.formatYearCaption;\n }\n return {\n ...defaultFormatters,\n ...customFormatters\n };\n}\n//# sourceMappingURL=getFormatters.js.map","import { defaultLocale } from \"../classes/DateLib.js\";\n/** Return the months to show in the dropdown. */\nexport function getMonthOptions(displayMonth, navStart, navEnd, formatters, dateLib) {\n if (!navStart)\n return undefined;\n if (!navEnd)\n return undefined;\n const { addMonths, startOfMonth } = dateLib;\n const year = displayMonth.getFullYear();\n const months = [];\n let month = navStart;\n while (months.length < 12) {\n months.push(month.getMonth());\n month = addMonths(month, 1);\n }\n const sortedMonths = months.sort((a, b) => {\n return a - b;\n });\n const options = sortedMonths.map((value) => {\n const label = formatters.formatMonthDropdown(value, dateLib.options.locale ?? defaultLocale);\n const month = dateLib.Date\n ? new dateLib.Date(year, value)\n : new Date(year, value);\n const disabled = (navStart && month < startOfMonth(navStart)) ||\n (navEnd && month > startOfMonth(navEnd)) ||\n false;\n return { value, label, disabled };\n });\n return options;\n}\n//# sourceMappingURL=getMonthOptions.js.map","import { UI } from \"../UI.js\";\nexport function getStyleForModifiers(dayModifiers, styles = {}, modifiersStyles = {}) {\n let style = { ...styles?.[UI.Day] };\n Object.entries(dayModifiers)\n .filter(([, active]) => active === true)\n .forEach(([modifier]) => {\n style = {\n ...style,\n ...modifiersStyles?.[modifier]\n };\n });\n return style;\n}\n//# sourceMappingURL=getStyleForModifiers.js.map","const offsetFormatCache = {};\nconst offsetCache = {};\n\n/**\n * The function extracts UTC offset in minutes from the given date in specified\n * time zone.\n *\n * Unlike `Date.prototype.getTimezoneOffset`, this function returns the value\n * mirrored to the sign of the offset in the time zone. For Asia/Singapore\n * (UTC+8), `tzOffset` returns 480, while `getTimezoneOffset` returns -480.\n *\n * @param timeZone - Time zone name (IANA or UTC offset)\n * @param date - Date to check the offset for\n *\n * @returns UTC offset in minutes\n */\nexport function tzOffset(timeZone, date) {\n try {\n const format = offsetFormatCache[timeZone] ||= new Intl.DateTimeFormat(\"en-GB\", {\n timeZone,\n hour: \"numeric\",\n timeZoneName: \"longOffset\"\n }).format;\n const offsetStr = format(date).split('GMT')[1] || '';\n if (offsetStr in offsetCache) return offsetCache[offsetStr];\n return calcOffset(offsetStr, offsetStr.split(\":\"));\n } catch {\n // Fallback to manual parsing if the runtime doesn't support ±HH:MM/±HHMM/±HH\n // See: https://github.com/nodejs/node/issues/53419\n if (timeZone in offsetCache) return offsetCache[timeZone];\n const captures = timeZone?.match(offsetRe);\n if (captures) return calcOffset(timeZone, captures.slice(1));\n return NaN;\n }\n}\nconst offsetRe = /([+-]\\d\\d):?(\\d\\d)?/;\nfunction calcOffset(cacheStr, values) {\n const hours = +values[0];\n const minutes = +(values[1] || 0);\n return offsetCache[cacheStr] = hours > 0 ? hours * 60 + minutes : hours * 60 - minutes;\n}","import { tzOffset } from \"../tzOffset/index.js\";\nexport class TZDateMini extends Date {\n //#region static\n\n constructor(...args) {\n super();\n if (args.length > 1 && typeof args[args.length - 1] === \"string\") {\n this.timeZone = args.pop();\n }\n this.internal = new Date();\n if (isNaN(tzOffset(this.timeZone, this))) {\n this.setTime(NaN);\n } else {\n if (!args.length) {\n this.setTime(Date.now());\n } else if (typeof args[0] === \"number\" && (args.length === 1 || args.length === 2 && typeof args[1] !== \"number\")) {\n this.setTime(args[0]);\n } else if (typeof args[0] === \"string\") {\n this.setTime(+new Date(args[0]));\n } else if (args[0] instanceof Date) {\n this.setTime(+args[0]);\n } else {\n this.setTime(+new Date(...args));\n adjustToSystemTZ(this, NaN);\n syncToInternal(this);\n }\n }\n }\n static tz(tz, ...args) {\n return args.length ? new TZDateMini(...args, tz) : new TZDateMini(Date.now(), tz);\n }\n\n //#endregion\n\n //#region time zone\n\n withTimeZone(timeZone) {\n return new TZDateMini(+this, timeZone);\n }\n getTimezoneOffset() {\n return -tzOffset(this.timeZone, this);\n }\n\n //#endregion\n\n //#region time\n\n setTime(time) {\n Date.prototype.setTime.apply(this, arguments);\n syncToInternal(this);\n return +this;\n }\n\n //#endregion\n\n //#region date-fns integration\n\n [Symbol.for(\"constructDateFrom\")](date) {\n return new TZDateMini(+new Date(date), this.timeZone);\n }\n\n //#endregion\n}\n\n// Assign getters and setters\nconst re = /^(get|set)(?!UTC)/;\nObject.getOwnPropertyNames(Date.prototype).forEach(method => {\n if (!re.test(method)) return;\n const utcMethod = method.replace(re, \"$1UTC\");\n // Filter out methods without UTC counterparts\n if (!TZDateMini.prototype[utcMethod]) return;\n if (method.startsWith(\"get\")) {\n // Delegate to internal date's UTC method\n TZDateMini.prototype[method] = function () {\n return this.internal[utcMethod]();\n };\n } else {\n // Assign regular setter\n TZDateMini.prototype[method] = function () {\n Date.prototype[utcMethod].apply(this.internal, arguments);\n syncFromInternal(this);\n return +this;\n };\n\n // Assign UTC setter\n TZDateMini.prototype[utcMethod] = function () {\n Date.prototype[utcMethod].apply(this, arguments);\n syncToInternal(this);\n return +this;\n };\n }\n});\n\n/**\n * Function syncs time to internal date, applying the time zone offset.\n *\n * @param {Date} date - Date to sync\n */\nfunction syncToInternal(date) {\n date.internal.setTime(+date);\n date.internal.setUTCMinutes(date.internal.getUTCMinutes() - date.getTimezoneOffset());\n}\n\n/**\n * Function syncs the internal date UTC values to the date. It allows to get\n * accurate timestamp value.\n *\n * @param {Date} date - The date to sync\n */\nfunction syncFromInternal(date) {\n // First we transpose the internal values\n Date.prototype.setFullYear.call(date, date.internal.getUTCFullYear(), date.internal.getUTCMonth(), date.internal.getUTCDate());\n Date.prototype.setHours.call(date, date.internal.getUTCHours(), date.internal.getUTCMinutes(), date.internal.getUTCSeconds(), date.internal.getUTCMilliseconds());\n\n // Now we have to adjust the date to the system time zone\n adjustToSystemTZ(date);\n}\n\n/**\n * Function adjusts the date to the system time zone. It uses the time zone\n * differences to calculate the offset and adjust the date.\n *\n * @param {Date} date - Date to adjust\n */\nfunction adjustToSystemTZ(date) {\n // Save the time zone offset before all the adjustments\n const offset = tzOffset(date.timeZone, date);\n\n //#region System DST adjustment\n\n // The biggest problem with using the system time zone is that when we create\n // a date from internal values stored in UTC, the system time zone might end\n // up on the DST hour:\n //\n // $ TZ=America/New_York node\n // > new Date(2020, 2, 8, 1).toString()\n // 'Sun Mar 08 2020 01:00:00 GMT-0500 (Eastern Standard Time)'\n // > new Date(2020, 2, 8, 2).toString()\n // 'Sun Mar 08 2020 03:00:00 GMT-0400 (Eastern Daylight Time)'\n // > new Date(2020, 2, 8, 3).toString()\n // 'Sun Mar 08 2020 03:00:00 GMT-0400 (Eastern Daylight Time)'\n // > new Date(2020, 2, 8, 4).toString()\n // 'Sun Mar 08 2020 04:00:00 GMT-0400 (Eastern Daylight Time)'\n //\n // Here we get the same hour for both 2 and 3, because the system time zone\n // has DST beginning at 8 March 2020, 2 a.m. and jumps to 3 a.m. So we have\n // to adjust the internal date to reflect that.\n //\n // However we want to adjust only if that's the DST hour the change happenes,\n // not the hour where DST moves to.\n\n // We calculate the previous hour to see if the time zone offset has changed\n // and we have landed on the DST hour.\n const prevHour = new Date(+date);\n // We use UTC methods here as we don't want to land on the same hour again\n // in case of DST.\n prevHour.setUTCHours(prevHour.getUTCHours() - 1);\n\n // Calculate if we are on the system DST hour.\n const systemOffset = -new Date(+date).getTimezoneOffset();\n const prevHourSystemOffset = -new Date(+prevHour).getTimezoneOffset();\n const systemDSTChange = systemOffset - prevHourSystemOffset;\n // Detect the DST shift. System DST change will occur both on\n const dstShift = Date.prototype.getHours.apply(date) !== date.internal.getUTCHours();\n\n // Move the internal date when we are on the system DST hour.\n if (systemDSTChange && dstShift) date.internal.setUTCMinutes(date.internal.getUTCMinutes() + systemDSTChange);\n\n //#endregion\n\n //#region System diff adjustment\n\n // Now we need to adjust the date, since we just applied internal values.\n // We need to calculate the difference between the system and date time zones\n // and apply it to the date.\n\n const offsetDiff = systemOffset - offset;\n if (offsetDiff) Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetDiff);\n\n //#endregion\n\n //#region Post-adjustment DST fix\n\n const postOffset = tzOffset(date.timeZone, date);\n const postSystemOffset = -new Date(+date).getTimezoneOffset();\n const postOffsetDiff = postSystemOffset - postOffset;\n const offsetChanged = postOffset !== offset;\n const postDiff = postOffsetDiff - offsetDiff;\n if (offsetChanged && postDiff) {\n Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + postDiff);\n\n // Now we need to check if got offset change during the post-adjustment.\n // If so, we also need both dates to reflect that.\n\n const newOffset = tzOffset(date.timeZone, date);\n const offsetChange = postOffset - newOffset;\n if (offsetChange) {\n date.internal.setUTCMinutes(date.internal.getUTCMinutes() + offsetChange);\n Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetChange);\n }\n }\n\n //#endregion\n}","import { TZDateMini } from \"./mini.js\";\n\n/**\n * UTC date class. It maps getters and setters to corresponding UTC methods,\n * forcing all calculations in the UTC time zone.\n *\n * Combined with date-fns, it allows using the class the same way as\n * the original date class.\n *\n * This complete version provides not only getters, setters,\n * and `getTimezoneOffset`, but also the formatter functions, mirroring\n * all original `Date` functionality. Use this version when you need to format\n * a string or in an environment you don't fully control (a library).\n * For a minimal version, see `UTCDateMini`.\n */\nexport class TZDate extends TZDateMini {\n //#region static\n\n static tz(tz, ...args) {\n return args.length ? new TZDate(...args, tz) : new TZDate(Date.now(), tz);\n }\n\n //#endregion\n\n //#region representation\n\n toISOString() {\n const [sign, hours, minutes] = this.tzComponents();\n const tz = `${sign}${hours}:${minutes}`;\n return this.internal.toISOString().slice(0, -1) + tz;\n }\n toString() {\n // \"Tue Aug 13 2024 07:50:19 GMT+0800 (Singapore Standard Time)\";\n return `${this.toDateString()} ${this.toTimeString()}`;\n }\n toDateString() {\n // toUTCString returns RFC 7231 (\"Mon, 12 Aug 2024 23:36:08 GMT\")\n const [day, date, month, year] = this.internal.toUTCString().split(\" \");\n // \"Tue Aug 13 2024\"\n return `${day?.slice(0, -1) /* Remove \",\" */} ${month} ${date} ${year}`;\n }\n toTimeString() {\n // toUTCString returns RFC 7231 (\"Mon, 12 Aug 2024 23:36:08 GMT\")\n const time = this.internal.toUTCString().split(\" \")[4];\n const [sign, hours, minutes] = this.tzComponents();\n // \"07:42:23 GMT+0800 (Singapore Standard Time)\"\n return `${time} GMT${sign}${hours}${minutes} (${tzName(this.timeZone, this)})`;\n }\n toLocaleString(locales, options) {\n return Date.prototype.toLocaleString.call(this, locales, {\n ...options,\n timeZone: options?.timeZone || this.timeZone\n });\n }\n toLocaleDateString(locales, options) {\n return Date.prototype.toLocaleDateString.call(this, locales, {\n ...options,\n timeZone: options?.timeZone || this.timeZone\n });\n }\n toLocaleTimeString(locales, options) {\n return Date.prototype.toLocaleTimeString.call(this, locales, {\n ...options,\n timeZone: options?.timeZone || this.timeZone\n });\n }\n\n //#endregion\n\n //#region private\n\n tzComponents() {\n const offset = this.getTimezoneOffset();\n const sign = offset > 0 ? \"-\" : \"+\";\n const hours = String(Math.floor(Math.abs(offset) / 60)).padStart(2, \"0\");\n const minutes = String(Math.abs(offset) % 60).padStart(2, \"0\");\n return [sign, hours, minutes];\n }\n\n //#endregion\n\n withTimeZone(timeZone) {\n return new TZDate(+this, timeZone);\n }\n\n //#region date-fns integration\n\n [Symbol.for(\"constructDateFrom\")](date) {\n return new TZDate(+new Date(date), this.timeZone);\n }\n\n //#endregion\n}\nfunction tzName(tz, date) {\n return new Intl.DateTimeFormat(\"en-GB\", {\n timeZone: tz,\n timeZoneName: \"long\"\n }).format(date).slice(12);\n}","import { TZDate } from \"@date-fns/tz\";\n/**\n * Generate a series of 7 days, starting from the week, to use for formatting\n * the weekday names (Monday, Tuesday, etc.).\n */\nexport function getWeekdays(\n/** The date library. */\ndateLib, \n/** Use ISOWeek instead of locale/ */\nISOWeek, timeZone, \n/** @since 9.4.0 */\nbroadcastCalendar) {\n const date = timeZone\n ? TZDate.tz(timeZone)\n : dateLib.Date\n ? new dateLib.Date()\n : new Date();\n const start = broadcastCalendar\n ? dateLib.startOfBroadcastWeek(date, dateLib)\n : ISOWeek\n ? dateLib.startOfISOWeek(date)\n : dateLib.startOfWeek(date);\n const days = [];\n for (let i = 0; i < 7; i++) {\n const day = dateLib.addDays(start, i);\n days.push(day);\n }\n return days;\n}\n//# sourceMappingURL=getWeekdays.js.map","/** Return the years to show in the dropdown. */\nexport function getYearOptions(navStart, navEnd, formatters, dateLib) {\n if (!navStart)\n return undefined;\n if (!navEnd)\n return undefined;\n const { startOfYear, endOfYear, addYears, isBefore, isSameYear } = dateLib;\n const firstNavYear = startOfYear(navStart);\n const lastNavYear = endOfYear(navEnd);\n const years = [];\n let year = firstNavYear;\n while (isBefore(year, lastNavYear) || isSameYear(year, lastNavYear)) {\n years.push(year.getFullYear());\n year = addYears(year, 1);\n }\n return years.map((value) => {\n const label = formatters.formatYearDropdown(value);\n return {\n value,\n label,\n disabled: false\n };\n });\n}\n//# sourceMappingURL=getYearOptions.js.map","import { DateLib } from \"../classes/DateLib.js\";\n/**\n * Return an ARIA label for the month grid, that will be announced when entering\n * the grid.\n *\n * @defaultValue `LLLL y` (e.g. \"November 2022\")\n * @group Labels\n * @see https://daypicker.dev/docs/translation#aria-labels\n */\nexport function labelGrid(date, options, dateLib) {\n return (dateLib ?? new DateLib(options)).format(date, \"LLLL y\");\n}\n/**\n * @deprecated Use {@link labelGrid} instead.\n * @protected\n */\nexport const labelCaption = labelGrid;\n//# sourceMappingURL=labelGrid.js.map","import { DateLib } from \"../classes/DateLib.js\";\n/**\n * The label for the day gridcell when the calendar is not interactive.\n *\n * @group Labels\n * @see https://daypicker.dev/docs/translation#aria-labels\n */\nexport function labelGridcell(date, \n/** The modifiers for the day. */\nmodifiers, options, dateLib) {\n let label = (dateLib ?? new DateLib(options)).format(date, \"PPPP\");\n if (modifiers?.today) {\n label = `Today, ${label}`;\n }\n return label;\n}\n//# sourceMappingURL=labelGridcell.js.map","import { DateLib } from \"../classes/DateLib.js\";\n/**\n * The ARIA label for the day button.\n *\n * Use the `modifiers` argument to add additional context to the label, e.g.\n * when a day is selected or is today.\n *\n * @defaultValue The formatted date.\n * @group Labels\n * @see https://daypicker.dev/docs/translation#aria-labels\n */\nexport function labelDayButton(date, \n/** The modifiers for the day. */\nmodifiers, options, dateLib) {\n let label = (dateLib ?? new DateLib(options)).format(date, \"PPPP\");\n if (modifiers.today)\n label = `Today, ${label}`;\n if (modifiers.selected)\n label = `${label}, selected`;\n return label;\n}\n/** @deprecated Use `labelDayButton` instead. */\nexport const labelDay = labelDayButton;\n//# sourceMappingURL=labelDayButton.js.map","/**\n * The ARIA label for the navigation toolbar.\n *\n * @defaultValue `\"\"`\n * @group Labels\n * @see https://daypicker.dev/docs/translation#aria-labels\n */\nexport function labelNav() {\n return \"\";\n}\n//# sourceMappingURL=labelNav.js.map","/**\n * The ARIA label for the months dropdown.\n *\n * @defaultValue `\"Choose the Month\"`\n * @group Labels\n * @see https://daypicker.dev/docs/translation#aria-labels\n */\nexport function labelMonthDropdown(options) {\n return \"Choose the Month\";\n}\n//# sourceMappingURL=labelMonthDropdown.js.map","/**\n * The ARIA label for next month button.\n *\n * @defaultValue `\"Go to the Next Month\"`\n * @group Labels\n * @see https://daypicker.dev/docs/translation#aria-labels\n */\nexport function labelNext(\n/** `undefined` where there's no next month to navigate to. */\nmonth) {\n return \"Go to the Next Month\";\n}\n//# sourceMappingURL=labelNext.js.map","/**\n * The ARIA label for previous month button.\n *\n * @defaultValue `\"Go to the Previous Month\"`\n * @group Labels\n * @see https://daypicker.dev/docs/translation#aria-labels\n */\nexport function labelPrevious(\n/** Undefined where there's no previous month to navigate to. */\nmonth) {\n return \"Go to the Previous Month\";\n}\n//# sourceMappingURL=labelPrevious.js.map","import { DateLib } from \"../classes/DateLib.js\";\n/**\n * The ARIA label for the Weekday column header.\n *\n * @defaultValue `\"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\", \"Sunday\"`\n * @group Labels\n * @see https://daypicker.dev/docs/translation#aria-labels\n */\nexport function labelWeekday(date, options, dateLib) {\n return (dateLib ?? new DateLib(options)).format(date, \"cccc\");\n}\n//# sourceMappingURL=labelWeekday.js.map","/**\n * The ARIA label for the week number cell (the first cell in the row).\n *\n * @defaultValue `Week ${weekNumber}`\n * @group Labels\n * @see https://daypicker.dev/docs/translation#aria-labels\n */\nexport function labelWeekNumber(weekNumber, options) {\n return `Week ${weekNumber}`;\n}\n//# sourceMappingURL=labelWeekNumber.js.map","/**\n * The ARIA label for the week number header element.\n *\n * @defaultValue `\"Week Number\"`\n * @group Labels\n * @see https://daypicker.dev/docs/translation#aria-labels\n */\nexport function labelWeekNumberHeader(options) {\n return \"Week Number\";\n}\n//# sourceMappingURL=labelWeekNumberHeader.js.map","/**\n * The ARIA label for the years dropdown.\n *\n * @defaultValue `\"Choose the Year\"`\n * @group Labels\n * @see https://daypicker.dev/docs/translation#aria-labels\n */\nexport function labelYearDropdown(options) {\n return \"Choose the Year\";\n}\n//# sourceMappingURL=labelYearDropdown.js.map","/** Return all the dates to display in the calendar. */\nexport function getDates(displayMonths, maxDate, props, dateLib) {\n const firstMonth = displayMonths[0];\n const lastMonth = displayMonths[displayMonths.length - 1];\n const { ISOWeek, fixedWeeks, broadcastCalendar } = props ?? {};\n const { addDays, differenceInCalendarDays, differenceInCalendarMonths, endOfBroadcastWeek, endOfISOWeek, endOfMonth, endOfWeek, isAfter, startOfBroadcastWeek, startOfISOWeek, startOfWeek } = dateLib;\n const startWeekFirstDate = broadcastCalendar\n ? startOfBroadcastWeek(firstMonth, dateLib)\n : ISOWeek\n ? startOfISOWeek(firstMonth)\n : startOfWeek(firstMonth);\n const endWeekLastDate = broadcastCalendar\n ? endOfBroadcastWeek(lastMonth, dateLib)\n : ISOWeek\n ? endOfISOWeek(endOfMonth(lastMonth))\n : endOfWeek(endOfMonth(lastMonth));\n const nOfDays = differenceInCalendarDays(endWeekLastDate, startWeekFirstDate);\n const nOfMonths = differenceInCalendarMonths(lastMonth, firstMonth) + 1;\n const dates = [];\n for (let i = 0; i <= nOfDays; i++) {\n const date = addDays(startWeekFirstDate, i);\n if (maxDate && isAfter(date, maxDate)) {\n break;\n }\n dates.push(date);\n }\n // If fixed weeks is enabled, add the extra dates to the array\n const nrOfDaysWithFixedWeeks = broadcastCalendar ? 35 : 42;\n const extraDates = nrOfDaysWithFixedWeeks * nOfMonths;\n if (fixedWeeks && dates.length < extraDates) {\n const daysToAdd = extraDates - dates.length;\n for (let i = 0; i < daysToAdd; i++) {\n const date = addDays(dates[dates.length - 1], 1);\n dates.push(date);\n }\n }\n return dates;\n}\n//# sourceMappingURL=getDates.js.map","/**\n * Returns all the days belonging to the calendar by merging the days in the\n * weeks for each month.\n */\nexport function getDays(calendarMonths) {\n const initialDays = [];\n return calendarMonths.reduce((days, month) => {\n const initialDays = [];\n const weekDays = month.weeks.reduce((weekDays, week) => {\n return [...weekDays, ...week.days];\n }, initialDays);\n return [...days, ...weekDays];\n }, initialDays);\n}\n//# sourceMappingURL=getDays.js.map","export function getDisplayMonths(firstDisplayedMonth, calendarEndMonth, props, dateLib) {\n const { numberOfMonths = 1 } = props;\n const months = [];\n for (let i = 0; i < numberOfMonths; i++) {\n const month = dateLib.addMonths(firstDisplayedMonth, i);\n if (calendarEndMonth && month > calendarEndMonth) {\n break;\n }\n months.push(month);\n }\n return months;\n}\n//# sourceMappingURL=getDisplayMonths.js.map","import { TZDate } from \"@date-fns/tz\";\n/** Return the start month based on the props passed to DayPicker. */\nexport function getInitialMonth(props, dateLib) {\n const { month, defaultMonth, today = props.timeZone\n ? TZDate.tz(props.timeZone)\n : dateLib.Date\n ? new dateLib.Date()\n : new Date(), numberOfMonths = 1, endMonth, startMonth } = props;\n let initialMonth = month || defaultMonth || today;\n const { differenceInCalendarMonths, addMonths, startOfMonth } = dateLib;\n // Fix the initialMonth if is after the to-date\n if (endMonth && differenceInCalendarMonths(endMonth, initialMonth) < 0) {\n const offset = -1 * (numberOfMonths - 1);\n initialMonth = addMonths(endMonth, offset);\n }\n // Fix the initialMonth if is before the from-date\n if (startMonth && differenceInCalendarMonths(initialMonth, startMonth) < 0) {\n initialMonth = startMonth;\n }\n return startOfMonth(initialMonth);\n}\n//# sourceMappingURL=getInitialMonth.js.map","import { defaultDateLib } from \"./DateLib.js\";\n/**\n * Represent the day displayed in the calendar.\n *\n * In DayPicker, a `Day` is a `Date` that can be displayed in the calendar. It\n * is used as extension of the native `Date` object to provide additional\n * information about the day.\n */\nexport class CalendarDay {\n constructor(date, displayMonth, dateLib = defaultDateLib) {\n this.date = date;\n this.displayMonth = displayMonth;\n this.outside = Boolean(displayMonth && !dateLib.isSameMonth(date, displayMonth));\n this.dateLib = dateLib;\n }\n /**\n * Check if the day is the same as the given day: considering if it is in the\n * same display month.\n */\n isEqualTo(day) {\n return (this.dateLib.isSameDay(day.date, this.date) &&\n this.dateLib.isSameMonth(day.displayMonth, this.displayMonth));\n }\n}\n//# sourceMappingURL=CalendarDay.js.map","/** Represent a month in a calendar year. Contains the weeks within the month. */\nexport class CalendarMonth {\n constructor(month, weeks) {\n this.date = month;\n this.weeks = weeks;\n }\n}\n//# sourceMappingURL=CalendarMonth.js.map","/** Represent a week in a calendar month. */\nexport class CalendarWeek {\n constructor(weekNumber, days) {\n this.days = days;\n this.weekNumber = weekNumber;\n }\n}\n//# sourceMappingURL=CalendarWeek.js.map","import { CalendarWeek, CalendarDay, CalendarMonth } from \"../classes/index.js\";\n/** Return the months to display in the calendar. */\nexport function getMonths(\n/** The months (as dates) to display in the calendar. */\ndisplayMonths, \n/** The dates to display in the calendar. */\ndates, \n/** Options from the props context. */\nprops, dateLib) {\n const { addDays, endOfBroadcastWeek, endOfISOWeek, endOfMonth, endOfWeek, getISOWeek, getWeek, startOfBroadcastWeek, startOfISOWeek, startOfWeek } = dateLib;\n const dayPickerMonths = displayMonths.reduce((months, month) => {\n const firstDateOfFirstWeek = props.broadcastCalendar\n ? startOfBroadcastWeek(month, dateLib)\n : props.ISOWeek\n ? startOfISOWeek(month)\n : startOfWeek(month);\n const lastDateOfLastWeek = props.broadcastCalendar\n ? endOfBroadcastWeek(month, dateLib)\n : props.ISOWeek\n ? endOfISOWeek(endOfMonth(month))\n : endOfWeek(endOfMonth(month));\n /** The dates to display in the month. */\n const monthDates = dates.filter((date) => {\n return date >= firstDateOfFirstWeek && date <= lastDateOfLastWeek;\n });\n const nrOfDaysWithFixedWeeks = props.broadcastCalendar ? 35 : 42;\n if (props.fixedWeeks && monthDates.length < nrOfDaysWithFixedWeeks) {\n const extraDates = dates.filter((date) => {\n const daysToAdd = nrOfDaysWithFixedWeeks - monthDates.length;\n return (date > lastDateOfLastWeek &&\n date <= addDays(lastDateOfLastWeek, daysToAdd));\n });\n monthDates.push(...extraDates);\n }\n const weeks = monthDates.reduce((weeks, date) => {\n const weekNumber = props.ISOWeek ? getISOWeek(date) : getWeek(date);\n const week = weeks.find((week) => week.weekNumber === weekNumber);\n const day = new CalendarDay(date, month, dateLib);\n if (!week) {\n weeks.push(new CalendarWeek(weekNumber, [day]));\n }\n else {\n week.days.push(day);\n }\n return weeks;\n }, []);\n const dayPickerMonth = new CalendarMonth(month, weeks);\n months.push(dayPickerMonth);\n return months;\n }, []);\n if (!props.reverseMonths) {\n return dayPickerMonths;\n }\n else {\n return dayPickerMonths.reverse();\n }\n}\n//# sourceMappingURL=getMonths.js.map","import { TZDate } from \"@date-fns/tz\";\n/** Return the start and end months for the calendar navigation. */\nexport function getNavMonths(props, dateLib) {\n let { startMonth, endMonth } = props;\n const { startOfYear, startOfDay, startOfMonth, endOfMonth, addYears, endOfYear } = dateLib;\n // Handle deprecated code\n const { fromYear, toYear, fromMonth, toMonth } = props;\n if (!startMonth && fromMonth) {\n startMonth = fromMonth;\n }\n if (!startMonth && fromYear) {\n startMonth = new Date(fromYear, 0, 1);\n }\n if (!endMonth && toMonth) {\n endMonth = toMonth;\n }\n if (!endMonth && toYear) {\n endMonth = new Date(toYear, 11, 31);\n }\n const hasDropdowns = props.captionLayout?.startsWith(\"dropdown\");\n if (startMonth) {\n startMonth = startOfMonth(startMonth);\n }\n else if (fromYear) {\n startMonth = new Date(fromYear, 0, 1);\n }\n else if (!startMonth && hasDropdowns) {\n const today = props.today ??\n (props.timeZone\n ? TZDate.tz(props.timeZone)\n : dateLib.Date\n ? new dateLib.Date()\n : new Date());\n startMonth = startOfYear(addYears(today, -100));\n }\n if (endMonth) {\n endMonth = endOfMonth(endMonth);\n }\n else if (toYear) {\n endMonth = new Date(toYear, 11, 31);\n }\n else if (!endMonth && hasDropdowns) {\n const today = props.today ??\n (props.timeZone\n ? TZDate.tz(props.timeZone)\n : dateLib.Date\n ? new dateLib.Date()\n : new Date());\n endMonth = endOfYear(today);\n }\n return [\n startMonth ? startOfDay(startMonth) : startMonth,\n endMonth ? startOfDay(endMonth) : endMonth\n ];\n}\n//# sourceMappingURL=getNavMonth.js.map","/**\n * Return the next month the user can navigate to according to the given\n * options.\n *\n * Please note that the next month is not always the next calendar month:\n *\n * - If after the `calendarEndMonth` range, is `undefined`;\n * - If the navigation is paged , is the number of months displayed ahead.\n */\nexport function getNextMonth(firstDisplayedMonth, calendarEndMonth, options, dateLib) {\n if (options.disableNavigation) {\n return undefined;\n }\n const { pagedNavigation, numberOfMonths = 1 } = options;\n const { startOfMonth, addMonths, differenceInCalendarMonths } = dateLib;\n const offset = pagedNavigation ? numberOfMonths : 1;\n const month = startOfMonth(firstDisplayedMonth);\n if (!calendarEndMonth) {\n return addMonths(month, offset);\n }\n const monthsDiff = differenceInCalendarMonths(calendarEndMonth, firstDisplayedMonth);\n if (monthsDiff < numberOfMonths) {\n return undefined;\n }\n // Jump forward as the number of months when paged navigation\n return addMonths(month, offset);\n}\n//# sourceMappingURL=getNextMonth.js.map","/**\n * Return the next previous the user can navigate to, according to the given\n * options.\n *\n * Please note that the previous month is not always the previous calendar\n * month:\n *\n * - If before the `calendarStartMonth` date, is `undefined`;\n * - If the navigation is paged, is the number of months displayed before.\n */\nexport function getPreviousMonth(firstDisplayedMonth, calendarStartMonth, options, dateLib) {\n if (options.disableNavigation) {\n return undefined;\n }\n const { pagedNavigation, numberOfMonths } = options;\n const { startOfMonth, addMonths, differenceInCalendarMonths } = dateLib;\n const offset = pagedNavigation ? (numberOfMonths ?? 1) : 1;\n const month = startOfMonth(firstDisplayedMonth);\n if (!calendarStartMonth) {\n return addMonths(month, -offset);\n }\n const monthsDiff = differenceInCalendarMonths(month, calendarStartMonth);\n if (monthsDiff <= 0) {\n return undefined;\n }\n return addMonths(month, -offset);\n}\n//# sourceMappingURL=getPreviousMonth.js.map","/** Returns an array of calendar weeks from an array of calendar months. */\nexport function getWeeks(months) {\n const initialWeeks = [];\n return months.reduce((weeks, month) => {\n return [...weeks, ...month.weeks];\n }, initialWeeks);\n}\n//# sourceMappingURL=getWeeks.js.map","import { useState } from \"react\";\n/**\n * A custom hook for managing both controlled and uncontrolled component states.\n *\n * @example\n * // Uncontrolled usage\n * const [value, setValue] = useControlledValue(0, undefined);\n *\n * // Controlled usage\n * const [value, setValue] = useControlledValue(0, props.value);\n *\n * @template T - The type of the value.\n * @param {T} defaultValue - The initial value for the uncontrolled state.\n * @param {T | undefined} controlledValue - The value for the controlled state.\n * If undefined, the component will use the uncontrolled state.\n * @returns {[T, DispatchStateAction<T>]} - Returns a tuple where the first\n * element is the current value (either controlled or uncontrolled) and the\n * second element is a setter function to update the value.\n */\nexport function useControlledValue(defaultValue, controlledValue) {\n const [uncontrolledValue, setValue] = useState(defaultValue);\n const value = controlledValue === undefined ? uncontrolledValue : controlledValue;\n return [value, setValue];\n}\n//# sourceMappingURL=useControlledValue.js.map","import { useEffect } from \"react\";\nimport { getDates } from \"./helpers/getDates.js\";\nimport { getDays } from \"./helpers/getDays.js\";\nimport { getDisplayMonths } from \"./helpers/getDisplayMonths.js\";\nimport { getInitialMonth } from \"./helpers/getInitialMonth.js\";\nimport { getMonths } from \"./helpers/getMonths.js\";\nimport { getNavMonths } from \"./helpers/getNavMonth.js\";\nimport { getNextMonth } from \"./helpers/getNextMonth.js\";\nimport { getPreviousMonth } from \"./helpers/getPreviousMonth.js\";\nimport { getWeeks } from \"./helpers/getWeeks.js\";\nimport { useControlledValue } from \"./helpers/useControlledValue.js\";\n/** @private */\nexport function useCalendar(props, dateLib) {\n const [navStart, navEnd] = getNavMonths(props, dateLib);\n const { startOfMonth, endOfMonth } = dateLib;\n const initialMonth = getInitialMonth(props, dateLib);\n const [firstMonth, setFirstMonth] = useControlledValue(initialMonth, props.month ? startOfMonth(props.month) : undefined);\n useEffect(() => {\n const newInitialMonth = getInitialMonth(props, dateLib);\n setFirstMonth(newInitialMonth);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [props.timeZone]);\n /** The months displayed in the calendar. */\n const displayMonths = getDisplayMonths(firstMonth, navEnd, props, dateLib);\n /** The dates displayed in the calendar. */\n const dates = getDates(displayMonths, props.endMonth ? endOfMonth(props.endMonth) : undefined, props, dateLib);\n /** The Months displayed in the calendar. */\n const months = getMonths(displayMonths, dates, props, dateLib);\n /** The Weeks displayed in the calendar. */\n const weeks = getWeeks(months);\n /** The Days displayed in the calendar. */\n const days = getDays(months);\n const previousMonth = getPreviousMonth(firstMonth, navStart, props, dateLib);\n const nextMonth = getNextMonth(firstMonth, navEnd, props, dateLib);\n const { disableNavigation, onMonthChange } = props;\n const isDayInCalendar = (day) => weeks.some((week) => week.days.some((d) => d.isEqualTo(day)));\n const goToMonth = (date) => {\n if (disableNavigation) {\n return;\n }\n let newMonth = startOfMonth(date);\n // if month is before start, use the first month instead\n if (navStart && newMonth < startOfMonth(navStart)) {\n newMonth = startOfMonth(navStart);\n }\n // if month is after endMonth, use the last month instead\n if (navEnd && newMonth > startOfMonth(navEnd)) {\n newMonth = startOfMonth(navEnd);\n }\n setFirstMonth(newMonth);\n onMonthChange?.(newMonth);\n };\n const goToDay = (day) => {\n // is this check necessary?\n if (isDayInCalendar(day)) {\n return;\n }\n goToMonth(day.date);\n };\n const calendar = {\n months,\n weeks,\n days,\n navStart,\n navEnd,\n previousMonth,\n nextMonth,\n goToMonth,\n goToDay\n };\n return calendar;\n}\n//# sourceMappingURL=useCalendar.js.map","import { DayFlag } from \"../UI.js\";\nexport function calculateFocusTarget(days, getModifiers, isSelected, lastFocused) {\n let focusTarget;\n let index = 0;\n let found = false;\n while (index < days.length && !found) {\n const day = days[index];\n const modifiers = getModifiers(day);\n if (!modifiers[DayFlag.disabled] &&\n !modifiers[DayFlag.hidden] &&\n !modifiers[DayFlag.outside]) {\n if (modifiers[DayFlag.focused]) {\n focusTarget = day;\n found = true;\n }\n else if (lastFocused?.isEqualTo(day)) {\n focusTarget = day;\n found = true;\n }\n else if (isSelected(day.date)) {\n focusTarget = day;\n found = true;\n }\n else if (modifiers[DayFlag.today]) {\n focusTarget = day;\n found = true;\n }\n }\n index++;\n }\n if (!focusTarget) {\n // return the first day that is focusable\n focusTarget = days.find((day) => {\n const m = getModifiers(day);\n return !m[DayFlag.disabled] && !m[DayFlag.hidden] && !m[DayFlag.outside];\n });\n }\n return focusTarget;\n}\n//# sourceMappingURL=calculateFocusTarget.js.map","import { defaultDateLib } from \"../classes/index.js\";\n/**\n * Determines whether a given date is inside a specified date range.\n *\n * @since 9.0.0\n * @group Utilities\n */\nexport function rangeIncludesDate(range, date, \n/** If `true`, the ends of the range are excluded. */\nexcludeEnds = false, dateLib = defaultDateLib) {\n let { from, to } = range;\n const { differenceInCalendarDays, isSameDay } = dateLib;\n if (from && to) {\n const isRangeInverted = differenceInCalendarDays(to, from) < 0;\n if (isRangeInverted) {\n [from, to] = [to, from];\n }\n const isInRange = differenceInCalendarDays(date, from) >= (excludeEnds ? 1 : 0) &&\n differenceInCalendarDays(to, date) >= (excludeEnds ? 1 : 0);\n return isInRange;\n }\n if (!excludeEnds && to) {\n return isSameDay(to, date);\n }\n if (!excludeEnds && from) {\n return isSameDay(from, date);\n }\n return false;\n}\n/**\n * @private\n * @deprecated Use {@link rangeIncludesDate} instead.\n */\nexport const isDateInRange = (range, date) => rangeIncludesDate(range, date, false, defaultDateLib);\n//# sourceMappingURL=rangeIncludesDate.js.map","/**\n * Returns true if `matcher` is of type {@link DateInterval}.\n *\n * @group Utilities\n */\nexport function isDateInterval(matcher) {\n return Boolean(matcher &&\n typeof matcher === \"object\" &&\n \"before\" in matcher &&\n \"after\" in matcher);\n}\n/**\n * Returns true if `value` is a {@link DateRange} type.\n *\n * @group Utilities\n */\nexport function isDateRange(value) {\n return Boolean(value && typeof value === \"object\" && \"from\" in value);\n}\n/**\n * Returns true if `value` is of type {@link DateAfter}.\n *\n * @group Utilities\n */\nexport function isDateAfterType(value) {\n return Boolean(value && typeof value === \"object\" && \"after\" in value);\n}\n/**\n * Returns true if `value` is of type {@link DateBefore}.\n *\n * @group Utilities\n */\nexport function isDateBeforeType(value) {\n return Boolean(value && typeof value === \"object\" && \"before\" in value);\n}\n/**\n * Returns true if `value` is a {@link DayOfWeek} type.\n *\n * @group Utilities\n */\nexport function isDayOfWeekType(value) {\n return Boolean(value && typeof value === \"object\" && \"dayOfWeek\" in value);\n}\n/**\n * Returns true if `value` is an array of valid dates.\n *\n * @private\n */\nexport function isDatesArray(value, dateLib) {\n return Array.isArray(value) && value.every(dateLib.isDate);\n}\n//# sourceMappingURL=typeguards.js.map","import { defaultDateLib } from \"../classes/DateLib.js\";\nimport { rangeIncludesDate } from \"./rangeIncludesDate.js\";\nimport { isDateAfterType, isDateBeforeType, isDateInterval, isDateRange, isDatesArray, isDayOfWeekType } from \"./typeguards.js\";\n/**\n * Returns whether a day matches against at least one of the given\n * {@link Matcher}.\n *\n * ```tsx\n * const date = new Date(2022, 5, 19);\n * const matcher1: DateRange = {\n * from: new Date(2021, 12, 21),\n * to: new Date(2021, 12, 30)\n * };\n * const matcher2: DateRange = {\n * from: new Date(2022, 5, 1),\n * to: new Date(2022, 5, 23)\n * };\n * dateMatchModifiers(date, [matcher1, matcher2]); // true, since day is in the matcher1 range.\n * ```\n *\n * @group Utilities\n */\nexport function dateMatchModifiers(date, matchers, dateLib = defaultDateLib) {\n const matchersArr = !Array.isArray(matchers) ? [matchers] : matchers;\n const { isSameDay, differenceInCalendarDays, isAfter } = dateLib;\n return matchersArr.some((matcher) => {\n if (typeof matcher === \"boolean\") {\n return matcher;\n }\n if (dateLib.isDate(matcher)) {\n return isSameDay(date, matcher);\n }\n if (isDatesArray(matcher, dateLib)) {\n return matcher.includes(date);\n }\n if (isDateRange(matcher)) {\n return rangeIncludesDate(matcher, date, false, dateLib);\n }\n if (isDayOfWeekType(matcher)) {\n if (!Array.isArray(matcher.dayOfWeek)) {\n return matcher.dayOfWeek === date.getDay();\n }\n return matcher.dayOfWeek.includes(date.getDay());\n }\n if (isDateInterval(matcher)) {\n const diffBefore = differenceInCalendarDays(matcher.before, date);\n const diffAfter = differenceInCalendarDays(matcher.after, date);\n const isDayBefore = diffBefore > 0;\n const isDayAfter = diffAfter < 0;\n const isClosedInterval = isAfter(matcher.before, matcher.after);\n if (isClosedInterval) {\n return isDayAfter && isDayBefore;\n }\n else {\n return isDayBefore || isDayAfter;\n }\n }\n if (isDateAfterType(matcher)) {\n return differenceInCalendarDays(date, matcher.after) > 0;\n }\n if (isDateBeforeType(matcher)) {\n return differenceInCalendarDays(matcher.before, date) > 0;\n }\n if (typeof matcher === \"function\") {\n return matcher(date);\n }\n return false;\n });\n}\n/**\n * @private\n * @deprecated Use {@link dateMatchModifiers} instead.\n */\nexport const isMatch = dateMatchModifiers;\n//# sourceMappingURL=dateMatchModifiers.js.map","/** Return the next date that should be focused. */\nexport function getFocusableDate(moveBy, moveDir, refDate, navStart, navEnd, props, dateLib) {\n const { ISOWeek, broadcastCalendar } = props;\n const { addDays, addMonths, addWeeks, addYears, endOfBroadcastWeek, endOfISOWeek, endOfWeek, max, min, startOfBroadcastWeek, startOfISOWeek, startOfWeek } = dateLib;\n const moveFns = {\n day: addDays,\n week: addWeeks,\n month: addMonths,\n year: addYears,\n startOfWeek: (date) => broadcastCalendar\n ? startOfBroadcastWeek(date, dateLib)\n : ISOWeek\n ? startOfISOWeek(date)\n : startOfWeek(date),\n endOfWeek: (date) => broadcastCalendar\n ? endOfBroadcastWeek(date, dateLib)\n : ISOWeek\n ? endOfISOWeek(date)\n : endOfWeek(date)\n };\n let focusableDate = moveFns[moveBy](refDate, moveDir === \"after\" ? 1 : -1);\n if (moveDir === \"before\" && navStart) {\n focusableDate = max([navStart, focusableDate]);\n }\n else if (moveDir === \"after\" && navEnd) {\n focusableDate = min([navEnd, focusableDate]);\n }\n return focusableDate;\n}\n//# sourceMappingURL=getFocusableDate.js.map","import { CalendarDay } from \"../classes/index.js\";\nimport { dateMatchModifiers } from \"../utils/dateMatchModifiers.js\";\nimport { getFocusableDate } from \"./getFocusableDate.js\";\nexport function getNextFocus(moveBy, moveDir, \n/** The date that is currently focused. */\nrefDay, calendarStartMonth, calendarEndMonth, props, dateLib, attempt = 0) {\n if (attempt > 365) {\n // Limit the recursion to 365 attempts\n return undefined;\n }\n const focusableDate = getFocusableDate(moveBy, moveDir, refDay.date, // should be refDay? or refDay.date?\n calendarStartMonth, calendarEndMonth, props, dateLib);\n const isDisabled = Boolean(props.disabled && dateMatchModifiers(focusableDate, props.disabled, dateLib));\n const isHidden = Boolean(props.hidden && dateMatchModifiers(focusableDate, props.hidden, dateLib));\n const targetMonth = focusableDate;\n const focusDay = new CalendarDay(focusableDate, targetMonth, dateLib);\n if (!isDisabled && !isHidden) {\n return focusDay;\n }\n // Recursively attempt to find the next focusable date\n return getNextFocus(moveBy, moveDir, focusDay, calendarStartMonth, calendarEndMonth, props, dateLib, attempt + 1);\n}\n//# sourceMappingURL=getNextFocus.js.map","import { useState } from \"react\";\nimport { calculateFocusTarget } from \"./helpers/calculateFocusTarget.js\";\nimport { getNextFocus } from \"./helpers/getNextFocus.js\";\n/** @private */\nexport function useFocus(props, calendar, getModifiers, isSelected, dateLib) {\n const { autoFocus } = props;\n const [lastFocused, setLastFocused] = useState();\n const focusTarget = calculateFocusTarget(calendar.days, getModifiers, isSelected || (() => false), lastFocused);\n const [focusedDay, setFocused] = useState(autoFocus ? focusTarget : undefined);\n const blur = () => {\n setLastFocused(focusedDay);\n setFocused(undefined);\n };\n const moveFocus = (moveBy, moveDir) => {\n if (!focusedDay)\n return;\n const nextFocus = getNextFocus(moveBy, moveDir, focusedDay, calendar.navStart, calendar.navEnd, props, dateLib);\n if (!nextFocus)\n return;\n calendar.goToDay(nextFocus);\n setFocused(nextFocus);\n };\n const isFocusTarget = (day) => {\n return Boolean(focusTarget?.isEqualTo(day));\n };\n const useFocus = {\n isFocusTarget,\n setFocused,\n focused: focusedDay,\n blur,\n moveFocus\n };\n return useFocus;\n}\n//# sourceMappingURL=useFocus.js.map","import { TZDate } from \"@date-fns/tz\";\nimport { DayFlag } from \"./UI.js\";\nimport { dateMatchModifiers } from \"./utils/dateMatchModifiers.js\";\n/**\n * Return a function to get the modifiers for a given day.\n *\n * NOTE: this is not an hook, but a factory for `getModifiers`.\n *\n * @private\n */\nexport function useGetModifiers(days, props, dateLib) {\n const { disabled, hidden, modifiers, showOutsideDays, broadcastCalendar, today } = props;\n const { isSameDay, isSameMonth, startOfMonth, isBefore, endOfMonth, isAfter } = dateLib;\n const startMonth = props.startMonth && startOfMonth(props.startMonth);\n const endMonth = props.endMonth && endOfMonth(props.endMonth);\n const internalModifiersMap = {\n [DayFlag.focused]: [],\n [DayFlag.outside]: [],\n [DayFlag.disabled]: [],\n [DayFlag.hidden]: [],\n [DayFlag.today]: []\n };\n const customModifiersMap = {};\n for (const day of days) {\n const { date, displayMonth } = day;\n const isOutside = Boolean(displayMonth && !isSameMonth(date, displayMonth));\n const isBeforeStartMonth = Boolean(startMonth && isBefore(date, startMonth));\n const isAfterEndMonth = Boolean(endMonth && isAfter(date, endMonth));\n const isDisabled = Boolean(disabled && dateMatchModifiers(date, disabled, dateLib));\n const isHidden = Boolean(hidden && dateMatchModifiers(date, hidden, dateLib)) ||\n isBeforeStartMonth ||\n isAfterEndMonth ||\n // Broadcast calendar will show outside days as default\n (!broadcastCalendar && !showOutsideDays && isOutside) ||\n (broadcastCalendar && showOutsideDays === false && isOutside);\n const isToday = isSameDay(date, today ??\n (props.timeZone\n ? TZDate.tz(props.timeZone)\n : dateLib.Date\n ? new dateLib.Date()\n : new Date()));\n if (isOutside)\n internalModifiersMap.outside.push(day);\n if (isDisabled)\n internalModifiersMap.disabled.push(day);\n if (isHidden)\n internalModifiersMap.hidden.push(day);\n if (isToday)\n internalModifiersMap.today.push(day);\n // Add custom modifiers\n if (modifiers) {\n Object.keys(modifiers).forEach((name) => {\n const modifierValue = modifiers?.[name];\n const isMatch = modifierValue\n ? dateMatchModifiers(date, modifierValue, dateLib)\n : false;\n if (!isMatch)\n return;\n if (customModifiersMap[name]) {\n customModifiersMap[name].push(day);\n }\n else {\n customModifiersMap[name] = [day];\n }\n });\n }\n }\n return (day) => {\n // Initialize all the modifiers to false\n const dayFlags = {\n [DayFlag.focused]: false,\n [DayFlag.disabled]: false,\n [DayFlag.hidden]: false,\n [DayFlag.outside]: false,\n [DayFlag.today]: false\n };\n const customModifiers = {};\n // Find the modifiers for the given day\n for (const name in internalModifiersMap) {\n const days = internalModifiersMap[name];\n dayFlags[name] = days.some((d) => d === day);\n }\n for (const name in customModifiersMap) {\n customModifiers[name] = customModifiersMap[name].some((d) => d === day);\n }\n return {\n ...dayFlags,\n // custom modifiers should override all the previous ones\n ...customModifiers\n };\n };\n}\n//# sourceMappingURL=useGetModifiers.js.map","import { useControlledValue } from \"../helpers/useControlledValue.js\";\nexport function useMulti(props, dateLib) {\n const { selected: initiallySelected, required, onSelect } = props;\n const [internallySelected, setSelected] = useControlledValue(initiallySelected, onSelect ? initiallySelected : undefined);\n const selected = !onSelect ? internallySelected : initiallySelected;\n const { isSameDay } = dateLib;\n const isSelected = (date) => {\n return selected?.some((d) => isSameDay(d, date)) ?? false;\n };\n const { min, max } = props;\n const select = (triggerDate, modifiers, e) => {\n let newDates = [...(selected ?? [])];\n if (isSelected(triggerDate)) {\n if (selected?.length === min) {\n // Min value reached, do nothing\n return;\n }\n if (required && selected?.length === 1) {\n // Required value already selected do nothing\n return;\n }\n newDates = selected?.filter((d) => !isSameDay(d, triggerDate));\n }\n else {\n if (selected?.length === max) {\n // Max value reached, reset the selection to date\n newDates = [triggerDate];\n }\n else {\n // Add the date to the selection\n newDates = [...newDates, triggerDate];\n }\n }\n if (!onSelect) {\n setSelected(newDates);\n }\n onSelect?.(newDates, triggerDate, modifiers, e);\n return newDates;\n };\n return {\n selected,\n select,\n isSelected\n };\n}\n//# sourceMappingURL=useMulti.js.map","import { defaultDateLib } from \"../classes/DateLib.js\";\n/**\n * Add a day to an existing range.\n *\n * The returned range takes in account the `undefined` values and if the added\n * day is already present in the range.\n *\n * @group Utilities\n */\nexport function addToRange(\n/** The date to add to the range. */\ndate, \n/** The range where to add `date`. */\ninitialRange, min = 0, max = 0, required = false, \n/** @ignore */\ndateLib = defaultDateLib) {\n const { from, to } = initialRange || {};\n const { isSameDay, isAfter, isBefore } = dateLib;\n let range;\n if (!from && !to) {\n // the range is empty, add the date\n range = { from: date, to: min > 0 ? undefined : date };\n }\n else if (from && !to) {\n // adding date to an incomplete range\n if (isSameDay(from, date)) {\n // adding a date equal to the start of the range\n if (required) {\n range = { from, to: undefined };\n }\n else {\n range = undefined;\n }\n }\n else if (isBefore(date, from)) {\n // adding a date before the start of the range\n range = { from: date, to: from };\n }\n else {\n // adding a date after the start of the range\n range = { from, to: date };\n }\n }\n else if (from && to) {\n // adding date to a complete range\n if (isSameDay(from, date) && isSameDay(to, date)) {\n // adding a date that is equal to both start and end of the range\n if (required) {\n range = { from, to };\n }\n else {\n range = undefined;\n }\n }\n else if (isSameDay(from, date)) {\n // adding a date equal to the the start of the range\n range = { from, to: min > 0 ? undefined : date };\n }\n else if (isSameDay(to, date)) {\n // adding a dare equal to the end of the range\n range = { from: date, to: min > 0 ? undefined : date };\n }\n else if (isBefore(date, from)) {\n // adding a date before the start of the range\n range = { from: date, to: to };\n }\n else if (isAfter(date, from)) {\n // adding a date after the start of the range\n range = { from, to: date };\n }\n else if (isAfter(date, to)) {\n // adding a date after the end of the range\n range = { from, to: date };\n }\n else {\n throw new Error(\"Invalid range\");\n }\n }\n // check for min / max\n if (range?.from && range?.to) {\n const diff = dateLib.differenceInCalendarDays(range.to, range.from);\n if (max > 0 && diff > max) {\n range = { from: date, to: undefined };\n }\n else if (min > 1 && diff < min) {\n range = { from: date, to: undefined };\n }\n }\n return range;\n}\n//# sourceMappingURL=addToRange.js.map","import { defaultDateLib } from \"../classes/DateLib.js\";\n/**\n * Returns whether a date range contains one or more days of the week.\n *\n * ```tsx\n * const range: DateRange = {\n * from: new Date(2024, 8, 1), // Sunday\n * to: new Date(2024, 8, 6) // Thursday\n * };\n * rangeContainsDayOfWeek(date, 1); // true: contains range contains Monday\n * ```\n *\n * @since 9.2.2\n * @group Utilities\n */\nexport function rangeContainsDayOfWeek(range, dayOfWeek, dateLib = defaultDateLib) {\n const dayOfWeekArr = !Array.isArray(dayOfWeek) ? [dayOfWeek] : dayOfWeek;\n let date = range.from;\n const totalDays = dateLib.differenceInCalendarDays(range.to, range.from);\n // iterate at maximum one week or the total days if the range is shorter than one week\n const totalDaysLimit = Math.min(totalDays, 6);\n for (let i = 0; i <= totalDaysLimit; i++) {\n if (dayOfWeekArr.includes(date.getDay())) {\n return true;\n }\n date = dateLib.addDays(date, 1);\n }\n return false;\n}\n//# sourceMappingURL=rangeContainsDayOfWeek.js.map","import { defaultDateLib } from \"../classes/index.js\";\nimport { rangeIncludesDate } from \"./rangeIncludesDate.js\";\n/**\n * Determines whether a given range overlaps with another range.\n *\n * @since 9.2.2\n * @group Utilities\n */\nexport function rangeOverlaps(rangeLeft, rangeRight, dateLib = defaultDateLib) {\n return (rangeIncludesDate(rangeLeft, rangeRight.from, false, dateLib) ||\n rangeIncludesDate(rangeLeft, rangeRight.to, false, dateLib) ||\n rangeIncludesDate(rangeRight, rangeLeft.from, false, dateLib) ||\n rangeIncludesDate(rangeRight, rangeLeft.to, false, dateLib));\n}\n//# sourceMappingURL=rangeOverlaps.js.map","import { defaultDateLib } from \"../classes/DateLib.js\";\nimport { dateMatchModifiers } from \"./dateMatchModifiers.js\";\nimport { rangeContainsDayOfWeek } from \"./rangeContainsDayOfWeek.js\";\nimport { rangeIncludesDate } from \"./rangeIncludesDate.js\";\nimport { rangeOverlaps } from \"./rangeOverlaps.js\";\nimport { isDateAfterType, isDateBeforeType, isDateInterval, isDateRange, isDatesArray, isDayOfWeekType } from \"./typeguards.js\";\n/**\n * Returns whether a range contains dates that match the given modifiers.\n *\n * ```tsx\n * const range: DateRange = {\n * from: new Date(2021, 12, 21),\n * to: new Date(2021, 12, 30)\n * };\n * const matcher1: Date = new Date(2021, 12, 21);\n * const matcher2: DateRange = {\n * from: new Date(2022, 5, 1),\n * to: new Date(2022, 5, 23)\n * };\n * rangeContainsModifiers(range, [matcher1, matcher2]); // true, since matcher1 is in the date.\n * ```\n *\n * @since 9.2.2\n * @group Utilities\n */\nexport function rangeContainsModifiers(range, modifiers, dateLib = defaultDateLib) {\n const matchers = Array.isArray(modifiers) ? modifiers : [modifiers];\n // Defer function matchers evaluation as they are the least performant.\n const nonFunctionMatchers = matchers.filter((matcher) => typeof matcher !== \"function\");\n const nonFunctionMatchersResult = nonFunctionMatchers.some((matcher) => {\n if (typeof matcher === \"boolean\")\n return matcher;\n if (dateLib.isDate(matcher)) {\n return rangeIncludesDate(range, matcher, false, dateLib);\n }\n if (isDatesArray(matcher, dateLib)) {\n return matcher.some((date) => rangeIncludesDate(range, date, false, dateLib));\n }\n if (isDateRange(matcher)) {\n if (matcher.from && matcher.to) {\n return rangeOverlaps(range, { from: matcher.from, to: matcher.to }, dateLib);\n }\n return false;\n }\n if (isDayOfWeekType(matcher)) {\n return rangeContainsDayOfWeek(range, matcher.dayOfWeek, dateLib);\n }\n if (isDateInterval(matcher)) {\n const isClosedInterval = dateLib.isAfter(matcher.before, matcher.after);\n if (isClosedInterval) {\n return rangeOverlaps(range, {\n from: dateLib.addDays(matcher.after, 1),\n to: dateLib.addDays(matcher.before, -1)\n }, dateLib);\n }\n return (dateMatchModifiers(range.from, matcher, dateLib) ||\n dateMatchModifiers(range.to, matcher, dateLib));\n }\n if (isDateAfterType(matcher) || isDateBeforeType(matcher)) {\n return (dateMatchModifiers(range.from, matcher, dateLib) ||\n dateMatchModifiers(range.to, matcher, dateLib));\n }\n return false;\n });\n if (nonFunctionMatchersResult) {\n return true;\n }\n const functionMatchers = matchers.filter((matcher) => typeof matcher === \"function\");\n if (functionMatchers.length) {\n let date = range.from;\n const totalDays = dateLib.differenceInCalendarDays(range.to, range.from);\n for (let i = 0; i <= totalDays; i++) {\n if (functionMatchers.some((matcher) => matcher(date))) {\n return true;\n }\n date = dateLib.addDays(date, 1);\n }\n }\n return false;\n}\n//# sourceMappingURL=rangeContainsModifiers.js.map","import { useControlledValue } from \"../helpers/useControlledValue.js\";\nimport { addToRange, rangeContainsModifiers } from \"../utils/index.js\";\nimport { rangeIncludesDate } from \"../utils/rangeIncludesDate.js\";\nexport function useRange(props, dateLib) {\n const { disabled, excludeDisabled, selected: initiallySelected, required, onSelect } = props;\n const [internallySelected, setSelected] = useControlledValue(initiallySelected, onSelect ? initiallySelected : undefined);\n const selected = !onSelect ? internallySelected : initiallySelected;\n const isSelected = (date) => selected && rangeIncludesDate(selected, date, false, dateLib);\n const select = (triggerDate, modifiers, e) => {\n const { min, max } = props;\n const newRange = triggerDate\n ? addToRange(triggerDate, selected, min, max, required, dateLib)\n : undefined;\n if (excludeDisabled && disabled && newRange?.from && newRange.to) {\n if (rangeContainsModifiers({ from: newRange.from, to: newRange.to }, disabled, dateLib)) {\n // if a disabled days is found, the range is reset\n newRange.from = triggerDate;\n newRange.to = undefined;\n }\n }\n if (!onSelect) {\n setSelected(newRange);\n }\n onSelect?.(newRange, triggerDate, modifiers, e);\n return newRange;\n };\n return {\n selected,\n select,\n isSelected\n };\n}\n//# sourceMappingURL=useRange.js.map","import { useControlledValue } from \"../helpers/useControlledValue.js\";\nexport function useSingle(props, dateLib) {\n const { selected: initiallySelected, required, onSelect } = props;\n const [internallySelected, setSelected] = useControlledValue(initiallySelected, onSelect ? initiallySelected : undefined);\n const selected = !onSelect ? internallySelected : initiallySelected;\n const { isSameDay } = dateLib;\n const isSelected = (compareDate) => {\n return selected ? isSameDay(selected, compareDate) : false;\n };\n const select = (triggerDate, modifiers, e) => {\n let newDate = triggerDate;\n if (!required && selected && selected && isSameDay(triggerDate, selected)) {\n // If the date is the same, clear the selection.\n newDate = undefined;\n }\n if (!onSelect) {\n setSelected(newDate);\n }\n if (required) {\n onSelect?.(newDate, triggerDate, modifiers, e);\n }\n else {\n onSelect?.(newDate, triggerDate, modifiers, e);\n }\n return newDate;\n };\n return {\n selected,\n select,\n isSelected\n };\n}\n//# sourceMappingURL=useSingle.js.map","import { useMulti } from \"./selection/useMulti.js\";\nimport { useRange } from \"./selection/useRange.js\";\nimport { useSingle } from \"./selection/useSingle.js\";\nexport function useSelection(props, dateLib) {\n const single = useSingle(props, dateLib);\n const multi = useMulti(props, dateLib);\n const range = useRange(props, dateLib);\n switch (props.mode) {\n case \"single\":\n return single;\n case \"multiple\":\n return multi;\n case \"range\":\n return range;\n default:\n return undefined;\n }\n}\n//# sourceMappingURL=useSelection.js.map","import React, { useCallback, useMemo } from \"react\";\nimport { UI, DayFlag, SelectionState } from \"./UI.js\";\nimport { DateLib, defaultLocale } from \"./classes/DateLib.js\";\nimport { getClassNamesForModifiers } from \"./helpers/getClassNamesForModifiers.js\";\nimport { getComponents } from \"./helpers/getComponents.js\";\nimport { getDataAttributes } from \"./helpers/getDataAttributes.js\";\nimport { getDefaultClassNames } from \"./helpers/getDefaultClassNames.js\";\nimport { getFormatters } from \"./helpers/getFormatters.js\";\nimport { getMonthOptions } from \"./helpers/getMonthOptions.js\";\nimport { getStyleForModifiers } from \"./helpers/getStyleForModifiers.js\";\nimport { getWeekdays } from \"./helpers/getWeekdays.js\";\nimport { getYearOptions } from \"./helpers/getYearOptions.js\";\nimport * as defaultLabels from \"./labels/index.js\";\nimport { useCalendar } from \"./useCalendar.js\";\nimport { dayPickerContext } from \"./useDayPicker.js\";\nimport { useFocus } from \"./useFocus.js\";\nimport { useGetModifiers } from \"./useGetModifiers.js\";\nimport { useSelection } from \"./useSelection.js\";\nimport { rangeIncludesDate } from \"./utils/rangeIncludesDate.js\";\nimport { isDateRange } from \"./utils/typeguards.js\";\n/**\n * Render the date picker calendar.\n *\n * @group DayPicker\n * @see https://daypicker.dev\n */\nexport function DayPicker(props) {\n const { components, formatters, labels, dateLib, locale, classNames } = useMemo(() => {\n const locale = { ...defaultLocale, ...props.locale };\n const dateLib = new DateLib({\n locale,\n weekStartsOn: props.broadcastCalendar ? 1 : props.weekStartsOn,\n firstWeekContainsDate: props.firstWeekContainsDate,\n useAdditionalWeekYearTokens: props.useAdditionalWeekYearTokens,\n useAdditionalDayOfYearTokens: props.useAdditionalDayOfYearTokens\n }, props.dateLib);\n return {\n dateLib,\n components: getComponents(props.components),\n formatters: getFormatters(props.formatters),\n labels: { ...defaultLabels, ...props.labels },\n locale,\n classNames: { ...getDefaultClassNames(), ...props.classNames }\n };\n }, [\n props.classNames,\n props.components,\n props.dateLib,\n props.firstWeekContainsDate,\n props.formatters,\n props.labels,\n props.locale,\n props.useAdditionalDayOfYearTokens,\n props.useAdditionalWeekYearTokens,\n props.weekStartsOn,\n props.broadcastCalendar\n ]);\n const { captionLayout, mode, onDayBlur, onDayClick, onDayFocus, onDayKeyDown, onDayMouseEnter, onDayMouseLeave, onNextClick, onPrevClick, showWeekNumber, styles } = props;\n const { formatCaption, formatDay, formatMonthDropdown, formatWeekNumber, formatWeekNumberHeader, formatWeekdayName, formatYearDropdown } = formatters;\n const calendar = useCalendar(props, dateLib);\n const { days, months, navStart, navEnd, previousMonth, nextMonth, goToMonth } = calendar;\n const getModifiers = useGetModifiers(days, props, dateLib);\n const { isSelected, select, selected: selectedValue } = useSelection(props, dateLib) ?? {};\n const { blur, focused, isFocusTarget, moveFocus, setFocused } = useFocus(props, calendar, getModifiers, isSelected ?? (() => false), dateLib);\n const { labelDayButton, labelGridcell, labelGrid, labelMonthDropdown, labelNav, labelWeekday, labelWeekNumber, labelWeekNumberHeader, labelYearDropdown } = labels;\n const weekdays = useMemo(() => getWeekdays(dateLib, props.ISOWeek, props.timeZone), [dateLib, props.ISOWeek, props.timeZone]);\n const isInteractive = mode !== undefined || onDayClick !== undefined;\n const handlePreviousClick = useCallback(() => {\n if (!previousMonth)\n return;\n goToMonth(previousMonth);\n onPrevClick?.(previousMonth);\n }, [previousMonth, goToMonth, onPrevClick]);\n const handleNextClick = useCallback(() => {\n if (!nextMonth)\n return;\n goToMonth(nextMonth);\n onNextClick?.(nextMonth);\n }, [goToMonth, nextMonth, onNextClick]);\n const handleDayClick = useCallback((day, m) => (e) => {\n e.preventDefault();\n e.stopPropagation();\n setFocused(day);\n select?.(day.date, m, e);\n onDayClick?.(day.date, m, e);\n }, [select, onDayClick, setFocused]);\n const handleDayFocus = useCallback((day, m) => (e) => {\n setFocused(day);\n onDayFocus?.(day.date, m, e);\n }, [onDayFocus, setFocused]);\n const handleDayBlur = useCallback((day, m) => (e) => {\n blur();\n onDayBlur?.(day.date, m, e);\n }, [blur, onDayBlur]);\n const handleDayKeyDown = useCallback((day, modifiers) => (e) => {\n const keyMap = {\n ArrowLeft: [\"day\", props.dir === \"rtl\" ? \"after\" : \"before\"],\n ArrowRight: [\"day\", props.dir === \"rtl\" ? \"before\" : \"after\"],\n ArrowDown: [\"week\", \"after\"],\n ArrowUp: [\"week\", \"before\"],\n PageUp: [e.shiftKey ? \"year\" : \"month\", \"before\"],\n PageDown: [e.shiftKey ? \"year\" : \"month\", \"after\"],\n Home: [\"startOfWeek\", \"before\"],\n End: [\"endOfWeek\", \"after\"]\n };\n if (keyMap[e.key]) {\n e.preventDefault();\n e.stopPropagation();\n const [moveBy, moveDir] = keyMap[e.key];\n moveFocus(moveBy, moveDir);\n }\n onDayKeyDown?.(day.date, modifiers, e);\n }, [moveFocus, onDayKeyDown, props.dir]);\n const handleDayMouseEnter = useCallback((day, modifiers) => (e) => {\n onDayMouseEnter?.(day.date, modifiers, e);\n }, [onDayMouseEnter]);\n const handleDayMouseLeave = useCallback((day, modifiers) => (e) => {\n onDayMouseLeave?.(day.date, modifiers, e);\n }, [onDayMouseLeave]);\n const handleMonthChange = useCallback((date) => (e) => {\n const selectedMonth = Number(e.target.value);\n const month = dateLib.setMonth(dateLib.startOfMonth(date), selectedMonth);\n goToMonth(month);\n }, [dateLib, goToMonth]);\n const handleYearChange = useCallback((date) => (e) => {\n const selectedYear = Number(e.target.value);\n const month = dateLib.setYear(dateLib.startOfMonth(date), selectedYear);\n goToMonth(month);\n }, [dateLib, goToMonth]);\n const { className, style } = useMemo(() => ({\n className: [classNames[UI.Root], props.className]\n .filter(Boolean)\n .join(\" \"),\n style: { ...styles?.[UI.Root], ...props.style }\n }), [classNames, props.className, props.style, styles]);\n const dataAttributes = getDataAttributes(props);\n const contextValue = {\n dayPickerProps: props,\n selected: selectedValue,\n select: select,\n isSelected,\n months,\n nextMonth,\n previousMonth,\n goToMonth,\n getModifiers,\n components,\n classNames,\n styles,\n labels,\n formatters\n };\n return (React.createElement(dayPickerContext.Provider, { value: contextValue },\n React.createElement(components.Root, { className: className, style: style, dir: props.dir, id: props.id, lang: props.lang, nonce: props.nonce, title: props.title, role: props.role, \"aria-label\": props[\"aria-label\"], ...dataAttributes },\n React.createElement(components.Months, { className: classNames[UI.Months], style: styles?.[UI.Months] },\n !props.hideNavigation && (React.createElement(components.Nav, { className: classNames[UI.Nav], style: styles?.[UI.Nav], \"aria-label\": labelNav(), onPreviousClick: handlePreviousClick, onNextClick: handleNextClick, previousMonth: previousMonth, nextMonth: nextMonth })),\n months.map((calendarMonth, displayIndex) => {\n const dropdownMonths = getMonthOptions(calendarMonth.date, navStart, navEnd, formatters, dateLib);\n const dropdownYears = getYearOptions(navStart, navEnd, formatters, dateLib);\n return (React.createElement(components.Month, { className: classNames[UI.Month], style: styles?.[UI.Month], key: displayIndex, displayIndex: displayIndex, calendarMonth: calendarMonth },\n React.createElement(components.MonthCaption, { className: classNames[UI.MonthCaption], style: styles?.[UI.MonthCaption], calendarMonth: calendarMonth, displayIndex: displayIndex }, captionLayout?.startsWith(\"dropdown\") ? (React.createElement(components.DropdownNav, { className: classNames[UI.Dropdowns], style: styles?.[UI.Dropdowns] },\n captionLayout === \"dropdown\" ||\n captionLayout === \"dropdown-months\" ? (React.createElement(components.MonthsDropdown, { className: classNames[UI.MonthsDropdown], \"aria-label\": labelMonthDropdown(), classNames: classNames, components: components, disabled: Boolean(props.disableNavigation), onChange: handleMonthChange(calendarMonth.date), options: dropdownMonths, style: styles?.[UI.Dropdown], value: calendarMonth.date.getMonth() })) : (React.createElement(\"span\", { role: \"status\", \"aria-live\": \"polite\" }, formatMonthDropdown(calendarMonth.date.getMonth(), locale))),\n captionLayout === \"dropdown\" ||\n captionLayout === \"dropdown-years\" ? (React.createElement(components.YearsDropdown, { className: classNames[UI.YearsDropdown], \"aria-label\": labelYearDropdown(dateLib.options), classNames: classNames, components: components, disabled: Boolean(props.disableNavigation), onChange: handleYearChange(calendarMonth.date), options: dropdownYears, style: styles?.[UI.Dropdown], value: calendarMonth.date.getFullYear() })) : (React.createElement(\"span\", { role: \"status\", \"aria-live\": \"polite\" }, formatYearDropdown(calendarMonth.date.getFullYear()))))) : (React.createElement(components.CaptionLabel, { className: classNames[UI.CaptionLabel], role: \"status\", \"aria-live\": \"polite\" }, formatCaption(calendarMonth.date, dateLib.options, dateLib)))),\n React.createElement(components.MonthGrid, { role: \"grid\", \"aria-multiselectable\": mode === \"multiple\" || mode === \"range\", \"aria-label\": labelGrid(calendarMonth.date, dateLib.options, dateLib) ||\n undefined, className: classNames[UI.MonthGrid], style: styles?.[UI.MonthGrid] },\n !props.hideWeekdays && (React.createElement(components.Weekdays, { className: classNames[UI.Weekdays], style: styles?.[UI.Weekdays] },\n showWeekNumber && (React.createElement(components.WeekNumberHeader, { \"aria-label\": labelWeekNumberHeader(dateLib.options), className: classNames[UI.WeekNumberHeader], style: styles?.[UI.WeekNumberHeader], scope: \"col\" }, formatWeekNumberHeader())),\n weekdays.map((weekday, i) => (React.createElement(components.Weekday, { \"aria-label\": labelWeekday(weekday, dateLib.options, dateLib), className: classNames[UI.Weekday], key: i, style: styles?.[UI.Weekday], scope: \"col\" }, formatWeekdayName(weekday, dateLib.options, dateLib)))))),\n React.createElement(components.Weeks, { className: classNames[UI.Weeks], style: styles?.[UI.Weeks] }, calendarMonth.weeks.map((week, weekIndex) => {\n return (React.createElement(components.Week, { className: classNames[UI.Week], key: week.weekNumber, style: styles?.[UI.Week], week: week },\n showWeekNumber && (React.createElement(components.WeekNumber, { week: week, style: styles?.[UI.WeekNumber], \"aria-label\": labelWeekNumber(week.weekNumber, {\n locale\n }), className: classNames[UI.WeekNumber], scope: \"row\", role: \"rowheader\" }, formatWeekNumber(week.weekNumber))),\n week.days.map((day) => {\n const { date } = day;\n const modifiers = getModifiers(day);\n modifiers[DayFlag.focused] =\n !modifiers.hidden &&\n Boolean(focused?.isEqualTo(day));\n modifiers[SelectionState.selected] =\n !modifiers.disabled &&\n (isSelected?.(date) || modifiers.selected);\n if (isDateRange(selectedValue)) {\n // add range modifiers\n const { from, to } = selectedValue;\n modifiers[SelectionState.range_start] = Boolean(from && to && dateLib.isSameDay(date, from));\n modifiers[SelectionState.range_end] = Boolean(from && to && dateLib.isSameDay(date, to));\n modifiers[SelectionState.range_middle] =\n rangeIncludesDate(selectedValue, date, true, dateLib);\n }\n const style = getStyleForModifiers(modifiers, styles, props.modifiersStyles);\n const className = getClassNamesForModifiers(modifiers, classNames, props.modifiersClassNames);\n const ariaLabel = !isInteractive && !modifiers.hidden\n ? labelGridcell(date, modifiers, dateLib.options, dateLib)\n : undefined;\n return (React.createElement(components.Day, { key: `${dateLib.format(date, \"yyyy-MM-dd\")}_${dateLib.format(day.displayMonth, \"yyyy-MM\")}`, day: day, modifiers: modifiers, className: className.join(\" \"), style: style, role: \"gridcell\", \"aria-selected\": modifiers.selected || undefined, \"aria-label\": ariaLabel, \"data-day\": dateLib.format(date, \"yyyy-MM-dd\"), \"data-month\": day.outside\n ? dateLib.format(date, \"yyyy-MM\")\n : undefined, \"data-selected\": modifiers.selected || undefined, \"data-disabled\": modifiers.disabled || undefined, \"data-hidden\": modifiers.hidden || undefined, \"data-outside\": day.outside || undefined, \"data-focused\": modifiers.focused || undefined, \"data-today\": modifiers.today || undefined }, !modifiers.hidden && isInteractive ? (React.createElement(components.DayButton, { className: classNames[UI.DayButton], style: styles?.[UI.DayButton], type: \"button\", day: day, modifiers: modifiers, disabled: modifiers.disabled || undefined, tabIndex: isFocusTarget(day) ? 0 : -1, \"aria-label\": labelDayButton(date, modifiers, dateLib.options, dateLib), onClick: handleDayClick(day, modifiers), onBlur: handleDayBlur(day, modifiers), onFocus: handleDayFocus(day, modifiers), onKeyDown: handleDayKeyDown(day, modifiers), onMouseEnter: handleDayMouseEnter(day, modifiers), onMouseLeave: handleDayMouseLeave(day, modifiers) }, formatDay(date, dateLib.options, dateLib))) : (!modifiers.hidden &&\n formatDay(day.date, dateLib.options, dateLib))));\n })));\n })))));\n })),\n props.footer && (React.createElement(components.Footer, { className: classNames[UI.Footer], style: styles?.[UI.Footer], role: \"status\", \"aria-live\": \"polite\" }, props.footer)))));\n}\n//# sourceMappingURL=DayPicker.js.map","import { CSSProperties } from 'react';\n\nimport { PopOverVariant } from '@helsenorge/designsystem-react/components/PopOver';\n\ntype HorizontalPosition = 'left' | 'right' | 'floating';\ntype BubblePosition = 'leftabove' | 'leftbelow' | 'rightabove' | 'rightbelow' | 'floatingabove' | 'floatingbelow';\n\n/** Bredde på hjelpeboble */\nconst BUBBLE_WIDTH_PX = 329;\n/** Hjelpeboblen skal holde avstand til venstre/høyre kant på vinduet */\nconst WINDOW_MARGIN_PX = 12;\n/** Vertikal avstand fra hjelpeboble til kontroller */\nconst BUBBLE_VERTICAL_OFFSET_PX = 26;\n/** Høyde/bredde på pil */\nconst ARROW_WIDTH_PX = 20;\n/** Avstand fra pil til hjelpeboble */\nconst ARROW_VERTICAL_OFFSET_PX = 9;\n/** Pilen skal holde avstand til venstre/høyre kant av hjelpeboblen */\nconst ARROW_HORIZONTAL_MARGIN_PX = 12;\n\n// @todo these functions are similar to the ones in utils in PopOver, should be moved to a shared location\n/**\n * Beregn om hjelpeboblen skal vises over eller under kontrolleren\n * @param controllerSize DOMRect for controlleren\n * @param bubbleSize DOMRect for hjelpeboblen\n * @param variant Ønsket plassering av hjelpeboblen (over/under/automatisk)\n * @returns Om hjelpeboblen skal vises over eller under\n */\nexport const getVerticalPosition = (\n controllerSize: DOMRect,\n bubbleSize: DOMRect,\n variant?: keyof typeof PopOverVariant\n): keyof typeof PopOverVariant => {\n if (variant !== PopOverVariant.positionautomatic && variant !== undefined) {\n return variant;\n }\n if (controllerSize.top > bubbleSize.height + BUBBLE_VERTICAL_OFFSET_PX) {\n return PopOverVariant.positionabove;\n } else {\n return PopOverVariant.positionbelow;\n }\n};\n\n/**\n * Finn horisontalt midtpunkt på kontrolleren i forhold til venstre kant av vinduet\n * @param controllerSize DOMRect for controlleren\n * @returns Horisontalt senter av controlleren i px\n */\nconst getControllerLeftEdgePx = (controllerSize: DOMRect): number => controllerSize.left + controllerSize.width / 4;\n\n/**\n * Finn horisontalt midtpunkt på kontrolleren i forhold til høyre kant av vinduet\n * @param controllerSize DOMRect for controlleren\n * @returns Horisontalt senter av controlleren i px\n */\nconst getControllerRightEdgePx = (controllerSize: DOMRect): number =>\n document.documentElement.clientWidth - controllerSize.right + controllerSize.width / 4;\n\n/**\n * Finn venstre kant av hjelpeboblen i forhold til kontrolleren\n * @param controllerSize DOMRect for controlleren\n * @param bubbleSize DOMRect for hjelpeboblen\n * @returns Venstre kant av hjelpeboblen i px\n */\n\n/**\n * Finn høyre kant av hjelpeboblen i forhold til kontrolleren\n * @param controllerSize DOMRect for controlleren\n * @param bubbleSize DOMRect for hjelpeboblen\n * @returns Høyre kant av hjelpeboblen i px\n */\nconst getBubbleRightPx = (controllerSize: DOMRect, bubbleSize: DOMRect): number => {\n return controllerSize.left + bubbleSize.width;\n};\n\n/**\n * Sjekk om venstre kant av hjelpeboblen er innenfor vinduet\n * @param controllerSize DOMRect for controlleren\n * @param bubbleSize DOMRect for hjelpeboblen\n * @returns true dersom venstre kant er innenfor vinduet\n */\nconst getBubbleLeftVisible = (controllerSize: DOMRect): boolean => {\n return controllerSize.left > WINDOW_MARGIN_PX;\n};\n\n/**\n * Sjekk om høyre kant av hjelpeboblen er innenfor vinduet\n * @param controllerSize DOMRect for controlleren\n * @param bubbleSize DOMRect for hjelpeboblen\n * @returns true dersom høyre kant er innenfor vinduet\n */\nconst getBubbleRightIsVisible = (controllerSize: DOMRect, bubbleSize: DOMRect): boolean => {\n const bubbleRightPx = getBubbleRightPx(controllerSize, bubbleSize);\n\n return bubbleRightPx < document.documentElement.clientWidth - WINDOW_MARGIN_PX;\n};\n\n/**\n * Finn riktig horisontal plassering til hjelpeboblen\n * @param controllerSize DOMRect for controlleren\n * @param bubbleSize DOMRect for hjelpeboblen\n * @returns left, right eller floating\n */\nconst getHorizontalPosition = (controllerSize: DOMRect, bubbleSize: DOMRect): HorizontalPosition => {\n if (!getBubbleRightIsVisible(controllerSize, bubbleSize)) {\n return 'right';\n }\n if (!getBubbleLeftVisible(controllerSize)) {\n return 'left';\n }\n\n return 'floating';\n};\n\n/**\n * Finn vertikal plassering av hjelpeboblen når den skal vises over\n * @param controllerSize DOMRect for controlleren\n * @param bubbleSize DOMRect for hjelpeboblen\n * @returns \"Top\" for hjelpeboblen i px\n */\nconst getBubbleAbovePx = (controllerSize: DOMRect, bubbleSize: DOMRect): number =>\n controllerSize.top - BUBBLE_VERTICAL_OFFSET_PX - bubbleSize.height;\n\n/**\n * Finn vertikal plassering av hjelpeboblen når den skal vises under\n * @param controllerSize DOMRect for controlleren\n * @param bubbleSize DOMRect for hjelpeboblen\n * @returns \"Top\" for hjelpeboblen i px\n */\nconst getBubbleBelowPx = (controllerSize: DOMRect): number => controllerSize.bottom + BUBBLE_VERTICAL_OFFSET_PX;\n\n/**\n * Finn maks bredde på hjelpeboblen i forhold til vinduet\n * @returns Bredde på hjelpeboblen i px\n */\nconst getBubbleWidth = (): number => document.documentElement.clientWidth - WINDOW_MARGIN_PX * 2;\n\n/**\n * Sjekk om hjelpeboblen har plass i vinduet\n * @returns true dersom det er plass til hjelpeboblen i vinduet\n */\nconst getBubbleFitsInWindow = (): boolean => {\n return document.documentElement.clientWidth > BUBBLE_WIDTH_PX + WINDOW_MARGIN_PX * 2;\n};\n\n/**\n * Finn vertikal plassering av pilen når den skal vises over\n * @param controllerSize DOMRect for controlleren\n * @returns \"Top\" for pilen i px\n */\nconst getArrowTopxPx = (controllerSize: DOMRect): number => controllerSize.top - BUBBLE_VERTICAL_OFFSET_PX - ARROW_VERTICAL_OFFSET_PX + 5;\n\n/**\n * Finn horisontal plassering av pilen i forhold til venstre kant av vinduet\n * @param controllerSize DOMRect for controlleren\n * @returns Venstre kant av pilen i px\n */\nconst getArrowLeftPx = (controllerSize: DOMRect): number => getControllerLeftEdgePx(controllerSize) - ARROW_WIDTH_PX / 2;\n\n/**\n * Finn horisontal plassering av pilen\n * @param controllerSize DOMRect for controlleren\n * @returns Venstre kant av pilen i px\n */\nconst getArrowRightPx = (controllerSize: DOMRect): number => getControllerRightEdgePx(controllerSize) - ARROW_WIDTH_PX / 2;\n\n/**\n * Finn riktig plassering av hjelpeboblen\n * @param controllerSize DOMRect for controlleren\n * @param bubbleSize DOMRect for hjelpeboblen\n * @param variant Ønsket plassering av hjelpeboblen (over/under)\n * @returns Beste mulige plassering av hjelpeboblen\n */\nconst getBubblePosition = (controllerSize: DOMRect, bubbleSize: DOMRect, variant: keyof typeof PopOverVariant): BubblePosition => {\n const horizontalPosition = getHorizontalPosition(controllerSize, bubbleSize);\n const verticalPosition = getVerticalPosition(controllerSize, bubbleSize, variant);\n\n if (horizontalPosition === 'left') {\n if (verticalPosition === PopOverVariant.positionabove) {\n return 'leftabove';\n }\n return 'leftbelow';\n }\n\n if (horizontalPosition === 'right') {\n if (verticalPosition === PopOverVariant.positionabove) {\n return 'rightabove';\n }\n return 'rightbelow';\n }\n\n if (verticalPosition === PopOverVariant.positionabove) {\n return 'floatingabove';\n }\n\n return 'floatingbelow';\n};\n\n/**\n * Finn riktig plassering av hjelpeboblen\n * @param controllerSize DOMRect for controlleren\n * @param bubbleSize DOMRect for hjelpeboblen\n * @param variant Ønsket plassering av hjelpeboblen (over/under)\n * @returns CSSProperties som plasserer hjelpeboblen riktig\n */\nexport const getBubbleStyle = (controllerSize: DOMRect, bubbleSize: DOMRect, variant: keyof typeof PopOverVariant): CSSProperties => {\n const bubblePosition = getBubblePosition(controllerSize, bubbleSize, variant);\n const bubbleWidth = !getBubbleFitsInWindow() ? getBubbleWidth() : undefined;\n\n if (bubblePosition === 'leftabove') {\n return {\n left: WINDOW_MARGIN_PX,\n top: getBubbleAbovePx(controllerSize, bubbleSize),\n width: bubbleWidth,\n };\n }\n if (bubblePosition === 'leftbelow') {\n return { left: WINDOW_MARGIN_PX, top: getBubbleBelowPx(controllerSize), width: bubbleWidth };\n }\n if (bubblePosition === 'rightabove') {\n return { right: WINDOW_MARGIN_PX, top: getBubbleAbovePx(controllerSize, bubbleSize), width: bubbleWidth };\n }\n if (bubblePosition === 'rightbelow') {\n return { right: WINDOW_MARGIN_PX, top: getBubbleBelowPx(controllerSize), width: bubbleWidth };\n }\n\n if (bubblePosition === 'floatingbelow') {\n return { left: getBubbleLeftPx(controllerSize, bubbleSize), top: getBubbleBelowPx(controllerSize), width: bubbleWidth };\n }\n\n return { left: getBubbleLeftPx(controllerSize, bubbleSize), top: getBubbleAbovePx(controllerSize, bubbleSize), width: bubbleWidth };\n};\n\n/**\n * Finn venstre kant av hjelpeboblen i forhold til kontrolleren\n * @param controllerSize DOMRect for controlleren\n * @param bubbleSize DOMRect for hjelpeboblen\n * @returns Venstre kant av hjelpeboblen i px\n */\nconst getBubbleLeftPx = (controllerSize: DOMRect, bubbleSize: DOMRect): number => {\n const controllerHorizontalCenterPx = getControllerLeftCenterPx(controllerSize);\n\n return controllerHorizontalCenterPx - bubbleSize.width / 2;\n};\n\n/**\n * Finn horisontalt midtpunkt på kontrolleren i forhold til venstre kant av vinduet\n * @param controllerSize DOMRect for controlleren\n * @returns Horisontalt senter av controlleren i px\n */\nconst getControllerLeftCenterPx = (controllerSize: DOMRect): number => controllerSize.left + controllerSize.width / 2;\n\n/**\n * Finn riktig plassering av pilen\n * @param bubbleStyle CSSProperties for hjelpeboblen\n * @param controllerSize DOMRect for kontrolleren\n * @param verticalPosition Ønsket plassering av hjelpeboblen (over/under)\n * @returns CSSProperties som plasserer pilen riktig\n */\nexport const getArrowStyle = (\n bubbleStyle: CSSProperties,\n controllerSize: DOMRect,\n verticalPosition: keyof typeof PopOverVariant\n): CSSProperties => {\n const leftPx = getArrowLeftPx(controllerSize);\n const rightPx = getArrowRightPx(controllerSize);\n const minLeftPx = (bubbleStyle.left as number) + ARROW_HORIZONTAL_MARGIN_PX;\n const minRightPx = (bubbleStyle.right as number) + ARROW_HORIZONTAL_MARGIN_PX;\n\n if (bubbleStyle.right) {\n if (verticalPosition === PopOverVariant.positionabove) {\n return {\n right: rightPx > minRightPx ? rightPx : minRightPx,\n top: getArrowTopxPx(controllerSize),\n };\n }\n\n return {\n right: rightPx > minRightPx ? rightPx : minRightPx,\n top: controllerSize.bottom + ARROW_VERTICAL_OFFSET_PX,\n };\n }\n\n if (verticalPosition === PopOverVariant.positionabove) {\n return {\n left: leftPx > minLeftPx ? leftPx : minLeftPx,\n top: getArrowTopxPx(controllerSize),\n };\n }\n\n return {\n left: leftPx > minLeftPx ? leftPx : minLeftPx,\n top: controllerSize.bottom + ARROW_VERTICAL_OFFSET_PX,\n };\n};\n","import React, { useState, useRef } from 'react';\n\nimport classNames from 'classnames';\nimport { DayPicker, DayPickerProps, PropsSingle } from 'react-day-picker';\nimport reactdaypickerstyles from 'react-day-picker/dist/style.module.css';\n\nimport { PopOverVariant } from '@helsenorge/designsystem-react/components/PopOver';\nimport { useFocusTrap } from '@helsenorge/designsystem-react/hooks/useFocusTrap';\nimport { useInterval } from '@helsenorge/designsystem-react/hooks/useInterval';\nimport { useIsVisible } from '@helsenorge/designsystem-react/hooks/useIsVisible';\nimport { useLayoutEvent } from '@helsenorge/designsystem-react/hooks/useLayoutEvent';\nimport { useSize } from '@helsenorge/designsystem-react/hooks/useSize';\nimport { getSpacer } from '@helsenorge/designsystem-react/theme/currys/spacing';\n\nimport { getArrowStyle, getBubbleStyle, getVerticalPosition } from './position-utils';\n\nimport styles from './styles.module.scss';\n\ninterface DatePickerPopupProps\n extends Pick<\n DayPickerProps,\n 'dir' | 'disabled' | 'footer' | 'startMonth' | 'initialFocus' | 'locale' | 'month' | 'onMonthChange' | 'endMonth'\n >,\n Pick<PropsSingle, 'selected' | 'onSelect'> {\n datepickerWrapperRef: React.RefObject<HTMLDivElement>;\n inputRef: React.RefObject<HTMLInputElement>;\n testId?: string;\n variant: keyof typeof PopOverVariant;\n zIndex?: number;\n}\n\nconst DatePickerPopup: React.FC<DatePickerPopupProps> = props => {\n const { datepickerWrapperRef, footer, inputRef, testId, variant, zIndex, ...rest } = props;\n const today = new Date();\n const arrowRef = useRef<HTMLDivElement>(null);\n const [controllerSize, setControllerSize] = useState<DOMRect>();\n const bubbleSize = useSize(datepickerWrapperRef);\n const controllerisVisible = useIsVisible(datepickerWrapperRef, 0);\n useFocusTrap(datepickerWrapperRef, true);\n\n const updateControllerSize = (): void => {\n setControllerSize(inputRef.current?.getBoundingClientRect());\n };\n\n React.useEffect(() => {\n updateControllerSize();\n }, []);\n\n useInterval(updateControllerSize, 500);\n useLayoutEvent(updateControllerSize, ['scroll', 'resize'], 10);\n\n const datepickerPopupContainerClasses = classNames(styles['datepicker-popup-container'], {\n [styles['datepicker-popup-container--visible']]: controllerisVisible,\n });\n const verticalPosition = controllerSize && bubbleSize && getVerticalPosition(controllerSize, bubbleSize, variant);\n const popupArrowClasses = classNames(styles['datepicker-popup-arrow'], {\n [styles['datepicker-popup-arrow--visible']]: controllerisVisible,\n [styles['datepicker-popup-arrow--over']]: verticalPosition === PopOverVariant.positionbelow,\n [styles['datepicker-popup-arrow--under']]: verticalPosition === PopOverVariant.positionabove,\n });\n\n const bubbleStyle = controllerSize && bubbleSize && getBubbleStyle(controllerSize, bubbleSize, variant);\n const arrowStyle = bubbleStyle && controllerSize && verticalPosition && getArrowStyle(bubbleStyle, controllerSize, verticalPosition);\n\n const datePickerClassNames = {\n ...reactdaypickerstyles,\n ...styles,\n };\n\n return (\n <>\n <div className={datepickerPopupContainerClasses} data-testid={testId} ref={datepickerWrapperRef} style={{ ...bubbleStyle, zIndex }}>\n <DayPicker\n captionLayout=\"dropdown\"\n classNames={datePickerClassNames}\n mode={'single'}\n style={{ '--rdp-cell-size': getSpacer('l') } as React.CSSProperties}\n modifiersClassNames={{\n today: styles['day--today'],\n selected: styles['day--selected'],\n disabled: styles['day--disabled'],\n }}\n footer={<span className={styles['footer-wrapper']}>{footer}</span>}\n fixedWeeks\n {...rest}\n startMonth={props.startMonth ?? new Date(today.getFullYear() - 100, today.getMonth(), 1)}\n endMonth={props.endMonth ?? new Date(today.getFullYear() + 100, today.getMonth(), 1)}\n />\n </div>\n <div ref={arrowRef} className={popupArrowClasses} style={{ ...arrowStyle, zIndex }} />\n </>\n );\n};\n\nexport default DatePickerPopup;\n","import React, { useState, useRef, useEffect } from 'react';\n\nimport { Locale, format, isValid, parse } from 'date-fns';\nimport { nb } from 'date-fns/locale';\nimport { Modifiers, DayOfWeek, DayPickerProps, PropsSingle } from 'react-day-picker';\n\nimport Button from '@helsenorge/designsystem-react/components/Button';\nimport { ErrorWrapperClassNameProps } from '@helsenorge/designsystem-react/components/ErrorWrapper';\nimport Icon from '@helsenorge/designsystem-react/components/Icon';\nimport Calendar from '@helsenorge/designsystem-react/components/Icons/Calendar';\nimport Input from '@helsenorge/designsystem-react/components/Input';\nimport { PopOverVariant } from '@helsenorge/designsystem-react/components/PopOver';\nimport { KeyboardEventKey, ZIndex } from '@helsenorge/designsystem-react/constants';\nimport { useKeyboardEvent } from '@helsenorge/designsystem-react/hooks/useKeyboardEvent';\nimport { useOutsideEvent } from '@helsenorge/designsystem-react/hooks/useOutsideEvent';\nimport { usePseudoClasses } from '@helsenorge/designsystem-react/hooks/usePseudoClasses';\nimport { isMobileUA } from '@helsenorge/designsystem-react/utils/mobile';\nimport { isMutableRefObject, mergeRefs } from '@helsenorge/designsystem-react/utils/refs';\n\nimport DatePickerPopup from './DatePickerPopup';\n\nimport styles from './styles.module.scss';\n\nexport type DateFormat = 'dd.MM.yyyy';\n\nexport interface DatePickerProps\n extends ErrorWrapperClassNameProps,\n Pick<React.InputHTMLAttributes<HTMLInputElement>, 'name' | 'aria-describedby' | 'onBlur' | 'autoComplete'>,\n Pick<DayPickerProps, 'dir' | 'initialFocus'> {\n /** Adds custom classes to the element. */\n className?: string;\n /** Sets aria-label on the button that opens the datepicker dialogue */\n dateButtonAriaLabel?: string;\n /** Sets the format of the date - only applies for desktop use. Native mobile date fields base their formats on the device */\n dateFormat?: DateFormat;\n /** Sets the date of the component */\n dateValue?: Date;\n /** Sets the current month */\n defaultMonth?: Date;\n /** Disables the datepicker */\n disabled?: boolean;\n /** Disables the days in the datepicker */\n disableDays?: Date[];\n /** Disables weekends in the datepicker */\n disableWeekends?: boolean;\n /** Activates Error style for the input */\n error?: boolean;\n /** Error text to show above the component */\n errorText?: string;\n /** Error text id */\n errorTextId?: string;\n /** Content to be rendered in the footer of the datepicker popup */\n footerContent?: React.ReactNode;\n /** Label of the input */\n label?: React.ReactNode;\n /** Input element id */\n inputId?: string;\n /** Sets the locale of the datepicker */\n locale?: Locale;\n /** Maximum date allowed to be selected */\n maxDate?: Date;\n /** Minimum date allowed to be selected */\n minDate?: Date;\n /** onChange callback triggered by change in chosen date */\n onChange?: (\n event?: React.ChangeEvent<HTMLInputElement> | React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element>,\n date?: Date | string | undefined\n ) => void;\n /** Only use this to trigger validation. Callback triggered by change in chosen date via the datepicker popup */\n onDatePopupClosed?: (date: Date | string | undefined) => void;\n /** Sets the data-testid attribute. */\n testId?: string;\n /** Determines the placement of the DatePicker popup. Default: automatic positioning. */\n variant?: keyof typeof PopOverVariant;\n /** Overrides the default z-index of DatePicker */\n zIndex?: number;\n}\n\nexport const DatePicker = React.forwardRef((props: DatePickerProps, ref: React.Ref<HTMLInputElement>) => {\n const {\n className,\n dateButtonAriaLabel,\n dateFormat = 'dd.MM.yyyy',\n dateValue,\n defaultMonth,\n dir,\n disabled,\n disableDays = [],\n disableWeekends,\n error,\n errorText,\n errorTextId,\n errorWrapperClassName,\n footerContent,\n label,\n inputId,\n locale = nb,\n maxDate,\n minDate,\n onBlur,\n onChange,\n onDatePopupClosed,\n testId,\n autoComplete = 'off',\n variant = PopOverVariant.positionautomatic,\n zIndex = ZIndex.PopOver,\n ...rest\n } = props;\n\n const [dateState, setDateState] = useState<Date | undefined>(dateValue);\n const [inputValue, setInputValue] = useState<string>(dateState ? format(dateState, dateFormat) : '');\n const [month, setMonth] = useState<Date | undefined>(defaultMonth);\n const [datePickerOpen, setDatePickerOpen] = useState<boolean>(false);\n const [returnInputFocus, setReturnInputFocus] = useState<boolean>(false);\n\n const weekendMatcher: DayOfWeek = {\n dayOfWeek: [0, 6],\n };\n const disabledDays: (Date | DayOfWeek)[] = disableWeekends ? [...disableDays, weekendMatcher] : disableDays;\n\n const inputWrapperRef = useRef<HTMLDivElement>(null);\n const inputContainerRef = useRef<HTMLDivElement>(null);\n const datepickerWrapperRef = useRef<HTMLDivElement>(null);\n const { refObject } = usePseudoClasses<HTMLInputElement>(isMutableRefObject(ref) ? ref : null);\n const mergedRefs = mergeRefs([ref, refObject]);\n const isTyping = useRef<boolean>(false);\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n useOutsideEvent(inputContainerRef, (e: any) => {\n if (\n inputContainerRef.current &&\n datepickerWrapperRef.current &&\n !e?.composedPath().includes(inputContainerRef.current) &&\n !e?.composedPath().includes(datepickerWrapperRef.current)\n ) {\n setDatePickerOpen(false);\n }\n });\n\n useEffect(() => {\n if (isValid(dateValue)) {\n setInputValue(dateValue ? format(dateValue, dateFormat) : '');\n setDateState(dateValue);\n setMonth(dateValue);\n } else {\n setInputValue('');\n setDateState(undefined);\n setMonth(undefined);\n }\n }, [dateValue, dateFormat]);\n\n useEffect(() => {\n if (returnInputFocus && refObject.current) {\n refObject.current.focus();\n }\n }, [returnInputFocus]);\n\n const handleEscapeKeyDown = (): void => {\n refObject?.current && refObject.current.focus();\n setDatePickerOpen(false);\n };\n\n useKeyboardEvent(datepickerWrapperRef, handleEscapeKeyDown, [KeyboardEventKey.Escape]);\n useKeyboardEvent(inputWrapperRef, handleEscapeKeyDown, [KeyboardEventKey.Escape]);\n\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>, inputFormat: string): void => {\n setInputValue(event.currentTarget.value);\n const newDate = parse(event.currentTarget.value, inputFormat, new Date());\n\n if (isValid(newDate)) {\n setDateState(newDate);\n setMonth(newDate);\n } else {\n setDateState(undefined);\n }\n\n onChange && onChange(event, event.currentTarget.value);\n };\n\n const handleInputFocus = (): void => {\n if (!returnInputFocus) {\n setDatePickerOpen(true);\n } else {\n setReturnInputFocus(false);\n }\n };\n\n /* eslint-disable @typescript-eslint/no-unused-vars */\n const handleSingleDatePickerSelect: PropsSingle['onSelect'] = (\n date: Date | undefined,\n _selectedDay: Date,\n _activeModifiers: Modifiers,\n e?: React.MouseEvent<Element, MouseEvent> | React.KeyboardEvent<Element>\n ): void => {\n setReturnInputFocus(true);\n\n if (!date) {\n setDatePickerOpen(false);\n return;\n }\n\n setDateState(date);\n\n if (refObject.current) {\n setInputValue(format(date, dateFormat));\n setDatePickerOpen(false);\n }\n\n onChange && onChange(e, date);\n triggerSyntheticInputEvents(refObject, format(date, dateFormat), date);\n onDatePopupClosed && onDatePopupClosed(date);\n };\n\n // We do this to make sure selecting from the DatePickerPopup triggers the onChange events properly, and works with react-hook-form\n const triggerSyntheticInputEvents = (\n inputRef: React.RefObject<HTMLInputElement>,\n value: string,\n date: Date,\n _onChange?: (event: React.ChangeEvent<HTMLInputElement>, date: Date) => void\n ): void => {\n if (inputRef.current) {\n inputRef.current.value = value;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const inputEvent = new Event('change', { bubbles: true });\n\n // Since the event is synthetic we have to add the target for webcomponents to not throw an error\n Object.defineProperty(inputEvent, 'target', {\n value: inputRef.current,\n writable: false,\n enumerable: true,\n configurable: true,\n });\n\n Object.defineProperty(inputEvent, 'currentTarget', {\n value: inputRef.current,\n writable: false,\n enumerable: true,\n configurable: true,\n });\n\n inputRef.current.dispatchEvent(inputEvent);\n\n if (onChange) {\n onChange(inputEvent as unknown as React.ChangeEvent<HTMLInputElement>, date);\n }\n }\n };\n\n const handleInputBlur = (e: React.FocusEvent<HTMLInputElement, Element>): void => {\n // We don't trigger the native onBlur event if the user select via the datepicker and the onDatePopupClosed callback is used (usually to trigger validation manually)\n if (!datePickerOpen && (typeof onDatePopupClosed === 'undefined' || isTyping.current)) {\n onBlur && onBlur(e);\n }\n\n isTyping.current = false;\n };\n\n const handleButtonClick = (\n e?: React.MouseEvent<HTMLElement, MouseEvent> | React.FormEvent<{}> | React.KeyboardEvent<HTMLUListElement> | null | undefined\n ): void => {\n e?.stopPropagation();\n setDatePickerOpen(!datePickerOpen);\n };\n\n // This differentiates between typing in the input field and selecting a date from the datepicker, especially on native mobile date fields\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent): void => {\n if (!['Escape', 'Enter', 'Tab'].includes(e.key)) {\n isTyping.current = true;\n setDatePickerOpen(false);\n }\n };\n\n const inputElement = refObject.current;\n if (inputElement) {\n inputElement.addEventListener('keydown', handleKeyDown);\n }\n\n return (): void => {\n if (inputElement) {\n inputElement.removeEventListener('keydown', handleKeyDown);\n }\n };\n }, [refObject]);\n\n const handleMobileInputChange = (e: React.ChangeEvent<HTMLInputElement>): void => {\n handleInputChange(e, 'yyyy-MM-dd');\n\n if (!isTyping.current) {\n onDatePopupClosed && onDatePopupClosed(dateState);\n }\n };\n\n const renderMobile = (\n <Input\n disabled={disabled}\n error={error}\n errorText={errorText}\n errorTextId={errorTextId}\n inputId={inputId}\n label={label}\n max={maxDate ? format(maxDate, 'yyyy-MM-dd') : ''}\n min={minDate ? format(minDate, 'yyyy-MM-dd') : ''}\n type=\"date\"\n ref={mergedRefs}\n value={dateState ? format(dateState, 'yyyy-MM-dd') : ''}\n width={14}\n {...rest}\n onBlur={handleInputBlur}\n onChange={handleMobileInputChange}\n autoComplete={autoComplete ? autoComplete : undefined}\n />\n );\n\n const renderDesktop = (\n <>\n <div>\n <Input\n errorWrapperClassName={errorWrapperClassName}\n disabled={disabled}\n error={error}\n errorText={errorText}\n errorTextId={errorTextId}\n inputId={inputId}\n inputContainerRef={inputContainerRef}\n inputWrapperRef={inputWrapperRef}\n label={label}\n onFocus={handleInputFocus}\n type=\"text\"\n ref={mergedRefs}\n value={inputValue}\n width={12}\n {...rest}\n onBlur={handleInputBlur}\n onChange={(e: React.ChangeEvent<HTMLInputElement>) => handleInputChange(e, 'yyyy-MM-dd')}\n rightOfInput={\n <Button\n disabled={disabled}\n ariaLabel={dateButtonAriaLabel ?? 'Velg dato'}\n onClick={handleButtonClick}\n tabIndex={datePickerOpen ? -1 : 0}\n variant={'borderless'}\n wrapperClassName={styles['date-button']}\n className={styles['date-button__inner']}\n >\n <Icon color={'black'} svgIcon={Calendar} />\n </Button>\n }\n autoComplete={autoComplete ? autoComplete : undefined}\n />\n </div>\n {datePickerOpen && !disabled && (\n <DatePickerPopup\n dir={dir}\n disabled={disabledDays}\n datepickerWrapperRef={datepickerWrapperRef}\n footer={footerContent}\n startMonth={minDate}\n endMonth={maxDate}\n inputRef={refObject}\n locale={locale}\n month={month}\n selected={dateState}\n onSelect={handleSingleDatePickerSelect}\n onMonthChange={setMonth}\n variant={variant}\n zIndex={zIndex}\n />\n )}\n </>\n );\n\n return (\n <div className={className} data-testid={testId}>\n {isMobileUA() ? renderMobile : renderDesktop}\n </div>\n );\n});\n\nDatePicker.displayName = 'DatePicker';\n\nexport default DatePicker;\n","import React, { useEffect, useState } from 'react';\n\nimport { ErrorWrapperClassNameProps } from '@helsenorge/designsystem-react/components/ErrorWrapper';\nimport Input from '@helsenorge/designsystem-react/components/Input';\nimport { usePseudoClasses } from '@helsenorge/designsystem-react/hooks/usePseudoClasses';\nimport { isMutableRefObject, mergeRefs } from '@helsenorge/designsystem-react/utils/refs';\n\nimport styles from './styles.module.scss';\n\nexport type TimeUnit = 'hours' | 'minutes';\n\nexport interface DateTimeProps\n extends ErrorWrapperClassNameProps,\n Pick<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'name' | 'aria-describedby' | 'aria-labelledby' | 'onBlur' | 'onChange' | 'disabled' | 'autoComplete'\n > {\n /** Default value that is set on the input field */\n defaultValue?: number;\n /** Activates Error style for the input */\n error?: boolean;\n /** Error text to show above the component */\n errorText?: string;\n /** Error text id */\n errorTextId?: string;\n /** input id of the checkbox */\n inputId?: string;\n /** Label of the input */\n label?: React.ReactNode;\n /** Sets the unit of time for the input field */\n timeUnit: TimeUnit;\n /** Value that is set on the input field */\n value?: number;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nconst formatAsTwoDigits = (value: string | number): string => {\n const stringValue = String(value);\n return stringValue.length === 1 ? '0' + stringValue : stringValue;\n};\n\nconst isNumericString = (str: string): boolean => {\n return !str || (/^\\d+$/.test(str) && str.length <= 2);\n};\n\nexport const DateTime = React.forwardRef((props: DateTimeProps, ref: React.Ref<HTMLInputElement>) => {\n const {\n error,\n errorText,\n errorTextId,\n errorWrapperClassName,\n label,\n onBlur,\n onChange,\n timeUnit,\n testId,\n inputId,\n value,\n autoComplete = 'off',\n ...rest\n } = props;\n\n const [inputValue, setInputValue] = useState<number | string | undefined>(\n typeof value !== 'undefined' ? formatAsTwoDigits(value) : undefined\n );\n const { refObject } = usePseudoClasses<HTMLInputElement>(isMutableRefObject(ref) ? ref : null);\n const mergedRefs = mergeRefs([ref, refObject]);\n\n useEffect(() => {\n setInputValue(value ? formatAsTwoDigits(value) : undefined);\n }, [value]);\n\n const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>): void => {\n const value = event.target.value;\n\n if (isNumericString(value)) {\n setInputValue(value);\n onChange && onChange(event);\n }\n };\n\n const handleInputBlur = (event: React.FocusEvent<HTMLInputElement>): void => {\n const formattedValue = formatAsTwoDigits(event.target.value);\n setInputValue(formattedValue);\n onChange && onChange(event);\n onBlur && onBlur(event);\n };\n\n /** Firefox stopper ikke vanlige characters fra å skrives til input type number - derfor håndterer vi det selv her */\n const handleInputOnKeyDown = (event: React.KeyboardEvent) => {\n const validChars = /[0-9]/;\n const allowedKeys = ['Backspace', ' ', 'Enter', 'Tab', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'];\n if (!validChars.test(event.key) && !allowedKeys.includes(event.key)) {\n event.preventDefault();\n }\n };\n\n const renderTimeSeparator = (): React.ReactNode => {\n return timeUnit === 'hours' && <span className={styles['time-separator']}>{':'}</span>;\n };\n\n return (\n <div data-testid={testId}>\n <Input\n inputId={inputId}\n error={error}\n errorText={errorText}\n errorTextId={errorTextId}\n errorWrapperClassName={errorWrapperClassName}\n label={label}\n max={timeUnit === 'hours' ? 23 : 59}\n min={0}\n type=\"number\"\n ref={mergedRefs}\n value={inputValue}\n width={5}\n defaultValue={typeof props.defaultValue !== 'undefined' ? formatAsTwoDigits(props.defaultValue) : undefined}\n {...rest}\n onChange={handleInputChange}\n onBlur={handleInputBlur}\n rightOfInput={renderTimeSeparator()}\n onKeyDown={handleInputOnKeyDown}\n autoComplete={autoComplete ? autoComplete : undefined}\n />\n </div>\n );\n});\n\nDateTime.displayName = 'DateTime';\n\nexport default DateTime;\n","import React from 'react';\n\nimport classNames from 'classnames';\n\nimport ErrorWrapper, { ErrorWrapperClassNameProps } from '@helsenorge/designsystem-react/components/ErrorWrapper';\nimport { useUuid } from '@helsenorge/designsystem-react/hooks/useUuid';\nimport { isComponent } from '@helsenorge/designsystem-react/utils/component';\n\nimport DatePicker, { DatePickerProps } from './DatePicker';\nimport DateTime, { DateTimeProps } from './DateTime';\n\nimport styles from './styles.module.scss';\n\nexport type TimeUnits = 'hours' | 'minutes';\n\ninterface DateTimePickerWrapperProps extends ErrorWrapperClassNameProps {\n /** Sets the children of the datetimepicker - the DatePicker and DateTime components go here */\n children?: React.ReactNode;\n /** Error text to show above the component */\n errorText?: string;\n /** text placed in the legend tag of the fieldset */\n legend?: string;\n /** Sets the data-testid attribute. */\n testId?: string;\n}\n\nexport const DateTimePickerWrapper = React.forwardRef((props: DateTimePickerWrapperProps, ref: React.ForwardedRef<HTMLDivElement>) => {\n const { children, errorWrapperClassName, errorText, legend, testId } = props;\n const errorTextId = useUuid();\n\n const mapDateComponents = (child: React.ReactNode): React.ReactNode => {\n if (isComponent<DatePickerProps>(child, DatePicker)) {\n return React.cloneElement(child, {\n className: classNames(styles['date-time-picker-wrapper__date-picker']),\n error: !!errorText,\n errorTextId,\n });\n } else if (isComponent<DateTimeProps>(child, DateTime)) {\n return React.cloneElement(child, {\n error: !!errorText,\n errorTextId,\n });\n }\n return child;\n };\n\n return (\n <div ref={ref} tabIndex={-1}>\n <ErrorWrapper className={errorWrapperClassName} errorText={errorText} errorTextId={errorTextId}>\n {props.legend ? (\n <fieldset className={styles['date-time-picker-wrapper']} data-testid={testId}>\n {props.legend && <legend className={styles['date-time-picker-wrapper__legend']}>{legend}</legend>}\n {React.Children.map(children, mapDateComponents)}\n </fieldset>\n ) : (\n <div className={styles['date-time-picker-wrapper']}>{React.Children.map(children, mapDateComponents)}</div>\n )}\n </ErrorWrapper>\n </div>\n );\n});\n\nDateTimePickerWrapper.displayName = 'DateTimePickerWrapper';\n\nexport default DateTimePickerWrapper;\n","import { isWithinInterval, isAfter, isBefore, isSameDay, parse, isValid } from 'date-fns';\n\nexport const parseInputDate = (dateString: string): Date | null => {\n const possibleFormats = ['yyyy-MM-dd', 'dd.MM.yyyy'];\n\n for (const format of possibleFormats) {\n const parsedDate = parse(dateString, format, new Date());\n if (isValid(parsedDate)) {\n return parsedDate;\n }\n }\n\n return null;\n};\n\nexport const isValidDate = (dateString: string): boolean => {\n const date = new Date(dateString);\n return date instanceof Date && !isNaN(date.getTime());\n};\n\n/** react-hook-form fromDate and toDate validation */\nexport const validateMinMaxDate = (\n date: string,\n outsideRangeErrorMessage: string,\n invalidFormatErrorMessage?: string,\n minDate?: Date,\n maxDate?: Date\n): string | true => {\n const formattedDate = parseInputDate(date);\n const hasMinDate = typeof minDate !== 'undefined';\n const hasMaxDate = typeof maxDate !== 'undefined';\n if (!formattedDate || (hasMinDate && !isValid(minDate)) || (hasMaxDate && !isValid(maxDate))) {\n return invalidFormatErrorMessage || 'Invalid date format';\n }\n\n if (hasMinDate && !hasMaxDate && (isSameDay(formattedDate, minDate) || isAfter(formattedDate, minDate))) return true;\n else if (hasMaxDate && !hasMinDate && (isSameDay(formattedDate, maxDate) || isBefore(formattedDate, maxDate))) return true;\n else if (\n hasMinDate &&\n hasMaxDate &&\n (isSameDay(formattedDate, minDate) ||\n isSameDay(formattedDate, maxDate) ||\n isWithinInterval(formattedDate, { start: minDate, end: maxDate }))\n ) {\n return true;\n }\n\n return outsideRangeErrorMessage;\n};\n\n/** react-hook-form fromDate and toDate validation */\nexport const validateDisabledDates = (\n date: string,\n disabledDates: Date[],\n isDisabledErrorMessage: string,\n invalidFormatErrorMessage?: string\n): string | true => {\n const formattedDate = parseInputDate(date);\n if (!formattedDate) {\n return invalidFormatErrorMessage || 'Invalid date format';\n }\n if (!disabledDates.some(d => isSameDay(d, formattedDate))) {\n return true;\n }\n\n return isDisabledErrorMessage;\n};\n\n/** react-hook-form fromTime and toTime validation */\nexport const validateMinTimeMaxTime = (\n time: { hour: number; minute: number },\n errorMessage: string,\n minTime?: { hour: number; minute: number },\n maxTime?: { hour: number; minute: number }\n): string | true => {\n const timeParsed = parse((time.hour + ':' + time.minute).toString(), 'HH:mm', new Date());\n const minTimeParsed = parse((minTime?.hour + ':' + minTime?.minute).toString(), 'HH:mm', new Date());\n const maxTimeParsed = parse((maxTime?.hour + ':' + maxTime?.minute).toString(), 'HH:mm', new Date());\n\n if ((typeof minTime === 'undefined' || timeParsed >= minTimeParsed) && (typeof maxTime === 'undefined' || timeParsed <= maxTimeParsed)) {\n return true;\n }\n\n return errorMessage;\n};\n"],"names":["UI","DayFlag","SelectionState","classNames","components","labelPrevious","labelNext","addMonths","startOfMonth","defaultLocale","month","styles","format","startOfYear","endOfYear","addYears","isBefore","isSameYear","addDays","differenceInCalendarDays","differenceInCalendarMonths","endOfBroadcastWeek","endOfISOWeek","endOfMonth","endOfWeek","isAfter","startOfBroadcastWeek","startOfISOWeek","startOfWeek","initialDays","weekDays","getISOWeek","getWeek","weeks","week","startOfDay","isSameDay","addWeeks","max","min","useFocus","isSameMonth","days","locale","dateLib","formatCaption","formatDay","formatMonthDropdown","formatWeekNumber","formatWeekNumberHeader","formatWeekdayName","formatYearDropdown","labelDayButton","labelGridcell","labelGrid","labelMonthDropdown","labelNav","labelWeekday","labelWeekNumber","labelWeekNumberHeader","labelYearDropdown","style","className","setMonth","Button","value"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOO,IAAI;AAAA,CACV,SAAUA,KAAI;AAEX,EAAAA,IAAG,MAAM,IAAI;AAEb,EAAAA,IAAG,SAAS,IAAI;AAKhB,EAAAA,IAAG,KAAK,IAAI;AAEZ,EAAAA,IAAG,WAAW,IAAI;AAElB,EAAAA,IAAG,cAAc,IAAI;AAErB,EAAAA,IAAG,WAAW,IAAI;AAElB,EAAAA,IAAG,UAAU,IAAI;AAEjB,EAAAA,IAAG,cAAc,IAAI;AAErB,EAAAA,IAAG,QAAQ,IAAI;AAEf,EAAAA,IAAG,WAAW,IAAI;AAElB,EAAAA,IAAG,cAAc,IAAI;AAErB,EAAAA,IAAG,gBAAgB,IAAI;AAEvB,EAAAA,IAAG,OAAO,IAAI;AAEd,EAAAA,IAAG,QAAQ,IAA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gBAAgB;AAC/H,WAAA;AAAA,EAAA;AAGF,SAAA;AACT;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92]}
|