import { Locale } from '../Locale' ; const MAP = [ 'th' , 'st' , 'nd' , 'rd' , 'th' , 'th' , 'th' , 'th' , 'th' , 'th' ] ; const lc = { weekStartsOn : 0 , firstWeekContainsDate : 4 , am : 'am' , pm : 'pm' , formatLT : 'h:mm A' , formatLTS : 'h:mm:ss A' , formatL : 'MM/DD/Y' , formatl : 'M/D/Y' , formatLL : 'MMMM D, Y' , formatll : 'MMM D, Y' , formatLLL : 'MMMM D, Y h:mm A' , formatlll : 'MMM D, Y h:mm A' , formatLLLL : 'dddd, MMMM D, Y h:mm A' , formatllll : 'ddd, MMM D, Y h:mm A' , suffix : ( value ) => { const TH_SPECIAL_MIN = 11 ; const TH_SPECIAL_MAX = 13 ; const suffix = value >= TH_SPECIAL_MIN && value <= TH_SPECIAL_MAX ? 'th' : MAP [ value % MAP . length ] ; return value + suffix ; } , identifierTime : ( short ) => short ? 'lll' : 'LLL' , identifierDay : ( short ) => short ? 'll' : 'LL' , identifierWeek : ( short ) => 'wo [week of] Y' , identifierMonth : ( short ) => short ? 'MMM Y' : 'MMMM Y' , identifierQuarter : ( short ) => 'Qo [quarter] Y' , identifierYear : ( short ) => 'Y' , patternNone : ( day ) => 'Does not repeat' , patternDaily : ( day ) => 'Daily' , patternWeekly : ( day ) => 'Weekly on ' + day . format ( 'dddd' ) , patternMonthlyWeek : ( day ) => 'Monthly on the ' + lc . suffix ( day . weekspanOfMonth + 1 ) + ' ' + day . format ( 'dddd' ) , patternAnnually : ( day ) => 'Annually on ' + day . format ( 'MMMM Do' ) , patternAnnuallyMonthWeek : ( day ) => 'Annually on the ' + lc . suffix ( day . weekspanOfMonth + 1 ) + ' ' + day . format ( 'dddd' ) + ' of ' + day . format ( 'MMMM' ) , patternWeekday : ( day ) => 'Every weekday (Monday to Friday)' , patternMonthly : ( day ) => 'Monthly on the ' + day . format ( 'Do' ) + ' day' , patternLastDay : ( day ) => 'Last day of the month' , patternLastDayOfMonth : ( day ) => 'Last day of ' + day . format ( 'MMMM' ) , patternLastWeekday : ( day ) => 'Last ' + day . format ( 'dddd' ) + ' in ' + day . format ( 'MMMM' ) , patternCustom : ( day ) => 'Custom...' , scheduleStartingOn : ( start ) => 'Starting on ' + start . format ( 'MMMM Do, YYYY' ) , scheduleEndingOn : ( end ) => ' and ending on ' + end . format ( 'MMMM Do, YYYY' ) , scheduleEndsOn : ( end ) => 'Up until ' + end . format ( 'MMMM Do, YYYY' ) , scheduleThing : ( thing , start ) => start ? 'The ' + thing + ' will occur' : ' the ' + thing + ' will occur' , scheduleAtTimes : ' at ' , scheduleDuration : ( duration , unit ) => ' lasting ' + duration + ' ' + ( unit ? unit + ( duration !== 1 ? 's' : '' ) + ' ' : '' ) , scheduleExcludes : ' excluding ' , scheduleIncludes : ' including ' , scheduleCancels : ' with cancellations on ' , ruleDayOfWeek : { every : ( every ) => `every ${ lc . suffix ( every ) } day of the week` , offset : ( offset ) => `starting on the ${ lc . suffix ( offset ) } day of the week` , oneOf : ( values ) => `on the ${ lc . list ( values . map ( lc . suffix ) ) } day of the week` } , ruleLastDayOfMonth : { every : ( every ) => `every ${ lc . suffix ( every ) } last day of the month` , offset : ( offset ) => `starting on the ${ lc . suffix ( offset ) } last day of the month` , oneOf : ( values ) => `on the ${ lc . list ( values . map ( lc . suffix ) ) } last day of the month` } , ruleDayOfMonth : { every : ( every ) => `every ${ lc . suffix ( every ) } day of the month` , offset : ( offset ) => `starting on the ${ lc . suffix ( offset ) } day of the month` , oneOf : ( values ) => `on the ${ lc . list ( values . map ( lc . suffix ) ) } day of the month` } , ruleDayOfYear : { every : ( every ) => `every ${ lc . suffix ( every ) } day of the year` , offset : ( offset ) => `starting on the ${ lc . suffix ( offset + 1 ) } day of the year` , oneOf : ( values ) => `on the ${ lc . list ( values . map ( lc . suffix ) ) } day of the year` } , ruleYear : { every : ( every ) => `every ${ lc . suffix ( every ) } year` , offset : ( offset ) => `starting in ${ offset }` , oneOf : ( values ) => `in ${ lc . list ( values . map ( x => x . toString ( ) ) ) }` } , ruleMonth : { every : ( every ) => `every ${ lc . suffix ( every ) } month` , offset : ( offset ) => `starting in ${ lc . months [ 0 ] [ offset ] }` , oneOf : ( values ) => `in ${ lc . list ( values . map ( x => lc . months [ 0 ] [ x ] ) ) }` } , ruleDay : { every : ( every ) => `every ${ lc . suffix ( every ) } day of the week` , offset : ( offset ) => `starting on ${ lc . weekdays [ 0 ] [ offset ] }` , oneOf : ( values ) => `on ${ lc . list ( values . map ( v => lc . weekdays [ 0 ] [ v ] ) ) }` } , ruleWeek : { every : ( every ) => `every ${ lc . suffix ( every ) } week of the year` , offset : ( offset ) => `starting on the ${ lc . suffix ( offset ) } week of the year` , oneOf : ( values ) => `on the ${ lc . list ( values . map ( lc . suffix ) ) } week of the year` } , ruleWeekOfYear : { every : ( every ) => `every ${ lc . suffix ( every ) } week of the year` , offset : ( offset ) => `starting on the ${ lc . suffix ( offset ) } week of the year` , oneOf : ( values ) => `on the ${ lc . list ( values . map ( lc . suffix ) ) } week of the year` } , ruleWeekspanOfYear : { every : ( every ) => `every ${ lc . suffix ( every + 1 ) } weekspan of the year` , offset : ( offset ) => `starting on the ${ lc . suffix ( offset + 1 ) } weekspan of the year` , oneOf : ( values ) => `on the ${ lc . list ( values . map ( x => lc . suffix ( x + 1 ) ) ) } weekspan of the year` } , ruleFullWeekOfYear : { every : ( every ) => `every ${ lc . suffix ( every ) } full week of the year` , offset : ( offset ) => `starting on the ${ lc . suffix ( offset ) } full week of the year` , oneOf : ( values ) => `on the ${ lc . list ( values . map ( lc . suffix ) ) } full week of the year` } , ruleLastWeekspanOfYear : { every : ( every ) => `every ${ lc . suffix ( every + 1 ) } last weekspan of the year` , offset : ( offset ) => `starting on the ${ lc . suffix ( offset + 1 ) } last weekspan of the year` , oneOf : ( values ) => `on the ${ lc . list ( values . map ( x => lc . suffix ( x + 1 ) ) ) } last weekspan of the year` } , ruleLastFullWeekOfYear : { every : ( every ) => `every ${ lc . suffix ( every ) } last full week of the year` , offset : ( offset ) => `starting on the ${ lc . suffix ( offset ) } last full week of the year` , oneOf : ( values ) => `on the ${ lc . list ( values . map ( lc . suffix ) ) } last full week of the year` } , ruleWeekOfMonth : { every : ( every ) => `every ${ lc . suffix ( every ) } week of the month` , offset : ( offset ) => `starting on the ${ lc . suffix ( offset ) } week of the month` , oneOf : ( values ) => `on the ${ lc . list ( values . map ( lc . suffix ) ) } week of the month` } , ruleFullWeekOfMonth : { every : ( every ) => `every ${ lc . suffix ( every ) } full week of the month` , offset : ( offset ) => `starting on the ${ lc . suffix ( offset ) } full week of the month` , oneOf : ( values ) => `on the ${ lc . list ( values . map ( lc . suffix ) ) } full week of the month` } , ruleWeekspanOfMonth : { every : ( every ) => `every ${ lc . suffix ( every + 1 ) } weekspan of the month` , offset : ( offset ) => `starting on the ${ lc . suffix ( offset + 1 ) } weekspan of the month` , oneOf : ( values ) => `on the ${ lc . list ( values . map ( x => lc . suffix ( x + 1 ) ) ) } weekspan of the month` } , ruleLastFullWeekOfMonth : { every : ( every ) => `every ${ lc . suffix ( every ) } last full week of the month` , offset : ( offset ) => `starting on the ${ lc . suffix ( offset ) } last full week of the month` , oneOf : ( values ) => `on the ${ lc . list ( values . map ( lc . suffix ) ) } last full week of the month` } , ruleLastWeekspanOfMonth : { every : ( every ) => `every ${ lc . suffix ( every + 1 ) } last weekspan of the month` , offset : ( offset ) => `starting on the ${ lc . suffix ( offset + 1 ) } last weekspan of the month` , oneOf : ( values ) => `on the ${ lc . list ( values . map ( x => lc . suffix ( x + 1 ) ) ) } last weekspan of the month` } , summaryDay : ( short , dayOfWeek , year ) => ( dayOfWeek ? ( short ? 'ddd, ' : 'dddd, ' ) : '' ) + ( short ? 'MMM ' : 'MMMM ' ) + 'Do' + ( year ? ' YYYY' : '' ) , summaryWeek : ( short , dayOfWeek , year ) => ( dayOfWeek ? ( short ? 'ddd, ' : 'dddd, ' ) : '' ) + ( short ? 'MMM ' : 'MMMM ' ) + 'Do' + ( year ? ' YYYY' : '' ) , summaryMonth : ( short , dayOfWeek , year ) => ( short ? 'MMM' : 'MMMM' ) + ( year ? ' YYYY' : '' ) , summaryYear : ( short , dayOfWeek , year ) => ( year ? 'YYYY' : '' ) , list : ( items ) => { const last = items . length - 1 ; let out = items [ 0 ] ; for ( let i = 1 ; i < last ; i ++ ) { out += ', ' + items [ i ] ; } if ( last > 0 ) { out += ' and ' + items [ last ] ; } return out ; } , months : [ [ 'January' , 'February' , 'March' , 'April' , 'May' , 'June' , 'July' , 'August' , 'September' , 'October' , 'November' , 'December' ] , [ 'Jan' , 'Feb' , 'Mar' , 'Apr' , 'May' , 'June' , 'July' , 'Aug' , 'Sept' , 'Oct' , 'Nov' , 'Dec' ] , [ 'Jan' , 'Feb' , 'Mar' , 'Apr' , 'May' , 'Jun' , 'Jul' , 'Aug' , 'Sep' , 'Oct' , 'Nov' , 'Dec' ] , [ 'Ja' , 'F' , 'Mr' , 'Ap' , 'My' , 'Je' , 'Jl' , 'Ag' , 'S' , 'O' , 'N' , 'D' ] ] , weekdays : [ [ 'Sunday' , 'Monday' , 'Tuesday' , 'Wednesday' , 'Thursday' , 'Friday' , 'Saturday' ] , [ 'Sun' , 'Mon' , 'Tues' , 'Wed' , 'Thurs' , 'Fri' , 'Sat' ] , [ 'Sun' , 'Mon' , 'Tue' , 'Wed' , 'Thu' , 'Fri' , 'Sat' ] , [ 'Su' , 'M' , 'Tu' , 'W' , 'Th' , 'F' , 'Sa' ] , ] , } ; export default lc ;