calendar-simple 1.2.0 → 2.0.0-beta.1
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/LICENSE +1 -1
- package/README.md +371 -62
- package/dist/calendar-simple.css +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +7588 -978
- package/dist/index.es.js.map +1 -1
- package/dist/index.iife.js +1 -1
- package/dist/index.iife.js.map +1 -1
- package/dist/src/Calendar.d.ts +19 -0
- package/dist/src/Calendar.test.d.ts +1 -0
- package/dist/src/assets/LeftArrow.d.ts +3 -0
- package/dist/src/assets/RightArrow.d.ts +3 -0
- package/dist/src/components/core/all_day_banner/AllDayBanner.d.ts +9 -0
- package/dist/src/components/core/all_day_banner/AllDayBanner.test.d.ts +1 -0
- package/dist/src/components/core/current_time_line/CurrentTimeLine.d.ts +7 -0
- package/dist/src/components/core/current_time_line/CurrentTimeLine.test.d.ts +1 -0
- package/dist/src/components/core/day_column/DayColumn.d.ts +11 -0
- package/dist/src/components/core/day_column/DayColumn.test.d.ts +1 -0
- package/dist/src/components/core/day_event_item/DayWeekEventItem.d.ts +8 -0
- package/dist/src/components/core/day_event_item/DayWeekEventItem.test.d.ts +1 -0
- package/dist/src/components/core/month_event_item/MonthEventItem.d.ts +21 -0
- package/dist/src/components/core/month_event_item/MonthEventItem.test.d.ts +1 -0
- package/dist/src/components/core/time_column/TimeColumn.d.ts +6 -0
- package/dist/src/components/core/time_column/TimeColumn.test.d.ts +1 -0
- package/dist/src/components/layout/Header.d.ts +7 -0
- package/dist/src/components/layout/Header.test.d.ts +1 -0
- package/dist/src/components/ui/CalendarErrorBoundary.d.ts +14 -0
- package/dist/src/components/ui/popover/Popover.d.ts +11 -0
- package/dist/src/components/ui/popover/Popover.test.d.ts +1 -0
- package/dist/src/components/ui/skeleton/MonthSkeleton.d.ts +2 -0
- package/dist/src/components/ui/skeleton/MonthSkeleton.test.d.ts +1 -0
- package/dist/src/components/ui/skeleton/ScheduleSkeleton.d.ts +2 -0
- package/dist/src/components/ui/skeleton/ScheduleSkeleton.test.d.ts +1 -0
- package/dist/src/components/ui/skeleton/TimeGridSkeleton.d.ts +2 -0
- package/dist/src/components/ui/skeleton/TimeGridSkeleton.test.d.ts +1 -0
- package/dist/src/components/views/View.d.ts +4 -0
- package/dist/src/components/views/View.test.d.ts +1 -0
- package/dist/src/components/views/custom_days_view/CustomDaysView.d.ts +5 -0
- package/dist/src/components/views/custom_days_view/CustomDaysView.test.d.ts +1 -0
- package/dist/src/components/views/day_view/DayView.d.ts +5 -0
- package/dist/src/components/views/day_view/DayView.test.d.ts +1 -0
- package/dist/src/components/views/month_view/MonthView.d.ts +5 -0
- package/dist/src/components/views/month_view/MonthView.test.d.ts +1 -0
- package/dist/src/components/views/schedule_view/ScheduleView.d.ts +4 -0
- package/dist/src/components/views/schedule_view/ScheduleView.test.d.ts +1 -0
- package/dist/src/components/views/week_view/WeekView.d.ts +5 -0
- package/dist/src/components/views/week_view/WeekView.test.d.ts +1 -0
- package/dist/src/constants/calendar.d.ts +96 -0
- package/dist/src/constants/index.d.ts +2 -0
- package/dist/src/constants/theme.d.ts +38 -0
- package/dist/src/context/CalendarContext.d.ts +83 -0
- package/dist/src/context/CalendarContext.test.d.ts +1 -0
- package/dist/src/hooks/useAllDayBanner.d.ts +48 -0
- package/dist/src/hooks/useAllDayBanner.test.d.ts +1 -0
- package/dist/src/hooks/useCalendarProps.d.ts +10 -0
- package/dist/src/hooks/useColorScheme.d.ts +2 -0
- package/dist/src/hooks/useColorScheme.test.d.ts +1 -0
- package/dist/src/hooks/useDayEventLayout.d.ts +27 -0
- package/dist/src/hooks/useDayEventLayout.test.d.ts +1 -0
- package/dist/src/hooks/useEvents.d.ts +16 -0
- package/dist/src/hooks/useEvents.test.d.ts +1 -0
- package/dist/src/hooks/useMonthGrid.d.ts +44 -0
- package/dist/src/hooks/useMonthGrid.test.d.ts +1 -0
- package/dist/src/hooks/useResizeObserver.d.ts +13 -0
- package/dist/src/hooks/useResizeObserver.test.d.ts +1 -0
- package/dist/src/hooks/useScheduleView.d.ts +24 -0
- package/dist/src/hooks/useScheduleView.test.d.ts +1 -0
- package/dist/src/index.d.ts +13 -0
- package/dist/src/setupTests.d.ts +0 -0
- package/dist/src/stories/Accessibility.stories.d.ts +10 -0
- package/dist/src/stories/CustomDayView.stories.d.ts +10 -0
- package/dist/src/stories/Customization.stories.d.ts +29 -0
- package/dist/src/stories/DayView.stories.d.ts +11 -0
- package/dist/src/stories/Features.stories.d.ts +25 -0
- package/dist/src/stories/Localization.stories.d.ts +22 -0
- package/dist/src/stories/MonthView.stories.d.ts +13 -0
- package/dist/src/stories/QA/EdgeCases.stories.d.ts +12 -0
- package/dist/src/stories/QA/Interactions.stories.d.ts +8 -0
- package/dist/src/stories/QA/LayoutLimits.stories.d.ts +11 -0
- package/dist/src/stories/QA/Performance.stories.d.ts +9 -0
- package/dist/src/stories/QA/TimeFormatting.stories.d.ts +11 -0
- package/dist/src/stories/QA/Views.stories.d.ts +10 -0
- package/dist/src/stories/ScheduleView.stories.d.ts +10 -0
- package/dist/src/stories/WeekView.stories.d.ts +14 -0
- package/dist/src/types/calendar.d.ts +213 -0
- package/dist/src/types/events.d.ts +34 -0
- package/dist/src/types/index.d.ts +3 -0
- package/dist/src/types/theme.d.ts +81 -0
- package/dist/src/utils/common.d.ts +48 -0
- package/dist/src/utils/common.test.d.ts +1 -0
- package/dist/src/utils/contrast.d.ts +18 -0
- package/dist/src/utils/contrast.test.d.ts +1 -0
- package/dist/src/utils/date.d.ts +55 -0
- package/dist/src/utils/date.test.d.ts +1 -0
- package/dist/src/utils/formatting.d.ts +21 -0
- package/dist/src/utils/formatting.test.d.ts +1 -0
- package/dist/src/utils/index.d.ts +9 -0
- package/dist/stats.html +4950 -0
- package/package.json +56 -16
- package/dist/index.d.ts +0 -60
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","names":["MONTH_LIST: MonthListType[]","e","n","t","r","i","s","u","a","M","m","f","l","$","y","v","g","D","o","d","c","h","weekEvents: InternalDataType[]","slots: string[][]","displayData: (DataTypeList | null)[]","newStyle: CSSProperties","allDayEvents: DataTypeList[]","initialState: CalendarState"],"sources":["../node_modules/classnames/index.js","../src/types/index.ts","../src/constants/index.ts","../node_modules/dayjs/dayjs.min.js","../src/utils/date.ts","../node_modules/calendarize/dist/index.mjs","../src/utils/calendarLogic.ts","../src/utils/common.ts","../src/utils/hooks.ts","../src/Calendar.module.css","../src/common/EventItem.module.css","../src/common/Popover.module.css","../src/common/Popover.tsx","../src/common/EventItem.tsx","../src/layout/Header.module.css","../src/assets/LeftArrow.tsx","../src/assets/RightArrow.tsx","../src/context/CalendarContext.tsx","../src/layout/Header.tsx","../src/Calendar.tsx","../src/index.ts"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue(arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(null, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import { DateType } from \"../utils\";\n\nexport interface ThemeStyle {\n color?: string;\n bgColor?: string;\n}\n\nexport interface CalendarTheme {\n default?: ThemeStyle;\n selected?: ThemeStyle;\n today?: ThemeStyle;\n}\n\nexport interface DataType {\n startDate: string;\n endDate?: string;\n value: string;\n color?: string;\n}\n\nexport interface CalendarType {\n dayType?: EDayType;\n data?: DataType[];\n width?: number;\n height?: number;\n selectedDate?: Date;\n onDateClick?: (date: Date) => void;\n onEventClick?: (event: DataType) => void;\n onMoreClick?: (date: Date) => void;\n onMonthChange?: (date: Date) => void;\n isSelectDate?: boolean;\n className?: string;\n headerClassName?: string;\n tableClassName?: string;\n tableDateClassName?: string;\n dataClassName?: string;\n selectedClassName?: string;\n todayClassName?: string;\n pastYearLength?: number;\n futureYearLength?: number;\n theme?: CalendarTheme;\n maxEvents?: number;\n}\n\nexport interface CalendarContentType extends CalendarType {\n dayType: EDayType;\n data: DataType[];\n width: number;\n height: number;\n isSelectDate: boolean;\n pastYearLength: number;\n futureYearLength: number;\n}\n\nexport enum EDayType {\n fullName = \"FULL\",\n halfName = \"HALF\",\n}\n\nexport type DataTypeList =\n | (DataType & {\n startDateWeek: string;\n endDateWeek?: string;\n isSpacer?: false;\n })\n | (DataType & { isSpacer: true });\n\nexport interface DateDataType {\n date: number;\n dateObj: DateType;\n data: (DataTypeList | null)[];\n cellWidth: number;\n className?: string;\n dataClassName?: string;\n isSelected: boolean;\n isToday: boolean;\n isCurrentMonth: boolean;\n onClick?: (date: DateType) => void;\n onEventClick?: (event: DataType) => void;\n onMoreClick?: (date: DateType) => void;\n selectedClassName?: string;\n todayClassName?: string;\n theme?: CalendarTheme;\n maxEvents: number;\n totalEvents?: number;\n}\n\nexport interface MonthListType {\n label: string;\n value: number;\n}\n\nexport enum EMonthOption {\n add = \"add\",\n sub = \"sub\",\n}\n\nexport enum EYearOption {\n month = \"month\",\n year = \"year\",\n}\n\nexport type CalendarView = \"month\" | \"week\" | \"day\";\n","import { EDayType, MonthListType } from \"../types\";\n\nconst DAY_LIST = {\n SUNDAY: {\n FULL: \"Sunday\",\n HALF: \"Sun\",\n },\n MONDAY: {\n FULL: \"Monday\",\n HALF: \"Mon\",\n },\n TUESDAY: {\n FULL: \"Tuesday\",\n HALF: \"Tue\",\n },\n WEDNESDAY: {\n FULL: \"Wednesday\",\n HALF: \"Wed\",\n },\n THURSDAY: {\n FULL: \"Thursday\",\n HALF: \"Thu\",\n },\n FRIDAY: {\n FULL: \"Friday\",\n HALF: \"Fri\",\n },\n SATURDAY: {\n FULL: \"Saturday\",\n HALF: \"Sat\",\n },\n};\n\nexport const DAY_LIST_NAME = {\n FULL: [\n DAY_LIST.SUNDAY.FULL,\n DAY_LIST.MONDAY.FULL,\n DAY_LIST.TUESDAY.FULL,\n DAY_LIST.WEDNESDAY.FULL,\n DAY_LIST.THURSDAY.FULL,\n DAY_LIST.FRIDAY.FULL,\n DAY_LIST.SATURDAY.FULL,\n ],\n HALF: [\n DAY_LIST.SUNDAY.HALF,\n DAY_LIST.MONDAY.HALF,\n DAY_LIST.TUESDAY.HALF,\n DAY_LIST.WEDNESDAY.HALF,\n DAY_LIST.THURSDAY.HALF,\n DAY_LIST.FRIDAY.HALF,\n DAY_LIST.SATURDAY.HALF,\n ],\n};\n\nconst MONTHS = {\n JAN: { label: \"January\", value: 0 },\n FEB: { label: \"February\", value: 1 },\n MAR: { label: \"March\", value: 2 },\n APR: { label: \"April\", value: 3 },\n MAY: { label: \"May\", value: 4 },\n JUN: { label: \"June\", value: 5 },\n JUL: { label: \"July\", value: 6 },\n AUG: { label: \"August\", value: 7 },\n SEP: { label: \"September\", value: 8 },\n OCT: { label: \"October\", value: 9 },\n NOV: { label: \"November\", value: 10 },\n DEC: { label: \"December\", value: 11 },\n};\n\nexport const MONTH_LIST: MonthListType[] = Object.values(MONTHS);\n\nexport const CALENDER_STRINGS = {\n MONTH: \"monthDropdown\",\n YEAR: \"yearDropdown\",\n};\n\nexport const DAY_TYPE = {\n FULL_NAME: \"FULL\",\n HALF_NAME: \"HALF\",\n};\n\nexport const defaultTheme = {\n default: {\n color: \"#000\",\n bgColor: \"#fff\",\n },\n selected: {\n color: \"#fff\",\n bgColor: \"#007bff\",\n },\n today: {\n color: \"#007bff\",\n bgColor: \"#e6f2ff\",\n },\n};\n\nexport const defaultCalenderProps = {\n dayType: EDayType.halfName,\n data: [],\n isSelectDate: false,\n pastYearLength: 5,\n futureYearLength: 5,\n theme: defaultTheme,\n};\n\nexport const CALENDAR_CONSTANTS = {\n HEADER_HEIGHT: 122,\n DATE_LABEL_HEIGHT: 28,\n CELL_PADDING: 8,\n EVENT_HEIGHT: 26,\n DEFAULT_ROWS: 6,\n MIN_ROWS: 4,\n DAYS_IN_WEEK: 7,\n EVENT_ITEM_PADDING: 16, // used in width calculation\n};\n","!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs=e()}(this,(function(){\"use strict\";var t=1e3,e=6e4,n=36e5,r=\"millisecond\",i=\"second\",s=\"minute\",u=\"hour\",a=\"day\",o=\"week\",c=\"month\",f=\"quarter\",h=\"year\",d=\"date\",l=\"Invalid Date\",$=/^(\\d{4})[-/]?(\\d{1,2})?[-/]?(\\d{0,2})[Tt\\s]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?[.:]?(\\d+)?$/,y=/\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\"),ordinal:function(t){var e=[\"th\",\"st\",\"nd\",\"rd\"],n=t%100;return\"[\"+t+(e[(n-20)%10]||e[n]||e[0])+\"]\"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:\"\"+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+m(r,2,\"0\")+\":\"+m(i,2,\"0\")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return+(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},g=\"en\",D={};D[g]=M;var p=\"$isDayjsObject\",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if(\"string\"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split(\"-\");if(!i&&u.length>1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n=\"object\"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if(\"string\"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||\"0\").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return b},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate(\"s\"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v=\"set\"+(this.$u?\"UTC\":\"\");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+\"Hours\",0);case u:return $(v+\"Minutes\",1);case s:return $(v+\"Seconds\",2);case i:return $(v+\"Milliseconds\",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=b.p(t),f=\"set\"+(this.$u?\"UTC\":\"\"),l=(n={},n[a]=f+\"Date\",n[d]=f+\"Date\",n[c]=f+\"Month\",n[h]=f+\"FullYear\",n[u]=f+\"Hours\",n[s]=f+\"Minutes\",n[i]=f+\"Seconds\",n[r]=f+\"Milliseconds\",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||\"YYYY-MM-DDTHH:mm:ssZ\",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,\"0\")},$=f||function(t,e,n){var r=t<12?\"AM\":\"PM\";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case\"YY\":return String(e.$y).slice(-2);case\"YYYY\":return b.s(e.$y,4,\"0\");case\"M\":return a+1;case\"MM\":return b.s(a+1,2,\"0\");case\"MMM\":return h(n.monthsShort,a,c,3);case\"MMMM\":return h(c,a);case\"D\":return e.$D;case\"DD\":return b.s(e.$D,2,\"0\");case\"d\":return String(e.$W);case\"dd\":return h(n.weekdaysMin,e.$W,o,2);case\"ddd\":return h(n.weekdaysShort,e.$W,o,3);case\"dddd\":return o[e.$W];case\"H\":return String(s);case\"HH\":return b.s(s,2,\"0\");case\"h\":return d(1);case\"hh\":return d(2);case\"a\":return $(s,u,!0);case\"A\":return $(s,u,!1);case\"m\":return String(u);case\"mm\":return b.s(u,2,\"0\");case\"s\":return String(e.$s);case\"ss\":return b.s(e.$s,2,\"0\");case\"SSS\":return b.s(e.$ms,3,\"0\");case\"Z\":return i}return null}(t)||i.replace(\":\",\"\")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[[\"$ms\",r],[\"$s\",i],[\"$m\",s],[\"$H\",u],[\"$W\",a],[\"$M\",c],[\"$y\",h],[\"$D\",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));","import dayjs, { Dayjs } from \"dayjs\";\n\nexport type DateType = Dayjs;\nexport type DateInputType = Date | DateType | string | number;\nexport const dateFn = dayjs;\n\nexport function getNoOfDays(date: DateType): number {\n return dayjs(date).daysInMonth();\n}\n\nexport function getMonthStartingDay(date: DateType): number {\n return Number(dayjs(date).startOf(\"month\").format(\"d\"));\n}\n\nexport function convertToDate(dayjsDate: DateType): Date {\n return dayjs(dayjsDate).toDate();\n}\n\nexport function getYearList(\n pastLength: number,\n futureLength: number,\n selectedYear: number,\n): number[] {\n const yearLength = pastLength + futureLength;\n const yearStarting = dayjs().year() - pastLength;\n const yearList = Array.from(\n { length: yearLength },\n (_, index) => index + yearStarting,\n );\n\n if (!yearList.includes(selectedYear)) {\n if (dayjs().year() <= selectedYear) {\n yearList.push(selectedYear);\n } else {\n return [selectedYear, ...yearList];\n }\n }\n return yearList;\n}\n\nexport function checkIsToday(selectedDate: DateType, dates: number): boolean {\n const cloneSelectedDate = dayjs(selectedDate).date(dates);\n\n const isToday = dayjs().isSame(cloneSelectedDate, \"day\");\n return isToday;\n}\n\nexport function getStartOfDay(date: DateInputType): DateType {\n return dayjs(date).startOf(\"day\");\n}\n\nexport function getEndOfDay(date: DateInputType): DateType {\n return dayjs(date).endOf(\"day\");\n}\n\nexport function getStartOfMonth(date: DateType): DateType {\n return dayjs(date).startOf(\"month\");\n}\n\nexport function getEndOfMonth(date: DateType): DateType {\n return dayjs(date).endOf(\"month\");\n}\n\nexport function addDays(date: DateType, days: number): DateType {\n return dayjs(date).add(days, \"day\");\n}\n\nexport function subDays(date: DateType, days: number): DateType {\n return dayjs(date).subtract(days, \"day\");\n}\n\nexport function addMonths(date: DateType, months: number): DateType {\n return dayjs(date).add(months, \"month\");\n}\n\nexport function subMonths(date: DateType, months: number): DateType {\n return dayjs(date).subtract(months, \"month\");\n}\n\nexport function getDiffDays(\n date1: DateInputType,\n date2: DateInputType,\n): number {\n return dayjs(date1).diff(dayjs(date2), \"day\");\n}\n\nexport function isBeforeDate(date1: DateType, date2: DateType): boolean {\n return dayjs(date1).isBefore(dayjs(date2), \"day\");\n}\n\nexport function isAfterDate(date1: DateType, date2: DateType): boolean {\n return dayjs(date1).isAfter(dayjs(date2), \"day\");\n}\n\nexport function isSameDate(date1: DateType, date2: DateType): boolean {\n return dayjs(date1).isSame(dayjs(date2), \"day\");\n}\n\nexport function formatDate(date: DateInputType, format: string): string {\n return dayjs(date).format(format);\n}\n\nexport function setDate(date: DateType, day: number): DateType {\n return dayjs(date).date(day);\n}\n\nexport function setMonth(date: DateType, month: number): DateType {\n return dayjs(date).month(month);\n}\n\nexport function setYear(date: DateType, year: number): DateType {\n return dayjs(date).year(year);\n}\n\nexport function getDate(date: DateType): number {\n return dayjs(date).date();\n}\n\nexport function getMonth(date: DateType): number {\n return dayjs(date).month();\n}\n\nexport function getYear(date: DateType): number {\n return dayjs(date).year();\n}\n\nexport function getDay(date: DateType): number {\n return dayjs(date).day();\n}\n","export default function (target, offset) {\n\tvar i=0, j=0, week, out=[], date = new Date(target || new Date);\n\tvar year = date.getFullYear(), month = date.getMonth();\n\n\t// day index (of week) for 1st of month\n\tvar first = new Date(year, month, 1 - (offset | 0)).getDay();\n\n\t// how many days there are in this month\n\tvar days = new Date(year, month+1, 0).getDate();\n\n\twhile (i < days) {\n\t\tfor (j=0, week=Array(7); j < 7;) {\n\t\t\twhile (j < first) week[j++] = 0;\n\t\t\tweek[j++] = ++i > days ? 0 : i;\n\t\t\tfirst = 0;\n\t\t}\n\t\tout.push(week);\n\t}\n\n\treturn out;\n}\n","/**\n * @file calendarLogic.ts\n * @description Core logic for generating the calendar grid and managing event layout.\n *\n * This utility handles the complex task of:\n * 1. Generating a grid of dates for the current month view.\n * 2. Placing events onto this grid.\n * 3. Handling multi-day events that span across weeks.\n * 4. Calculating vertical slot assignments for events to prevent visual overlaps (the \"Tetris\" problem).\n */\n\nimport calendarize from \"calendarize\";\nimport {\n dateFn,\n checkIsToday,\n DateType,\n getMonthStartingDay,\n getStartOfDay,\n getDiffDays,\n getStartOfMonth,\n setDate,\n addDays,\n isBeforeDate,\n isAfterDate,\n isSameDate,\n formatDate,\n subDays,\n getDate,\n} from \"./date\";\nimport { DataType, DataTypeList } from \"../types\";\n\ninterface InternalDataType extends DataType {\n _tempId?: string;\n}\n\n/**\n * Represents the information for a single day in the calendar grid.\n */\nexport interface CalendarDayInfo {\n /** The full date object */\n currentDate: DateType;\n /** Whether the day belongs to the currently selected month (for styling) */\n isCurrentMonth: boolean;\n /** The day number to display (1-31) */\n displayDay: number;\n /** List of events or spacers for this day's slots */\n events: (DataTypeList | null)[];\n /** Total number of events on this day (including hidden ones) */\n totalEvents: number;\n /** Whether this day is today */\n isToday: boolean;\n}\n\n/**\n * 2D array representing the calendar grid: [week][day]\n */\nexport type CalendarMatrix = CalendarDayInfo[][];\n\n/**\n * Generates the grid of days and events for the monthly view.\n *\n * This function handles:\n * 1. Grid Generation: Calculates the days for each week, handling previous/next month overlap.\n * 2. Event Processing: Filters events for each week and sorts them.\n * 3. Slot Assignment: Uses a \"tetris-like\" algorithm to stack overlapping events into available vertical slots.\n * 4. Data Preparation: Formats the data for the UI, including calculating event continuity across days.\n *\n * @param selectedDate - The currently selected date (determining the month to show)\n * @param events - List of all events\n * @returns A structured matrix of weeks and days with assigned events\n */\nexport function generateCalendarGrid(\n selectedDate: DateType,\n events: DataType[],\n): CalendarMatrix {\n // Sort events\n const dataEvents = [...events].sort((a, b) => {\n return getDiffDays(getStartOfDay(a.startDate), getStartOfDay(b.startDate));\n });\n\n const calendarArray = calendarize(selectedDate.toDate());\n\n return calendarArray.map((week: number[], weekIndex: number) => {\n // -------------------------------------------------------------------------\n // 1. Grid Generation: Calculate dates for the entire week first\n // -------------------------------------------------------------------------\n const processedWeek = week.map((day: number, dayIndex: number) => {\n let currentDate = dateFn(selectedDate);\n let isCurrentMonth = true;\n let displayDay = day;\n\n if (day === 0) {\n isCurrentMonth = false;\n if (weekIndex === 0) {\n const startOfMonth = getStartOfMonth(selectedDate);\n const startDayOfWeek = getMonthStartingDay(selectedDate);\n currentDate = subDays(startOfMonth, startDayOfWeek - dayIndex);\n displayDay = getDate(currentDate);\n } else {\n const startOfMonth = getStartOfMonth(selectedDate);\n const startDayOfWeek = getMonthStartingDay(selectedDate);\n\n const globalIndex = weekIndex * 7 + dayIndex;\n const daysFromStart = globalIndex - startDayOfWeek;\n\n currentDate = addDays(startOfMonth, daysFromStart);\n displayDay = getDate(currentDate);\n }\n } else {\n currentDate = setDate(selectedDate, day);\n }\n return { currentDate, isCurrentMonth, displayDay };\n });\n\n // -------------------------------------------------------------------------\n // 2. Event Identification: Identify all events overlapping with this week\n // -------------------------------------------------------------------------\n const weekStart = getStartOfDay(processedWeek[0].currentDate);\n const weekEnd = getStartOfDay(processedWeek[6].currentDate);\n\n const weekEvents: InternalDataType[] = dataEvents.filter((item) => {\n const start = getStartOfDay(item.startDate);\n const end = item.endDate ? getStartOfDay(item.endDate) : start;\n // Check overlap\n return (\n isBeforeDate(start, addDays(weekEnd, 1)) &&\n isAfterDate(end, subDays(weekStart, 1))\n );\n });\n\n // -------------------------------------------------------------------------\n // 3. Event Sorting: Start Date asc, then Duration desc\n //\n // Sorting is crucial for the slot assignment algorithm (\"Tetris\" algorithm) to work efficiently.\n // By placing earlier events first, we fill the timeline from left to right.\n // By placing longer events first (among those starting on the same day), we ensure\n // that long-spanning events get stable top slots, reducing visual fragmentation.\n // -------------------------------------------------------------------------\n weekEvents.sort((a, b) => {\n const startA = getStartOfDay(a.startDate);\n const startB = getStartOfDay(b.startDate);\n // Primary sort: Start date (ascending)\n if (!isSameDate(startA, startB)) return getDiffDays(startA, startB);\n\n // Secondary sort: Duration (descending)\n const endA = a.endDate ? getStartOfDay(a.endDate) : startA;\n const endB = b.endDate ? getStartOfDay(b.endDate) : startB;\n const durA = getDiffDays(endA, startA);\n const durB = getDiffDays(endB, startB);\n return durB - durA; // Longer events first\n });\n\n // -------------------------------------------------------------------------\n // 4. Slot Assignment: \"Tetris\" Algorithm\n //\n // The goal here is to assign a vertical \"slot\" index (0, 1, 2...) to each event\n // so that no two overlapping events share the same slot.\n //\n // We maintain a 2D array `slots[dayIndex][slotIndex]` to track usage.\n // dayIndex: 0..6 (Mon-Sun)\n // slotIndex: 0..N (Vertical position)\n //\n // For each event:\n // 1. Determine its start/end range within this week (clipped to 0..6).\n // 2. Find the lowest `slotIndex` where `slots[day][slotIndex]` is empty for all days in the range.\n // 3. Mark that slot as used for those days.\n // -------------------------------------------------------------------------\n const slots: string[][] = Array(7)\n .fill(null)\n .map(() => []); // slots[dayIndex][slotIndex] = eventId\n const eventSlots = new Map<string, number>(); // Map<eventId, slotIndex> for quick lookup later\n\n weekEvents.forEach((event, index) => {\n // Determine start/end indices in this week (0..6)\n // We clip the event's start/end to the current week's boundaries because\n // we are only rendering one week at a time in this loop.\n const start = getStartOfDay(event.startDate);\n const end = event.endDate ? getStartOfDay(event.endDate) : start;\n\n let startIndex = getDiffDays(start, weekStart);\n let endIndex = getDiffDays(end, weekStart);\n\n // Clip to week boundaries\n if (startIndex < 0) startIndex = 0;\n if (endIndex > 6) endIndex = 6;\n\n // Find first available slot\n let slotIndex = 0;\n while (true) {\n let isAvailable = true;\n // Check if this slotIndex is free for the entire duration of the event (within this week)\n for (let i = startIndex; i <= endIndex; i++) {\n if (slots[i][slotIndex]) {\n isAvailable = false;\n break;\n }\n }\n if (isAvailable) break; // Found a spot!\n slotIndex++; // Try the next slot down\n }\n\n // Assign the found slot\n // We create a unique temporary ID because the raw event data might not have one,\n // or we might be processing split segments of the same logical event.\n const eventId = event.startDate + event.value + index;\n eventSlots.set(eventId, slotIndex);\n\n // Mark the slots as occupied\n for (let i = startIndex; i <= endIndex; i++) {\n slots[i][slotIndex] = eventId;\n }\n\n // Store the ID on the event object temporarily for step 5\n event._tempId = eventId;\n });\n\n // -------------------------------------------------------------------------\n // 5. Content Generation: Generate final display data for each day\n // Map the calculated slots back to individual day cells.\n // -------------------------------------------------------------------------\n return processedWeek.map((dayObj, dayIndex) => {\n const { currentDate, isCurrentMonth, displayDay } = dayObj;\n\n // Find events active on this day\n const activeEvents = weekEvents.filter((event) => {\n const start = getStartOfDay(event.startDate);\n const end = event.endDate ? getStartOfDay(event.endDate) : start;\n return (\n !isBeforeDate(currentDate, start) && !isAfterDate(currentDate, end)\n );\n });\n\n const displayData: (DataTypeList | null)[] = [];\n\n let maxDaySlot = -1;\n activeEvents.forEach((e) => {\n const s = eventSlots.get(e._tempId!);\n if (s !== undefined && s > maxDaySlot) maxDaySlot = s;\n });\n\n for (let s = 0; s <= maxDaySlot; s++) {\n const event = activeEvents.find(\n (e) => eventSlots.get(e._tempId!) === s,\n );\n if (event) {\n const itemStartDate = getStartOfDay(event.startDate);\n const isStart = isSameDate(itemStartDate, currentDate);\n const isWeekStart = dayIndex === 0;\n\n // If the event starts today (or earlier but this is the start of the week),\n // we render the \"segment\" of the event.\n if (isStart || isWeekStart) {\n // Ensure the visual end date doesn't exceed the end of the current week.\n // This is crucial for rendering the correct width for the event bar using CSS/col-span.\n const itemEndDate = event.endDate\n ? getStartOfDay(event.endDate)\n : getStartOfDay(event.startDate);\n const endOfWeekDate = addDays(currentDate, 6 - dayIndex);\n\n let effectiveEndDate = itemEndDate;\n if (isAfterDate(itemEndDate, endOfWeekDate)) {\n effectiveEndDate = endOfWeekDate;\n }\n\n displayData.push({\n ...event,\n startDateWeek: formatDate(currentDate, \"YYYY-MM-DD\"),\n endDateWeek: formatDate(effectiveEndDate, \"YYYY-MM-DD\"),\n isSpacer: false,\n });\n } else {\n // Spacer: The event exists on this day but was started in a previous cell in this row.\n // We insert a spacer so that subsequent events in this column get pushed down to their correct slots.\n displayData.push({ ...event, isSpacer: true });\n }\n } else {\n // Empty slot: No event assigned to this vertical index.\n displayData.push(null);\n }\n }\n\n return {\n currentDate,\n isCurrentMonth,\n displayDay,\n events: displayData,\n totalEvents: activeEvents.length,\n isToday: checkIsToday(selectedDate, displayDay) && isCurrentMonth,\n };\n });\n });\n}\n","import { CALENDAR_CONSTANTS } from \"../constants\";\n\n/**\n * Calculates the maximum number of events that can be displayed in a cell based on the calendar height.\n *\n * @param height - The total height of the calendar\n * @returns The maximum number of events to display\n */\nexport function calculateMaxEvents(height: number, rowsInView: number): number {\n const { DATE_LABEL_HEIGHT, CELL_PADDING, EVENT_HEIGHT } = CALENDAR_CONSTANTS;\n\n const cellHeight = height / rowsInView;\n const availableHeight = cellHeight - DATE_LABEL_HEIGHT - CELL_PADDING;\n const calculatedMax = Math.round(availableHeight / EVENT_HEIGHT) - 1; // -1 for \"more\" button\n\n return Math.max(0, calculatedMax);\n}\n","import { useEffect, useState, RefObject } from \"react\";\n\n/**\n * Hook to observe the size of an element.\n * @param ref React ref object of the element to observe\n * @returns The width and height of the element\n */\nexport function useResizeObserver(ref: RefObject<HTMLElement | null>) {\n const [size, setSize] = useState({ width: 0, height: 0 });\n\n useEffect(() => {\n const element = ref.current;\n if (!element) return;\n\n const resizeObserver = new ResizeObserver((entries) => {\n if (!Array.isArray(entries) || !entries.length) return;\n\n const entry = entries[0];\n const { width, height } = entry.contentRect;\n\n setSize({ width, height });\n });\n\n resizeObserver.observe(element);\n\n return () => {\n resizeObserver.disconnect();\n };\n }, [ref]);\n\n return size;\n}\n",".calendarContainer {\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.calendar {\n width: 100%;\n height: 100%;\n /* Default values, overridden by inline styles */\n --calendar-width: 0px;\n --calendar-height: 0px;\n\n /* Theme variables */\n --primary-color: #3b82f6;\n --primary-hover: #2563eb;\n --text-primary: #1f2937;\n --text-secondary: #6b7280;\n --bg-color: #ffffff;\n --bg-hover: #f3f4f6;\n --border-color: #e5e7eb;\n --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n --shadow-md:\n 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);\n --radius-md: 0.375rem;\n --radius-lg: 0.5rem;\n\n font-family:\n ui-sans-serif,\n system-ui,\n -apple-system,\n BlinkMacSystemFont,\n \"Segoe UI\",\n Roboto,\n \"Helvetica Neue\",\n Arial,\n sans-serif;\n color: var(--text-primary);\n background-color: var(--bg-color);\n border: 1px solid var(--border-color);\n border-radius: var(--radius-lg);\n box-shadow: var(--shadow-md);\n box-sizing: border-box;\n overflow: hidden;\n overflow-y: auto;\n\n & * {\n padding: 0;\n margin: 0;\n box-sizing: border-box;\n }\n}\n\n.table {\n border-collapse: separate;\n border-spacing: 0;\n}\n\n.tableHeader,\n.tableCell {\n border-right: 1px solid var(--border-color);\n border-bottom: 1px solid var(--border-color);\n}\n\n.tableHeader:last-child,\n.tableCell:last-child {\n border-right: none;\n}\n\n.table tr:last-child .tableCell {\n border-bottom: none;\n}\n\n.tableHeader {\n height: 40px;\n background-color: #f9fafb;\n color: var(--text-secondary);\n font-weight: 600;\n font-size: 0.875rem;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n text-align: center;\n vertical-align: middle;\n}\n\n.tableBody {\n height: var(--calendar-height);\n}\n",".dateData {\n cursor: pointer;\n position: relative;\n transition: background-color 0.15s ease;\n vertical-align: top;\n height: calc(\n var(--calendar-height) / var(--calendar-rows, 6)\n ); /* Approx 6 rows usually */\n min-width: calc(var(--calendar-width) / 7);\n max-width: calc(var(--calendar-width) / 7);\n padding: 0.25rem;\n}\n\n.dateData:hover {\n background-color: #fafafa;\n}\n\n.currentMonth {\n color: #9ca3af; /* muted text */\n background-color: #f9fafb;\n}\n\n.cellContent {\n height: 100%;\n width: 100%;\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n gap: 0.25rem;\n}\n\n.dateLabel {\n font-size: 0.875rem;\n font-weight: 500;\n padding: 0.25rem;\n border-radius: 50%;\n width: 1.75rem;\n height: 1.75rem;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-bottom: 0.25rem;\n color: var(--text-primary);\n}\n\n.selected .dateLabel {\n background-color: var(--primary-color);\n color: white;\n}\n\n.today .dateLabel {\n background-color: var(--primary-color);\n color: white;\n}\n\n.dataContainer {\n display: flex;\n flex-direction: column;\n gap: 2px;\n overflow: visible;\n flex: 1;\n}\n\n.spacer {\n height: 1.5rem; /* Match eventItem height */\n margin-bottom: 2px;\n}\n\n.eventItem {\n background-color: var(--primary-color);\n border-radius: 4px; /* Slightly rounded */\n z-index: 2;\n position: relative;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: 0.75rem;\n padding: 0.15rem 0.5rem;\n color: white;\n font-weight: 500;\n height: 1.5rem;\n line-height: 1.2rem;\n box-sizing: border-box;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n transition:\n transform 0.1s ease,\n box-shadow 0.1s ease;\n cursor: pointer;\n}\n\n.eventItem:hover {\n transform: translateY(-1px);\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);\n filter: brightness(1.05);\n}\n\n.moreEventsContainer {\n position: relative;\n margin-top: 2px;\n}\n\n.moreEvents {\n font-size: 0.75rem;\n font-weight: 600;\n color: var(--text-secondary);\n cursor: pointer;\n padding: 0.15rem 0.5rem;\n background: transparent;\n border: none;\n width: 100%;\n text-align: left;\n border-radius: 4px;\n transition: background-color 0.2s;\n}\n\n.moreEvents:hover {\n background-color: var(--bg-hover);\n color: var(--text-primary);\n}\n",".popover {\n position: fixed;\n top: calc(100% + 4px);\n left: 0;\n z-index: 100;\n background-color: white;\n border: 1px solid var(--border-color);\n border-radius: var(--radius-lg);\n box-shadow: var(--shadow-md);\n padding: 0.5rem;\n /* min-width: 180px; - allow it to be wider if needed, or keep? Keeping for now */\n min-width: 200px;\n max-width: 300px;\n max-height: 300px; /* Increased from 240px */\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n gap: 2px;\n opacity: 0;\n animation: fadeIn 0.2s ease forwards;\n}\n\n@keyframes fadeIn {\n from {\n opacity: 0;\n transform: translateY(-4px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n\n.popoverHeader {\n font-size: 0.75rem;\n font-weight: 600;\n margin-bottom: 0.5rem;\n color: var(--text-secondary);\n text-transform: uppercase;\n letter-spacing: 0.05em;\n padding-bottom: 0.25rem;\n border-bottom: 1px solid var(--border-color);\n}\n\n.popoverContent {\n overflow-y: auto;\n}\n\n.popoverItem {\n padding: 0.25rem 0.5rem;\n background-color: var(--primary-color);\n color: white;\n border-radius: var(--radius-md);\n font-size: 0.75rem;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: pointer;\n margin-bottom: 2px;\n transition: opacity 0.2s ease;\n flex-shrink: 0; /* Prevent shrinking */\n}\n\n.popoverItem:hover {\n opacity: 0.9;\n}\n\n.popoverItem.startBefore {\n clip-path: polygon(10px 0, 100% 0, 100% 100%, 10px 100%, 0 50%);\n padding-left: 14px;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.popoverItem.endAfter {\n clip-path: polygon(\n 0 0,\n calc(100% - 10px) 0,\n 100% 50%,\n calc(100% - 10px) 100%,\n 0 100%\n );\n padding-right: 14px;\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n\n.popoverItem.startBefore.endAfter {\n clip-path: polygon(\n 10px 0,\n calc(100% - 10px) 0,\n 100% 50%,\n calc(100% - 10px) 100%,\n 10px 100%,\n 0 50%\n );\n padding-left: 14px;\n padding-right: 14px;\n border-radius: 0;\n}\n","import React, {\n useRef,\n useEffect,\n useLayoutEffect,\n useState,\n CSSProperties,\n} from \"react\";\nimport cx from \"classnames\";\nimport styles from \"./Popover.module.css\";\nimport {\n DateType,\n formatDate,\n getStartOfDay,\n isBeforeDate,\n isAfterDate,\n} from \"../utils\";\nimport { CalendarType, DataTypeList, DateDataType } from \"../types\";\n\ninterface PopoverProps {\n dateObj: DateType;\n events: DataTypeList[];\n onEventClick?: CalendarType[\"onEventClick\"];\n onClose: () => void;\n anchorEl: HTMLElement | null;\n}\n\nfunction Popover({\n dateObj,\n events,\n onEventClick,\n onClose,\n anchorEl,\n}: PopoverProps) {\n const popoverRef = useRef<HTMLDivElement>(null);\n const [stylePosition, setStylePosition] = useState<CSSProperties>({\n visibility: \"hidden\",\n });\n\n useLayoutEffect(() => {\n if (popoverRef.current && anchorEl) {\n const popoverRect = popoverRef.current.getBoundingClientRect();\n const anchorRect = anchorEl.getBoundingClientRect();\n const PADDING = 10;\n\n // Base position: bottom-left of the anchor\n let top = anchorRect.bottom + 4; // 4px gap\n let left = anchorRect.left;\n\n // Available space in viewport\n const viewportHeight = window.innerHeight;\n const viewportWidth = window.innerWidth;\n\n const spaceBelow = viewportHeight - top;\n const spaceAbove = anchorRect.top - PADDING;\n\n let newStyle: CSSProperties = {\n visibility: \"visible\",\n position: \"fixed\",\n top: `${top}px`,\n left: `${left}px`,\n width: \"220px\", // Fixed width to prevent resizing\n };\n\n // Horizontal Check (Viewport)\n if (left + popoverRect.width > viewportWidth - PADDING) {\n // Align to right edge of viewport if it overflows\n left = viewportWidth - popoverRect.width - PADDING;\n newStyle.left = `${left}px`;\n }\n\n // Vertical Check (Viewport)\n if (top + popoverRect.height > viewportHeight - PADDING) {\n const height = popoverRect.height;\n\n // Flip to top if not enough space below but enough above\n if (spaceBelow < height && spaceAbove > spaceBelow) {\n const maxHeight = Math.min(height, spaceAbove);\n newStyle.top = \"auto\";\n newStyle.bottom = `${viewportHeight - anchorRect.top + 4}px`;\n newStyle.maxHeight = `${maxHeight}px`;\n } else {\n // Cap height at bottom\n const maxHeight = Math.min(height, spaceBelow - PADDING);\n newStyle.maxHeight = `${maxHeight}px`;\n }\n }\n\n setStylePosition(newStyle);\n }\n }, [anchorEl]);\n\n useEffect(() => {\n function handleClickOutside(event: MouseEvent) {\n if (\n popoverRef.current &&\n !popoverRef.current.contains(event.target as Node)\n ) {\n onClose();\n }\n }\n\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n };\n }, [onClose]);\n\n return (\n <div\n className={styles.popover}\n ref={popoverRef}\n style={stylePosition}\n onClick={(e) => e.stopPropagation()}\n >\n <div className={styles.popoverHeader}>\n {formatDate(dateObj, \"ddd, D MMM\")}\n </div>\n <div className={styles.popoverContent}>\n {events.map((item, idx) => {\n const dayStart = getStartOfDay(dateObj);\n const eventStart = getStartOfDay(item.startDate);\n const eventEnd = item.endDate\n ? getStartOfDay(item.endDate)\n : eventStart;\n\n const isStartBefore = isBeforeDate(eventStart, dayStart);\n const isEndAfter = isAfterDate(eventEnd, dayStart);\n\n return (\n <div\n key={`pop-${idx}`}\n className={cx(styles.popoverItem, {\n [styles.startBefore]: isStartBefore,\n [styles.endAfter]: isEndAfter,\n })}\n style={{ backgroundColor: item.color }}\n onClick={(e) => {\n e.stopPropagation();\n onEventClick?.(item);\n onClose();\n }}\n title={item.value}\n >\n {item.value}\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n\nexport default Popover;\n","import React, { useState, useRef } from \"react\";\nimport cx from \"classnames\";\nimport { DataTypeList, DateDataType } from \"../types\";\nimport { formatDate, getDiffDays } from \"../utils\";\nimport styles from \"./EventItem.module.css\";\nimport Popover from \"./Popover\";\nimport { CALENDAR_CONSTANTS, defaultTheme } from \"../constants\";\n\nfunction EventItem({\n date,\n dateObj,\n data,\n cellWidth,\n className,\n dataClassName,\n isSelected,\n isToday,\n onClick,\n selectedClassName,\n todayClassName,\n isCurrentMonth,\n theme,\n maxEvents,\n onMoreClick,\n onEventClick,\n totalEvents = 0,\n}: DateDataType) {\n const [showPopover, setShowPopover] = useState(false);\n const moreButtonRef = useRef<HTMLButtonElement>(null);\n\n const styleSource = isSelected\n ? { ...defaultTheme.selected, ...theme?.selected }\n : isToday\n ? { ...defaultTheme.today, ...theme?.today }\n : { ...defaultTheme.default, ...theme?.default };\n\n const style = {\n color: styleSource?.color,\n backgroundColor: styleSource?.bgColor,\n };\n\n // Determine which items to display\n let visibleEvents = data;\n let hiddenEventsCount = 0;\n\n if (\n (maxEvents || maxEvents === 0) &&\n data &&\n (totalEvents >= maxEvents || data.length > maxEvents)\n ) {\n visibleEvents = data.slice(0, maxEvents);\n\n const visibleRealEventsCount = visibleEvents.filter(\n (e) => e !== null,\n ).length;\n hiddenEventsCount = totalEvents - visibleRealEventsCount;\n }\n\n const allDayEvents: DataTypeList[] =\n data?.filter((e): e is DataTypeList => e !== null) || [];\n\n return (\n <td\n style={style}\n onClick={() => onClick?.(dateObj)}\n className={cx(styles.dateData, className, {\n [styles.currentMonth]: !isCurrentMonth,\n [cx(styles.selected, selectedClassName)]: isSelected,\n [cx(styles.today, todayClassName)]: isToday,\n })}\n >\n <div className={styles.cellContent}>\n <p className={styles.dateLabel}>{date}</p>\n\n {data && (\n <div className={cx(styles.dataContainer, dataClassName)}>\n {visibleEvents.map((item, index) => {\n if (!item || item.isSpacer) {\n return (\n <div key={`spacer-${index}`} className={styles.spacer} />\n );\n }\n\n let diffDates = 1;\n let tooltipText = formatDate(item.startDate, \"YYYY-MM-DD\");\n if (item.endDateWeek) {\n diffDates =\n getDiffDays(item.endDateWeek, item.startDateWeek) + 1;\n }\n if (item.endDate) {\n tooltipText += ` to ${formatDate(item.endDate, \"YYYY-MM-DD\")}`;\n }\n tooltipText += ` - ${item.value}`;\n const width = `${cellWidth * diffDates - CALENDAR_CONSTANTS.EVENT_ITEM_PADDING}px`;\n\n return (\n <div\n key={`${item.startDate}-${index}`}\n className={styles.eventItem}\n style={{ width, backgroundColor: item.color }}\n title={tooltipText}\n onClick={(e) => {\n e.stopPropagation();\n onEventClick?.(item);\n }}\n >\n {item.value}\n </div>\n );\n })}\n {hiddenEventsCount > 0 && (\n <div className={styles.moreEventsContainer}>\n <button\n ref={moreButtonRef}\n className={styles.moreEvents}\n onClick={(e) => {\n e.stopPropagation();\n !showPopover && setShowPopover(true);\n onMoreClick?.(dateObj);\n }}\n >\n + {hiddenEventsCount} more\n </button>\n {showPopover && (\n <Popover\n dateObj={dateObj}\n events={allDayEvents}\n onEventClick={onEventClick}\n onClose={() => setShowPopover(false)}\n anchorEl={moreButtonRef.current}\n />\n )}\n </div>\n )}\n </div>\n )}\n </div>\n </td>\n );\n}\n\nexport default EventItem;\n",".header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 1rem;\n background-color: transparent;\n width: 100%;\n box-sizing: border-box;\n}\n\n.navigation {\n display: flex;\n align-items: center;\n gap: 1rem;\n}\n\n.todayButton {\n background-color: transparent;\n border: 1px solid var(--border-color);\n border-radius: var(--radius-md);\n color: var(--text-primary);\n cursor: pointer;\n font-family: inherit;\n font-size: 0.875rem;\n font-weight: 500;\n padding: 0.5rem 1rem;\n transition: all 0.2s ease;\n}\n\n.todayButton:hover {\n background-color: var(--bg-hover);\n border-color: var(--text-secondary);\n}\n\n.arrows {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n}\n\n.iconButton {\n background: transparent;\n border: 1px solid transparent;\n border-radius: var(--radius-md);\n color: var(--text-secondary);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 2rem;\n width: 2rem;\n outline: none;\n transition: all 0.2s ease;\n}\n\n.iconButton:hover {\n background-color: var(--bg-hover);\n color: var(--text-primary);\n}\n\n.dateTitle {\n color: var(--text-primary);\n font-family: inherit;\n font-size: 1.25rem;\n font-weight: 600;\n margin: 0;\n white-space: nowrap;\n}\n\n.controls {\n display: flex;\n align-items: center;\n gap: 0.75rem;\n}\n\n.select {\n appearance: none;\n background-color: var(--bg-color);\n background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E\");\n background-position: right 0.5rem center;\n background-repeat: no-repeat;\n background-size: 1.5em 1.5em;\n border: 1px solid var(--border-color);\n border-radius: var(--radius-md);\n color: var(--text-primary);\n cursor: pointer;\n font-family: inherit;\n font-size: 0.875rem;\n padding: 0.5rem 2.5rem 0.5rem 1rem;\n transition: border-color 0.2s ease;\n outline: none;\n}\n\n.select:hover {\n border-color: var(--text-secondary);\n}\n\n.select:focus {\n border-color: var(--primary-color);\n box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);\n}\n","import React from \"react\";\n\nfunction LeftArrow() {\n return (\n <svg\n width=\"40px\"\n height=\"40px\"\n viewBox=\"0 0 24.00 24.00\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n stroke=\"currentColor\"\n transform=\"rotate(180)\"\n >\n <g id=\"SVGRepo_bgCarrier\" strokeWidth=\"0\" />\n <g\n id=\"SVGRepo_tracerCarrier\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <g id=\"SVGRepo_iconCarrier\">\n <path\n d=\"M10 7L15 12L10 17\"\n stroke=\"currentColor\"\n strokeWidth=\"1.2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </g>\n </svg>\n );\n}\n\nexport default LeftArrow;\n","import React from \"react\";\n\nfunction RightArrow() {\n return (\n <svg\n width=\"40px\"\n height=\"40px\"\n viewBox=\"0 0 24.00 24.00\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n stroke=\"currentColor\"\n >\n <g id=\"SVGRepo_bgCarrier\" strokeWidth=\"0\" />\n <g\n id=\"SVGRepo_tracerCarrier\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <g id=\"SVGRepo_iconCarrier\">\n <path\n d=\"M10 7L15 12L10 17\"\n stroke=\"currentColor\"\n strokeWidth=\"1.2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </g>\n </svg>\n );\n}\n\nexport default RightArrow;\n","import React, {\n createContext,\n useContext,\n useReducer,\n ReactNode,\n useMemo,\n} from \"react\";\nimport { dateFn, DateType } from \"../utils\";\nimport { DataType, CalendarView } from \"../types\";\n\ninterface CalendarState {\n currentDate: DateType;\n selectedDate: DateType;\n view: CalendarView;\n events: DataType[];\n}\n\ntype CalendarAction =\n | { type: \"SET_DATE\"; payload: DateType }\n | { type: \"SET_VIEW\"; payload: CalendarView }\n | { type: \"SET_EVENTS\"; payload: DataType[] }\n | { type: \"NEXT\" }\n | { type: \"PREV\" }\n | { type: \"TODAY\" };\n\nconst initialState: CalendarState = {\n currentDate: dateFn(),\n selectedDate: dateFn(),\n view: \"month\",\n events: [],\n};\n\nconst CalendarContext = createContext<\n | {\n state: CalendarState;\n dispatch: React.Dispatch<CalendarAction>;\n }\n | undefined\n>(undefined);\n\nfunction calendarReducer(\n state: CalendarState,\n action: CalendarAction,\n): CalendarState {\n switch (action.type) {\n case \"SET_DATE\":\n return {\n ...state,\n currentDate: action.payload,\n selectedDate: action.payload,\n };\n case \"SET_VIEW\":\n return { ...state, view: action.payload };\n case \"SET_EVENTS\":\n return { ...state, events: action.payload };\n case \"NEXT\": {\n let nextDate = state.currentDate;\n if (state.view === \"month\") nextDate = nextDate.add(1, \"month\");\n else if (state.view === \"week\") nextDate = nextDate.add(1, \"week\");\n else if (state.view === \"day\") nextDate = nextDate.add(1, \"day\");\n return { ...state, currentDate: nextDate };\n }\n case \"PREV\": {\n let prevDate = state.currentDate;\n if (state.view === \"month\") prevDate = prevDate.subtract(1, \"month\");\n else if (state.view === \"week\") prevDate = prevDate.subtract(1, \"week\");\n else if (state.view === \"day\") prevDate = prevDate.subtract(1, \"day\");\n return { ...state, currentDate: prevDate };\n }\n case \"TODAY\":\n return {\n ...state,\n currentDate: dateFn(),\n selectedDate: dateFn(),\n };\n default:\n return state;\n }\n}\n\ninterface CalendarProviderProps {\n children: ReactNode;\n initialEvents?: DataType[];\n initialDate?: DateType;\n}\n\nexport function CalendarProvider({\n children,\n initialEvents = [],\n initialDate,\n}: CalendarProviderProps) {\n const [state, dispatch] = useReducer(calendarReducer, {\n ...initialState,\n events: initialEvents,\n currentDate: initialDate || initialState.currentDate,\n selectedDate: initialDate || initialState.selectedDate,\n });\n\n const value = useMemo(() => ({ state, dispatch }), [state]);\n\n return (\n <CalendarContext.Provider value={value}>\n {children}\n </CalendarContext.Provider>\n );\n}\n\nexport const useCalendar = () => {\n const context = useContext(CalendarContext);\n if (context === undefined) {\n throw new Error(\"useCalendar must be used within a CalendarProvider\");\n }\n return context;\n};\n","import React, { ChangeEvent } from \"react\";\nimport cx from \"classnames\";\nimport {\n CalendarType,\n EMonthOption,\n EYearOption,\n MonthListType,\n} from \"../types\";\nimport { CALENDER_STRINGS, MONTH_LIST } from \"../constants\";\nimport {\n dateFn,\n getYearList,\n convertToDate,\n addMonths,\n subMonths,\n setMonth,\n setYear,\n formatDate,\n getMonth,\n getYear,\n} from \"../utils\";\nimport styles from \"./Header.module.css\";\nimport LeftArrow from \"../assets/LeftArrow\";\nimport RightArrow from \"../assets/RightArrow\";\nimport { useCalendar } from \"../context/CalendarContext\";\n\ninterface HeaderProps extends Pick<\n CalendarType,\n \"headerClassName\" | \"pastYearLength\" | \"futureYearLength\" | \"onMonthChange\"\n> {}\n\nfunction Header({\n headerClassName,\n pastYearLength = 5,\n futureYearLength = 5,\n onMonthChange,\n}: HeaderProps) {\n const { state, dispatch } = useCalendar();\n const { currentDate } = state;\n\n const onMonthArrowClick = (option: EMonthOption) => {\n if (option === EMonthOption.add) {\n dispatch({ type: \"NEXT\" });\n const nextDate = addMonths(currentDate, 1); // predictive for callback\n onMonthChange?.(convertToDate(nextDate));\n } else if (option === EMonthOption.sub) {\n dispatch({ type: \"PREV\" });\n const prevDate = subMonths(currentDate, 1); // predictive for callback\n onMonthChange?.(convertToDate(prevDate));\n }\n };\n\n const onDropdownClick = (\n event: ChangeEvent<HTMLSelectElement>,\n option: EYearOption,\n ) => {\n const value = Number(event.target.value);\n let newDate = currentDate;\n\n if (option === EYearOption.month) {\n newDate = setMonth(currentDate, value);\n } else if (option === EYearOption.year) {\n newDate = setYear(currentDate, value);\n }\n\n dispatch({ type: \"SET_DATE\", payload: newDate });\n onMonthChange?.(convertToDate(newDate));\n };\n\n return (\n <div className={cx(styles.header, headerClassName)}>\n <div className={styles.navigation}>\n <button\n className={styles.todayButton}\n onClick={() => {\n dispatch({ type: \"TODAY\" });\n onMonthChange?.(convertToDate(dateFn()));\n }}\n >\n Today\n </button>\n <div className={styles.arrows}>\n <button\n className={styles.iconButton}\n onClick={() => onMonthArrowClick(EMonthOption.sub)}\n >\n <LeftArrow />\n </button>\n <button\n className={styles.iconButton}\n onClick={() => onMonthArrowClick(EMonthOption.add)}\n >\n <RightArrow />\n </button>\n </div>\n <h2 className={styles.dateTitle}>\n {formatDate(currentDate, \"MMMM YYYY\")}\n </h2>\n </div>\n\n <div className={styles.controls}>\n <select\n className={styles.select}\n id={CALENDER_STRINGS.MONTH}\n name={CALENDER_STRINGS.MONTH}\n value={getMonth(currentDate)}\n onChange={(e) => onDropdownClick(e, EYearOption.month)}\n >\n {MONTH_LIST.map((month: MonthListType) => (\n <option key={month.label} value={month.value}>\n {month.label}\n </option>\n ))}\n </select>\n <select\n className={styles.select}\n id={CALENDER_STRINGS.YEAR}\n name={CALENDER_STRINGS.YEAR}\n value={getYear(currentDate)}\n onChange={(e) => onDropdownClick(e, EYearOption.year)}\n >\n {getYearList(\n pastYearLength,\n futureYearLength,\n getYear(currentDate),\n ).map((year: number) => (\n <option key={year} value={year}>\n {year}\n </option>\n ))}\n </select>\n </div>\n </div>\n );\n}\n\nexport default Header;\n","import React, { useCallback, useMemo, memo, useEffect } from \"react\";\nimport cx from \"classnames\";\nimport { CalendarType, CalendarContentType } from \"./types\";\nimport {\n DAY_LIST_NAME,\n defaultCalenderProps,\n CALENDAR_CONSTANTS,\n} from \"./constants\";\nimport {\n dateFn,\n convertToDate,\n DateType,\n generateCalendarGrid,\n calculateMaxEvents,\n useResizeObserver,\n} from \"./utils\";\nimport styles from \"./Calendar.module.css\";\nimport EventItem from \"./common/EventItem\";\nimport Header from \"./layout/Header\";\nimport { CalendarProvider, useCalendar } from \"./context/CalendarContext\";\n\nfunction CalendarContent({\n dayType,\n width,\n height,\n onDateClick,\n onEventClick,\n onMoreClick,\n isSelectDate,\n data: propsData, // Capture props data to sync\n ...restProps\n}: CalendarContentType) {\n const { state, dispatch } = useCalendar();\n const { currentDate: selectedDate, events: data } = state;\n\n // Sync data from props to context\n useEffect(() => {\n if (propsData) {\n dispatch({ type: \"SET_EVENTS\", payload: propsData });\n }\n }, [propsData]);\n\n const calendarGrid = useMemo(\n () => generateCalendarGrid(selectedDate, data),\n [selectedDate, data],\n );\n\n const maxEvents = useMemo(\n () =>\n restProps.maxEvents ??\n calculateMaxEvents(\n height,\n calendarGrid.length || CALENDAR_CONSTANTS.MIN_ROWS,\n ),\n [restProps.maxEvents, height, calendarGrid.length],\n );\n\n const onClickDateHandler = useCallback(\n (dateInput: DateType) => {\n const newDate = dateFn(dateInput);\n onDateClick?.(convertToDate(newDate));\n if (isSelectDate && !newDate.isSame(selectedDate, \"day\")) {\n dispatch({ type: \"SET_DATE\", payload: newDate });\n }\n },\n [selectedDate, onDateClick],\n );\n\n return (\n <section\n style={\n {\n \"--calendar-width\": `${width}px`,\n \"--calendar-height\": `${height}px`,\n \"--calendar-rows\":\n calendarGrid.length || CALENDAR_CONSTANTS.DEFAULT_ROWS,\n } as React.CSSProperties\n }\n className={cx(styles.calendar, restProps.className)}\n >\n <Header\n headerClassName={restProps.headerClassName}\n onMonthChange={restProps.onMonthChange}\n pastYearLength={restProps.pastYearLength}\n futureYearLength={restProps.futureYearLength}\n />\n <table className={cx(styles.table, restProps.tableClassName)}>\n <thead>\n <tr>\n {DAY_LIST_NAME[dayType].map((day: string) => (\n <th key={day} className={styles.tableHeader}>\n {day}\n </th>\n ))}\n </tr>\n </thead>\n <tbody className={styles.tableBody}>\n {calendarGrid.map((week, weekIndex) => (\n <tr key={weekIndex}>\n {week.map((dayInfo, dayIndex) => (\n <EventItem\n key={`date_${weekIndex}_${dayIndex}`}\n isSelected={\n isSelectDate &&\n dayInfo.isCurrentMonth &&\n dayInfo.displayDay === selectedDate.date()\n }\n isToday={dayInfo.isToday}\n isCurrentMonth={dayInfo.isCurrentMonth}\n onClick={onClickDateHandler}\n date={dayInfo.displayDay}\n dateObj={dayInfo.currentDate}\n data={dayInfo.events}\n cellWidth={width / CALENDAR_CONSTANTS.DAYS_IN_WEEK}\n className={cx(styles.tableCell, restProps.tableDateClassName)}\n dataClassName={restProps.dataClassName}\n selectedClassName={restProps.selectedClassName}\n todayClassName={restProps.todayClassName}\n theme={restProps.theme}\n maxEvents={maxEvents}\n totalEvents={dayInfo.totalEvents}\n onEventClick={onEventClick}\n onMoreClick={(d) => onMoreClick?.(convertToDate(d))}\n />\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n </section>\n );\n}\n\nfunction Calendar(props: CalendarType = defaultCalenderProps) {\n const containerRef = React.useRef<HTMLDivElement>(null);\n const { width: observedWidth, height: observedHeight } =\n useResizeObserver(containerRef);\n\n const allProps = { ...defaultCalenderProps, ...props };\n const { data, selectedDate } = allProps;\n\n // Use props if provided, otherwise use observed size\n const width = props.width ?? observedWidth ?? 0;\n const mainHeight = props.height ?? observedHeight ?? 0;\n const height = mainHeight - CALENDAR_CONSTANTS.HEADER_HEIGHT;\n\n const initialDate = useMemo(\n () => (selectedDate ? dateFn(selectedDate) : undefined),\n [selectedDate],\n );\n\n return (\n <CalendarProvider initialEvents={data} initialDate={initialDate}>\n <div ref={containerRef} className={styles.calendarContainer}>\n <CalendarContent {...allProps} width={width} height={height} />\n </div>\n </CalendarProvider>\n );\n}\n\nexport default memo(Calendar);\n","import Calendar from \"./Calendar\";\nimport { EDayType } from \"./types\";\nimport type { CalendarType, DataType } from \"./types\";\nimport { DAY_TYPE } from \"./constants\";\n\nexport { EDayType, CalendarType, DataType, DAY_TYPE };\nexport default Calendar;\n"],"x_google_ignoreList":[0,3,5],"mappings":"2rBAOC,UAAY,CACZ,aAEA,IAAI,EAAS,CAAA,EAAG,eAEhB,SAAS,GAAc,CAGtB,QAFI,EAAU,GAEL,EAAI,EAAG,EAAI,UAAU,OAAQ,IAAK,CAC1C,IAAI,EAAM,UAAU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EAAM,OAAS,GAAiB,EAExC,GADa,EAAM,QAAU,GAAkB,GACzB,GAAmB,cAEzC,KAAA,EAAA,SAAA,IACG,EAAe,EAAO,CAAA,EAAgB,OAC7C,CAAC,CAAA,CAAa,EAGhB,OACE,EAAA,QAAA,cAAC,GAAA,CAAiB,cAAe,EAAmB,YAAA,GAClD,EAAA,QAAA,cAAC,MAAA,CAAI,IAAK,EAAc,UAAW,GAAO,mBACxC,EAAA,QAAA,cAAC,GAAA,CAAgB,GAAI,EAAiB,MAAA,EAAe,OAAA,GAAU,CAC3D,EAKZ,IAAA,MAAA,EAAA,MAAoB,EAAA,EC1JpB,GAAe"}
|
|
1
|
+
{"version":3,"file":"index.cjs.js","names":["s","calendar","offset","defaultZone","n","table","formatOffset","match","l","e","formatStr: string","colorNameMap: Record<string, string>","processedEvents: ProcessedEvent[]","clusters: ProcessedEvent[][]","currentCluster: ProcessedEvent[]","columns: ProcessedEvent[][]","colMap: Map<number, ProcessedEvent[]>","rows: BannerLayoutEvent[][]","layoutEvents: BannerLayoutEvent[]","layoutEvent: BannerLayoutEvent","offset","currentDate: DateType","weekEvents: InternalCalendarEvent[]","slots: string[][]","displayData: (EventListType | null)[]","newStyle: CSSProperties","allDayEvents: EventListType[]","hiddenEventsList: EventListType[]","groups: Record<string, CalendarEvent[]>","allProps: CalendarProps"],"sources":["../node_modules/classnames/index.js","../src/types/calendar.ts","../src/constants/theme.ts","../src/constants/calendar.ts","../node_modules/luxon/build/es6/luxon.mjs","../src/utils/date.ts","../src/utils/common.ts","../src/utils/formatting.ts","../src/utils/contrast.ts","../src/hooks/useResizeObserver.ts","../src/hooks/useEvents.ts","../src/hooks/useColorScheme.ts","../src/Calendar.module.css","../src/components/layout/Header.module.css","../src/assets/LeftArrow.tsx","../src/assets/RightArrow.tsx","../src/context/CalendarContext.tsx","../src/hooks/useCalendarProps.ts","../src/components/layout/Header.tsx","../src/hooks/useDayEventLayout.ts","../src/components/views/day_view/DayView.module.css","../src/components/core/time_column/TimeColumn.module.css","../src/components/core/time_column/TimeColumn.tsx","../src/components/core/day_event_item/DayWeekEventItem.module.css","../src/components/core/day_event_item/DayWeekEventItem.tsx","../src/components/core/current_time_line/CurrentTimeLine.module.css","../src/components/core/current_time_line/CurrentTimeLine.tsx","../src/components/core/day_column/DayColumn.module.css","../src/components/core/day_column/DayColumn.tsx","../src/hooks/useAllDayBanner.ts","../src/components/core/all_day_banner/AllDayBanner.module.css","../src/components/core/all_day_banner/AllDayBanner.tsx","../src/components/views/day_view/DayView.tsx","../src/components/views/week_view/WeekView.module.css","../src/components/views/week_view/WeekView.tsx","../node_modules/calendarize/dist/index.mjs","../src/hooks/useMonthGrid.ts","../src/components/core/month_event_item/MonthEventItem.module.css","../src/components/ui/popover/Popover.module.css","../src/components/ui/popover/Popover.tsx","../src/components/core/month_event_item/MonthEventItem.tsx","../src/components/views/month_view/MonthView.module.css","../src/components/views/month_view/MonthView.tsx","../src/components/views/schedule_view/ScheduleView.module.css","../src/hooks/useScheduleView.ts","../src/components/views/schedule_view/ScheduleView.tsx","../src/components/views/custom_days_view/CustomDaysView.module.css","../src/components/views/custom_days_view/CustomDaysView.tsx","../src/components/ui/skeleton/Skeleton.module.css","../src/components/ui/skeleton/MonthSkeleton.tsx","../src/components/ui/skeleton/TimeGridSkeleton.tsx","../src/components/ui/skeleton/ScheduleSkeleton.tsx","../src/components/views/View.module.css","../src/components/views/View.tsx","../src/components/ui/CalendarErrorBoundary.tsx","../src/Calendar.tsx","../src/index.ts"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue(arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(null, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","/**\n * @file Calendar component prop types, view enums, and render callback interfaces.\n */\nimport { ReactNode } from \"react\";\nimport { CalendarEvent } from \"./events\";\nimport { CalendarTheme, CalendarClassNames } from \"./theme\";\n\n/** Color palette modes accepted by `CalendarProps.colorScheme`. */\nexport type ColorScheme = \"light\" | \"dark\" | \"auto\";\n\n/**\n * Makes a specific subset of keys required while leaving the rest unchanged.\n * Used to enforce that `CalendarContentProps` always has defaults applied.\n */\nexport type RequiredSome<T, K extends keyof T> = Omit<T, K> &\n Required<Pick<T, K>>;\n\n/**\n * Available calendar view modes.\n * Use as values for the `view` prop or `onViewChange` callback.\n */\nexport const ECalendarViewType = {\n month: \"month\",\n week: \"week\",\n day: \"day\",\n schedule: \"schedule\",\n customDays: \"customDays\",\n} as const;\n\nexport type ECalendarViewType =\n (typeof ECalendarViewType)[keyof typeof ECalendarViewType];\n\n/**\n * Controls how much of the day is shown in the time grid.\n * `full` shows all 24 hours; `half` shows 12 hours (combined with `minHour`/`maxHour`).\n */\nexport const EDayType = {\n full: \"full\",\n half: \"half\",\n} as const;\n\nexport type EDayType = (typeof EDayType)[keyof typeof EDayType];\n\n/**\n * Props passed to the `renderHeader` custom renderer.\n * Provides the current navigation state and handlers to build a fully custom header.\n */\nexport interface RenderHeaderProps {\n /** The currently displayed date (first day of the visible period). */\n currentDate: Date;\n /** The active view mode. */\n view: ECalendarViewType;\n /** Call with a target date to programmatically navigate the calendar. */\n onNavigate: (date: Date) => void;\n /** Call to switch the active view. */\n onViewChange: (view: ECalendarViewType) => void;\n}\n\n/**\n * Props passed to the `renderDateCell` custom renderer in Month view.\n * Allows replacing the default date number with a fully custom cell.\n */\nexport interface RenderDateCellProps {\n /** The date this cell represents. */\n date: Date;\n /** Whether this cell is today's date. */\n isToday: boolean;\n /** Whether this cell is the currently selected date. */\n isSelected?: boolean;\n /** Whether this date belongs to the currently displayed month (false for adjacent-month cells). */\n isCurrentMonth?: boolean;\n}\n\n/**\n * Top-level props for the `<Calendar>` component.\n */\nexport interface CalendarProps {\n /** Child components rendered inside the calendar layout (e.g. custom header). */\n children?: ReactNode;\n\n // --- Data & State ---\n /** Events to display. Each must have at minimum `startDate` and `title`. */\n events?: CalendarEvent[];\n /** Initially selected date. Defaults to today if omitted. */\n selectedDate?: Date;\n /** Active view mode. Defaults to `month`. */\n view?: ECalendarViewType;\n /** `data-testid` attribute placed on the root element for testing. */\n testId?: string;\n\n // --- Loading State ---\n /**\n * When `true`, activates loading mode. Behaviour depends on whether events are present:\n * - **No events:** replaces the calendar body with a skeleton (or `renderLoading()` if provided).\n * - **Events present:** keeps the calendar visible but wraps it in a non-interactive overlay\n * so existing data stays on screen during a background refresh (DI-3).\n */\n isLoading?: boolean;\n /**\n * Custom loading indicator renderer. Called only when `isLoading=true` and no events are\n * present. Falls back to a built-in view-specific skeleton when omitted.\n */\n renderLoading?: () => ReactNode;\n\n // --- Configuration ---\n /** Use 12-hour clock format (AM/PM) in time grids. Defaults to `false`. */\n is12Hour?: boolean;\n /** Allow date cells to be clicked and selected. Defaults to `true`. */\n selectable?: boolean;\n /** Maximum number of events shown per day cell before a \"+N more\" overflow link appears. */\n maxEvents?: number;\n /** Controls time-grid range. `full` = all 24 h; `half` = respects `minHour`/`maxHour`. */\n dayType?: EDayType;\n /** Number of years before today available in the year picker. */\n pastYearLength?: number;\n /** Number of years after today available in the year picker. */\n futureYearLength?: number;\n /** Show a line indicating the current time in Week / Day views. */\n showCurrentTime?: boolean;\n /** Scroll the time grid to the current time on initial render. */\n autoScrollToCurrentTime?: boolean;\n /** Earliest hour shown in the time grid (0–23). */\n minHour?: number;\n /** Latest hour shown in the time grid (0–23). */\n maxHour?: number;\n /** First day of the week: 0 = Sunday, 1 = Monday … 6 = Saturday. */\n weekStartsOn?: number;\n /** Last day of the week: 0–6, must be after `weekStartsOn`. */\n weekEndsOn?: number;\n /** Show dates from the previous / next month in the month grid. */\n showAdjacentMonths?: boolean;\n /** Show ISO week numbers in the leftmost column of the month grid. */\n showWeekNumbers?: boolean;\n /** Number of days shown in the CustomDays view. */\n customDays?: number;\n /** Reset the selected date to today when switching views. */\n resetDateOnViewChange?: boolean;\n /** Show the all-day event banner row in Week / Day views. */\n showAllDayRow?: boolean;\n /** Custom renderer for the date separator in Schedule view. */\n renderScheduleSeparator?: (date: Date) => ReactNode;\n /** Pixel offset added between overlapping events in the time grid to keep them readable. */\n eventOverlapOffset?: number;\n\n // --- Layout ---\n /** CSS width of the calendar container (number = px, string = any CSS value). */\n width?: number | string;\n /** CSS height of the calendar container (number = px, string = any CSS value). */\n height?: number | string;\n\n // --- Event Callbacks ---\n /** Called when a date cell is clicked. */\n onDateClick?: (date: Date) => void;\n /** Called when an event chip is clicked. */\n onEventClick?: (event: CalendarEvent) => void;\n /** Called when the \"+N more\" overflow link is clicked. Receives the date and the hidden events. */\n onMoreClick?: (date: Date, hiddenEvents?: CalendarEvent[]) => void;\n /** Called when the calendar navigates to a different date. */\n onNavigate?: (date: Date) => void;\n /** Called when the user switches views. */\n onViewChange?: (view: ECalendarViewType) => void;\n /** Allow clicking empty time slots to create new events. */\n creatable?: boolean;\n /** Called when an empty time slot is clicked; receives the slot's start and end date. */\n onSlotClick?: (startDate: Date, endDate: Date) => void;\n\n // --- Appearance ---\n /** Color theme overrides for selected, today, and default states. */\n theme?: CalendarTheme;\n /** CSS class name overrides for individual calendar elements. */\n classNames?: CalendarClassNames;\n\n // --- Custom Renderers ---\n /** Replaces the default event chip with a fully custom renderer. */\n renderEvent?: (event: CalendarEvent) => ReactNode;\n /** Replaces the entire header bar with a custom renderer. */\n renderHeader?: (props: RenderHeaderProps) => ReactNode;\n /** Replaces the default hour label in the time grid left column. */\n renderHourCell?: (date: Date) => ReactNode;\n /** Replaces the default date number in Month view cells. */\n renderDateCell?: (props: RenderDateCellProps) => ReactNode;\n\n // --- Performance Options ---\n /** Pre-built O(1) lookup map of events keyed by date string. Avoids re-filtering on each render. */\n enrichedEventsByDate?: Record<string, CalendarEvent[]>;\n /** Enable O(1) event lookup via `enrichedEventsByDate`. */\n enableEnrichedEvents?: boolean;\n /**\n * Skip internal validation when events are already sorted by `startDate` ascending.\n *\n * **Known caveat:** the library does not re-sort the array. If unsorted events are\n * passed with this flag set to `true`, they will render in the order provided.\n * Only set this flag when the input is guaranteed to be sorted.\n */\n eventsAreSorted?: boolean;\n /** Maintain stable visual ordering of overlapping events across re-renders. */\n isEventOrderingEnabled?: boolean;\n /** Sort events within Month view cells. Pass `true` for default sort or a comparator for custom order. */\n sortedMonthView?: boolean | ((a: CalendarEvent, b: CalendarEvent) => number);\n\n // --- Localization ---\n /** Luxon locale code (e.g. `'en'`, `'fr'`, `'es-MX'`). Controls date formatting language. */\n locale?: string;\n\n /**\n * Layout direction. When omitted, falls back to `'rtl'` if `locale` is in the RTL locale list\n * (ar, he, fa, ur, ps, sd, ckb, yi); otherwise `'ltr'`.\n */\n direction?: \"ltr\" | \"rtl\";\n\n /**\n * Controls the color palette of the calendar.\n * - `'auto'` (default): follows the OS `prefers-color-scheme` preference and updates live\n * when the user toggles their OS theme.\n * - `'light'` / `'dark'`: forces the palette regardless of OS preference.\n *\n * The resolved scheme is applied as `data-color-scheme=\"light\"|\"dark\"` on the calendar root,\n * which switches the CSS custom-property palette via attribute-selector overrides in\n * `src/styles/variables.css`. The `theme` prop (per-event inline color overrides) still wins.\n */\n colorScheme?: ColorScheme;\n\n /** Overrides for built-in UI strings (navigation buttons, view names, etc.). */\n localeMessages?: {\n today?: string;\n day?: string;\n week?: string;\n month?: string;\n schedule?: string;\n /** Label suffix in the custom days dropdown (e.g. `'Days'` → \"3 Days\"). */\n days?: string;\n };\n}\n\n/**\n * Internal props type used by all view components after defaults have been applied.\n * Extends `CalendarProps` with a required subset of keys so views never need to null-check defaults.\n */\nexport interface CalendarContentProps extends RequiredSome<\n CalendarProps,\n | \"events\"\n | \"view\"\n | \"is12Hour\"\n | \"selectable\"\n | \"creatable\"\n | \"dayType\"\n | \"pastYearLength\"\n | \"futureYearLength\"\n | \"showCurrentTime\"\n | \"autoScrollToCurrentTime\"\n | \"minHour\"\n | \"maxHour\"\n | \"weekStartsOn\"\n | \"weekEndsOn\"\n | \"showAdjacentMonths\"\n | \"showWeekNumbers\"\n | \"resetDateOnViewChange\"\n | \"showAllDayRow\"\n | \"width\"\n | \"height\"\n | \"theme\"\n | \"classNames\"\n | \"eventOverlapOffset\"\n | \"enableEnrichedEvents\"\n | \"eventsAreSorted\"\n | \"isEventOrderingEnabled\"\n | \"sortedMonthView\"\n | \"testId\"\n | \"locale\"\n | \"localeMessages\"\n> {}\n\n/**\n * A month entry used in the month picker dropdown.\n */\nexport interface MonthListType {\n /** Localized month name (e.g. \"January\"). */\n label: string;\n /** 1-based month number (1 = January … 12 = December). */\n value: number;\n}\n","/**\n * @file Default theme values and layout/keyboard constants.\n */\n\n/** Fallback color theme applied when no `theme` prop is provided. */\nexport const defaultTheme = {\n default: {\n color: \"#000\",\n bgColor: \"#fff\",\n },\n selected: {\n color: \"#fff\",\n bgColor: \"#007bff\",\n },\n today: {\n color: \"#007bff\",\n bgColor: \"#e6f2ff\",\n },\n};\n\n/** Pixel dimensions used by layout algorithms to calculate cell sizes and event positioning. */\nexport const LAYOUT_CONSTANTS = {\n HEADER_HEIGHT: 122,\n DATE_LABEL_HEIGHT: 28,\n CELL_PADDING: 8,\n EVENT_HEIGHT: 26,\n DEFAULT_ROWS: 6,\n MIN_ROWS: 4,\n ALL_DAY_ROW_HEIGHT: 24,\n EVENT_ITEM_PADDING: 16,\n SMALL_EVENT_HEIGHT: 40,\n TINY_EVENT_HEIGHT: 20,\n DEFAULT_EVENT_COLOR: \"#3b82f6\",\n} as const;\n\n/** Keyboard key values that trigger interactive calendar actions. */\nexport const KEYBOARD_SHORTCUTS = {\n OPEN: \"Enter\",\n ACTIVATE: \" \",\n CLOSE: \"Escape\",\n} as const;\n","/**\n * @file Default calendar prop values and shared configuration constants.\n */\nimport { ECalendarViewType, EDayType } from \"../types\";\n\n/** Test ID strings used to locate header dropdown elements in tests and automation. */\nexport const CALENDAR_STRINGS = {\n MONTH: \"monthDropdown\",\n YEAR: \"yearDropdown\",\n};\n\n/** View options shown in the header view switcher dropdown (excludes CustomDays, which is dynamic). */\nexport const VIEW_OPTIONS = [\n { label: \"Day\", value: ECalendarViewType.day },\n { label: \"Week\", value: ECalendarViewType.week },\n { label: \"Month\", value: ECalendarViewType.month },\n { label: \"Schedule\", value: ECalendarViewType.schedule },\n];\n\n/** Default values merged into `CalendarProps` by `useCalendarProps` when the consumer omits a prop. */\nexport const defaultCalendarProps = {\n events: [],\n view: ECalendarViewType.month,\n locale: \"en\",\n localeMessages: {\n today: \"Today\",\n day: \"Day\",\n week: \"Week\",\n month: \"Month\",\n schedule: \"Schedule\",\n days: \"Days\",\n },\n is12Hour: false,\n selectable: false,\n creatable: false,\n dayType: EDayType.half,\n pastYearLength: 5,\n futureYearLength: 5,\n showCurrentTime: false,\n autoScrollToCurrentTime: false,\n minHour: 0,\n maxHour: 24,\n weekStartsOn: 0,\n weekEndsOn: 6,\n theme: {},\n classNames: {},\n showAdjacentMonths: true,\n showWeekNumbers: false,\n resetDateOnViewChange: false,\n showAllDayRow: true,\n eventOverlapOffset: 0,\n enableEnrichedEvents: false,\n eventsAreSorted: false,\n isEventOrderingEnabled: true,\n sortedMonthView: true,\n testId: \"calendar\",\n isLoading: false,\n};\n\n/**\n * Locale primary subtags that default to RTL layout when no explicit `direction` prop is given.\n * Match is case-insensitive and handles BCP-47 region/script tags (e.g. ar-SA → ar).\n */\nexport const RTL_LOCALES = [\n \"ar\", // Arabic\n \"he\", // Hebrew\n \"fa\", // Persian / Farsi\n \"ur\", // Urdu\n \"ps\", // Pashto\n \"sd\", // Sindhi\n \"ckb\", // Central Kurdish (Sorani)\n \"yi\", // Yiddish\n] as const;\n\n/** Action type strings dispatched to the calendar reducer. */\nexport const CALENDAR_ACTIONS = {\n SET_DATE: \"SET_DATE\",\n SET_VIEW: \"SET_VIEW\",\n SET_CUSTOM_DAYS: \"SET_CUSTOM_DAYS\",\n NEXT: \"NEXT\",\n PREV: \"PREV\",\n TODAY: \"TODAY\",\n} as const;\n\n/** Common time unit values used in duration and overlap calculations. */\nexport const TIME_CONSTANTS = {\n MINUTES_IN_HOUR: 60,\n HOURS_IN_DAY: 24,\n DAYS_IN_WEEK: 7,\n MS_PER_MINUTE: 60_000,\n MS_PER_HOUR: 3_600_000,\n} as const;\n\n/** Luxon format strings used throughout the calendar for date and time display. */\nexport const DATE_FORMATS = {\n DATE: \"yyyy-MM-dd\",\n TIME: \"HH:mm\",\n TIME_12H: \"hh:mm a\",\n HOUR_12H: \"hh a\",\n MONTH_YEAR: \"MMMM yyyy\",\n DAY_INDEX: \"c\",\n DAY_NUMBER: \"d\",\n FULL_DATE: \"EEEE, MMMM d, yyyy\",\n MONTH_DAY_YEAR: \"MMMM d, yyyy\",\n SHORT_MONTH_YEAR: \"MMM yyyy\",\n SHORT_MONTH: \"MMM\",\n SHORT_DAY: \"EEE\",\n DAY_DATE_SHORT_MONTH: \"EEE, d MMM\",\n} as const;\n","// these aren't really private, but nor are they really useful to document\n\n/**\n * @private\n */\nclass LuxonError extends Error {}\n\n/**\n * @private\n */\nclass InvalidDateTimeError extends LuxonError {\n constructor(reason) {\n super(`Invalid DateTime: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nclass InvalidIntervalError extends LuxonError {\n constructor(reason) {\n super(`Invalid Interval: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nclass InvalidDurationError extends LuxonError {\n constructor(reason) {\n super(`Invalid Duration: ${reason.toMessage()}`);\n }\n}\n\n/**\n * @private\n */\nclass ConflictingSpecificationError extends LuxonError {}\n\n/**\n * @private\n */\nclass InvalidUnitError extends LuxonError {\n constructor(unit) {\n super(`Invalid unit ${unit}`);\n }\n}\n\n/**\n * @private\n */\nclass InvalidArgumentError extends LuxonError {}\n\n/**\n * @private\n */\nclass ZoneIsAbstractError extends LuxonError {\n constructor() {\n super(\"Zone is an abstract class\");\n }\n}\n\n/**\n * @private\n */\n\nconst n = \"numeric\",\n s = \"short\",\n l = \"long\";\n\nconst DATE_SHORT = {\n year: n,\n month: n,\n day: n,\n};\n\nconst DATE_MED = {\n year: n,\n month: s,\n day: n,\n};\n\nconst DATE_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n};\n\nconst DATE_FULL = {\n year: n,\n month: l,\n day: n,\n};\n\nconst DATE_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n};\n\nconst TIME_SIMPLE = {\n hour: n,\n minute: n,\n};\n\nconst TIME_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n};\n\nconst TIME_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nconst TIME_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n\nconst TIME_24_SIMPLE = {\n hour: n,\n minute: n,\n hourCycle: \"h23\",\n};\n\nconst TIME_24_WITH_SECONDS = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n};\n\nconst TIME_24_WITH_SHORT_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: s,\n};\n\nconst TIME_24_WITH_LONG_OFFSET = {\n hour: n,\n minute: n,\n second: n,\n hourCycle: \"h23\",\n timeZoneName: l,\n};\n\nconst DATETIME_SHORT = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n};\n\nconst DATETIME_SHORT_WITH_SECONDS = {\n year: n,\n month: n,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nconst DATETIME_MED = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n};\n\nconst DATETIME_MED_WITH_SECONDS = {\n year: n,\n month: s,\n day: n,\n hour: n,\n minute: n,\n second: n,\n};\n\nconst DATETIME_MED_WITH_WEEKDAY = {\n year: n,\n month: s,\n day: n,\n weekday: s,\n hour: n,\n minute: n,\n};\n\nconst DATETIME_FULL = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n timeZoneName: s,\n};\n\nconst DATETIME_FULL_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: s,\n};\n\nconst DATETIME_HUGE = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n timeZoneName: l,\n};\n\nconst DATETIME_HUGE_WITH_SECONDS = {\n year: n,\n month: l,\n day: n,\n weekday: l,\n hour: n,\n minute: n,\n second: n,\n timeZoneName: l,\n};\n\n/**\n * @interface\n */\nclass Zone {\n /**\n * The type of zone\n * @abstract\n * @type {string}\n */\n get type() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The name of this zone.\n * @abstract\n * @type {string}\n */\n get name() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * The IANA name of this zone.\n * Defaults to `name` if not overwritten by a subclass.\n * @abstract\n * @type {string}\n */\n get ianaName() {\n return this.name;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year.\n * @abstract\n * @type {boolean}\n */\n get isUniversal() {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, opts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Returns the offset's value as a string\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @abstract\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @abstract\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n throw new ZoneIsAbstractError();\n }\n\n /**\n * Return whether this Zone is valid.\n * @abstract\n * @type {boolean}\n */\n get isValid() {\n throw new ZoneIsAbstractError();\n }\n}\n\nlet singleton$1 = null;\n\n/**\n * Represents the local zone for this JavaScript environment.\n * @implements {Zone}\n */\nclass SystemZone extends Zone {\n /**\n * Get a singleton instance of the local zone\n * @return {SystemZone}\n */\n static get instance() {\n if (singleton$1 === null) {\n singleton$1 = new SystemZone();\n }\n return singleton$1;\n }\n\n /** @override **/\n get type() {\n return \"system\";\n }\n\n /** @override **/\n get name() {\n return new Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale);\n }\n\n /** @override **/\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /** @override **/\n offset(ts) {\n return -new Date(ts).getTimezoneOffset();\n }\n\n /** @override **/\n equals(otherZone) {\n return otherZone.type === \"system\";\n }\n\n /** @override **/\n get isValid() {\n return true;\n }\n}\n\nconst dtfCache = new Map();\nfunction makeDTF(zoneName) {\n let dtf = dtfCache.get(zoneName);\n if (dtf === undefined) {\n dtf = new Intl.DateTimeFormat(\"en-US\", {\n hour12: false,\n timeZone: zoneName,\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n era: \"short\",\n });\n dtfCache.set(zoneName, dtf);\n }\n return dtf;\n}\n\nconst typeToPos = {\n year: 0,\n month: 1,\n day: 2,\n era: 3,\n hour: 4,\n minute: 5,\n second: 6,\n};\n\nfunction hackyOffset(dtf, date) {\n const formatted = dtf.format(date).replace(/\\u200E/g, \"\"),\n parsed = /(\\d+)\\/(\\d+)\\/(\\d+) (AD|BC),? (\\d+):(\\d+):(\\d+)/.exec(formatted),\n [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed;\n return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond];\n}\n\nfunction partsOffset(dtf, date) {\n const formatted = dtf.formatToParts(date);\n const filled = [];\n for (let i = 0; i < formatted.length; i++) {\n const { type, value } = formatted[i];\n const pos = typeToPos[type];\n\n if (type === \"era\") {\n filled[pos] = value;\n } else if (!isUndefined(pos)) {\n filled[pos] = parseInt(value, 10);\n }\n }\n return filled;\n}\n\nconst ianaZoneCache = new Map();\n/**\n * A zone identified by an IANA identifier, like America/New_York\n * @implements {Zone}\n */\nclass IANAZone extends Zone {\n /**\n * @param {string} name - Zone name\n * @return {IANAZone}\n */\n static create(name) {\n let zone = ianaZoneCache.get(name);\n if (zone === undefined) {\n ianaZoneCache.set(name, (zone = new IANAZone(name)));\n }\n return zone;\n }\n\n /**\n * Reset local caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCache() {\n ianaZoneCache.clear();\n dtfCache.clear();\n }\n\n /**\n * Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that.\n * @param {string} s - The string to check validity on\n * @example IANAZone.isValidSpecifier(\"America/New_York\") //=> true\n * @example IANAZone.isValidSpecifier(\"Sport~~blorp\") //=> false\n * @deprecated For backward compatibility, this forwards to isValidZone, better use `isValidZone()` directly instead.\n * @return {boolean}\n */\n static isValidSpecifier(s) {\n return this.isValidZone(s);\n }\n\n /**\n * Returns whether the provided string identifies a real zone\n * @param {string} zone - The string to check\n * @example IANAZone.isValidZone(\"America/New_York\") //=> true\n * @example IANAZone.isValidZone(\"Fantasia/Castle\") //=> false\n * @example IANAZone.isValidZone(\"Sport~~blorp\") //=> false\n * @return {boolean}\n */\n static isValidZone(zone) {\n if (!zone) {\n return false;\n }\n try {\n new Intl.DateTimeFormat(\"en-US\", { timeZone: zone }).format();\n return true;\n } catch (e) {\n return false;\n }\n }\n\n constructor(name) {\n super();\n /** @private **/\n this.zoneName = name;\n /** @private **/\n this.valid = IANAZone.isValidZone(name);\n }\n\n /**\n * The type of zone. `iana` for all instances of `IANAZone`.\n * @override\n * @type {string}\n */\n get type() {\n return \"iana\";\n }\n\n /**\n * The name of this zone (i.e. the IANA zone name).\n * @override\n * @type {string}\n */\n get name() {\n return this.zoneName;\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year:\n * Always returns false for all IANA zones.\n * @override\n * @type {boolean}\n */\n get isUniversal() {\n return false;\n }\n\n /**\n * Returns the offset's common name (such as EST) at the specified timestamp\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the name\n * @param {Object} opts - Options to affect the format\n * @param {string} opts.format - What style of offset to return. Accepts 'long' or 'short'.\n * @param {string} opts.locale - What locale to return the offset name in.\n * @return {string}\n */\n offsetName(ts, { format, locale }) {\n return parseZoneInfo(ts, format, locale, this.name);\n }\n\n /**\n * Returns the offset's value as a string\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n return formatOffset(this.offset(ts), format);\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n * @override\n * @param {number} ts - Epoch milliseconds for which to compute the offset\n * @return {number}\n */\n offset(ts) {\n if (!this.valid) return NaN;\n const date = new Date(ts);\n\n if (isNaN(date)) return NaN;\n\n const dtf = makeDTF(this.name);\n let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts\n ? partsOffset(dtf, date)\n : hackyOffset(dtf, date);\n\n if (adOrBc === \"BC\") {\n year = -Math.abs(year) + 1;\n }\n\n // because we're using hour12 and https://bugs.chromium.org/p/chromium/issues/detail?id=1025564&can=2&q=%2224%3A00%22%20datetimeformat\n const adjustedHour = hour === 24 ? 0 : hour;\n\n const asUTC = objToLocalTS({\n year,\n month,\n day,\n hour: adjustedHour,\n minute,\n second,\n millisecond: 0,\n });\n\n let asTS = +date;\n const over = asTS % 1000;\n asTS -= over >= 0 ? over : 1000 + over;\n return (asUTC - asTS) / (60 * 1000);\n }\n\n /**\n * Return whether this Zone is equal to another zone\n * @override\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n return otherZone.type === \"iana\" && otherZone.name === this.name;\n }\n\n /**\n * Return whether this Zone is valid.\n * @override\n * @type {boolean}\n */\n get isValid() {\n return this.valid;\n }\n}\n\n// todo - remap caching\n\nlet intlLFCache = {};\nfunction getCachedLF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlLFCache[key];\n if (!dtf) {\n dtf = new Intl.ListFormat(locString, opts);\n intlLFCache[key] = dtf;\n }\n return dtf;\n}\n\nconst intlDTCache = new Map();\nfunction getCachedDTF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let dtf = intlDTCache.get(key);\n if (dtf === undefined) {\n dtf = new Intl.DateTimeFormat(locString, opts);\n intlDTCache.set(key, dtf);\n }\n return dtf;\n}\n\nconst intlNumCache = new Map();\nfunction getCachedINF(locString, opts = {}) {\n const key = JSON.stringify([locString, opts]);\n let inf = intlNumCache.get(key);\n if (inf === undefined) {\n inf = new Intl.NumberFormat(locString, opts);\n intlNumCache.set(key, inf);\n }\n return inf;\n}\n\nconst intlRelCache = new Map();\nfunction getCachedRTF(locString, opts = {}) {\n const { base, ...cacheKeyOpts } = opts; // exclude `base` from the options\n const key = JSON.stringify([locString, cacheKeyOpts]);\n let inf = intlRelCache.get(key);\n if (inf === undefined) {\n inf = new Intl.RelativeTimeFormat(locString, opts);\n intlRelCache.set(key, inf);\n }\n return inf;\n}\n\nlet sysLocaleCache = null;\nfunction systemLocale() {\n if (sysLocaleCache) {\n return sysLocaleCache;\n } else {\n sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale;\n return sysLocaleCache;\n }\n}\n\nconst intlResolvedOptionsCache = new Map();\nfunction getCachedIntResolvedOptions(locString) {\n let opts = intlResolvedOptionsCache.get(locString);\n if (opts === undefined) {\n opts = new Intl.DateTimeFormat(locString).resolvedOptions();\n intlResolvedOptionsCache.set(locString, opts);\n }\n return opts;\n}\n\nconst weekInfoCache = new Map();\nfunction getCachedWeekInfo(locString) {\n let data = weekInfoCache.get(locString);\n if (!data) {\n const locale = new Intl.Locale(locString);\n // browsers currently implement this as a property, but spec says it should be a getter function\n data = \"getWeekInfo\" in locale ? locale.getWeekInfo() : locale.weekInfo;\n // minimalDays was removed from WeekInfo: https://github.com/tc39/proposal-intl-locale-info/issues/86\n if (!(\"minimalDays\" in data)) {\n data = { ...fallbackWeekSettings, ...data };\n }\n weekInfoCache.set(locString, data);\n }\n return data;\n}\n\nfunction parseLocaleString(localeStr) {\n // I really want to avoid writing a BCP 47 parser\n // see, e.g. https://github.com/wooorm/bcp-47\n // Instead, we'll do this:\n\n // a) if the string has no -u extensions, just leave it alone\n // b) if it does, use Intl to resolve everything\n // c) if Intl fails, try again without the -u\n\n // private subtags and unicode subtags have ordering requirements,\n // and we're not properly parsing this, so just strip out the\n // private ones if they exist.\n const xIndex = localeStr.indexOf(\"-x-\");\n if (xIndex !== -1) {\n localeStr = localeStr.substring(0, xIndex);\n }\n\n const uIndex = localeStr.indexOf(\"-u-\");\n if (uIndex === -1) {\n return [localeStr];\n } else {\n let options;\n let selectedStr;\n try {\n options = getCachedDTF(localeStr).resolvedOptions();\n selectedStr = localeStr;\n } catch (e) {\n const smaller = localeStr.substring(0, uIndex);\n options = getCachedDTF(smaller).resolvedOptions();\n selectedStr = smaller;\n }\n\n const { numberingSystem, calendar } = options;\n return [selectedStr, numberingSystem, calendar];\n }\n}\n\nfunction intlConfigString(localeStr, numberingSystem, outputCalendar) {\n if (outputCalendar || numberingSystem) {\n if (!localeStr.includes(\"-u-\")) {\n localeStr += \"-u\";\n }\n\n if (outputCalendar) {\n localeStr += `-ca-${outputCalendar}`;\n }\n\n if (numberingSystem) {\n localeStr += `-nu-${numberingSystem}`;\n }\n return localeStr;\n } else {\n return localeStr;\n }\n}\n\nfunction mapMonths(f) {\n const ms = [];\n for (let i = 1; i <= 12; i++) {\n const dt = DateTime.utc(2009, i, 1);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction mapWeekdays(f) {\n const ms = [];\n for (let i = 1; i <= 7; i++) {\n const dt = DateTime.utc(2016, 11, 13 + i);\n ms.push(f(dt));\n }\n return ms;\n}\n\nfunction listStuff(loc, length, englishFn, intlFn) {\n const mode = loc.listingMode();\n\n if (mode === \"error\") {\n return null;\n } else if (mode === \"en\") {\n return englishFn(length);\n } else {\n return intlFn(length);\n }\n}\n\nfunction supportsFastNumbers(loc) {\n if (loc.numberingSystem && loc.numberingSystem !== \"latn\") {\n return false;\n } else {\n return (\n loc.numberingSystem === \"latn\" ||\n !loc.locale ||\n loc.locale.startsWith(\"en\") ||\n getCachedIntResolvedOptions(loc.locale).numberingSystem === \"latn\"\n );\n }\n}\n\n/**\n * @private\n */\n\nclass PolyNumberFormatter {\n constructor(intl, forceSimple, opts) {\n this.padTo = opts.padTo || 0;\n this.floor = opts.floor || false;\n\n const { padTo, floor, ...otherOpts } = opts;\n\n if (!forceSimple || Object.keys(otherOpts).length > 0) {\n const intlOpts = { useGrouping: false, ...opts };\n if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo;\n this.inf = getCachedINF(intl, intlOpts);\n }\n }\n\n format(i) {\n if (this.inf) {\n const fixed = this.floor ? Math.floor(i) : i;\n return this.inf.format(fixed);\n } else {\n // to match the browser's numberformatter defaults\n const fixed = this.floor ? Math.floor(i) : roundTo(i, 3);\n return padStart(fixed, this.padTo);\n }\n }\n}\n\n/**\n * @private\n */\n\nclass PolyDateFormatter {\n constructor(dt, intl, opts) {\n this.opts = opts;\n this.originalZone = undefined;\n\n let z = undefined;\n if (this.opts.timeZone) {\n // Don't apply any workarounds if a timeZone is explicitly provided in opts\n this.dt = dt;\n } else if (dt.zone.type === \"fixed\") {\n // UTC-8 or Etc/UTC-8 are not part of tzdata, only Etc/GMT+8 and the like.\n // That is why fixed-offset TZ is set to that unless it is:\n // 1. Representing offset 0 when UTC is used to maintain previous behavior and does not become GMT.\n // 2. Unsupported by the browser:\n // - some do not support Etc/\n // - < Etc/GMT-14, > Etc/GMT+12, and 30-minute or 45-minute offsets are not part of tzdata\n const gmtOffset = -1 * (dt.offset / 60);\n const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;\n if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {\n z = offsetZ;\n this.dt = dt;\n } else {\n // Not all fixed-offset zones like Etc/+4:30 are present in tzdata so\n // we manually apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.offset === 0 ? dt : dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n } else if (dt.zone.type === \"system\") {\n this.dt = dt;\n } else if (dt.zone.type === \"iana\") {\n this.dt = dt;\n z = dt.zone.name;\n } else {\n // Custom zones can have any offset / offsetName so we just manually\n // apply the offset and substitute the zone as needed.\n z = \"UTC\";\n this.dt = dt.setZone(\"UTC\").plus({ minutes: dt.offset });\n this.originalZone = dt.zone;\n }\n\n const intlOpts = { ...this.opts };\n intlOpts.timeZone = intlOpts.timeZone || z;\n this.dtf = getCachedDTF(intl, intlOpts);\n }\n\n format() {\n if (this.originalZone) {\n // If we have to substitute in the actual zone name, we have to use\n // formatToParts so that the timezone can be replaced.\n return this.formatToParts()\n .map(({ value }) => value)\n .join(\"\");\n }\n return this.dtf.format(this.dt.toJSDate());\n }\n\n formatToParts() {\n const parts = this.dtf.formatToParts(this.dt.toJSDate());\n if (this.originalZone) {\n return parts.map((part) => {\n if (part.type === \"timeZoneName\") {\n const offsetName = this.originalZone.offsetName(this.dt.ts, {\n locale: this.dt.locale,\n format: this.opts.timeZoneName,\n });\n return {\n ...part,\n value: offsetName,\n };\n } else {\n return part;\n }\n });\n }\n return parts;\n }\n\n resolvedOptions() {\n return this.dtf.resolvedOptions();\n }\n}\n\n/**\n * @private\n */\nclass PolyRelFormatter {\n constructor(intl, isEnglish, opts) {\n this.opts = { style: \"long\", ...opts };\n if (!isEnglish && hasRelative()) {\n this.rtf = getCachedRTF(intl, opts);\n }\n }\n\n format(count, unit) {\n if (this.rtf) {\n return this.rtf.format(count, unit);\n } else {\n return formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== \"long\");\n }\n }\n\n formatToParts(count, unit) {\n if (this.rtf) {\n return this.rtf.formatToParts(count, unit);\n } else {\n return [];\n }\n }\n}\n\nconst fallbackWeekSettings = {\n firstDay: 1,\n minimalDays: 4,\n weekend: [6, 7],\n};\n\n/**\n * @private\n */\nclass Locale {\n static fromOpts(opts) {\n return Locale.create(\n opts.locale,\n opts.numberingSystem,\n opts.outputCalendar,\n opts.weekSettings,\n opts.defaultToEN\n );\n }\n\n static create(locale, numberingSystem, outputCalendar, weekSettings, defaultToEN = false) {\n const specifiedLocale = locale || Settings.defaultLocale;\n // the system locale is useful for human-readable strings but annoying for parsing/formatting known formats\n const localeR = specifiedLocale || (defaultToEN ? \"en-US\" : systemLocale());\n const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem;\n const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar;\n const weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings;\n return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale);\n }\n\n static resetCache() {\n sysLocaleCache = null;\n intlDTCache.clear();\n intlNumCache.clear();\n intlRelCache.clear();\n intlResolvedOptionsCache.clear();\n weekInfoCache.clear();\n }\n\n static fromObject({ locale, numberingSystem, outputCalendar, weekSettings } = {}) {\n return Locale.create(locale, numberingSystem, outputCalendar, weekSettings);\n }\n\n constructor(locale, numbering, outputCalendar, weekSettings, specifiedLocale) {\n const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale);\n\n this.locale = parsedLocale;\n this.numberingSystem = numbering || parsedNumberingSystem || null;\n this.outputCalendar = outputCalendar || parsedOutputCalendar || null;\n this.weekSettings = weekSettings;\n this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar);\n\n this.weekdaysCache = { format: {}, standalone: {} };\n this.monthsCache = { format: {}, standalone: {} };\n this.meridiemCache = null;\n this.eraCache = {};\n\n this.specifiedLocale = specifiedLocale;\n this.fastNumbersCached = null;\n }\n\n get fastNumbers() {\n if (this.fastNumbersCached == null) {\n this.fastNumbersCached = supportsFastNumbers(this);\n }\n\n return this.fastNumbersCached;\n }\n\n listingMode() {\n const isActuallyEn = this.isEnglish();\n const hasNoWeirdness =\n (this.numberingSystem === null || this.numberingSystem === \"latn\") &&\n (this.outputCalendar === null || this.outputCalendar === \"gregory\");\n return isActuallyEn && hasNoWeirdness ? \"en\" : \"intl\";\n }\n\n clone(alts) {\n if (!alts || Object.getOwnPropertyNames(alts).length === 0) {\n return this;\n } else {\n return Locale.create(\n alts.locale || this.specifiedLocale,\n alts.numberingSystem || this.numberingSystem,\n alts.outputCalendar || this.outputCalendar,\n validateWeekSettings(alts.weekSettings) || this.weekSettings,\n alts.defaultToEN || false\n );\n }\n }\n\n redefaultToEN(alts = {}) {\n return this.clone({ ...alts, defaultToEN: true });\n }\n\n redefaultToSystem(alts = {}) {\n return this.clone({ ...alts, defaultToEN: false });\n }\n\n months(length, format = false) {\n return listStuff(this, length, months, () => {\n // Workaround for \"ja\" locale: formatToParts does not label all parts of the month\n // as \"month\" and for this locale there is no difference between \"format\" and \"non-format\".\n // As such, just use format() instead of formatToParts() and take the whole string\n const monthSpecialCase = this.intl === \"ja\" || this.intl.startsWith(\"ja-\");\n format &= !monthSpecialCase;\n const intl = format ? { month: length, day: \"numeric\" } : { month: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.monthsCache[formatStr][length]) {\n const mapper = !monthSpecialCase\n ? (dt) => this.extract(dt, intl, \"month\")\n : (dt) => this.dtFormatter(dt, intl).format();\n this.monthsCache[formatStr][length] = mapMonths(mapper);\n }\n return this.monthsCache[formatStr][length];\n });\n }\n\n weekdays(length, format = false) {\n return listStuff(this, length, weekdays, () => {\n const intl = format\n ? { weekday: length, year: \"numeric\", month: \"long\", day: \"numeric\" }\n : { weekday: length },\n formatStr = format ? \"format\" : \"standalone\";\n if (!this.weekdaysCache[formatStr][length]) {\n this.weekdaysCache[formatStr][length] = mapWeekdays((dt) =>\n this.extract(dt, intl, \"weekday\")\n );\n }\n return this.weekdaysCache[formatStr][length];\n });\n }\n\n meridiems() {\n return listStuff(\n this,\n undefined,\n () => meridiems,\n () => {\n // In theory there could be aribitrary day periods. We're gonna assume there are exactly two\n // for AM and PM. This is probably wrong, but it's makes parsing way easier.\n if (!this.meridiemCache) {\n const intl = { hour: \"numeric\", hourCycle: \"h12\" };\n this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(\n (dt) => this.extract(dt, intl, \"dayperiod\")\n );\n }\n\n return this.meridiemCache;\n }\n );\n }\n\n eras(length) {\n return listStuff(this, length, eras, () => {\n const intl = { era: length };\n\n // This is problematic. Different calendars are going to define eras totally differently. What I need is the minimum set of dates\n // to definitely enumerate them.\n if (!this.eraCache[length]) {\n this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map((dt) =>\n this.extract(dt, intl, \"era\")\n );\n }\n\n return this.eraCache[length];\n });\n }\n\n extract(dt, intlOpts, field) {\n const df = this.dtFormatter(dt, intlOpts),\n results = df.formatToParts(),\n matching = results.find((m) => m.type.toLowerCase() === field);\n return matching ? matching.value : null;\n }\n\n numberFormatter(opts = {}) {\n // this forcesimple option is never used (the only caller short-circuits on it, but it seems safer to leave)\n // (in contrast, the rest of the condition is used heavily)\n return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts);\n }\n\n dtFormatter(dt, intlOpts = {}) {\n return new PolyDateFormatter(dt, this.intl, intlOpts);\n }\n\n relFormatter(opts = {}) {\n return new PolyRelFormatter(this.intl, this.isEnglish(), opts);\n }\n\n listFormatter(opts = {}) {\n return getCachedLF(this.intl, opts);\n }\n\n isEnglish() {\n return (\n this.locale === \"en\" ||\n this.locale.toLowerCase() === \"en-us\" ||\n getCachedIntResolvedOptions(this.intl).locale.startsWith(\"en-us\")\n );\n }\n\n getWeekSettings() {\n if (this.weekSettings) {\n return this.weekSettings;\n } else if (!hasLocaleWeekInfo()) {\n return fallbackWeekSettings;\n } else {\n return getCachedWeekInfo(this.locale);\n }\n }\n\n getStartOfWeek() {\n return this.getWeekSettings().firstDay;\n }\n\n getMinDaysInFirstWeek() {\n return this.getWeekSettings().minimalDays;\n }\n\n getWeekendDays() {\n return this.getWeekSettings().weekend;\n }\n\n equals(other) {\n return (\n this.locale === other.locale &&\n this.numberingSystem === other.numberingSystem &&\n this.outputCalendar === other.outputCalendar\n );\n }\n\n toString() {\n return `Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`;\n }\n}\n\nlet singleton = null;\n\n/**\n * A zone with a fixed offset (meaning no DST)\n * @implements {Zone}\n */\nclass FixedOffsetZone extends Zone {\n /**\n * Get a singleton instance of UTC\n * @return {FixedOffsetZone}\n */\n static get utcInstance() {\n if (singleton === null) {\n singleton = new FixedOffsetZone(0);\n }\n return singleton;\n }\n\n /**\n * Get an instance with a specified offset\n * @param {number} offset - The offset in minutes\n * @return {FixedOffsetZone}\n */\n static instance(offset) {\n return offset === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset);\n }\n\n /**\n * Get an instance of FixedOffsetZone from a UTC offset string, like \"UTC+6\"\n * @param {string} s - The offset string to parse\n * @example FixedOffsetZone.parseSpecifier(\"UTC+6\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC+06\")\n * @example FixedOffsetZone.parseSpecifier(\"UTC-6:00\")\n * @return {FixedOffsetZone}\n */\n static parseSpecifier(s) {\n if (s) {\n const r = s.match(/^utc(?:([+-]\\d{1,2})(?::(\\d{2}))?)?$/i);\n if (r) {\n return new FixedOffsetZone(signedOffset(r[1], r[2]));\n }\n }\n return null;\n }\n\n constructor(offset) {\n super();\n /** @private **/\n this.fixed = offset;\n }\n\n /**\n * The type of zone. `fixed` for all instances of `FixedOffsetZone`.\n * @override\n * @type {string}\n */\n get type() {\n return \"fixed\";\n }\n\n /**\n * The name of this zone.\n * All fixed zones' names always start with \"UTC\" (plus optional offset)\n * @override\n * @type {string}\n */\n get name() {\n return this.fixed === 0 ? \"UTC\" : `UTC${formatOffset(this.fixed, \"narrow\")}`;\n }\n\n /**\n * The IANA name of this zone, i.e. `Etc/UTC` or `Etc/GMT+/-nn`\n *\n * @override\n * @type {string}\n */\n get ianaName() {\n if (this.fixed === 0) {\n return \"Etc/UTC\";\n } else {\n return `Etc/GMT${formatOffset(-this.fixed, \"narrow\")}`;\n }\n }\n\n /**\n * Returns the offset's common name at the specified timestamp.\n *\n * For fixed offset zones this equals to the zone name.\n * @override\n */\n offsetName() {\n return this.name;\n }\n\n /**\n * Returns the offset's value as a string\n * @override\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\n formatOffset(ts, format) {\n return formatOffset(this.fixed, format);\n }\n\n /**\n * Returns whether the offset is known to be fixed for the whole year:\n * Always returns true for all fixed offset zones.\n * @override\n * @type {boolean}\n */\n get isUniversal() {\n return true;\n }\n\n /**\n * Return the offset in minutes for this zone at the specified timestamp.\n *\n * For fixed offset zones, this is constant and does not depend on a timestamp.\n * @override\n * @return {number}\n */\n offset() {\n return this.fixed;\n }\n\n /**\n * Return whether this Zone is equal to another zone (i.e. also fixed and same offset)\n * @override\n * @param {Zone} otherZone - the zone to compare\n * @return {boolean}\n */\n equals(otherZone) {\n return otherZone.type === \"fixed\" && otherZone.fixed === this.fixed;\n }\n\n /**\n * Return whether this Zone is valid:\n * All fixed offset zones are valid.\n * @override\n * @type {boolean}\n */\n get isValid() {\n return true;\n }\n}\n\n/**\n * A zone that failed to parse. You should never need to instantiate this.\n * @implements {Zone}\n */\nclass InvalidZone extends Zone {\n constructor(zoneName) {\n super();\n /** @private */\n this.zoneName = zoneName;\n }\n\n /** @override **/\n get type() {\n return \"invalid\";\n }\n\n /** @override **/\n get name() {\n return this.zoneName;\n }\n\n /** @override **/\n get isUniversal() {\n return false;\n }\n\n /** @override **/\n offsetName() {\n return null;\n }\n\n /** @override **/\n formatOffset() {\n return \"\";\n }\n\n /** @override **/\n offset() {\n return NaN;\n }\n\n /** @override **/\n equals() {\n return false;\n }\n\n /** @override **/\n get isValid() {\n return false;\n }\n}\n\n/**\n * @private\n */\n\nfunction normalizeZone(input, defaultZone) {\n if (isUndefined(input) || input === null) {\n return defaultZone;\n } else if (input instanceof Zone) {\n return input;\n } else if (isString(input)) {\n const lowered = input.toLowerCase();\n if (lowered === \"default\") return defaultZone;\n else if (lowered === \"local\" || lowered === \"system\") return SystemZone.instance;\n else if (lowered === \"utc\" || lowered === \"gmt\") return FixedOffsetZone.utcInstance;\n else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input);\n } else if (isNumber(input)) {\n return FixedOffsetZone.instance(input);\n } else if (typeof input === \"object\" && \"offset\" in input && typeof input.offset === \"function\") {\n // This is dumb, but the instanceof check above doesn't seem to really work\n // so we're duck checking it\n return input;\n } else {\n return new InvalidZone(input);\n }\n}\n\nconst numberingSystems = {\n arab: \"[\\u0660-\\u0669]\",\n arabext: \"[\\u06F0-\\u06F9]\",\n bali: \"[\\u1B50-\\u1B59]\",\n beng: \"[\\u09E6-\\u09EF]\",\n deva: \"[\\u0966-\\u096F]\",\n fullwide: \"[\\uFF10-\\uFF19]\",\n gujr: \"[\\u0AE6-\\u0AEF]\",\n hanidec: \"[〇|一|二|三|四|五|六|七|八|九]\",\n khmr: \"[\\u17E0-\\u17E9]\",\n knda: \"[\\u0CE6-\\u0CEF]\",\n laoo: \"[\\u0ED0-\\u0ED9]\",\n limb: \"[\\u1946-\\u194F]\",\n mlym: \"[\\u0D66-\\u0D6F]\",\n mong: \"[\\u1810-\\u1819]\",\n mymr: \"[\\u1040-\\u1049]\",\n orya: \"[\\u0B66-\\u0B6F]\",\n tamldec: \"[\\u0BE6-\\u0BEF]\",\n telu: \"[\\u0C66-\\u0C6F]\",\n thai: \"[\\u0E50-\\u0E59]\",\n tibt: \"[\\u0F20-\\u0F29]\",\n latn: \"\\\\d\",\n};\n\nconst numberingSystemsUTF16 = {\n arab: [1632, 1641],\n arabext: [1776, 1785],\n bali: [6992, 7001],\n beng: [2534, 2543],\n deva: [2406, 2415],\n fullwide: [65296, 65303],\n gujr: [2790, 2799],\n khmr: [6112, 6121],\n knda: [3302, 3311],\n laoo: [3792, 3801],\n limb: [6470, 6479],\n mlym: [3430, 3439],\n mong: [6160, 6169],\n mymr: [4160, 4169],\n orya: [2918, 2927],\n tamldec: [3046, 3055],\n telu: [3174, 3183],\n thai: [3664, 3673],\n tibt: [3872, 3881],\n};\n\nconst hanidecChars = numberingSystems.hanidec.replace(/[\\[|\\]]/g, \"\").split(\"\");\n\nfunction parseDigits(str) {\n let value = parseInt(str, 10);\n if (isNaN(value)) {\n value = \"\";\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n\n if (str[i].search(numberingSystems.hanidec) !== -1) {\n value += hanidecChars.indexOf(str[i]);\n } else {\n for (const key in numberingSystemsUTF16) {\n const [min, max] = numberingSystemsUTF16[key];\n if (code >= min && code <= max) {\n value += code - min;\n }\n }\n }\n }\n return parseInt(value, 10);\n } else {\n return value;\n }\n}\n\n// cache of {numberingSystem: {append: regex}}\nconst digitRegexCache = new Map();\nfunction resetDigitRegexCache() {\n digitRegexCache.clear();\n}\n\nfunction digitRegex({ numberingSystem }, append = \"\") {\n const ns = numberingSystem || \"latn\";\n\n let appendCache = digitRegexCache.get(ns);\n if (appendCache === undefined) {\n appendCache = new Map();\n digitRegexCache.set(ns, appendCache);\n }\n let regex = appendCache.get(append);\n if (regex === undefined) {\n regex = new RegExp(`${numberingSystems[ns]}${append}`);\n appendCache.set(append, regex);\n }\n\n return regex;\n}\n\nlet now = () => Date.now(),\n defaultZone = \"system\",\n defaultLocale = null,\n defaultNumberingSystem = null,\n defaultOutputCalendar = null,\n twoDigitCutoffYear = 60,\n throwOnInvalid,\n defaultWeekSettings = null;\n\n/**\n * Settings contains static getters and setters that control Luxon's overall behavior. Luxon is a simple library with few options, but the ones it does have live here.\n */\nclass Settings {\n /**\n * Get the callback for returning the current timestamp.\n * @type {function}\n */\n static get now() {\n return now;\n }\n\n /**\n * Set the callback for returning the current timestamp.\n * The function should return a number, which will be interpreted as an Epoch millisecond count\n * @type {function}\n * @example Settings.now = () => Date.now() + 3000 // pretend it is 3 seconds in the future\n * @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time\n */\n static set now(n) {\n now = n;\n }\n\n /**\n * Set the default time zone to create DateTimes in. Does not affect existing instances.\n * Use the value \"system\" to reset this value to the system's time zone.\n * @type {string}\n */\n static set defaultZone(zone) {\n defaultZone = zone;\n }\n\n /**\n * Get the default time zone object currently used to create DateTimes. Does not affect existing instances.\n * The default value is the system's time zone (the one set on the machine that runs this code).\n * @type {Zone}\n */\n static get defaultZone() {\n return normalizeZone(defaultZone, SystemZone.instance);\n }\n\n /**\n * Get the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultLocale() {\n return defaultLocale;\n }\n\n /**\n * Set the default locale to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultLocale(locale) {\n defaultLocale = locale;\n }\n\n /**\n * Get the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultNumberingSystem() {\n return defaultNumberingSystem;\n }\n\n /**\n * Set the default numbering system to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultNumberingSystem(numberingSystem) {\n defaultNumberingSystem = numberingSystem;\n }\n\n /**\n * Get the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static get defaultOutputCalendar() {\n return defaultOutputCalendar;\n }\n\n /**\n * Set the default output calendar to create DateTimes with. Does not affect existing instances.\n * @type {string}\n */\n static set defaultOutputCalendar(outputCalendar) {\n defaultOutputCalendar = outputCalendar;\n }\n\n /**\n * @typedef {Object} WeekSettings\n * @property {number} firstDay\n * @property {number} minimalDays\n * @property {number[]} weekend\n */\n\n /**\n * @return {WeekSettings|null}\n */\n static get defaultWeekSettings() {\n return defaultWeekSettings;\n }\n\n /**\n * Allows overriding the default locale week settings, i.e. the start of the week, the weekend and\n * how many days are required in the first week of a year.\n * Does not affect existing instances.\n *\n * @param {WeekSettings|null} weekSettings\n */\n static set defaultWeekSettings(weekSettings) {\n defaultWeekSettings = validateWeekSettings(weekSettings);\n }\n\n /**\n * Get the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx.\n * @type {number}\n */\n static get twoDigitCutoffYear() {\n return twoDigitCutoffYear;\n }\n\n /**\n * Set the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx.\n * @type {number}\n * @example Settings.twoDigitCutoffYear = 0 // all 'yy' are interpreted as 20th century\n * @example Settings.twoDigitCutoffYear = 99 // all 'yy' are interpreted as 21st century\n * @example Settings.twoDigitCutoffYear = 50 // '49' -> 2049; '50' -> 1950\n * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50\n * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50\n */\n static set twoDigitCutoffYear(cutoffYear) {\n twoDigitCutoffYear = cutoffYear % 100;\n }\n\n /**\n * Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static get throwOnInvalid() {\n return throwOnInvalid;\n }\n\n /**\n * Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals\n * @type {boolean}\n */\n static set throwOnInvalid(t) {\n throwOnInvalid = t;\n }\n\n /**\n * Reset Luxon's global caches. Should only be necessary in testing scenarios.\n * @return {void}\n */\n static resetCaches() {\n Locale.resetCache();\n IANAZone.resetCache();\n DateTime.resetCache();\n resetDigitRegexCache();\n }\n}\n\nclass Invalid {\n constructor(reason, explanation) {\n this.reason = reason;\n this.explanation = explanation;\n }\n\n toMessage() {\n if (this.explanation) {\n return `${this.reason}: ${this.explanation}`;\n } else {\n return this.reason;\n }\n }\n}\n\nconst nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334],\n leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];\n\nfunction unitOutOfRange(unit, value) {\n return new Invalid(\n \"unit out of range\",\n `you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid`\n );\n}\n\nfunction dayOfWeek(year, month, day) {\n const d = new Date(Date.UTC(year, month - 1, day));\n\n if (year < 100 && year >= 0) {\n d.setUTCFullYear(d.getUTCFullYear() - 1900);\n }\n\n const js = d.getUTCDay();\n\n return js === 0 ? 7 : js;\n}\n\nfunction computeOrdinal(year, month, day) {\n return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1];\n}\n\nfunction uncomputeOrdinal(year, ordinal) {\n const table = isLeapYear(year) ? leapLadder : nonLeapLadder,\n month0 = table.findIndex((i) => i < ordinal),\n day = ordinal - table[month0];\n return { month: month0 + 1, day };\n}\n\nfunction isoWeekdayToLocal(isoWeekday, startOfWeek) {\n return ((isoWeekday - startOfWeek + 7) % 7) + 1;\n}\n\n/**\n * @private\n */\n\nfunction gregorianToWeek(gregObj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { year, month, day } = gregObj,\n ordinal = computeOrdinal(year, month, day),\n weekday = isoWeekdayToLocal(dayOfWeek(year, month, day), startOfWeek);\n\n let weekNumber = Math.floor((ordinal - weekday + 14 - minDaysInFirstWeek) / 7),\n weekYear;\n\n if (weekNumber < 1) {\n weekYear = year - 1;\n weekNumber = weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek);\n } else if (weekNumber > weeksInWeekYear(year, minDaysInFirstWeek, startOfWeek)) {\n weekYear = year + 1;\n weekNumber = 1;\n } else {\n weekYear = year;\n }\n\n return { weekYear, weekNumber, weekday, ...timeObject(gregObj) };\n}\n\nfunction weekToGregorian(weekData, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const { weekYear, weekNumber, weekday } = weekData,\n weekdayOfJan4 = isoWeekdayToLocal(dayOfWeek(weekYear, 1, minDaysInFirstWeek), startOfWeek),\n yearInDays = daysInYear(weekYear);\n\n let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 7 + minDaysInFirstWeek,\n year;\n\n if (ordinal < 1) {\n year = weekYear - 1;\n ordinal += daysInYear(year);\n } else if (ordinal > yearInDays) {\n year = weekYear + 1;\n ordinal -= daysInYear(weekYear);\n } else {\n year = weekYear;\n }\n\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(weekData) };\n}\n\nfunction gregorianToOrdinal(gregData) {\n const { year, month, day } = gregData;\n const ordinal = computeOrdinal(year, month, day);\n return { year, ordinal, ...timeObject(gregData) };\n}\n\nfunction ordinalToGregorian(ordinalData) {\n const { year, ordinal } = ordinalData;\n const { month, day } = uncomputeOrdinal(year, ordinal);\n return { year, month, day, ...timeObject(ordinalData) };\n}\n\n/**\n * Check if local week units like localWeekday are used in obj.\n * If so, validates that they are not mixed with ISO week units and then copies them to the normal week unit properties.\n * Modifies obj in-place!\n * @param obj the object values\n */\nfunction usesLocalWeekValues(obj, loc) {\n const hasLocaleWeekData =\n !isUndefined(obj.localWeekday) ||\n !isUndefined(obj.localWeekNumber) ||\n !isUndefined(obj.localWeekYear);\n if (hasLocaleWeekData) {\n const hasIsoWeekData =\n !isUndefined(obj.weekday) || !isUndefined(obj.weekNumber) || !isUndefined(obj.weekYear);\n\n if (hasIsoWeekData) {\n throw new ConflictingSpecificationError(\n \"Cannot mix locale-based week fields with ISO-based week fields\"\n );\n }\n if (!isUndefined(obj.localWeekday)) obj.weekday = obj.localWeekday;\n if (!isUndefined(obj.localWeekNumber)) obj.weekNumber = obj.localWeekNumber;\n if (!isUndefined(obj.localWeekYear)) obj.weekYear = obj.localWeekYear;\n delete obj.localWeekday;\n delete obj.localWeekNumber;\n delete obj.localWeekYear;\n return {\n minDaysInFirstWeek: loc.getMinDaysInFirstWeek(),\n startOfWeek: loc.getStartOfWeek(),\n };\n } else {\n return { minDaysInFirstWeek: 4, startOfWeek: 1 };\n }\n}\n\nfunction hasInvalidWeekData(obj, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const validYear = isInteger(obj.weekYear),\n validWeek = integerBetween(\n obj.weekNumber,\n 1,\n weeksInWeekYear(obj.weekYear, minDaysInFirstWeek, startOfWeek)\n ),\n validWeekday = integerBetween(obj.weekday, 1, 7);\n\n if (!validYear) {\n return unitOutOfRange(\"weekYear\", obj.weekYear);\n } else if (!validWeek) {\n return unitOutOfRange(\"week\", obj.weekNumber);\n } else if (!validWeekday) {\n return unitOutOfRange(\"weekday\", obj.weekday);\n } else return false;\n}\n\nfunction hasInvalidOrdinalData(obj) {\n const validYear = isInteger(obj.year),\n validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validOrdinal) {\n return unitOutOfRange(\"ordinal\", obj.ordinal);\n } else return false;\n}\n\nfunction hasInvalidGregorianData(obj) {\n const validYear = isInteger(obj.year),\n validMonth = integerBetween(obj.month, 1, 12),\n validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month));\n\n if (!validYear) {\n return unitOutOfRange(\"year\", obj.year);\n } else if (!validMonth) {\n return unitOutOfRange(\"month\", obj.month);\n } else if (!validDay) {\n return unitOutOfRange(\"day\", obj.day);\n } else return false;\n}\n\nfunction hasInvalidTimeData(obj) {\n const { hour, minute, second, millisecond } = obj;\n const validHour =\n integerBetween(hour, 0, 23) ||\n (hour === 24 && minute === 0 && second === 0 && millisecond === 0),\n validMinute = integerBetween(minute, 0, 59),\n validSecond = integerBetween(second, 0, 59),\n validMillisecond = integerBetween(millisecond, 0, 999);\n\n if (!validHour) {\n return unitOutOfRange(\"hour\", hour);\n } else if (!validMinute) {\n return unitOutOfRange(\"minute\", minute);\n } else if (!validSecond) {\n return unitOutOfRange(\"second\", second);\n } else if (!validMillisecond) {\n return unitOutOfRange(\"millisecond\", millisecond);\n } else return false;\n}\n\n/*\n This is just a junk drawer, containing anything used across multiple classes.\n Because Luxon is small(ish), this should stay small and we won't worry about splitting\n it up into, say, parsingUtil.js and basicUtil.js and so on. But they are divided up by feature area.\n*/\n\n/**\n * @private\n */\n\n// TYPES\n\nfunction isUndefined(o) {\n return typeof o === \"undefined\";\n}\n\nfunction isNumber(o) {\n return typeof o === \"number\";\n}\n\nfunction isInteger(o) {\n return typeof o === \"number\" && o % 1 === 0;\n}\n\nfunction isString(o) {\n return typeof o === \"string\";\n}\n\nfunction isDate(o) {\n return Object.prototype.toString.call(o) === \"[object Date]\";\n}\n\n// CAPABILITIES\n\nfunction hasRelative() {\n try {\n return typeof Intl !== \"undefined\" && !!Intl.RelativeTimeFormat;\n } catch (e) {\n return false;\n }\n}\n\nfunction hasLocaleWeekInfo() {\n try {\n return (\n typeof Intl !== \"undefined\" &&\n !!Intl.Locale &&\n (\"weekInfo\" in Intl.Locale.prototype || \"getWeekInfo\" in Intl.Locale.prototype)\n );\n } catch (e) {\n return false;\n }\n}\n\n// OBJECTS AND ARRAYS\n\nfunction maybeArray(thing) {\n return Array.isArray(thing) ? thing : [thing];\n}\n\nfunction bestBy(arr, by, compare) {\n if (arr.length === 0) {\n return undefined;\n }\n return arr.reduce((best, next) => {\n const pair = [by(next), next];\n if (!best) {\n return pair;\n } else if (compare(best[0], pair[0]) === best[0]) {\n return best;\n } else {\n return pair;\n }\n }, null)[1];\n}\n\nfunction pick(obj, keys) {\n return keys.reduce((a, k) => {\n a[k] = obj[k];\n return a;\n }, {});\n}\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nfunction validateWeekSettings(settings) {\n if (settings == null) {\n return null;\n } else if (typeof settings !== \"object\") {\n throw new InvalidArgumentError(\"Week settings must be an object\");\n } else {\n if (\n !integerBetween(settings.firstDay, 1, 7) ||\n !integerBetween(settings.minimalDays, 1, 7) ||\n !Array.isArray(settings.weekend) ||\n settings.weekend.some((v) => !integerBetween(v, 1, 7))\n ) {\n throw new InvalidArgumentError(\"Invalid week settings\");\n }\n return {\n firstDay: settings.firstDay,\n minimalDays: settings.minimalDays,\n weekend: Array.from(settings.weekend),\n };\n }\n}\n\n// NUMBERS AND STRINGS\n\nfunction integerBetween(thing, bottom, top) {\n return isInteger(thing) && thing >= bottom && thing <= top;\n}\n\n// x % n but takes the sign of n instead of x\nfunction floorMod(x, n) {\n return x - n * Math.floor(x / n);\n}\n\nfunction padStart(input, n = 2) {\n const isNeg = input < 0;\n let padded;\n if (isNeg) {\n padded = \"-\" + (\"\" + -input).padStart(n, \"0\");\n } else {\n padded = (\"\" + input).padStart(n, \"0\");\n }\n return padded;\n}\n\nfunction parseInteger(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseInt(string, 10);\n }\n}\n\nfunction parseFloating(string) {\n if (isUndefined(string) || string === null || string === \"\") {\n return undefined;\n } else {\n return parseFloat(string);\n }\n}\n\nfunction parseMillis(fraction) {\n // Return undefined (instead of 0) in these cases, where fraction is not set\n if (isUndefined(fraction) || fraction === null || fraction === \"\") {\n return undefined;\n } else {\n const f = parseFloat(\"0.\" + fraction) * 1000;\n return Math.floor(f);\n }\n}\n\nfunction roundTo(number, digits, rounding = \"round\") {\n const factor = 10 ** digits;\n switch (rounding) {\n case \"expand\":\n return number > 0\n ? Math.ceil(number * factor) / factor\n : Math.floor(number * factor) / factor;\n case \"trunc\":\n return Math.trunc(number * factor) / factor;\n case \"round\":\n return Math.round(number * factor) / factor;\n case \"floor\":\n return Math.floor(number * factor) / factor;\n case \"ceil\":\n return Math.ceil(number * factor) / factor;\n default:\n throw new RangeError(`Value rounding ${rounding} is out of range`);\n }\n}\n\n// DATE BASICS\n\nfunction isLeapYear(year) {\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\n\nfunction daysInYear(year) {\n return isLeapYear(year) ? 366 : 365;\n}\n\nfunction daysInMonth(year, month) {\n const modMonth = floorMod(month - 1, 12) + 1,\n modYear = year + (month - modMonth) / 12;\n\n if (modMonth === 2) {\n return isLeapYear(modYear) ? 29 : 28;\n } else {\n return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1];\n }\n}\n\n// convert a calendar object to a local timestamp (epoch, but with the offset baked in)\nfunction objToLocalTS(obj) {\n let d = Date.UTC(\n obj.year,\n obj.month - 1,\n obj.day,\n obj.hour,\n obj.minute,\n obj.second,\n obj.millisecond\n );\n\n // for legacy reasons, years between 0 and 99 are interpreted as 19XX; revert that\n if (obj.year < 100 && obj.year >= 0) {\n d = new Date(d);\n // set the month and day again, this is necessary because year 2000 is a leap year, but year 100 is not\n // so if obj.year is in 99, but obj.day makes it roll over into year 100,\n // the calculations done by Date.UTC are using year 2000 - which is incorrect\n d.setUTCFullYear(obj.year, obj.month - 1, obj.day);\n }\n return +d;\n}\n\n// adapted from moment.js: https://github.com/moment/moment/blob/000ac1800e620f770f4eb31b5ae908f6167b0ab2/src/lib/units/week-calendar-utils.js\nfunction firstWeekOffset(year, minDaysInFirstWeek, startOfWeek) {\n const fwdlw = isoWeekdayToLocal(dayOfWeek(year, 1, minDaysInFirstWeek), startOfWeek);\n return -fwdlw + minDaysInFirstWeek - 1;\n}\n\nfunction weeksInWeekYear(weekYear, minDaysInFirstWeek = 4, startOfWeek = 1) {\n const weekOffset = firstWeekOffset(weekYear, minDaysInFirstWeek, startOfWeek);\n const weekOffsetNext = firstWeekOffset(weekYear + 1, minDaysInFirstWeek, startOfWeek);\n return (daysInYear(weekYear) - weekOffset + weekOffsetNext) / 7;\n}\n\nfunction untruncateYear(year) {\n if (year > 99) {\n return year;\n } else return year > Settings.twoDigitCutoffYear ? 1900 + year : 2000 + year;\n}\n\n// PARSING\n\nfunction parseZoneInfo(ts, offsetFormat, locale, timeZone = null) {\n const date = new Date(ts),\n intlOpts = {\n hourCycle: \"h23\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n };\n\n if (timeZone) {\n intlOpts.timeZone = timeZone;\n }\n\n const modified = { timeZoneName: offsetFormat, ...intlOpts };\n\n const parsed = new Intl.DateTimeFormat(locale, modified)\n .formatToParts(date)\n .find((m) => m.type.toLowerCase() === \"timezonename\");\n return parsed ? parsed.value : null;\n}\n\n// signedOffset('-5', '30') -> -330\nfunction signedOffset(offHourStr, offMinuteStr) {\n let offHour = parseInt(offHourStr, 10);\n\n // don't || this because we want to preserve -0\n if (Number.isNaN(offHour)) {\n offHour = 0;\n }\n\n const offMin = parseInt(offMinuteStr, 10) || 0,\n offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin;\n return offHour * 60 + offMinSigned;\n}\n\n// COERCION\n\nfunction asNumber(value) {\n const numericValue = Number(value);\n if (typeof value === \"boolean\" || value === \"\" || !Number.isFinite(numericValue))\n throw new InvalidArgumentError(`Invalid unit value ${value}`);\n return numericValue;\n}\n\nfunction normalizeObject(obj, normalizer) {\n const normalized = {};\n for (const u in obj) {\n if (hasOwnProperty(obj, u)) {\n const v = obj[u];\n if (v === undefined || v === null) continue;\n normalized[normalizer(u)] = asNumber(v);\n }\n }\n return normalized;\n}\n\n/**\n * Returns the offset's value as a string\n * @param {number} ts - Epoch milliseconds for which to get the offset\n * @param {string} format - What style of offset to return.\n * Accepts 'narrow', 'short', or 'techie'. Returning '+6', '+06:00', or '+0600' respectively\n * @return {string}\n */\nfunction formatOffset(offset, format) {\n const hours = Math.trunc(Math.abs(offset / 60)),\n minutes = Math.trunc(Math.abs(offset % 60)),\n sign = offset >= 0 ? \"+\" : \"-\";\n\n switch (format) {\n case \"short\":\n return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`;\n case \"narrow\":\n return `${sign}${hours}${minutes > 0 ? `:${minutes}` : \"\"}`;\n case \"techie\":\n return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`;\n default:\n throw new RangeError(`Value format ${format} is out of range for property format`);\n }\n}\n\nfunction timeObject(obj) {\n return pick(obj, [\"hour\", \"minute\", \"second\", \"millisecond\"]);\n}\n\n/**\n * @private\n */\n\nconst monthsLong = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n];\n\nconst monthsShort = [\n \"Jan\",\n \"Feb\",\n \"Mar\",\n \"Apr\",\n \"May\",\n \"Jun\",\n \"Jul\",\n \"Aug\",\n \"Sep\",\n \"Oct\",\n \"Nov\",\n \"Dec\",\n];\n\nconst monthsNarrow = [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"];\n\nfunction months(length) {\n switch (length) {\n case \"narrow\":\n return [...monthsNarrow];\n case \"short\":\n return [...monthsShort];\n case \"long\":\n return [...monthsLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\"];\n case \"2-digit\":\n return [\"01\", \"02\", \"03\", \"04\", \"05\", \"06\", \"07\", \"08\", \"09\", \"10\", \"11\", \"12\"];\n default:\n return null;\n }\n}\n\nconst weekdaysLong = [\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n \"Sunday\",\n];\n\nconst weekdaysShort = [\"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\"];\n\nconst weekdaysNarrow = [\"M\", \"T\", \"W\", \"T\", \"F\", \"S\", \"S\"];\n\nfunction weekdays(length) {\n switch (length) {\n case \"narrow\":\n return [...weekdaysNarrow];\n case \"short\":\n return [...weekdaysShort];\n case \"long\":\n return [...weekdaysLong];\n case \"numeric\":\n return [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\"];\n default:\n return null;\n }\n}\n\nconst meridiems = [\"AM\", \"PM\"];\n\nconst erasLong = [\"Before Christ\", \"Anno Domini\"];\n\nconst erasShort = [\"BC\", \"AD\"];\n\nconst erasNarrow = [\"B\", \"A\"];\n\nfunction eras(length) {\n switch (length) {\n case \"narrow\":\n return [...erasNarrow];\n case \"short\":\n return [...erasShort];\n case \"long\":\n return [...erasLong];\n default:\n return null;\n }\n}\n\nfunction meridiemForDateTime(dt) {\n return meridiems[dt.hour < 12 ? 0 : 1];\n}\n\nfunction weekdayForDateTime(dt, length) {\n return weekdays(length)[dt.weekday - 1];\n}\n\nfunction monthForDateTime(dt, length) {\n return months(length)[dt.month - 1];\n}\n\nfunction eraForDateTime(dt, length) {\n return eras(length)[dt.year < 0 ? 0 : 1];\n}\n\nfunction formatRelativeTime(unit, count, numeric = \"always\", narrow = false) {\n const units = {\n years: [\"year\", \"yr.\"],\n quarters: [\"quarter\", \"qtr.\"],\n months: [\"month\", \"mo.\"],\n weeks: [\"week\", \"wk.\"],\n days: [\"day\", \"day\", \"days\"],\n hours: [\"hour\", \"hr.\"],\n minutes: [\"minute\", \"min.\"],\n seconds: [\"second\", \"sec.\"],\n };\n\n const lastable = [\"hours\", \"minutes\", \"seconds\"].indexOf(unit) === -1;\n\n if (numeric === \"auto\" && lastable) {\n const isDay = unit === \"days\";\n switch (count) {\n case 1:\n return isDay ? \"tomorrow\" : `next ${units[unit][0]}`;\n case -1:\n return isDay ? \"yesterday\" : `last ${units[unit][0]}`;\n case 0:\n return isDay ? \"today\" : `this ${units[unit][0]}`;\n }\n }\n\n const isInPast = Object.is(count, -0) || count < 0,\n fmtValue = Math.abs(count),\n singular = fmtValue === 1,\n lilUnits = units[unit],\n fmtUnit = narrow\n ? singular\n ? lilUnits[1]\n : lilUnits[2] || lilUnits[1]\n : singular\n ? units[unit][0]\n : unit;\n return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`;\n}\n\nfunction stringifyTokens(splits, tokenToString) {\n let s = \"\";\n for (const token of splits) {\n if (token.literal) {\n s += token.val;\n } else {\n s += tokenToString(token.val);\n }\n }\n return s;\n}\n\nconst macroTokenToFormatOpts = {\n D: DATE_SHORT,\n DD: DATE_MED,\n DDD: DATE_FULL,\n DDDD: DATE_HUGE,\n t: TIME_SIMPLE,\n tt: TIME_WITH_SECONDS,\n ttt: TIME_WITH_SHORT_OFFSET,\n tttt: TIME_WITH_LONG_OFFSET,\n T: TIME_24_SIMPLE,\n TT: TIME_24_WITH_SECONDS,\n TTT: TIME_24_WITH_SHORT_OFFSET,\n TTTT: TIME_24_WITH_LONG_OFFSET,\n f: DATETIME_SHORT,\n ff: DATETIME_MED,\n fff: DATETIME_FULL,\n ffff: DATETIME_HUGE,\n F: DATETIME_SHORT_WITH_SECONDS,\n FF: DATETIME_MED_WITH_SECONDS,\n FFF: DATETIME_FULL_WITH_SECONDS,\n FFFF: DATETIME_HUGE_WITH_SECONDS,\n};\n\n/**\n * @private\n */\n\nclass Formatter {\n static create(locale, opts = {}) {\n return new Formatter(locale, opts);\n }\n\n static parseFormat(fmt) {\n // white-space is always considered a literal in user-provided formats\n // the \" \" token has a special meaning (see unitForToken)\n\n let current = null,\n currentFull = \"\",\n bracketed = false;\n const splits = [];\n for (let i = 0; i < fmt.length; i++) {\n const c = fmt.charAt(i);\n if (c === \"'\") {\n // turn '' into a literal signal quote instead of just skipping the empty literal\n if (currentFull.length > 0 || bracketed) {\n splits.push({\n literal: bracketed || /^\\s+$/.test(currentFull),\n val: currentFull === \"\" ? \"'\" : currentFull,\n });\n }\n current = null;\n currentFull = \"\";\n bracketed = !bracketed;\n } else if (bracketed) {\n currentFull += c;\n } else if (c === current) {\n currentFull += c;\n } else {\n if (currentFull.length > 0) {\n splits.push({ literal: /^\\s+$/.test(currentFull), val: currentFull });\n }\n currentFull = c;\n current = c;\n }\n }\n\n if (currentFull.length > 0) {\n splits.push({ literal: bracketed || /^\\s+$/.test(currentFull), val: currentFull });\n }\n\n return splits;\n }\n\n static macroTokenToFormatOpts(token) {\n return macroTokenToFormatOpts[token];\n }\n\n constructor(locale, formatOpts) {\n this.opts = formatOpts;\n this.loc = locale;\n this.systemLoc = null;\n }\n\n formatWithSystemDefault(dt, opts) {\n if (this.systemLoc === null) {\n this.systemLoc = this.loc.redefaultToSystem();\n }\n const df = this.systemLoc.dtFormatter(dt, { ...this.opts, ...opts });\n return df.format();\n }\n\n dtFormatter(dt, opts = {}) {\n return this.loc.dtFormatter(dt, { ...this.opts, ...opts });\n }\n\n formatDateTime(dt, opts) {\n return this.dtFormatter(dt, opts).format();\n }\n\n formatDateTimeParts(dt, opts) {\n return this.dtFormatter(dt, opts).formatToParts();\n }\n\n formatInterval(interval, opts) {\n const df = this.dtFormatter(interval.start, opts);\n return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate());\n }\n\n resolvedOptions(dt, opts) {\n return this.dtFormatter(dt, opts).resolvedOptions();\n }\n\n num(n, p = 0, signDisplay = undefined) {\n // we get some perf out of doing this here, annoyingly\n if (this.opts.forceSimple) {\n return padStart(n, p);\n }\n\n const opts = { ...this.opts };\n\n if (p > 0) {\n opts.padTo = p;\n }\n if (signDisplay) {\n opts.signDisplay = signDisplay;\n }\n\n return this.loc.numberFormatter(opts).format(n);\n }\n\n formatDateTimeFromString(dt, fmt) {\n const knownEnglish = this.loc.listingMode() === \"en\",\n useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== \"gregory\",\n string = (opts, extract) => this.loc.extract(dt, opts, extract),\n formatOffset = (opts) => {\n if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) {\n return \"Z\";\n }\n\n return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : \"\";\n },\n meridiem = () =>\n knownEnglish\n ? meridiemForDateTime(dt)\n : string({ hour: \"numeric\", hourCycle: \"h12\" }, \"dayperiod\"),\n month = (length, standalone) =>\n knownEnglish\n ? monthForDateTime(dt, length)\n : string(standalone ? { month: length } : { month: length, day: \"numeric\" }, \"month\"),\n weekday = (length, standalone) =>\n knownEnglish\n ? weekdayForDateTime(dt, length)\n : string(\n standalone ? { weekday: length } : { weekday: length, month: \"long\", day: \"numeric\" },\n \"weekday\"\n ),\n maybeMacro = (token) => {\n const formatOpts = Formatter.macroTokenToFormatOpts(token);\n if (formatOpts) {\n return this.formatWithSystemDefault(dt, formatOpts);\n } else {\n return token;\n }\n },\n era = (length) =>\n knownEnglish ? eraForDateTime(dt, length) : string({ era: length }, \"era\"),\n tokenToString = (token) => {\n // Where possible: https://cldr.unicode.org/translation/date-time/date-time-symbols\n switch (token) {\n // ms\n case \"S\":\n return this.num(dt.millisecond);\n case \"u\":\n // falls through\n case \"SSS\":\n return this.num(dt.millisecond, 3);\n // seconds\n case \"s\":\n return this.num(dt.second);\n case \"ss\":\n return this.num(dt.second, 2);\n // fractional seconds\n case \"uu\":\n return this.num(Math.floor(dt.millisecond / 10), 2);\n case \"uuu\":\n return this.num(Math.floor(dt.millisecond / 100));\n // minutes\n case \"m\":\n return this.num(dt.minute);\n case \"mm\":\n return this.num(dt.minute, 2);\n // hours\n case \"h\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12);\n case \"hh\":\n return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2);\n case \"H\":\n return this.num(dt.hour);\n case \"HH\":\n return this.num(dt.hour, 2);\n // offset\n case \"Z\":\n // like +6\n return formatOffset({ format: \"narrow\", allowZ: this.opts.allowZ });\n case \"ZZ\":\n // like +06:00\n return formatOffset({ format: \"short\", allowZ: this.opts.allowZ });\n case \"ZZZ\":\n // like +0600\n return formatOffset({ format: \"techie\", allowZ: this.opts.allowZ });\n case \"ZZZZ\":\n // like EST\n return dt.zone.offsetName(dt.ts, { format: \"short\", locale: this.loc.locale });\n case \"ZZZZZ\":\n // like Eastern Standard Time\n return dt.zone.offsetName(dt.ts, { format: \"long\", locale: this.loc.locale });\n // zone\n case \"z\":\n // like America/New_York\n return dt.zoneName;\n // meridiems\n case \"a\":\n return meridiem();\n // dates\n case \"d\":\n return useDateTimeFormatter ? string({ day: \"numeric\" }, \"day\") : this.num(dt.day);\n case \"dd\":\n return useDateTimeFormatter ? string({ day: \"2-digit\" }, \"day\") : this.num(dt.day, 2);\n // weekdays - standalone\n case \"c\":\n // like 1\n return this.num(dt.weekday);\n case \"ccc\":\n // like 'Tues'\n return weekday(\"short\", true);\n case \"cccc\":\n // like 'Tuesday'\n return weekday(\"long\", true);\n case \"ccccc\":\n // like 'T'\n return weekday(\"narrow\", true);\n // weekdays - format\n case \"E\":\n // like 1\n return this.num(dt.weekday);\n case \"EEE\":\n // like 'Tues'\n return weekday(\"short\", false);\n case \"EEEE\":\n // like 'Tuesday'\n return weekday(\"long\", false);\n case \"EEEEE\":\n // like 'T'\n return weekday(\"narrow\", false);\n // months - standalone\n case \"L\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\", day: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"LL\":\n // like 01, doesn't seem to work\n return useDateTimeFormatter\n ? string({ month: \"2-digit\", day: \"numeric\" }, \"month\")\n : this.num(dt.month, 2);\n case \"LLL\":\n // like Jan\n return month(\"short\", true);\n case \"LLLL\":\n // like January\n return month(\"long\", true);\n case \"LLLLL\":\n // like J\n return month(\"narrow\", true);\n // months - format\n case \"M\":\n // like 1\n return useDateTimeFormatter\n ? string({ month: \"numeric\" }, \"month\")\n : this.num(dt.month);\n case \"MM\":\n // like 01\n return useDateTimeFormatter\n ? string({ month: \"2-digit\" }, \"month\")\n : this.num(dt.month, 2);\n case \"MMM\":\n // like Jan\n return month(\"short\", false);\n case \"MMMM\":\n // like January\n return month(\"long\", false);\n case \"MMMMM\":\n // like J\n return month(\"narrow\", false);\n // years\n case \"y\":\n // like 2014\n return useDateTimeFormatter ? string({ year: \"numeric\" }, \"year\") : this.num(dt.year);\n case \"yy\":\n // like 14\n return useDateTimeFormatter\n ? string({ year: \"2-digit\" }, \"year\")\n : this.num(dt.year.toString().slice(-2), 2);\n case \"yyyy\":\n // like 0012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 4);\n case \"yyyyyy\":\n // like 000012\n return useDateTimeFormatter\n ? string({ year: \"numeric\" }, \"year\")\n : this.num(dt.year, 6);\n // eras\n case \"G\":\n // like AD\n return era(\"short\");\n case \"GG\":\n // like Anno Domini\n return era(\"long\");\n case \"GGGGG\":\n return era(\"narrow\");\n case \"kk\":\n return this.num(dt.weekYear.toString().slice(-2), 2);\n case \"kkkk\":\n return this.num(dt.weekYear, 4);\n case \"W\":\n return this.num(dt.weekNumber);\n case \"WW\":\n return this.num(dt.weekNumber, 2);\n case \"n\":\n return this.num(dt.localWeekNumber);\n case \"nn\":\n return this.num(dt.localWeekNumber, 2);\n case \"ii\":\n return this.num(dt.localWeekYear.toString().slice(-2), 2);\n case \"iiii\":\n return this.num(dt.localWeekYear, 4);\n case \"o\":\n return this.num(dt.ordinal);\n case \"ooo\":\n return this.num(dt.ordinal, 3);\n case \"q\":\n // like 1\n return this.num(dt.quarter);\n case \"qq\":\n // like 01\n return this.num(dt.quarter, 2);\n case \"X\":\n return this.num(Math.floor(dt.ts / 1000));\n case \"x\":\n return this.num(dt.ts);\n default:\n return maybeMacro(token);\n }\n };\n\n return stringifyTokens(Formatter.parseFormat(fmt), tokenToString);\n }\n\n formatDurationFromString(dur, fmt) {\n const invertLargest = this.opts.signMode === \"negativeLargestOnly\" ? -1 : 1;\n const tokenToField = (token) => {\n switch (token[0]) {\n case \"S\":\n return \"milliseconds\";\n case \"s\":\n return \"seconds\";\n case \"m\":\n return \"minutes\";\n case \"h\":\n return \"hours\";\n case \"d\":\n return \"days\";\n case \"w\":\n return \"weeks\";\n case \"M\":\n return \"months\";\n case \"y\":\n return \"years\";\n default:\n return null;\n }\n },\n tokenToString = (lildur, info) => (token) => {\n const mapped = tokenToField(token);\n if (mapped) {\n const inversionFactor =\n info.isNegativeDuration && mapped !== info.largestUnit ? invertLargest : 1;\n let signDisplay;\n if (this.opts.signMode === \"negativeLargestOnly\" && mapped !== info.largestUnit) {\n signDisplay = \"never\";\n } else if (this.opts.signMode === \"all\") {\n signDisplay = \"always\";\n } else {\n // \"auto\" and \"negative\" are the same, but \"auto\" has better support\n signDisplay = \"auto\";\n }\n return this.num(lildur.get(mapped) * inversionFactor, token.length, signDisplay);\n } else {\n return token;\n }\n },\n tokens = Formatter.parseFormat(fmt),\n realTokens = tokens.reduce(\n (found, { literal, val }) => (literal ? found : found.concat(val)),\n []\n ),\n collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t) => t)),\n durationInfo = {\n isNegativeDuration: collapsed < 0,\n // this relies on \"collapsed\" being based on \"shiftTo\", which builds up the object\n // in order\n largestUnit: Object.keys(collapsed.values)[0],\n };\n return stringifyTokens(tokens, tokenToString(collapsed, durationInfo));\n }\n}\n\n/*\n * This file handles parsing for well-specified formats. Here's how it works:\n * Two things go into parsing: a regex to match with and an extractor to take apart the groups in the match.\n * An extractor is just a function that takes a regex match array and returns a { year: ..., month: ... } object\n * parse() does the work of executing the regex and applying the extractor. It takes multiple regex/extractor pairs to try in sequence.\n * Extractors can take a \"cursor\" representing the offset in the match to look at. This makes it easy to combine extractors.\n * combineExtractors() does the work of combining them, keeping track of the cursor through multiple extractions.\n * Some extractions are super dumb and simpleParse and fromStrings help DRY them.\n */\n\nconst ianaRegex = /[A-Za-z_+-]{1,256}(?::?\\/[A-Za-z0-9_+-]{1,256}(?:\\/[A-Za-z0-9_+-]{1,256})?)?/;\n\nfunction combineRegexes(...regexes) {\n const full = regexes.reduce((f, r) => f + r.source, \"\");\n return RegExp(`^${full}$`);\n}\n\nfunction combineExtractors(...extractors) {\n return (m) =>\n extractors\n .reduce(\n ([mergedVals, mergedZone, cursor], ex) => {\n const [val, zone, next] = ex(m, cursor);\n return [{ ...mergedVals, ...val }, zone || mergedZone, next];\n },\n [{}, null, 1]\n )\n .slice(0, 2);\n}\n\nfunction parse(s, ...patterns) {\n if (s == null) {\n return [null, null];\n }\n\n for (const [regex, extractor] of patterns) {\n const m = regex.exec(s);\n if (m) {\n return extractor(m);\n }\n }\n return [null, null];\n}\n\nfunction simpleParse(...keys) {\n return (match, cursor) => {\n const ret = {};\n let i;\n\n for (i = 0; i < keys.length; i++) {\n ret[keys[i]] = parseInteger(match[cursor + i]);\n }\n return [ret, null, cursor + i];\n };\n}\n\n// ISO and SQL parsing\nconst offsetRegex = /(?:([Zz])|([+-]\\d\\d)(?::?(\\d\\d))?)/;\nconst isoExtendedZone = `(?:${offsetRegex.source}?(?:\\\\[(${ianaRegex.source})\\\\])?)?`;\nconst isoTimeBaseRegex = /(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:[.,](\\d{1,30}))?)?)?/;\nconst isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`);\nconst isoTimeExtensionRegex = RegExp(`(?:[Tt]${isoTimeRegex.source})?`);\nconst isoYmdRegex = /([+-]\\d{6}|\\d{4})(?:-?(\\d\\d)(?:-?(\\d\\d))?)?/;\nconst isoWeekRegex = /(\\d{4})-?W(\\d\\d)(?:-?(\\d))?/;\nconst isoOrdinalRegex = /(\\d{4})-?(\\d{3})/;\nconst extractISOWeekData = simpleParse(\"weekYear\", \"weekNumber\", \"weekDay\");\nconst extractISOOrdinalData = simpleParse(\"year\", \"ordinal\");\nconst sqlYmdRegex = /(\\d{4})-(\\d\\d)-(\\d\\d)/; // dumbed-down version of the ISO one\nconst sqlTimeRegex = RegExp(\n `${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`\n);\nconst sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`);\n\nfunction int(match, pos, fallback) {\n const m = match[pos];\n return isUndefined(m) ? fallback : parseInteger(m);\n}\n\nfunction extractISOYmd(match, cursor) {\n const item = {\n year: int(match, cursor),\n month: int(match, cursor + 1, 1),\n day: int(match, cursor + 2, 1),\n };\n\n return [item, null, cursor + 3];\n}\n\nfunction extractISOTime(match, cursor) {\n const item = {\n hours: int(match, cursor, 0),\n minutes: int(match, cursor + 1, 0),\n seconds: int(match, cursor + 2, 0),\n milliseconds: parseMillis(match[cursor + 3]),\n };\n\n return [item, null, cursor + 4];\n}\n\nfunction extractISOOffset(match, cursor) {\n const local = !match[cursor] && !match[cursor + 1],\n fullOffset = signedOffset(match[cursor + 1], match[cursor + 2]),\n zone = local ? null : FixedOffsetZone.instance(fullOffset);\n return [{}, zone, cursor + 3];\n}\n\nfunction extractIANAZone(match, cursor) {\n const zone = match[cursor] ? IANAZone.create(match[cursor]) : null;\n return [{}, zone, cursor + 1];\n}\n\n// ISO time parsing\n\nconst isoTimeOnly = RegExp(`^T?${isoTimeBaseRegex.source}$`);\n\n// ISO duration parsing\n\nconst isoDuration =\n /^-?P(?:(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)Y)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)W)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)D)?(?:T(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)H)?(?:(-?\\d{1,20}(?:\\.\\d{1,20})?)M)?(?:(-?\\d{1,20})(?:[.,](-?\\d{1,20}))?S)?)?)$/;\n\nfunction extractISODuration(match) {\n const [s, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] =\n match;\n\n const hasNegativePrefix = s[0] === \"-\";\n const negativeSeconds = secondStr && secondStr[0] === \"-\";\n\n const maybeNegate = (num, force = false) =>\n num !== undefined && (force || (num && hasNegativePrefix)) ? -num : num;\n\n return [\n {\n years: maybeNegate(parseFloating(yearStr)),\n months: maybeNegate(parseFloating(monthStr)),\n weeks: maybeNegate(parseFloating(weekStr)),\n days: maybeNegate(parseFloating(dayStr)),\n hours: maybeNegate(parseFloating(hourStr)),\n minutes: maybeNegate(parseFloating(minuteStr)),\n seconds: maybeNegate(parseFloating(secondStr), secondStr === \"-0\"),\n milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds),\n },\n ];\n}\n\n// These are a little braindead. EDT *should* tell us that we're in, say, America/New_York\n// and not just that we're in -240 *right now*. But since I don't think these are used that often\n// I'm just going to ignore that\nconst obsOffsets = {\n GMT: 0,\n EDT: -4 * 60,\n EST: -5 * 60,\n CDT: -5 * 60,\n CST: -6 * 60,\n MDT: -6 * 60,\n MST: -7 * 60,\n PDT: -7 * 60,\n PST: -8 * 60,\n};\n\nfunction fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {\n const result = {\n year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr),\n month: monthsShort.indexOf(monthStr) + 1,\n day: parseInteger(dayStr),\n hour: parseInteger(hourStr),\n minute: parseInteger(minuteStr),\n };\n\n if (secondStr) result.second = parseInteger(secondStr);\n if (weekdayStr) {\n result.weekday =\n weekdayStr.length > 3\n ? weekdaysLong.indexOf(weekdayStr) + 1\n : weekdaysShort.indexOf(weekdayStr) + 1;\n }\n\n return result;\n}\n\n// RFC 2822/5322\nconst rfc2822 =\n /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\\d\\d)(\\d\\d)))$/;\n\nfunction extractRFC2822(match) {\n const [\n ,\n weekdayStr,\n dayStr,\n monthStr,\n yearStr,\n hourStr,\n minuteStr,\n secondStr,\n obsOffset,\n milOffset,\n offHourStr,\n offMinuteStr,\n ] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n\n let offset;\n if (obsOffset) {\n offset = obsOffsets[obsOffset];\n } else if (milOffset) {\n offset = 0;\n } else {\n offset = signedOffset(offHourStr, offMinuteStr);\n }\n\n return [result, new FixedOffsetZone(offset)];\n}\n\nfunction preprocessRFC2822(s) {\n // Remove comments and folding whitespace and replace multiple-spaces with a single space\n return s\n .replace(/\\([^()]*\\)|[\\n\\t]/g, \" \")\n .replace(/(\\s\\s+)/g, \" \")\n .trim();\n}\n\n// http date\n\nconst rfc1123 =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\\d\\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\\d{4}) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n rfc850 =\n /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\\d\\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,\n ascii =\n /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \\d|\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) (\\d{4})$/;\n\nfunction extractRFC1123Or850(match) {\n const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nfunction extractASCII(match) {\n const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match,\n result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);\n return [result, FixedOffsetZone.utcInstance];\n}\n\nconst isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex);\nconst isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex);\nconst isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex);\nconst isoTimeCombinedRegex = combineRegexes(isoTimeRegex);\n\nconst extractISOYmdTimeAndOffset = combineExtractors(\n extractISOYmd,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOWeekTimeAndOffset = combineExtractors(\n extractISOWeekData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOOrdinalDateAndTime = combineExtractors(\n extractISOOrdinalData,\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\nconst extractISOTimeAndOffset = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\n/*\n * @private\n */\n\nfunction parseISODate(s) {\n return parse(\n s,\n [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset],\n [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime],\n [isoTimeCombinedRegex, extractISOTimeAndOffset]\n );\n}\n\nfunction parseRFC2822Date(s) {\n return parse(preprocessRFC2822(s), [rfc2822, extractRFC2822]);\n}\n\nfunction parseHTTPDate(s) {\n return parse(\n s,\n [rfc1123, extractRFC1123Or850],\n [rfc850, extractRFC1123Or850],\n [ascii, extractASCII]\n );\n}\n\nfunction parseISODuration(s) {\n return parse(s, [isoDuration, extractISODuration]);\n}\n\nconst extractISOTimeOnly = combineExtractors(extractISOTime);\n\nfunction parseISOTimeOnly(s) {\n return parse(s, [isoTimeOnly, extractISOTimeOnly]);\n}\n\nconst sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex);\nconst sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex);\n\nconst extractISOTimeOffsetAndIANAZone = combineExtractors(\n extractISOTime,\n extractISOOffset,\n extractIANAZone\n);\n\nfunction parseSQL(s) {\n return parse(\n s,\n [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],\n [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]\n );\n}\n\nconst INVALID$2 = \"Invalid Duration\";\n\n// unit conversion constants\nconst lowOrderMatrix = {\n weeks: {\n days: 7,\n hours: 7 * 24,\n minutes: 7 * 24 * 60,\n seconds: 7 * 24 * 60 * 60,\n milliseconds: 7 * 24 * 60 * 60 * 1000,\n },\n days: {\n hours: 24,\n minutes: 24 * 60,\n seconds: 24 * 60 * 60,\n milliseconds: 24 * 60 * 60 * 1000,\n },\n hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1000 },\n minutes: { seconds: 60, milliseconds: 60 * 1000 },\n seconds: { milliseconds: 1000 },\n },\n casualMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: 52,\n days: 365,\n hours: 365 * 24,\n minutes: 365 * 24 * 60,\n seconds: 365 * 24 * 60 * 60,\n milliseconds: 365 * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: 13,\n days: 91,\n hours: 91 * 24,\n minutes: 91 * 24 * 60,\n seconds: 91 * 24 * 60 * 60,\n milliseconds: 91 * 24 * 60 * 60 * 1000,\n },\n months: {\n weeks: 4,\n days: 30,\n hours: 30 * 24,\n minutes: 30 * 24 * 60,\n seconds: 30 * 24 * 60 * 60,\n milliseconds: 30 * 24 * 60 * 60 * 1000,\n },\n\n ...lowOrderMatrix,\n },\n daysInYearAccurate = 146097.0 / 400,\n daysInMonthAccurate = 146097.0 / 4800,\n accurateMatrix = {\n years: {\n quarters: 4,\n months: 12,\n weeks: daysInYearAccurate / 7,\n days: daysInYearAccurate,\n hours: daysInYearAccurate * 24,\n minutes: daysInYearAccurate * 24 * 60,\n seconds: daysInYearAccurate * 24 * 60 * 60,\n milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1000,\n },\n quarters: {\n months: 3,\n weeks: daysInYearAccurate / 28,\n days: daysInYearAccurate / 4,\n hours: (daysInYearAccurate * 24) / 4,\n minutes: (daysInYearAccurate * 24 * 60) / 4,\n seconds: (daysInYearAccurate * 24 * 60 * 60) / 4,\n milliseconds: (daysInYearAccurate * 24 * 60 * 60 * 1000) / 4,\n },\n months: {\n weeks: daysInMonthAccurate / 7,\n days: daysInMonthAccurate,\n hours: daysInMonthAccurate * 24,\n minutes: daysInMonthAccurate * 24 * 60,\n seconds: daysInMonthAccurate * 24 * 60 * 60,\n milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1000,\n },\n ...lowOrderMatrix,\n };\n\n// units ordered by size\nconst orderedUnits$1 = [\n \"years\",\n \"quarters\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\",\n];\n\nconst reverseUnits = orderedUnits$1.slice(0).reverse();\n\n// clone really means \"create another instance just like this one, but with these changes\"\nfunction clone$1(dur, alts, clear = false) {\n // deep merge for vals\n const conf = {\n values: clear ? alts.values : { ...dur.values, ...(alts.values || {}) },\n loc: dur.loc.clone(alts.loc),\n conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy,\n matrix: alts.matrix || dur.matrix,\n };\n return new Duration(conf);\n}\n\nfunction durationToMillis(matrix, vals) {\n let sum = vals.milliseconds ?? 0;\n for (const unit of reverseUnits.slice(1)) {\n if (vals[unit]) {\n sum += vals[unit] * matrix[unit][\"milliseconds\"];\n }\n }\n return sum;\n}\n\n// NB: mutates parameters\nfunction normalizeValues(matrix, vals) {\n // the logic below assumes the overall value of the duration is positive\n // if this is not the case, factor is used to make it so\n const factor = durationToMillis(matrix, vals) < 0 ? -1 : 1;\n\n orderedUnits$1.reduceRight((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const previousVal = vals[previous] * factor;\n const conv = matrix[current][previous];\n\n // if (previousVal < 0):\n // lower order unit is negative (e.g. { years: 2, days: -2 })\n // normalize this by reducing the higher order unit by the appropriate amount\n // and increasing the lower order unit\n // this can never make the higher order unit negative, because this function only operates\n // on positive durations, so the amount of time represented by the lower order unit cannot\n // be larger than the higher order unit\n // else:\n // lower order unit is positive (e.g. { years: 2, days: 450 } or { years: -2, days: 450 })\n // in this case we attempt to convert as much as possible from the lower order unit into\n // the higher order one\n //\n // Math.floor takes care of both of these cases, rounding away from 0\n // if previousVal < 0 it makes the absolute value larger\n // if previousVal >= it makes the absolute value smaller\n const rollUp = Math.floor(previousVal / conv);\n vals[current] += rollUp * factor;\n vals[previous] -= rollUp * conv * factor;\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n\n // try to convert any decimals into smaller units if possible\n // for example for { years: 2.5, days: 0, seconds: 0 } we want to get { years: 2, days: 182, hours: 12 }\n orderedUnits$1.reduce((previous, current) => {\n if (!isUndefined(vals[current])) {\n if (previous) {\n const fraction = vals[previous] % 1;\n vals[previous] -= fraction;\n vals[current] += fraction * matrix[previous][current];\n }\n return current;\n } else {\n return previous;\n }\n }, null);\n}\n\n// Remove all properties with a value of 0 from an object\nfunction removeZeroes(vals) {\n const newVals = {};\n for (const [key, value] of Object.entries(vals)) {\n if (value !== 0) {\n newVals[key] = value;\n }\n }\n return newVals;\n}\n\n/**\n * A Duration object represents a period of time, like \"2 months\" or \"1 day, 1 hour\". Conceptually, it's just a map of units to their quantities, accompanied by some additional configuration and methods for creating, parsing, interrogating, transforming, and formatting them. They can be used on their own or in conjunction with other Luxon types; for example, you can use {@link DateTime#plus} to add a Duration object to a DateTime, producing another DateTime.\n *\n * Here is a brief overview of commonly used methods and getters in Duration:\n *\n * * **Creation** To create a Duration, use {@link Duration.fromMillis}, {@link Duration.fromObject}, or {@link Duration.fromISO}.\n * * **Unit values** See the {@link Duration#years}, {@link Duration#months}, {@link Duration#weeks}, {@link Duration#days}, {@link Duration#hours}, {@link Duration#minutes}, {@link Duration#seconds}, {@link Duration#milliseconds} accessors.\n * * **Configuration** See {@link Duration#locale} and {@link Duration#numberingSystem} accessors.\n * * **Transformation** To create new Durations out of old ones use {@link Duration#plus}, {@link Duration#minus}, {@link Duration#normalize}, {@link Duration#set}, {@link Duration#reconfigure}, {@link Duration#shiftTo}, and {@link Duration#negate}.\n * * **Output** To convert the Duration into other representations, see {@link Duration#as}, {@link Duration#toISO}, {@link Duration#toFormat}, and {@link Duration#toJSON}\n *\n * There's are more methods documented below. In addition, for more information on subtler topics like internationalization and validity, see the external documentation.\n */\nclass Duration {\n /**\n * @private\n */\n constructor(config) {\n const accurate = config.conversionAccuracy === \"longterm\" || false;\n let matrix = accurate ? accurateMatrix : casualMatrix;\n\n if (config.matrix) {\n matrix = config.matrix;\n }\n\n /**\n * @access private\n */\n this.values = config.values;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.conversionAccuracy = accurate ? \"longterm\" : \"casual\";\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.matrix = matrix;\n /**\n * @access private\n */\n this.isLuxonDuration = true;\n }\n\n /**\n * Create Duration from a number of milliseconds.\n * @param {number} count of milliseconds\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n static fromMillis(count, opts) {\n return Duration.fromObject({ milliseconds: count }, opts);\n }\n\n /**\n * Create a Duration from a JavaScript object with keys like 'years' and 'hours'.\n * If this object is empty then a zero milliseconds duration is returned.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.years\n * @param {number} obj.quarters\n * @param {number} obj.months\n * @param {number} obj.weeks\n * @param {number} obj.days\n * @param {number} obj.hours\n * @param {number} obj.minutes\n * @param {number} obj.seconds\n * @param {number} obj.milliseconds\n * @param {Object} [opts=[]] - options for creating this Duration\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the custom conversion system to use\n * @return {Duration}\n */\n static fromObject(obj, opts = {}) {\n if (obj == null || typeof obj !== \"object\") {\n throw new InvalidArgumentError(\n `Duration.fromObject: argument expected to be an object, got ${\n obj === null ? \"null\" : typeof obj\n }`\n );\n }\n\n return new Duration({\n values: normalizeObject(obj, Duration.normalizeUnit),\n loc: Locale.fromObject(opts),\n conversionAccuracy: opts.conversionAccuracy,\n matrix: opts.matrix,\n });\n }\n\n /**\n * Create a Duration from DurationLike.\n *\n * @param {Object | number | Duration} durationLike\n * One of:\n * - object with keys like 'years' and 'hours'.\n * - number representing milliseconds\n * - Duration instance\n * @return {Duration}\n */\n static fromDurationLike(durationLike) {\n if (isNumber(durationLike)) {\n return Duration.fromMillis(durationLike);\n } else if (Duration.isDuration(durationLike)) {\n return durationLike;\n } else if (typeof durationLike === \"object\") {\n return Duration.fromObject(durationLike);\n } else {\n throw new InvalidArgumentError(\n `Unknown duration argument ${durationLike} of type ${typeof durationLike}`\n );\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 duration string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the preset conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromISO('P3Y6M1W4DT12H30M5S').toObject() //=> { years: 3, months: 6, weeks: 1, days: 4, hours: 12, minutes: 30, seconds: 5 }\n * @example Duration.fromISO('PT23H').toObject() //=> { hours: 23 }\n * @example Duration.fromISO('P5Y3M').toObject() //=> { years: 5, months: 3 }\n * @return {Duration}\n */\n static fromISO(text, opts) {\n const [parsed] = parseISODuration(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create a Duration from an ISO 8601 time string.\n * @param {string} text - text to parse\n * @param {Object} opts - options for parsing\n * @param {string} [opts.locale='en-US'] - the locale to use\n * @param {string} opts.numberingSystem - the numbering system to use\n * @param {string} [opts.conversionAccuracy='casual'] - the preset conversion system to use\n * @param {string} [opts.matrix=Object] - the conversion system to use\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @example Duration.fromISOTime('11:22:33.444').toObject() //=> { hours: 11, minutes: 22, seconds: 33, milliseconds: 444 }\n * @example Duration.fromISOTime('11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T11:00').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @example Duration.fromISOTime('T1100').toObject() //=> { hours: 11, minutes: 0, seconds: 0 }\n * @return {Duration}\n */\n static fromISOTime(text, opts) {\n const [parsed] = parseISOTimeOnly(text);\n if (parsed) {\n return Duration.fromObject(parsed, opts);\n } else {\n return Duration.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n }\n\n /**\n * Create an invalid Duration.\n * @param {string} reason - simple string of why this datetime is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Duration}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Duration is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDurationError(invalid);\n } else {\n return new Duration({ invalid });\n }\n }\n\n /**\n * @private\n */\n static normalizeUnit(unit) {\n const normalized = {\n year: \"years\",\n years: \"years\",\n quarter: \"quarters\",\n quarters: \"quarters\",\n month: \"months\",\n months: \"months\",\n week: \"weeks\",\n weeks: \"weeks\",\n day: \"days\",\n days: \"days\",\n hour: \"hours\",\n hours: \"hours\",\n minute: \"minutes\",\n minutes: \"minutes\",\n second: \"seconds\",\n seconds: \"seconds\",\n millisecond: \"milliseconds\",\n milliseconds: \"milliseconds\",\n }[unit ? unit.toLowerCase() : unit];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n }\n\n /**\n * Check if an object is a Duration. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDuration(o) {\n return (o && o.isLuxonDuration) || false;\n }\n\n /**\n * Get the locale of a Duration, such 'en-GB'\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a Duration, such 'beng'. The numbering system is used when formatting the Duration\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Returns a string representation of this Duration formatted according to the specified format string. You may use these tokens:\n * * `S` for milliseconds\n * * `s` for seconds\n * * `m` for minutes\n * * `h` for hours\n * * `d` for days\n * * `w` for weeks\n * * `M` for months\n * * `y` for years\n * Notes:\n * * Add padding by repeating the token, e.g. \"yy\" pads the years to two digits, \"hhhh\" pads the hours out to four digits\n * * Tokens can be escaped by wrapping with single quotes.\n * * The duration will be converted to the set of units in the format string using {@link Duration#shiftTo} and the Durations's conversion accuracy setting.\n * @param {string} fmt - the format string\n * @param {Object} opts - options\n * @param {boolean} [opts.floor=true] - floor numerical values\n * @param {'negative'|'all'|'negativeLargestOnly'} [opts.signMode=negative] - How to handle signs\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"y d s\") //=> \"1 6 2\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"yy dd sss\") //=> \"01 06 002\"\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toFormat(\"M S\") //=> \"12 518402000\"\n * @example Duration.fromObject({ days: 6, seconds: 2 }).toFormat(\"d s\", { signMode: \"all\" }) //=> \"+6 +2\"\n * @example Duration.fromObject({ days: -6, seconds: -2 }).toFormat(\"d s\", { signMode: \"all\" }) //=> \"-6 -2\"\n * @example Duration.fromObject({ days: -6, seconds: -2 }).toFormat(\"d s\", { signMode: \"negativeLargestOnly\" }) //=> \"-6 2\"\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n // reverse-compat since 1.2; we always round down now, never up, and we do it by default\n const fmtOpts = {\n ...opts,\n floor: opts.round !== false && opts.floor !== false,\n };\n return this.isValid\n ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt)\n : INVALID$2;\n }\n\n /**\n * Returns a string representation of a Duration with all units included.\n * To modify its behavior, use `listStyle` and any Intl.NumberFormat option, though `unitDisplay` is especially relevant.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options\n * @param {Object} opts - Formatting options. Accepts the same keys as the options parameter of the native `Intl.NumberFormat` constructor, as well as `listStyle`.\n * @param {string} [opts.listStyle='narrow'] - How to format the merged list. Corresponds to the `style` property of the options parameter of the native `Intl.ListFormat` constructor.\n * @param {boolean} [opts.showZeros=true] - Show all units previously used by the duration even if they are zero\n * @example\n * ```js\n * var dur = Duration.fromObject({ months: 1, weeks: 0, hours: 5, minutes: 6 })\n * dur.toHuman() //=> '1 month, 0 weeks, 5 hours, 6 minutes'\n * dur.toHuman({ listStyle: \"long\" }) //=> '1 month, 0 weeks, 5 hours, and 6 minutes'\n * dur.toHuman({ unitDisplay: \"short\" }) //=> '1 mth, 0 wks, 5 hr, 6 min'\n * dur.toHuman({ showZeros: false }) //=> '1 month, 5 hours, 6 minutes'\n * ```\n */\n toHuman(opts = {}) {\n if (!this.isValid) return INVALID$2;\n\n const showZeros = opts.showZeros !== false;\n\n const l = orderedUnits$1\n .map((unit) => {\n const val = this.values[unit];\n if (isUndefined(val) || (val === 0 && !showZeros)) {\n return null;\n }\n return this.loc\n .numberFormatter({ style: \"unit\", unitDisplay: \"long\", ...opts, unit: unit.slice(0, -1) })\n .format(val);\n })\n .filter((n) => n);\n\n return this.loc\n .listFormatter({ type: \"conjunction\", style: opts.listStyle || \"narrow\", ...opts })\n .format(l);\n }\n\n /**\n * Returns a JavaScript object with this Duration's values.\n * @example Duration.fromObject({ years: 1, days: 6, seconds: 2 }).toObject() //=> { years: 1, days: 6, seconds: 2 }\n * @return {Object}\n */\n toObject() {\n if (!this.isValid) return {};\n return { ...this.values };\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Durations\n * @example Duration.fromObject({ years: 3, seconds: 45 }).toISO() //=> 'P3YT45S'\n * @example Duration.fromObject({ months: 4, seconds: 45 }).toISO() //=> 'P4MT45S'\n * @example Duration.fromObject({ months: 5 }).toISO() //=> 'P5M'\n * @example Duration.fromObject({ minutes: 5 }).toISO() //=> 'PT5M'\n * @example Duration.fromObject({ milliseconds: 6 }).toISO() //=> 'PT0.006S'\n * @return {string}\n */\n toISO() {\n // we could use the formatter, but this is an easier way to get the minimum string\n if (!this.isValid) return null;\n\n let s = \"P\";\n if (this.years !== 0) s += this.years + \"Y\";\n if (this.months !== 0 || this.quarters !== 0) s += this.months + this.quarters * 3 + \"M\";\n if (this.weeks !== 0) s += this.weeks + \"W\";\n if (this.days !== 0) s += this.days + \"D\";\n if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0)\n s += \"T\";\n if (this.hours !== 0) s += this.hours + \"H\";\n if (this.minutes !== 0) s += this.minutes + \"M\";\n if (this.seconds !== 0 || this.milliseconds !== 0)\n // this will handle \"floating point madness\" by removing extra decimal places\n // https://stackoverflow.com/questions/588004/is-floating-point-math-broken\n s += roundTo(this.seconds + this.milliseconds / 1000, 3) + \"S\";\n if (s === \"P\") s += \"T0S\";\n return s;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day.\n * Note that this will return null if the duration is invalid, negative, or equal to or greater than 24 hours.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Times\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @example Duration.fromObject({ hours: 11 }).toISOTime() //=> '11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressMilliseconds: true }) //=> '11:00:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ suppressSeconds: true }) //=> '11:00'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ includePrefix: true }) //=> 'T11:00:00.000'\n * @example Duration.fromObject({ hours: 11 }).toISOTime({ format: 'basic' }) //=> '110000.000'\n * @return {string}\n */\n toISOTime(opts = {}) {\n if (!this.isValid) return null;\n\n const millis = this.toMillis();\n if (millis < 0 || millis >= 86400000) return null;\n\n opts = {\n suppressMilliseconds: false,\n suppressSeconds: false,\n includePrefix: false,\n format: \"extended\",\n ...opts,\n includeOffset: false,\n };\n\n const dateTime = DateTime.fromMillis(millis, { zone: \"UTC\" });\n return dateTime.toISOTime(opts);\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns an ISO 8601 representation of this Duration appropriate for use in debugging.\n * @return {string}\n */\n toString() {\n return this.toISO();\n }\n\n /**\n * Returns a string representation of this Duration appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Duration { values: ${JSON.stringify(this.values)} }`;\n } else {\n return `Duration { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns an milliseconds value of this Duration.\n * @return {number}\n */\n toMillis() {\n if (!this.isValid) return NaN;\n\n return durationToMillis(this.matrix, this.values);\n }\n\n /**\n * Returns an milliseconds value of this Duration. Alias of {@link toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Make this Duration longer by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n plus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration),\n result = {};\n\n for (const k of orderedUnits$1) {\n if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) {\n result[k] = dur.get(k) + this.get(k);\n }\n }\n\n return clone$1(this, { values: result }, true);\n }\n\n /**\n * Make this Duration shorter by the specified amount. Return a newly-constructed Duration.\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @return {Duration}\n */\n minus(duration) {\n if (!this.isValid) return this;\n\n const dur = Duration.fromDurationLike(duration);\n return this.plus(dur.negate());\n }\n\n /**\n * Scale this Duration by the specified amount. Return a newly-constructed Duration.\n * @param {function} fn - The function to apply to each unit. Arity is 1 or 2: the value of the unit and, optionally, the unit name. Must return a number.\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits(x => x * 2) //=> { hours: 2, minutes: 60 }\n * @example Duration.fromObject({ hours: 1, minutes: 30 }).mapUnits((x, u) => u === \"hours\" ? x * 2 : x) //=> { hours: 2, minutes: 30 }\n * @return {Duration}\n */\n mapUnits(fn) {\n if (!this.isValid) return this;\n const result = {};\n for (const k of Object.keys(this.values)) {\n result[k] = asNumber(fn(this.values[k], k));\n }\n return clone$1(this, { values: result }, true);\n }\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example Duration.fromObject({years: 2, days: 3}).get('years') //=> 2\n * @example Duration.fromObject({years: 2, days: 3}).get('months') //=> 0\n * @example Duration.fromObject({years: 2, days: 3}).get('days') //=> 3\n * @return {number}\n */\n get(unit) {\n return this[Duration.normalizeUnit(unit)];\n }\n\n /**\n * \"Set\" the values of specified units. Return a newly-constructed Duration.\n * @param {Object} values - a mapping of units to numbers\n * @example dur.set({ years: 2017 })\n * @example dur.set({ hours: 8, minutes: 30 })\n * @return {Duration}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const mixed = { ...this.values, ...normalizeObject(values, Duration.normalizeUnit) };\n return clone$1(this, { values: mixed });\n }\n\n /**\n * \"Set\" the locale and/or numberingSystem. Returns a newly-constructed Duration.\n * @example dur.reconfigure({ locale: 'en-GB' })\n * @return {Duration}\n */\n reconfigure({ locale, numberingSystem, conversionAccuracy, matrix } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem });\n const opts = { loc, matrix, conversionAccuracy };\n return clone$1(this, opts);\n }\n\n /**\n * Return the length of the duration in the specified unit.\n * @param {string} unit - a unit such as 'minutes' or 'days'\n * @example Duration.fromObject({years: 1}).as('days') //=> 365\n * @example Duration.fromObject({years: 1}).as('months') //=> 12\n * @example Duration.fromObject({hours: 60}).as('days') //=> 2.5\n * @return {number}\n */\n as(unit) {\n return this.isValid ? this.shiftTo(unit).get(unit) : NaN;\n }\n\n /**\n * Reduce this Duration to its canonical representation in its current units.\n * Assuming the overall value of the Duration is positive, this means:\n * - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example)\n * - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise\n * the overall value would be negative, see third example)\n * - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example)\n *\n * If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`.\n * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 }\n * @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 }\n * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 }\n * @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 }\n * @return {Duration}\n */\n normalize() {\n if (!this.isValid) return this;\n const vals = this.toObject();\n normalizeValues(this.matrix, vals);\n return clone$1(this, { values: vals }, true);\n }\n\n /**\n * Rescale units to its largest representation\n * @example Duration.fromObject({ milliseconds: 90000 }).rescale().toObject() //=> { minutes: 1, seconds: 30 }\n * @return {Duration}\n */\n rescale() {\n if (!this.isValid) return this;\n const vals = removeZeroes(this.normalize().shiftToAll().toObject());\n return clone$1(this, { values: vals }, true);\n }\n\n /**\n * Convert this Duration into its representation in a different set of units.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).shiftTo('minutes', 'milliseconds').toObject() //=> { minutes: 60, milliseconds: 30000 }\n * @return {Duration}\n */\n shiftTo(...units) {\n if (!this.isValid) return this;\n\n if (units.length === 0) {\n return this;\n }\n\n units = units.map((u) => Duration.normalizeUnit(u));\n\n const built = {},\n accumulated = {},\n vals = this.toObject();\n let lastUnit;\n\n for (const k of orderedUnits$1) {\n if (units.indexOf(k) >= 0) {\n lastUnit = k;\n\n let own = 0;\n\n // anything we haven't boiled down yet should get boiled to this unit\n for (const ak in accumulated) {\n own += this.matrix[ak][k] * accumulated[ak];\n accumulated[ak] = 0;\n }\n\n // plus anything that's already in this unit\n if (isNumber(vals[k])) {\n own += vals[k];\n }\n\n // only keep the integer part for now in the hopes of putting any decimal part\n // into a smaller unit later\n const i = Math.trunc(own);\n built[k] = i;\n accumulated[k] = (own * 1000 - i * 1000) / 1000;\n\n // otherwise, keep it in the wings to boil it later\n } else if (isNumber(vals[k])) {\n accumulated[k] = vals[k];\n }\n }\n\n // anything leftover becomes the decimal for the last unit\n // lastUnit must be defined since units is not empty\n for (const key in accumulated) {\n if (accumulated[key] !== 0) {\n built[lastUnit] +=\n key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key];\n }\n }\n\n normalizeValues(this.matrix, built);\n return clone$1(this, { values: built }, true);\n }\n\n /**\n * Shift this Duration to all available units.\n * Same as shiftTo(\"years\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", \"seconds\", \"milliseconds\")\n * @return {Duration}\n */\n shiftToAll() {\n if (!this.isValid) return this;\n return this.shiftTo(\n \"years\",\n \"months\",\n \"weeks\",\n \"days\",\n \"hours\",\n \"minutes\",\n \"seconds\",\n \"milliseconds\"\n );\n }\n\n /**\n * Return the negative of this Duration.\n * @example Duration.fromObject({ hours: 1, seconds: 30 }).negate().toObject() //=> { hours: -1, seconds: -30 }\n * @return {Duration}\n */\n negate() {\n if (!this.isValid) return this;\n const negated = {};\n for (const k of Object.keys(this.values)) {\n negated[k] = this.values[k] === 0 ? 0 : -this.values[k];\n }\n return clone$1(this, { values: negated }, true);\n }\n\n /**\n * Removes all units with values equal to 0 from this Duration.\n * @example Duration.fromObject({ years: 2, days: 0, hours: 0, minutes: 0 }).removeZeros().toObject() //=> { years: 2 }\n * @return {Duration}\n */\n removeZeros() {\n if (!this.isValid) return this;\n const vals = removeZeroes(this.values);\n return clone$1(this, { values: vals }, true);\n }\n\n /**\n * Get the years.\n * @type {number}\n */\n get years() {\n return this.isValid ? this.values.years || 0 : NaN;\n }\n\n /**\n * Get the quarters.\n * @type {number}\n */\n get quarters() {\n return this.isValid ? this.values.quarters || 0 : NaN;\n }\n\n /**\n * Get the months.\n * @type {number}\n */\n get months() {\n return this.isValid ? this.values.months || 0 : NaN;\n }\n\n /**\n * Get the weeks\n * @type {number}\n */\n get weeks() {\n return this.isValid ? this.values.weeks || 0 : NaN;\n }\n\n /**\n * Get the days.\n * @type {number}\n */\n get days() {\n return this.isValid ? this.values.days || 0 : NaN;\n }\n\n /**\n * Get the hours.\n * @type {number}\n */\n get hours() {\n return this.isValid ? this.values.hours || 0 : NaN;\n }\n\n /**\n * Get the minutes.\n * @type {number}\n */\n get minutes() {\n return this.isValid ? this.values.minutes || 0 : NaN;\n }\n\n /**\n * Get the seconds.\n * @return {number}\n */\n get seconds() {\n return this.isValid ? this.values.seconds || 0 : NaN;\n }\n\n /**\n * Get the milliseconds.\n * @return {number}\n */\n get milliseconds() {\n return this.isValid ? this.values.milliseconds || 0 : NaN;\n }\n\n /**\n * Returns whether the Duration is invalid. Invalid durations are returned by diff operations\n * on invalid DateTimes or Intervals.\n * @return {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this Duration became invalid, or null if the Duration is valid\n * @return {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Duration became invalid, or null if the Duration is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Equality check\n * Two Durations are equal iff they have the same units and the same values for each unit.\n * @param {Duration} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n if (!this.loc.equals(other.loc)) {\n return false;\n }\n\n function eq(v1, v2) {\n // Consider 0 and undefined as equal\n if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0;\n return v1 === v2;\n }\n\n for (const u of orderedUnits$1) {\n if (!eq(this.values[u], other.values[u])) {\n return false;\n }\n }\n return true;\n }\n}\n\nconst INVALID$1 = \"Invalid Interval\";\n\n// checks if the start is equal to or before the end\nfunction validateStartEnd(start, end) {\n if (!start || !start.isValid) {\n return Interval.invalid(\"missing or invalid start\");\n } else if (!end || !end.isValid) {\n return Interval.invalid(\"missing or invalid end\");\n } else if (end < start) {\n return Interval.invalid(\n \"end before start\",\n `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`\n );\n } else {\n return null;\n }\n}\n\n/**\n * An Interval object represents a half-open interval of time, where each endpoint is a {@link DateTime}. Conceptually, it's a container for those two endpoints, accompanied by methods for creating, parsing, interrogating, comparing, transforming, and formatting them.\n *\n * Here is a brief overview of the most commonly used methods and getters in Interval:\n *\n * * **Creation** To create an Interval, use {@link Interval.fromDateTimes}, {@link Interval.after}, {@link Interval.before}, or {@link Interval.fromISO}.\n * * **Accessors** Use {@link Interval#start} and {@link Interval#end} to get the start and end.\n * * **Interrogation** To analyze the Interval, use {@link Interval#count}, {@link Interval#length}, {@link Interval#hasSame}, {@link Interval#contains}, {@link Interval#isAfter}, or {@link Interval#isBefore}.\n * * **Transformation** To create other Intervals out of this one, use {@link Interval#set}, {@link Interval#splitAt}, {@link Interval#splitBy}, {@link Interval#divideEqually}, {@link Interval.merge}, {@link Interval.xor}, {@link Interval#union}, {@link Interval#intersection}, or {@link Interval#difference}.\n * * **Comparison** To compare this Interval to another one, use {@link Interval#equals}, {@link Interval#overlaps}, {@link Interval#abutsStart}, {@link Interval#abutsEnd}, {@link Interval#engulfs}\n * * **Output** To convert the Interval into other representations, see {@link Interval#toString}, {@link Interval#toLocaleString}, {@link Interval#toISO}, {@link Interval#toISODate}, {@link Interval#toISOTime}, {@link Interval#toFormat}, and {@link Interval#toDuration}.\n */\nclass Interval {\n /**\n * @private\n */\n constructor(config) {\n /**\n * @access private\n */\n this.s = config.start;\n /**\n * @access private\n */\n this.e = config.end;\n /**\n * @access private\n */\n this.invalid = config.invalid || null;\n /**\n * @access private\n */\n this.isLuxonInterval = true;\n }\n\n /**\n * Create an invalid Interval.\n * @param {string} reason - simple string of why this Interval is invalid. Should not contain parameters or anything else data-dependent\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {Interval}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the Interval is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidIntervalError(invalid);\n } else {\n return new Interval({ invalid });\n }\n }\n\n /**\n * Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end.\n * @param {DateTime|Date|Object} start\n * @param {DateTime|Date|Object} end\n * @return {Interval}\n */\n static fromDateTimes(start, end) {\n const builtStart = friendlyDateTime(start),\n builtEnd = friendlyDateTime(end);\n\n const validateError = validateStartEnd(builtStart, builtEnd);\n\n if (validateError == null) {\n return new Interval({\n start: builtStart,\n end: builtEnd,\n });\n } else {\n return validateError;\n }\n }\n\n /**\n * Create an Interval from a start DateTime and a Duration to extend to.\n * @param {DateTime|Date|Object} start\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static after(start, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(start);\n return Interval.fromDateTimes(dt, dt.plus(dur));\n }\n\n /**\n * Create an Interval from an end DateTime and a Duration to extend backwards to.\n * @param {DateTime|Date|Object} end\n * @param {Duration|Object|number} duration - the length of the Interval.\n * @return {Interval}\n */\n static before(end, duration) {\n const dur = Duration.fromDurationLike(duration),\n dt = friendlyDateTime(end);\n return Interval.fromDateTimes(dt.minus(dur), dt);\n }\n\n /**\n * Create an Interval from an ISO 8601 string.\n * Accepts `<start>/<end>`, `<start>/<duration>`, and `<duration>/<end>` formats.\n * @param {string} text - the ISO string to parse\n * @param {Object} [opts] - options to pass {@link DateTime#fromISO} and optionally {@link Duration#fromISO}\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {Interval}\n */\n static fromISO(text, opts) {\n const [s, e] = (text || \"\").split(\"/\", 2);\n if (s && e) {\n let start, startIsValid;\n try {\n start = DateTime.fromISO(s, opts);\n startIsValid = start.isValid;\n } catch (e) {\n startIsValid = false;\n }\n\n let end, endIsValid;\n try {\n end = DateTime.fromISO(e, opts);\n endIsValid = end.isValid;\n } catch (e) {\n endIsValid = false;\n }\n\n if (startIsValid && endIsValid) {\n return Interval.fromDateTimes(start, end);\n }\n\n if (startIsValid) {\n const dur = Duration.fromISO(e, opts);\n if (dur.isValid) {\n return Interval.after(start, dur);\n }\n } else if (endIsValid) {\n const dur = Duration.fromISO(s, opts);\n if (dur.isValid) {\n return Interval.before(end, dur);\n }\n }\n }\n return Interval.invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ISO 8601`);\n }\n\n /**\n * Check if an object is an Interval. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isInterval(o) {\n return (o && o.isLuxonInterval) || false;\n }\n\n /**\n * Returns the start of the Interval\n * @type {DateTime}\n */\n get start() {\n return this.isValid ? this.s : null;\n }\n\n /**\n * Returns the end of the Interval. This is the first instant which is not part of the interval\n * (Interval is half-open).\n * @type {DateTime}\n */\n get end() {\n return this.isValid ? this.e : null;\n }\n\n /**\n * Returns the last DateTime included in the interval (since end is not part of the interval)\n * @type {DateTime}\n */\n get lastDateTime() {\n return this.isValid ? (this.e ? this.e.minus(1) : null) : null;\n }\n\n /**\n * Returns whether this Interval's end is at least its start, meaning that the Interval isn't 'backwards'.\n * @type {boolean}\n */\n get isValid() {\n return this.invalidReason === null;\n }\n\n /**\n * Returns an error code if this Interval is invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this Interval became invalid, or null if the Interval is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Returns the length of the Interval in the specified unit.\n * @param {string} unit - the unit (such as 'hours' or 'days') to return the length in.\n * @return {number}\n */\n length(unit = \"milliseconds\") {\n return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN;\n }\n\n /**\n * Returns the count of minutes, hours, days, months, or years included in the Interval, even in part.\n * Unlike {@link Interval#length} this counts sections of the calendar, not periods of time, e.g. specifying 'day'\n * asks 'what dates are included in this interval?', not 'how many days long is this interval?'\n * @param {string} [unit='milliseconds'] - the unit of time to count.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; this operation will always use the locale of the start DateTime\n * @return {number}\n */\n count(unit = \"milliseconds\", opts) {\n if (!this.isValid) return NaN;\n const start = this.start.startOf(unit, opts);\n let end;\n if (opts?.useLocaleWeeks) {\n end = this.end.reconfigure({ locale: start.locale });\n } else {\n end = this.end;\n }\n end = end.startOf(unit, opts);\n return Math.floor(end.diff(start, unit).get(unit)) + (end.valueOf() !== this.end.valueOf());\n }\n\n /**\n * Returns whether this Interval's start and end are both in the same unit of time\n * @param {string} unit - the unit of time to check sameness on\n * @return {boolean}\n */\n hasSame(unit) {\n return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;\n }\n\n /**\n * Return whether this Interval has the same start and end DateTimes.\n * @return {boolean}\n */\n isEmpty() {\n return this.s.valueOf() === this.e.valueOf();\n }\n\n /**\n * Return whether this Interval's start is after the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isAfter(dateTime) {\n if (!this.isValid) return false;\n return this.s > dateTime;\n }\n\n /**\n * Return whether this Interval's end is before the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n isBefore(dateTime) {\n if (!this.isValid) return false;\n return this.e <= dateTime;\n }\n\n /**\n * Return whether this Interval contains the specified DateTime.\n * @param {DateTime} dateTime\n * @return {boolean}\n */\n contains(dateTime) {\n if (!this.isValid) return false;\n return this.s <= dateTime && this.e > dateTime;\n }\n\n /**\n * \"Sets\" the start and/or end dates. Returns a newly-constructed Interval.\n * @param {Object} values - the values to set\n * @param {DateTime} values.start - the starting DateTime\n * @param {DateTime} values.end - the ending DateTime\n * @return {Interval}\n */\n set({ start, end } = {}) {\n if (!this.isValid) return this;\n return Interval.fromDateTimes(start || this.s, end || this.e);\n }\n\n /**\n * Split this Interval at each of the specified DateTimes\n * @param {...DateTime} dateTimes - the unit of time to count.\n * @return {Array}\n */\n splitAt(...dateTimes) {\n if (!this.isValid) return [];\n const sorted = dateTimes\n .map(friendlyDateTime)\n .filter((d) => this.contains(d))\n .sort((a, b) => a.toMillis() - b.toMillis()),\n results = [];\n let { s } = this,\n i = 0;\n\n while (s < this.e) {\n const added = sorted[i] || this.e,\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n i += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into smaller Intervals, each of the specified length.\n * Left over time is grouped into a smaller interval\n * @param {Duration|Object|number} duration - The length of each resulting interval.\n * @return {Array}\n */\n splitBy(duration) {\n const dur = Duration.fromDurationLike(duration);\n\n if (!this.isValid || !dur.isValid || dur.as(\"milliseconds\") === 0) {\n return [];\n }\n\n let { s } = this,\n idx = 1,\n next;\n\n const results = [];\n while (s < this.e) {\n const added = this.start.plus(dur.mapUnits((x) => x * idx));\n next = +added > +this.e ? this.e : added;\n results.push(Interval.fromDateTimes(s, next));\n s = next;\n idx += 1;\n }\n\n return results;\n }\n\n /**\n * Split this Interval into the specified number of smaller intervals.\n * @param {number} numberOfParts - The number of Intervals to divide the Interval into.\n * @return {Array}\n */\n divideEqually(numberOfParts) {\n if (!this.isValid) return [];\n return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts);\n }\n\n /**\n * Return whether this Interval overlaps with the specified Interval\n * @param {Interval} other\n * @return {boolean}\n */\n overlaps(other) {\n return this.e > other.s && this.s < other.e;\n }\n\n /**\n * Return whether this Interval's end is adjacent to the specified Interval's start.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsStart(other) {\n if (!this.isValid) return false;\n return +this.e === +other.s;\n }\n\n /**\n * Return whether this Interval's start is adjacent to the specified Interval's end.\n * @param {Interval} other\n * @return {boolean}\n */\n abutsEnd(other) {\n if (!this.isValid) return false;\n return +other.e === +this.s;\n }\n\n /**\n * Returns true if this Interval fully contains the specified Interval, specifically if the intersect (of this Interval and the other Interval) is equal to the other Interval; false otherwise.\n * @param {Interval} other\n * @return {boolean}\n */\n engulfs(other) {\n if (!this.isValid) return false;\n return this.s <= other.s && this.e >= other.e;\n }\n\n /**\n * Return whether this Interval has the same start and end as the specified Interval.\n * @param {Interval} other\n * @return {boolean}\n */\n equals(other) {\n if (!this.isValid || !other.isValid) {\n return false;\n }\n\n return this.s.equals(other.s) && this.e.equals(other.e);\n }\n\n /**\n * Return an Interval representing the intersection of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the maximum start time and the minimum end time of the two Intervals.\n * Returns null if the intersection is empty, meaning, the intervals don't intersect.\n * @param {Interval} other\n * @return {Interval}\n */\n intersection(other) {\n if (!this.isValid) return this;\n const s = this.s > other.s ? this.s : other.s,\n e = this.e < other.e ? this.e : other.e;\n\n if (s >= e) {\n return null;\n } else {\n return Interval.fromDateTimes(s, e);\n }\n }\n\n /**\n * Return an Interval representing the union of this Interval and the specified Interval.\n * Specifically, the resulting Interval has the minimum start time and the maximum end time of the two Intervals.\n * @param {Interval} other\n * @return {Interval}\n */\n union(other) {\n if (!this.isValid) return this;\n const s = this.s < other.s ? this.s : other.s,\n e = this.e > other.e ? this.e : other.e;\n return Interval.fromDateTimes(s, e);\n }\n\n /**\n * Merge an array of Intervals into an equivalent minimal set of Intervals.\n * Combines overlapping and adjacent Intervals.\n * The resulting array will contain the Intervals in ascending order, that is, starting with the earliest Interval\n * and ending with the latest.\n *\n * @param {Array} intervals\n * @return {Array}\n */\n static merge(intervals) {\n const [found, final] = intervals\n .sort((a, b) => a.s - b.s)\n .reduce(\n ([sofar, current], item) => {\n if (!current) {\n return [sofar, item];\n } else if (current.overlaps(item) || current.abutsStart(item)) {\n return [sofar, current.union(item)];\n } else {\n return [sofar.concat([current]), item];\n }\n },\n [[], null]\n );\n if (final) {\n found.push(final);\n }\n return found;\n }\n\n /**\n * Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals.\n * @param {Array} intervals\n * @return {Array}\n */\n static xor(intervals) {\n let start = null,\n currentCount = 0;\n const results = [],\n ends = intervals.map((i) => [\n { time: i.s, type: \"s\" },\n { time: i.e, type: \"e\" },\n ]),\n flattened = Array.prototype.concat(...ends),\n arr = flattened.sort((a, b) => a.time - b.time);\n\n for (const i of arr) {\n currentCount += i.type === \"s\" ? 1 : -1;\n\n if (currentCount === 1) {\n start = i.time;\n } else {\n if (start && +start !== +i.time) {\n results.push(Interval.fromDateTimes(start, i.time));\n }\n\n start = null;\n }\n }\n\n return Interval.merge(results);\n }\n\n /**\n * Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals.\n * @param {...Interval} intervals\n * @return {Array}\n */\n difference(...intervals) {\n return Interval.xor([this].concat(intervals))\n .map((i) => this.intersection(i))\n .filter((i) => i && !i.isEmpty());\n }\n\n /**\n * Returns a string representation of this Interval appropriate for debugging.\n * @return {string}\n */\n toString() {\n if (!this.isValid) return INVALID$1;\n return `[${this.s.toISO()} – ${this.e.toISO()})`;\n }\n\n /**\n * Returns a string representation of this Interval appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`;\n } else {\n return `Interval { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns a localized string representing this Interval. Accepts the same options as the\n * Intl.DateTimeFormat constructor and any presets defined by Luxon, such as\n * {@link DateTime.DATE_FULL} or {@link DateTime.TIME_SIMPLE}. The exact behavior of this method\n * is browser-specific, but in general it will return an appropriate representation of the\n * Interval in the assigned locale. Defaults to the system's locale if no locale has been\n * specified.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {Object} [formatOpts=DateTime.DATE_SHORT] - Either a DateTime preset or\n * Intl.DateTimeFormat constructor options.\n * @param {Object} opts - Options to override the configuration of the start DateTime.\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(); //=> 11/7/2022 – 11/8/2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL); //=> November 7 – 8, 2022\n * @example Interval.fromISO('2022-11-07T09:00Z/2022-11-08T09:00Z').toLocaleString(DateTime.DATE_FULL, { locale: 'fr-FR' }); //=> 7–8 novembre 2022\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString(DateTime.TIME_SIMPLE); //=> 6:00 – 8:00 PM\n * @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p\n * @return {string}\n */\n toLocaleString(formatOpts = DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this)\n : INVALID$1;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this Interval.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISO(opts) {\n if (!this.isValid) return INVALID$1;\n return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of date of this Interval.\n * The time components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @return {string}\n */\n toISODate() {\n if (!this.isValid) return INVALID$1;\n return `${this.s.toISODate()}/${this.e.toISODate()}`;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of time of this Interval.\n * The date components are ignored.\n * @see https://en.wikipedia.org/wiki/ISO_8601#Time_intervals\n * @param {Object} opts - The same options as {@link DateTime#toISO}\n * @return {string}\n */\n toISOTime(opts) {\n if (!this.isValid) return INVALID$1;\n return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this Interval formatted according to the specified format\n * string. **You may not want this.** See {@link Interval#toLocaleString} for a more flexible\n * formatting tool.\n * @param {string} dateFormat - The format string. This string formats the start and end time.\n * See {@link DateTime#toFormat} for details.\n * @param {Object} opts - Options.\n * @param {string} [opts.separator = ' – '] - A separator to place between the start and end\n * representations.\n * @return {string}\n */\n toFormat(dateFormat, { separator = \" – \" } = {}) {\n if (!this.isValid) return INVALID$1;\n return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`;\n }\n\n /**\n * Return a Duration representing the time spanned by this interval.\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example Interval.fromDateTimes(dt1, dt2).toDuration().toObject() //=> { milliseconds: 88489257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('days').toObject() //=> { days: 1.0241812152777778 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes']).toObject() //=> { hours: 24, minutes: 34.82095 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration(['hours', 'minutes', 'seconds']).toObject() //=> { hours: 24, minutes: 34, seconds: 49.257 }\n * @example Interval.fromDateTimes(dt1, dt2).toDuration('seconds').toObject() //=> { seconds: 88489.257 }\n * @return {Duration}\n */\n toDuration(unit, opts) {\n if (!this.isValid) {\n return Duration.invalid(this.invalidReason);\n }\n return this.e.diff(this.s, unit, opts);\n }\n\n /**\n * Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes\n * @param {function} mapFn\n * @return {Interval}\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.toUTC())\n * @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 }))\n */\n mapEndpoints(mapFn) {\n return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e));\n }\n}\n\n/**\n * The Info class contains static methods for retrieving general time and date related data. For example, it has methods for finding out if a time zone has a DST, for listing the months in any supported locale, and for discovering which of Luxon features are available in the current environment.\n */\nclass Info {\n /**\n * Return whether the specified zone contains a DST.\n * @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone.\n * @return {boolean}\n */\n static hasDST(zone = Settings.defaultZone) {\n const proto = DateTime.now().setZone(zone).set({ month: 12 });\n\n return !zone.isUniversal && proto.offset !== proto.set({ month: 6 }).offset;\n }\n\n /**\n * Return whether the specified zone is a valid IANA specifier.\n * @param {string} zone - Zone to check\n * @return {boolean}\n */\n static isValidIANAZone(zone) {\n return IANAZone.isValidZone(zone);\n }\n\n /**\n * Converts the input into a {@link Zone} instance.\n *\n * * If `input` is already a Zone instance, it is returned unchanged.\n * * If `input` is a string containing a valid time zone name, a Zone instance\n * with that name is returned.\n * * If `input` is a string that doesn't refer to a known time zone, a Zone\n * instance with {@link Zone#isValid} == false is returned.\n * * If `input is a number, a Zone instance with the specified fixed offset\n * in minutes is returned.\n * * If `input` is `null` or `undefined`, the default zone is returned.\n * @param {string|Zone|number} [input] - the value to be converted\n * @return {Zone}\n */\n static normalizeZone(input) {\n return normalizeZone(input, Settings.defaultZone);\n }\n\n /**\n * Get the weekday on which the week starts according to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number} the start of the week, 1 for Monday through 7 for Sunday\n */\n static getStartOfWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getStartOfWeek();\n }\n\n /**\n * Get the minimum number of days necessary in a week before it is considered part of the next year according\n * to the given locale.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number}\n */\n static getMinimumDaysInFirstWeek({ locale = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale)).getMinDaysInFirstWeek();\n }\n\n /**\n * Get the weekdays, which are considered the weekend according to the given locale\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @returns {number[]} an array of weekdays, 1 for Monday through 7 for Sunday\n */\n static getWeekendWeekdays({ locale = null, locObj = null } = {}) {\n // copy the array, because we cache it internally\n return (locObj || Locale.create(locale)).getWeekendDays().slice();\n }\n\n /**\n * Return an array of standalone month names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @example Info.months()[0] //=> 'January'\n * @example Info.months('short')[0] //=> 'Jan'\n * @example Info.months('numeric')[0] //=> '1'\n * @example Info.months('short', { locale: 'fr-CA' } )[0] //=> 'janv.'\n * @example Info.months('numeric', { locale: 'ar' })[0] //=> '١'\n * @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I'\n * @return {Array}\n */\n static months(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length);\n }\n\n /**\n * Return an array of format month names.\n * Format months differ from standalone months in that they're meant to appear next to the day of the month. In some languages, that\n * changes the string.\n * See {@link Info#months}\n * @param {string} [length='long'] - the length of the month representation, such as \"numeric\", \"2-digit\", \"narrow\", \"short\", \"long\"\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @param {string} [opts.outputCalendar='gregory'] - the calendar\n * @return {Array}\n */\n static monthsFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null, outputCalendar = \"gregory\" } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true);\n }\n\n /**\n * Return an array of standalone week names.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param {string} [length='long'] - the length of the weekday representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @example Info.weekdays()[0] //=> 'Monday'\n * @example Info.weekdays('short')[0] //=> 'Mon'\n * @example Info.weekdays('short', { locale: 'fr-CA' })[0] //=> 'lun.'\n * @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين'\n * @return {Array}\n */\n static weekdays(length = \"long\", { locale = null, numberingSystem = null, locObj = null } = {}) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length);\n }\n\n /**\n * Return an array of format week names.\n * Format weekdays differ from standalone weekdays in that they're meant to appear next to more date information. In some languages, that\n * changes the string.\n * See {@link Info#weekdays}\n * @param {string} [length='long'] - the length of the month representation, such as \"narrow\", \"short\", \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale=null] - the locale code\n * @param {string} [opts.numberingSystem=null] - the numbering system\n * @param {string} [opts.locObj=null] - an existing locale object to use\n * @return {Array}\n */\n static weekdaysFormat(\n length = \"long\",\n { locale = null, numberingSystem = null, locObj = null } = {}\n ) {\n return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true);\n }\n\n /**\n * Return an array of meridiems.\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.meridiems() //=> [ 'AM', 'PM' ]\n * @example Info.meridiems({ locale: 'my' }) //=> [ 'နံနက်', 'ညနေ' ]\n * @return {Array}\n */\n static meridiems({ locale = null } = {}) {\n return Locale.create(locale).meridiems();\n }\n\n /**\n * Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian.\n * @param {string} [length='short'] - the length of the era representation, such as \"short\" or \"long\".\n * @param {Object} opts - options\n * @param {string} [opts.locale] - the locale code\n * @example Info.eras() //=> [ 'BC', 'AD' ]\n * @example Info.eras('long') //=> [ 'Before Christ', 'Anno Domini' ]\n * @example Info.eras('long', { locale: 'fr' }) //=> [ 'avant Jésus-Christ', 'après Jésus-Christ' ]\n * @return {Array}\n */\n static eras(length = \"short\", { locale = null } = {}) {\n return Locale.create(locale, null, \"gregory\").eras(length);\n }\n\n /**\n * Return the set of available features in this environment.\n * Some features of Luxon are not available in all environments. For example, on older browsers, relative time formatting support is not available. Use this function to figure out if that's the case.\n * Keys:\n * * `relative`: whether this environment supports relative time formatting\n * * `localeWeek`: whether this environment supports different weekdays for the start of the week based on the locale\n * @example Info.features() //=> { relative: false, localeWeek: true }\n * @return {Object}\n */\n static features() {\n return { relative: hasRelative(), localeWeek: hasLocaleWeekInfo() };\n }\n}\n\nfunction dayDiff(earlier, later) {\n const utcDayStart = (dt) => dt.toUTC(0, { keepLocalTime: true }).startOf(\"day\").valueOf(),\n ms = utcDayStart(later) - utcDayStart(earlier);\n return Math.floor(Duration.fromMillis(ms).as(\"days\"));\n}\n\nfunction highOrderDiffs(cursor, later, units) {\n const differs = [\n [\"years\", (a, b) => b.year - a.year],\n [\"quarters\", (a, b) => b.quarter - a.quarter + (b.year - a.year) * 4],\n [\"months\", (a, b) => b.month - a.month + (b.year - a.year) * 12],\n [\n \"weeks\",\n (a, b) => {\n const days = dayDiff(a, b);\n return (days - (days % 7)) / 7;\n },\n ],\n [\"days\", dayDiff],\n ];\n\n const results = {};\n const earlier = cursor;\n let lowestOrder, highWater;\n\n /* This loop tries to diff using larger units first.\n If we overshoot, we backtrack and try the next smaller unit.\n \"cursor\" starts out at the earlier timestamp and moves closer and closer to \"later\"\n as we use smaller and smaller units.\n highWater keeps track of where we would be if we added one more of the smallest unit,\n this is used later to potentially convert any difference smaller than the smallest higher order unit\n into a fraction of that smallest higher order unit\n */\n for (const [unit, differ] of differs) {\n if (units.indexOf(unit) >= 0) {\n lowestOrder = unit;\n\n results[unit] = differ(cursor, later);\n highWater = earlier.plus(results);\n\n if (highWater > later) {\n // we overshot the end point, backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n\n // if we are still overshooting now, we need to backtrack again\n // this happens in certain situations when diffing times in different zones,\n // because this calculation ignores time zones\n if (cursor > later) {\n // keep the \"overshot by 1\" around as highWater\n highWater = cursor;\n // backtrack cursor by 1\n results[unit]--;\n cursor = earlier.plus(results);\n }\n } else {\n cursor = highWater;\n }\n }\n }\n\n return [cursor, results, highWater, lowestOrder];\n}\n\nfunction diff (earlier, later, units, opts) {\n let [cursor, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units);\n\n const remainingMillis = later - cursor;\n\n const lowerOrderUnits = units.filter(\n (u) => [\"hours\", \"minutes\", \"seconds\", \"milliseconds\"].indexOf(u) >= 0\n );\n\n if (lowerOrderUnits.length === 0) {\n if (highWater < later) {\n highWater = cursor.plus({ [lowestOrder]: 1 });\n }\n\n if (highWater !== cursor) {\n results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor);\n }\n }\n\n const duration = Duration.fromObject(results, opts);\n\n if (lowerOrderUnits.length > 0) {\n return Duration.fromMillis(remainingMillis, opts)\n .shiftTo(...lowerOrderUnits)\n .plus(duration);\n } else {\n return duration;\n }\n}\n\nconst MISSING_FTP = \"missing Intl.DateTimeFormat.formatToParts support\";\n\nfunction intUnit(regex, post = (i) => i) {\n return { regex, deser: ([s]) => post(parseDigits(s)) };\n}\n\nconst NBSP = String.fromCharCode(160);\nconst spaceOrNBSP = `[ ${NBSP}]`;\nconst spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, \"g\");\n\nfunction fixListRegex(s) {\n // make dots optional and also make them literal\n // make space and non breakable space characters interchangeable\n return s.replace(/\\./g, \"\\\\.?\").replace(spaceOrNBSPRegExp, spaceOrNBSP);\n}\n\nfunction stripInsensitivities(s) {\n return s\n .replace(/\\./g, \"\") // ignore dots that were made optional\n .replace(spaceOrNBSPRegExp, \" \") // interchange space and nbsp\n .toLowerCase();\n}\n\nfunction oneOf(strings, startIndex) {\n if (strings === null) {\n return null;\n } else {\n return {\n regex: RegExp(strings.map(fixListRegex).join(\"|\")),\n deser: ([s]) =>\n strings.findIndex((i) => stripInsensitivities(s) === stripInsensitivities(i)) + startIndex,\n };\n }\n}\n\nfunction offset(regex, groups) {\n return { regex, deser: ([, h, m]) => signedOffset(h, m), groups };\n}\n\nfunction simple(regex) {\n return { regex, deser: ([s]) => s };\n}\n\nfunction escapeToken(value) {\n return value.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, \"\\\\$&\");\n}\n\n/**\n * @param token\n * @param {Locale} loc\n */\nfunction unitForToken(token, loc) {\n const one = digitRegex(loc),\n two = digitRegex(loc, \"{2}\"),\n three = digitRegex(loc, \"{3}\"),\n four = digitRegex(loc, \"{4}\"),\n six = digitRegex(loc, \"{6}\"),\n oneOrTwo = digitRegex(loc, \"{1,2}\"),\n oneToThree = digitRegex(loc, \"{1,3}\"),\n oneToSix = digitRegex(loc, \"{1,6}\"),\n oneToNine = digitRegex(loc, \"{1,9}\"),\n twoToFour = digitRegex(loc, \"{2,4}\"),\n fourToSix = digitRegex(loc, \"{4,6}\"),\n literal = (t) => ({ regex: RegExp(escapeToken(t.val)), deser: ([s]) => s, literal: true }),\n unitate = (t) => {\n if (token.literal) {\n return literal(t);\n }\n switch (t.val) {\n // era\n case \"G\":\n return oneOf(loc.eras(\"short\"), 0);\n case \"GG\":\n return oneOf(loc.eras(\"long\"), 0);\n // years\n case \"y\":\n return intUnit(oneToSix);\n case \"yy\":\n return intUnit(twoToFour, untruncateYear);\n case \"yyyy\":\n return intUnit(four);\n case \"yyyyy\":\n return intUnit(fourToSix);\n case \"yyyyyy\":\n return intUnit(six);\n // months\n case \"M\":\n return intUnit(oneOrTwo);\n case \"MM\":\n return intUnit(two);\n case \"MMM\":\n return oneOf(loc.months(\"short\", true), 1);\n case \"MMMM\":\n return oneOf(loc.months(\"long\", true), 1);\n case \"L\":\n return intUnit(oneOrTwo);\n case \"LL\":\n return intUnit(two);\n case \"LLL\":\n return oneOf(loc.months(\"short\", false), 1);\n case \"LLLL\":\n return oneOf(loc.months(\"long\", false), 1);\n // dates\n case \"d\":\n return intUnit(oneOrTwo);\n case \"dd\":\n return intUnit(two);\n // ordinals\n case \"o\":\n return intUnit(oneToThree);\n case \"ooo\":\n return intUnit(three);\n // time\n case \"HH\":\n return intUnit(two);\n case \"H\":\n return intUnit(oneOrTwo);\n case \"hh\":\n return intUnit(two);\n case \"h\":\n return intUnit(oneOrTwo);\n case \"mm\":\n return intUnit(two);\n case \"m\":\n return intUnit(oneOrTwo);\n case \"q\":\n return intUnit(oneOrTwo);\n case \"qq\":\n return intUnit(two);\n case \"s\":\n return intUnit(oneOrTwo);\n case \"ss\":\n return intUnit(two);\n case \"S\":\n return intUnit(oneToThree);\n case \"SSS\":\n return intUnit(three);\n case \"u\":\n return simple(oneToNine);\n case \"uu\":\n return simple(oneOrTwo);\n case \"uuu\":\n return intUnit(one);\n // meridiem\n case \"a\":\n return oneOf(loc.meridiems(), 0);\n // weekYear (k)\n case \"kkkk\":\n return intUnit(four);\n case \"kk\":\n return intUnit(twoToFour, untruncateYear);\n // weekNumber (W)\n case \"W\":\n return intUnit(oneOrTwo);\n case \"WW\":\n return intUnit(two);\n // weekdays\n case \"E\":\n case \"c\":\n return intUnit(one);\n case \"EEE\":\n return oneOf(loc.weekdays(\"short\", false), 1);\n case \"EEEE\":\n return oneOf(loc.weekdays(\"long\", false), 1);\n case \"ccc\":\n return oneOf(loc.weekdays(\"short\", true), 1);\n case \"cccc\":\n return oneOf(loc.weekdays(\"long\", true), 1);\n // offset/zone\n case \"Z\":\n case \"ZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2);\n case \"ZZZ\":\n return offset(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2);\n // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing\n // because we don't have any way to figure out what they are\n case \"z\":\n return simple(/[a-z_+-/]{1,256}?/i);\n // this special-case \"token\" represents a place where a macro-token expanded into a white-space literal\n // in this case we accept any non-newline white-space\n case \" \":\n return simple(/[^\\S\\n\\r]/);\n default:\n return literal(t);\n }\n };\n\n const unit = unitate(token) || {\n invalidReason: MISSING_FTP,\n };\n\n unit.token = token;\n\n return unit;\n}\n\nconst partTypeStyleToTokenVal = {\n year: {\n \"2-digit\": \"yy\",\n numeric: \"yyyyy\",\n },\n month: {\n numeric: \"M\",\n \"2-digit\": \"MM\",\n short: \"MMM\",\n long: \"MMMM\",\n },\n day: {\n numeric: \"d\",\n \"2-digit\": \"dd\",\n },\n weekday: {\n short: \"EEE\",\n long: \"EEEE\",\n },\n dayperiod: \"a\",\n dayPeriod: \"a\",\n hour12: {\n numeric: \"h\",\n \"2-digit\": \"hh\",\n },\n hour24: {\n numeric: \"H\",\n \"2-digit\": \"HH\",\n },\n minute: {\n numeric: \"m\",\n \"2-digit\": \"mm\",\n },\n second: {\n numeric: \"s\",\n \"2-digit\": \"ss\",\n },\n timeZoneName: {\n long: \"ZZZZZ\",\n short: \"ZZZ\",\n },\n};\n\nfunction tokenForPart(part, formatOpts, resolvedOpts) {\n const { type, value } = part;\n\n if (type === \"literal\") {\n const isSpace = /^\\s+$/.test(value);\n return {\n literal: !isSpace,\n val: isSpace ? \" \" : value,\n };\n }\n\n const style = formatOpts[type];\n\n // The user might have explicitly specified hour12 or hourCycle\n // if so, respect their decision\n // if not, refer back to the resolvedOpts, which are based on the locale\n let actualType = type;\n if (type === \"hour\") {\n if (formatOpts.hour12 != null) {\n actualType = formatOpts.hour12 ? \"hour12\" : \"hour24\";\n } else if (formatOpts.hourCycle != null) {\n if (formatOpts.hourCycle === \"h11\" || formatOpts.hourCycle === \"h12\") {\n actualType = \"hour12\";\n } else {\n actualType = \"hour24\";\n }\n } else {\n // tokens only differentiate between 24 hours or not,\n // so we do not need to check hourCycle here, which is less supported anyways\n actualType = resolvedOpts.hour12 ? \"hour12\" : \"hour24\";\n }\n }\n let val = partTypeStyleToTokenVal[actualType];\n if (typeof val === \"object\") {\n val = val[style];\n }\n\n if (val) {\n return {\n literal: false,\n val,\n };\n }\n\n return undefined;\n}\n\nfunction buildRegex(units) {\n const re = units.map((u) => u.regex).reduce((f, r) => `${f}(${r.source})`, \"\");\n return [`^${re}$`, units];\n}\n\nfunction match(input, regex, handlers) {\n const matches = input.match(regex);\n\n if (matches) {\n const all = {};\n let matchIndex = 1;\n for (const i in handlers) {\n if (hasOwnProperty(handlers, i)) {\n const h = handlers[i],\n groups = h.groups ? h.groups + 1 : 1;\n if (!h.literal && h.token) {\n all[h.token.val[0]] = h.deser(matches.slice(matchIndex, matchIndex + groups));\n }\n matchIndex += groups;\n }\n }\n return [matches, all];\n } else {\n return [matches, {}];\n }\n}\n\nfunction dateTimeFromMatches(matches) {\n const toField = (token) => {\n switch (token) {\n case \"S\":\n return \"millisecond\";\n case \"s\":\n return \"second\";\n case \"m\":\n return \"minute\";\n case \"h\":\n case \"H\":\n return \"hour\";\n case \"d\":\n return \"day\";\n case \"o\":\n return \"ordinal\";\n case \"L\":\n case \"M\":\n return \"month\";\n case \"y\":\n return \"year\";\n case \"E\":\n case \"c\":\n return \"weekday\";\n case \"W\":\n return \"weekNumber\";\n case \"k\":\n return \"weekYear\";\n case \"q\":\n return \"quarter\";\n default:\n return null;\n }\n };\n\n let zone = null;\n let specificOffset;\n if (!isUndefined(matches.z)) {\n zone = IANAZone.create(matches.z);\n }\n\n if (!isUndefined(matches.Z)) {\n if (!zone) {\n zone = new FixedOffsetZone(matches.Z);\n }\n specificOffset = matches.Z;\n }\n\n if (!isUndefined(matches.q)) {\n matches.M = (matches.q - 1) * 3 + 1;\n }\n\n if (!isUndefined(matches.h)) {\n if (matches.h < 12 && matches.a === 1) {\n matches.h += 12;\n } else if (matches.h === 12 && matches.a === 0) {\n matches.h = 0;\n }\n }\n\n if (matches.G === 0 && matches.y) {\n matches.y = -matches.y;\n }\n\n if (!isUndefined(matches.u)) {\n matches.S = parseMillis(matches.u);\n }\n\n const vals = Object.keys(matches).reduce((r, k) => {\n const f = toField(k);\n if (f) {\n r[f] = matches[k];\n }\n\n return r;\n }, {});\n\n return [vals, zone, specificOffset];\n}\n\nlet dummyDateTimeCache = null;\n\nfunction getDummyDateTime() {\n if (!dummyDateTimeCache) {\n dummyDateTimeCache = DateTime.fromMillis(1555555555555);\n }\n\n return dummyDateTimeCache;\n}\n\nfunction maybeExpandMacroToken(token, locale) {\n if (token.literal) {\n return token;\n }\n\n const formatOpts = Formatter.macroTokenToFormatOpts(token.val);\n const tokens = formatOptsToTokens(formatOpts, locale);\n\n if (tokens == null || tokens.includes(undefined)) {\n return token;\n }\n\n return tokens;\n}\n\nfunction expandMacroTokens(tokens, locale) {\n return Array.prototype.concat(...tokens.map((t) => maybeExpandMacroToken(t, locale)));\n}\n\n/**\n * @private\n */\n\nclass TokenParser {\n constructor(locale, format) {\n this.locale = locale;\n this.format = format;\n this.tokens = expandMacroTokens(Formatter.parseFormat(format), locale);\n this.units = this.tokens.map((t) => unitForToken(t, locale));\n this.disqualifyingUnit = this.units.find((t) => t.invalidReason);\n\n if (!this.disqualifyingUnit) {\n const [regexString, handlers] = buildRegex(this.units);\n this.regex = RegExp(regexString, \"i\");\n this.handlers = handlers;\n }\n }\n\n explainFromTokens(input) {\n if (!this.isValid) {\n return { input, tokens: this.tokens, invalidReason: this.invalidReason };\n } else {\n const [rawMatches, matches] = match(input, this.regex, this.handlers),\n [result, zone, specificOffset] = matches\n ? dateTimeFromMatches(matches)\n : [null, null, undefined];\n if (hasOwnProperty(matches, \"a\") && hasOwnProperty(matches, \"H\")) {\n throw new ConflictingSpecificationError(\n \"Can't include meridiem when specifying 24-hour format\"\n );\n }\n return {\n input,\n tokens: this.tokens,\n regex: this.regex,\n rawMatches,\n matches,\n result,\n zone,\n specificOffset,\n };\n }\n }\n\n get isValid() {\n return !this.disqualifyingUnit;\n }\n\n get invalidReason() {\n return this.disqualifyingUnit ? this.disqualifyingUnit.invalidReason : null;\n }\n}\n\nfunction explainFromTokens(locale, input, format) {\n const parser = new TokenParser(locale, format);\n return parser.explainFromTokens(input);\n}\n\nfunction parseFromTokens(locale, input, format) {\n const { result, zone, specificOffset, invalidReason } = explainFromTokens(locale, input, format);\n return [result, zone, specificOffset, invalidReason];\n}\n\nfunction formatOptsToTokens(formatOpts, locale) {\n if (!formatOpts) {\n return null;\n }\n\n const formatter = Formatter.create(locale, formatOpts);\n const df = formatter.dtFormatter(getDummyDateTime());\n const parts = df.formatToParts();\n const resolvedOpts = df.resolvedOptions();\n return parts.map((p) => tokenForPart(p, formatOpts, resolvedOpts));\n}\n\nconst INVALID = \"Invalid DateTime\";\nconst MAX_DATE = 8.64e15;\n\nfunction unsupportedZone(zone) {\n return new Invalid(\"unsupported zone\", `the zone \"${zone.name}\" is not supported`);\n}\n\n// we cache week data on the DT object and this intermediates the cache\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedWeekData(dt) {\n if (dt.weekData === null) {\n dt.weekData = gregorianToWeek(dt.c);\n }\n return dt.weekData;\n}\n\n/**\n * @param {DateTime} dt\n */\nfunction possiblyCachedLocalWeekData(dt) {\n if (dt.localWeekData === null) {\n dt.localWeekData = gregorianToWeek(\n dt.c,\n dt.loc.getMinDaysInFirstWeek(),\n dt.loc.getStartOfWeek()\n );\n }\n return dt.localWeekData;\n}\n\n// clone really means, \"make a new object with these modifications\". all \"setters\" really use this\n// to create a new object while only changing some of the properties\nfunction clone(inst, alts) {\n const current = {\n ts: inst.ts,\n zone: inst.zone,\n c: inst.c,\n o: inst.o,\n loc: inst.loc,\n invalid: inst.invalid,\n };\n return new DateTime({ ...current, ...alts, old: current });\n}\n\n// find the right offset a given local time. The o input is our guess, which determines which\n// offset we'll pick in ambiguous cases (e.g. there are two 3 AMs b/c Fallback DST)\nfunction fixOffset(localTS, o, tz) {\n // Our UTC time is just a guess because our offset is just a guess\n let utcGuess = localTS - o * 60 * 1000;\n\n // Test whether the zone matches the offset for this ts\n const o2 = tz.offset(utcGuess);\n\n // If so, offset didn't change and we're done\n if (o === o2) {\n return [utcGuess, o];\n }\n\n // If not, change the ts by the difference in the offset\n utcGuess -= (o2 - o) * 60 * 1000;\n\n // If that gives us the local time we want, we're done\n const o3 = tz.offset(utcGuess);\n if (o2 === o3) {\n return [utcGuess, o2];\n }\n\n // If it's different, we're in a hole time. The offset has changed, but the we don't adjust the time\n return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];\n}\n\n// convert an epoch timestamp into a calendar object with the given offset\nfunction tsToObj(ts, offset) {\n ts += offset * 60 * 1000;\n\n const d = new Date(ts);\n\n return {\n year: d.getUTCFullYear(),\n month: d.getUTCMonth() + 1,\n day: d.getUTCDate(),\n hour: d.getUTCHours(),\n minute: d.getUTCMinutes(),\n second: d.getUTCSeconds(),\n millisecond: d.getUTCMilliseconds(),\n };\n}\n\n// convert a calendar object to a epoch timestamp\nfunction objToTS(obj, offset, zone) {\n return fixOffset(objToLocalTS(obj), offset, zone);\n}\n\n// create a new DT instance by adding a duration, adjusting for DSTs\nfunction adjustTime(inst, dur) {\n const oPre = inst.o,\n year = inst.c.year + Math.trunc(dur.years),\n month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3,\n c = {\n ...inst.c,\n year,\n month,\n day:\n Math.min(inst.c.day, daysInMonth(year, month)) +\n Math.trunc(dur.days) +\n Math.trunc(dur.weeks) * 7,\n },\n millisToAdd = Duration.fromObject({\n years: dur.years - Math.trunc(dur.years),\n quarters: dur.quarters - Math.trunc(dur.quarters),\n months: dur.months - Math.trunc(dur.months),\n weeks: dur.weeks - Math.trunc(dur.weeks),\n days: dur.days - Math.trunc(dur.days),\n hours: dur.hours,\n minutes: dur.minutes,\n seconds: dur.seconds,\n milliseconds: dur.milliseconds,\n }).as(\"milliseconds\"),\n localTS = objToLocalTS(c);\n\n let [ts, o] = fixOffset(localTS, oPre, inst.zone);\n\n if (millisToAdd !== 0) {\n ts += millisToAdd;\n // that could have changed the offset by going over a DST, but we want to keep the ts the same\n o = inst.zone.offset(ts);\n }\n\n return { ts, o };\n}\n\n// helper useful in turning the results of parsing into real dates\n// by handling the zone options\nfunction parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) {\n const { setZone, zone } = opts;\n if ((parsed && Object.keys(parsed).length !== 0) || parsedZone) {\n const interpretationZone = parsedZone || zone,\n inst = DateTime.fromObject(parsed, {\n ...opts,\n zone: interpretationZone,\n specificOffset,\n });\n return setZone ? inst : inst.setZone(zone);\n } else {\n return DateTime.invalid(\n new Invalid(\"unparsable\", `the input \"${text}\" can't be parsed as ${format}`)\n );\n }\n}\n\n// if you want to output a technical format (e.g. RFC 2822), this helper\n// helps handle the details\nfunction toTechFormat(dt, format, allowZ = true) {\n return dt.isValid\n ? Formatter.create(Locale.create(\"en-US\"), {\n allowZ,\n forceSimple: true,\n }).formatDateTimeFromString(dt, format)\n : null;\n}\n\nfunction toISODate(o, extended, precision) {\n const longFormat = o.c.year > 9999 || o.c.year < 0;\n let c = \"\";\n if (longFormat && o.c.year >= 0) c += \"+\";\n c += padStart(o.c.year, longFormat ? 6 : 4);\n if (precision === \"year\") return c;\n if (extended) {\n c += \"-\";\n c += padStart(o.c.month);\n if (precision === \"month\") return c;\n c += \"-\";\n } else {\n c += padStart(o.c.month);\n if (precision === \"month\") return c;\n }\n c += padStart(o.c.day);\n return c;\n}\n\nfunction toISOTime(\n o,\n extended,\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone,\n precision\n) {\n let showSeconds = !suppressSeconds || o.c.millisecond !== 0 || o.c.second !== 0,\n c = \"\";\n switch (precision) {\n case \"day\":\n case \"month\":\n case \"year\":\n break;\n default:\n c += padStart(o.c.hour);\n if (precision === \"hour\") break;\n if (extended) {\n c += \":\";\n c += padStart(o.c.minute);\n if (precision === \"minute\") break;\n if (showSeconds) {\n c += \":\";\n c += padStart(o.c.second);\n }\n } else {\n c += padStart(o.c.minute);\n if (precision === \"minute\") break;\n if (showSeconds) {\n c += padStart(o.c.second);\n }\n }\n if (precision === \"second\") break;\n if (showSeconds && (!suppressMilliseconds || o.c.millisecond !== 0)) {\n c += \".\";\n c += padStart(o.c.millisecond, 3);\n }\n }\n\n if (includeOffset) {\n if (o.isOffsetFixed && o.offset === 0 && !extendedZone) {\n c += \"Z\";\n } else if (o.o < 0) {\n c += \"-\";\n c += padStart(Math.trunc(-o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(-o.o % 60));\n } else {\n c += \"+\";\n c += padStart(Math.trunc(o.o / 60));\n c += \":\";\n c += padStart(Math.trunc(o.o % 60));\n }\n }\n\n if (extendedZone) {\n c += \"[\" + o.zone.ianaName + \"]\";\n }\n return c;\n}\n\n// defaults for unspecified units in the supported calendars\nconst defaultUnitValues = {\n month: 1,\n day: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultWeekUnitValues = {\n weekNumber: 1,\n weekday: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n },\n defaultOrdinalUnitValues = {\n ordinal: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n };\n\n// Units in the supported calendars, sorted by bigness\nconst orderedUnits = [\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\", \"millisecond\"],\n orderedWeekUnits = [\n \"weekYear\",\n \"weekNumber\",\n \"weekday\",\n \"hour\",\n \"minute\",\n \"second\",\n \"millisecond\",\n ],\n orderedOrdinalUnits = [\"year\", \"ordinal\", \"hour\", \"minute\", \"second\", \"millisecond\"];\n\n// standardize case and plurality in units\nfunction normalizeUnit(unit) {\n const normalized = {\n year: \"year\",\n years: \"year\",\n month: \"month\",\n months: \"month\",\n day: \"day\",\n days: \"day\",\n hour: \"hour\",\n hours: \"hour\",\n minute: \"minute\",\n minutes: \"minute\",\n quarter: \"quarter\",\n quarters: \"quarter\",\n second: \"second\",\n seconds: \"second\",\n millisecond: \"millisecond\",\n milliseconds: \"millisecond\",\n weekday: \"weekday\",\n weekdays: \"weekday\",\n weeknumber: \"weekNumber\",\n weeksnumber: \"weekNumber\",\n weeknumbers: \"weekNumber\",\n weekyear: \"weekYear\",\n weekyears: \"weekYear\",\n ordinal: \"ordinal\",\n }[unit.toLowerCase()];\n\n if (!normalized) throw new InvalidUnitError(unit);\n\n return normalized;\n}\n\nfunction normalizeUnitWithLocalWeeks(unit) {\n switch (unit.toLowerCase()) {\n case \"localweekday\":\n case \"localweekdays\":\n return \"localWeekday\";\n case \"localweeknumber\":\n case \"localweeknumbers\":\n return \"localWeekNumber\";\n case \"localweekyear\":\n case \"localweekyears\":\n return \"localWeekYear\";\n default:\n return normalizeUnit(unit);\n }\n}\n\n// cache offsets for zones based on the current timestamp when this function is\n// first called. When we are handling a datetime from components like (year,\n// month, day, hour) in a time zone, we need a guess about what the timezone\n// offset is so that we can convert into a UTC timestamp. One way is to find the\n// offset of now in the zone. The actual date may have a different offset (for\n// example, if we handle a date in June while we're in December in a zone that\n// observes DST), but we can check and adjust that.\n//\n// When handling many dates, calculating the offset for now every time is\n// expensive. It's just a guess, so we can cache the offset to use even if we\n// are right on a time change boundary (we'll just correct in the other\n// direction). Using a timestamp from first read is a slight optimization for\n// handling dates close to the current date, since those dates will usually be\n// in the same offset (we could set the timestamp statically, instead). We use a\n// single timestamp for all zones to make things a bit more predictable.\n//\n// This is safe for quickDT (used by local() and utc()) because we don't fill in\n// higher-order units from tsNow (as we do in fromObject, this requires that\n// offset is calculated from tsNow).\n/**\n * @param {Zone} zone\n * @return {number}\n */\nfunction guessOffsetForZone(zone) {\n if (zoneOffsetTs === undefined) {\n zoneOffsetTs = Settings.now();\n }\n\n // Do not cache anything but IANA zones, because it is not safe to do so.\n // Guessing an offset which is not present in the zone can cause wrong results from fixOffset\n if (zone.type !== \"iana\") {\n return zone.offset(zoneOffsetTs);\n }\n const zoneName = zone.name;\n let offsetGuess = zoneOffsetGuessCache.get(zoneName);\n if (offsetGuess === undefined) {\n offsetGuess = zone.offset(zoneOffsetTs);\n zoneOffsetGuessCache.set(zoneName, offsetGuess);\n }\n return offsetGuess;\n}\n\n// this is a dumbed down version of fromObject() that runs about 60% faster\n// but doesn't do any validation, makes a bunch of assumptions about what units\n// are present, and so on.\nfunction quickDT(obj, opts) {\n const zone = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n }\n\n const loc = Locale.fromObject(opts);\n\n let ts, o;\n\n // assume we have the higher-order units\n if (!isUndefined(obj.year)) {\n for (const u of orderedUnits) {\n if (isUndefined(obj[u])) {\n obj[u] = defaultUnitValues[u];\n }\n }\n\n const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj);\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n const offsetProvis = guessOffsetForZone(zone);\n [ts, o] = objToTS(obj, offsetProvis, zone);\n } else {\n ts = Settings.now();\n }\n\n return new DateTime({ ts, zone, loc, o });\n}\n\nfunction diffRelative(start, end, opts) {\n const round = isUndefined(opts.round) ? true : opts.round,\n rounding = isUndefined(opts.rounding) ? \"trunc\" : opts.rounding,\n format = (c, unit) => {\n c = roundTo(c, round || opts.calendary ? 0 : 2, opts.calendary ? \"round\" : rounding);\n const formatter = end.loc.clone(opts).relFormatter(opts);\n return formatter.format(c, unit);\n },\n differ = (unit) => {\n if (opts.calendary) {\n if (!end.hasSame(start, unit)) {\n return end.startOf(unit).diff(start.startOf(unit), unit).get(unit);\n } else return 0;\n } else {\n return end.diff(start, unit).get(unit);\n }\n };\n\n if (opts.unit) {\n return format(differ(opts.unit), opts.unit);\n }\n\n for (const unit of opts.units) {\n const count = differ(unit);\n if (Math.abs(count) >= 1) {\n return format(count, unit);\n }\n }\n return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]);\n}\n\nfunction lastOpts(argList) {\n let opts = {},\n args;\n if (argList.length > 0 && typeof argList[argList.length - 1] === \"object\") {\n opts = argList[argList.length - 1];\n args = Array.from(argList).slice(0, argList.length - 1);\n } else {\n args = Array.from(argList);\n }\n return [opts, args];\n}\n\n/**\n * Timestamp to use for cached zone offset guesses (exposed for test)\n */\nlet zoneOffsetTs;\n/**\n * Cache for zone offset guesses (exposed for test).\n *\n * This optimizes quickDT via guessOffsetForZone to avoid repeated calls of\n * zone.offset().\n */\nconst zoneOffsetGuessCache = new Map();\n\n/**\n * A DateTime is an immutable data structure representing a specific date and time and accompanying methods. It contains class and instance methods for creating, parsing, interrogating, transforming, and formatting them.\n *\n * A DateTime comprises of:\n * * A timestamp. Each DateTime instance refers to a specific millisecond of the Unix epoch.\n * * A time zone. Each instance is considered in the context of a specific zone (by default the local system's zone).\n * * Configuration properties that effect how output strings are formatted, such as `locale`, `numberingSystem`, and `outputCalendar`.\n *\n * Here is a brief overview of the most commonly used functionality it provides:\n *\n * * **Creation**: To create a DateTime from its components, use one of its factory class methods: {@link DateTime.local}, {@link DateTime.utc}, and (most flexibly) {@link DateTime.fromObject}. To create one from a standard string format, use {@link DateTime.fromISO}, {@link DateTime.fromHTTP}, and {@link DateTime.fromRFC2822}. To create one from a custom string format, use {@link DateTime.fromFormat}. To create one from a native JS date, use {@link DateTime.fromJSDate}.\n * * **Gregorian calendar and time**: To examine the Gregorian properties of a DateTime individually (i.e as opposed to collectively through {@link DateTime#toObject}), use the {@link DateTime#year}, {@link DateTime#month},\n * {@link DateTime#day}, {@link DateTime#hour}, {@link DateTime#minute}, {@link DateTime#second}, {@link DateTime#millisecond} accessors.\n * * **Week calendar**: For ISO week calendar attributes, see the {@link DateTime#weekYear}, {@link DateTime#weekNumber}, and {@link DateTime#weekday} accessors.\n * * **Configuration** See the {@link DateTime#locale} and {@link DateTime#numberingSystem} accessors.\n * * **Transformation**: To transform the DateTime into other DateTimes, use {@link DateTime#set}, {@link DateTime#reconfigure}, {@link DateTime#setZone}, {@link DateTime#setLocale}, {@link DateTime.plus}, {@link DateTime#minus}, {@link DateTime#endOf}, {@link DateTime#startOf}, {@link DateTime#toUTC}, and {@link DateTime#toLocal}.\n * * **Output**: To convert the DateTime to other representations, use the {@link DateTime#toRelative}, {@link DateTime#toRelativeCalendar}, {@link DateTime#toJSON}, {@link DateTime#toISO}, {@link DateTime#toHTTP}, {@link DateTime#toObject}, {@link DateTime#toRFC2822}, {@link DateTime#toString}, {@link DateTime#toLocaleString}, {@link DateTime#toFormat}, {@link DateTime#toMillis} and {@link DateTime#toJSDate}.\n *\n * There's plenty others documented below. In addition, for more information on subtler topics like internationalization, time zones, alternative calendars, validity, and so on, see the external documentation.\n */\nclass DateTime {\n /**\n * @access private\n */\n constructor(config) {\n const zone = config.zone || Settings.defaultZone;\n\n let invalid =\n config.invalid ||\n (Number.isNaN(config.ts) ? new Invalid(\"invalid input\") : null) ||\n (!zone.isValid ? unsupportedZone(zone) : null);\n /**\n * @access private\n */\n this.ts = isUndefined(config.ts) ? Settings.now() : config.ts;\n\n let c = null,\n o = null;\n if (!invalid) {\n const unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone);\n\n if (unchanged) {\n [c, o] = [config.old.c, config.old.o];\n } else {\n // If an offset has been passed and we have not been called from\n // clone(), we can trust it and avoid the offset calculation.\n const ot = isNumber(config.o) && !config.old ? config.o : zone.offset(this.ts);\n c = tsToObj(this.ts, ot);\n invalid = Number.isNaN(c.year) ? new Invalid(\"invalid input\") : null;\n c = invalid ? null : c;\n o = invalid ? null : ot;\n }\n }\n\n /**\n * @access private\n */\n this._zone = zone;\n /**\n * @access private\n */\n this.loc = config.loc || Locale.create();\n /**\n * @access private\n */\n this.invalid = invalid;\n /**\n * @access private\n */\n this.weekData = null;\n /**\n * @access private\n */\n this.localWeekData = null;\n /**\n * @access private\n */\n this.c = c;\n /**\n * @access private\n */\n this.o = o;\n /**\n * @access private\n */\n this.isLuxonDateTime = true;\n }\n\n // CONSTRUCT\n\n /**\n * Create a DateTime for the current instant, in the system's time zone.\n *\n * Use Settings to override these default values if needed.\n * @example DateTime.now().toISO() //~> now in the ISO format\n * @return {DateTime}\n */\n static now() {\n return new DateTime({});\n }\n\n /**\n * Create a local DateTime\n * @param {number} [year] - The calendar year. If omitted (as in, call `local()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month, 1-indexed\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @example DateTime.local() //~> now\n * @example DateTime.local({ zone: \"America/New_York\" }) //~> now, in US east coast time\n * @example DateTime.local(2017) //~> 2017-01-01T00:00:00\n * @example DateTime.local(2017, 3) //~> 2017-03-01T00:00:00\n * @example DateTime.local(2017, 3, 12, { locale: \"fr\" }) //~> 2017-03-12T00:00:00, with a French locale\n * @example DateTime.local(2017, 3, 12, 5) //~> 2017-03-12T05:00:00\n * @example DateTime.local(2017, 3, 12, 5, { zone: \"utc\" }) //~> 2017-03-12T05:00:00, in UTC\n * @example DateTime.local(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00\n * @example DateTime.local(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10\n * @example DateTime.local(2017, 3, 12, 5, 45, 10, 765) //~> 2017-03-12T05:45:10.765\n * @return {DateTime}\n */\n static local() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime in UTC\n * @param {number} [year] - The calendar year. If omitted (as in, call `utc()` with no arguments), the current time will be used\n * @param {number} [month=1] - The month, 1-indexed\n * @param {number} [day=1] - The day of the month\n * @param {number} [hour=0] - The hour of the day, in 24-hour time\n * @param {number} [minute=0] - The minute of the hour, meaning a number between 0 and 59\n * @param {number} [second=0] - The second of the minute, meaning a number between 0 and 59\n * @param {number} [millisecond=0] - The millisecond of the second, meaning a number between 0 and 999\n * @param {Object} options - configuration options for the DateTime\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} [options.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [options.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @param {string} [options.weekSettings] - the week settings to set on the resulting DateTime instance\n * @example DateTime.utc() //~> now\n * @example DateTime.utc(2017) //~> 2017-01-01T00:00:00Z\n * @example DateTime.utc(2017, 3) //~> 2017-03-01T00:00:00Z\n * @example DateTime.utc(2017, 3, 12) //~> 2017-03-12T00:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5) //~> 2017-03-12T05:00:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45) //~> 2017-03-12T05:45:00Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, { locale: \"fr\" }) //~> 2017-03-12T05:45:00Z with a French locale\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10) //~> 2017-03-12T05:45:10Z\n * @example DateTime.utc(2017, 3, 12, 5, 45, 10, 765, { locale: \"fr\" }) //~> 2017-03-12T05:45:10.765Z with a French locale\n * @return {DateTime}\n */\n static utc() {\n const [opts, args] = lastOpts(arguments),\n [year, month, day, hour, minute, second, millisecond] = args;\n\n opts.zone = FixedOffsetZone.utcInstance;\n return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);\n }\n\n /**\n * Create a DateTime from a JavaScript Date object. Uses the default zone.\n * @param {Date} date - a JavaScript Date object\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @return {DateTime}\n */\n static fromJSDate(date, options = {}) {\n const ts = isDate(date) ? date.valueOf() : NaN;\n if (Number.isNaN(ts)) {\n return DateTime.invalid(\"invalid input\");\n }\n\n const zoneToUse = normalizeZone(options.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n return new DateTime({\n ts: ts,\n zone: zoneToUse,\n loc: Locale.fromObject(options),\n });\n }\n\n /**\n * Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} milliseconds - a number of milliseconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} options.weekSettings - the week settings to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromMillis(milliseconds, options = {}) {\n if (!isNumber(milliseconds)) {\n throw new InvalidArgumentError(\n `fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`\n );\n } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) {\n // this isn't perfect because we can still end up out of range because of additional shifting, but it's a start\n return DateTime.invalid(\"Timestamp out of range\");\n } else {\n return new DateTime({\n ts: milliseconds,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a number of seconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.\n * @param {number} seconds - a number of seconds since 1970 UTC\n * @param {Object} options - configuration options for the DateTime\n * @param {string|Zone} [options.zone='local'] - the zone to place the DateTime into\n * @param {string} [options.locale] - a locale to set on the resulting DateTime instance\n * @param {string} options.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} options.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} options.weekSettings - the week settings to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromSeconds(seconds, options = {}) {\n if (!isNumber(seconds)) {\n throw new InvalidArgumentError(\"fromSeconds requires a numerical input\");\n } else {\n return new DateTime({\n ts: seconds * 1000,\n zone: normalizeZone(options.zone, Settings.defaultZone),\n loc: Locale.fromObject(options),\n });\n }\n }\n\n /**\n * Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.\n * @param {Object} obj - the object to create the DateTime from\n * @param {number} obj.year - a year, such as 1987\n * @param {number} obj.month - a month, 1-12\n * @param {number} obj.day - a day of the month, 1-31, depending on the month\n * @param {number} obj.ordinal - day of the year, 1-365 or 366\n * @param {number} obj.weekYear - an ISO week year\n * @param {number} obj.weekNumber - an ISO week number, between 1 and 52 or 53, depending on the year\n * @param {number} obj.weekday - an ISO weekday, 1-7, where 1 is Monday and 7 is Sunday\n * @param {number} obj.localWeekYear - a week year, according to the locale\n * @param {number} obj.localWeekNumber - a week number, between 1 and 52 or 53, depending on the year, according to the locale\n * @param {number} obj.localWeekday - a weekday, 1-7, where 1 is the first and 7 is the last day of the week, according to the locale\n * @param {number} obj.hour - hour of the day, 0-23\n * @param {number} obj.minute - minute of the hour, 0-59\n * @param {number} obj.second - second of the minute, 0-59\n * @param {number} obj.millisecond - millisecond of the second, 0-999\n * @param {Object} opts - options for creating this DateTime\n * @param {string|Zone} [opts.zone='local'] - interpret the numbers in the context of a particular zone. Can take any value taken as the first argument to setZone()\n * @param {string} [opts.locale='system\\'s locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromObject({ year: 1982, month: 5, day: 25}).toISODate() //=> '1982-05-25'\n * @example DateTime.fromObject({ year: 1982 }).toISODate() //=> '1982-01-01'\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }) //~> today at 10:26:06\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'utc' }),\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'local' })\n * @example DateTime.fromObject({ hour: 10, minute: 26, second: 6 }, { zone: 'America/New_York' })\n * @example DateTime.fromObject({ weekYear: 2016, weekNumber: 2, weekday: 3 }).toISODate() //=> '2016-01-13'\n * @example DateTime.fromObject({ localWeekYear: 2022, localWeekNumber: 1, localWeekday: 1 }, { locale: \"en-US\" }).toISODate() //=> '2021-12-26'\n * @return {DateTime}\n */\n static fromObject(obj, opts = {}) {\n obj = obj || {};\n const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone);\n if (!zoneToUse.isValid) {\n return DateTime.invalid(unsupportedZone(zoneToUse));\n }\n\n const loc = Locale.fromObject(opts);\n const normalized = normalizeObject(obj, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, loc);\n\n const tsNow = Settings.now(),\n offsetProvis = !isUndefined(opts.specificOffset)\n ? opts.specificOffset\n : zoneToUse.offset(tsNow),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n // cases:\n // just a weekday -> this week's instance of that weekday, no worries\n // (gregorian data or ordinal) + (weekYear or weekNumber) -> error\n // (gregorian month or day) + ordinal -> error\n // otherwise just use weeks or ordinals or gregorian, depending on what's specified\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n const useWeekData = definiteWeekDef || (normalized.weekday && !containsGregor);\n\n // configure ourselves to deal with gregorian dates or week stuff\n let units,\n defaultValues,\n objNow = tsToObj(tsNow, offsetProvis);\n if (useWeekData) {\n units = orderedWeekUnits;\n defaultValues = defaultWeekUnitValues;\n objNow = gregorianToWeek(objNow, minDaysInFirstWeek, startOfWeek);\n } else if (containsOrdinal) {\n units = orderedOrdinalUnits;\n defaultValues = defaultOrdinalUnitValues;\n objNow = gregorianToOrdinal(objNow);\n } else {\n units = orderedUnits;\n defaultValues = defaultUnitValues;\n }\n\n // set default values for missing stuff\n let foundFirst = false;\n for (const u of units) {\n const v = normalized[u];\n if (!isUndefined(v)) {\n foundFirst = true;\n } else if (foundFirst) {\n normalized[u] = defaultValues[u];\n } else {\n normalized[u] = objNow[u];\n }\n }\n\n // make sure the values we have are in range\n const higherOrderInvalid = useWeekData\n ? hasInvalidWeekData(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? hasInvalidOrdinalData(normalized)\n : hasInvalidGregorianData(normalized),\n invalid = higherOrderInvalid || hasInvalidTimeData(normalized);\n\n if (invalid) {\n return DateTime.invalid(invalid);\n }\n\n // compute the actual time\n const gregorian = useWeekData\n ? weekToGregorian(normalized, minDaysInFirstWeek, startOfWeek)\n : containsOrdinal\n ? ordinalToGregorian(normalized)\n : normalized,\n [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse),\n inst = new DateTime({\n ts: tsFinal,\n zone: zoneToUse,\n o: offsetFinal,\n loc,\n });\n\n // gregorian data + weekday serves only to validate\n if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) {\n return DateTime.invalid(\n \"mismatched weekday\",\n `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`\n );\n }\n\n if (!inst.isValid) {\n return DateTime.invalid(inst.invalid);\n }\n\n return inst;\n }\n\n /**\n * Create a DateTime from an ISO 8601 string\n * @param {string} text - the ISO string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the time to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} [opts.outputCalendar] - the output calendar to set on the resulting DateTime instance\n * @param {string} [opts.numberingSystem] - the numbering system to set on the resulting DateTime instance\n * @param {string} [opts.weekSettings] - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromISO('2016-05-25T09:08:34.123')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00')\n * @example DateTime.fromISO('2016-05-25T09:08:34.123+06:00', {setZone: true})\n * @example DateTime.fromISO('2016-05-25T09:08:34.123', {zone: 'utc'})\n * @example DateTime.fromISO('2016-W05-4')\n * @return {DateTime}\n */\n static fromISO(text, opts = {}) {\n const [vals, parsedZone] = parseISODate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"ISO 8601\", text);\n }\n\n /**\n * Create a DateTime from an RFC 2822 string\n * @param {string} text - the RFC 2822 string\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since the offset is always specified in the string itself, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with a fixed-offset zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23:12 GMT')\n * @example DateTime.fromRFC2822('Fri, 25 Nov 2016 13:23:12 +0600')\n * @example DateTime.fromRFC2822('25 Nov 2016 13:23 Z')\n * @return {DateTime}\n */\n static fromRFC2822(text, opts = {}) {\n const [vals, parsedZone] = parseRFC2822Date(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"RFC 2822\", text);\n }\n\n /**\n * Create a DateTime from an HTTP header date\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @param {string} text - the HTTP header date\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - convert the time to this zone. Since HTTP dates are always in UTC, this has no effect on the interpretation of string, merely the zone the resulting DateTime is expressed in.\n * @param {boolean} [opts.setZone=false] - override the zone with the fixed-offset zone specified in the string. For HTTP dates, this is always UTC, so this option is equivalent to setting the `zone` option to 'utc', but this option is included for consistency with similar methods.\n * @param {string} [opts.locale='system's locale'] - a locale to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @param {string} opts.numberingSystem - the numbering system to set on the resulting DateTime instance\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @example DateTime.fromHTTP('Sun, 06 Nov 1994 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sunday, 06-Nov-94 08:49:37 GMT')\n * @example DateTime.fromHTTP('Sun Nov 6 08:49:37 1994')\n * @return {DateTime}\n */\n static fromHTTP(text, opts = {}) {\n const [vals, parsedZone] = parseHTTPDate(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"HTTP\", opts);\n }\n\n /**\n * Create a DateTime from an input string and format string.\n * Defaults to en-US if no locale has been specified, regardless of the system's locale. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/parsing?id=table-of-tokens).\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see the link below for the formats)\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @return {DateTime}\n */\n static fromFormat(text, fmt, opts = {}) {\n if (isUndefined(text) || isUndefined(fmt)) {\n throw new InvalidArgumentError(\"fromFormat requires an input string and a format\");\n }\n\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n }),\n [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text, fmt);\n if (invalid) {\n return DateTime.invalid(invalid);\n } else {\n return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text, specificOffset);\n }\n }\n\n /**\n * @deprecated use fromFormat instead\n */\n static fromString(text, fmt, opts = {}) {\n return DateTime.fromFormat(text, fmt, opts);\n }\n\n /**\n * Create a DateTime from a SQL date, time, or datetime\n * Defaults to en-US if no locale has been specified, regardless of the system's locale\n * @param {string} text - the string to parse\n * @param {Object} opts - options to affect the creation\n * @param {string|Zone} [opts.zone='local'] - use this zone if no offset is specified in the input string itself. Will also convert the DateTime to this zone\n * @param {boolean} [opts.setZone=false] - override the zone with a zone specified in the string itself, if it specifies one\n * @param {string} [opts.locale='en-US'] - a locale string to use when parsing. Will also set the DateTime to this locale\n * @param {string} opts.numberingSystem - the numbering system to use when parsing. Will also set the resulting DateTime to this numbering system\n * @param {string} opts.weekSettings - the week settings to set on the resulting DateTime instance\n * @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance\n * @example DateTime.fromSQL('2017-05-15')\n * @example DateTime.fromSQL('2017-05-15 09:12:34')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342+06:00')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles')\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342 America/Los_Angeles', { setZone: true })\n * @example DateTime.fromSQL('2017-05-15 09:12:34.342', { zone: 'America/Los_Angeles' })\n * @example DateTime.fromSQL('09:12:34.342')\n * @return {DateTime}\n */\n static fromSQL(text, opts = {}) {\n const [vals, parsedZone] = parseSQL(text);\n return parseDataToDateTime(vals, parsedZone, opts, \"SQL\", text);\n }\n\n /**\n * Create an invalid DateTime.\n * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent.\n * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information\n * @return {DateTime}\n */\n static invalid(reason, explanation = null) {\n if (!reason) {\n throw new InvalidArgumentError(\"need to specify a reason the DateTime is invalid\");\n }\n\n const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);\n\n if (Settings.throwOnInvalid) {\n throw new InvalidDateTimeError(invalid);\n } else {\n return new DateTime({ invalid });\n }\n }\n\n /**\n * Check if an object is an instance of DateTime. Works across context boundaries\n * @param {object} o\n * @return {boolean}\n */\n static isDateTime(o) {\n return (o && o.isLuxonDateTime) || false;\n }\n\n /**\n * Produce the format string for a set of options\n * @param formatOpts\n * @param localeOpts\n * @returns {string}\n */\n static parseFormatForOpts(formatOpts, localeOpts = {}) {\n const tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts));\n return !tokenList ? null : tokenList.map((t) => (t ? t.val : null)).join(\"\");\n }\n\n /**\n * Produce the the fully expanded format token for the locale\n * Does NOT quote characters, so quoted tokens will not round trip correctly\n * @param fmt\n * @param localeOpts\n * @returns {string}\n */\n static expandFormat(fmt, localeOpts = {}) {\n const expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts));\n return expanded.map((t) => t.val).join(\"\");\n }\n\n static resetCache() {\n zoneOffsetTs = undefined;\n zoneOffsetGuessCache.clear();\n }\n\n // INFO\n\n /**\n * Get the value of unit.\n * @param {string} unit - a unit such as 'minute' or 'day'\n * @example DateTime.local(2017, 7, 4).get('month'); //=> 7\n * @example DateTime.local(2017, 7, 4).get('day'); //=> 4\n * @return {number}\n */\n get(unit) {\n return this[unit];\n }\n\n /**\n * Returns whether the DateTime is valid. Invalid DateTimes occur when:\n * * The DateTime was created from invalid calendar information, such as the 13th month or February 30\n * * The DateTime was created by an operation on another invalid date\n * @type {boolean}\n */\n get isValid() {\n return this.invalid === null;\n }\n\n /**\n * Returns an error code if this DateTime is invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidReason() {\n return this.invalid ? this.invalid.reason : null;\n }\n\n /**\n * Returns an explanation of why this DateTime became invalid, or null if the DateTime is valid\n * @type {string}\n */\n get invalidExplanation() {\n return this.invalid ? this.invalid.explanation : null;\n }\n\n /**\n * Get the locale of a DateTime, such 'en-GB'. The locale is used when formatting the DateTime\n *\n * @type {string}\n */\n get locale() {\n return this.isValid ? this.loc.locale : null;\n }\n\n /**\n * Get the numbering system of a DateTime, such 'beng'. The numbering system is used when formatting the DateTime\n *\n * @type {string}\n */\n get numberingSystem() {\n return this.isValid ? this.loc.numberingSystem : null;\n }\n\n /**\n * Get the output calendar of a DateTime, such 'islamic'. The output calendar is used when formatting the DateTime\n *\n * @type {string}\n */\n get outputCalendar() {\n return this.isValid ? this.loc.outputCalendar : null;\n }\n\n /**\n * Get the time zone associated with this DateTime.\n * @type {Zone}\n */\n get zone() {\n return this._zone;\n }\n\n /**\n * Get the name of the time zone.\n * @type {string}\n */\n get zoneName() {\n return this.isValid ? this.zone.name : null;\n }\n\n /**\n * Get the year\n * @example DateTime.local(2017, 5, 25).year //=> 2017\n * @type {number}\n */\n get year() {\n return this.isValid ? this.c.year : NaN;\n }\n\n /**\n * Get the quarter\n * @example DateTime.local(2017, 5, 25).quarter //=> 2\n * @type {number}\n */\n get quarter() {\n return this.isValid ? Math.ceil(this.c.month / 3) : NaN;\n }\n\n /**\n * Get the month (1-12).\n * @example DateTime.local(2017, 5, 25).month //=> 5\n * @type {number}\n */\n get month() {\n return this.isValid ? this.c.month : NaN;\n }\n\n /**\n * Get the day of the month (1-30ish).\n * @example DateTime.local(2017, 5, 25).day //=> 25\n * @type {number}\n */\n get day() {\n return this.isValid ? this.c.day : NaN;\n }\n\n /**\n * Get the hour of the day (0-23).\n * @example DateTime.local(2017, 5, 25, 9).hour //=> 9\n * @type {number}\n */\n get hour() {\n return this.isValid ? this.c.hour : NaN;\n }\n\n /**\n * Get the minute of the hour (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30).minute //=> 30\n * @type {number}\n */\n get minute() {\n return this.isValid ? this.c.minute : NaN;\n }\n\n /**\n * Get the second of the minute (0-59).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52).second //=> 52\n * @type {number}\n */\n get second() {\n return this.isValid ? this.c.second : NaN;\n }\n\n /**\n * Get the millisecond of the second (0-999).\n * @example DateTime.local(2017, 5, 25, 9, 30, 52, 654).millisecond //=> 654\n * @type {number}\n */\n get millisecond() {\n return this.isValid ? this.c.millisecond : NaN;\n }\n\n /**\n * Get the week year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 12, 31).weekYear //=> 2015\n * @type {number}\n */\n get weekYear() {\n return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the week number of the week year (1-52ish).\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2017, 5, 25).weekNumber //=> 21\n * @type {number}\n */\n get weekNumber() {\n return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the day of the week.\n * 1 is Monday and 7 is Sunday\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2014, 11, 31).weekday //=> 4\n * @type {number}\n */\n get weekday() {\n return this.isValid ? possiblyCachedWeekData(this).weekday : NaN;\n }\n\n /**\n * Returns true if this date is on a weekend according to the locale, false otherwise\n * @returns {boolean}\n */\n get isWeekend() {\n return this.isValid && this.loc.getWeekendDays().includes(this.weekday);\n }\n\n /**\n * Get the day of the week according to the locale.\n * 1 is the first day of the week and 7 is the last day of the week.\n * If the locale assigns Sunday as the first day of the week, then a date which is a Sunday will return 1,\n * @returns {number}\n */\n get localWeekday() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekday : NaN;\n }\n\n /**\n * Get the week number of the week year according to the locale. Different locales assign week numbers differently,\n * because the week can start on different days of the week (see localWeekday) and because a different number of days\n * is required for a week to count as the first week of a year.\n * @returns {number}\n */\n get localWeekNumber() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekNumber : NaN;\n }\n\n /**\n * Get the week year according to the locale. Different locales assign week numbers (and therefor week years)\n * differently, see localWeekNumber.\n * @returns {number}\n */\n get localWeekYear() {\n return this.isValid ? possiblyCachedLocalWeekData(this).weekYear : NaN;\n }\n\n /**\n * Get the ordinal (meaning the day of the year)\n * @example DateTime.local(2017, 5, 25).ordinal //=> 145\n * @type {number|DateTime}\n */\n get ordinal() {\n return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN;\n }\n\n /**\n * Get the human readable short month name, such as 'Oct'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthShort //=> Oct\n * @type {string}\n */\n get monthShort() {\n return this.isValid ? Info.months(\"short\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable long month name, such as 'October'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).monthLong //=> October\n * @type {string}\n */\n get monthLong() {\n return this.isValid ? Info.months(\"long\", { locObj: this.loc })[this.month - 1] : null;\n }\n\n /**\n * Get the human readable short weekday, such as 'Mon'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayShort //=> Mon\n * @type {string}\n */\n get weekdayShort() {\n return this.isValid ? Info.weekdays(\"short\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the human readable long weekday, such as 'Monday'.\n * Defaults to the system's locale if no locale has been specified\n * @example DateTime.local(2017, 10, 30).weekdayLong //=> Monday\n * @type {string}\n */\n get weekdayLong() {\n return this.isValid ? Info.weekdays(\"long\", { locObj: this.loc })[this.weekday - 1] : null;\n }\n\n /**\n * Get the UTC offset of this DateTime in minutes\n * @example DateTime.now().offset //=> -240\n * @example DateTime.utc().offset //=> 0\n * @type {number}\n */\n get offset() {\n return this.isValid ? +this.o : NaN;\n }\n\n /**\n * Get the short human name for the zone's current offset, for example \"EST\" or \"EDT\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameShort() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"short\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get the long human name for the zone's current offset, for example \"Eastern Standard Time\" or \"Eastern Daylight Time\".\n * Defaults to the system's locale if no locale has been specified\n * @type {string}\n */\n get offsetNameLong() {\n if (this.isValid) {\n return this.zone.offsetName(this.ts, {\n format: \"long\",\n locale: this.locale,\n });\n } else {\n return null;\n }\n }\n\n /**\n * Get whether this zone's offset ever changes, as in a DST.\n * @type {boolean}\n */\n get isOffsetFixed() {\n return this.isValid ? this.zone.isUniversal : null;\n }\n\n /**\n * Get whether the DateTime is in a DST.\n * @type {boolean}\n */\n get isInDST() {\n if (this.isOffsetFixed) {\n return false;\n } else {\n return (\n this.offset > this.set({ month: 1, day: 1 }).offset ||\n this.offset > this.set({ month: 5 }).offset\n );\n }\n }\n\n /**\n * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC\n * in this DateTime's zone. During DST changes local time can be ambiguous, for example\n * `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`.\n * This method will return both possible DateTimes if this DateTime's local time is ambiguous.\n * @returns {DateTime[]}\n */\n getPossibleOffsets() {\n if (!this.isValid || this.isOffsetFixed) {\n return [this];\n }\n const dayMs = 86400000;\n const minuteMs = 60000;\n const localTS = objToLocalTS(this.c);\n const oEarlier = this.zone.offset(localTS - dayMs);\n const oLater = this.zone.offset(localTS + dayMs);\n\n const o1 = this.zone.offset(localTS - oEarlier * minuteMs);\n const o2 = this.zone.offset(localTS - oLater * minuteMs);\n if (o1 === o2) {\n return [this];\n }\n const ts1 = localTS - o1 * minuteMs;\n const ts2 = localTS - o2 * minuteMs;\n const c1 = tsToObj(ts1, o1);\n const c2 = tsToObj(ts2, o2);\n if (\n c1.hour === c2.hour &&\n c1.minute === c2.minute &&\n c1.second === c2.second &&\n c1.millisecond === c2.millisecond\n ) {\n return [clone(this, { ts: ts1 }), clone(this, { ts: ts2 })];\n }\n return [this];\n }\n\n /**\n * Returns true if this DateTime is in a leap year, false otherwise\n * @example DateTime.local(2016).isInLeapYear //=> true\n * @example DateTime.local(2013).isInLeapYear //=> false\n * @type {boolean}\n */\n get isInLeapYear() {\n return isLeapYear(this.year);\n }\n\n /**\n * Returns the number of days in this DateTime's month\n * @example DateTime.local(2016, 2).daysInMonth //=> 29\n * @example DateTime.local(2016, 3).daysInMonth //=> 31\n * @type {number}\n */\n get daysInMonth() {\n return daysInMonth(this.year, this.month);\n }\n\n /**\n * Returns the number of days in this DateTime's year\n * @example DateTime.local(2016).daysInYear //=> 366\n * @example DateTime.local(2013).daysInYear //=> 365\n * @type {number}\n */\n get daysInYear() {\n return this.isValid ? daysInYear(this.year) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's year\n * @see https://en.wikipedia.org/wiki/ISO_week_date\n * @example DateTime.local(2004).weeksInWeekYear //=> 53\n * @example DateTime.local(2013).weeksInWeekYear //=> 52\n * @type {number}\n */\n get weeksInWeekYear() {\n return this.isValid ? weeksInWeekYear(this.weekYear) : NaN;\n }\n\n /**\n * Returns the number of weeks in this DateTime's local week year\n * @example DateTime.local(2020, 6, {locale: 'en-US'}).weeksInLocalWeekYear //=> 52\n * @example DateTime.local(2020, 6, {locale: 'de-DE'}).weeksInLocalWeekYear //=> 53\n * @type {number}\n */\n get weeksInLocalWeekYear() {\n return this.isValid\n ? weeksInWeekYear(\n this.localWeekYear,\n this.loc.getMinDaysInFirstWeek(),\n this.loc.getStartOfWeek()\n )\n : NaN;\n }\n\n /**\n * Returns the resolved Intl options for this DateTime.\n * This is useful in understanding the behavior of formatting methods\n * @param {Object} opts - the same options as toLocaleString\n * @return {Object}\n */\n resolvedLocaleOptions(opts = {}) {\n const { locale, numberingSystem, calendar } = Formatter.create(\n this.loc.clone(opts),\n opts\n ).resolvedOptions(this);\n return { locale, numberingSystem, outputCalendar: calendar };\n }\n\n // TRANSFORM\n\n /**\n * \"Set\" the DateTime's zone to UTC. Returns a newly-constructed DateTime.\n *\n * Equivalent to {@link DateTime#setZone}('utc')\n * @param {number} [offset=0] - optionally, an offset from UTC in minutes\n * @param {Object} [opts={}] - options to pass to `setZone()`\n * @return {DateTime}\n */\n toUTC(offset = 0, opts = {}) {\n return this.setZone(FixedOffsetZone.instance(offset), opts);\n }\n\n /**\n * \"Set\" the DateTime's zone to the host's local zone. Returns a newly-constructed DateTime.\n *\n * Equivalent to `setZone('local')`\n * @return {DateTime}\n */\n toLocal() {\n return this.setZone(Settings.defaultZone);\n }\n\n /**\n * \"Set\" the DateTime's zone to specified zone. Returns a newly-constructed DateTime.\n *\n * By default, the setter keeps the underlying time the same (as in, the same timestamp), but the new instance will report different local times and consider DSTs when making computations, as with {@link DateTime#plus}. You may wish to use {@link DateTime#toLocal} and {@link DateTime#toUTC} which provide simple convenience wrappers for commonly used zones.\n * @param {string|Zone} [zone='local'] - a zone identifier. As a string, that can be any IANA zone supported by the host environment, or a fixed-offset name of the form 'UTC+3', or the strings 'local' or 'utc'. You may also supply an instance of a {@link DateTime#Zone} class.\n * @param {Object} opts - options\n * @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this.\n * @return {DateTime}\n */\n setZone(zone, { keepLocalTime = false, keepCalendarTime = false } = {}) {\n zone = normalizeZone(zone, Settings.defaultZone);\n if (zone.equals(this.zone)) {\n return this;\n } else if (!zone.isValid) {\n return DateTime.invalid(unsupportedZone(zone));\n } else {\n let newTS = this.ts;\n if (keepLocalTime || keepCalendarTime) {\n const offsetGuess = zone.offset(this.ts);\n const asObj = this.toObject();\n [newTS] = objToTS(asObj, offsetGuess, zone);\n }\n return clone(this, { ts: newTS, zone });\n }\n }\n\n /**\n * \"Set\" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime.\n * @param {Object} properties - the properties to set\n * @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' })\n * @return {DateTime}\n */\n reconfigure({ locale, numberingSystem, outputCalendar } = {}) {\n const loc = this.loc.clone({ locale, numberingSystem, outputCalendar });\n return clone(this, { loc });\n }\n\n /**\n * \"Set\" the locale. Returns a newly-constructed DateTime.\n * Just a convenient alias for reconfigure({ locale })\n * @example DateTime.local(2017, 5, 25).setLocale('en-GB')\n * @return {DateTime}\n */\n setLocale(locale) {\n return this.reconfigure({ locale });\n }\n\n /**\n * \"Set\" the values of specified units. Returns a newly-constructed DateTime.\n * You can only set units with this method; for \"setting\" metadata, see {@link DateTime#reconfigure} and {@link DateTime#setZone}.\n *\n * This method also supports setting locale-based week units, i.e. `localWeekday`, `localWeekNumber` and `localWeekYear`.\n * They cannot be mixed with ISO-week units like `weekday`.\n * @param {Object} values - a mapping of units to numbers\n * @example dt.set({ year: 2017 })\n * @example dt.set({ hour: 8, minute: 30 })\n * @example dt.set({ weekday: 5 })\n * @example dt.set({ year: 2005, ordinal: 234 })\n * @return {DateTime}\n */\n set(values) {\n if (!this.isValid) return this;\n\n const normalized = normalizeObject(values, normalizeUnitWithLocalWeeks);\n const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, this.loc);\n\n const settingWeekStuff =\n !isUndefined(normalized.weekYear) ||\n !isUndefined(normalized.weekNumber) ||\n !isUndefined(normalized.weekday),\n containsOrdinal = !isUndefined(normalized.ordinal),\n containsGregorYear = !isUndefined(normalized.year),\n containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day),\n containsGregor = containsGregorYear || containsGregorMD,\n definiteWeekDef = normalized.weekYear || normalized.weekNumber;\n\n if ((containsGregor || containsOrdinal) && definiteWeekDef) {\n throw new ConflictingSpecificationError(\n \"Can't mix weekYear/weekNumber units with year/month/day or ordinals\"\n );\n }\n\n if (containsGregorMD && containsOrdinal) {\n throw new ConflictingSpecificationError(\"Can't mix ordinal dates with month/day\");\n }\n\n let mixed;\n if (settingWeekStuff) {\n mixed = weekToGregorian(\n { ...gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), ...normalized },\n minDaysInFirstWeek,\n startOfWeek\n );\n } else if (!isUndefined(normalized.ordinal)) {\n mixed = ordinalToGregorian({ ...gregorianToOrdinal(this.c), ...normalized });\n } else {\n mixed = { ...this.toObject(), ...normalized };\n\n // if we didn't set the day but we ended up on an overflow date,\n // use the last day of the right month\n if (isUndefined(normalized.day)) {\n mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day);\n }\n }\n\n const [ts, o] = objToTS(mixed, this.o, this.zone);\n return clone(this, { ts, o });\n }\n\n /**\n * Add a period of time to this DateTime and return the resulting DateTime\n *\n * Adding hours, minutes, seconds, or milliseconds increases the timestamp by the right number of milliseconds. Adding days, months, or years shifts the calendar, accounting for DSTs and leap years along the way. Thus, `dt.plus({ hours: 24 })` may result in a different time than `dt.plus({ days: 1 })` if there's a DST shift in between.\n * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n * @example DateTime.now().plus(123) //~> in 123 milliseconds\n * @example DateTime.now().plus({ minutes: 15 }) //~> in 15 minutes\n * @example DateTime.now().plus({ days: 1 }) //~> this time tomorrow\n * @example DateTime.now().plus({ days: -1 }) //~> this time yesterday\n * @example DateTime.now().plus({ hours: 3, minutes: 13 }) //~> in 3 hr, 13 min\n * @example DateTime.now().plus(Duration.fromObject({ hours: 3, minutes: 13 })) //~> in 3 hr, 13 min\n * @return {DateTime}\n */\n plus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration);\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * Subtract a period of time to this DateTime and return the resulting DateTime\n * See {@link DateTime#plus}\n * @param {Duration|Object|number} duration - The amount to subtract. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject()\n @return {DateTime}\n */\n minus(duration) {\n if (!this.isValid) return this;\n const dur = Duration.fromDurationLike(duration).negate();\n return clone(this, adjustTime(this, dur));\n }\n\n /**\n * \"Set\" this DateTime to the beginning of a unit of time.\n * @param {string} unit - The unit to go to the beginning of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).startOf('month').toISODate(); //=> '2014-03-01'\n * @example DateTime.local(2014, 3, 3).startOf('year').toISODate(); //=> '2014-01-01'\n * @example DateTime.local(2014, 3, 3).startOf('week').toISODate(); //=> '2014-03-03', weeks always start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('day').toISOTime(); //=> '00:00.000-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).startOf('hour').toISOTime(); //=> '05:00:00.000-05:00'\n * @return {DateTime}\n */\n startOf(unit, { useLocaleWeeks = false } = {}) {\n if (!this.isValid) return this;\n\n const o = {},\n normalizedUnit = Duration.normalizeUnit(unit);\n switch (normalizedUnit) {\n case \"years\":\n o.month = 1;\n // falls through\n case \"quarters\":\n case \"months\":\n o.day = 1;\n // falls through\n case \"weeks\":\n case \"days\":\n o.hour = 0;\n // falls through\n case \"hours\":\n o.minute = 0;\n // falls through\n case \"minutes\":\n o.second = 0;\n // falls through\n case \"seconds\":\n o.millisecond = 0;\n break;\n // no default, invalid units throw in normalizeUnit()\n }\n\n if (normalizedUnit === \"weeks\") {\n if (useLocaleWeeks) {\n const startOfWeek = this.loc.getStartOfWeek();\n const { weekday } = this;\n if (weekday < startOfWeek) {\n o.weekNumber = this.weekNumber - 1;\n }\n o.weekday = startOfWeek;\n } else {\n o.weekday = 1;\n }\n }\n\n if (normalizedUnit === \"quarters\") {\n const q = Math.ceil(this.month / 3);\n o.month = (q - 1) * 3 + 1;\n }\n\n return this.set(o);\n }\n\n /**\n * \"Set\" this DateTime to the end (meaning the last millisecond) of a unit of time\n * @param {string} unit - The unit to go to the end of. Can be 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', or 'millisecond'.\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week\n * @example DateTime.local(2014, 3, 3).endOf('month').toISO(); //=> '2014-03-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('year').toISO(); //=> '2014-12-31T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3).endOf('week').toISO(); // => '2014-03-09T23:59:59.999-05:00', weeks start on Mondays\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('day').toISO(); //=> '2014-03-03T23:59:59.999-05:00'\n * @example DateTime.local(2014, 3, 3, 5, 30).endOf('hour').toISO(); //=> '2014-03-03T05:59:59.999-05:00'\n * @return {DateTime}\n */\n endOf(unit, opts) {\n return this.isValid\n ? this.plus({ [unit]: 1 })\n .startOf(unit, opts)\n .minus(1)\n : this;\n }\n\n // OUTPUT\n\n /**\n * Returns a string representation of this DateTime formatted according to the specified format string.\n * **You may not want this.** See {@link DateTime#toLocaleString} for a more flexible formatting tool. For a table of tokens and their interpretations, see [here](https://moment.github.io/luxon/#/formatting?id=table-of-tokens).\n * Defaults to en-US if no locale has been specified, regardless of the system's locale.\n * @param {string} fmt - the format string\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toFormat('yyyy LLL dd') //=> '2017 Apr 22'\n * @example DateTime.now().setLocale('fr').toFormat('yyyy LLL dd') //=> '2017 avr. 22'\n * @example DateTime.now().toFormat('yyyy LLL dd', { locale: \"fr\" }) //=> '2017 avr. 22'\n * @example DateTime.now().toFormat(\"HH 'hours and' mm 'minutes'\") //=> '20 hours and 55 minutes'\n * @return {string}\n */\n toFormat(fmt, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt)\n : INVALID;\n }\n\n /**\n * Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.\n * The exact behavior of this method is browser-specific, but in general it will return an appropriate representation\n * of the DateTime in the assigned locale.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat\n * @param formatOpts {Object} - Intl.DateTimeFormat constructor options and configuration options\n * @param {Object} opts - opts to override the configuration options on this DateTime\n * @example DateTime.now().toLocaleString(); //=> 4/20/2017\n * @example DateTime.now().setLocale('en-gb').toLocaleString(); //=> '20/04/2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL); //=> 'April 20, 2017'\n * @example DateTime.now().toLocaleString(DateTime.DATE_FULL, { locale: 'fr' }); //=> '28 août 2022'\n * @example DateTime.now().toLocaleString(DateTime.TIME_SIMPLE); //=> '11:32 AM'\n * @example DateTime.now().toLocaleString(DateTime.DATETIME_SHORT); //=> '4/20/2017, 11:32 AM'\n * @example DateTime.now().toLocaleString({ weekday: 'long', month: 'long', day: '2-digit' }); //=> 'Thursday, April 20'\n * @example DateTime.now().toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> 'Thu, Apr 20, 11:27 AM'\n * @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32'\n * @return {string}\n */\n toLocaleString(formatOpts = DATE_SHORT, opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this)\n : INVALID;\n }\n\n /**\n * Returns an array of format \"parts\", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.\n * Defaults to the system's locale if no locale has been specified\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat/formatToParts\n * @param opts {Object} - Intl.DateTimeFormat constructor options, same as `toLocaleString`.\n * @example DateTime.now().toLocaleParts(); //=> [\n * //=> { type: 'day', value: '25' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'month', value: '05' },\n * //=> { type: 'literal', value: '/' },\n * //=> { type: 'year', value: '1982' }\n * //=> ]\n */\n toLocaleParts(opts = {}) {\n return this.isValid\n ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this)\n : [];\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=false] - add the time zone format extension\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @param {string} [opts.precision='milliseconds'] - truncate output to desired presicion: 'years', 'months', 'days', 'hours', 'minutes', 'seconds' or 'milliseconds'. When precision and suppressSeconds or suppressMilliseconds are used together, precision sets the maximum unit shown in the output, however seconds or milliseconds will still be suppressed if they are 0.\n * @example DateTime.utc(1983, 5, 25).toISO() //=> '1982-05-25T00:00:00.000Z'\n * @example DateTime.now().toISO() //=> '2017-04-22T20:47:05.335-04:00'\n * @example DateTime.now().toISO({ includeOffset: false }) //=> '2017-04-22T20:47:05.335'\n * @example DateTime.now().toISO({ format: 'basic' }) //=> '20170422T204705.335-0400'\n * @example DateTime.now().toISO({ precision: 'day' }) //=> '2017-04-22Z'\n * @example DateTime.now().toISO({ precision: 'minute' }) //=> '2017-04-22T20:47Z'\n * @return {string|null}\n */\n toISO({\n format = \"extended\",\n suppressSeconds = false,\n suppressMilliseconds = false,\n includeOffset = true,\n extendedZone = false,\n precision = \"milliseconds\",\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n precision = normalizeUnit(precision);\n const ext = format === \"extended\";\n\n let c = toISODate(this, ext, precision);\n if (orderedUnits.indexOf(precision) >= 3) c += \"T\";\n c += toISOTime(\n this,\n ext,\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone,\n precision\n );\n return c;\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's date component\n * @param {Object} opts - options\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @param {string} [opts.precision='day'] - truncate output to desired precision: 'years', 'months', or 'days'.\n * @example DateTime.utc(1982, 5, 25).toISODate() //=> '1982-05-25'\n * @example DateTime.utc(1982, 5, 25).toISODate({ format: 'basic' }) //=> '19820525'\n * @example DateTime.utc(1982, 5, 25).toISODate({ precision: 'month' }) //=> '1982-05'\n * @return {string|null}\n */\n toISODate({ format = \"extended\", precision = \"day\" } = {}) {\n if (!this.isValid) {\n return null;\n }\n return toISODate(this, format === \"extended\", normalizeUnit(precision));\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's week date\n * @example DateTime.utc(1982, 5, 25).toISOWeekDate() //=> '1982-W21-2'\n * @return {string}\n */\n toISOWeekDate() {\n return toTechFormat(this, \"kkkk-'W'WW-c\");\n }\n\n /**\n * Returns an ISO 8601-compliant string representation of this DateTime's time component\n * @param {Object} opts - options\n * @param {boolean} [opts.suppressMilliseconds=false] - exclude milliseconds from the format if they're 0\n * @param {boolean} [opts.suppressSeconds=false] - exclude seconds from the format if they're 0\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.extendedZone=true] - add the time zone format extension\n * @param {boolean} [opts.includePrefix=false] - include the `T` prefix\n * @param {string} [opts.format='extended'] - choose between the basic and extended format\n * @param {string} [opts.precision='milliseconds'] - truncate output to desired presicion: 'hours', 'minutes', 'seconds' or 'milliseconds'. When precision and suppressSeconds or suppressMilliseconds are used together, precision sets the maximum unit shown in the output, however seconds or milliseconds will still be suppressed if they are 0.\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime() //=> '07:34:19.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34, seconds: 0, milliseconds: 0 }).toISOTime({ suppressSeconds: true }) //=> '07:34Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ format: 'basic' }) //=> '073419.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34 }).toISOTime({ includePrefix: true }) //=> 'T07:34:19.361Z'\n * @example DateTime.utc().set({ hour: 7, minute: 34, second: 56 }).toISOTime({ precision: 'minute' }) //=> '07:34Z'\n * @return {string}\n */\n toISOTime({\n suppressMilliseconds = false,\n suppressSeconds = false,\n includeOffset = true,\n includePrefix = false,\n extendedZone = false,\n format = \"extended\",\n precision = \"milliseconds\",\n } = {}) {\n if (!this.isValid) {\n return null;\n }\n\n precision = normalizeUnit(precision);\n let c = includePrefix && orderedUnits.indexOf(precision) >= 3 ? \"T\" : \"\";\n return (\n c +\n toISOTime(\n this,\n format === \"extended\",\n suppressSeconds,\n suppressMilliseconds,\n includeOffset,\n extendedZone,\n precision\n )\n );\n }\n\n /**\n * Returns an RFC 2822-compatible string representation of this DateTime\n * @example DateTime.utc(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 +0000'\n * @example DateTime.local(2014, 7, 13).toRFC2822() //=> 'Sun, 13 Jul 2014 00:00:00 -0400'\n * @return {string}\n */\n toRFC2822() {\n return toTechFormat(this, \"EEE, dd LLL yyyy HH:mm:ss ZZZ\", false);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT.\n * Specifically, the string conforms to RFC 1123.\n * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1\n * @example DateTime.utc(2014, 7, 13).toHTTP() //=> 'Sun, 13 Jul 2014 00:00:00 GMT'\n * @example DateTime.utc(2014, 7, 13, 19).toHTTP() //=> 'Sun, 13 Jul 2014 19:00:00 GMT'\n * @return {string}\n */\n toHTTP() {\n return toTechFormat(this.toUTC(), \"EEE, dd LLL yyyy HH:mm:ss 'GMT'\");\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Date\n * @example DateTime.utc(2014, 7, 13).toSQLDate() //=> '2014-07-13'\n * @return {string|null}\n */\n toSQLDate() {\n if (!this.isValid) {\n return null;\n }\n return toISODate(this, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL Time\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc().toSQL() //=> '05:15:16.345'\n * @example DateTime.now().toSQL() //=> '05:15:16.345 -04:00'\n * @example DateTime.now().toSQL({ includeOffset: false }) //=> '05:15:16.345'\n * @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York'\n * @return {string}\n */\n toSQLTime({ includeOffset = true, includeZone = false, includeOffsetSpace = true } = {}) {\n let fmt = \"HH:mm:ss.SSS\";\n\n if (includeZone || includeOffset) {\n if (includeOffsetSpace) {\n fmt += \" \";\n }\n if (includeZone) {\n fmt += \"z\";\n } else if (includeOffset) {\n fmt += \"ZZ\";\n }\n }\n\n return toTechFormat(this, fmt, true);\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for use in SQL DateTime\n * @param {Object} opts - options\n * @param {boolean} [opts.includeZone=false] - include the zone, such as 'America/New_York'. Overrides includeOffset.\n * @param {boolean} [opts.includeOffset=true] - include the offset, such as 'Z' or '-04:00'\n * @param {boolean} [opts.includeOffsetSpace=true] - include the space between the time and the offset, such as '05:15:16.345 -04:00'\n * @example DateTime.utc(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 Z'\n * @example DateTime.local(2014, 7, 13).toSQL() //=> '2014-07-13 00:00:00.000 -04:00'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeOffset: false }) //=> '2014-07-13 00:00:00.000'\n * @example DateTime.local(2014, 7, 13).toSQL({ includeZone: true }) //=> '2014-07-13 00:00:00.000 America/New_York'\n * @return {string}\n */\n toSQL(opts = {}) {\n if (!this.isValid) {\n return null;\n }\n\n return `${this.toSQLDate()} ${this.toSQLTime(opts)}`;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for debugging\n * @return {string}\n */\n toString() {\n return this.isValid ? this.toISO() : INVALID;\n }\n\n /**\n * Returns a string representation of this DateTime appropriate for the REPL.\n * @return {string}\n */\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n if (this.isValid) {\n return `DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`;\n } else {\n return `DateTime { Invalid, reason: ${this.invalidReason} }`;\n }\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime. Alias of {@link DateTime#toMillis}\n * @return {number}\n */\n valueOf() {\n return this.toMillis();\n }\n\n /**\n * Returns the epoch milliseconds of this DateTime.\n * @return {number}\n */\n toMillis() {\n return this.isValid ? this.ts : NaN;\n }\n\n /**\n * Returns the epoch seconds (including milliseconds in the fractional part) of this DateTime.\n * @return {number}\n */\n toSeconds() {\n return this.isValid ? this.ts / 1000 : NaN;\n }\n\n /**\n * Returns the epoch seconds (as a whole number) of this DateTime.\n * @return {number}\n */\n toUnixInteger() {\n return this.isValid ? Math.floor(this.ts / 1000) : NaN;\n }\n\n /**\n * Returns an ISO 8601 representation of this DateTime appropriate for use in JSON.\n * @return {string}\n */\n toJSON() {\n return this.toISO();\n }\n\n /**\n * Returns a BSON serializable equivalent to this DateTime.\n * @return {Date}\n */\n toBSON() {\n return this.toJSDate();\n }\n\n /**\n * Returns a JavaScript object with this DateTime's year, month, day, and so on.\n * @param opts - options for generating the object\n * @param {boolean} [opts.includeConfig=false] - include configuration attributes in the output\n * @example DateTime.now().toObject() //=> { year: 2017, month: 4, day: 22, hour: 20, minute: 49, second: 42, millisecond: 268 }\n * @return {Object}\n */\n toObject(opts = {}) {\n if (!this.isValid) return {};\n\n const base = { ...this.c };\n\n if (opts.includeConfig) {\n base.outputCalendar = this.outputCalendar;\n base.numberingSystem = this.loc.numberingSystem;\n base.locale = this.loc.locale;\n }\n return base;\n }\n\n /**\n * Returns a JavaScript Date equivalent to this DateTime.\n * @return {Date}\n */\n toJSDate() {\n return new Date(this.isValid ? this.ts : NaN);\n }\n\n // COMPARE\n\n /**\n * Return the difference between two DateTimes as a Duration.\n * @param {DateTime} otherDateTime - the DateTime to compare this one to\n * @param {string|string[]} [unit=['milliseconds']] - the unit or array of units (such as 'hours' or 'days') to include in the duration.\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @example\n * var i1 = DateTime.fromISO('1982-05-25T09:45'),\n * i2 = DateTime.fromISO('1983-10-14T10:30');\n * i2.diff(i1).toObject() //=> { milliseconds: 43807500000 }\n * i2.diff(i1, 'hours').toObject() //=> { hours: 12168.75 }\n * i2.diff(i1, ['months', 'days']).toObject() //=> { months: 16, days: 19.03125 }\n * i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 }\n * @return {Duration}\n */\n diff(otherDateTime, unit = \"milliseconds\", opts = {}) {\n if (!this.isValid || !otherDateTime.isValid) {\n return Duration.invalid(\"created by diffing an invalid DateTime\");\n }\n\n const durOpts = { locale: this.locale, numberingSystem: this.numberingSystem, ...opts };\n\n const units = maybeArray(unit).map(Duration.normalizeUnit),\n otherIsLater = otherDateTime.valueOf() > this.valueOf(),\n earlier = otherIsLater ? this : otherDateTime,\n later = otherIsLater ? otherDateTime : this,\n diffed = diff(earlier, later, units, durOpts);\n\n return otherIsLater ? diffed.negate() : diffed;\n }\n\n /**\n * Return the difference between this DateTime and right now.\n * See {@link DateTime#diff}\n * @param {string|string[]} [unit=['milliseconds']] - the unit or units units (such as 'hours' or 'days') to include in the duration\n * @param {Object} opts - options that affect the creation of the Duration\n * @param {string} [opts.conversionAccuracy='casual'] - the conversion system to use\n * @return {Duration}\n */\n diffNow(unit = \"milliseconds\", opts = {}) {\n return this.diff(DateTime.now(), unit, opts);\n }\n\n /**\n * Return an Interval spanning between this DateTime and another DateTime\n * @param {DateTime} otherDateTime - the other end point of the Interval\n * @return {Interval|DateTime}\n */\n until(otherDateTime) {\n return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this;\n }\n\n /**\n * Return whether this DateTime is in the same unit of time as another DateTime.\n * Higher-order units must also be identical for this function to return `true`.\n * Note that time zones are **ignored** in this comparison, which compares the **local** calendar time. Use {@link DateTime#setZone} to convert one of the dates if needed.\n * @param {DateTime} otherDateTime - the other DateTime\n * @param {string} unit - the unit of time to check sameness on\n * @param {Object} opts - options\n * @param {boolean} [opts.useLocaleWeeks=false] - If true, use weeks based on the locale, i.e. use the locale-dependent start of the week; only the locale of this DateTime is used\n * @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day\n * @return {boolean}\n */\n hasSame(otherDateTime, unit, opts) {\n if (!this.isValid) return false;\n\n const inputMs = otherDateTime.valueOf();\n const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true });\n return (\n adjustedToZone.startOf(unit, opts) <= inputMs && inputMs <= adjustedToZone.endOf(unit, opts)\n );\n }\n\n /**\n * Equality check\n * Two DateTimes are equal if and only if they represent the same millisecond, have the same zone and location, and are both valid.\n * To compare just the millisecond values, use `+dt1 === +dt2`.\n * @param {DateTime} other - the other DateTime\n * @return {boolean}\n */\n equals(other) {\n return (\n this.isValid &&\n other.isValid &&\n this.valueOf() === other.valueOf() &&\n this.zone.equals(other.zone) &&\n this.loc.equals(other.loc)\n );\n }\n\n /**\n * Returns a string representation of a this time relative to now, such as \"in two days\". Can only internationalize if your\n * platform supports Intl.RelativeTimeFormat. Rounds towards zero by default.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} [options.style=\"long\"] - the style of units, must be \"long\", \"short\", or \"narrow\"\n * @param {string|string[]} options.unit - use a specific unit or array of units; if omitted, or an array, the method will pick the best unit. Use an array or one of \"years\", \"quarters\", \"months\", \"weeks\", \"days\", \"hours\", \"minutes\", or \"seconds\"\n * @param {boolean} [options.round=true] - whether to round the numbers in the output.\n * @param {string} [options.rounding=\"trunc\"] - rounding method to use when rounding the numbers in the output. Can be \"trunc\" (toward zero), \"expand\" (away from zero), \"round\", \"floor\", or \"ceil\".\n * @param {number} [options.padding=0] - padding in milliseconds. This allows you to round up the result if it fits inside the threshold. Don't use in combination with {round: false} because the decimal output will include the padding.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelative() //=> \"in 1 day\"\n * @example DateTime.now().setLocale(\"es\").toRelative({ days: 1 }) //=> \"dentro de 1 día\"\n * @example DateTime.now().plus({ days: 1 }).toRelative({ locale: \"fr\" }) //=> \"dans 23 heures\"\n * @example DateTime.now().minus({ days: 2 }).toRelative() //=> \"2 days ago\"\n * @example DateTime.now().minus({ days: 2 }).toRelative({ unit: \"hours\" }) //=> \"48 hours ago\"\n * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> \"1.5 days ago\"\n */\n toRelative(options = {}) {\n if (!this.isValid) return null;\n const base = options.base || DateTime.fromObject({}, { zone: this.zone }),\n padding = options.padding ? (this < base ? -options.padding : options.padding) : 0;\n let units = [\"years\", \"months\", \"days\", \"hours\", \"minutes\", \"seconds\"];\n let unit = options.unit;\n if (Array.isArray(options.unit)) {\n units = options.unit;\n unit = undefined;\n }\n return diffRelative(base, this.plus(padding), {\n ...options,\n numeric: \"always\",\n units,\n unit,\n });\n }\n\n /**\n * Returns a string representation of this date relative to today, such as \"yesterday\" or \"next month\".\n * Only internationalizes on platforms that supports Intl.RelativeTimeFormat.\n * @param {Object} options - options that affect the output\n * @param {DateTime} [options.base=DateTime.now()] - the DateTime to use as the basis to which this time is compared. Defaults to now.\n * @param {string} options.locale - override the locale of this DateTime\n * @param {string} options.unit - use a specific unit; if omitted, the method will pick the unit. Use one of \"years\", \"quarters\", \"months\", \"weeks\", or \"days\"\n * @param {string} options.numberingSystem - override the numberingSystem of this DateTime. The Intl system may choose not to honor this\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar() //=> \"tomorrow\"\n * @example DateTime.now().setLocale(\"es\").plus({ days: 1 }).toRelative() //=> \"\"mañana\"\n * @example DateTime.now().plus({ days: 1 }).toRelativeCalendar({ locale: \"fr\" }) //=> \"demain\"\n * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> \"2 days ago\"\n */\n toRelativeCalendar(options = {}) {\n if (!this.isValid) return null;\n\n return diffRelative(options.base || DateTime.fromObject({}, { zone: this.zone }), this, {\n ...options,\n numeric: \"auto\",\n units: [\"years\", \"months\", \"days\"],\n calendary: true,\n });\n }\n\n /**\n * Return the min of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the minimum\n * @return {DateTime} the min DateTime, or undefined if called with no argument\n */\n static min(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"min requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.min);\n }\n\n /**\n * Return the max of several date times\n * @param {...DateTime} dateTimes - the DateTimes from which to choose the maximum\n * @return {DateTime} the max DateTime, or undefined if called with no argument\n */\n static max(...dateTimes) {\n if (!dateTimes.every(DateTime.isDateTime)) {\n throw new InvalidArgumentError(\"max requires all arguments be DateTimes\");\n }\n return bestBy(dateTimes, (i) => i.valueOf(), Math.max);\n }\n\n // MISC\n\n /**\n * Explain how a string would be parsed by fromFormat()\n * @param {string} text - the string to parse\n * @param {string} fmt - the format the string is expected to be in (see description)\n * @param {Object} options - options taken by fromFormat()\n * @return {Object}\n */\n static fromFormatExplain(text, fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return explainFromTokens(localeToUse, text, fmt);\n }\n\n /**\n * @deprecated use fromFormatExplain instead\n */\n static fromStringExplain(text, fmt, options = {}) {\n return DateTime.fromFormatExplain(text, fmt, options);\n }\n\n /**\n * Build a parser for `fmt` using the given locale. This parser can be passed\n * to {@link DateTime.fromFormatParser} to a parse a date in this format. This\n * can be used to optimize cases where many dates need to be parsed in a\n * specific format.\n *\n * @param {String} fmt - the format the string is expected to be in (see\n * description)\n * @param {Object} options - options used to set locale and numberingSystem\n * for parser\n * @returns {TokenParser} - opaque object to be used\n */\n static buildFormatParser(fmt, options = {}) {\n const { locale = null, numberingSystem = null } = options,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n return new TokenParser(localeToUse, fmt);\n }\n\n /**\n * Create a DateTime from an input string and format parser.\n *\n * The format parser must have been created with the same locale as this call.\n *\n * @param {String} text - the string to parse\n * @param {TokenParser} formatParser - parser from {@link DateTime.buildFormatParser}\n * @param {Object} opts - options taken by fromFormat()\n * @returns {DateTime}\n */\n static fromFormatParser(text, formatParser, opts = {}) {\n if (isUndefined(text) || isUndefined(formatParser)) {\n throw new InvalidArgumentError(\n \"fromFormatParser requires an input string and a format parser\"\n );\n }\n const { locale = null, numberingSystem = null } = opts,\n localeToUse = Locale.fromOpts({\n locale,\n numberingSystem,\n defaultToEN: true,\n });\n\n if (!localeToUse.equals(formatParser.locale)) {\n throw new InvalidArgumentError(\n `fromFormatParser called with a locale of ${localeToUse}, ` +\n `but the format parser was created for ${formatParser.locale}`\n );\n }\n\n const { result, zone, specificOffset, invalidReason } = formatParser.explainFromTokens(text);\n\n if (invalidReason) {\n return DateTime.invalid(invalidReason);\n } else {\n return parseDataToDateTime(\n result,\n zone,\n opts,\n `format ${formatParser.format}`,\n text,\n specificOffset\n );\n }\n }\n\n // FORMAT PRESETS\n\n /**\n * {@link DateTime#toLocaleString} format like 10/14/1983\n * @type {Object}\n */\n static get DATE_SHORT() {\n return DATE_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED() {\n return DATE_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'\n * @type {Object}\n */\n static get DATE_MED_WITH_WEEKDAY() {\n return DATE_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983'\n * @type {Object}\n */\n static get DATE_FULL() {\n return DATE_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'\n * @type {Object}\n */\n static get DATE_HUGE() {\n return DATE_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_SIMPLE() {\n return TIME_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SECONDS() {\n return TIME_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_SHORT_OFFSET() {\n return TIME_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get TIME_WITH_LONG_OFFSET() {\n return TIME_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_SIMPLE() {\n return TIME_24_SIMPLE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SECONDS() {\n return TIME_24_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_SHORT_OFFSET() {\n return TIME_24_WITH_SHORT_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.\n * @type {Object}\n */\n static get TIME_24_WITH_LONG_OFFSET() {\n return TIME_24_WITH_LONG_OFFSET;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT() {\n return DATETIME_SHORT;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_SHORT_WITH_SECONDS() {\n return DATETIME_SHORT_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED() {\n return DATETIME_MED;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_SECONDS() {\n return DATETIME_MED_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_MED_WITH_WEEKDAY() {\n return DATETIME_MED_WITH_WEEKDAY;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL() {\n return DATETIME_FULL;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_FULL_WITH_SECONDS() {\n return DATETIME_FULL_WITH_SECONDS;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE() {\n return DATETIME_HUGE;\n }\n\n /**\n * {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.\n * @type {Object}\n */\n static get DATETIME_HUGE_WITH_SECONDS() {\n return DATETIME_HUGE_WITH_SECONDS;\n }\n}\n\n/**\n * @private\n */\nfunction friendlyDateTime(dateTimeish) {\n if (DateTime.isDateTime(dateTimeish)) {\n return dateTimeish;\n } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) {\n return DateTime.fromJSDate(dateTimeish);\n } else if (dateTimeish && typeof dateTimeish === \"object\") {\n return DateTime.fromObject(dateTimeish);\n } else {\n throw new InvalidArgumentError(\n `Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`\n );\n }\n}\n\nconst VERSION = \"3.7.2\";\n\nexport { DateTime, Duration, FixedOffsetZone, IANAZone, Info, Interval, InvalidZone, Settings, SystemZone, VERSION, Zone };\n//# sourceMappingURL=luxon.mjs.map\n","/**\n * @file date.ts\n * @description Date manipulation and formatting wrappers.\n *\n * This file encapsulates `luxon` logic and exposes standardized, reusable\n * utility functions for date calculations throughout the application.\n */\n\nimport { DateTime } from \"luxon\";\n\nexport type DateType = DateTime;\nexport type DateInputType = Date | DateTime | string | number;\n\n/**\n * Normalizes various date inputs into a Luxon DateTime object.\n */\nexport function dateFn(date?: DateInputType): DateTime {\n if (date === undefined) return DateTime.now();\n if (date instanceof DateTime) return date;\n if (date instanceof Date) return DateTime.fromJSDate(date);\n if (typeof date === \"string\") return DateTime.fromISO(date);\n if (typeof date === \"number\") return DateTime.fromMillis(date);\n return DateTime.now();\n}\n\n// ---------------------------------------------------------------------------\n// Basic Wrapping Utilities (Getters, Setters, Navigators)\n// These functions wrap common operations to maintain a consistent API\n// and reduce direct framework dependency across the components.\n// ---------------------------------------------------------------------------\n\nexport function getStartOfDay(date: DateInputType): DateType {\n return dateFn(date).startOf(\"day\");\n}\n\nexport function getStartOfMonth(date: DateType): DateType {\n return dateFn(date).startOf(\"month\");\n}\n\nexport function addDays(date: DateType, days: number): DateType {\n return dateFn(date).plus({ days });\n}\n\nexport function subDays(date: DateType, days: number): DateType {\n return dateFn(date).minus({ days });\n}\n\nexport function getDiffDays(\n date1: DateInputType,\n date2: DateInputType,\n): number {\n return Math.floor(dateFn(date1).diff(dateFn(date2), \"day\").days);\n}\n\nexport function setDate(date: DateType, day: number): DateType {\n return date.set({ day });\n}\n\n// Adapting to 0-indexed behavior for backward compatibility across components\nexport function setMonth(date: DateType, month: number): DateType {\n return date.set({ month: month + 1 });\n}\n\nexport function setYear(date: DateType, year: number): DateType {\n return date.set({ year });\n}\n\nexport function getDate(date: DateType): number {\n return date.day;\n}\n\n// Adapting to 0-indexed behavior for backward compatibility across components\nexport function getMonth(date: DateType): number {\n return date.month - 1;\n}\n\nexport function getYear(date: DateType): number {\n return date.year;\n}\n\n// ---------------------------------------------------------------------------\n// Comparisons & Formatting\n// ---------------------------------------------------------------------------\n\nexport function isBeforeDate(\n date1: DateInputType,\n date2: DateInputType,\n): boolean {\n return dateFn(date1).startOf(\"day\") < dateFn(date2).startOf(\"day\");\n}\n\nexport function isAfterDate(\n date1: DateInputType,\n date2: DateInputType,\n): boolean {\n return dateFn(date1).startOf(\"day\") > dateFn(date2).startOf(\"day\");\n}\n\nexport function isSameDate(\n date1: DateInputType,\n date2: DateInputType,\n): boolean {\n return dateFn(date1).hasSame(dateFn(dateFn(date2)), \"day\");\n}\n\nexport function formatDate(\n date: DateInputType,\n format: string,\n locale?: string,\n): string {\n return dateFn(date)\n .setLocale(locale || \"en\")\n .toFormat(format);\n}\n\nexport function convertToDate(luxonDate: DateType): Date {\n return luxonDate.toJSDate();\n}\n\n// ---------------------------------------------------------------------------\n// Complex Date Calculations\n// ---------------------------------------------------------------------------\n\n/**\n * Determines the day of the week (0-6)\n *\n * @param date - A DateType representing the target date.\n * @returns The numeric index of the day (0 = Sunday, 1 = Monday, etc.).\n */\nexport function getDayOfWeek(date: DateType): number {\n return date.weekday === 7 ? 0 : date.weekday;\n}\n\n/**\n * Determines the day of the week (0-6) on which a given month starts.\n *\n * @param date - A DateType representing the target month.\n * @returns The numeric index of the starting day (0 = Sunday, 1 = Monday, etc.).\n */\nexport function getMonthStartingDay(date: DateType): number {\n return getDayOfWeek(date.startOf(\"month\"));\n}\n\n/**\n * Checks whether a specific numeric date within a targeted month matches today's date.\n *\n * @param selectedDate - The base month/year context.\n * @param dates - The specific numeric day of the month (1-31).\n * @returns True if the assembled date is the exact current calendar day.\n */\nexport function checkIsToday(selectedDate: DateType, dates: number): boolean {\n const cloneSelectedDate = selectedDate.set({ day: dates });\n return DateTime.now().hasSame(dateFn(cloneSelectedDate), \"day\");\n}\n\n/**\n * Generates an array of years centered around or including the `selectedYear`.\n * Useful for populating year-selection dropdowns or pickers.\n *\n * @param pastLength - Number of historical years to include from the current date.\n * @param futureLength - Number of future years to include from the current date.\n * @param selectedYear - Ensures this year is included in the array if it falls outside the requested bounds.\n * @returns An array of numeric years.\n */\nexport function getYearList(\n pastLength: number,\n futureLength: number,\n selectedYear: number,\n): number[] {\n // length should include past years, future years, and the current year (+1)\n const yearLength = pastLength + futureLength + 1;\n const yearStarting = DateTime.now().year - pastLength;\n const yearList = Array.from(\n { length: yearLength },\n (_, index) => index + yearStarting,\n );\n\n if (!yearList.includes(selectedYear)) {\n if (DateTime.now().year <= selectedYear) {\n yearList.push(selectedYear);\n } else {\n return [selectedYear, ...yearList];\n }\n }\n return yearList;\n}\n","/**\n * @file common.ts\n * @description Common utility functions used across the calendar components.\n *\n * Provides generalized helpers for event-type checking (all-day, multi-day)\n * and spatial calculations like the maximum number of viewable events per cell.\n */\n\nimport { KeyboardEvent } from \"react\";\nimport {\n KEYBOARD_SHORTCUTS,\n LAYOUT_CONSTANTS,\n RTL_LOCALES,\n TIME_CONSTANTS,\n} from \"../constants\";\nimport { CalendarEvent } from \"../types\";\nimport { dateFn, DateType } from \"./date\";\n\n/**\n * Calculates the maximum number of events that can be displayed in a cell based on the calendar height.\n *\n * @param height - The total height of the calendar\n * @returns The maximum number of events to display\n */\nexport function calculateMaxEvents(height: number, rowsInView: number): number {\n const { DATE_LABEL_HEIGHT, CELL_PADDING, EVENT_HEIGHT } = LAYOUT_CONSTANTS;\n\n const cellHeight = height / rowsInView;\n const availableHeight = cellHeight - DATE_LABEL_HEIGHT - CELL_PADDING;\n const calculatedMax = Math.round(availableHeight / EVENT_HEIGHT) - 1; // -1 for \"more\" button\n\n return Math.max(0, calculatedMax);\n}\n\n/**\n * Helper to determine if an event is an all-day event.\n * An event is considered \"all-day\" if its start and end date strings\n * contain only a date (e.g. yyyy-MM-dd) and no time component (no 'T' or space).\n *\n * @param event - The calendar event to check.\n * @returns True if the event has no time payload.\n */\nexport function isAllDayEvent(event: CalendarEvent): boolean {\n const isDateOnly = (dateStr: string) => {\n return !dateStr.includes(\"T\") && !dateStr.includes(\" \");\n };\n\n if (!isDateOnly(event.startDate)) {\n return false;\n }\n\n if (event.endDate && !isDateOnly(event.endDate)) {\n return false;\n }\n\n return true;\n}\n\n/**\n * Helper to determine if an event spans across multiple distinct calendar days.\n * Compares the start of the day for both startDate and endDate.\n *\n * @param event - The calendar event to check.\n * @returns True if the event starts and ends on different days.\n */\nexport function isMultiDay(event: CalendarEvent): boolean {\n if (!event.endDate) return false;\n const start = dateFn(event.startDate).startOf(\"day\");\n const end = dateFn(event.endDate).startOf(\"day\");\n return !start.equals(dateFn(end));\n}\n\n/**\n * Calculates the overlap duration in hours of an event with a specific calendar day boundary (00:00 to 23:59).\n *\n * @param event - The calendar event.\n * @param date - The day to check the overlap against.\n * @returns The overlap duration in hours (e.g., 2.5). Returns 24 for all-day events.\n */\nexport function getEventOverlapInHours(\n event: CalendarEvent,\n date: DateType,\n): number {\n if (isAllDayEvent(event)) return TIME_CONSTANTS.HOURS_IN_DAY;\n\n const dayStart = dateFn(date).startOf(\"day\");\n const dayEnd = dateFn(date).endOf(\"day\");\n\n const eventStart = dateFn(event.startDate);\n const eventEnd = event.endDate ? dateFn(event.endDate) : eventStart;\n\n const overlapStart = eventStart > dayStart ? eventStart : dayStart;\n const overlapEnd = eventEnd < dayEnd ? eventEnd : dayEnd;\n\n const overlapMs = overlapEnd.valueOf() - overlapStart.valueOf();\n if (overlapMs <= 0) return 0;\n\n return overlapMs / TIME_CONSTANTS.MS_PER_HOUR;\n}\n\n/**\n * Resolves layout direction. Explicit `direction` prop wins; otherwise infers from\n * the locale's primary subtag. Defaults to `'ltr'` when both are undefined.\n */\nexport function resolveDirection(\n direction: \"ltr\" | \"rtl\" | undefined,\n locale: string | undefined,\n): \"ltr\" | \"rtl\" {\n if (direction === \"ltr\" || direction === \"rtl\") return direction;\n const base = (locale ?? \"en\").toLowerCase().split(/[-_]/)[0];\n return (RTL_LOCALES as readonly string[]).includes(base) ? \"rtl\" : \"ltr\";\n}\n\n/**\n * Wraps a handler so it only fires on Enter or Space — the standard keyboard activation keys.\n * Prevents default and stops propagation to avoid scroll or form submission side effects.\n *\n * @param handler - The callback to invoke on activation.\n * @returns A keyboard event handler suitable for `onKeyDown`.\n */\nexport function handleKeyboardActivation(handler: (e: KeyboardEvent) => void) {\n return (e: KeyboardEvent) => {\n if (\n e.key === KEYBOARD_SHORTCUTS.OPEN ||\n e.key === KEYBOARD_SHORTCUTS.ACTIVATE\n ) {\n e.preventDefault();\n e.stopPropagation();\n handler(e);\n }\n };\n}\n","/**\n * @file formatting.ts\n * @description Utilities to format data for user interface presentation.\n *\n * Includes logic to generate contextual strings based on current calendar views,\n * such as tooltip strings and dynamic GMT offsets.\n */\n\nimport { Info } from \"luxon\";\nimport { DATE_FORMATS, TIME_CONSTANTS } from \"../constants\";\nimport {\n CalendarEvent,\n ECalendarViewType,\n EDayType,\n MonthListType,\n} from \"../types\";\nimport { formatDate, dateFn } from \"./date\";\nimport { isAllDayEvent } from \"./common\";\n\n/**\n * Generates the tooltip text for an event based on the view type.\n * Adapts the formatting (whether to include explicit dates, times, or both)\n * dynamically based on if it's month/week view, or all-day vs timed.\n *\n * @param event - The calendar event hovering over.\n * @param viewType - The current enum view mode of the calendar.\n * @param is12Hour - Boolean indicating if the user is employing a 12-hour clock.\n * @returns A formatted string ready for tooltip display.\n */\nexport function generateTooltipText(\n event: CalendarEvent,\n viewType: ECalendarViewType,\n is12Hour?: boolean,\n locale?: string,\n): string {\n const timeFormat = is12Hour ? DATE_FORMATS.TIME_12H : DATE_FORMATS.TIME;\n const isMulti =\n event.endDate &&\n !dateFn(event.startDate).hasSame(dateFn(event.endDate), \"day\");\n const isAllDay = isAllDayEvent(event);\n\n let formatStr: string = timeFormat;\n\n if (viewType === ECalendarViewType.month || isAllDay) {\n formatStr = DATE_FORMATS.DATE;\n } else if (isMulti) {\n // Include both date and time for multi-day events in day/week/schedule views\n formatStr = `${DATE_FORMATS.DATE} ${timeFormat}`;\n }\n\n let tooltipText = `${event.title} (${formatDate(event.startDate, formatStr, locale)}`;\n if (event.endDate) {\n tooltipText += ` - ${formatDate(event.endDate, formatStr, locale)}`;\n }\n tooltipText += `)`;\n\n return tooltipText;\n}\n\n/**\n * Returns a formatted GMT offset string based on the user's local timezone.\n * Useful for displaying timezone indicators on the calendar grid.\n *\n * @returns A formatted string like \"GMT+05:30\" or \"GMT-08\".\n */\nexport function getGmtOffset() {\n const offset = new Date().getTimezoneOffset();\n const sign = offset > 0 ? \"-\" : \"+\"; // timeZoneOffset returns negative if ahead of UTC\n const absOffset = Math.abs(offset);\n const hours = Math.floor(absOffset / TIME_CONSTANTS.MINUTES_IN_HOUR);\n const minutes = absOffset % TIME_CONSTANTS.MINUTES_IN_HOUR;\n\n if (minutes === 0) {\n return `GMT${sign}${hours.toString().padStart(2, \"0\")}`;\n }\n return `GMT${sign}${hours.toString().padStart(2, \"0\")}:${minutes.toString().padStart(2, \"0\")}`;\n}\n\nexport function getDayListNames(dayType: EDayType, locale?: string): string[] {\n const format = dayType === EDayType.full ? \"long\" : \"short\";\n const days = Info.weekdays(format, { locale: locale || \"en\" });\n // Luxon returns Mon-Sun. We need Sun-Sat to match expected 0-6 index.\n return [days[6], ...days.slice(0, 6)];\n}\n\nexport function getMonthList(locale?: string): MonthListType[] {\n return Info.months(\"long\", { locale: locale || \"en\" }).map((label, i) => ({\n label,\n value: i,\n }));\n}\n","/**\n * @file contrast.ts\n * @description Utility functions for calculating color luminance and contrast.\n * Follows WCAG 2.1 Web Content Accessibility Guidelines.\n */\nimport type { CalendarTheme, ThemeScheme } from \"../types\";\n\ninterface RGB {\n r: number;\n g: number;\n b: number;\n}\n\n/**\n * Map of common CSS color names to their Hex equivalents.\n * Used as a fallback for the parser when a named color is provided.\n * @internal\n */\nconst colorNameMap: Record<string, string> = {\n white: \"#ffffff\",\n black: \"#000000\",\n transparent: \"#ffffff\", // Default to white for transparent backgrounds\n pink: \"#ffc0cb\",\n lime: \"#00ff00\",\n orange: \"#ffa500\",\n yellow: \"#ffff00\",\n cyan: \"#00ffff\",\n silver: \"#c0c0c0\",\n gold: \"#ffd700\",\n lightgray: \"#d3d3d3\",\n lightblue: \"#add8e6\",\n};\n\n/**\n * Converts a hex color string or RGB/RGBA string to an RGB object.\n *\n * @param color - The color string to parse (e.g., \"#FFF\", \"#FFFFFF\", \"rgb(255, 255, 255)\").\n * @returns An RGB object or null if the color format is invalid.\n */\nfunction parseToRgb(color: string): RGB | null {\n color = color.trim().toLowerCase();\n\n // Handle Hex (e.g., #FFF or #FFFFFF)\n if (color.startsWith(\"#\")) {\n const hex = color.slice(1);\n if (hex.length === 3) {\n return {\n r: parseInt(hex[0] + hex[0], 16),\n g: parseInt(hex[1] + hex[1], 16),\n b: parseInt(hex[2] + hex[2], 16),\n };\n } else if (hex.length === 6) {\n return {\n r: parseInt(hex.substring(0, 2), 16),\n g: parseInt(hex.substring(2, 4), 16),\n b: parseInt(hex.substring(4, 6), 16),\n };\n }\n }\n\n // Handle RGB/RGBA (e.g., rgb(255, 255, 255) or rgba(255, 255, 255, 1))\n const rgbMatch = color.match(\n /^rgba?\\((\\d+),\\s*(\\d+),\\s*(\\d+)(?:,\\s*[\\d.]+)?\\)$/,\n );\n if (rgbMatch) {\n return {\n r: parseInt(rgbMatch[1], 10),\n g: parseInt(rgbMatch[2], 10),\n b: parseInt(rgbMatch[3], 10),\n };\n }\n\n if (colorNameMap[color]) {\n return parseToRgb(colorNameMap[color]);\n }\n\n return null;\n}\n\n/**\n * Calculates the relative luminance of a color.\n * Formula: 0.2126 * R + 0.7152 * G + 0.0722 * B\n *\n * @see https://www.w3.org/TR/WCAG20/#relativeluminancedef\n * @param r - Red component (0-255).\n * @param g - Green component (0-255).\n * @param b - Blue component (0-255).\n * @returns The relative luminance (0 to 1).\n */\nfunction getRelativeLuminance(r: number, g: number, b: number): number {\n const [lr, lg, lb] = [r, g, b].map((val) => {\n const s = val / 255;\n return s <= 0.03928 ? s / 12.92 : Math.pow((s + 0.055) / 1.055, 2.4);\n });\n return 0.2126 * lr + 0.7152 * lg + 0.0722 * lb;\n}\n\n/**\n * Calculates the contrast ratio between two relative luminances.\n * Formula: (L1 + 0.05) / (L2 + 0.05)\n *\n * @see https://www.w3.org/TR/WCAG20/#contrast-ratiodef\n * @param l1 - Luminance 1.\n * @param l2 - Luminance 2.\n * @returns The contrast ratio (1 to 21).\n */\nfunction getContrastRatio(l1: number, l2: number): number {\n const lighter = Math.max(l1, l2);\n const darker = Math.min(l1, l2);\n return (lighter + 0.05) / (darker + 0.05);\n}\n\n/**\n * Determines the best contrast color (black or white) for a given background color.\n * Follows WCAG 2.1 standards for readability.\n *\n * @param bgColor - The CSS background color (Hex, RGB, or named color).\n * @returns \"#FFFFFF\" or \"#212529\" (a very dark gray, softer than pure black).\n */\nexport function getContrastColor(bgColor?: string): string {\n if (!bgColor) return \"#FFFFFF\";\n\n const rgb = parseToRgb(bgColor);\n if (!rgb) return \"#FFFFFF\";\n\n const luminance = getRelativeLuminance(rgb.r, rgb.g, rgb.b);\n\n // Contrast against white (#FFFFFF) has luminance 1\n // Contrast against dark gray (#212529) has luminance ~0.012\n const whiteLuminance = 1;\n const darkLuminance = getRelativeLuminance(33, 37, 41); // #212529\n\n const contrastWithWhite = getContrastRatio(luminance, whiteLuminance);\n const contrastWithDark = getContrastRatio(luminance, darkLuminance);\n\n return contrastWithWhite >= contrastWithDark ? \"#FFFFFF\" : \"#212529\";\n}\n\n/**\n * Merges flat CalendarTheme values with the scheme-specific sub-object.\n * Scheme-specific values win on a per-field basis.\n *\n * @param theme - Raw theme from CalendarProps (may be undefined or {}).\n * @param scheme - Resolved color scheme (\"light\" | \"dark\") from context.\n * @returns A flat ThemeScheme with no nested keys.\n */\nexport function resolveTheme(\n theme: CalendarTheme | undefined,\n scheme: \"light\" | \"dark\",\n): ThemeScheme {\n if (!theme) return {};\n const override = theme[scheme];\n return {\n default: { ...theme.default, ...override?.default },\n selected: { ...theme.selected, ...override?.selected },\n today: { ...theme.today, ...override?.today },\n };\n}\n","/**\n * @file useResizeObserver.ts\n * @description Hook to monitor and return the current dimensions of a referenced HTML element.\n *\n * This hook uses the native browser `ResizeObserver` API to observe changes\n * to an element's size, returning its current `width` and `height`. It is\n * useful for responsive rendering within specific container bounds.\n */\n\nimport { useEffect, useState, RefObject } from \"react\";\n\n/**\n * Hook to observe the size of an element.\n *\n * @param ref - React ref object attached to the element to observe.\n * @param notNeeded - Optional flag to bypass the observer. Useful for performance\n * if the observer is conditionally required.\n * @returns An object containing the observed `width` and `height`.\n */\nexport default function useResizeObserver(\n ref: RefObject<HTMLElement | null>,\n notNeeded?: boolean,\n) {\n const [size, setSize] = useState({ width: 0, height: 0 });\n\n useEffect(() => {\n if (notNeeded) return;\n const element = ref.current;\n if (!element) return;\n\n // -------------------------------------------------------------------------\n // Set up the ResizeObserver instance\n // -------------------------------------------------------------------------\n const resizeObserver = new ResizeObserver((entries) => {\n if (!Array.isArray(entries) || !entries.length) return;\n\n const entry = entries[0];\n const { width, height } = entry.contentRect;\n\n setSize({ width, height });\n });\n\n resizeObserver.observe(element);\n\n return () => {\n resizeObserver.disconnect();\n };\n }, [ref, notNeeded]);\n\n return size;\n}\n","/**\n * @file useEvents.ts\n * @description Hook to sanitize and prepare a list of calendar events.\n *\n * This utility currently acts as a basic validation layer, filtering out\n * completely invalid events (e.g., events where the end date chronologically\n * precedes the start date).\n */\n\nimport { useMemo } from \"react\";\nimport { dateFn } from \"../utils/date\";\nimport { CalendarEvent } from \"../types/events\";\n\n/**\n * Hook to filter and return only valid calendar events.\n *\n * Events where `endDate` is chronologically before `startDate` are silently removed.\n * This is intentional — such events have no renderable duration (C-TC3).\n *\n * @param events - The raw array of calendar events to process. Events with\n * `endDate < startDate` are filtered out (negative-duration guard).\n * @param eventsAreSorted - When `true`, skips validation and returns events as-is (caller guarantees\n * events are pre-sorted by `startDate` ascending). **Caveat:** unsorted input will render in the\n * provided order — the library never re-sorts the array.\n * @param enableEnrichedEvents - When `true`, skips validation (caller supplies pre-enriched events via `enrichedEventsByDate`).\n * @returns A memoized array containing only logically valid events.\n */\nexport default function useEvents(\n events: CalendarEvent[],\n eventsAreSorted?: boolean,\n enableEnrichedEvents?: boolean,\n) {\n const validEvents = useMemo(() => {\n // -------------------------------------------------------------------------\n // 1. Basic Validation: Filter invalid date ranges\n // -------------------------------------------------------------------------\n if (eventsAreSorted || enableEnrichedEvents) {\n return events;\n }\n\n return events.filter((event) => {\n if (!event.endDate) return true;\n return dateFn(event.endDate) >= dateFn(event.startDate);\n });\n }, [events, eventsAreSorted, enableEnrichedEvents]);\n\n return validEvents;\n}\n","import { useEffect, useState } from \"react\";\nimport type { ColorScheme } from \"../types\";\n\nconst PREFERS_DARK_QUERY = \"(prefers-color-scheme: dark)\";\n\nfunction readSystemScheme(): \"light\" | \"dark\" {\n if (\n typeof window === \"undefined\" ||\n typeof window.matchMedia !== \"function\"\n ) {\n return \"light\";\n }\n return window.matchMedia(PREFERS_DARK_QUERY).matches ? \"dark\" : \"light\";\n}\n\nexport default function useColorScheme(\n colorScheme: ColorScheme | undefined,\n): \"light\" | \"dark\" {\n const isAuto = colorScheme === undefined || colorScheme === \"auto\";\n\n const [systemScheme, setSystemScheme] = useState<\"light\" | \"dark\">(() =>\n isAuto ? readSystemScheme() : \"light\",\n );\n\n useEffect(() => {\n if (!isAuto) return;\n if (\n typeof window === \"undefined\" ||\n typeof window.matchMedia !== \"function\"\n )\n return;\n\n const mq = window.matchMedia(PREFERS_DARK_QUERY);\n const handler = (e: MediaQueryListEvent) =>\n setSystemScheme(e.matches ? \"dark\" : \"light\");\n\n setSystemScheme(mq.matches ? \"dark\" : \"light\");\n\n mq.addEventListener(\"change\", handler);\n return () => mq.removeEventListener(\"change\", handler);\n }, [isAuto]);\n\n if (colorScheme === \"light\" || colorScheme === \"dark\") return colorScheme;\n return systemScheme;\n}\n",".calendar {\n width: 100%;\n height: 100%;\n /* Default values, overridden by inline styles */\n --calendar-width: 0px;\n --calendar-height: 0px;\n\n font-family:\n ui-sans-serif,\n system-ui,\n -apple-system,\n BlinkMacSystemFont,\n \"Segoe UI\",\n Roboto,\n \"Helvetica Neue\",\n Arial,\n sans-serif;\n color: var(--text-primary);\n background-color: var(--bg-color);\n border: 1px solid var(--border-color);\n border-radius: var(--radius-lg);\n box-shadow: var(--shadow-md);\n box-sizing: border-box;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n\n & * {\n padding: 0;\n margin: 0;\n box-sizing: border-box;\n }\n}\n",".header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 1rem;\n background-color: transparent;\n width: 100%;\n box-sizing: border-box;\n flex-wrap: wrap;\n gap: 1rem;\n}\n\n@media (max-width: 768px) {\n .header {\n flex-direction: column;\n align-items: flex-start;\n padding: 0.75rem;\n gap: 0.5rem;\n }\n\n .navigation {\n width: 100%;\n justify-content: space-between;\n }\n\n .controls {\n width: 100%;\n justify-content: flex-start;\n flex-wrap: wrap;\n gap: 0.5rem;\n }\n\n .dateTitle {\n font-size: 1rem;\n }\n\n .select {\n font-size: 0.8125rem;\n padding-block: 0.375rem;\n padding-inline: 0.75rem 2rem;\n }\n\n .todayButton {\n font-size: 0.8125rem;\n padding: 0.375rem 0.75rem;\n }\n}\n\n.navigation {\n display: flex;\n align-items: center;\n gap: 1rem;\n}\n\n.todayButton {\n background-color: transparent;\n border: 1px solid var(--border-color);\n border-radius: var(--radius-md);\n color: var(--text-primary);\n cursor: pointer;\n font-family: inherit;\n font-size: 0.875rem;\n font-weight: 500;\n padding: 0.5rem 1rem;\n transition: all 0.2s ease;\n}\n\n.todayButton:hover {\n background-color: var(--bg-hover);\n border-color: var(--text-secondary);\n}\n\n.arrows {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n}\n\n.iconButton {\n background: transparent;\n border: 1px solid transparent;\n border-radius: var(--radius-md);\n color: var(--text-secondary);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 2rem;\n width: 2rem;\n outline: none;\n transition: all 0.2s ease;\n}\n\n.iconButton:hover {\n background-color: var(--bg-hover);\n color: var(--text-primary);\n}\n\n.dateTitle {\n color: var(--text-primary);\n font-family: inherit;\n font-size: 1.25rem;\n font-weight: 600;\n margin: 0;\n white-space: nowrap;\n}\n\n.controls {\n display: flex;\n align-items: center;\n gap: 0.75rem;\n}\n\n.select {\n appearance: none;\n background-color: var(--bg-color);\n background-image: url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E\");\n background-position: right 0.5rem center;\n background-repeat: no-repeat;\n background-size: 1.5em 1.5em;\n border: 1px solid var(--border-color);\n border-radius: var(--radius-md);\n color: var(--text-primary);\n cursor: pointer;\n font-family: inherit;\n font-size: 0.875rem;\n padding-block: 0.5rem;\n padding-inline: 1rem 2.5rem;\n transition: border-color 0.2s ease;\n outline: none;\n}\n\n.select:hover {\n border-color: var(--text-secondary);\n}\n\n.select:focus {\n border-color: var(--primary-color);\n box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);\n}\n\n[dir=\"rtl\"] .select {\n background-position: left 0.5rem center;\n}\n\n.iconButtonIcon {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n}\n\n[dir=\"rtl\"] .iconButtonIcon {\n transform: scaleX(-1);\n}\n","import React from \"react\";\n\nfunction LeftArrow() {\n return (\n <svg\n width=\"40px\"\n height=\"40px\"\n viewBox=\"0 0 24.00 24.00\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n stroke=\"currentColor\"\n transform=\"rotate(180)\"\n >\n <g id=\"SVGRepo_bgCarrier\" strokeWidth=\"0\" />\n <g\n id=\"SVGRepo_tracerCarrier\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <g id=\"SVGRepo_iconCarrier\">\n <path\n d=\"M10 7L15 12L10 17\"\n stroke=\"currentColor\"\n strokeWidth=\"1.2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </g>\n </svg>\n );\n}\n\nexport default LeftArrow;\n","import React from \"react\";\n\nfunction RightArrow() {\n return (\n <svg\n width=\"40px\"\n height=\"40px\"\n viewBox=\"0 0 24.00 24.00\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n stroke=\"currentColor\"\n >\n <g id=\"SVGRepo_bgCarrier\" strokeWidth=\"0\" />\n <g\n id=\"SVGRepo_tracerCarrier\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <g id=\"SVGRepo_iconCarrier\">\n <path\n d=\"M10 7L15 12L10 17\"\n stroke=\"currentColor\"\n strokeWidth=\"1.2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </g>\n </svg>\n );\n}\n\nexport default RightArrow;\n","/**\n * @file Calendar context — state management, reducer, provider, and consumer hook.\n */\nimport React, {\n createContext,\n useContext,\n useReducer,\n ReactNode,\n useMemo,\n Dispatch,\n} from \"react\";\nimport { dateFn, DateType } from \"../utils\";\nimport { ECalendarViewType, CalendarProps } from \"../types\";\nimport { CALENDAR_ACTIONS } from \"../constants\";\nimport useColorScheme from \"../hooks/useColorScheme\";\n\n/**\n * Mutable runtime state managed by the calendar reducer.\n */\nexport interface CalendarState {\n /** The currently selected (navigated-to) date. */\n selectedDate: DateType;\n /** The active view mode. */\n view: ECalendarViewType;\n /** Number of days shown when view is `customDays`. */\n customDays?: number;\n}\n\n/**\n * Union of all dispatchable actions for the calendar reducer.\n * - `SET_DATE` — jump to a specific date\n * - `SET_VIEW` — switch the active view\n * - `NEXT` / `PREV` — advance or retreat by one view-unit (month, week, day, or N custom days)\n * - `TODAY` — reset navigation to today\n */\nexport type CalendarAction =\n | { type: typeof CALENDAR_ACTIONS.SET_DATE; payload: DateType }\n | { type: typeof CALENDAR_ACTIONS.SET_VIEW; payload: ECalendarViewType }\n | { type: typeof CALENDAR_ACTIONS.SET_CUSTOM_DAYS; payload: number }\n | { type: typeof CALENDAR_ACTIONS.NEXT }\n | { type: typeof CALENDAR_ACTIONS.PREV }\n | { type: typeof CALENDAR_ACTIONS.TODAY };\n\n/**\n * Shape of the value exposed by `CalendarContext`.\n */\nexport interface CalendarContextValue {\n /** Current reducer state (selected date, view, customDays). */\n state: CalendarState;\n /** Dispatch function for sending actions to the reducer. */\n dispatch: Dispatch<CalendarAction>;\n /** `data-testid` forwarded from the root `<Calendar>` prop. */\n testId?: string;\n /** Static calendar configuration props (everything except `children`, `selectedDate`, and `view`). */\n config: Omit<CalendarProps, \"children\" | \"selectedDate\" | \"view\">;\n /** Resolved color scheme (\"light\" or \"dark\") for portaled UI such as Popover. */\n colorScheme: \"light\" | \"dark\";\n}\n\nexport const CalendarContext = createContext<CalendarContextValue | undefined>(\n undefined,\n);\n\n/**\n * Pure reducer that computes the next calendar state.\n * Navigation units map directly to Luxon duration keys (`month`, `week`, `day`);\n * `schedule` reuses `day` since it paginates one day at a time.\n *\n * @param state - Current calendar state.\n * @param action - Action to apply.\n * @returns Next calendar state.\n */\nfunction calendarReducer(\n state: CalendarState,\n action: CalendarAction,\n): CalendarState {\n switch (action.type) {\n case CALENDAR_ACTIONS.SET_DATE:\n return {\n ...state,\n selectedDate: action.payload,\n };\n case CALENDAR_ACTIONS.SET_VIEW:\n return { ...state, view: action.payload };\n case CALENDAR_ACTIONS.SET_CUSTOM_DAYS:\n return { ...state, customDays: action.payload };\n case CALENDAR_ACTIONS.NEXT: {\n if (state.view === ECalendarViewType.customDays) {\n return {\n ...state,\n selectedDate: state.selectedDate.plus({\n days: state.customDays || 3,\n }),\n };\n }\n const unit =\n state.view === ECalendarViewType.schedule ? \"day\" : state.view;\n return { ...state, selectedDate: state.selectedDate.plus({ [unit]: 1 }) };\n }\n case CALENDAR_ACTIONS.PREV: {\n if (state.view === ECalendarViewType.customDays) {\n return {\n ...state,\n selectedDate: state.selectedDate.minus({\n days: state.customDays || 3,\n }),\n };\n }\n const unit =\n state.view === ECalendarViewType.schedule ? \"day\" : state.view;\n return {\n ...state,\n selectedDate: state.selectedDate.minus({ [unit]: 1 }),\n };\n }\n case CALENDAR_ACTIONS.TODAY:\n return {\n ...state,\n selectedDate: dateFn(),\n };\n default:\n return state;\n }\n}\n\n/**\n * Props accepted by `CalendarProvider`.\n */\nexport interface CalendarProviderProps {\n /** Content rendered inside the calendar layout. */\n children: ReactNode;\n /** Starting selected date for the reducer. */\n initialDate: DateType;\n /** Starting view mode for the reducer. */\n initialView: ECalendarViewType;\n /** Starting value for `customDays` when the initial view is `customDays`. */\n initialCustomDays?: number;\n /** Forwarded `data-testid` from the root `<Calendar>` prop. */\n testId?: string;\n /** Static configuration props passed through to all child components via context. */\n config?: Omit<CalendarProps, \"children\" | \"selectedDate\" | \"view\">;\n}\n\n/**\n * Provides calendar state and dispatch to the component tree via `CalendarContext`.\n * Wrap view components with this provider; consume state via `useCalendar()`.\n */\nexport function CalendarProvider({\n children,\n initialDate,\n initialView,\n initialCustomDays,\n testId,\n config,\n}: CalendarProviderProps) {\n const [state, dispatch] = useReducer(calendarReducer, {\n selectedDate: initialDate,\n view: initialView,\n customDays: initialCustomDays,\n });\n\n const resolvedScheme = useColorScheme(config?.colorScheme);\n\n const value = useMemo(\n () => ({\n state,\n dispatch,\n testId,\n config:\n config ||\n ({} as Omit<CalendarProps, \"children\" | \"selectedDate\" | \"view\">),\n colorScheme: resolvedScheme,\n }),\n [state, testId, config, resolvedScheme],\n );\n\n return (\n <CalendarContext.Provider value={value}>\n {children}\n </CalendarContext.Provider>\n );\n}\n\n/**\n * Consumes `CalendarContext` and returns the current state, dispatch, and config.\n * Must be called inside a `CalendarProvider` — throws if the context is missing.\n *\n * @returns The current `CalendarContextValue`.\n */\nexport function useCalendar() {\n const context = useContext(CalendarContext);\n if (context === undefined) {\n throw new Error(\"useCalendar must be used within a CalendarProvider\");\n }\n return context;\n}\n","/**\n * @file Hook that merges context-level calendar config with view-local prop overrides.\n */\nimport { useCalendar } from \"../context/CalendarContext\";\nimport { CalendarProps, CalendarContentProps } from \"../types\";\n\n/**\n * Merges the global calendar config from context with view-local props.\n * Local props take precedence — undefined values are ignored so they don't\n * accidentally overwrite context defaults.\n *\n * @param localProps - Props specific to the calling view component.\n * @returns Merged `CalendarContentProps` with all required defaults guaranteed.\n */\nexport default function useCalendarProps<T extends Partial<CalendarProps>>(\n localProps: T,\n): CalendarContentProps {\n const { config } = useCalendar();\n\n const merged = { ...config } as Record<string, unknown>;\n for (const key in localProps) {\n if (localProps[key] !== undefined) {\n merged[key] = localProps[key];\n }\n }\n\n return merged as CalendarContentProps;\n}\n","import React, { ChangeEvent } from \"react\";\nimport cx from \"classnames\";\nimport {\n CalendarContentProps,\n ECalendarViewType,\n MonthListType,\n} from \"../../types\";\nimport {\n CALENDAR_STRINGS,\n DATE_FORMATS,\n CALENDAR_ACTIONS,\n VIEW_OPTIONS,\n} from \"../../constants\";\nimport {\n dateFn,\n getYearList,\n convertToDate,\n setMonth,\n setYear,\n formatDate,\n getMonth,\n getYear,\n getMonthList,\n} from \"../../utils\";\nimport styles from \"./Header.module.css\";\nimport LeftArrow from \"../../assets/LeftArrow\";\nimport RightArrow from \"../../assets/RightArrow\";\nimport { useCalendar } from \"../../context/CalendarContext\";\nimport useCalendarProps from \"../../hooks/useCalendarProps\";\n\nenum EMonthOption {\n add = \"add\",\n sub = \"sub\",\n}\n\nenum EYearOption {\n month = \"month\",\n year = \"year\",\n}\n\nexport type HeaderProps = Partial<\n Pick<\n CalendarContentProps,\n | \"pastYearLength\"\n | \"futureYearLength\"\n | \"onNavigate\"\n | \"onViewChange\"\n | \"customDays\"\n | \"resetDateOnViewChange\"\n | \"localeMessages\"\n | \"showWeekNumbers\"\n >\n> & {\n headerClassName?: string;\n};\n\nfunction Header(props: HeaderProps) {\n const {\n pastYearLength,\n futureYearLength,\n onNavigate,\n onViewChange,\n customDays,\n events,\n resetDateOnViewChange,\n locale,\n localeMessages,\n classNames,\n showWeekNumbers,\n } = useCalendarProps(props) as CalendarContentProps & {\n headerClassName?: string;\n };\n\n const finalHeaderClassName = props.headerClassName || classNames?.header;\n const { state, dispatch, testId } = useCalendar();\n const { selectedDate, view } = state;\n\n const onMonthArrowClick = (option: EMonthOption) => {\n const isAdd = option === EMonthOption.add;\n dispatch({ type: isAdd ? CALENDAR_ACTIONS.NEXT : CALENDAR_ACTIONS.PREV });\n\n const unit = (view === ECalendarViewType.schedule ? \"day\" : view) as\n | \"day\"\n | \"week\"\n | \"month\"\n | \"year\";\n\n let predictiveDate;\n if (view === ECalendarViewType.customDays) {\n predictiveDate = isAdd\n ? selectedDate.plus({ days: customDays || 3 })\n : selectedDate.minus({ days: customDays || 3 });\n } else {\n predictiveDate = isAdd\n ? selectedDate.plus({ [unit]: 1 })\n : selectedDate.minus({ [unit]: 1 });\n }\n\n onNavigate?.(convertToDate(predictiveDate));\n };\n\n const onDropdownClick = (\n event: ChangeEvent<HTMLSelectElement>,\n option: EYearOption,\n ) => {\n const value = Number(event.target.value);\n let newDate = selectedDate;\n\n if (option === EYearOption.month) {\n newDate = setMonth(selectedDate, value);\n } else if (option === EYearOption.year) {\n newDate = setYear(selectedDate, value);\n }\n\n dispatch({ type: CALENDAR_ACTIONS.SET_DATE, payload: newDate });\n onNavigate?.(convertToDate(newDate));\n };\n\n const onViewDropdownClick = (e: ChangeEvent<HTMLSelectElement>) => {\n const newView = e.target.value as ECalendarViewType;\n dispatch({ type: CALENDAR_ACTIONS.SET_VIEW, payload: newView });\n if (resetDateOnViewChange) {\n dispatch({ type: CALENDAR_ACTIONS.TODAY });\n onNavigate?.(convertToDate(dateFn()));\n }\n onViewChange?.(newView);\n };\n\n const getHeaderTitle = () => {\n const weekSuffix =\n view === ECalendarViewType.week && showWeekNumbers\n ? ` · W${selectedDate.weekNumber}`\n : \"\";\n\n if (view === ECalendarViewType.day) {\n return formatDate(selectedDate, DATE_FORMATS.MONTH_DAY_YEAR, locale);\n }\n if (view === ECalendarViewType.week) {\n const startOfWeek = selectedDate.startOf(\"week\");\n const endOfWeek = selectedDate.endOf(\"week\");\n let baseString;\n if (startOfWeek.month !== endOfWeek.month) {\n if (startOfWeek.year !== endOfWeek.year) {\n baseString = `${formatDate(startOfWeek, DATE_FORMATS.SHORT_MONTH_YEAR, locale)} - ${formatDate(endOfWeek, DATE_FORMATS.SHORT_MONTH_YEAR, locale)}`;\n } else {\n baseString = `${formatDate(startOfWeek, DATE_FORMATS.SHORT_MONTH, locale)} - ${formatDate(endOfWeek, DATE_FORMATS.SHORT_MONTH_YEAR, locale)}`;\n }\n } else {\n baseString = formatDate(selectedDate, DATE_FORMATS.MONTH_YEAR, locale);\n }\n return `${baseString}${weekSuffix}`;\n }\n if (view === ECalendarViewType.customDays) {\n const days = customDays || 3;\n const endDate = selectedDate.plus({ days: days - 1 });\n if (selectedDate.month !== endDate.month) {\n if (selectedDate.year !== endDate.year) {\n return `${formatDate(selectedDate, DATE_FORMATS.SHORT_MONTH_YEAR, locale)} - ${formatDate(endDate, DATE_FORMATS.SHORT_MONTH_YEAR, locale)}`;\n }\n return `${formatDate(selectedDate, DATE_FORMATS.SHORT_MONTH, locale)} - ${formatDate(endDate, DATE_FORMATS.SHORT_MONTH_YEAR, locale)}`;\n }\n if (days === 1) {\n return formatDate(selectedDate, DATE_FORMATS.MONTH_DAY_YEAR, locale);\n }\n return `${formatDate(selectedDate, DATE_FORMATS.DAY_DATE_SHORT_MONTH, locale)} - ${formatDate(endDate, DATE_FORMATS.DAY_DATE_SHORT_MONTH, locale)}, ${formatDate(selectedDate, \"yyyy\")}`;\n }\n if (view === ECalendarViewType.schedule) {\n if (events && events.length > 0) {\n let minDate = dateFn(events[0].startDate);\n let maxDate = minDate;\n\n events.forEach((event) => {\n const sd = dateFn(event.startDate);\n const ed = event.endDate ? dateFn(event.endDate) : sd;\n if (sd < minDate) minDate = sd;\n if (ed > maxDate) maxDate = ed;\n });\n\n if (minDate.month !== maxDate.month || minDate.year !== maxDate.year) {\n if (minDate.year !== maxDate.year) {\n return `${formatDate(minDate, DATE_FORMATS.SHORT_MONTH_YEAR, locale)} - ${formatDate(maxDate, DATE_FORMATS.SHORT_MONTH_YEAR, locale)}`;\n }\n return `${formatDate(minDate, DATE_FORMATS.SHORT_MONTH, locale)} - ${formatDate(maxDate, DATE_FORMATS.SHORT_MONTH_YEAR, locale)}`;\n }\n return formatDate(minDate, DATE_FORMATS.SHORT_MONTH_YEAR, locale);\n }\n }\n return formatDate(selectedDate, DATE_FORMATS.MONTH_YEAR, locale);\n };\n\n return (\n <div\n className={cx(styles.header, finalHeaderClassName)}\n data-testid={`${testId}-header`}\n >\n <nav className={styles.navigation} aria-label=\"Calendar navigation\">\n <button\n className={styles.todayButton}\n data-testid={`${testId}-header-today-btn`}\n aria-label={localeMessages?.today || \"Today\"}\n onClick={() => {\n dispatch({ type: CALENDAR_ACTIONS.TODAY });\n onNavigate?.(convertToDate(dateFn()));\n }}\n >\n {localeMessages?.today || \"Today\"}\n </button>\n <div className={styles.arrows}>\n <button\n className={styles.iconButton}\n data-testid={`${testId}-header-prev-btn`}\n aria-label=\"Previous period\"\n onClick={() => onMonthArrowClick(EMonthOption.sub)}\n >\n <span className={styles.iconButtonIcon}>\n <LeftArrow />\n </span>\n </button>\n <button\n className={styles.iconButton}\n data-testid={`${testId}-header-next-btn`}\n aria-label=\"Next period\"\n onClick={() => onMonthArrowClick(EMonthOption.add)}\n >\n <span className={styles.iconButtonIcon}>\n <RightArrow />\n </span>\n </button>\n </div>\n <h2 className={styles.dateTitle}>{getHeaderTitle()}</h2>\n </nav>\n\n <div className={styles.controls}>\n <select\n className={styles.select}\n value={view}\n data-testid={`${testId}-header-view-select`}\n aria-label=\"Select calendar view\"\n onChange={onViewDropdownClick}\n >\n {VIEW_OPTIONS.map((option) => (\n <option key={option.value} value={option.value}>\n {localeMessages?.[option.value as keyof typeof localeMessages] ||\n option.label}\n </option>\n ))}\n {customDays && customDays > 0 && customDays < 11 && (\n <option key={customDays} value={ECalendarViewType.customDays}>\n {customDays} {localeMessages?.days || \"Days\"}\n </option>\n )}\n </select>\n <select\n className={styles.select}\n id={CALENDAR_STRINGS.MONTH}\n name={CALENDAR_STRINGS.MONTH}\n value={getMonth(selectedDate)}\n data-testid={`${testId}-header-month-select`}\n aria-label=\"Select month\"\n onChange={(e) => onDropdownClick(e, EYearOption.month)}\n >\n {getMonthList(locale).map((month: MonthListType) => (\n <option key={month.label} value={month.value}>\n {month.label}\n </option>\n ))}\n </select>\n <select\n className={styles.select}\n id={CALENDAR_STRINGS.YEAR}\n name={CALENDAR_STRINGS.YEAR}\n value={getYear(selectedDate)}\n data-testid={`${testId}-header-year-select`}\n aria-label=\"Select year\"\n onChange={(e) => onDropdownClick(e, EYearOption.year)}\n >\n {getYearList(\n pastYearLength,\n futureYearLength,\n getYear(selectedDate),\n ).map((year: number) => (\n <option key={year} value={year}>\n {year}\n </option>\n ))}\n </select>\n </div>\n </div>\n );\n}\n\nexport default Header;\n","/**\n * @file useDayEventLayout.ts\n * @description Core logic for calculating the visual layout of timed events in a day/week view.\n *\n * This utility computes the positioning (top, left, width, height) of events\n * so that they are displayed chronologically, and visually stacked/wrapped\n * when overlapping. It employs:\n * 1. Filtering out all-day and multi-day events.\n * 2. Sweep-line algorithm to group overlapping events into \"clusters\".\n * 3. Greedy slot assignment to place events in columns without overlapping.\n * 4. Width expansion to let events take up available empty space dynamically.\n */\n\nimport { CalendarEvent } from \"../types\";\nimport { useMemo } from \"react\";\nimport { dateFn, DateType, formatDate } from \"../utils/date\";\nimport { isAllDayEvent, getEventOverlapInHours } from \"../utils/common\";\nimport { DATE_FORMATS, TIME_CONSTANTS } from \"../constants\";\n\nexport interface UseDayEventLayoutOptions {\n enableEnrichedEvents?: boolean;\n enrichedEventsByDate?: Record<string, CalendarEvent[]>;\n eventsAreSorted?: boolean;\n isEventOrderingEnabled?: boolean;\n}\n\n/**\n * Represents the final calculated CSS positioning for an event in the day view.\n */\nexport interface DayEventLayout {\n event: CalendarEvent;\n top: number;\n height: number;\n left: number;\n width: number;\n zIndex: number;\n}\n\n/**\n * Internal representation of an event being processed during the layout algorithm.\n * Tracks temporary states like starting minute, ending minute, and assigned column.\n */\ninterface ProcessedEvent {\n id: string;\n start: number;\n end: number;\n duration: number;\n original: CalendarEvent;\n columnIndex?: number;\n left?: number;\n width?: number;\n expandCols?: number;\n}\n\n/**\n * Hook to calculate layout and positioning for timed events in a day or week view.\n *\n * @param events - The complete array of calendar events.\n * @param currentDateOrDates - A single date (for Day view) or array of dates (for Week view) to render.\n * @returns A layout array (for a single day) or a nested array of layouts (for multiple days).\n */\nexport default function useDayEventLayout(\n events: CalendarEvent[],\n currentDateOrDates: DateType | DateType[],\n minHour: number,\n maxHour: number,\n showAllDayRow: boolean,\n eventOverlapOffset: number,\n options: UseDayEventLayoutOptions = {},\n): DayEventLayout[] | DayEventLayout[][] {\n const {\n enableEnrichedEvents,\n enrichedEventsByDate,\n eventsAreSorted,\n isEventOrderingEnabled = true,\n } = options;\n\n return useMemo(() => {\n const dates = Array.isArray(currentDateOrDates)\n ? currentDateOrDates\n : [currentDateOrDates];\n\n const generateLayoutForDate = (currentDate: DateType) => {\n // -------------------------------------------------------------------------\n // 1. Initial Filtering: Only process timed events for this specific day\n // -------------------------------------------------------------------------\n const getEventsForDay = () => {\n const filterFn = (event: CalendarEvent) => {\n const currentDay = dateFn(currentDate).startOf(\"day\");\n\n // Check if event overlaps this calendar day at all\n const eventStart = dateFn(event.startDate).startOf(\"day\");\n const eventEnd = event.endDate\n ? dateFn(event.endDate).endOf(\"day\")\n : eventStart.endOf(\"day\");\n\n const overlapsCurrentDay =\n currentDay >= eventStart.startOf(\"day\") &&\n currentDay <= eventEnd.startOf(\"day\");\n\n if (!overlapsCurrentDay) return false;\n\n const isAllDay = isAllDayEvent(event);\n\n if (showAllDayRow) {\n if (isAllDay) return false;\n if (getEventOverlapInHours(event, currentDay) >= 12) return false;\n\n // To ensure we restrict to visible operating hours\n const actStartMs = Math.max(\n dateFn(event.startDate).valueOf(),\n currentDay.valueOf(),\n );\n const actEndMs = Math.min(\n event.endDate ? dateFn(event.endDate).valueOf() : actStartMs,\n currentDay.endOf(\"day\").valueOf() + 1,\n );\n\n const startMins = Math.floor(\n (actStartMs - currentDay.valueOf()) /\n TIME_CONSTANTS.MS_PER_MINUTE,\n );\n const endMins = Math.floor(\n (actEndMs - currentDay.valueOf()) / TIME_CONSTANTS.MS_PER_MINUTE,\n );\n\n const isWithinBounds =\n endMins > minHour * TIME_CONSTANTS.MINUTES_IN_HOUR &&\n startMins < maxHour * TIME_CONSTANTS.MINUTES_IN_HOUR;\n return isWithinBounds;\n }\n\n // If hiding the all-day row, we want to show all events that overlap this day\n return true;\n };\n\n if (enableEnrichedEvents && enrichedEventsByDate) {\n const dateStr = formatDate(currentDate, DATE_FORMATS.DATE);\n return (enrichedEventsByDate[dateStr] || []).filter(filterFn);\n }\n return events.filter(filterFn);\n };\n\n const eventsForDay = getEventsForDay();\n\n if (eventsForDay.length === 0) return [];\n\n // -------------------------------------------------------------------------\n // 2. Data Preparation: Convert dates to minutes from start of day\n // -------------------------------------------------------------------------\n const processedEvents: ProcessedEvent[] = eventsForDay.map(\n (event, index) => {\n const currentDayStartMs = dateFn(currentDate)\n .startOf(\"day\")\n .valueOf();\n const currentDayEndMs = dateFn(currentDate).endOf(\"day\").valueOf();\n\n const isAllDay = isAllDayEvent(event);\n const overlapHours = getEventOverlapInHours(event, currentDate);\n\n const actStartMs = Math.max(\n dateFn(event.startDate).valueOf(),\n currentDayStartMs,\n );\n const actEndMs = Math.min(\n event.endDate ? dateFn(event.endDate).valueOf() : actStartMs,\n currentDayEndMs + 1, // Add 1ms to include exact midnight\n );\n\n let start = Math.floor((actStartMs - currentDayStartMs) / 60000);\n let end = Math.floor((actEndMs - currentDayStartMs) / 60000);\n\n if (start === end) end += 1;\n\n if (!showAllDayRow && (isAllDay || overlapHours >= 12)) {\n // Force it to span the entire visible grid (minHour to maxHour)\n start = minHour * TIME_CONSTANTS.MINUTES_IN_HOUR;\n end = maxHour * TIME_CONSTANTS.MINUTES_IN_HOUR;\n }\n\n // Clamp start and end to boundaries for the algorithm\n const clampedStart = Math.max(\n start,\n minHour * TIME_CONSTANTS.MINUTES_IN_HOUR,\n );\n const clampedEnd = Math.min(\n end,\n maxHour * TIME_CONSTANTS.MINUTES_IN_HOUR,\n );\n\n return {\n id: `${index}-${event.title}`,\n start: clampedStart,\n end: clampedEnd,\n duration: clampedEnd - clampedStart,\n original: event,\n };\n },\n );\n\n // -------------------------------------------------------------------------\n // Phase 1 - Sorting: Start time asc, then Duration desc\n // -------------------------------------------------------------------------\n if (!eventsAreSorted) {\n processedEvents.sort((a, b) => {\n if (a.start === b.start) return b.duration - a.duration;\n return a.start - b.start;\n });\n }\n\n // If ordering is disabled, bypass expensive layout processing\n if (!isEventOrderingEnabled) {\n return processedEvents.map((event) => {\n event.columnIndex = 0; // Use a constant so zIndex stays 1 and naturally DOM-stacks without breaking header z-indexes\n event.left = 0;\n event.width = 1;\n return toLayout(event);\n });\n }\n\n // -------------------------------------------------------------------------\n // Phase 2 - Sweep-line Clustering: Group overlapping events\n //\n // Iterates through sorted events and groups them into \"clusters\".\n // Two events are in the same cluster if they overlap in time. A cluster\n // ends when the next event's start time is >= the maximum end time seen so far.\n // -------------------------------------------------------------------------\n const clusters: ProcessedEvent[][] = [];\n let currentCluster: ProcessedEvent[] = [];\n let clusterMaxEnd = -Infinity;\n\n for (const event of processedEvents) {\n if (currentCluster.length > 0 && event.start >= clusterMaxEnd) {\n clusters.push(currentCluster);\n currentCluster = [];\n clusterMaxEnd = -Infinity;\n }\n currentCluster.push(event);\n clusterMaxEnd = Math.max(clusterMaxEnd, event.end);\n }\n if (currentCluster.length > 0) clusters.push(currentCluster);\n\n // -------------------------------------------------------------------------\n // Phases 3–5: Calculate relative layout per cluster\n // -------------------------------------------------------------------------\n for (const cluster of clusters) {\n // Phase 3 - Greedy Column Assignment\n // Assign each event to the first column where it does not overlap with the\n // last event in that column. If it doesn't fit in any, add a new column.\n const columns: ProcessedEvent[][] = [];\n\n for (const event of cluster) {\n let placed = false;\n for (let c = 0; c < columns.length; c++) {\n const lastEvent = columns[c][columns[c].length - 1];\n if (lastEvent.end <= event.start) {\n columns[c].push(event);\n event.columnIndex = c;\n placed = true;\n break;\n }\n }\n\n if (!placed) {\n event.columnIndex = columns.length;\n columns.push([event]);\n }\n }\n\n const totalCols = columns.length;\n\n // Phase 4 - Initialise default dimensions\n for (const event of cluster) {\n if (eventOverlapOffset > 0) {\n // Stacked layout: each column is shifted by offset\n event.left = (event.columnIndex! * eventOverlapOffset) / 100;\n event.width = 1 - event.left;\n } else {\n // Tiled layout: equal width\n event.left = event.columnIndex! / totalCols;\n event.width = 1 / totalCols;\n }\n }\n\n // Phase 5 - Width Expansion (Only for tiled layout)\n if (eventOverlapOffset === 0) {\n const colMap: Map<number, ProcessedEvent[]> = new Map();\n for (const event of cluster) {\n const c = event.columnIndex!;\n if (!colMap.has(c)) colMap.set(c, []);\n colMap.get(c)!.push(event);\n }\n\n for (const event of cluster) {\n let expandCols = 1;\n\n for (let c = event.columnIndex! + 1; c < totalCols; c++) {\n const colEvents = colMap.get(c) ?? [];\n const blocked = colEvents.some(\n (other) => other.start < event.end && event.start < other.end,\n );\n if (blocked) break;\n expandCols++;\n }\n\n const maxPossibleCols = totalCols - event.columnIndex!;\n event.expandCols = Math.min(expandCols, maxPossibleCols);\n event.width = event.expandCols / totalCols;\n }\n }\n }\n\n function toLayout(event: ProcessedEvent): DayEventLayout {\n const rawHeight = event.end - event.start;\n // Shift top by the minHour offset\n const top = event.start - minHour * TIME_CONSTANTS.MINUTES_IN_HOUR;\n\n return {\n event: event.original,\n top: Math.max(0, top), // ensure it never renders above container\n height: Math.max(rawHeight, 15),\n left: parseFloat((event.left! * 100).toFixed(4)),\n width: parseFloat((event.width! * 100).toFixed(4)),\n zIndex: Math.min(event.columnIndex! + 1, 14), // Cap z-index below 15 (timeHeaderSpacer) and 20 (stickyTopContainer)\n };\n }\n\n return clusters.flatMap((cluster) => cluster.map(toLayout));\n };\n\n if (Array.isArray(currentDateOrDates)) {\n return dates.map((d) => generateLayoutForDate(d));\n }\n return generateLayoutForDate(dates[0]);\n }, [\n events,\n currentDateOrDates,\n minHour,\n maxHour,\n showAllDayRow,\n eventOverlapOffset,\n enableEnrichedEvents,\n enrichedEventsByDate,\n eventsAreSorted,\n isEventOrderingEnabled,\n ]);\n}\n",".dayView {\n display: flex;\n flex-direction: column;\n height: 100%;\n overflow-y: auto;\n overflow-x: auto;\n border: 1px solid var(--border-color);\n border-radius: 8px;\n}\n\n.stickyTopContainer {\n position: sticky;\n top: 0;\n z-index: 20;\n background-color: var(--bg-color);\n display: flex;\n flex-direction: column;\n box-shadow: 0 4px 6px -4px rgba(0, 0, 0, 0.1);\n}\n\n.dayHeaderContainer {\n display: flex;\n border-bottom: 1px solid var(--border-color);\n background-color: var(--bg-hover);\n}\n\n.timeHeaderSpacer {\n width: 60px;\n flex-shrink: 0;\n border-inline-end: 1px solid var(--border-color);\n position: sticky;\n inset-inline-start: 0;\n z-index: 15;\n background-color: var(--bg-hover);\n}\n\n.dayHeader {\n flex: 1;\n text-align: center;\n padding: 10px 0;\n}\n\n.dayName {\n font-size: 12px;\n color: var(--text-secondary);\n text-transform: uppercase;\n}\n\n.dayNumber {\n font-size: 20px;\n font-weight: 500;\n margin-top: 4px;\n}\n\n.dayNumber.today {\n color: var(--primary-color);\n font-weight: bold;\n}\n\n.timeGrid {\n display: grid;\n grid-template-columns: 60px 1fr;\n flex: 1;\n /* min-width: 300px; */\n}\n\n.eventsColumn {\n position: relative;\n}\n\n/* ── Tablet & Phone (768px): reduce day header font for narrow screens ── */\n@media (max-width: 768px) {\n .dayNumber {\n font-size: 16px;\n margin-top: 2px;\n }\n\n .dayHeader {\n padding: 6px 0;\n }\n}\n",".timeColumn {\n width: 60px;\n flex-shrink: 0;\n border-inline-end: 1px solid var(--border-color);\n position: sticky;\n inset-inline-start: 0;\n z-index: 5;\n background-color: var(--bg-color);\n}\n\n.timeSlot {\n height: 60px; /* 1 hour height */\n border-bottom: 1px solid var(--border-color);\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 12px;\n color: var(--text-secondary);\n}\n","import React from \"react\";\nimport cx from \"classnames\";\nimport { dateFn, formatDate } from \"../../../utils\";\nimport { DATE_FORMATS } from \"../../../constants\";\nimport styles from \"./TimeColumn.module.css\";\nimport { CalendarContentProps } from \"../../../types\";\nimport { useCalendar } from \"../../../context/CalendarContext\";\n\ninterface TimeColumnProps extends Pick<\n CalendarContentProps,\n \"is12Hour\" | \"classNames\" | \"minHour\" | \"maxHour\" | \"locale\"\n> {}\n\nfunction TimeColumn({\n is12Hour,\n classNames,\n minHour,\n maxHour,\n locale,\n}: TimeColumnProps) {\n const { testId } = useCalendar();\n const hours = Array.from(\n { length: maxHour - minHour },\n (_, i) => i + minHour,\n );\n\n return (\n <div\n className={cx(styles.timeColumn, classNames?.timeColumn)}\n data-testid={`${testId}-time-column`}\n >\n {hours.map((hour) => {\n const timeFormat = is12Hour ? DATE_FORMATS.HOUR_12H : DATE_FORMATS.TIME;\n return (\n <div key={hour} className={cx(styles.timeSlot, classNames?.timeSlot)}>\n {formatDate(dateFn().set({ hour, minute: 0 }), timeFormat, locale)}\n </div>\n );\n })}\n </div>\n );\n}\n\nexport default TimeColumn;\n",".eventItem {\n position: absolute;\n inset-inline-start: 5px;\n inset-inline-end: 5px;\n padding: 4px 5px;\n background-color: #3b82f6;\n color: white;\n border-radius: 4px;\n font-size: 12px;\n overflow: hidden;\n cursor: pointer;\n box-sizing: border-box;\n width: calc(var(--event-width) - 2px);\n display: flex;\n flex-direction: column;\n line-height: 1.2;\n}\n\n.eventItemSmall {\n flex-direction: row;\n align-items: center;\n gap: 4px;\n padding: 2px 5px;\n}\n\n.eventItemTiny {\n flex-direction: row;\n align-items: center;\n gap: 4px;\n padding: 1px 4px;\n font-size: 10px;\n line-height: 1;\n}\n\n.eventTitle {\n font-weight: 500;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.eventTime {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n opacity: 0.9;\n}\n","import React, { CSSProperties } from \"react\";\nimport cx from \"classnames\";\nimport {\n formatDate,\n generateTooltipText,\n getContrastColor,\n handleKeyboardActivation,\n} from \"../../../utils\";\nimport { CalendarContentProps } from \"../../../types\";\nimport { DayEventLayout } from \"../../../hooks/useDayEventLayout\";\nimport { LAYOUT_CONSTANTS, DATE_FORMATS } from \"../../../constants\";\nimport styles from \"./DayWeekEventItem.module.css\";\nimport { useCalendar } from \"../../../context/CalendarContext\";\n\ninterface DayWeekEventItemProps extends Pick<\n CalendarContentProps,\n \"onEventClick\" | \"is12Hour\" | \"classNames\" | \"renderEvent\"\n> {\n item: DayEventLayout;\n}\n\nexport function DayWeekEventItem({\n item,\n onEventClick,\n is12Hour,\n classNames,\n renderEvent,\n}: DayWeekEventItemProps) {\n const { testId } = useCalendar();\n const tooltipText = generateTooltipText(item.event, \"day\", is12Hour);\n\n const isSmall =\n item.height < LAYOUT_CONSTANTS.SMALL_EVENT_HEIGHT &&\n item.height >= LAYOUT_CONSTANTS.TINY_EVENT_HEIGHT;\n const isTiny = item.height < LAYOUT_CONSTANTS.TINY_EVENT_HEIGHT;\n\n const eventBgColor =\n item.event.style?.backgroundColor || LAYOUT_CONSTANTS.DEFAULT_EVENT_COLOR;\n const textColor = getContrastColor(String(eventBgColor));\n\n return (\n <div\n role=\"button\"\n tabIndex={0}\n className={cx(styles.eventItem, classNames?.event, {\n [styles.eventItemSmall]: isSmall,\n [styles.eventItemTiny]: isTiny,\n })}\n data-testid={`${testId}-${item.event.id}-day-event-item`}\n style={\n {\n top: `${item.top}px`,\n height: `${item.height}px`,\n insetInlineStart: `${item.left}%`,\n zIndex: item.zIndex,\n \"--event-width\": `${item.width}%`,\n backgroundColor: LAYOUT_CONSTANTS.DEFAULT_EVENT_COLOR,\n color: textColor,\n position: \"absolute\",\n ...item.event.style,\n } as CSSProperties\n }\n id={item.event.id}\n aria-label={`${item.event.title}, ${tooltipText}`}\n onClick={() => onEventClick?.(item.event)}\n onKeyDown={handleKeyboardActivation(() => onEventClick?.(item.event))}\n title={tooltipText}\n >\n {renderEvent ? (\n renderEvent(item.event)\n ) : (\n <>\n <div className={styles.eventTitle}>{item.event.title}</div>\n <div className={styles.eventTime}>\n {formatDate(\n item.event.startDate,\n is12Hour ? DATE_FORMATS.TIME_12H : DATE_FORMATS.TIME,\n )}\n </div>\n </>\n )}\n </div>\n );\n}\n",".currentTimeLine {\n position: absolute;\n inset-inline: 0;\n height: 2px;\n z-index: 10;\n pointer-events: none;\n display: flex;\n align-items: center;\n}\n\n.circle {\n width: 12px;\n height: 12px;\n background-color: #ea4335;\n border-radius: 50%;\n position: absolute;\n inset-inline-start: -6px;\n}\n\n.line {\n height: 2px;\n width: 100%;\n background-color: #ea4335;\n}\n","import React, { useEffect, useState } from \"react\";\nimport cx from \"classnames\";\nimport styles from \"./CurrentTimeLine.module.css\";\nimport { dateFn } from \"../../../utils\";\nimport { CalendarContentProps } from \"../../../types\";\nimport { useCalendar } from \"../../../context/CalendarContext\";\nimport { TIME_CONSTANTS } from \"../../../constants\";\n\ninterface CurrentTimeLineProps extends Pick<\n CalendarContentProps,\n \"minHour\" | \"maxHour\"\n> {\n className?: string;\n}\n\nconst CurrentTimeLine = ({\n className,\n minHour,\n maxHour,\n}: CurrentTimeLineProps) => {\n const { testId } = useCalendar();\n const [position, setPosition] = useState(() => {\n const now = dateFn();\n return (now.hour - minHour) * TIME_CONSTANTS.MINUTES_IN_HOUR + now.minute;\n });\n\n useEffect(() => {\n const updatePosition = () => {\n const now = dateFn();\n const hours = now.hour;\n const minutes = now.minute;\n // eventSlot height is 60px per hour\n const totalMinutes =\n (hours - minHour) * TIME_CONSTANTS.MINUTES_IN_HOUR + minutes;\n setPosition(totalMinutes);\n };\n\n updatePosition();\n const interval = setInterval(updatePosition, TIME_CONSTANTS.MS_PER_MINUTE);\n\n return () => clearInterval(interval);\n }, [minHour]);\n\n if (\n position < 0 ||\n position > (maxHour - minHour) * TIME_CONSTANTS.MINUTES_IN_HOUR\n ) {\n return null;\n }\n\n return (\n <div\n className={cx(styles.currentTimeLine, className)}\n style={{ top: `${position}px` }}\n data-testid={`${testId}-current-time-line`}\n >\n <div className={styles.circle} />\n <div className={styles.line} />\n </div>\n );\n};\n\nexport default CurrentTimeLine;\n",".eventSlot {\n height: 60px; /* Match timeSlot height */\n border-bottom: 1px solid var(--border-color);\n}\n\n.creatable {\n cursor: pointer;\n}\n","import React from \"react\";\nimport cx from \"classnames\";\nimport { DateTime } from \"luxon\";\nimport { CalendarContentProps } from \"../../../types\";\nimport { DayEventLayout } from \"../../../hooks/useDayEventLayout\";\nimport { DayWeekEventItem } from \"../day_event_item/DayWeekEventItem\";\nimport CurrentTimeLine from \"../current_time_line/CurrentTimeLine\";\nimport { handleKeyboardActivation } from \"../../../utils\";\nimport styles from \"./DayColumn.module.css\";\n\ninterface DayColumnProps extends Pick<\n CalendarContentProps,\n | \"onEventClick\"\n | \"is12Hour\"\n | \"classNames\"\n | \"showCurrentTime\"\n | \"minHour\"\n | \"maxHour\"\n | \"renderEvent\"\n | \"renderHourCell\"\n | \"creatable\"\n | \"onSlotClick\"\n> {\n dayEvents: DayEventLayout[];\n date: DateTime;\n isToday?: boolean;\n}\n\nfunction DayColumn({\n dayEvents,\n date,\n onEventClick,\n is12Hour,\n classNames,\n isToday,\n showCurrentTime,\n minHour,\n maxHour,\n renderEvent,\n renderHourCell,\n creatable,\n onSlotClick,\n}: DayColumnProps) {\n const hours = Array.from(\n { length: maxHour - minHour },\n (_, i) => i + minHour,\n );\n\n return (\n <>\n {hours.map((hour) => {\n const isInteractive = creatable && !!onSlotClick;\n const slotStart = date.set({\n hour,\n minute: 0,\n second: 0,\n millisecond: 0,\n });\n const slotLabel = `Create event at ${slotStart.toFormat(\n \"h:mm a, MMMM d\",\n )}`;\n const handleClick = isInteractive\n ? () =>\n onSlotClick!(\n slotStart.toJSDate(),\n slotStart.plus({ hours: 1 }).toJSDate(),\n )\n : undefined;\n\n return (\n <div\n key={hour}\n role={isInteractive ? \"button\" : undefined}\n tabIndex={isInteractive ? 0 : undefined}\n aria-label={isInteractive ? slotLabel : undefined}\n className={cx(styles.eventSlot, classNames?.timeSlot, {\n [styles.creatable]: creatable,\n })}\n onClick={handleClick}\n onKeyDown={\n isInteractive ? handleKeyboardActivation(handleClick!) : undefined\n }\n >\n {renderHourCell?.(new Date(new Date().setHours(hour, 0, 0, 0)))}\n </div>\n );\n })}\n {dayEvents.map((item, index) => (\n <DayWeekEventItem\n key={item.event.id || index}\n item={item}\n onEventClick={onEventClick}\n is12Hour={is12Hour}\n classNames={classNames}\n renderEvent={renderEvent}\n />\n ))}\n {isToday && showCurrentTime && (\n <CurrentTimeLine minHour={minHour} maxHour={maxHour} />\n )}\n </>\n );\n}\n\nexport default DayColumn;\n","/**\n * @file useAllDayBanner.ts\n * @description Core logic for calculating the layout of the all-day and multi-day events banner.\n *\n * This utility handles the complex task of:\n * 1. Filtering events that span multiple days or are marked as all-day.\n * 2. Identifying intersecting events within the currently visible days.\n * 3. Sorting events to optimize visual flow (longest events first).\n * 4. Stacking events vertically using a Tetris-like row assignment algorithm to avoid overlap.\n * 5. Calculating expand/collapse states and dynamically resolving container heights.\n */\n\nimport { useMemo } from \"react\";\nimport { dateFn, DateType } from \"../utils/date\";\nimport { CalendarEvent } from \"../types\";\nimport {\n isAllDayEvent,\n isMultiDay,\n getEventOverlapInHours,\n} from \"../utils/common\";\nimport { LAYOUT_CONSTANTS } from \"../constants\";\n\n/**\n * Represents the layout information for an event displayed in the all-day banner.\n */\nexport interface BannerLayoutEvent {\n /** The original calendar event data */\n event: CalendarEvent;\n /** The index of the day where the event starts within the current view */\n startIndex: number;\n /** The index of the day where the event ends within the current view */\n endIndex: number;\n /** Indicates if the event starts before the current view's start date */\n isClippedLeft: boolean;\n /** Indicates if the event ends after the current view's end date */\n isClippedRight: boolean;\n /** The vertical row index where the event should be positioned to avoid overlap */\n row: number;\n}\n\n/**\n * Hook to calculate layout and positioning for multi-day and all-day events in a banner view.\n * It determines which events are visible, how they stack vertically to avoid overlapping,\n * and handles an expanded/collapsed state when there are too many concurrent events.\n *\n * @param days - The array of days currently visible in the calendar view.\n * @param events - The complete array of calendar events to filter and layout.\n * @param isExpanded - Whether the banner is currently expanded to show all stacked events.\n * @param maxVisibleRows - The maximum number of event rows to show before collapsing (default: 3).\n * @returns An object containing layout details:\n * - `layoutEvents`: All calculated events that intersect with the current view.\n * - `rowCount`: The total number of rows required to display all events without overlap.\n * - `effectiveMaxRows`: The effective limit on visible rows.\n * - `hiddenCounts`: An array representing the number of hidden events for each day index.\n * - `hasHiddenEvents`: A boolean flag indicating if any events exceed the `maxVisibleRows`.\n * - `visibleLayoutEvents`: The events that should currently be rendered based on the `isExpanded` state.\n * - `containerHeight`: The computed height of the banner container.\n * - `showExpandCollapse`: A boolean flag indicating if the expand/collapse button should be rendered.\n */\nexport default function useAllDayBanner(\n days: DateType[],\n events: CalendarEvent[],\n isExpanded: boolean,\n maxVisibleRows: number = 3,\n) {\n return useMemo(() => {\n if (days.length === 0) {\n return {\n layoutEvents: [],\n rowCount: 0,\n effectiveMaxRows: maxVisibleRows,\n hiddenCounts: [],\n hasHiddenEvents: false,\n visibleLayoutEvents: [],\n containerHeight: 28,\n showExpandCollapse: false,\n };\n }\n\n const viewStart = dateFn(days[0]).startOf(\"day\");\n const viewEnd = dateFn(days[days.length - 1]).startOf(\"day\");\n\n // -------------------------------------------------------------------------\n // 1. Event Filtering: Multi-day and All-day events\n // -------------------------------------------------------------------------\n const multiDayEvents = events.filter(\n (e) => isMultiDay(e) || isAllDayEvent(e),\n );\n\n // -------------------------------------------------------------------------\n // 2. Event Identification: Intersecting Events (via hybrid slices)\n // -------------------------------------------------------------------------\n const processedEvents = multiDayEvents.map((event) => {\n const exactStart = dateFn(event.startDate);\n const exactEnd = event.endDate ? dateFn(event.endDate) : exactStart;\n\n let bannerStartDay = exactStart.startOf(\"day\");\n if (\n !isAllDayEvent(event) &&\n getEventOverlapInHours(event, bannerStartDay) < 12\n ) {\n bannerStartDay = bannerStartDay.plus({ days: 1 });\n }\n\n let bannerEndDay = exactEnd.startOf(\"day\");\n if (\n !isAllDayEvent(event) &&\n getEventOverlapInHours(event, bannerEndDay) < 12\n ) {\n bannerEndDay = bannerEndDay.minus({ days: 1 });\n }\n\n return { event, bannerStartDay, bannerEndDay, exactStart, exactEnd };\n });\n\n const intersectingEvents = processedEvents.filter(\n ({ bannerStartDay, bannerEndDay }) => {\n if (bannerStartDay > bannerEndDay) return false;\n // Intersects if start is before viewEnd AND end is after viewStart\n return (\n (bannerStartDay < viewEnd || bannerStartDay.equals(viewEnd)) &&\n (bannerEndDay > viewStart || bannerEndDay.equals(viewStart))\n );\n },\n );\n\n // -------------------------------------------------------------------------\n // 3. Event Sorting: Start Date asc, then Duration desc\n //\n // Sorting by start date ensures chronological order left-to-right.\n // Secondary sorting by duration (descending) puts longer events at the top,\n // reducing visual fragmentation and allowing shorter events to tile underneath nicely.\n // -------------------------------------------------------------------------\n intersectingEvents.sort((a, b) => {\n const startA = dateFn(a.event.startDate).valueOf();\n const startB = dateFn(b.event.startDate).valueOf();\n if (startA === startB) {\n const durA = a.event.endDate\n ? dateFn(a.event.endDate).valueOf() - startA\n : 0;\n const durB = b.event.endDate\n ? dateFn(b.event.endDate).valueOf() - startB\n : 0;\n return durB - durA; // longest first\n }\n return startA - startB;\n });\n\n const rows: BannerLayoutEvent[][] = [];\n const layoutEvents: BannerLayoutEvent[] = [];\n\n // -------------------------------------------------------------------------\n // 4. Slot Assignment: \"Tetris\" Algorithm\n //\n // The goal here is to calculate the start and end column index for each event\n // and assign a vertical \"row\" index so no overlapping events share a row.\n // -------------------------------------------------------------------------\n intersectingEvents.forEach(\n ({ event, bannerStartDay, bannerEndDay, exactStart, exactEnd }) => {\n // Calculate bound indices for the current visible view\n let startIndex = days.findIndex((d) =>\n dateFn(d).startOf(\"day\").equals(bannerStartDay),\n );\n if (startIndex === -1 && bannerStartDay < viewStart) {\n startIndex = 0;\n }\n\n let endIndex = days.findIndex((d) =>\n dateFn(d).startOf(\"day\").equals(bannerEndDay),\n );\n if (endIndex === -1 && bannerEndDay > viewEnd) {\n endIndex = days.length - 1;\n }\n\n // It might happen that the event is completely outside the days, but we already filtered for intersections.\n if (startIndex === -1) startIndex = 0;\n if (endIndex === -1) endIndex = days.length - 1;\n\n const isClippedLeft =\n bannerStartDay < viewStart ||\n exactStart.startOf(\"day\") < bannerStartDay;\n const isClippedRight =\n bannerEndDay > viewEnd || exactEnd.startOf(\"day\") > bannerEndDay;\n\n // Row stacking: Find the lowest row index where the event fits without overlap\n let rowIndex = 0;\n while (true) {\n if (!rows[rowIndex]) {\n rows[rowIndex] = [];\n break;\n }\n const hasOverlap = rows[rowIndex].some((existingEvent) => {\n return (\n startIndex <= existingEvent.endIndex &&\n endIndex >= existingEvent.startIndex\n );\n });\n if (!hasOverlap) {\n break;\n }\n rowIndex++;\n }\n\n const layoutEvent: BannerLayoutEvent = {\n event,\n startIndex,\n endIndex,\n isClippedLeft,\n isClippedRight,\n row: rowIndex,\n };\n\n rows[rowIndex].push(layoutEvent);\n layoutEvents.push(layoutEvent);\n },\n );\n\n const rowCount = rows.length;\n\n const effectiveMaxRows =\n rowCount === maxVisibleRows + 1 ? maxVisibleRows + 1 : maxVisibleRows;\n\n const hiddenCounts = new Array(days.length).fill(0);\n // -------------------------------------------------------------------------\n // 5. Overflow and Display Calculation\n //\n // Manage which events are hidden under an \"expand\" toggle if there\n // are too many concurrent rows, and compute height/visibility states accordingly.\n // -------------------------------------------------------------------------\n layoutEvents.forEach((ev) => {\n if (ev.row >= effectiveMaxRows) {\n for (\n let i = Math.max(0, ev.startIndex);\n i <= Math.min(days.length - 1, ev.endIndex);\n i++\n ) {\n hiddenCounts[i]++;\n }\n }\n });\n\n const hasHiddenEvents = hiddenCounts.some((count) => count > 0);\n\n const visibleLayoutEvents = isExpanded\n ? layoutEvents\n : layoutEvents.filter((ev) => ev.row < effectiveMaxRows);\n\n const containerHeight = isExpanded\n ? Math.max(\n rowCount * LAYOUT_CONSTANTS.ALL_DAY_ROW_HEIGHT + 4,\n LAYOUT_CONSTANTS.DATE_LABEL_HEIGHT,\n )\n : hasHiddenEvents\n ? Math.max(\n (effectiveMaxRows + 1) * LAYOUT_CONSTANTS.ALL_DAY_ROW_HEIGHT + 4,\n LAYOUT_CONSTANTS.DATE_LABEL_HEIGHT,\n )\n : Math.max(\n rowCount * LAYOUT_CONSTANTS.ALL_DAY_ROW_HEIGHT + 4,\n LAYOUT_CONSTANTS.DATE_LABEL_HEIGHT,\n );\n\n const showExpandCollapse = hasHiddenEvents || isExpanded;\n\n return {\n layoutEvents,\n rowCount,\n effectiveMaxRows,\n hiddenCounts,\n hasHiddenEvents,\n visibleLayoutEvents,\n containerHeight,\n showExpandCollapse,\n };\n }, [days, events, isExpanded, maxVisibleRows]);\n}\n",".bannerWrapper {\n display: flex;\n width: 100%;\n border-bottom: 1px solid var(--border-color);\n}\n\n.timeHeaderSpacer {\n width: 60px;\n flex-shrink: 0;\n border-inline-end: 1px solid var(--border-color);\n position: sticky;\n inset-inline-start: 0;\n z-index: 15;\n background-color: var(--bg-color);\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-items: center;\n padding: 4px 0 2px 0;\n}\n\n.timezoneLabel {\n font-size: 10px;\n font-weight: 500;\n color: var(--text-secondary);\n text-align: center;\n margin-top: 4px;\n}\n\n.expandIcon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n cursor: pointer;\n color: var(--text-secondary);\n transition:\n background-color 0.2s,\n transform 0.2s;\n}\n\n.expandIcon:hover {\n background-color: var(--bg-hover);\n}\n\n.expandIcon.expanded {\n transform: rotate(180deg);\n}\n\n.bannerContainer {\n position: relative;\n flex: 1;\n display: flex;\n flex-direction: column;\n flex-shrink: 0;\n padding-bottom: 4px;\n min-height: 28px;\n overflow: hidden;\n box-sizing: border-box;\n}\n\n.bannerGridBg {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n pointer-events: none;\n}\n\n.bannerGridCell {\n flex: 1;\n border-inline-end: 1px solid var(--border-color);\n}\n\n.bannerGridCell:last-child {\n border-inline-end: none;\n}\n\n.bannerRow {\n position: relative;\n height: 22px;\n width: 100%;\n margin-top: 2px;\n}\n\n.bannerChip {\n position: absolute;\n height: 20px;\n top: 1px;\n display: flex;\n align-items: center;\n padding: 0 4px;\n font-size: 11px;\n font-weight: 500;\n color: #fff;\n background-color: #1a73e8;\n border-radius: 4px;\n box-sizing: border-box;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n cursor: pointer;\n z-index: 10;\n}\n\n.bannerChip.clippedLeft {\n clip-path: polygon(10px 0, 100% 0, 100% 100%, 10px 100%, 0 50%);\n padding-inline-start: 14px;\n border-start-start-radius: 0;\n border-end-start-radius: 0;\n}\n\n.bannerChip.clippedRight {\n clip-path: polygon(\n 0 0,\n calc(100% - 10px) 0,\n 100% 50%,\n calc(100% - 10px) 100%,\n 0 100%\n );\n padding-inline-end: 14px;\n border-start-end-radius: 0;\n border-end-end-radius: 0;\n}\n\n.bannerChip.clippedLeft.clippedRight {\n clip-path: polygon(\n 10px 0,\n calc(100% - 10px) 0,\n 100% 50%,\n calc(100% - 10px) 100%,\n 10px 100%,\n 0 50%\n );\n padding-inline: 14px;\n border-radius: 0;\n}\n\n[dir=\"rtl\"] .bannerChip.clippedLeft {\n clip-path: polygon(\n 0 0,\n calc(100% - 10px) 0,\n 100% 50%,\n calc(100% - 10px) 100%,\n 0 100%\n );\n}\n\n[dir=\"rtl\"] .bannerChip.clippedRight {\n clip-path: polygon(10px 0, 100% 0, 100% 100%, 10px 100%, 0 50%);\n}\n\n.title {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n flex-grow: 1;\n}\n\n.moreChip {\n position: absolute;\n font-size: 0.75rem;\n font-weight: 600;\n color: var(--text-secondary);\n background: transparent;\n border-radius: 4px;\n box-sizing: border-box;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n cursor: pointer;\n z-index: 10;\n display: flex;\n align-items: center;\n padding: 0.15rem 0.5rem;\n transition: background-color 0.2s;\n}\n\n.moreChip:hover {\n background-color: var(--bg-hover);\n color: var(--text-primary);\n}\n","import React, { useState, useEffect } from \"react\";\nimport cx from \"classnames\";\nimport {\n DateType,\n getGmtOffset,\n generateTooltipText,\n getContrastColor,\n handleKeyboardActivation,\n} from \"../../../utils\";\nimport {\n CalendarEvent,\n CalendarContentProps,\n ECalendarViewType,\n} from \"../../../types\";\nimport useAllDayBanner, {\n BannerLayoutEvent,\n} from \"../../../hooks/useAllDayBanner\";\nimport styles from \"./AllDayBanner.module.css\";\nimport { LAYOUT_CONSTANTS } from \"../../../constants\";\nimport { useCalendar } from \"../../../context/CalendarContext\";\n\ninterface AllDayBannerProps extends Pick<\n CalendarContentProps,\n | \"maxEvents\"\n | \"onEventClick\"\n | \"classNames\"\n | \"is12Hour\"\n | \"renderEvent\"\n | \"locale\"\n> {\n days: DateType[];\n events: CalendarEvent[];\n}\n\nexport default function AllDayBanner({\n days,\n events,\n maxEvents,\n onEventClick,\n classNames,\n is12Hour,\n renderEvent,\n locale,\n}: AllDayBannerProps) {\n const { testId } = useCalendar();\n const [isExpanded, setIsExpanded] = useState(false);\n const MAX_VISIBLE_ROWS = maxEvents ?? 3;\n\n useEffect(() => {\n setIsExpanded(false);\n }, [days]);\n\n const {\n layoutEvents,\n effectiveMaxRows,\n hiddenCounts,\n visibleLayoutEvents,\n containerHeight,\n showExpandCollapse,\n } = useAllDayBanner(days, events, isExpanded, MAX_VISIBLE_ROWS);\n\n const renderGridBg = () => (\n <div className={styles.bannerGridBg}>\n {days.map((_, idx) => (\n <div key={idx} className={styles.bannerGridCell} />\n ))}\n </div>\n );\n\n const gmtLabel = getGmtOffset();\n\n if (layoutEvents.length === 0) {\n return (\n <div\n role=\"region\"\n aria-label=\"All-day events\"\n className={styles.bannerWrapper}\n data-testid={`${testId}-all-day-banner`}\n >\n <div className={styles.timeHeaderSpacer}>\n <span className={styles.timezoneLabel}>{gmtLabel}</span>\n </div>\n <div className={styles.bannerContainer}>{renderGridBg()}</div>\n </div>\n );\n }\n\n const totalCols = days.length;\n\n return (\n <div\n role=\"region\"\n aria-label=\"All-day events\"\n className={styles.bannerWrapper}\n data-testid={`${testId}-all-day-banner`}\n >\n <div className={styles.timeHeaderSpacer}>\n <span className={styles.timezoneLabel}>{gmtLabel}</span>\n {showExpandCollapse && (\n <div\n role=\"button\"\n tabIndex={0}\n className={cx(styles.expandIcon, {\n [styles.expanded]: isExpanded,\n })}\n data-testid={`${testId}-all-day-expand-icon`}\n aria-label={\n isExpanded ? \"Collapse all-day events\" : \"Expand all-day events\"\n }\n aria-expanded={isExpanded}\n onClick={() => setIsExpanded((prev) => !prev)}\n onKeyDown={handleKeyboardActivation(() =>\n setIsExpanded((prev) => !prev),\n )}\n >\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <polyline points=\"6 9 12 15 18 9\" />\n </svg>\n </div>\n )}\n </div>\n <div\n className={styles.bannerContainer}\n style={{ height: containerHeight }}\n >\n {renderGridBg()}\n {visibleLayoutEvents.map(\n (layoutEvent: BannerLayoutEvent, idx: number) => {\n const {\n event,\n row,\n startIndex,\n endIndex,\n isClippedLeft,\n isClippedRight,\n } = layoutEvent;\n\n const leftPct = (startIndex / totalCols) * 100;\n const widthPct = ((endIndex - startIndex + 1) / totalCols) * 100;\n const topPx = row * LAYOUT_CONSTANTS.ALL_DAY_ROW_HEIGHT + 2;\n\n const eventBgColor =\n event.style?.backgroundColor ||\n LAYOUT_CONSTANTS.DEFAULT_EVENT_COLOR;\n const textColor = getContrastColor(String(eventBgColor));\n\n return (\n <div\n key={event.id || `banner-evt-${idx}`}\n role=\"button\"\n tabIndex={0}\n className={cx(styles.bannerChip, classNames?.event, {\n [styles.clippedLeft]: isClippedLeft,\n [styles.clippedRight]: isClippedRight,\n })}\n style={{\n top: `${topPx}px`,\n left: `${leftPct}%`,\n width: `calc(${widthPct}% - 4px)`,\n backgroundColor: LAYOUT_CONSTANTS.DEFAULT_EVENT_COLOR,\n color: textColor,\n ...event.style,\n }}\n data-testid={`${testId}-${event.id}-all-day-event`}\n aria-label={generateTooltipText(\n event,\n ECalendarViewType.week,\n is12Hour,\n locale,\n )}\n onClick={() => onEventClick?.(event)}\n onKeyDown={handleKeyboardActivation(() =>\n onEventClick?.(event),\n )}\n title={generateTooltipText(\n event,\n ECalendarViewType.week,\n is12Hour,\n locale,\n )}\n >\n {renderEvent ? (\n renderEvent(event)\n ) : (\n <span className={styles.title}>{event.title}</span>\n )}\n </div>\n );\n },\n )}\n {!isExpanded &&\n hiddenCounts.map((count: number, idx: number) => {\n if (count === 0) return null;\n const leftPct = (idx / totalCols) * 100;\n const widthPct = (1 / totalCols) * 100;\n const topPx =\n effectiveMaxRows * LAYOUT_CONSTANTS.ALL_DAY_ROW_HEIGHT + 2;\n\n return (\n <div\n key={`more-${idx}`}\n role=\"button\"\n tabIndex={0}\n className={styles.moreChip}\n style={{\n top: `${topPx}px`,\n left: `${leftPct}%`,\n width: `calc(${widthPct}% - 4px)`,\n }}\n data-testid={`${testId}-${idx}-all-day-more-chip`}\n aria-label={`${count} more all-day events, click to expand`}\n onClick={() => setIsExpanded(true)}\n onKeyDown={handleKeyboardActivation(() => setIsExpanded(true))}\n >\n + {count} more\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n","import React, { useEffect, useRef } from \"react\";\nimport cx from \"classnames\";\nimport {\n getDayOfWeek,\n dateFn,\n formatDate,\n getDayListNames,\n resolveTheme,\n} from \"../../../utils\";\nimport useDayEventLayout, {\n DayEventLayout,\n} from \"../../../hooks/useDayEventLayout\";\nimport { CalendarContentProps } from \"../../../types\";\nimport { DATE_FORMATS, TIME_CONSTANTS } from \"../../../constants\";\nimport styles from \"./DayView.module.css\";\nimport { useCalendar } from \"../../../context/CalendarContext\";\nimport useCalendarProps from \"../../../hooks/useCalendarProps\";\nimport TimeColumn from \"../../core/time_column/TimeColumn\";\nimport DayColumn from \"../../core/day_column/DayColumn\";\nimport AllDayBanner from \"../../core/all_day_banner/AllDayBanner\";\n\nexport type DayViewProps = Partial<\n Pick<\n CalendarContentProps,\n | \"is12Hour\"\n | \"dayType\"\n | \"onEventClick\"\n | \"theme\"\n | \"classNames\"\n | \"showCurrentTime\"\n | \"maxEvents\"\n | \"autoScrollToCurrentTime\"\n | \"minHour\"\n | \"maxHour\"\n | \"renderEvent\"\n | \"renderHourCell\"\n | \"renderDateCell\"\n | \"showAllDayRow\"\n | \"eventOverlapOffset\"\n | \"enableEnrichedEvents\"\n | \"enrichedEventsByDate\"\n | \"eventsAreSorted\"\n | \"isEventOrderingEnabled\"\n | \"creatable\"\n | \"onSlotClick\"\n >\n>;\n\nfunction DayView(props: DayViewProps) {\n const {\n events,\n onEventClick,\n dayType,\n is12Hour,\n theme,\n classNames,\n showCurrentTime,\n maxEvents,\n autoScrollToCurrentTime,\n minHour,\n maxHour,\n renderEvent,\n renderHourCell,\n renderDateCell,\n showAllDayRow,\n eventOverlapOffset,\n enableEnrichedEvents,\n enrichedEventsByDate,\n eventsAreSorted,\n isEventOrderingEnabled,\n locale,\n creatable,\n onSlotClick,\n } = useCalendarProps(props);\n const containerRef = useRef<HTMLDivElement>(null);\n const { state, testId, colorScheme } = useCalendar();\n const { selectedDate } = state;\n const dayEvents = useDayEventLayout(\n events,\n selectedDate,\n minHour,\n maxHour,\n showAllDayRow,\n eventOverlapOffset,\n {\n enableEnrichedEvents,\n enrichedEventsByDate,\n eventsAreSorted,\n isEventOrderingEnabled,\n },\n ) as DayEventLayout[];\n\n const isToday = dateFn().hasSame(selectedDate, \"day\");\n\n const resolvedTheme = resolveTheme(theme, colorScheme);\n const todayStyle = isToday\n ? {\n color: resolvedTheme.today?.color,\n backgroundColor: resolvedTheme.today?.bgColor,\n }\n : undefined;\n\n useEffect(() => {\n if (autoScrollToCurrentTime && containerRef.current && isToday) {\n const now = dateFn();\n const hours = now.hour;\n const minutes = now.minute;\n const totalMinutes = hours * TIME_CONSTANTS.MINUTES_IN_HOUR + minutes;\n\n const container = containerRef.current;\n const targetScroll = Math.max(\n 0,\n totalMinutes - container.clientHeight / 2,\n );\n\n container.scrollTo({ top: targetScroll, behavior: \"smooth\" });\n }\n }, [autoScrollToCurrentTime, isToday]);\n\n return (\n <div\n role=\"region\"\n aria-label=\"Day view\"\n className={styles.dayView}\n ref={containerRef}\n data-testid={`${testId}-day-view`}\n >\n <div className={styles.stickyTopContainer}>\n <div className={styles.dayHeaderContainer}>\n <div className={styles.timeHeaderSpacer} />\n {renderDateCell ? (\n renderDateCell({\n date: selectedDate.toJSDate(),\n isToday,\n })\n ) : (\n <div className={cx(styles.dayHeader, classNames?.dayHeader)}>\n <div className={cx(styles.dayName, classNames?.dayName)}>\n {getDayListNames(dayType, locale)[getDayOfWeek(selectedDate)]}\n </div>\n <div\n className={cx(styles.dayNumber, classNames?.dayNumber, {\n [styles.today]: isToday,\n })}\n style={todayStyle}\n >\n {formatDate(selectedDate, DATE_FORMATS.DAY_NUMBER, locale)}\n </div>\n </div>\n )}\n </div>\n {showAllDayRow && (\n <AllDayBanner\n days={[selectedDate]}\n events={events || []}\n maxEvents={maxEvents}\n onEventClick={onEventClick}\n classNames={classNames}\n is12Hour={is12Hour}\n renderEvent={renderEvent}\n locale={locale}\n />\n )}\n </div>\n <div className={styles.timeGrid}>\n <TimeColumn\n is12Hour={is12Hour}\n classNames={classNames}\n minHour={minHour}\n maxHour={maxHour}\n locale={locale}\n />\n <div\n className={cx(styles.eventsColumn, classNames?.dayColumn)}\n data-testid={`${testId}-day-column`}\n >\n <DayColumn\n dayEvents={dayEvents}\n date={selectedDate}\n onEventClick={onEventClick}\n is12Hour={is12Hour}\n classNames={classNames}\n isToday={isToday}\n showCurrentTime={showCurrentTime}\n minHour={minHour}\n maxHour={maxHour}\n renderEvent={renderEvent}\n renderHourCell={renderHourCell}\n creatable={creatable}\n onSlotClick={onSlotClick}\n />\n </div>\n </div>\n </div>\n );\n}\n\nexport default DayView;\n",".weekView {\n display: flex;\n flex-direction: column;\n height: 100%;\n overflow-y: auto;\n overflow-x: auto;\n border: 1px solid var(--border-color);\n border-radius: 8px;\n}\n\n.stickyTopContainer {\n position: sticky;\n top: 0;\n z-index: 20;\n background-color: var(--bg-color);\n display: flex;\n flex-direction: column;\n box-shadow: 0 4px 6px -4px rgba(0, 0, 0, 0.1);\n}\n\n.weekHeader {\n display: flex;\n border-bottom: 1px solid var(--border-color);\n background-color: var(--bg-hover);\n}\n\n.timeHeaderSpacer {\n width: 60px;\n flex-shrink: 0;\n border-inline-end: 1px solid var(--border-color);\n position: sticky;\n inset-inline-start: 0;\n z-index: 15;\n background-color: var(--bg-hover);\n}\n\n.dayHeader {\n flex: 1;\n text-align: center;\n padding: 10px 0;\n border-inline-end: 1px solid var(--border-color);\n}\n\n.dayHeader:last-child {\n border-inline-end: none;\n}\n\n.dayName {\n font-size: 12px;\n color: var(--text-secondary);\n text-transform: uppercase;\n}\n\n.dayNumber {\n font-size: 20px;\n font-weight: 500;\n margin-top: 4px;\n}\n\n.dayNumber.today {\n color: var(--primary-color);\n font-weight: bold;\n}\n\n.timeGrid {\n display: flex;\n flex: 1;\n /* min-width: 600px; */\n}\n\n.eventsGrid {\n display: flex;\n flex: 1;\n}\n\n.dayColumn {\n flex: 1;\n position: relative;\n border-inline-end: 1px solid var(--border-color);\n}\n\n.dayColumn:last-child {\n border-inline-end: none;\n}\n\n/* ── Tablet (768px): ~3 day columns visible, rest accessible by scroll ── */\n@media (max-width: 768px) {\n .dayHeader {\n min-width: 100px;\n flex: 0 0 100px;\n }\n\n .dayColumn {\n min-width: 100px;\n flex: 0 0 100px;\n }\n\n .dayName {\n font-size: 10px;\n }\n\n .dayNumber {\n font-size: 15px;\n }\n}\n\n/* ── Phone (480px): 1 day column fills the viewport, scroll for others ── */\n@media (max-width: 480px) {\n .dayHeader {\n min-width: calc(100vw - 90px);\n flex: 0 0 calc(100vw - 90px);\n }\n\n .dayColumn {\n min-width: calc(100vw - 90px);\n flex: 0 0 calc(100vw - 90px);\n }\n}\n","import React, { useMemo, useEffect, useRef } from \"react\";\nimport cx from \"classnames\";\nimport {\n getDayOfWeek,\n dateFn,\n formatDate,\n getDayListNames,\n resolveTheme,\n} from \"../../../utils\";\nimport useDayEventLayout, {\n DayEventLayout,\n} from \"../../../hooks/useDayEventLayout\";\nimport { CalendarContentProps } from \"../../../types\";\nimport { DATE_FORMATS, TIME_CONSTANTS } from \"../../../constants\";\nimport styles from \"./WeekView.module.css\";\nimport { useCalendar } from \"../../../context/CalendarContext\";\nimport useCalendarProps from \"../../../hooks/useCalendarProps\";\nimport TimeColumn from \"../../core/time_column/TimeColumn\";\nimport DayColumn from \"../../core/day_column/DayColumn\";\nimport AllDayBanner from \"../../core/all_day_banner/AllDayBanner\";\n\nexport type WeekViewProps = Partial<\n Pick<\n CalendarContentProps,\n | \"is12Hour\"\n | \"dayType\"\n | \"onEventClick\"\n | \"theme\"\n | \"classNames\"\n | \"showCurrentTime\"\n | \"maxEvents\"\n | \"autoScrollToCurrentTime\"\n | \"weekStartsOn\"\n | \"weekEndsOn\"\n | \"minHour\"\n | \"maxHour\"\n | \"renderEvent\"\n | \"renderHourCell\"\n | \"renderDateCell\"\n | \"showAllDayRow\"\n | \"eventOverlapOffset\"\n | \"enableEnrichedEvents\"\n | \"enrichedEventsByDate\"\n | \"eventsAreSorted\"\n | \"isEventOrderingEnabled\"\n | \"creatable\"\n | \"onSlotClick\"\n >\n>;\n\nfunction WeekView(props: WeekViewProps) {\n const {\n events,\n onEventClick,\n dayType,\n is12Hour,\n theme,\n classNames,\n showCurrentTime,\n maxEvents,\n autoScrollToCurrentTime,\n weekStartsOn,\n weekEndsOn,\n minHour,\n maxHour,\n renderEvent,\n renderHourCell,\n renderDateCell,\n showAllDayRow,\n eventOverlapOffset,\n enableEnrichedEvents,\n enrichedEventsByDate,\n eventsAreSorted,\n isEventOrderingEnabled,\n locale,\n creatable,\n onSlotClick,\n } = useCalendarProps(props);\n const containerRef = useRef<HTMLDivElement>(null);\n const { state, testId, colorScheme } = useCalendar();\n const { selectedDate } = state;\n const startOfWeek = useMemo(() => {\n const currentDay = getDayOfWeek(selectedDate);\n const diff =\n currentDay >= weekStartsOn\n ? weekStartsOn - currentDay\n : weekStartsOn - currentDay - TIME_CONSTANTS.DAYS_IN_WEEK;\n return selectedDate.plus({ days: diff }).startOf(\"day\");\n }, [selectedDate, weekStartsOn]);\n\n const weekDays = useMemo(() => {\n let length = weekEndsOn - weekStartsOn + 1;\n if (length <= 0) length += TIME_CONSTANTS.DAYS_IN_WEEK;\n return Array.from({ length }, (_, i) => startOfWeek.plus({ days: i }));\n }, [startOfWeek, weekStartsOn, weekEndsOn]);\n\n const weekEvents = useDayEventLayout(\n events,\n weekDays,\n minHour,\n maxHour,\n showAllDayRow,\n eventOverlapOffset,\n {\n enableEnrichedEvents,\n enrichedEventsByDate,\n eventsAreSorted,\n isEventOrderingEnabled,\n },\n ) as DayEventLayout[][];\n\n const isCurrentWeek = useMemo(() => {\n const now = dateFn();\n return weekDays.some((day) => now.hasSame(day, \"day\"));\n }, [weekDays]);\n\n useEffect(() => {\n if (autoScrollToCurrentTime && containerRef.current && isCurrentWeek) {\n const now = dateFn();\n const hours = now.hour;\n const minutes = now.minute;\n const totalMinutes = hours * TIME_CONSTANTS.MINUTES_IN_HOUR + minutes;\n\n const container = containerRef.current;\n const targetScroll = Math.max(\n 0,\n totalMinutes - container.clientHeight / 2,\n );\n\n container.scrollTo({ top: targetScroll, behavior: \"smooth\" });\n }\n }, [autoScrollToCurrentTime, isCurrentWeek]);\n\n return (\n <div\n role=\"region\"\n aria-label=\"Week view\"\n className={styles.weekView}\n ref={containerRef}\n data-testid={`${testId}-week-view`}\n >\n <div className={styles.stickyTopContainer}>\n <div className={styles.weekHeader}>\n <div className={styles.timeHeaderSpacer} />\n {weekDays.map((date, index) => {\n const isToday = dateFn().hasSame(date, \"day\");\n const resolvedTheme = resolveTheme(theme, colorScheme);\n const todayStyle = isToday\n ? {\n color: resolvedTheme.today?.color,\n backgroundColor: resolvedTheme.today?.bgColor,\n }\n : undefined;\n\n return renderDateCell ? (\n renderDateCell({\n date: date.toJSDate(),\n isToday,\n })\n ) : (\n <div\n key={index}\n className={cx(styles.dayHeader, classNames?.dayHeader)}\n >\n <div className={cx(styles.dayName, classNames?.dayName)}>\n {getDayListNames(dayType, locale)[getDayOfWeek(date)]}\n </div>\n <div\n className={cx(styles.dayNumber, classNames?.dayNumber, {\n [styles.today]: isToday,\n })}\n style={todayStyle}\n >\n {formatDate(date, DATE_FORMATS.DAY_NUMBER, locale)}\n </div>\n </div>\n );\n })}\n </div>\n {showAllDayRow && (\n <AllDayBanner\n days={weekDays}\n events={events || []}\n maxEvents={maxEvents}\n onEventClick={onEventClick}\n classNames={classNames}\n is12Hour={is12Hour}\n renderEvent={renderEvent}\n locale={locale}\n />\n )}\n </div>\n <div className={styles.timeGrid}>\n <TimeColumn\n is12Hour={is12Hour}\n classNames={classNames}\n minHour={minHour}\n maxHour={maxHour}\n locale={locale}\n />\n <div className={styles.eventsGrid}>\n {weekDays.map((date, dayIndex) => {\n const isToday = dateFn().hasSame(date, \"day\");\n return (\n <div\n key={dayIndex}\n className={cx(styles.dayColumn, classNames?.dayColumn)}\n data-testid={`${testId}-day-column`}\n >\n <DayColumn\n dayEvents={weekEvents[dayIndex]}\n date={date}\n onEventClick={onEventClick}\n is12Hour={is12Hour}\n classNames={classNames}\n isToday={isToday}\n showCurrentTime={showCurrentTime}\n minHour={minHour}\n maxHour={maxHour}\n renderEvent={renderEvent}\n renderHourCell={renderHourCell}\n creatable={creatable}\n onSlotClick={onSlotClick}\n />\n </div>\n );\n })}\n </div>\n </div>\n </div>\n );\n}\n\nexport default WeekView;\n","export default function (target, offset) {\n\tvar i=0, j=0, week, out=[], date = new Date(target || new Date);\n\tvar year = date.getFullYear(), month = date.getMonth();\n\n\t// day index (of week) for 1st of month\n\tvar first = new Date(year, month, 1 - (offset | 0)).getDay();\n\n\t// how many days there are in this month\n\tvar days = new Date(year, month+1, 0).getDate();\n\n\twhile (i < days) {\n\t\tfor (j=0, week=Array(7); j < 7;) {\n\t\t\twhile (j < first) week[j++] = 0;\n\t\t\tweek[j++] = ++i > days ? 0 : i;\n\t\t\tfirst = 0;\n\t\t}\n\t\tout.push(week);\n\t}\n\n\treturn out;\n}\n","/**\n * @file monthGrid.ts\n * @description Core logic for generating the calendar grid and managing event layout.\n *\n * This utility handles the complex task of:\n * 1. Generating a grid of dates for the current month view.\n * 2. Placing events onto this grid.\n * 3. Handling multi-day events that span across weeks.\n * 4. Calculating vertical slot assignments for events to prevent visual overlaps (the \"Tetris\" problem).\n */\n\nimport { useMemo } from \"react\";\nimport calendarize from \"calendarize\";\nimport {\n checkIsToday,\n DateType,\n getMonthStartingDay,\n getStartOfDay,\n getDiffDays,\n getStartOfMonth,\n setDate,\n addDays,\n isBeforeDate,\n isAfterDate,\n isSameDate,\n formatDate,\n subDays,\n getDate,\n} from \"../utils/date\";\nimport { CalendarEvent, EventListType } from \"../types\";\nimport { DATE_FORMATS, TIME_CONSTANTS } from \"../constants\";\n\ninterface InternalCalendarEvent extends CalendarEvent {\n _tempId?: string;\n}\n\n/**\n * Represents the information for a single day in the calendar grid.\n */\ninterface CalendarDayInfo {\n /** The full date object */\n currentDate: DateType;\n /** Whether the day belongs to the currently selected month (for styling) */\n isCurrentMonth: boolean;\n /** The day number to display (1-31) */\n displayDay: number;\n /** List of events or spacers for this day's slots */\n events: (EventListType | null)[];\n /** Total number of events on this day (including hidden ones) */\n totalEvents: number;\n /** Whether this day is today */\n isToday: boolean;\n}\n\n/**\n * 2D array representing the calendar grid: [week][day]\n */\ntype CalendarMatrix = CalendarDayInfo[][];\n\n/**\n * Generates the grid of days and events for the monthly view.\n *\n * This function handles:\n * 1. Grid Generation: Calculates the days for each week, handling previous/next month overlap.\n * 2. Event Processing: Filters events for each week and sorts them.\n * 3. Slot Assignment: Uses a \"tetris-like\" algorithm to stack overlapping events into available vertical slots.\n * 4. Data Preparation: Formats the data for the UI, including calculating event continuity across days.\n *\n * @param selectedDate - The currently selected date (determining the month to show)\n * @returns A structured matrix of weeks and days with assigned events\n */\nexport interface UseMonthGridOptions {\n enableEnrichedEvents?: boolean;\n enrichedEventsByDate?: Record<string, CalendarEvent[]>;\n eventsAreSorted?: boolean;\n isEventOrderingEnabled?: boolean;\n sortedMonthView?: boolean | ((a: CalendarEvent, b: CalendarEvent) => number);\n}\n\nexport default function useMonthGrid(\n selectedDate: DateType,\n events: CalendarEvent[],\n weekStartsOn: number,\n weekEndsOn: number,\n options: UseMonthGridOptions = {},\n): CalendarMatrix {\n const {\n enableEnrichedEvents,\n enrichedEventsByDate,\n eventsAreSorted,\n isEventOrderingEnabled = true,\n sortedMonthView = true,\n } = options;\n\n return useMemo(() => {\n // Sort events\n const dataEvents = eventsAreSorted\n ? events\n : [...events].sort((a, b) => {\n return getDiffDays(\n getStartOfDay(a.startDate),\n getStartOfDay(b.startDate),\n );\n });\n\n const length =\n ((weekEndsOn - weekStartsOn + TIME_CONSTANTS.DAYS_IN_WEEK) %\n TIME_CONSTANTS.DAYS_IN_WEEK) +\n 1;\n const calendarArray = calendarize(selectedDate.toJSDate(), weekStartsOn);\n\n return calendarArray.map((week: number[], weekIndex: number) => {\n const slicedWeek = week.slice(0, length);\n // -------------------------------------------------------------------------\n // 1. Grid Generation: Calculate dates for the entire week first\n // -------------------------------------------------------------------------\n const processedWeek = slicedWeek.map((day: number, dayIndex: number) => {\n let currentDate: DateType;\n let isCurrentMonth = true;\n let displayDay = day;\n\n if (day === 0) {\n isCurrentMonth = false;\n const startOfMonth = getStartOfMonth(selectedDate);\n const startDayOfWeek = getMonthStartingDay(selectedDate);\n const diffFromWeekStartToMonthStart =\n (startDayOfWeek - weekStartsOn + TIME_CONSTANTS.DAYS_IN_WEEK) %\n TIME_CONSTANTS.DAYS_IN_WEEK;\n\n if (weekIndex === 0) {\n currentDate = subDays(\n startOfMonth,\n diffFromWeekStartToMonthStart - dayIndex,\n );\n displayDay = getDate(currentDate);\n } else {\n const globalIndex =\n weekIndex * TIME_CONSTANTS.DAYS_IN_WEEK + dayIndex;\n const daysFromStart = globalIndex - diffFromWeekStartToMonthStart;\n\n currentDate = addDays(startOfMonth, daysFromStart);\n displayDay = getDate(currentDate);\n }\n } else {\n currentDate = setDate(selectedDate, day);\n }\n return { currentDate, isCurrentMonth, displayDay };\n });\n\n // -------------------------------------------------------------------------\n // 2. Event Identification: Identify all events overlapping with this week\n // -------------------------------------------------------------------------\n const weekStart = getStartOfDay(processedWeek[0].currentDate);\n const weekEnd = getStartOfDay(\n processedWeek[processedWeek.length - 1].currentDate,\n );\n\n let weekEvents: InternalCalendarEvent[] = [];\n\n if (enableEnrichedEvents && enrichedEventsByDate) {\n const addedEventIds = new Set<string>();\n for (let i = 0; i < length; i++) {\n const dateStr = formatDate(\n processedWeek[i].currentDate,\n DATE_FORMATS.DATE,\n );\n const dayEvents = enrichedEventsByDate[dateStr] || [];\n dayEvents.forEach((e) => {\n const eventId = e.id || e.startDate + e.title;\n if (!addedEventIds.has(eventId)) {\n weekEvents.push({ ...e });\n addedEventIds.add(eventId);\n }\n });\n }\n } else {\n weekEvents = dataEvents.filter((item) => {\n const start = getStartOfDay(item.startDate);\n const end = item.endDate ? getStartOfDay(item.endDate) : start;\n // Check overlap\n return (\n isBeforeDate(start, addDays(weekEnd, 1)) &&\n isAfterDate(end, subDays(weekStart, 1))\n );\n });\n }\n\n // -------------------------------------------------------------------------\n // 3. Event Sorting: Start Date asc, then Duration desc\n //\n // Sorting is crucial for the slot assignment algorithm (\"Tetris\" algorithm) to work efficiently.\n // By placing earlier events first, we fill the timeline from left to right.\n // By placing longer events first (among those starting on the same day), we ensure\n // that long-spanning events get stable top slots, reducing visual fragmentation.\n // -------------------------------------------------------------------------\n if (sortedMonthView) {\n if (typeof sortedMonthView === \"function\") {\n weekEvents.sort(sortedMonthView);\n } else {\n weekEvents.sort((a, b) => {\n const startA = getStartOfDay(a.startDate);\n const startB = getStartOfDay(b.startDate);\n // Primary sort: Start date (ascending)\n if (!isSameDate(startA, startB)) return getDiffDays(startA, startB);\n\n // Secondary sort: Duration (descending)\n const endA = a.endDate ? getStartOfDay(a.endDate) : startA;\n const endB = b.endDate ? getStartOfDay(b.endDate) : startB;\n const durA = getDiffDays(endA, startA);\n const durB = getDiffDays(endB, startB);\n return durB - durA; // Longer events first\n });\n }\n }\n\n // -------------------------------------------------------------------------\n // 4. Slot Assignment: \"Tetris\" Algorithm\n //\n // The goal here is to assign a vertical \"slot\" index (0, 1, 2...) to each event\n // so that no two overlapping events share the same slot.\n //\n // We maintain a 2D array `slots[dayIndex][slotIndex]` to track usage.\n // dayIndex: 0..6 (Mon-Sun)\n // slotIndex: 0..N (Vertical position)\n //\n // For each event:\n // 1. Determine its start/end range within this week (clipped to 0..6).\n // 2. Find the lowest `slotIndex` where `slots[day][slotIndex]` is empty for all days in the range.\n // 3. Mark that slot as used for those days.\n // -------------------------------------------------------------------------\n const slots: string[][] = Array(length)\n .fill(null)\n .map(() => []); // slots[dayIndex][slotIndex] = eventId\n const eventSlots = new Map<string, number>(); // Map<eventId, slotIndex> for quick lookup later\n\n weekEvents.forEach((event, index) => {\n // Determine start/end indices in this week (0..length-1)\n // We clip the event's start/end to the current week's boundaries because\n // we are only rendering one week at a time in this loop.\n const start = getStartOfDay(event.startDate);\n const end = event.endDate ? getStartOfDay(event.endDate) : start;\n\n let startIndex = getDiffDays(start, weekStart);\n let endIndex = getDiffDays(end, weekStart);\n\n // Clip to week boundaries\n if (startIndex < 0) startIndex = 0;\n if (endIndex > length - 1) endIndex = length - 1;\n\n const eventId = event.startDate + event.title + index;\n\n if (!isEventOrderingEnabled) {\n eventSlots.set(eventId, index);\n } else {\n // Find first available slot\n let slotIndex = 0;\n while (true) {\n let isAvailable = true;\n // Check if this slotIndex is free for the entire duration of the event (within this week)\n for (let i = startIndex; i <= endIndex; i++) {\n if (slots[i][slotIndex]) {\n isAvailable = false;\n break;\n }\n }\n if (isAvailable) break; // Found a spot!\n slotIndex++; // Try the next slot down\n }\n\n eventSlots.set(eventId, slotIndex);\n\n // Mark the slots as occupied\n for (let i = startIndex; i <= endIndex; i++) {\n slots[i][slotIndex] = eventId;\n }\n }\n\n // Store the ID on the event object temporarily for step 5\n event._tempId = eventId;\n });\n\n // -------------------------------------------------------------------------\n // 5. Content Generation: Generate final display data for each day\n // Map the calculated slots back to individual day cells.\n // -------------------------------------------------------------------------\n return processedWeek.map((dayObj, dayIndex) => {\n const { currentDate, isCurrentMonth, displayDay } = dayObj;\n\n // Find events active on this day\n const activeEvents = weekEvents.filter((event) => {\n const start = getStartOfDay(event.startDate);\n const end = event.endDate ? getStartOfDay(event.endDate) : start;\n return (\n !isBeforeDate(currentDate, start) && !isAfterDate(currentDate, end)\n );\n });\n\n const displayData: (EventListType | null)[] = [];\n\n let maxDaySlot = -1;\n activeEvents.forEach((e) => {\n const s = eventSlots.get(e._tempId!);\n if (s !== undefined && s > maxDaySlot) maxDaySlot = s;\n });\n\n for (let s = 0; s <= maxDaySlot; s++) {\n const event = activeEvents.find(\n (e) => eventSlots.get(e._tempId!) === s,\n );\n if (event) {\n const itemStartDate = getStartOfDay(event.startDate);\n const isStart = isSameDate(itemStartDate, currentDate);\n const isWeekStart = dayIndex === 0;\n\n // If the event starts today (or earlier but this is the start of the week),\n // we render the \"segment\" of the event.\n if (isStart || isWeekStart) {\n // Ensure the visual end date doesn't exceed the end of the current week.\n // This is crucial for rendering the correct width for the event bar using CSS/col-span.\n const itemEndDate = event.endDate\n ? getStartOfDay(event.endDate)\n : getStartOfDay(event.startDate);\n const endOfWeekDate = addDays(currentDate, length - 1 - dayIndex);\n\n let effectiveEndDate = itemEndDate;\n if (isAfterDate(itemEndDate, endOfWeekDate)) {\n effectiveEndDate = endOfWeekDate;\n }\n\n displayData.push({\n ...event,\n startDateWeek: formatDate(currentDate, DATE_FORMATS.DATE),\n endDateWeek: formatDate(effectiveEndDate, DATE_FORMATS.DATE),\n isSpacer: false,\n });\n } else {\n // Spacer: The event exists on this day but was started in a previous cell in this row.\n // We insert a spacer so that subsequent events in this column get pushed down to their correct slots.\n displayData.push({ ...event, isSpacer: true });\n }\n } else {\n // Empty slot: No event assigned to this vertical index.\n displayData.push(null);\n }\n }\n\n return {\n currentDate,\n isCurrentMonth,\n displayDay,\n events: displayData,\n totalEvents: activeEvents.length,\n isToday: checkIsToday(selectedDate, displayDay) && isCurrentMonth,\n };\n });\n });\n }, [\n selectedDate,\n events,\n weekStartsOn,\n weekEndsOn,\n enableEnrichedEvents,\n enrichedEventsByDate,\n eventsAreSorted,\n isEventOrderingEnabled,\n sortedMonthView,\n ]);\n}\n",".dateData {\n cursor: pointer;\n position: relative;\n transition: background-color 0.15s ease;\n vertical-align: top;\n height: calc(\n var(--calendar-height) / var(--calendar-rows, 6)\n ); /* Approx 6 rows usually */\n min-width: calc(var(--calendar-width) / 7);\n max-width: calc(var(--calendar-width) / 7);\n padding: 0.25rem;\n}\n\n.dateData:hover {\n background-color: var(--bg-hover);\n}\n\n.currentMonth {\n color: var(--text-secondary); /* muted text */\n background-color: var(--bg-hover);\n}\n\n.cellContent {\n height: 100%;\n width: 100%;\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n gap: 0.25rem;\n}\n\n.dateLabel {\n font-size: 0.8125rem;\n font-weight: 500;\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-block: 2px 4px;\n margin-inline: auto 2px; /* Align to top-end (right in LTR, left in RTL) */\n color: var(--text-primary);\n border-radius: 50%;\n transition:\n background-color 0.2s,\n color 0.2s;\n}\n\n.selected .dateLabel {\n background-color: var(--primary-color);\n color: white;\n}\n\n.today .dateLabel {\n background-color: var(--primary-color);\n color: white;\n box-shadow:\n 0 0 0 2px white,\n 0 0 0 4px var(--primary-color); /* Double ring effect for premium feel */\n}\n\n.dataContainer {\n display: flex;\n flex-direction: column;\n gap: 2px;\n overflow: visible;\n flex: 1;\n}\n\n.spacer {\n height: 1.5rem; /* Match eventItem height */\n margin-bottom: 2px;\n}\n\n.eventItem {\n background-color: var(--primary-color);\n border-radius: 4px; /* Slightly rounded */\n z-index: 2;\n position: relative;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: 0.75rem;\n padding: 0.15rem 0.5rem;\n color: white;\n font-weight: 500;\n height: 1.5rem;\n line-height: 1.2rem;\n box-sizing: border-box;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);\n transition:\n transform 0.1s ease,\n box-shadow 0.1s ease;\n cursor: pointer;\n}\n\n.eventItem:hover {\n transform: translateY(-1px);\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);\n filter: brightness(1.05);\n}\n\n.moreEventsContainer {\n position: relative;\n margin-top: 2px;\n}\n\n.moreEvents {\n font-size: 0.75rem;\n font-weight: 600;\n color: var(--text-secondary);\n cursor: pointer;\n padding: 0.15rem 0.5rem;\n background: transparent;\n border: none;\n width: 100%;\n text-align: start;\n border-radius: 4px;\n transition: background-color 0.2s;\n}\n\n.moreEvents:hover {\n background-color: var(--bg-hover);\n color: var(--text-primary);\n}\n\n/* ── Tablet (768px): tighter sizes, text still readable ── */\n@media (max-width: 768px) {\n .dateLabel {\n font-size: 0.6875rem;\n width: 20px;\n height: 20px;\n }\n\n .eventItem {\n font-size: 0.6875rem;\n padding: 0.1rem 0.25rem;\n height: 1.25rem;\n line-height: 1rem;\n }\n\n .moreEvents {\n font-size: 0.6875rem;\n padding: 0.1rem 0.25rem;\n }\n}\n\n/* ── Phone (480px): dot-only events — colored bar, no text ── */\n@media (max-width: 480px) {\n .dateLabel {\n font-size: 0.625rem;\n width: 16px;\n height: 16px;\n margin-block: 1px 2px;\n margin-inline: auto 1px;\n }\n\n .eventItem {\n font-size: 0;\n padding: 0 2px;\n height: 6px;\n line-height: 0;\n border-radius: 3px;\n }\n\n .moreEvents {\n display: none;\n }\n\n .spacer {\n height: 8px;\n }\n}\n",".popover {\n position: fixed;\n top: calc(100% + 4px);\n inset-inline-start: 0;\n z-index: 100;\n background-color: var(--bg-color);\n border: 1px solid rgba(0, 0, 0, 0.1);\n border-radius: 12px;\n box-shadow:\n 0 10px 15px -3px rgba(0, 0, 0, 0.1),\n 0 4px 6px -2px rgba(0, 0, 0, 0.05);\n padding: 0; /* Remove padding to handle header/content better */\n min-width: 220px;\n max-width: 320px;\n display: flex;\n flex-direction: column;\n opacity: 0;\n animation: fadeIn 0.2s ease forwards;\n overflow: hidden;\n}\n\n@keyframes fadeIn {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n\n.popoverHeader {\n font-size: 0.75rem;\n font-weight: 600;\n padding: 10px 12px;\n color: var(--text-secondary);\n text-transform: uppercase;\n letter-spacing: 0.05em;\n background-color: var(--bg-hover);\n border-bottom: 1px solid var(--border-color);\n}\n\n.popoverContent {\n padding: 8px;\n max-height: 250px;\n overflow-y: auto;\n scrollbar-width: thin;\n scrollbar-color: var(--border-color) transparent;\n}\n\n.popoverItem {\n padding: 0.25rem 0.5rem;\n background-color: var(--primary-color);\n color: white;\n border-radius: var(--radius-md);\n font-size: 0.75rem;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: pointer;\n margin-bottom: 2px;\n transition: opacity 0.2s ease;\n flex-shrink: 0; /* Prevent shrinking */\n}\n\n.popoverItem:hover {\n opacity: 0.9;\n}\n\n.popoverItem.startBefore {\n clip-path: polygon(10px 0, 100% 0, 100% 100%, 10px 100%, 0 50%);\n padding-inline-start: 14px;\n border-start-start-radius: 0;\n border-end-start-radius: 0;\n}\n\n.popoverItem.endAfter {\n clip-path: polygon(\n 0 0,\n calc(100% - 10px) 0,\n 100% 50%,\n calc(100% - 10px) 100%,\n 0 100%\n );\n padding-inline-end: 14px;\n border-start-end-radius: 0;\n border-end-end-radius: 0;\n}\n\n.popoverItem.startBefore.endAfter {\n clip-path: polygon(\n 10px 0,\n calc(100% - 10px) 0,\n 100% 50%,\n calc(100% - 10px) 100%,\n 10px 100%,\n 0 50%\n );\n padding-inline: 14px;\n border-radius: 0;\n}\n\n[dir=\"rtl\"] .popoverItem.startBefore {\n clip-path: polygon(\n 0 0,\n calc(100% - 10px) 0,\n 100% 50%,\n calc(100% - 10px) 100%,\n 0 100%\n );\n}\n\n[dir=\"rtl\"] .popoverItem.endAfter {\n clip-path: polygon(10px 0, 100% 0, 100% 100%, 10px 100%, 0 50%);\n}\n","import React, {\n useRef,\n useEffect,\n useLayoutEffect,\n useState,\n useCallback,\n CSSProperties,\n} from \"react\";\nimport cx from \"classnames\";\nimport { createPortal } from \"react-dom\";\nimport styles from \"./Popover.module.css\";\nimport {\n DateType,\n formatDate,\n getStartOfDay,\n isBeforeDate,\n isAfterDate,\n generateTooltipText,\n getContrastColor,\n handleKeyboardActivation,\n} from \"../../../utils\";\nimport {\n CalendarContentProps,\n ECalendarViewType,\n EventListType,\n} from \"../../../types\";\nimport {\n DATE_FORMATS,\n LAYOUT_CONSTANTS,\n KEYBOARD_SHORTCUTS,\n} from \"../../../constants\";\nimport { useCalendar } from \"../../../context/CalendarContext\";\n\ninterface PopoverProps extends Pick<\n CalendarContentProps,\n \"onEventClick\" | \"is12Hour\" | \"renderEvent\"\n> {\n dateObj: DateType;\n events: EventListType[];\n onClose: () => void;\n anchorEl: HTMLElement | null;\n}\n\nfunction Popover({\n dateObj,\n events,\n onEventClick,\n onClose,\n anchorEl,\n is12Hour,\n renderEvent,\n}: PopoverProps) {\n const { testId, colorScheme } = useCalendar();\n const popoverRef = useRef<HTMLDivElement>(null);\n const [stylePosition, setStylePosition] = useState<CSSProperties>({\n visibility: \"hidden\",\n });\n\n const handleClose = useCallback(() => {\n onClose();\n requestAnimationFrame(() => {\n (anchorEl as HTMLElement | null)?.focus();\n });\n }, [onClose, anchorEl]);\n\n useLayoutEffect(() => {\n if (popoverRef.current && anchorEl) {\n const popoverRect = popoverRef.current.getBoundingClientRect();\n const anchorRect = anchorEl.getBoundingClientRect();\n const PADDING = 10;\n\n // Base position: bottom-left of the anchor\n const top = anchorRect.bottom + 4; // 4px gap\n let left = anchorRect.left;\n\n // Available space in viewport\n const viewportHeight = window.innerHeight;\n const viewportWidth = window.innerWidth;\n\n const spaceBelow = viewportHeight - top;\n const spaceAbove = anchorRect.top - PADDING;\n\n const newStyle: CSSProperties = {\n visibility: \"visible\",\n position: \"fixed\",\n top: `${top}px`,\n left: `${left}px`,\n width: \"220px\", // Fixed width to prevent resizing\n };\n\n // Horizontal Check (Viewport)\n if (left + popoverRect.width > viewportWidth - PADDING) {\n // Align to right edge of viewport if it overflows\n left = viewportWidth - popoverRect.width - PADDING;\n newStyle.left = `${left}px`;\n }\n\n // Vertical Check (Viewport)\n if (top + popoverRect.height > viewportHeight - PADDING) {\n const height = popoverRect.height;\n\n // Flip to top if not enough space below but enough above\n if (spaceBelow < height && spaceAbove > spaceBelow) {\n const maxHeight = Math.min(height, spaceAbove);\n newStyle.top = \"auto\";\n newStyle.bottom = `${viewportHeight - anchorRect.top + 4}px`;\n newStyle.maxHeight = `${maxHeight}px`;\n } else {\n // Cap height at bottom\n const maxHeight = Math.min(height, spaceBelow - PADDING);\n newStyle.maxHeight = `${maxHeight}px`;\n }\n }\n\n setStylePosition(newStyle);\n }\n }, [anchorEl]);\n\n useEffect(() => {\n function handleClickOutside(event: MouseEvent) {\n if (\n popoverRef.current &&\n !popoverRef.current.contains(event.target as Node)\n ) {\n handleClose();\n }\n }\n\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () => {\n document.removeEventListener(\"mousedown\", handleClickOutside);\n };\n }, [handleClose]);\n\n useEffect(() => {\n const frameId = requestAnimationFrame(() => {\n const firstItem = popoverRef.current?.querySelector<HTMLElement>(\n '[role=\"button\"], button, [tabindex=\"0\"]',\n );\n firstItem?.focus();\n });\n return () => cancelAnimationFrame(frameId);\n }, []);\n\n const handlePopoverKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\n if (e.key === KEYBOARD_SHORTCUTS.CLOSE) {\n e.stopPropagation();\n handleClose();\n return;\n }\n if (e.key === \"Tab\") {\n const focusable = Array.from(\n popoverRef.current?.querySelectorAll<HTMLElement>(\n '[role=\"button\"], button, [tabindex=\"0\"]',\n ) ?? [],\n );\n if (focusable.length === 0) return;\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\n if (e.shiftKey && document.activeElement === first) {\n e.preventDefault();\n last.focus();\n } else if (!e.shiftKey && document.activeElement === last) {\n e.preventDefault();\n first.focus();\n }\n }\n };\n\n const content = (\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={`Events on ${formatDate(dateObj, DATE_FORMATS.DAY_DATE_SHORT_MONTH)}`}\n className={styles.popover}\n ref={popoverRef}\n style={stylePosition}\n onClick={(e) => e.stopPropagation()}\n onKeyDown={handlePopoverKeyDown}\n data-testid={`${testId}-popover-content`}\n data-color-scheme={colorScheme}\n >\n <div className={styles.popoverHeader}>\n {formatDate(dateObj, DATE_FORMATS.DAY_DATE_SHORT_MONTH)}\n </div>\n <div className={styles.popoverContent}>\n {events.map((item, idx) => {\n const dayStart = getStartOfDay(dateObj);\n const eventStart = getStartOfDay(item.startDate);\n const eventEnd = item.endDate\n ? getStartOfDay(item.endDate)\n : eventStart;\n\n const isStartBefore = isBeforeDate(eventStart, dayStart);\n const isEndAfter = isAfterDate(eventEnd, dayStart);\n const tooltipText = generateTooltipText(\n item,\n ECalendarViewType.month,\n is12Hour,\n );\n\n const eventBgColor =\n item.style?.backgroundColor || LAYOUT_CONSTANTS.DEFAULT_EVENT_COLOR;\n const textColor = getContrastColor(String(eventBgColor));\n\n return (\n <div\n key={item.id || `pop-${idx}`}\n role=\"button\"\n tabIndex={0}\n className={cx(styles.popoverItem, {\n [styles.startBefore]: isStartBefore,\n [styles.endAfter]: isEndAfter,\n })}\n id={item.id}\n data-testid={`${testId}-${item.id}-popover-item`}\n style={{\n backgroundColor: LAYOUT_CONSTANTS.DEFAULT_EVENT_COLOR,\n color: textColor,\n ...item.style,\n }}\n aria-label={tooltipText}\n onClick={(e) => {\n e.stopPropagation();\n onEventClick?.(item);\n handleClose();\n }}\n onKeyDown={handleKeyboardActivation(() => {\n onEventClick?.(item);\n handleClose();\n })}\n title={tooltipText}\n >\n {renderEvent ? renderEvent(item) : item.title}\n </div>\n );\n })}\n </div>\n </div>\n );\n\n return createPortal(content, document.body);\n}\n\nexport default Popover;\n","import React, { useCallback, useState } from \"react\";\nimport cx from \"classnames\";\nimport {\n CalendarContentProps,\n EventListType,\n ECalendarViewType,\n} from \"../../../types\";\nimport {\n getDiffDays,\n generateTooltipText,\n DateType,\n getContrastColor,\n formatDate,\n handleKeyboardActivation,\n resolveTheme,\n} from \"../../../utils\";\nimport styles from \"./MonthEventItem.module.css\";\nimport Popover from \"../../ui/popover/Popover\";\nimport { LAYOUT_CONSTANTS, DATE_FORMATS } from \"../../../constants\";\nimport { useCalendar } from \"../../../context/CalendarContext\";\n\ninterface MonthEventItemProps extends Pick<\n CalendarContentProps,\n | \"onEventClick\"\n | \"theme\"\n | \"maxEvents\"\n | \"is12Hour\"\n | \"showAdjacentMonths\"\n | \"classNames\"\n | \"renderEvent\"\n | \"renderDateCell\"\n> {\n dataClassName?: string;\n selectedClassName?: string;\n todayClassName?: string;\n date: number;\n dateObj: DateType;\n data: (EventListType | null)[];\n cellWidth: number;\n className?: string;\n isSelected: boolean;\n isToday: boolean;\n isCurrentMonth: boolean;\n onClick?: (date: DateType) => void;\n onMoreClick?: (date: DateType, hiddenEvents: EventListType[]) => void;\n totalEvents?: number;\n}\n\nfunction MonthEventItem({\n date,\n dateObj,\n data,\n cellWidth,\n className,\n dataClassName,\n isSelected,\n isToday,\n onClick,\n selectedClassName,\n todayClassName,\n isCurrentMonth,\n theme,\n maxEvents,\n onMoreClick,\n onEventClick,\n totalEvents = 0,\n is12Hour,\n showAdjacentMonths,\n classNames,\n renderEvent,\n renderDateCell,\n}: MonthEventItemProps) {\n const { testId, config, colorScheme } = useCalendar();\n const locale = config.locale;\n const [showPopover, setShowPopover] = useState(false);\n const [anchorEl, setAnchorEl] = useState<HTMLButtonElement | null>(null);\n\n const handleClosePopover = useCallback(() => {\n setShowPopover(false);\n setAnchorEl(null);\n }, []);\n\n const resolved = resolveTheme(theme, colorScheme);\n const themeSource = isSelected\n ? resolved.selected\n : isToday\n ? resolved.today\n : resolved.default;\n\n const style = {\n color: themeSource?.color,\n backgroundColor: themeSource?.bgColor,\n };\n\n const allDayEvents: EventListType[] =\n data?.filter((e): e is EventListType => e !== null) || [];\n\n // Determine which items to display\n let visibleEvents = data;\n let hiddenEventsCount = 0;\n let hiddenEventsList: EventListType[] = [];\n\n if (\n (maxEvents || maxEvents === 0) &&\n data &&\n (totalEvents >= maxEvents || data.length > maxEvents)\n ) {\n visibleEvents = data.slice(0, maxEvents);\n\n const visibleRealEventsCount = visibleEvents.filter(\n (e) => e !== null,\n ).length;\n hiddenEventsCount = totalEvents - visibleRealEventsCount;\n hiddenEventsList = allDayEvents\n .slice(visibleRealEventsCount)\n .filter((e) => !e.isSpacer);\n }\n\n return (\n <td\n style={style}\n data-testid={`${testId}-${date}-month-cell`}\n onClick={() => onClick?.(dateObj)}\n tabIndex={onClick ? 0 : undefined}\n aria-label={\n onClick\n ? formatDate(dateObj, DATE_FORMATS.MONTH_DAY_YEAR, locale)\n : undefined\n }\n onKeyDown={\n onClick ? handleKeyboardActivation(() => onClick(dateObj)) : undefined\n }\n className={cx(styles.dateData, className, {\n [styles.currentMonth]: !isCurrentMonth,\n [cx(styles.selected, selectedClassName)]: isSelected,\n [cx(styles.today, todayClassName)]: isToday,\n })}\n >\n <div className={styles.cellContent}>\n {(isCurrentMonth || showAdjacentMonths) && (\n <>\n {renderDateCell ? (\n renderDateCell({\n date: dateObj.toJSDate(),\n isToday,\n isSelected,\n isCurrentMonth,\n })\n ) : (\n <p className={styles.dateLabel}>{date}</p>\n )}\n\n {data && (\n <div className={cx(styles.dataContainer, dataClassName)}>\n {visibleEvents.map((item, index) => {\n if (!item || item.isSpacer) {\n return (\n <div key={`spacer-${index}`} className={styles.spacer} />\n );\n }\n\n let diffDates = 1;\n if (item.endDateWeek) {\n diffDates =\n getDiffDays(item.endDateWeek, item.startDateWeek) + 1;\n }\n const tooltipText = generateTooltipText(\n item,\n ECalendarViewType.month,\n is12Hour,\n );\n\n const eventBgColor =\n item.style?.backgroundColor ||\n LAYOUT_CONSTANTS.DEFAULT_EVENT_COLOR;\n const textColor = getContrastColor(String(eventBgColor));\n\n // If cellWidth is 0, we can't calculate a proper spanning width.\n // Fallback to a percentage or just let it be 0 until measured.\n const calculatedWidth =\n cellWidth > 0\n ? `${cellWidth * diffDates - LAYOUT_CONSTANTS.EVENT_ITEM_PADDING}px`\n : \"100%\";\n\n const id = item.id || `${item.startDate}-${index}`;\n\n return (\n <div\n key={id}\n role=\"button\"\n tabIndex={0}\n className={cx(styles.eventItem, classNames?.event)}\n id={item.id}\n data-testid={`${testId}-${id}-month-event-item`}\n style={{\n width: calculatedWidth,\n backgroundColor: LAYOUT_CONSTANTS.DEFAULT_EVENT_COLOR,\n color: textColor,\n ...item.style,\n }}\n title={tooltipText}\n aria-label={`${item.title}, ${tooltipText}`}\n onClick={(e) => {\n e.stopPropagation();\n onEventClick?.(item);\n }}\n onKeyDown={handleKeyboardActivation(() =>\n onEventClick?.(item),\n )}\n >\n {renderEvent ? renderEvent(item) : item.title}\n </div>\n );\n })}\n {hiddenEventsCount > 0 && (\n <div className={styles.moreEventsContainer}>\n <button\n className={styles.moreEvents}\n data-testid={`${testId}-${date}-more-events`}\n aria-label={`${hiddenEventsCount} more events on ${formatDate(dateObj, DATE_FORMATS.MONTH_DAY_YEAR, locale)}`}\n onClick={(e) => {\n e.stopPropagation();\n if (!showPopover) {\n setAnchorEl(e.currentTarget);\n setShowPopover(true);\n }\n onMoreClick?.(dateObj, hiddenEventsList);\n }}\n onKeyDown={handleKeyboardActivation((e) => {\n if (!showPopover) {\n setAnchorEl(e.currentTarget as HTMLButtonElement);\n setShowPopover(true);\n }\n onMoreClick?.(dateObj, hiddenEventsList);\n })}\n >\n + {hiddenEventsCount} more\n </button>\n {showPopover && anchorEl && (\n <Popover\n dateObj={dateObj}\n events={allDayEvents}\n onEventClick={onEventClick}\n onClose={handleClosePopover}\n anchorEl={anchorEl}\n is12Hour={is12Hour}\n renderEvent={renderEvent}\n />\n )}\n </div>\n )}\n </div>\n )}\n </>\n )}\n </div>\n </td>\n );\n}\n\nexport default MonthEventItem;\n",".monthView {\n height: 100%;\n flex: 1;\n overflow: hidden;\n position: relative;\n display: flex;\n flex-direction: column;\n}\n\n.table {\n border-collapse: collapse;\n width: 100%;\n /* min-width: 500px; */\n flex: 1;\n height: 100%;\n box-sizing: border-box;\n}\n\n.tableHeader,\n.tableCell {\n border-inline-end: 1px solid var(--border-color);\n border-bottom: 1px solid var(--border-color);\n box-sizing: border-box;\n}\n\n.tableHeader:last-child,\n.tableCell:last-child {\n border-inline-end: none;\n}\n\n.table tr:last-child .tableCell {\n border-bottom: none;\n}\n\n.tableHeader {\n height: 40px;\n background-color: var(--bg-hover);\n position: sticky;\n top: 0;\n z-index: 10;\n color: var(--text-secondary);\n font-weight: 600;\n font-size: 0.875rem;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n text-align: center;\n vertical-align: middle;\n}\n\n.tableBody {\n /* Let flex/table handle the fill naturally instead of strict pixel height */\n}\n\n.tableCell {\n vertical-align: top;\n height: calc(100% / var(--calendar-rows));\n width: calc((100% - var(--week-number-width, 0px)) / 7);\n padding: 4px;\n}\n\n.weekNumberHeader {\n width: var(--week-number-width, 36px);\n position: sticky;\n top: 0;\n z-index: 10;\n background-color: var(--bg-hover);\n}\n\n.weekNumberCell {\n vertical-align: middle;\n text-align: center;\n color: var(--text-secondary);\n background-color: var(--bg-hover);\n font-size: 0.875rem;\n font-weight: 500;\n border-inline-end: 1px solid var(--border-color);\n border-bottom: 1px solid var(--border-color);\n}\n\n@media (max-width: 768px) {\n .tableHeader {\n height: 30px;\n font-size: 0.75rem;\n letter-spacing: 0;\n }\n\n .tableCell {\n padding: 2px;\n }\n}\n","import React, { CSSProperties, useCallback, useMemo } from \"react\";\nimport cx from \"classnames\";\nimport { CalendarContentProps } from \"../../../types\";\nimport {\n LAYOUT_CONSTANTS,\n DATE_FORMATS,\n TIME_CONSTANTS,\n} from \"../../../constants\";\nimport {\n dateFn,\n convertToDate,\n DateType,\n calculateMaxEvents,\n formatDate,\n getDayListNames,\n} from \"../../../utils\";\nimport useMonthGrid from \"../../../hooks/useMonthGrid\";\nimport MonthEventItem from \"../../core/month_event_item/MonthEventItem\";\nimport styles from \"./MonthView.module.css\";\nimport { useCalendar } from \"../../../context/CalendarContext\";\nimport useCalendarProps from \"../../../hooks/useCalendarProps\";\n\nexport type MonthViewProps = Partial<\n Pick<\n CalendarContentProps,\n | \"is12Hour\"\n | \"selectable\"\n | \"maxEvents\"\n | \"dayType\"\n | \"onDateClick\"\n | \"onEventClick\"\n | \"onMoreClick\"\n | \"theme\"\n | \"classNames\"\n | \"weekStartsOn\"\n | \"weekEndsOn\"\n | \"showAdjacentMonths\"\n | \"renderEvent\"\n | \"renderDateCell\"\n | \"enableEnrichedEvents\"\n | \"enrichedEventsByDate\"\n | \"eventsAreSorted\"\n | \"isEventOrderingEnabled\"\n | \"sortedMonthView\"\n | \"showWeekNumbers\"\n | \"creatable\"\n | \"onSlotClick\"\n >\n>;\n\nfunction MonthView(props: MonthViewProps) {\n const {\n dayType,\n width,\n height,\n onDateClick,\n onEventClick,\n onMoreClick,\n selectable,\n events,\n is12Hour,\n classNames,\n weekStartsOn,\n weekEndsOn,\n showAdjacentMonths,\n renderEvent,\n renderDateCell,\n enableEnrichedEvents,\n enrichedEventsByDate,\n eventsAreSorted,\n isEventOrderingEnabled,\n sortedMonthView,\n locale,\n theme,\n showWeekNumbers,\n creatable,\n onSlotClick,\n maxEvents: propsMaxEvents,\n } = useCalendarProps(props);\n const { state, dispatch, testId } = useCalendar();\n const { selectedDate } = state;\n\n const calendarGrid = useMonthGrid(\n selectedDate,\n events,\n weekStartsOn,\n weekEndsOn,\n {\n enableEnrichedEvents,\n enrichedEventsByDate,\n eventsAreSorted,\n isEventOrderingEnabled,\n sortedMonthView,\n },\n );\n\n const maxEvents = useMemo(\n () =>\n propsMaxEvents ??\n calculateMaxEvents(\n typeof height === \"number\" ? height : 0,\n calendarGrid.length || LAYOUT_CONSTANTS.MIN_ROWS,\n ),\n [propsMaxEvents, height, calendarGrid.length],\n );\n\n const onClickDateHandler = useCallback(\n (dateInput: DateType) => {\n const newDate = dateFn(dateInput);\n if (selectable && !newDate.hasSame(selectedDate, \"day\")) {\n onDateClick?.(convertToDate(newDate));\n dispatch({ type: \"SET_DATE\", payload: newDate });\n }\n if (creatable) {\n onSlotClick?.(\n newDate.startOf(\"day\").toJSDate(),\n newDate.endOf(\"day\").toJSDate(),\n );\n }\n },\n [selectedDate, onDateClick, selectable, dispatch, creatable, onSlotClick],\n );\n\n const headerDays = useMemo(() => {\n const list = getDayListNames(dayType, locale);\n const length =\n ((weekEndsOn - weekStartsOn + TIME_CONSTANTS.DAYS_IN_WEEK) %\n TIME_CONSTANTS.DAYS_IN_WEEK) +\n 1;\n return Array.from(\n { length },\n (_, i) => list[(weekStartsOn + i) % TIME_CONSTANTS.DAYS_IN_WEEK],\n );\n }, [dayType, weekStartsOn, weekEndsOn, locale]);\n\n const tableAriaLabel = formatDate(\n selectedDate,\n DATE_FORMATS.MONTH_YEAR,\n locale,\n );\n\n return (\n <div className={styles.monthView} data-testid={`${testId}-month-view`}>\n <table\n className={cx(styles.table, classNames?.table)}\n aria-label={tableAriaLabel}\n style={\n {\n \"--calendar-rows\": calendarGrid.length,\n \"--week-number-width\": showWeekNumbers ? \"36px\" : \"0px\",\n } as CSSProperties\n }\n >\n <thead>\n <tr>\n {showWeekNumbers && (\n <th\n scope=\"col\"\n className={cx(styles.weekNumberHeader, classNames?.weekNumber)}\n />\n )}\n {headerDays.map((day: string) => (\n <th\n key={day}\n scope=\"col\"\n className={cx(styles.tableHeader, classNames?.tableHeader)}\n >\n {day}\n </th>\n ))}\n </tr>\n </thead>\n <tbody className={styles.tableBody}>\n {calendarGrid.map((week, weekIndex) => {\n const isRowEntirelyAdjacent = week.every((d) => !d.isCurrentMonth);\n\n return (\n <tr key={weekIndex}>\n {showWeekNumbers && (\n <td\n className={cx(\n styles.weekNumberCell,\n classNames?.weekNumber,\n )}\n >\n {!showAdjacentMonths && isRowEntirelyAdjacent\n ? null\n : week[0]?.currentDate.weekNumber}\n </td>\n )}\n {week.map((dayInfo, dayIndex) => (\n <MonthEventItem\n key={`date_${weekIndex}_${dayIndex}`}\n isSelected={\n selectable &&\n dayInfo.isCurrentMonth &&\n dayInfo.displayDay === selectedDate.day\n }\n isToday={dayInfo.isToday}\n isCurrentMonth={dayInfo.isCurrentMonth}\n onClick={onClickDateHandler}\n date={dayInfo.displayDay}\n dateObj={dayInfo.currentDate}\n data={dayInfo.events}\n cellWidth={\n (typeof width === \"number\" ? width : 0) /\n headerDays.length\n }\n className={cx(styles.tableCell, classNames?.tableDate)}\n dataClassName={classNames?.event}\n selectedClassName={classNames?.selected}\n todayClassName={classNames?.today}\n theme={theme}\n maxEvents={maxEvents}\n totalEvents={dayInfo.totalEvents}\n is12Hour={is12Hour}\n onEventClick={onEventClick}\n onMoreClick={(d, hiddenEvs) =>\n onMoreClick?.(convertToDate(d), hiddenEvs)\n }\n showAdjacentMonths={showAdjacentMonths}\n classNames={classNames}\n renderEvent={renderEvent}\n renderDateCell={renderDateCell}\n />\n ))}\n </tr>\n );\n })}\n </tbody>\n </table>\n </div>\n );\n}\n\nexport default MonthView;\n",".scheduleView {\n flex: 1;\n overflow-y: auto;\n padding: 0 16px 16px;\n background-color: var(--bg-color);\n color: var(--text-primary);\n display: flex;\n flex-direction: column;\n height: 100%;\n}\n\n.emptyState {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n color: var(--text-secondary);\n font-size: 14px;\n}\n\n.dateGroup {\n display: flex;\n flex-direction: column;\n border-bottom: 1px solid var(--border-color);\n}\n\n.dateGroup:last-child {\n border-bottom: none;\n}\n\n.dateGroup.noBorder {\n border-bottom: none;\n}\n\n.eventItemContainer {\n display: flex;\n align-items: center;\n gap: 16px;\n padding: 6px 0;\n position: relative;\n}\n\n.dateInfoColumn {\n width: 70px;\n display: flex;\n align-items: flex-start;\n gap: 8px;\n flex-shrink: 0;\n align-self: flex-start;\n padding-top: 4px;\n}\n\n.dateNumber {\n font-size: 20px;\n font-weight: 500;\n color: var(--text-primary);\n min-width: 28px;\n text-align: end;\n display: flex;\n justify-content: center;\n align-items: center;\n height: 28px;\n width: 28px;\n border-radius: 50%;\n padding-bottom: 2px;\n padding-inline-start: 1px;\n}\n\n.dateNumber.today {\n background-color: var(--primary-color);\n color: #fff;\n}\n\n.dateSubInfo {\n font-size: 11px;\n color: var(--text-secondary);\n text-transform: uppercase;\n letter-spacing: 0.5px;\n padding-top: 5px;\n}\n\n.dotTimeColumn {\n width: 140px;\n display: flex;\n align-items: center;\n gap: 12px;\n flex-shrink: 0;\n}\n\n.eventDot {\n width: 10px;\n height: 10px;\n border-radius: 50%;\n background-color: var(--primary-color);\n flex-shrink: 0;\n}\n\n.eventTime {\n font-size: 13px;\n color: var(--text-primary);\n}\n\n.eventTitleColumn {\n flex: 1;\n font-size: 14px;\n font-weight: 500;\n color: var(--text-primary);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: pointer;\n}\n\n/* ── Phone (480px): tighter horizontal padding, narrower time column ── */\n@media (max-width: 480px) {\n .scheduleView {\n padding: 0 8px;\n }\n\n .dotTimeColumn {\n width: 100px;\n gap: 8px;\n }\n\n .dateNumber {\n font-size: 16px;\n width: 24px;\n height: 24px;\n }\n\n .eventTime {\n font-size: 11px;\n }\n\n .eventTitleColumn {\n font-size: 13px;\n }\n}\n","/**\n * @file useScheduleView.ts\n * @description Hook to manage and format data for the 'Schedule' (agenda) layout view.\n *\n * This hook handles:\n * 1. Sorting events broadly by start date.\n * 2. Grouping events into discrete days (replicating events that span multiple days).\n * 3. Formatting specific time displays and titles accommodating multi-day spans.\n * 4. Handling auto-scrolling to the current day indicator.\n */\n\nimport { useMemo, useEffect, useRef } from \"react\";\nimport { CalendarEvent } from \"../types\";\nimport {\n formatDate,\n dateFn,\n isSameDate,\n getDiffDays,\n isAllDayEvent,\n} from \"../utils\";\nimport { DATE_FORMATS } from \"../constants\";\n\n/**\n * Properties for configuring the schedule view hook.\n */\ninterface UseScheduleViewProps {\n events: CalendarEvent[];\n autoScrollToCurrentTime?: boolean;\n is12Hour?: boolean;\n locale?: string;\n}\n\n/**\n * Hook to process calendar events into grouped daily lists for the Schedule agenda.\n *\n * @param props - Configuration properties { events, autoScrollToCurrentTime, is12Hour }\n * @returns Object with a ref to attach to \"today\", the grouped event map, and formatters.\n */\nexport default function useScheduleView({\n events,\n autoScrollToCurrentTime,\n is12Hour,\n locale,\n}: UseScheduleViewProps) {\n const todayRef = useRef<HTMLDivElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n\n const groupedEvents = useMemo(() => {\n // -------------------------------------------------------------------------\n // 1. Initial Sorting\n // -------------------------------------------------------------------------\n // Sort events by start date\n const sorted = [...events].sort(\n (a, b) => dateFn(a.startDate).valueOf() - dateFn(b.startDate).valueOf(),\n );\n\n const groups: Record<string, CalendarEvent[]> = {};\n\n // -------------------------------------------------------------------------\n // 2. Multi-day span resolution and Grouping\n // -------------------------------------------------------------------------\n sorted.forEach((event) => {\n // Group by every date the event spans\n let current = dateFn(event.startDate).startOf(\"day\");\n const end = event.endDate\n ? dateFn(event.endDate).startOf(\"day\")\n : current;\n\n while (current < end || current.equals(end)) {\n const dateKey = formatDate(current, DATE_FORMATS.DATE);\n if (!groups[dateKey]) {\n groups[dateKey] = [];\n }\n groups[dateKey].push(event);\n current = current.plus({ days: 1 });\n }\n });\n\n return groups;\n }, [events]);\n\n useEffect(() => {\n if (autoScrollToCurrentTime && todayRef.current && containerRef.current) {\n const containerRect = containerRef.current.getBoundingClientRect();\n const elementRect = todayRef.current.getBoundingClientRect();\n containerRef.current.scrollTop += elementRect.top - containerRect.top;\n }\n }, [autoScrollToCurrentTime, groupedEvents]);\n\n // ---------------------------------------------------------------------------\n // 3. Presentation formatting helpers\n // ---------------------------------------------------------------------------\n\n /**\n * Formats the time range string for an event on a specific day.\n * Modifies display smartly if it's a multi-day event continuing from a prior day\n * or ending on a subsequent day (e.g. \"All day\", \"Until 10PM\").\n */\n const renderEventTime = (event: CalendarEvent, dateKey: string) => {\n if (isAllDayEvent(event)) {\n return \"All day\";\n }\n\n const currentDay = dateFn(dateKey).startOf(\"day\");\n const startDay = dateFn(event.startDate).startOf(\"day\");\n const endDay = event.endDate\n ? dateFn(event.endDate).startOf(\"day\")\n : startDay;\n const isMultiDay = !startDay.equals(endDay);\n\n const timeFormat = is12Hour ? DATE_FORMATS.TIME_12H : DATE_FORMATS.TIME;\n const formatTime = (t: string) => t.replace(/^0/, \"\").replace(\":00\", \" \");\n\n const isMidnight = (d: string) =>\n dateFn(d).hour === 0 && dateFn(d).minute === 0;\n const isEndOfDay = (d: string) =>\n dateFn(d).hour === 23 && dateFn(d).minute === 59;\n\n if (isMultiDay) {\n if (currentDay.equals(startDay)) {\n return isMidnight(event.startDate)\n ? \"All day\"\n : `${formatTime(formatDate(event.startDate, timeFormat, locale))}`;\n } else if (currentDay.equals(endDay)) {\n return isEndOfDay(event.endDate!)\n ? \"All day\"\n : `Until ${formatTime(formatDate(event.endDate!, timeFormat, locale))}`;\n } else {\n return \"All day\";\n }\n }\n\n // Normal single day time range\n const startStr = formatDate(event.startDate, timeFormat, locale);\n if (event.endDate) {\n if (isMidnight(event.startDate) && isEndOfDay(event.endDate)) {\n return \"All day\";\n }\n const endStr = formatDate(event.endDate, timeFormat, locale);\n return `${formatTime(startStr)} – ${formatTime(endStr)}`;\n }\n return formatTime(startStr);\n };\n\n /**\n * Formats the title of an event. Appends descriptive text if the event\n * spans multiple days (e.g., \"Event Name (Day 2/3)\").\n */\n const renderEventTitle = (event: CalendarEvent, dateKey: string) => {\n if (\n event.endDate &&\n !isSameDate(dateFn(event.startDate), dateFn(event.endDate))\n ) {\n const currentDay = dateFn(dateKey).startOf(\"day\");\n const startDay = dateFn(event.startDate).startOf(\"day\");\n const dayIndex = getDiffDays(currentDay, startDay) + 1;\n const totalDays = getDiffDays(event.endDate, event.startDate) + 1;\n return `${event.title} (Day ${dayIndex}/${totalDays})`;\n }\n return event.title;\n };\n\n return {\n todayRef,\n containerRef,\n groupedEvents,\n renderEventTime,\n renderEventTitle,\n };\n}\n","import React from \"react\";\nimport cx from \"classnames\";\nimport { CalendarContentProps, ECalendarViewType } from \"../../../types\";\nimport {\n formatDate,\n dateFn,\n checkIsToday,\n generateTooltipText,\n handleKeyboardActivation,\n resolveTheme,\n} from \"../../../utils\";\nimport styles from \"./ScheduleView.module.css\";\nimport { DATE_FORMATS, LAYOUT_CONSTANTS } from \"../../../constants\";\nimport useScheduleView from \"../../../hooks/useScheduleView\";\nimport { useCalendar } from \"../../../context/CalendarContext\";\nimport useCalendarProps from \"../../../hooks/useCalendarProps\";\n\nexport type ScheduleViewProps = Partial<\n Pick<\n CalendarContentProps,\n | \"is12Hour\"\n | \"dayType\"\n | \"onEventClick\"\n | \"theme\"\n | \"classNames\"\n | \"autoScrollToCurrentTime\"\n | \"renderEvent\"\n | \"renderScheduleSeparator\"\n >\n>;\n\nexport default function ScheduleView(props: ScheduleViewProps) {\n const {\n events,\n onEventClick,\n is12Hour,\n theme,\n classNames,\n autoScrollToCurrentTime,\n renderEvent,\n renderScheduleSeparator,\n locale,\n } = useCalendarProps(props);\n const { testId, colorScheme } = useCalendar();\n const {\n todayRef,\n containerRef,\n groupedEvents,\n renderEventTime,\n renderEventTitle,\n } = useScheduleView({\n events,\n autoScrollToCurrentTime,\n is12Hour,\n locale,\n });\n\n return (\n <div\n ref={containerRef}\n role=\"region\"\n aria-label=\"Schedule view\"\n className={styles.scheduleView}\n data-testid={`${testId}-schedule-view`}\n >\n {Object.keys(groupedEvents).length === 0 ? (\n <div className={styles.emptyState}>No events to display</div>\n ) : (\n Object.keys(groupedEvents)\n .sort()\n .map((dateKey, groupIndex, allKeys) => {\n const dayEvents = groupedEvents[dateKey];\n const dateObj = dateFn(dateKey);\n const isLastGroup = groupIndex === allKeys.length - 1;\n\n const isToday = checkIsToday(dateObj, dateObj.day);\n const resolvedTheme = resolveTheme(theme, colorScheme);\n const todayStyle = isToday\n ? {\n color: resolvedTheme.today?.color,\n backgroundColor: resolvedTheme.today?.bgColor,\n }\n : undefined;\n\n return (\n <React.Fragment key={dateKey}>\n <div\n ref={isToday ? todayRef : undefined}\n className={cx(\n styles.dateGroup,\n classNames?.scheduleDateGroup,\n {\n [styles.noBorder]: !!renderScheduleSeparator,\n },\n )}\n >\n {dayEvents.map((event, index) => {\n const isFirstEventOfDay = index === 0;\n\n return (\n <div\n key={event.id || index}\n role=\"button\"\n tabIndex={0}\n className={cx(\n styles.eventItemContainer,\n classNames?.event,\n )}\n data-testid={`${testId}-${event.id}-schedule-event`}\n aria-label={generateTooltipText(\n event,\n ECalendarViewType.schedule,\n is12Hour,\n locale,\n )}\n onClick={() => onEventClick?.(event)}\n onKeyDown={handleKeyboardActivation(() =>\n onEventClick?.(event),\n )}\n title={generateTooltipText(\n event,\n ECalendarViewType.schedule,\n is12Hour,\n locale,\n )}\n >\n {/* Column 1: Date Info (only shown on the first event of the day) */}\n <div\n className={styles.dateInfoColumn}\n data-testid={`${testId}-date-info`}\n >\n {isFirstEventOfDay && (\n <>\n <div\n className={cx(\n styles.dateNumber,\n classNames?.scheduleDateNumber,\n {\n [styles.today]: isToday,\n },\n )}\n style={todayStyle}\n >\n {formatDate(\n dateObj,\n DATE_FORMATS.DAY_NUMBER,\n locale,\n )}\n </div>\n <div\n className={cx(\n styles.dateSubInfo,\n classNames?.scheduleDateSubInfo,\n )}\n >\n {formatDate(\n dateObj,\n DATE_FORMATS.SHORT_MONTH,\n locale,\n ).toUpperCase()}\n ,{\" \"}\n {formatDate(\n dateObj,\n DATE_FORMATS.SHORT_DAY,\n locale,\n ).toUpperCase()}\n </div>\n </>\n )}\n </div>\n\n {renderEvent ? (\n renderEvent(event)\n ) : (\n <>\n {/* Column 2: Dot + Time */}\n <div className={styles.dotTimeColumn}>\n <div\n className={styles.eventDot}\n style={{\n backgroundColor:\n event.style?.backgroundColor ||\n LAYOUT_CONSTANTS.DEFAULT_EVENT_COLOR,\n }}\n />\n <div\n className={cx(\n styles.eventTime,\n classNames?.scheduleTime,\n )}\n >\n {renderEventTime(event, dateKey)}\n </div>\n </div>\n\n {/* Column 3: Title */}\n <div\n className={cx(\n styles.eventTitleColumn,\n classNames?.scheduleTitle,\n )}\n style={{\n ...event.style,\n backgroundColor: \"transparent\",\n }}\n >\n {renderEventTitle(event, dateKey)}\n </div>\n </>\n )}\n </div>\n );\n })}\n </div>\n {!isLastGroup &&\n renderScheduleSeparator &&\n renderScheduleSeparator(dateObj.toJSDate())}\n </React.Fragment>\n );\n })\n )}\n </div>\n );\n}\n",".customView {\n display: flex;\n flex-direction: column;\n height: 100%;\n overflow-y: auto;\n overflow-x: auto;\n background-color: var(--bg-color);\n position: relative;\n}\n\n.stickyTopContainer {\n position: sticky;\n top: 0;\n z-index: 10;\n background-color: var(--bg-color);\n border-bottom: 1px solid var(--border-color);\n}\n\n.customHeader {\n display: flex;\n border-bottom: 1px solid var(--border-color);\n}\n\n.timeHeaderSpacer {\n width: 60px;\n flex-shrink: 0;\n border-inline-end: 1px solid var(--border-color);\n}\n\n.dayHeader {\n flex: 1;\n padding: 10px 5px;\n text-align: center;\n border-inline-end: 1px solid var(--border-color);\n min-width: 0;\n}\n\n.dayHeader:last-child {\n border-inline-end: none;\n}\n\n.dayName {\n font-size: 12px;\n color: var(--text-secondary);\n text-transform: uppercase;\n margin-bottom: 4px;\n}\n\n.dayNumber {\n font-size: 18px;\n width: 32px;\n height: 32px;\n line-height: 32px;\n margin: 0 auto;\n border-radius: 50%;\n}\n\n.today {\n background-color: var(--primary-color);\n color: #fff;\n}\n\n.timeGrid {\n display: flex;\n flex: 1;\n}\n\n.eventsGrid {\n display: flex;\n flex: 1;\n position: relative;\n}\n\n.dayColumn {\n flex: 1;\n border-inline-end: 1px solid var(--border-color);\n position: relative;\n min-width: 0;\n}\n\n.dayColumn:last-child {\n border-inline-end: none;\n}\n\n/* ── Tablet (768px): fixed column width → visible columns, rest scroll ── */\n@media (max-width: 768px) {\n .dayHeader {\n min-width: 100px;\n flex: 0 0 100px;\n padding: 8px 4px;\n }\n\n .dayColumn {\n min-width: 100px;\n flex: 0 0 100px;\n }\n\n .dayName {\n font-size: 10px;\n }\n\n .dayNumber {\n font-size: 15px;\n width: 26px;\n height: 26px;\n line-height: 26px;\n }\n}\n\n/* ── Phone (480px): 1 column fills the viewport, scroll for others ── */\n@media (max-width: 480px) {\n .dayHeader {\n min-width: calc(100vw - 90px);\n flex: 0 0 calc(100vw - 90px);\n }\n\n .dayColumn {\n min-width: calc(100vw - 90px);\n flex: 0 0 calc(100vw - 90px);\n }\n}\n","import React, { useMemo, useEffect, useRef } from \"react\";\nimport cx from \"classnames\";\nimport {\n getDayOfWeek,\n dateFn,\n formatDate,\n getDayListNames,\n resolveTheme,\n} from \"../../../utils\";\nimport useDayEventLayout, {\n DayEventLayout,\n} from \"../../../hooks/useDayEventLayout\";\nimport { CalendarContentProps } from \"../../../types\";\nimport { DATE_FORMATS, TIME_CONSTANTS } from \"../../../constants\";\nimport styles from \"./CustomDaysView.module.css\";\nimport { useCalendar } from \"../../../context/CalendarContext\";\nimport useCalendarProps from \"../../../hooks/useCalendarProps\";\nimport TimeColumn from \"../../core/time_column/TimeColumn\";\nimport DayColumn from \"../../core/day_column/DayColumn\";\nimport AllDayBanner from \"../../core/all_day_banner/AllDayBanner\";\n\nexport type CustomViewProps = Partial<\n Pick<\n CalendarContentProps,\n | \"is12Hour\"\n | \"dayType\"\n | \"onEventClick\"\n | \"theme\"\n | \"classNames\"\n | \"showCurrentTime\"\n | \"maxEvents\"\n | \"autoScrollToCurrentTime\"\n | \"minHour\"\n | \"maxHour\"\n | \"customDays\"\n | \"renderEvent\"\n | \"renderHourCell\"\n | \"renderDateCell\"\n | \"showAllDayRow\"\n | \"eventOverlapOffset\"\n | \"enableEnrichedEvents\"\n | \"enrichedEventsByDate\"\n | \"eventsAreSorted\"\n | \"isEventOrderingEnabled\"\n | \"creatable\"\n | \"onSlotClick\"\n >\n>;\n\nfunction CustomView(props: CustomViewProps) {\n const {\n events,\n onEventClick,\n dayType,\n is12Hour,\n theme,\n classNames,\n showCurrentTime,\n maxEvents,\n autoScrollToCurrentTime,\n minHour,\n maxHour,\n customDays = 3,\n renderEvent,\n renderHourCell,\n renderDateCell,\n showAllDayRow,\n eventOverlapOffset,\n enableEnrichedEvents,\n enrichedEventsByDate,\n eventsAreSorted,\n isEventOrderingEnabled,\n locale,\n creatable,\n onSlotClick,\n } = useCalendarProps(props);\n const containerRef = useRef<HTMLDivElement>(null);\n const { state, testId, colorScheme } = useCalendar();\n const { selectedDate } = state;\n\n const viewDays = useMemo(() => {\n return Array.from({ length: customDays }, (_, i) =>\n selectedDate.plus({ days: i }),\n );\n }, [selectedDate, customDays]);\n\n const viewEvents = useDayEventLayout(\n events,\n viewDays,\n minHour,\n maxHour,\n showAllDayRow,\n eventOverlapOffset,\n {\n enableEnrichedEvents,\n enrichedEventsByDate,\n eventsAreSorted,\n isEventOrderingEnabled,\n },\n ) as DayEventLayout[][];\n\n const hasToday = useMemo(() => {\n const now = dateFn();\n return viewDays.some((day) => now.hasSame(day, \"day\"));\n }, [viewDays]);\n\n useEffect(() => {\n if (autoScrollToCurrentTime && containerRef.current && hasToday) {\n const now = dateFn();\n const hours = now.hour;\n const minutes = now.minute;\n const totalMinutes = hours * TIME_CONSTANTS.MINUTES_IN_HOUR + minutes;\n\n const container = containerRef.current;\n const targetScroll = Math.max(\n 0,\n totalMinutes - container.clientHeight / 2,\n );\n\n container.scrollTo({ top: targetScroll, behavior: \"smooth\" });\n }\n }, [autoScrollToCurrentTime, hasToday]);\n\n return (\n <div\n role=\"region\"\n aria-label={`${customDays} days view`}\n className={styles.customView}\n ref={containerRef}\n data-testid={`${testId}-custom-days-view`}\n >\n <div className={styles.stickyTopContainer}>\n <div className={styles.customHeader}>\n <div className={styles.timeHeaderSpacer} />\n {viewDays.map((date, index) => {\n const isToday = dateFn().hasSame(date, \"day\");\n const resolvedTheme = resolveTheme(theme, colorScheme);\n const todayStyle = isToday\n ? {\n color: resolvedTheme.today?.color,\n backgroundColor: resolvedTheme.today?.bgColor,\n }\n : undefined;\n\n return renderDateCell ? (\n renderDateCell({\n date: date.toJSDate(),\n isToday,\n })\n ) : (\n <div\n key={index}\n className={cx(styles.dayHeader, classNames?.dayHeader)}\n >\n <div className={cx(styles.dayName, classNames?.dayName)}>\n {getDayListNames(dayType, locale)[getDayOfWeek(date)]}\n </div>\n <div\n className={cx(styles.dayNumber, classNames?.dayNumber, {\n [styles.today]: isToday,\n })}\n style={todayStyle}\n >\n {formatDate(date, DATE_FORMATS.DAY_NUMBER, locale)}\n </div>\n </div>\n );\n })}\n </div>\n {showAllDayRow && (\n <AllDayBanner\n days={viewDays}\n events={events || []}\n maxEvents={maxEvents}\n onEventClick={onEventClick}\n classNames={classNames}\n is12Hour={is12Hour}\n renderEvent={renderEvent}\n locale={locale}\n />\n )}\n </div>\n <div className={styles.timeGrid}>\n <TimeColumn\n is12Hour={is12Hour}\n classNames={classNames}\n minHour={minHour}\n maxHour={maxHour}\n locale={locale}\n />\n <div className={styles.eventsGrid}>\n {viewDays.map((date, dayIndex) => {\n const isToday = dateFn().hasSame(date, \"day\");\n return (\n <div\n key={dayIndex}\n className={cx(styles.dayColumn, classNames?.dayColumn)}\n data-testid={`${testId}-day-column`}\n >\n <DayColumn\n dayEvents={viewEvents[dayIndex]}\n date={date}\n onEventClick={onEventClick}\n is12Hour={is12Hour}\n classNames={classNames}\n isToday={isToday}\n showCurrentTime={showCurrentTime}\n minHour={minHour}\n maxHour={maxHour}\n renderEvent={renderEvent}\n renderHourCell={renderHourCell}\n creatable={creatable}\n onSlotClick={onSlotClick}\n />\n </div>\n );\n })}\n </div>\n </div>\n </div>\n );\n}\n\nexport default CustomView;\n","/* ── Shimmer animation ─────────────────────────────────── */\n@keyframes shimmer {\n 0% {\n background-position: -468px 0;\n }\n 100% {\n background-position: 468px 0;\n }\n}\n\n.shimmer {\n background: linear-gradient(to right, #f0f0f0 8%, #e0e0e0 18%, #f0f0f0 33%);\n background-size: 800px 104px;\n animation: shimmer 1.5s linear infinite;\n border-radius: 4px;\n display: block;\n}\n\n/* ── MonthSkeleton ─────────────────────────────────────── */\n.monthSkeleton {\n flex: 1;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n}\n\n.table {\n border-collapse: collapse;\n width: 100%;\n flex: 1;\n height: 100%;\n}\n\n.headerCell {\n height: 40px;\n background-color: var(--bg-hover);\n border-inline-end: 1px solid var(--border-color);\n border-bottom: 1px solid var(--border-color);\n padding: 4px 8px;\n vertical-align: middle;\n}\n\n.headerCell:last-child {\n border-inline-end: none;\n}\n\n.cell {\n vertical-align: top;\n border-inline-end: 1px solid var(--border-color);\n border-bottom: 1px solid var(--border-color);\n padding: 4px;\n height: 100px;\n}\n\n.cell:last-child {\n border-inline-end: none;\n}\n\n/* ── TimeGridSkeleton ──────────────────────────────────── */\n.timeGridSkeleton {\n flex: 1;\n display: flex;\n overflow: hidden;\n border: 1px solid var(--border-color);\n border-radius: 8px;\n}\n\n.timeColumn {\n width: 60px;\n flex-shrink: 0;\n border-inline-end: 1px solid var(--border-color);\n padding: 8px 4px;\n display: flex;\n flex-direction: column;\n gap: 16px;\n}\n\n.timeSlot {\n display: flex;\n justify-content: center;\n}\n\n.eventsArea {\n flex: 1;\n position: relative;\n}\n\n/* ── ScheduleSkeleton ──────────────────────────────────── */\n.scheduleSkeleton {\n flex: 1;\n overflow-y: auto;\n padding: 16px;\n display: flex;\n flex-direction: column;\n gap: 16px;\n}\n\n.scheduleRow {\n display: flex;\n align-items: center;\n gap: 16px;\n padding: 8px 0;\n border-bottom: 1px solid var(--border-color);\n}\n\n.scheduleLines {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n/* ── Dark mode overrides ───────────────────────────────── */\n[data-color-scheme=\"dark\"] .shimmer {\n background: linear-gradient(\n 90deg,\n rgba(255, 255, 255, 0.04) 0%,\n rgba(255, 255, 255, 0.1) 50%,\n rgba(255, 255, 255, 0.04) 100%\n );\n}\n[data-color-scheme=\"dark\"] .headerCell,\n[data-color-scheme=\"dark\"] .cell {\n border-inline-end-color: var(--border-color);\n border-bottom-color: var(--border-color);\n}\n","import React from \"react\";\nimport styles from \"./Skeleton.module.css\";\nimport { TIME_CONSTANTS } from \"../../../constants\";\n\nexport default function MonthSkeleton() {\n const rows = 5;\n const cols = TIME_CONSTANTS.DAYS_IN_WEEK;\n\n return (\n <div className={styles.monthSkeleton} data-testid=\"month-skeleton\">\n <table className={styles.table}>\n <thead>\n <tr>\n {Array.from({ length: cols }, (_, i) => (\n <th key={i} className={styles.headerCell}>\n <div\n className={styles.shimmer}\n style={{ width: \"60%\", height: \"14px\" }}\n />\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {Array.from({ length: rows }, (_, row) => (\n <tr key={row}>\n {Array.from({ length: cols }, (_, col) => (\n <td key={col} className={styles.cell}>\n <div\n className={styles.shimmer}\n style={{\n width: \"20px\",\n height: \"14px\",\n marginBottom: \"4px\",\n }}\n />\n <div\n className={styles.shimmer}\n style={{\n width: \"80%\",\n height: \"16px\",\n marginBottom: \"3px\",\n }}\n />\n {(row + col) % 3 !== 0 && (\n <div\n className={styles.shimmer}\n style={{ width: \"60%\", height: \"16px\" }}\n />\n )}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n}\n","import React from \"react\";\nimport styles from \"./Skeleton.module.css\";\n\nconst EVENT_BARS = [\n { top: \"15%\", left: \"5%\", width: \"45%\" },\n { top: \"38%\", left: \"52%\", width: \"30%\" },\n { top: \"62%\", left: \"15%\", width: \"55%\" },\n];\n\nexport default function TimeGridSkeleton() {\n return (\n <div className={styles.timeGridSkeleton} data-testid=\"time-grid-skeleton\">\n <div className={styles.timeColumn}>\n {Array.from({ length: 8 }, (_, i) => (\n <div key={i} className={styles.timeSlot} data-testid=\"time-slot\">\n <div\n className={styles.shimmer}\n style={{ width: \"40px\", height: \"12px\" }}\n />\n </div>\n ))}\n </div>\n <div className={styles.eventsArea}>\n {EVENT_BARS.map((bar, i) => (\n <div\n key={i}\n data-testid=\"event-bar\"\n className={styles.shimmer}\n style={{\n position: \"absolute\",\n top: bar.top,\n left: bar.left,\n width: bar.width,\n height: \"40px\",\n }}\n />\n ))}\n </div>\n </div>\n );\n}\n","import React from \"react\";\nimport styles from \"./Skeleton.module.css\";\n\nexport default function ScheduleSkeleton() {\n return (\n <div className={styles.scheduleSkeleton} data-testid=\"schedule-skeleton\">\n {Array.from({ length: 4 }, (_, i) => (\n <div\n key={i}\n className={styles.scheduleRow}\n data-testid=\"schedule-skeleton-row\"\n >\n <div\n data-testid=\"skeleton-circle\"\n className={styles.shimmer}\n style={{\n width: \"28px\",\n height: \"28px\",\n borderRadius: \"50%\",\n flexShrink: 0,\n }}\n />\n <div className={styles.scheduleLines}>\n <div\n data-testid=\"skeleton-line\"\n className={styles.shimmer}\n style={{ width: \"70%\", height: \"14px\" }}\n />\n <div\n data-testid=\"skeleton-line\"\n className={styles.shimmer}\n style={{ width: \"50%\", height: \"12px\" }}\n />\n </div>\n </div>\n ))}\n </div>\n );\n}\n","@keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n/* Applied for 150ms after isLoading transitions false to fade content in */\n.fadeIn {\n animation: fadeIn 150ms ease;\n}\n\n/* Wraps view when isLoading + events exist — blocks all pointer events */\n.loadingOverlay {\n pointer-events: none;\n}\n\n/* Wraps renderLoading() output to fill the view body area */\n.viewBody {\n flex: 1;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n}\n\n.views {\n flex: 1;\n min-height: 0;\n}\n","import React, { useRef, useState, useEffect } from \"react\";\nimport cx from \"classnames\";\nimport { ECalendarViewType, CalendarContentProps } from \"../../types\";\nimport { useCalendar } from \"../../context/CalendarContext\";\nimport useCalendarProps from \"../../hooks/useCalendarProps\";\nimport DayView from \"./day_view/DayView\";\nimport WeekView from \"./week_view/WeekView\";\nimport MonthView from \"./month_view/MonthView\";\nimport ScheduleView from \"./schedule_view/ScheduleView\";\nimport CustomDaysView from \"./custom_days_view/CustomDaysView\";\nimport MonthSkeleton from \"../ui/skeleton/MonthSkeleton\";\nimport TimeGridSkeleton from \"../ui/skeleton/TimeGridSkeleton\";\nimport ScheduleSkeleton from \"../ui/skeleton/ScheduleSkeleton\";\nimport styles from \"./View.module.css\";\n\nexport type ViewProps = Partial<\n Omit<\n CalendarContentProps,\n | \"events\"\n | \"locale\"\n | \"pastYearLength\"\n | \"futureYearLength\"\n | \"onNavigate\"\n | \"onViewChange\"\n | \"resetDateOnViewChange\"\n | \"localeMessages\"\n >\n>;\n\nexport default function View(props: ViewProps) {\n const { isLoading, events, renderLoading } = useCalendarProps({});\n const {\n state: { view, customDays },\n } = useCalendar();\n\n // Track loading→loaded transition to trigger fadeIn animation\n const prevIsLoadingRef = useRef(isLoading);\n const [showFadeIn, setShowFadeIn] = useState(false);\n\n useEffect(() => {\n if (prevIsLoadingRef.current && !isLoading) {\n setShowFadeIn(true);\n const t = setTimeout(() => setShowFadeIn(false), 150);\n prevIsLoadingRef.current = false;\n return () => clearTimeout(t);\n }\n prevIsLoadingRef.current = isLoading;\n }, [isLoading]);\n\n const isEmpty = !events || events.length === 0;\n const showLoadingUi = isLoading && isEmpty;\n\n // Show skeleton (or custom loading UI) when loading with no events\n if (showLoadingUi) {\n if (renderLoading) {\n return <div className={styles.viewBody}>{renderLoading()}</div>;\n }\n switch (view) {\n case ECalendarViewType.month:\n return <MonthSkeleton />;\n case ECalendarViewType.day:\n case ECalendarViewType.week:\n case ECalendarViewType.customDays:\n return <TimeGridSkeleton />;\n case ECalendarViewType.schedule:\n return <ScheduleSkeleton />;\n default:\n return <MonthSkeleton />;\n }\n }\n\n const renderActiveView = () => {\n switch (view) {\n case ECalendarViewType.day:\n return <DayView {...props} />;\n case ECalendarViewType.week:\n return <WeekView {...props} />;\n case ECalendarViewType.month:\n return <MonthView {...props} />;\n case ECalendarViewType.schedule:\n return <ScheduleView {...props} />;\n case ECalendarViewType.customDays:\n if (!customDays || customDays < 1 || customDays > 10) return null;\n return <CustomDaysView {...props} customDays={customDays} />;\n default:\n return null;\n }\n };\n\n // When loading but events exist — show them but block interactions\n if (isLoading) {\n return (\n <div\n className={styles.loadingOverlay}\n data-testid=\"calendar-loading-overlay\"\n >\n {renderActiveView()}\n </div>\n );\n }\n\n // Normal render with optional fade-in after loading completes\n const activeView = renderActiveView();\n if (!activeView) return null;\n return (\n <div className={cx(styles.views, { [styles.fadeIn]: showFadeIn })}>\n {activeView}\n </div>\n );\n}\n","import React, { Component, ReactNode, ErrorInfo } from \"react\";\n\ninterface Props {\n children: ReactNode;\n}\n\ninterface State {\n hasError: boolean;\n}\n\nexport default class CalendarErrorBoundary extends Component<Props, State> {\n state: State = { hasError: false };\n\n static getDerivedStateFromError(): State {\n return { hasError: true };\n }\n\n componentDidCatch(_error: Error, _info: ErrorInfo) {\n // Intentionally silent — the host app's own error reporting handles logging.\n }\n\n render() {\n if (this.state.hasError) {\n return <div data-testid=\"calendar-error-boundary\" />;\n }\n return this.props.children;\n }\n}\n","import React, { useMemo, memo, useEffect, CSSProperties, useRef } from \"react\";\nimport cx from \"classnames\";\nimport {\n CalendarProps,\n CalendarContentProps,\n ECalendarViewType,\n} from \"./types\";\nimport {\n defaultCalendarProps,\n LAYOUT_CONSTANTS,\n CALENDAR_ACTIONS,\n} from \"./constants\";\nimport { dateFn, resolveDirection } from \"./utils\";\nimport useResizeObserver from \"./hooks/useResizeObserver\";\nimport useEvents from \"./hooks/useEvents\";\nimport useColorScheme from \"./hooks/useColorScheme\";\nimport styles from \"./Calendar.module.css\";\nimport Header from \"./components/layout/Header\";\nimport DayView from \"./components/views/day_view/DayView\";\nimport WeekView from \"./components/views/week_view/WeekView\";\nimport MonthView from \"./components/views/month_view/MonthView\";\nimport ScheduleView from \"./components/views/schedule_view/ScheduleView\";\nimport CustomDaysView from \"./components/views/custom_days_view/CustomDaysView\";\nimport { CalendarProvider, useCalendar } from \"./context/CalendarContext\";\nimport View from \"./components/views/View\";\nimport useCalendarProps from \"./hooks/useCalendarProps\";\nimport CalendarErrorBoundary from \"./components/ui/CalendarErrorBoundary\";\n\nfunction CalendarContent(props: CalendarContentProps) {\n const {\n testId,\n classNames,\n renderHeader,\n width,\n height,\n onNavigate,\n onViewChange,\n direction,\n locale,\n colorScheme,\n } = useCalendarProps(props);\n\n const dir = resolveDirection(direction, locale);\n const resolvedScheme = useColorScheme(colorScheme);\n\n const {\n state: { view, selectedDate },\n dispatch,\n } = useCalendar();\n\n // Sync view from props to context\n useEffect(() => {\n if (props.view) {\n dispatch({ type: \"SET_VIEW\", payload: props.view });\n }\n }, [props.view, dispatch]);\n\n // Sync external date prop to context if it changes\n useEffect(() => {\n if (props.selectedDate) {\n dispatch({ type: \"SET_DATE\", payload: dateFn(props.selectedDate) });\n }\n }, [props.selectedDate, dispatch]);\n\n // Sync customDays from props to context\n useEffect(() => {\n if (props.customDays) {\n dispatch({ type: \"SET_CUSTOM_DAYS\", payload: props.customDays });\n }\n }, [props.customDays, dispatch]);\n\n return (\n <section\n data-testid={`${testId}-container`}\n dir={dir}\n data-color-scheme={resolvedScheme}\n style={\n {\n \"--calendar-width\": `${width}px`,\n \"--calendar-height\": `${height}px`,\n } as CSSProperties\n }\n className={cx(styles.calendar, classNames?.root)}\n >\n {renderHeader ? (\n renderHeader({\n currentDate: selectedDate.toJSDate(),\n view,\n onNavigate: (date: Date) => {\n dispatch({\n type: CALENDAR_ACTIONS.SET_DATE,\n payload: dateFn(date),\n });\n if (onNavigate) onNavigate(date);\n },\n onViewChange: (newView: ECalendarViewType) => {\n dispatch({ type: CALENDAR_ACTIONS.SET_VIEW, payload: newView });\n if (onViewChange) onViewChange(newView);\n },\n })\n ) : (\n <Header />\n )}\n <View />\n </section>\n );\n}\n\nfunction Calendar(props: CalendarProps = defaultCalendarProps) {\n const containerRef = useRef<HTMLDivElement>(null);\n\n const allProps: CalendarProps = { ...defaultCalendarProps, ...props };\n const { width: observedWidth, height: observedHeight } = useResizeObserver(\n containerRef,\n !!allProps.width && !!allProps.height,\n );\n\n // Use props if provided, otherwise use observed size\n const width = allProps.width ?? observedWidth ?? 0;\n const mainHeight = allProps.height ?? observedHeight ?? 0;\n const height =\n (typeof mainHeight === \"number\" ? mainHeight : 0) -\n LAYOUT_CONSTANTS.HEADER_HEIGHT;\n\n const initialDate = useMemo(\n () => dateFn(props.selectedDate),\n [props.selectedDate],\n );\n\n // Filter out events where the end date is before the start date\n const validEvents = useEvents(\n allProps.events || [],\n allProps.eventsAreSorted,\n allProps.enableEnrichedEvents,\n );\n\n const dir = resolveDirection(allProps.direction, allProps.locale);\n const resolvedScheme = useColorScheme(allProps.colorScheme);\n\n return (\n <CalendarProvider\n initialDate={initialDate}\n initialView={allProps.view || ECalendarViewType.month}\n initialCustomDays={allProps.customDays}\n testId={allProps.testId}\n config={{ ...allProps, width, height }}\n >\n <div\n ref={containerRef}\n data-testid={\n allProps.children ? `${allProps.testId}-container` : undefined\n }\n dir={dir}\n data-color-scheme={resolvedScheme}\n style={{\n width: allProps.width ?? \"100%\",\n height: allProps.height ?? \"100%\",\n display: \"flex\",\n flexDirection: \"column\",\n overflow: \"hidden\",\n ...(allProps.children\n ? ({\n \"--calendar-width\": `${width}px`,\n \"--calendar-height\": `${height}px`,\n } as CSSProperties)\n : undefined),\n }}\n className={cx(\n allProps.children ? styles.calendar : undefined,\n allProps.children ? allProps.classNames?.root : undefined,\n )}\n >\n <CalendarErrorBoundary>\n {allProps.children ? (\n allProps.children\n ) : (\n <CalendarContent\n {...(allProps as unknown as CalendarContentProps)}\n width={width}\n height={height}\n events={validEvents}\n />\n )}\n </CalendarErrorBoundary>\n </div>\n </CalendarProvider>\n );\n}\n\nconst MemoizedCalendar = memo(\n Calendar,\n) as unknown as React.NamedExoticComponent<CalendarProps> & {\n Header: typeof Header;\n View: typeof View;\n DayView: typeof DayView;\n WeekView: typeof WeekView;\n MonthView: typeof MonthView;\n ScheduleView: typeof ScheduleView;\n CustomDaysView: typeof CustomDaysView;\n};\n\nMemoizedCalendar.Header = Header;\nMemoizedCalendar.View = View;\nMemoizedCalendar.DayView = DayView;\nMemoizedCalendar.WeekView = WeekView;\nMemoizedCalendar.MonthView = MonthView;\nMemoizedCalendar.ScheduleView = ScheduleView;\nMemoizedCalendar.CustomDaysView = CustomDaysView;\n\nexport default MemoizedCalendar;\n","import Calendar from \"./Calendar\";\nimport \"./styles/variables.css\";\n\nexport { EDayType, ECalendarViewType } from \"./types\";\nexport type {\n CalendarProps,\n CalendarEvent,\n CalendarContentProps,\n ColorScheme,\n CalendarTheme,\n ThemeScheme,\n} from \"./types\";\nexport type { HeaderProps } from \"./components/layout/Header\";\nexport type { ViewProps } from \"./components/views/View\";\nexport type { MonthViewProps } from \"./components/views/month_view/MonthView\";\nexport type { WeekViewProps } from \"./components/views/week_view/WeekView\";\nexport type { DayViewProps } from \"./components/views/day_view/DayView\";\nexport type { ScheduleViewProps } from \"./components/views/schedule_view/ScheduleView\";\nexport type { CustomViewProps } from \"./components/views/custom_days_view/CustomDaysView\";\n\nexport { CalendarProvider, useCalendar } from \"./context/CalendarContext\";\nexport { CALENDAR_ACTIONS } from \"./constants\";\n\nexport default Calendar;\n"],"x_google_ignoreList":[0,4,35],"mappings":"utBAOC,UAAY,CACZ,aAEA,IAAI,EAAS,CAAA,EAAG,eAEhB,SAAS,GAAc,CAGtB,QAFI,EAAU,GAEL,EAAI,EAAG,EAAI,UAAU,OAAQ,IAAK,CAC1C,IAAI,EAAM,UAAU,CAAA,EAChB,IACH,EAAU,EAAY,EAAS,EAAW,CAAA,CAAI,GAIhD,OAAO,EAGR,SAAS,EAAY,EAAK,CACzB,GAAI,OAAO,GAAQ,UAAY,OAAO,GAAQ,SAC7C,OAAO,EAGR,GAAI,OAAO,GAAQ,SAClB,MAAO,GAGR,GAAI,MAAM,QAA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