import { addTime , propsFromCalendarObj , CalendarUnit } from './chrono' ; const timeProps = [ 'epochSeconds' , 'dayOfWeek' ] ; internal export const timeProp = Object . fromEntries ( timeProps . map ( ( propName , i ) => [ propName , i ] ) ) ; const zonedDateTimeFromCache = { } ; interface TemporalArgs { timeZone : string ; year : number ; month : number ; day : number ; hour ? : number ; minute ? : number ; second ? : number ; } internal export const cachedZonedDateTimeFrom = ( temporalArgs ) => { const { timeZone , year , month , day , hour = 0 } = temporalArgs ; const key = `_${ year }_${ month }_${ day }_${ hour }_${ timeZone }` ; const cachedValue = zonedDateTimeFromCache [ key ] ; if ( cachedValue ) { return cachedValue ; } const result = propsFromCalendarObj ( { year , month , day , hour } , timeZone ) ; zonedDateTimeFromCache [ key ] = result ; return result ; } ; const deltaTimeCache = { } ; internal export const cachedTimeDelta = ( temporalArgs , unit , count ) => { const { timeZone , year , month , day } = temporalArgs ; const key = `_${ year }_${ month }_${ day }_${ timeZone }_${ count }_${ unit }` ; const cachedValue = deltaTimeCache [ key ] ; if ( cachedValue ) { return cachedValue ; } const result = addTime ( { year , month , day } , timeZone , unit , count ) ; deltaTimeCache [ key ] = result ; return result ; } ;