@arc-ui/components 12.0.0-alpha.0 → 12.0.0-beta.3

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.
Files changed (566) hide show
  1. package/dist/Alert/Alert.cjs.js +11 -15
  2. package/dist/Alert/Alert.esm.js +9 -13
  3. package/dist/Align/Align.cjs.js +6 -6
  4. package/dist/Align/Align.esm.js +2 -2
  5. package/dist/AppButton/AppButton.cjs.js +73 -0
  6. package/dist/AppButton/AppButton.esm.js +65 -0
  7. package/dist/AppButton/package.json +7 -0
  8. package/dist/Avatar/Avatar.cjs.js +18 -0
  9. package/dist/Avatar/Avatar.esm.js +10 -0
  10. package/dist/Avatar/package.json +7 -0
  11. package/dist/AvatarGroup/AvatarGroup.cjs.js +38 -0
  12. package/dist/AvatarGroup/AvatarGroup.esm.js +30 -0
  13. package/dist/AvatarGroup/package.json +7 -0
  14. package/dist/Badge/Badge.cjs.js +6 -21
  15. package/dist/Badge/Badge.esm.js +6 -21
  16. package/dist/Box/Box.cjs.js +6 -7
  17. package/dist/Box/Box.esm.js +3 -4
  18. package/dist/BrandLogo/BrandLogo.cjs.js +4 -4
  19. package/dist/BrandLogo/BrandLogo.esm.js +4 -4
  20. package/dist/Breadcrumbs/Breadcrumbs.cjs.js +7 -6
  21. package/dist/Breadcrumbs/Breadcrumbs.esm.js +7 -6
  22. package/dist/Button/Button.cjs.js +6 -6
  23. package/dist/Button/Button.esm.js +6 -6
  24. package/dist/ButtonV2/ButtonV2.cjs.js +16 -0
  25. package/dist/ButtonV2/ButtonV2.esm.js +8 -0
  26. package/dist/ButtonV2/package.json +7 -0
  27. package/dist/Calendar/Calendar.cjs.js +22 -0
  28. package/dist/Calendar/Calendar.esm.js +14 -0
  29. package/dist/Calendar/package.json +7 -0
  30. package/dist/Checkbox/Checkbox.cjs.js +9 -8
  31. package/dist/Checkbox/Checkbox.esm.js +9 -8
  32. package/dist/Columns/Columns.cjs.js +3 -3
  33. package/dist/Columns/Columns.esm.js +3 -3
  34. package/dist/DatePicker/DatePicker.cjs.js +40 -0
  35. package/dist/DatePicker/DatePicker.esm.js +27 -0
  36. package/dist/DatePicker/package.json +7 -0
  37. package/dist/Disclosure/Disclosure.cjs.js +15 -12
  38. package/dist/Disclosure/Disclosure.esm.js +12 -9
  39. package/dist/DisclosureMini/DisclosureMini.cjs.js +6 -6
  40. package/dist/DisclosureMini/DisclosureMini.esm.js +6 -6
  41. package/dist/Elevation/Elevation.cjs.js +5 -5
  42. package/dist/Elevation/Elevation.esm.js +1 -1
  43. package/dist/Filter/Filter.cjs.js +4 -3
  44. package/dist/Filter/Filter.esm.js +4 -3
  45. package/dist/FormControl/FormControl.cjs.js +8 -7
  46. package/dist/FormControl/FormControl.esm.js +8 -7
  47. package/dist/Grid/Grid.cjs.js +13 -0
  48. package/dist/Grid/Grid.esm.js +5 -0
  49. package/dist/Grid/package.json +7 -0
  50. package/dist/Group/Group.cjs.js +3 -3
  51. package/dist/Group/Group.esm.js +3 -3
  52. package/dist/Heading/Heading.cjs.js +4 -4
  53. package/dist/Heading/Heading.esm.js +4 -4
  54. package/dist/HeroButton/HeroButton.cjs.js +16 -0
  55. package/dist/HeroButton/HeroButton.esm.js +8 -0
  56. package/dist/HeroButton/package.json +7 -0
  57. package/dist/Hidden/Hidden.cjs.js +24 -0
  58. package/dist/Hidden/Hidden.esm.js +16 -0
  59. package/dist/Hidden/package.json +7 -0
  60. package/dist/Icon/Icon.cjs.js +4 -4
  61. package/dist/Icon/Icon.esm.js +4 -4
  62. package/dist/Image/Image.cjs.js +3 -3
  63. package/dist/Image/Image.esm.js +3 -3
  64. package/dist/ImpactCard/ImpactCard.cjs.js +44 -0
  65. package/dist/ImpactCard/ImpactCard.esm.js +36 -0
  66. package/dist/ImpactCard/package.json +7 -0
  67. package/dist/InformationCard/InformationCard.cjs.js +74 -0
  68. package/dist/InformationCard/InformationCard.esm.js +66 -0
  69. package/dist/InformationCard/package.json +7 -0
  70. package/dist/Link/Link.cjs.js +76 -0
  71. package/dist/Link/Link.esm.js +68 -0
  72. package/dist/Link/package.json +7 -0
  73. package/dist/Markup/Markup.cjs.js +6 -6
  74. package/dist/Markup/Markup.esm.js +2 -2
  75. package/dist/MediaCard/MediaCard.cjs.js +26 -0
  76. package/dist/MediaCard/MediaCard.esm.js +18 -0
  77. package/dist/MediaCard/package.json +7 -0
  78. package/dist/Modal/Modal.cjs.js +1478 -527
  79. package/dist/Modal/Modal.esm.js +1455 -523
  80. package/dist/Pagination/Pagination.cjs.js +14 -17
  81. package/dist/Pagination/Pagination.esm.js +7 -10
  82. package/dist/PaginationSimple/PaginationSimple.cjs.js +24 -27
  83. package/dist/PaginationSimple/PaginationSimple.esm.js +22 -25
  84. package/dist/Poster/Poster.cjs.js +5 -5
  85. package/dist/Poster/Poster.esm.js +5 -5
  86. package/dist/ProgressBar/ProgressBar.cjs.js +21 -18
  87. package/dist/ProgressBar/ProgressBar.esm.js +17 -14
  88. package/dist/ProgressStepper/ProgressStepper.cjs.js +6 -7
  89. package/dist/ProgressStepper/ProgressStepper.esm.js +6 -7
  90. package/dist/RadioGroup/RadioGroup.cjs.js +10 -8
  91. package/dist/RadioGroup/RadioGroup.esm.js +9 -8
  92. package/dist/Rule/Rule.cjs.js +14 -4
  93. package/dist/Rule/Rule.esm.js +15 -5
  94. package/dist/ScrollToTop/ScrollToTop.cjs.js +12 -11
  95. package/dist/ScrollToTop/ScrollToTop.esm.js +7 -6
  96. package/dist/Section/Section.cjs.js +2 -2
  97. package/dist/Section/Section.esm.js +2 -2
  98. package/dist/Select/Select.cjs.js +358 -931
  99. package/dist/Select/Select.esm.js +304 -858
  100. package/dist/SiteFooter/SiteFooter.cjs.js +10 -33
  101. package/dist/SiteFooter/SiteFooter.esm.js +10 -33
  102. package/dist/SiteHeaderV2/SiteHeaderV2.cjs.js +25 -0
  103. package/dist/SiteHeaderV2/SiteHeaderV2.esm.js +17 -0
  104. package/dist/SiteHeaderV2/package.json +7 -0
  105. package/dist/SkipLink/SkipLink.cjs.js +24 -0
  106. package/dist/SkipLink/SkipLink.esm.js +16 -0
  107. package/dist/SkipLink/package.json +7 -0
  108. package/dist/Surface/Surface.cjs.js +2 -2
  109. package/dist/Surface/Surface.esm.js +2 -2
  110. package/dist/Switch/Switch.cjs.js +28 -73
  111. package/dist/Switch/Switch.esm.js +16 -61
  112. package/dist/Tabs/Tabs.cjs.js +11 -10
  113. package/dist/Tabs/Tabs.esm.js +11 -10
  114. package/dist/Tag/Tag.cjs.js +9 -43
  115. package/dist/Tag/Tag.esm.js +8 -42
  116. package/dist/Text/Text.cjs.js +4 -4
  117. package/dist/Text/Text.esm.js +4 -4
  118. package/dist/TextArea/TextArea.cjs.js +66 -46
  119. package/dist/TextArea/TextArea.esm.js +64 -44
  120. package/dist/TextInput/TextInput.cjs.js +10 -9
  121. package/dist/TextInput/TextInput.esm.js +10 -9
  122. package/dist/Theme/Theme.cjs.js +15 -4
  123. package/dist/Theme/Theme.esm.js +15 -4
  124. package/dist/ThemeIcon/ThemeIcon.cjs.js +14 -0
  125. package/dist/ThemeIcon/ThemeIcon.esm.js +6 -0
  126. package/dist/ThemeIcon/package.json +7 -0
  127. package/dist/Toast/Toast.cjs.js +10 -9
  128. package/dist/Toast/Toast.esm.js +10 -9
  129. package/dist/Truncate/Truncate.cjs.js +3 -3
  130. package/dist/Truncate/Truncate.esm.js +1 -1
  131. package/dist/TypographyCard/TypographyCard.cjs.js +41 -0
  132. package/dist/TypographyCard/TypographyCard.esm.js +33 -0
  133. package/dist/TypographyCard/package.json +7 -0
  134. package/dist/UniversalHeader/UniversalHeader.cjs.js +3 -3
  135. package/dist/UniversalHeader/UniversalHeader.esm.js +3 -3
  136. package/dist/VerticalSpace/VerticalSpace.cjs.js +2 -2
  137. package/dist/VerticalSpace/VerticalSpace.esm.js +2 -2
  138. package/dist/VideoPlayer/VideoPlayer.cjs.js +3013 -0
  139. package/dist/VideoPlayer/VideoPlayer.esm.js +3005 -0
  140. package/dist/VideoPlayer/package.json +7 -0
  141. package/dist/Visible/Visible.cjs.js +24 -0
  142. package/dist/Visible/Visible.esm.js +16 -0
  143. package/dist/Visible/package.json +7 -0
  144. package/dist/VisuallyHidden/VisuallyHidden.cjs.js +1 -1
  145. package/dist/VisuallyHidden/VisuallyHidden.esm.js +1 -1
  146. package/dist/_shared/cjs/ArcIconEclipse.esm-ac777a76.js +28 -0
  147. package/dist/_shared/cjs/Avatar-fc0d9b8b.js +49 -0
  148. package/dist/_shared/cjs/{BrandLogo-aea340c8.js → BrandLogo-1d2ca2c7.js} +7 -7
  149. package/dist/_shared/cjs/{Breadcrumbs-f3385e2e.js → Breadcrumbs-7af0af2c.js} +16 -16
  150. package/dist/_shared/cjs/BtIconArrowRight.esm-5989f2ca.js +38 -0
  151. package/dist/_shared/cjs/BtIconChevronRightMid.esm-3e8d18a9.js +28 -0
  152. package/dist/_shared/cjs/BtIconPlayFill.esm-b8997cfc.js +30 -0
  153. package/dist/_shared/cjs/{Button-5c958ce9.js → Button-7d891a89.js} +12 -12
  154. package/dist/_shared/cjs/ButtonV2-b2db3f46.js +48 -0
  155. package/dist/_shared/cjs/Calendar-780bb071.js +1927 -0
  156. package/dist/_shared/cjs/CardFooter-5414bc4f.js +79 -0
  157. package/dist/_shared/cjs/{Checkbox-5f14bb0d.js → Checkbox-0e423653.js} +18 -14
  158. package/dist/_shared/cjs/{Columns-ae4f8cef.js → Columns-1224bdff.js} +9 -16
  159. package/dist/_shared/cjs/Combination-3a639f6d.js +2974 -0
  160. package/dist/_shared/cjs/ConditionalWrapper-be3b2625.js +14 -0
  161. package/dist/_shared/cjs/DatePicker-e27ea988.js +550 -0
  162. package/dist/_shared/cjs/{DisclosureMini-145105a4.js → DisclosureMini-c01ecce0.js} +12 -15
  163. package/dist/_shared/cjs/{Filter-1bde635c.js → Filter-3b897d92.js} +32 -24
  164. package/dist/_shared/cjs/{FormControl-30f2330f.js → FormControl-88d48f42.js} +32 -17
  165. package/dist/_shared/cjs/Grid-9e91fb3d.js +46 -0
  166. package/dist/_shared/cjs/{Group-0429741a.js → Group-3d5ea240.js} +9 -16
  167. package/dist/_shared/cjs/{Heading-27cba320.js → Heading-fb63844f.js} +7 -7
  168. package/dist/_shared/cjs/HeroButton-0586a7c4.js +126 -0
  169. package/dist/_shared/cjs/{Icon-a47b6c0a.js → Icon-0ec0c1fb.js} +12 -8
  170. package/dist/_shared/cjs/Image-e9a5a326.js +56 -0
  171. package/dist/_shared/cjs/MediaCard-e1648705.js +65 -0
  172. package/dist/_shared/cjs/{Poster-499b78da.js → Poster-b7242b37.js} +14 -14
  173. package/dist/_shared/cjs/Preview-0bf3f6e8.js +167 -0
  174. package/dist/_shared/cjs/ProgressStepper-fb8405c2.js +121 -0
  175. package/dist/_shared/cjs/RadioGroup-a4186267.js +85 -0
  176. package/dist/_shared/cjs/{Section-59804166.js → Section-ecfc659b.js} +5 -5
  177. package/dist/_shared/cjs/{SiteFooter-0638c27c.js → SiteFooter-b4247527.js} +13 -12
  178. package/dist/_shared/cjs/SiteHeaderV2-c2d651bc.js +689 -0
  179. package/dist/_shared/cjs/{Surface-038db6e1.js → Surface-8599dbe4.js} +23 -23
  180. package/dist/_shared/cjs/{Tabs-ade6d6b6.js → Tabs-75c34f43.js} +35 -39
  181. package/dist/_shared/cjs/Tag-452048f6.js +44 -0
  182. package/dist/_shared/cjs/{Text-606ca3a2.js → Text-1c1110a4.js} +7 -7
  183. package/dist/_shared/cjs/TextInput-762e2309.js +103 -0
  184. package/dist/_shared/cjs/{ThemeIcon-9534f091.js → ThemeIcon-ee814862.js} +8 -8
  185. package/dist/_shared/cjs/{Toast-6d4021d7.js → Toast-d06a89e0.js} +283 -44
  186. package/dist/_shared/cjs/UniversalHeader-f6d9c63a.js +29 -0
  187. package/dist/_shared/cjs/{VerticalSpace-dc53bb70.js → VerticalSpace-e128ec68.js} +5 -5
  188. package/dist/_shared/cjs/{VisuallyHidden-e2c8b291.js → VisuallyHidden-b0de4c7b.js} +1 -1
  189. package/dist/_shared/cjs/_commonjsHelpers-56412ec5.js +21 -0
  190. package/dist/_shared/cjs/{index-38d3848e.js → component-df82bc05.js} +154 -435
  191. package/dist/_shared/cjs/{debounce-123468fb.js → debounce-a74c28cf.js} +2 -2
  192. package/dist/_shared/cjs/index-039a9d35.js +23 -0
  193. package/dist/_shared/cjs/{index-23b4f49f.js → index-0c6319ec.js} +1 -1
  194. package/dist/_shared/cjs/index-28447df0.js +23 -0
  195. package/dist/_shared/cjs/index-3d629205.js +26 -0
  196. package/dist/_shared/cjs/{index.module-7d7228b3.js → index-3dd54df1.js} +47 -49
  197. package/dist/_shared/cjs/index-41b09e85.js +53 -0
  198. package/dist/_shared/cjs/{index-d75774a9.js → index-7aa7f96a.js} +1 -1
  199. package/dist/_shared/cjs/index-7e31a45b.js +2206 -0
  200. package/dist/_shared/cjs/index-996dec94.js +131 -0
  201. package/dist/_shared/cjs/index-dcfdd5da.js +11 -0
  202. package/dist/_shared/cjs/{filter-data-attrs-1c9a530c.js → index-df60851b.js} +17 -57
  203. package/dist/_shared/cjs/index.es-8b018b0d.js +13 -0
  204. package/dist/_shared/cjs/{suffix-modifier-64dcd338.js → suffix-modifier-c8a34402.js} +2 -2
  205. package/dist/_shared/cjs/{index.es-77def0c9.js → use-media-query-d34c83b9.js} +0 -9
  206. package/dist/_shared/esm/ArcIconEclipse.esm-bb48b82a.js +22 -0
  207. package/dist/_shared/esm/Avatar-38cc0595.js +43 -0
  208. package/dist/_shared/esm/{BrandLogo-1af78f76.js → BrandLogo-7ed8aeda.js} +3 -3
  209. package/dist/_shared/esm/{Breadcrumbs-c4b65cff.js → Breadcrumbs-9078b68e.js} +8 -8
  210. package/dist/_shared/esm/BtIconArrowRight.esm-6a17d0ce.js +31 -0
  211. package/dist/_shared/esm/BtIconChevronRightMid.esm-4764708f.js +22 -0
  212. package/dist/_shared/esm/BtIconPlayFill.esm-05fc0344.js +24 -0
  213. package/dist/_shared/esm/{Button-c3348ed8.js → Button-dde2b46a.js} +6 -6
  214. package/dist/_shared/esm/ButtonV2-49cd0615.js +42 -0
  215. package/dist/_shared/esm/Calendar-f81052f4.js +1918 -0
  216. package/dist/_shared/esm/CardFooter-c79fb2db.js +73 -0
  217. package/dist/_shared/esm/{Checkbox-2a623386.js → Checkbox-0baca464.js} +14 -10
  218. package/dist/_shared/esm/{Columns-d96b7425.js → Columns-6a8f6fbb.js} +3 -10
  219. package/dist/_shared/esm/Combination-ae3a3f08.js +2942 -0
  220. package/dist/_shared/esm/ConditionalWrapper-59be8f35.js +8 -0
  221. package/dist/_shared/esm/DatePicker-2260f260.js +539 -0
  222. package/dist/_shared/esm/{DisclosureMini-bf95a9db.js → DisclosureMini-38f4c459.js} +8 -11
  223. package/dist/_shared/esm/{Filter-58a42358.js → Filter-49dcf5ce.js} +24 -16
  224. package/dist/_shared/esm/{FormControl-433228f5.js → FormControl-d873f7fa.js} +29 -14
  225. package/dist/_shared/esm/Grid-fb9fc522.js +40 -0
  226. package/dist/_shared/esm/{Group-73fdb896.js → Group-66196f07.js} +3 -10
  227. package/dist/_shared/esm/{Heading-d16e0e53.js → Heading-906c7c7c.js} +3 -3
  228. package/dist/_shared/esm/HeroButton-7ea692bf.js +120 -0
  229. package/dist/_shared/esm/{Icon-9ecaaeab.js → Icon-512f834f.js} +9 -5
  230. package/dist/_shared/esm/{Image-12fbd327.js → Image-57d08939.js} +15 -5
  231. package/dist/_shared/esm/MediaCard-01250268.js +59 -0
  232. package/dist/_shared/esm/{Poster-699dc89b.js → Poster-e05a8b45.js} +6 -6
  233. package/dist/_shared/esm/Preview-43b2a75d.js +161 -0
  234. package/dist/_shared/esm/ProgressStepper-189ed0f9.js +115 -0
  235. package/dist/_shared/esm/RadioGroup-8ff17cbb.js +78 -0
  236. package/dist/_shared/esm/{Section-73781b56.js → Section-1acbc06a.js} +1 -1
  237. package/dist/_shared/esm/{SiteFooter-d21da7ab.js → SiteFooter-ef6f0cdc.js} +9 -8
  238. package/dist/_shared/esm/SiteHeaderV2-a041b889.js +683 -0
  239. package/dist/_shared/esm/{Surface-0ca6817d.js → Surface-71d21a9e.js} +17 -17
  240. package/dist/_shared/esm/{Tabs-39d24a7d.js → Tabs-21ac7dfe.js} +11 -15
  241. package/dist/_shared/esm/Tag-2513c185.js +38 -0
  242. package/dist/_shared/esm/{Text-14f586ac.js → Text-a46fb76b.js} +3 -3
  243. package/dist/_shared/esm/TextInput-94c7b1a4.js +96 -0
  244. package/dist/_shared/esm/{ThemeIcon-eab5a4d0.js → ThemeIcon-c2dc41a6.js} +3 -3
  245. package/dist/_shared/esm/{Toast-dce2d01e.js → Toast-de6ca2f3.js} +261 -23
  246. package/dist/_shared/esm/{UniversalHeader-b4c1577c.js → UniversalHeader-456ad60c.js} +8 -13
  247. package/dist/_shared/esm/{VerticalSpace-43cd9138.js → VerticalSpace-b07cd8e6.js} +1 -1
  248. package/dist/_shared/esm/{VisuallyHidden-b9eebf71.js → VisuallyHidden-06692fd3.js} +1 -1
  249. package/dist/_shared/esm/_commonjsHelpers-0109d574.js +18 -0
  250. package/dist/_shared/esm/{index-ffd720d0.js → component-d0a555cf.js} +144 -432
  251. package/dist/_shared/esm/{debounce-6fed6b84.js → debounce-c8e41002.js} +1 -1
  252. package/dist/_shared/esm/{filter-data-attrs-ea8f4ed4.js → index-288c66b5.js} +17 -55
  253. package/dist/_shared/esm/index-4e58de24.js +51 -0
  254. package/dist/_shared/esm/index-5113ed53.js +24 -0
  255. package/dist/_shared/esm/index-6028d797.js +21 -0
  256. package/dist/_shared/esm/index-605031ca.js +2197 -0
  257. package/dist/_shared/esm/index-69089474.js +21 -0
  258. package/dist/_shared/esm/{index-3147c5b0.js → index-7740883c.js} +1 -1
  259. package/dist/_shared/esm/index-a624de47.js +9 -0
  260. package/dist/_shared/esm/{index.module-50b2c98a.js → index-cace3545.js} +43 -45
  261. package/dist/_shared/esm/{index-65264b4e.js → index-f97466e9.js} +1 -1
  262. package/dist/_shared/esm/index-fa93ec97.js +129 -0
  263. package/dist/_shared/esm/index.es-3139cf9e.js +9 -0
  264. package/dist/_shared/esm/{suffix-modifier-3d548e45.js → suffix-modifier-1ce05abe.js} +2 -2
  265. package/dist/_shared/esm/{index.es-00cb3bcb.js → use-media-query-d3622da8.js} +1 -8
  266. package/dist/index.es.js +18330 -38186
  267. package/dist/index.es.js.map +1 -1
  268. package/dist/index.js +18317 -38162
  269. package/dist/index.js.map +1 -1
  270. package/dist/styles.css +7 -38
  271. package/dist/types/components/Alert/Alert.d.ts +1 -1
  272. package/dist/types/components/AppButton/AppButton.d.ts +9 -0
  273. package/dist/types/components/AppButton/icons/AppStore.d.ts +2 -0
  274. package/dist/types/components/AppButton/icons/GooglePlay.d.ts +2 -0
  275. package/dist/types/components/AppButton/index.d.ts +1 -0
  276. package/dist/types/components/Avatar/Avatar.d.ts +14 -0
  277. package/dist/types/components/Avatar/components/AvatarContent/AvatarContent.d.ts +9 -0
  278. package/dist/types/components/Avatar/index.d.ts +1 -0
  279. package/dist/types/components/Avatar/types/avatar-icon-size.d.ts +1 -0
  280. package/dist/types/components/Avatar/types/avatar-image.d.ts +2 -0
  281. package/dist/types/components/Avatar/types/avatar-size.d.ts +1 -0
  282. package/dist/types/components/Avatar/types/avatar-text-size.d.ts +2 -0
  283. package/dist/types/components/AvatarGroup/AvatarGroup.d.ts +14 -0
  284. package/dist/types/components/AvatarGroup/index.d.ts +1 -0
  285. package/dist/types/components/AvatarGroup/types/group-avatar.d.ts +2 -0
  286. package/dist/types/components/AvatarGroup/utils/get-avatars.d.ts +2 -0
  287. package/dist/types/components/Badge/Badge.d.ts +1 -9
  288. package/dist/types/components/Button/Button.d.ts +1 -1
  289. package/dist/types/components/ButtonV2/ButtonV2.d.ts +79 -0
  290. package/dist/types/components/ButtonV2/index.d.ts +1 -0
  291. package/dist/types/components/Calendar/Calendar.d.ts +50 -0
  292. package/dist/types/components/Calendar/Calendar.provider.d.ts +21 -0
  293. package/dist/types/components/Calendar/components/CalendarDateSelect/CalendarDateSelect.d.ts +15 -0
  294. package/dist/types/components/Calendar/components/CalendarDateSelect/index.d.ts +1 -0
  295. package/dist/types/components/Calendar/components/CalendarDayGrid/CalendarDayGrid.d.ts +6 -0
  296. package/dist/types/components/Calendar/components/CalendarDayGrid/index.d.ts +1 -0
  297. package/dist/types/components/Calendar/components/CalendarDayNumber/CalendarDayNumber.d.ts +8 -0
  298. package/dist/types/components/Calendar/components/CalendarDayNumber/index.d.ts +1 -0
  299. package/dist/types/components/Calendar/components/CalendarDoubleMonthView/CalendarDoubleMonthView.d.ts +9 -0
  300. package/dist/types/components/Calendar/components/CalendarDoubleMonthView/index.d.ts +1 -0
  301. package/dist/types/components/Calendar/components/CalendarFooter/CalendarFooter.d.ts +6 -0
  302. package/dist/types/components/Calendar/components/CalendarFooter/index.d.ts +1 -0
  303. package/dist/types/components/Calendar/components/CalendarMonthView/CalendarMonthView.d.ts +9 -0
  304. package/dist/types/components/Calendar/components/CalendarMonthView/index.d.ts +1 -0
  305. package/dist/types/components/Calendar/components/CalendarMonthYearView/CalendarMonthYearView.d.ts +11 -0
  306. package/dist/types/components/Calendar/components/CalendarMonthYearView/index.d.ts +1 -0
  307. package/dist/types/components/Calendar/components/CalendarNavButton/CalendarNavButton.d.ts +10 -0
  308. package/dist/types/components/Calendar/components/CalendarNavButton/index.d.ts +1 -0
  309. package/dist/types/components/Calendar/components/CalendarWrapper/CalendarWrapper.d.ts +5 -0
  310. package/dist/types/components/Calendar/components/CalendarWrapper/index.d.ts +1 -0
  311. package/dist/types/components/Calendar/components/index.d.ts +6 -0
  312. package/dist/types/components/Calendar/constants/day-names.d.ts +5 -0
  313. package/dist/types/components/Calendar/constants/index.d.ts +1 -0
  314. package/dist/types/components/Calendar/helpers/contains-date.d.ts +1 -0
  315. package/dist/types/components/Calendar/helpers/contains-date.test.d.ts +1 -0
  316. package/dist/types/components/Calendar/helpers/date-without-time.d.ts +1 -0
  317. package/dist/types/components/Calendar/helpers/date-without-time.test.d.ts +1 -0
  318. package/dist/types/components/Calendar/helpers/get-calendar-type.d.ts +2 -0
  319. package/dist/types/components/Calendar/helpers/get-calendar-type.test.d.ts +1 -0
  320. package/dist/types/components/Calendar/helpers/get-dates-in-month.d.ts +1 -0
  321. package/dist/types/components/Calendar/helpers/get-dates-in-month.test.d.ts +1 -0
  322. package/dist/types/components/Calendar/helpers/get-double-month-display-range.d.ts +1 -0
  323. package/dist/types/components/Calendar/helpers/get-double-month-display-range.test.d.ts +1 -0
  324. package/dist/types/components/Calendar/helpers/get-focus-date.d.ts +5 -0
  325. package/dist/types/components/Calendar/helpers/get-focus-date.test.d.ts +1 -0
  326. package/dist/types/components/Calendar/helpers/get-highlighted-range.d.ts +6 -0
  327. package/dist/types/components/Calendar/helpers/get-highlighted-range.test.d.ts +1 -0
  328. package/dist/types/components/Calendar/helpers/get-keydown-date.d.ts +6 -0
  329. package/dist/types/components/Calendar/helpers/get-keydown-date.test.d.ts +1 -0
  330. package/dist/types/components/Calendar/helpers/index.d.ts +13 -0
  331. package/dist/types/components/Calendar/helpers/is-day.d.ts +2 -0
  332. package/dist/types/components/Calendar/helpers/is-day.test.d.ts +1 -0
  333. package/dist/types/components/Calendar/helpers/is-disabled-date.d.ts +1 -0
  334. package/dist/types/components/Calendar/helpers/is-disabled-date.test.d.ts +1 -0
  335. package/dist/types/components/Calendar/helpers/is-month-after-max-date.d.ts +1 -0
  336. package/dist/types/components/Calendar/helpers/is-month-after-max-date.test.d.ts +1 -0
  337. package/dist/types/components/Calendar/helpers/is-month-before-min-date.d.ts +1 -0
  338. package/dist/types/components/Calendar/helpers/is-month-before-min-date.test.d.ts +1 -0
  339. package/dist/types/components/Calendar/helpers/process-selected-range.d.ts +9 -0
  340. package/dist/types/components/Calendar/helpers/process-selected-range.test.d.ts +1 -0
  341. package/dist/types/components/Calendar/index.d.ts +2 -0
  342. package/dist/types/components/Calendar/state/handlers/calendar-keydown-handler.d.ts +3 -0
  343. package/dist/types/components/Calendar/state/handlers/day-grid-leave-handler.d.ts +3 -0
  344. package/dist/types/components/Calendar/state/handlers/day-number-select-handler.d.ts +3 -0
  345. package/dist/types/components/Calendar/state/handlers/default-handler.d.ts +2 -0
  346. package/dist/types/components/Calendar/state/handlers/dropdown-change-month-handler.d.ts +3 -0
  347. package/dist/types/components/Calendar/state/handlers/dropdown-change-year-handler.d.ts +3 -0
  348. package/dist/types/components/Calendar/state/handlers/highlight-range-handler.d.ts +3 -0
  349. package/dist/types/components/Calendar/state/handlers/index.d.ts +12 -0
  350. package/dist/types/components/Calendar/state/handlers/range-select-handler.d.ts +3 -0
  351. package/dist/types/components/Calendar/state/handlers/show-next-double-month-handler.d.ts +3 -0
  352. package/dist/types/components/Calendar/state/handlers/show-next-month-handler.d.ts +3 -0
  353. package/dist/types/components/Calendar/state/handlers/show-previous-double-month-handler.d.ts +3 -0
  354. package/dist/types/components/Calendar/state/handlers/show-previous-month-handler.d.ts +3 -0
  355. package/dist/types/components/Calendar/state/index.d.ts +2 -0
  356. package/dist/types/components/Calendar/state/reducer.d.ts +3 -0
  357. package/dist/types/components/Calendar/state/reducer.test.d.ts +1 -0
  358. package/dist/types/components/Calendar/state/types/actions.d.ts +81 -0
  359. package/dist/types/components/Calendar/state/types/state-handler.d.ts +3 -0
  360. package/dist/types/components/Calendar/state/types/state.d.ts +5 -0
  361. package/dist/types/components/Calendar/types/calendar-type.d.ts +1 -0
  362. package/dist/types/components/Calendar/types/date-select-value.d.ts +2 -0
  363. package/dist/types/components/Calendar/types/index.d.ts +6 -0
  364. package/dist/types/components/Calendar/types/key-names.d.ts +13 -0
  365. package/dist/types/components/Calendar/types/range-selection.d.ts +10 -0
  366. package/dist/types/components/Calendar/types/selection-type.d.ts +1 -0
  367. package/dist/types/components/Calendar/types/week-days.d.ts +18 -0
  368. package/dist/types/components/Checkbox/Checkbox.d.ts +7 -4
  369. package/dist/types/components/DatePicker/DatePicker.d.ts +20 -0
  370. package/dist/types/components/DatePicker/constants/date-format.d.ts +1 -0
  371. package/dist/types/components/DatePicker/constants/index.d.ts +1 -0
  372. package/dist/types/components/DatePicker/helpers/convert-date-string-to-date.d.ts +1 -0
  373. package/dist/types/components/DatePicker/helpers/convert-date-string-to-date.test.d.ts +1 -0
  374. package/dist/types/components/DatePicker/helpers/convert-range-string-to-dates.d.ts +1 -0
  375. package/dist/types/components/DatePicker/helpers/convert-range-string-to-dates.test.d.ts +1 -0
  376. package/dist/types/components/DatePicker/helpers/format-date.d.ts +1 -0
  377. package/dist/types/components/DatePicker/helpers/format-date.test.d.ts +1 -0
  378. package/dist/types/components/DatePicker/helpers/index.d.ts +8 -0
  379. package/dist/types/components/DatePicker/helpers/is-date-valid.d.ts +1 -0
  380. package/dist/types/components/DatePicker/helpers/is-date-valid.test.d.ts +1 -0
  381. package/dist/types/components/DatePicker/helpers/is-disabled-date.d.ts +1 -0
  382. package/dist/types/components/DatePicker/helpers/is-disabled-date.test.d.ts +1 -0
  383. package/dist/types/components/DatePicker/helpers/is-range-valid.d.ts +1 -0
  384. package/dist/types/components/DatePicker/helpers/is-range-valid.test.d.ts +1 -0
  385. package/dist/types/components/DatePicker/helpers/parse-date-string.d.ts +5 -0
  386. package/dist/types/components/DatePicker/helpers/parse-date-string.test.d.ts +1 -0
  387. package/dist/types/components/DatePicker/helpers/parse-range-string.d.ts +14 -0
  388. package/dist/types/components/DatePicker/helpers/parse-range-string.test.d.ts +1 -0
  389. package/dist/types/components/DatePicker/index.d.ts +6 -0
  390. package/dist/types/components/Disclosure/Disclosure.d.ts +1 -2
  391. package/dist/types/components/DisclosureMini/DisclosureMini.d.ts +1 -2
  392. package/dist/types/components/Filter/Filter.d.ts +1 -1
  393. package/dist/types/components/Filter/FilterItems/FilterItems.d.ts +4 -0
  394. package/dist/types/components/FormControl/FormControl.d.ts +5 -1
  395. package/dist/types/components/Grid/Grid.constants.d.ts +1 -0
  396. package/dist/types/components/Grid/Grid.d.ts +28 -0
  397. package/dist/types/components/Grid/Grid.types.d.ts +10 -0
  398. package/dist/types/components/Grid/components/Col/Col.d.ts +10 -0
  399. package/dist/types/components/Grid/components/Col/index.d.ts +1 -0
  400. package/dist/types/components/Grid/components/Row/Row.d.ts +10 -0
  401. package/dist/types/components/Grid/components/Row/index.d.ts +1 -0
  402. package/dist/types/components/Grid/index.d.ts +2 -0
  403. package/dist/types/components/HeroButton/HeroButton.d.ts +66 -0
  404. package/dist/types/components/HeroButton/index.d.ts +1 -0
  405. package/dist/types/components/Hidden/Hidden.d.ts +11 -0
  406. package/dist/types/components/Hidden/index.d.ts +1 -0
  407. package/dist/types/components/Icon/Icon.d.ts +4 -0
  408. package/dist/types/components/Image/Image.d.ts +4 -0
  409. package/dist/types/components/ImpactCard/ImpactCard.d.ts +58 -0
  410. package/dist/types/components/ImpactCard/index.d.ts +1 -0
  411. package/dist/types/components/InformationCard/InformationCard.d.ts +62 -0
  412. package/dist/types/components/InformationCard/index.d.ts +1 -0
  413. package/dist/types/components/Link/Link.d.ts +52 -0
  414. package/dist/types/components/Link/index.d.ts +1 -0
  415. package/dist/types/components/MediaCard/MediaCard.d.ts +27 -28
  416. package/dist/types/components/MediaCard/types/index.d.ts +2 -0
  417. package/dist/types/components/MediaCard/types/media-card-image.d.ts +4 -0
  418. package/dist/types/components/MediaCard/types/media-card-video.d.ts +4 -0
  419. package/dist/types/components/Modal/Modal.d.ts +3 -3
  420. package/dist/types/components/Pagination/Pagination.d.ts +1 -1
  421. package/dist/types/components/PaginationSimple/PaginationSimple.d.ts +12 -4
  422. package/dist/types/components/Poster/Poster.d.ts +1 -1
  423. package/dist/types/components/ProgressBar/ProgressBar.d.ts +4 -0
  424. package/dist/types/components/ProgressStepper/ProgressStepper.d.ts +2 -2
  425. package/dist/types/components/ProgressStepper/ProgressStepperItem/ProgressStepperItem.d.ts +3 -7
  426. package/dist/types/components/ProgressStepper/ProgressStepperItem/icons/Complete.d.ts +2 -0
  427. package/dist/types/components/ProgressStepper/ProgressStepperItem/icons/Current.d.ts +2 -0
  428. package/dist/types/components/ProgressStepper/ProgressStepperItem/icons/Error.d.ts +2 -0
  429. package/dist/types/components/ProgressStepper/ProgressStepperItem/icons/Todo.d.ts +2 -0
  430. package/dist/types/components/ProgressStepper/ProgressStepperItem/icons/Warning.d.ts +2 -0
  431. package/dist/types/components/RadioGroup/RadioButton/RadioButton.d.ts +17 -23
  432. package/dist/types/components/RadioGroup/RadioButtonGroupInput/RadioButtonGroupInput.d.ts +36 -0
  433. package/dist/types/components/RadioGroup/RadioButtonGroupInput/index.d.ts +1 -0
  434. package/dist/types/components/RadioGroup/RadioGroup.d.ts +11 -3
  435. package/dist/types/components/RadioGroup/context.d.ts +1 -1
  436. package/dist/types/components/RadioGroup/index.d.ts +1 -0
  437. package/dist/types/components/Rule/Rule.d.ts +2 -1
  438. package/dist/types/components/Select/Select.d.ts +53 -0
  439. package/dist/types/components/SiteFooter/index.d.ts +0 -1
  440. package/dist/types/components/SiteHeaderV2/SiteHeaderV2.d.ts +82 -0
  441. package/dist/types/components/{SiteHeader → SiteHeaderV2}/components/BackButton/BackButton.d.ts +1 -0
  442. package/dist/types/components/{SiteHeader → SiteHeaderV2}/components/Column/Column.d.ts +1 -1
  443. package/dist/types/components/SiteHeaderV2/components/HorizontalPanel/HorizontalPanel.d.ts +13 -0
  444. package/dist/types/components/SiteHeaderV2/components/HorizontalPanel/index.d.ts +1 -0
  445. package/dist/types/components/{SiteHeader → SiteHeaderV2}/components/ItemGroup/ItemGroup.d.ts +1 -0
  446. package/dist/types/components/SiteHeaderV2/components/ItemGroup/index.d.ts +1 -0
  447. package/dist/types/components/{SiteHeader → SiteHeaderV2}/components/NavItem/NavItem.d.ts +5 -6
  448. package/dist/types/components/{SiteHeader → SiteHeaderV2}/components/NavItem/NavItemWithSubNav.d.ts +13 -4
  449. package/dist/types/components/SiteHeaderV2/components/NavItem/index.d.ts +2 -0
  450. package/dist/types/components/{SiteHeader → SiteHeaderV2}/components/NodeItem/NodeItem.d.ts +1 -1
  451. package/dist/types/components/{SiteHeader → SiteHeaderV2}/components/Panel/Panel.d.ts +8 -2
  452. package/dist/types/components/{SiteHeader → SiteHeaderV2}/components/SubNavItem/SubNavItem.d.ts +5 -7
  453. package/dist/types/components/SiteHeaderV2/components/SubNavItem/index.d.ts +1 -0
  454. package/dist/types/components/SiteHeaderV2/components/VerticalDivider/VerticalDivider.d.ts +2 -0
  455. package/dist/types/components/SiteHeaderV2/components/VerticalDivider/index.d.ts +1 -0
  456. package/dist/types/components/SiteHeaderV2/index.d.ts +1 -0
  457. package/dist/types/components/SkipLink/SkipLink.d.ts +12 -0
  458. package/dist/types/components/SkipLink/SkipLinkItem/SkipLinkItem.d.ts +16 -0
  459. package/dist/types/components/SkipLink/index.d.ts +1 -0
  460. package/dist/types/components/Surface/Surface.d.ts +3 -3
  461. package/dist/types/components/Switch/Switch.d.ts +2 -2
  462. package/dist/types/components/Tabs/Tabs.d.ts +1 -0
  463. package/dist/types/components/Tag/Tag.d.ts +5 -1
  464. package/dist/types/components/TextArea/TextArea.d.ts +17 -0
  465. package/dist/types/components/TextInput/TextInput.d.ts +46 -6
  466. package/dist/types/components/Theme/Theme.d.ts +11 -3
  467. package/dist/types/components/Theme/index.d.ts +1 -1
  468. package/dist/types/components/ThemeIcon/icon-names.d.ts +1 -1
  469. package/dist/types/components/Toast/Toast.d.ts +1 -1
  470. package/dist/types/components/TypographyCard/TypographyCard.d.ts +58 -0
  471. package/dist/types/components/TypographyCard/index.d.ts +1 -0
  472. package/dist/types/components/UniversalHeader/UniversalHeader.d.ts +4 -0
  473. package/dist/types/components/VideoPlayer/VideoPlayer.d.ts +18 -0
  474. package/dist/types/components/VideoPlayer/index.d.ts +1 -0
  475. package/dist/types/components/Visible/Visible.d.ts +11 -0
  476. package/dist/types/components/Visible/index.d.ts +1 -0
  477. package/dist/types/components/VisuallyHidden/VisuallyHidden.d.ts +1 -1
  478. package/dist/types/components/index.d.ts +17 -5
  479. package/dist/types/helpers/get-theme-img.d.ts +6 -0
  480. package/dist/types/helpers/index.d.ts +1 -0
  481. package/dist/types/hooks/index.d.ts +2 -4
  482. package/dist/types/hooks/private/index.d.ts +5 -0
  483. package/dist/types/hooks/private/use-aria-describedby/index.d.ts +1 -0
  484. package/dist/types/hooks/private/use-interaction-mode/index.d.ts +1 -0
  485. package/dist/types/hooks/private/use-numeric-input/index.d.ts +1 -0
  486. package/dist/types/hooks/{use-numeric-input.d.ts → private/use-numeric-input/use-numeric-input.d.ts} +3 -3
  487. package/dist/types/hooks/private/use-pagination/index.d.ts +1 -0
  488. package/dist/types/hooks/private/use-theme-element/index.d.ts +1 -0
  489. package/dist/types/hooks/public/index.d.ts +1 -0
  490. package/dist/types/hooks/public/use-media-query/index.d.ts +1 -0
  491. package/dist/types/hooks/{use-media-query.d.ts → public/use-media-query/use-media-query.d.ts} +1 -1
  492. package/dist/types/index.d.ts +1 -0
  493. package/dist/types/private-components/CardFooter/CardFooter.d.ts +11 -0
  494. package/dist/types/private-components/CardFooter/index.d.ts +1 -0
  495. package/dist/types/private-components/CardHeading/CardHeading.d.ts +19 -0
  496. package/dist/types/private-components/CardHeading/index.d.ts +1 -0
  497. package/dist/types/private-components/ConditionalWrapper/ConditionalWrapper.d.ts +7 -0
  498. package/dist/types/private-components/ConditionalWrapper/index.d.ts +1 -0
  499. package/dist/types/private-components/index.d.ts +3 -0
  500. package/dist/types/styles.d.ts +22 -5
  501. package/dist/types/types/auto-complete-types.d.ts +1 -0
  502. package/dist/use-media-query/package.json +7 -0
  503. package/dist/use-media-query/use-media-query.cjs.js +10 -0
  504. package/dist/use-media-query/use-media-query.esm.js +2 -0
  505. package/package.json +53 -37
  506. package/dist/Base/Base.cjs.js +0 -11
  507. package/dist/Base/Base.esm.js +0 -3
  508. package/dist/Base/package.json +0 -7
  509. package/dist/Card/Card.cjs.js +0 -18
  510. package/dist/Card/Card.esm.js +0 -10
  511. package/dist/Card/package.json +0 -7
  512. package/dist/Clock/Clock.cjs.js +0 -43
  513. package/dist/Clock/Clock.esm.js +0 -34
  514. package/dist/Clock/package.json +0 -7
  515. package/dist/SiteHeader/SiteHeader.cjs.js +0 -22
  516. package/dist/SiteHeader/SiteHeader.esm.js +0 -13
  517. package/dist/SiteHeader/package.json +0 -7
  518. package/dist/_shared/cjs/Base-f5a86eed.js +0 -22
  519. package/dist/_shared/cjs/Card-eb1c20c1.js +0 -121
  520. package/dist/_shared/cjs/Image-e873b8fc.js +0 -46
  521. package/dist/_shared/cjs/ProgressStepper-74ee1eec.js +0 -88
  522. package/dist/_shared/cjs/RadioGroup-9bc96f6a.js +0 -69
  523. package/dist/_shared/cjs/SiteHeader.rehydrator-42c4a0e0.js +0 -670
  524. package/dist/_shared/cjs/TextInput-a5f72f6f.js +0 -81
  525. package/dist/_shared/cjs/UniversalHeader-5e43d320.js +0 -34
  526. package/dist/_shared/cjs/extends-8c5e4b48.js +0 -18
  527. package/dist/_shared/cjs/index-4aa11039.js +0 -490
  528. package/dist/_shared/cjs/index-4dd46cbe.js +0 -289
  529. package/dist/_shared/esm/Base-f200653c.js +0 -15
  530. package/dist/_shared/esm/Card-45e8e10a.js +0 -115
  531. package/dist/_shared/esm/ProgressStepper-5de34269.js +0 -82
  532. package/dist/_shared/esm/RadioGroup-002a32ba.js +0 -63
  533. package/dist/_shared/esm/SiteHeader.rehydrator-97900e11.js +0 -663
  534. package/dist/_shared/esm/TextInput-28f18769.js +0 -75
  535. package/dist/_shared/esm/extends-8cc61aad.js +0 -16
  536. package/dist/_shared/esm/index-4f8d3888.js +0 -280
  537. package/dist/_shared/esm/index-87a828b8.js +0 -479
  538. package/dist/types/components/Base/Base.d.ts +0 -16
  539. package/dist/types/components/Base/index.d.ts +0 -1
  540. package/dist/types/components/Card/Card.d.ts +0 -128
  541. package/dist/types/components/Card/index.d.ts +0 -1
  542. package/dist/types/components/Clock/Clock.d.ts +0 -12
  543. package/dist/types/components/Clock/Clock.rehydrator.d.ts +0 -2
  544. package/dist/types/components/Clock/index.d.ts +0 -2
  545. package/dist/types/components/MediaCard/MediaCard.stories-wip.d.ts +0 -15
  546. package/dist/types/components/SiteFooter/SiteFooter.rehydrator.d.ts +0 -2
  547. package/dist/types/components/SiteHeader/SiteHeader.d.ts +0 -75
  548. package/dist/types/components/SiteHeader/SiteHeader.rehydrator.d.ts +0 -8
  549. package/dist/types/components/SiteHeader/components/ItemGroup/ItemGroup.rehydrator.d.ts +0 -2
  550. package/dist/types/components/SiteHeader/components/ItemGroup/index.d.ts +0 -2
  551. package/dist/types/components/SiteHeader/components/NavItem/NavItem.rehydrator.d.ts +0 -2
  552. package/dist/types/components/SiteHeader/components/NavItem/NavItemWithSubNav.rehydrator.d.ts +0 -2
  553. package/dist/types/components/SiteHeader/components/NavItem/index.d.ts +0 -4
  554. package/dist/types/components/SiteHeader/components/SubNavItem/SubNavItem.rehydrator.d.ts +0 -2
  555. package/dist/types/components/SiteHeader/components/SubNavItem/index.d.ts +0 -2
  556. package/dist/types/components/SiteHeader/index.d.ts +0 -2
  557. /package/dist/types/components/{SiteHeader → SiteHeaderV2}/components/BackButton/index.d.ts +0 -0
  558. /package/dist/types/components/{SiteHeader → SiteHeaderV2}/components/Column/index.d.ts +0 -0
  559. /package/dist/types/components/{SiteHeader → SiteHeaderV2}/components/Item/Item.d.ts +0 -0
  560. /package/dist/types/components/{SiteHeader → SiteHeaderV2}/components/Item/index.d.ts +0 -0
  561. /package/dist/types/components/{SiteHeader → SiteHeaderV2}/components/MenuButton/MenuButton.d.ts +0 -0
  562. /package/dist/types/components/{SiteHeader → SiteHeaderV2}/components/MenuButton/index.d.ts +0 -0
  563. /package/dist/types/components/{SiteHeader → SiteHeaderV2}/components/Panel/index.d.ts +0 -0
  564. /package/dist/types/hooks/{use-aria-describedby.d.ts → private/use-aria-describedby/use-aria-describedby.d.ts} +0 -0
  565. /package/dist/types/hooks/{use-interaction-mode.d.ts → private/use-interaction-mode/use-interaction-mode.d.ts} +0 -0
  566. /package/dist/types/hooks/{use-pagination.d.ts → private/use-pagination/use-pagination.d.ts} +0 -0
@@ -0,0 +1,2197 @@
1
+ function _typeof(o) {
2
+ "@babel/helpers - typeof";
3
+
4
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
5
+ return typeof o;
6
+ } : function (o) {
7
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
8
+ }, _typeof(o);
9
+ }
10
+
11
+ function toInteger(dirtyNumber) {
12
+ if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
13
+ return NaN;
14
+ }
15
+ var number = Number(dirtyNumber);
16
+ if (isNaN(number)) {
17
+ return number;
18
+ }
19
+ return number < 0 ? Math.ceil(number) : Math.floor(number);
20
+ }
21
+
22
+ function requiredArgs(required, args) {
23
+ if (args.length < required) {
24
+ throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
25
+ }
26
+ }
27
+
28
+ /**
29
+ * @name toDate
30
+ * @category Common Helpers
31
+ * @summary Convert the given argument to an instance of Date.
32
+ *
33
+ * @description
34
+ * Convert the given argument to an instance of Date.
35
+ *
36
+ * If the argument is an instance of Date, the function returns its clone.
37
+ *
38
+ * If the argument is a number, it is treated as a timestamp.
39
+ *
40
+ * If the argument is none of the above, the function returns Invalid Date.
41
+ *
42
+ * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
43
+ *
44
+ * @param {Date|Number} argument - the value to convert
45
+ * @returns {Date} the parsed date in the local time zone
46
+ * @throws {TypeError} 1 argument required
47
+ *
48
+ * @example
49
+ * // Clone the date:
50
+ * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
51
+ * //=> Tue Feb 11 2014 11:30:30
52
+ *
53
+ * @example
54
+ * // Convert the timestamp to date:
55
+ * const result = toDate(1392098430000)
56
+ * //=> Tue Feb 11 2014 11:30:30
57
+ */
58
+ function toDate(argument) {
59
+ requiredArgs(1, arguments);
60
+ var argStr = Object.prototype.toString.call(argument);
61
+
62
+ // Clone the date
63
+ if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {
64
+ // Prevent the date to lose the milliseconds when passed to new Date() in IE10
65
+ return new Date(argument.getTime());
66
+ } else if (typeof argument === 'number' || argStr === '[object Number]') {
67
+ return new Date(argument);
68
+ } else {
69
+ if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
70
+ // eslint-disable-next-line no-console
71
+ console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
72
+ // eslint-disable-next-line no-console
73
+ console.warn(new Error().stack);
74
+ }
75
+ return new Date(NaN);
76
+ }
77
+ }
78
+
79
+ /**
80
+ * @name addMilliseconds
81
+ * @category Millisecond Helpers
82
+ * @summary Add the specified number of milliseconds to the given date.
83
+ *
84
+ * @description
85
+ * Add the specified number of milliseconds to the given date.
86
+ *
87
+ * @param {Date|Number} date - the date to be changed
88
+ * @param {Number} amount - the amount of milliseconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
89
+ * @returns {Date} the new date with the milliseconds added
90
+ * @throws {TypeError} 2 arguments required
91
+ *
92
+ * @example
93
+ * // Add 750 milliseconds to 10 July 2014 12:45:30.000:
94
+ * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
95
+ * //=> Thu Jul 10 2014 12:45:30.750
96
+ */
97
+ function addMilliseconds(dirtyDate, dirtyAmount) {
98
+ requiredArgs(2, arguments);
99
+ var timestamp = toDate(dirtyDate).getTime();
100
+ var amount = toInteger(dirtyAmount);
101
+ return new Date(timestamp + amount);
102
+ }
103
+
104
+ var defaultOptions = {};
105
+ function getDefaultOptions() {
106
+ return defaultOptions;
107
+ }
108
+
109
+ /**
110
+ * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
111
+ * They usually appear for dates that denote time before the timezones were introduced
112
+ * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
113
+ * and GMT+01:00:00 after that date)
114
+ *
115
+ * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
116
+ * which would lead to incorrect calculations.
117
+ *
118
+ * This function returns the timezone offset in milliseconds that takes seconds in account.
119
+ */
120
+ function getTimezoneOffsetInMilliseconds(date) {
121
+ var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
122
+ utcDate.setUTCFullYear(date.getFullYear());
123
+ return date.getTime() - utcDate.getTime();
124
+ }
125
+
126
+ /**
127
+ * @name isDate
128
+ * @category Common Helpers
129
+ * @summary Is the given value a date?
130
+ *
131
+ * @description
132
+ * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
133
+ *
134
+ * @param {*} value - the value to check
135
+ * @returns {boolean} true if the given value is a date
136
+ * @throws {TypeError} 1 arguments required
137
+ *
138
+ * @example
139
+ * // For a valid date:
140
+ * const result = isDate(new Date())
141
+ * //=> true
142
+ *
143
+ * @example
144
+ * // For an invalid date:
145
+ * const result = isDate(new Date(NaN))
146
+ * //=> true
147
+ *
148
+ * @example
149
+ * // For some value:
150
+ * const result = isDate('2014-02-31')
151
+ * //=> false
152
+ *
153
+ * @example
154
+ * // For an object:
155
+ * const result = isDate({})
156
+ * //=> false
157
+ */
158
+ function isDate(value) {
159
+ requiredArgs(1, arguments);
160
+ return value instanceof Date || _typeof(value) === 'object' && Object.prototype.toString.call(value) === '[object Date]';
161
+ }
162
+
163
+ /**
164
+ * @name isValid
165
+ * @category Common Helpers
166
+ * @summary Is the given date valid?
167
+ *
168
+ * @description
169
+ * Returns false if argument is Invalid Date and true otherwise.
170
+ * Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}
171
+ * Invalid Date is a Date, whose time value is NaN.
172
+ *
173
+ * Time value of Date: http://es5.github.io/#x15.9.1.1
174
+ *
175
+ * @param {*} date - the date to check
176
+ * @returns {Boolean} the date is valid
177
+ * @throws {TypeError} 1 argument required
178
+ *
179
+ * @example
180
+ * // For the valid date:
181
+ * const result = isValid(new Date(2014, 1, 31))
182
+ * //=> true
183
+ *
184
+ * @example
185
+ * // For the value, convertable into a date:
186
+ * const result = isValid(1393804800000)
187
+ * //=> true
188
+ *
189
+ * @example
190
+ * // For the invalid date:
191
+ * const result = isValid(new Date(''))
192
+ * //=> false
193
+ */
194
+ function isValid(dirtyDate) {
195
+ requiredArgs(1, arguments);
196
+ if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {
197
+ return false;
198
+ }
199
+ var date = toDate(dirtyDate);
200
+ return !isNaN(Number(date));
201
+ }
202
+
203
+ /**
204
+ * @name subMilliseconds
205
+ * @category Millisecond Helpers
206
+ * @summary Subtract the specified number of milliseconds from the given date.
207
+ *
208
+ * @description
209
+ * Subtract the specified number of milliseconds from the given date.
210
+ *
211
+ * @param {Date|Number} date - the date to be changed
212
+ * @param {Number} amount - the amount of milliseconds to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
213
+ * @returns {Date} the new date with the milliseconds subtracted
214
+ * @throws {TypeError} 2 arguments required
215
+ *
216
+ * @example
217
+ * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:
218
+ * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
219
+ * //=> Thu Jul 10 2014 12:45:29.250
220
+ */
221
+ function subMilliseconds(dirtyDate, dirtyAmount) {
222
+ requiredArgs(2, arguments);
223
+ var amount = toInteger(dirtyAmount);
224
+ return addMilliseconds(dirtyDate, -amount);
225
+ }
226
+
227
+ var MILLISECONDS_IN_DAY = 86400000;
228
+ function getUTCDayOfYear(dirtyDate) {
229
+ requiredArgs(1, arguments);
230
+ var date = toDate(dirtyDate);
231
+ var timestamp = date.getTime();
232
+ date.setUTCMonth(0, 1);
233
+ date.setUTCHours(0, 0, 0, 0);
234
+ var startOfYearTimestamp = date.getTime();
235
+ var difference = timestamp - startOfYearTimestamp;
236
+ return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
237
+ }
238
+
239
+ function startOfUTCISOWeek(dirtyDate) {
240
+ requiredArgs(1, arguments);
241
+ var weekStartsOn = 1;
242
+ var date = toDate(dirtyDate);
243
+ var day = date.getUTCDay();
244
+ var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
245
+ date.setUTCDate(date.getUTCDate() - diff);
246
+ date.setUTCHours(0, 0, 0, 0);
247
+ return date;
248
+ }
249
+
250
+ function getUTCISOWeekYear(dirtyDate) {
251
+ requiredArgs(1, arguments);
252
+ var date = toDate(dirtyDate);
253
+ var year = date.getUTCFullYear();
254
+ var fourthOfJanuaryOfNextYear = new Date(0);
255
+ fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
256
+ fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
257
+ var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);
258
+ var fourthOfJanuaryOfThisYear = new Date(0);
259
+ fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
260
+ fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
261
+ var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
262
+ if (date.getTime() >= startOfNextYear.getTime()) {
263
+ return year + 1;
264
+ } else if (date.getTime() >= startOfThisYear.getTime()) {
265
+ return year;
266
+ } else {
267
+ return year - 1;
268
+ }
269
+ }
270
+
271
+ function startOfUTCISOWeekYear(dirtyDate) {
272
+ requiredArgs(1, arguments);
273
+ var year = getUTCISOWeekYear(dirtyDate);
274
+ var fourthOfJanuary = new Date(0);
275
+ fourthOfJanuary.setUTCFullYear(year, 0, 4);
276
+ fourthOfJanuary.setUTCHours(0, 0, 0, 0);
277
+ var date = startOfUTCISOWeek(fourthOfJanuary);
278
+ return date;
279
+ }
280
+
281
+ var MILLISECONDS_IN_WEEK$1 = 604800000;
282
+ function getUTCISOWeek(dirtyDate) {
283
+ requiredArgs(1, arguments);
284
+ var date = toDate(dirtyDate);
285
+ var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime();
286
+
287
+ // Round the number of days to the nearest integer
288
+ // because the number of milliseconds in a week is not constant
289
+ // (e.g. it's different in the week of the daylight saving time clock shift)
290
+ return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
291
+ }
292
+
293
+ function startOfUTCWeek(dirtyDate, options) {
294
+ var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
295
+ requiredArgs(1, arguments);
296
+ var defaultOptions = getDefaultOptions();
297
+ var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0);
298
+
299
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
300
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
301
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
302
+ }
303
+ var date = toDate(dirtyDate);
304
+ var day = date.getUTCDay();
305
+ var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
306
+ date.setUTCDate(date.getUTCDate() - diff);
307
+ date.setUTCHours(0, 0, 0, 0);
308
+ return date;
309
+ }
310
+
311
+ function getUTCWeekYear(dirtyDate, options) {
312
+ var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
313
+ requiredArgs(1, arguments);
314
+ var date = toDate(dirtyDate);
315
+ var year = date.getUTCFullYear();
316
+ var defaultOptions = getDefaultOptions();
317
+ var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
318
+
319
+ // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
320
+ if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
321
+ throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
322
+ }
323
+ var firstWeekOfNextYear = new Date(0);
324
+ firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
325
+ firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
326
+ var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, options);
327
+ var firstWeekOfThisYear = new Date(0);
328
+ firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
329
+ firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
330
+ var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, options);
331
+ if (date.getTime() >= startOfNextYear.getTime()) {
332
+ return year + 1;
333
+ } else if (date.getTime() >= startOfThisYear.getTime()) {
334
+ return year;
335
+ } else {
336
+ return year - 1;
337
+ }
338
+ }
339
+
340
+ function startOfUTCWeekYear(dirtyDate, options) {
341
+ var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
342
+ requiredArgs(1, arguments);
343
+ var defaultOptions = getDefaultOptions();
344
+ var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
345
+ var year = getUTCWeekYear(dirtyDate, options);
346
+ var firstWeek = new Date(0);
347
+ firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
348
+ firstWeek.setUTCHours(0, 0, 0, 0);
349
+ var date = startOfUTCWeek(firstWeek, options);
350
+ return date;
351
+ }
352
+
353
+ var MILLISECONDS_IN_WEEK = 604800000;
354
+ function getUTCWeek(dirtyDate, options) {
355
+ requiredArgs(1, arguments);
356
+ var date = toDate(dirtyDate);
357
+ var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime();
358
+
359
+ // Round the number of days to the nearest integer
360
+ // because the number of milliseconds in a week is not constant
361
+ // (e.g. it's different in the week of the daylight saving time clock shift)
362
+ return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
363
+ }
364
+
365
+ function addLeadingZeros(number, targetLength) {
366
+ var sign = number < 0 ? '-' : '';
367
+ var output = Math.abs(number).toString();
368
+ while (output.length < targetLength) {
369
+ output = '0' + output;
370
+ }
371
+ return sign + output;
372
+ }
373
+
374
+ /*
375
+ * | | Unit | | Unit |
376
+ * |-----|--------------------------------|-----|--------------------------------|
377
+ * | a | AM, PM | A* | |
378
+ * | d | Day of month | D | |
379
+ * | h | Hour [1-12] | H | Hour [0-23] |
380
+ * | m | Minute | M | Month |
381
+ * | s | Second | S | Fraction of second |
382
+ * | y | Year (abs) | Y | |
383
+ *
384
+ * Letters marked by * are not implemented but reserved by Unicode standard.
385
+ */
386
+ var formatters$2 = {
387
+ // Year
388
+ y: function y(date, token) {
389
+ // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
390
+ // | Year | y | yy | yyy | yyyy | yyyyy |
391
+ // |----------|-------|----|-------|-------|-------|
392
+ // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
393
+ // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
394
+ // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
395
+ // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
396
+ // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
397
+
398
+ var signedYear = date.getUTCFullYear();
399
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
400
+ var year = signedYear > 0 ? signedYear : 1 - signedYear;
401
+ return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
402
+ },
403
+ // Month
404
+ M: function M(date, token) {
405
+ var month = date.getUTCMonth();
406
+ return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);
407
+ },
408
+ // Day of the month
409
+ d: function d(date, token) {
410
+ return addLeadingZeros(date.getUTCDate(), token.length);
411
+ },
412
+ // AM or PM
413
+ a: function a(date, token) {
414
+ var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
415
+ switch (token) {
416
+ case 'a':
417
+ case 'aa':
418
+ return dayPeriodEnumValue.toUpperCase();
419
+ case 'aaa':
420
+ return dayPeriodEnumValue;
421
+ case 'aaaaa':
422
+ return dayPeriodEnumValue[0];
423
+ case 'aaaa':
424
+ default:
425
+ return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
426
+ }
427
+ },
428
+ // Hour [1-12]
429
+ h: function h(date, token) {
430
+ return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
431
+ },
432
+ // Hour [0-23]
433
+ H: function H(date, token) {
434
+ return addLeadingZeros(date.getUTCHours(), token.length);
435
+ },
436
+ // Minute
437
+ m: function m(date, token) {
438
+ return addLeadingZeros(date.getUTCMinutes(), token.length);
439
+ },
440
+ // Second
441
+ s: function s(date, token) {
442
+ return addLeadingZeros(date.getUTCSeconds(), token.length);
443
+ },
444
+ // Fraction of second
445
+ S: function S(date, token) {
446
+ var numberOfDigits = token.length;
447
+ var milliseconds = date.getUTCMilliseconds();
448
+ var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
449
+ return addLeadingZeros(fractionalSeconds, token.length);
450
+ }
451
+ };
452
+ var formatters$3 = formatters$2;
453
+
454
+ var dayPeriodEnum = {
455
+ am: 'am',
456
+ pm: 'pm',
457
+ midnight: 'midnight',
458
+ noon: 'noon',
459
+ morning: 'morning',
460
+ afternoon: 'afternoon',
461
+ evening: 'evening',
462
+ night: 'night'
463
+ };
464
+ /*
465
+ * | | Unit | | Unit |
466
+ * |-----|--------------------------------|-----|--------------------------------|
467
+ * | a | AM, PM | A* | Milliseconds in day |
468
+ * | b | AM, PM, noon, midnight | B | Flexible day period |
469
+ * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
470
+ * | d | Day of month | D | Day of year |
471
+ * | e | Local day of week | E | Day of week |
472
+ * | f | | F* | Day of week in month |
473
+ * | g* | Modified Julian day | G | Era |
474
+ * | h | Hour [1-12] | H | Hour [0-23] |
475
+ * | i! | ISO day of week | I! | ISO week of year |
476
+ * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
477
+ * | k | Hour [1-24] | K | Hour [0-11] |
478
+ * | l* | (deprecated) | L | Stand-alone month |
479
+ * | m | Minute | M | Month |
480
+ * | n | | N | |
481
+ * | o! | Ordinal number modifier | O | Timezone (GMT) |
482
+ * | p! | Long localized time | P! | Long localized date |
483
+ * | q | Stand-alone quarter | Q | Quarter |
484
+ * | r* | Related Gregorian year | R! | ISO week-numbering year |
485
+ * | s | Second | S | Fraction of second |
486
+ * | t! | Seconds timestamp | T! | Milliseconds timestamp |
487
+ * | u | Extended year | U* | Cyclic year |
488
+ * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
489
+ * | w | Local week of year | W* | Week of month |
490
+ * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
491
+ * | y | Year (abs) | Y | Local week-numbering year |
492
+ * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
493
+ *
494
+ * Letters marked by * are not implemented but reserved by Unicode standard.
495
+ *
496
+ * Letters marked by ! are non-standard, but implemented by date-fns:
497
+ * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
498
+ * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
499
+ * i.e. 7 for Sunday, 1 for Monday, etc.
500
+ * - `I` is ISO week of year, as opposed to `w` which is local week of year.
501
+ * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
502
+ * `R` is supposed to be used in conjunction with `I` and `i`
503
+ * for universal ISO week-numbering date, whereas
504
+ * `Y` is supposed to be used in conjunction with `w` and `e`
505
+ * for week-numbering date specific to the locale.
506
+ * - `P` is long localized date format
507
+ * - `p` is long localized time format
508
+ */
509
+
510
+ var formatters = {
511
+ // Era
512
+ G: function G(date, token, localize) {
513
+ var era = date.getUTCFullYear() > 0 ? 1 : 0;
514
+ switch (token) {
515
+ // AD, BC
516
+ case 'G':
517
+ case 'GG':
518
+ case 'GGG':
519
+ return localize.era(era, {
520
+ width: 'abbreviated'
521
+ });
522
+ // A, B
523
+ case 'GGGGG':
524
+ return localize.era(era, {
525
+ width: 'narrow'
526
+ });
527
+ // Anno Domini, Before Christ
528
+ case 'GGGG':
529
+ default:
530
+ return localize.era(era, {
531
+ width: 'wide'
532
+ });
533
+ }
534
+ },
535
+ // Year
536
+ y: function y(date, token, localize) {
537
+ // Ordinal number
538
+ if (token === 'yo') {
539
+ var signedYear = date.getUTCFullYear();
540
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
541
+ var year = signedYear > 0 ? signedYear : 1 - signedYear;
542
+ return localize.ordinalNumber(year, {
543
+ unit: 'year'
544
+ });
545
+ }
546
+ return formatters$3.y(date, token);
547
+ },
548
+ // Local week-numbering year
549
+ Y: function Y(date, token, localize, options) {
550
+ var signedWeekYear = getUTCWeekYear(date, options);
551
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
552
+ var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
553
+
554
+ // Two digit year
555
+ if (token === 'YY') {
556
+ var twoDigitYear = weekYear % 100;
557
+ return addLeadingZeros(twoDigitYear, 2);
558
+ }
559
+
560
+ // Ordinal number
561
+ if (token === 'Yo') {
562
+ return localize.ordinalNumber(weekYear, {
563
+ unit: 'year'
564
+ });
565
+ }
566
+
567
+ // Padding
568
+ return addLeadingZeros(weekYear, token.length);
569
+ },
570
+ // ISO week-numbering year
571
+ R: function R(date, token) {
572
+ var isoWeekYear = getUTCISOWeekYear(date);
573
+
574
+ // Padding
575
+ return addLeadingZeros(isoWeekYear, token.length);
576
+ },
577
+ // Extended year. This is a single number designating the year of this calendar system.
578
+ // The main difference between `y` and `u` localizers are B.C. years:
579
+ // | Year | `y` | `u` |
580
+ // |------|-----|-----|
581
+ // | AC 1 | 1 | 1 |
582
+ // | BC 1 | 1 | 0 |
583
+ // | BC 2 | 2 | -1 |
584
+ // Also `yy` always returns the last two digits of a year,
585
+ // while `uu` pads single digit years to 2 characters and returns other years unchanged.
586
+ u: function u(date, token) {
587
+ var year = date.getUTCFullYear();
588
+ return addLeadingZeros(year, token.length);
589
+ },
590
+ // Quarter
591
+ Q: function Q(date, token, localize) {
592
+ var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
593
+ switch (token) {
594
+ // 1, 2, 3, 4
595
+ case 'Q':
596
+ return String(quarter);
597
+ // 01, 02, 03, 04
598
+ case 'QQ':
599
+ return addLeadingZeros(quarter, 2);
600
+ // 1st, 2nd, 3rd, 4th
601
+ case 'Qo':
602
+ return localize.ordinalNumber(quarter, {
603
+ unit: 'quarter'
604
+ });
605
+ // Q1, Q2, Q3, Q4
606
+ case 'QQQ':
607
+ return localize.quarter(quarter, {
608
+ width: 'abbreviated',
609
+ context: 'formatting'
610
+ });
611
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
612
+ case 'QQQQQ':
613
+ return localize.quarter(quarter, {
614
+ width: 'narrow',
615
+ context: 'formatting'
616
+ });
617
+ // 1st quarter, 2nd quarter, ...
618
+ case 'QQQQ':
619
+ default:
620
+ return localize.quarter(quarter, {
621
+ width: 'wide',
622
+ context: 'formatting'
623
+ });
624
+ }
625
+ },
626
+ // Stand-alone quarter
627
+ q: function q(date, token, localize) {
628
+ var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
629
+ switch (token) {
630
+ // 1, 2, 3, 4
631
+ case 'q':
632
+ return String(quarter);
633
+ // 01, 02, 03, 04
634
+ case 'qq':
635
+ return addLeadingZeros(quarter, 2);
636
+ // 1st, 2nd, 3rd, 4th
637
+ case 'qo':
638
+ return localize.ordinalNumber(quarter, {
639
+ unit: 'quarter'
640
+ });
641
+ // Q1, Q2, Q3, Q4
642
+ case 'qqq':
643
+ return localize.quarter(quarter, {
644
+ width: 'abbreviated',
645
+ context: 'standalone'
646
+ });
647
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
648
+ case 'qqqqq':
649
+ return localize.quarter(quarter, {
650
+ width: 'narrow',
651
+ context: 'standalone'
652
+ });
653
+ // 1st quarter, 2nd quarter, ...
654
+ case 'qqqq':
655
+ default:
656
+ return localize.quarter(quarter, {
657
+ width: 'wide',
658
+ context: 'standalone'
659
+ });
660
+ }
661
+ },
662
+ // Month
663
+ M: function M(date, token, localize) {
664
+ var month = date.getUTCMonth();
665
+ switch (token) {
666
+ case 'M':
667
+ case 'MM':
668
+ return formatters$3.M(date, token);
669
+ // 1st, 2nd, ..., 12th
670
+ case 'Mo':
671
+ return localize.ordinalNumber(month + 1, {
672
+ unit: 'month'
673
+ });
674
+ // Jan, Feb, ..., Dec
675
+ case 'MMM':
676
+ return localize.month(month, {
677
+ width: 'abbreviated',
678
+ context: 'formatting'
679
+ });
680
+ // J, F, ..., D
681
+ case 'MMMMM':
682
+ return localize.month(month, {
683
+ width: 'narrow',
684
+ context: 'formatting'
685
+ });
686
+ // January, February, ..., December
687
+ case 'MMMM':
688
+ default:
689
+ return localize.month(month, {
690
+ width: 'wide',
691
+ context: 'formatting'
692
+ });
693
+ }
694
+ },
695
+ // Stand-alone month
696
+ L: function L(date, token, localize) {
697
+ var month = date.getUTCMonth();
698
+ switch (token) {
699
+ // 1, 2, ..., 12
700
+ case 'L':
701
+ return String(month + 1);
702
+ // 01, 02, ..., 12
703
+ case 'LL':
704
+ return addLeadingZeros(month + 1, 2);
705
+ // 1st, 2nd, ..., 12th
706
+ case 'Lo':
707
+ return localize.ordinalNumber(month + 1, {
708
+ unit: 'month'
709
+ });
710
+ // Jan, Feb, ..., Dec
711
+ case 'LLL':
712
+ return localize.month(month, {
713
+ width: 'abbreviated',
714
+ context: 'standalone'
715
+ });
716
+ // J, F, ..., D
717
+ case 'LLLLL':
718
+ return localize.month(month, {
719
+ width: 'narrow',
720
+ context: 'standalone'
721
+ });
722
+ // January, February, ..., December
723
+ case 'LLLL':
724
+ default:
725
+ return localize.month(month, {
726
+ width: 'wide',
727
+ context: 'standalone'
728
+ });
729
+ }
730
+ },
731
+ // Local week of year
732
+ w: function w(date, token, localize, options) {
733
+ var week = getUTCWeek(date, options);
734
+ if (token === 'wo') {
735
+ return localize.ordinalNumber(week, {
736
+ unit: 'week'
737
+ });
738
+ }
739
+ return addLeadingZeros(week, token.length);
740
+ },
741
+ // ISO week of year
742
+ I: function I(date, token, localize) {
743
+ var isoWeek = getUTCISOWeek(date);
744
+ if (token === 'Io') {
745
+ return localize.ordinalNumber(isoWeek, {
746
+ unit: 'week'
747
+ });
748
+ }
749
+ return addLeadingZeros(isoWeek, token.length);
750
+ },
751
+ // Day of the month
752
+ d: function d(date, token, localize) {
753
+ if (token === 'do') {
754
+ return localize.ordinalNumber(date.getUTCDate(), {
755
+ unit: 'date'
756
+ });
757
+ }
758
+ return formatters$3.d(date, token);
759
+ },
760
+ // Day of year
761
+ D: function D(date, token, localize) {
762
+ var dayOfYear = getUTCDayOfYear(date);
763
+ if (token === 'Do') {
764
+ return localize.ordinalNumber(dayOfYear, {
765
+ unit: 'dayOfYear'
766
+ });
767
+ }
768
+ return addLeadingZeros(dayOfYear, token.length);
769
+ },
770
+ // Day of week
771
+ E: function E(date, token, localize) {
772
+ var dayOfWeek = date.getUTCDay();
773
+ switch (token) {
774
+ // Tue
775
+ case 'E':
776
+ case 'EE':
777
+ case 'EEE':
778
+ return localize.day(dayOfWeek, {
779
+ width: 'abbreviated',
780
+ context: 'formatting'
781
+ });
782
+ // T
783
+ case 'EEEEE':
784
+ return localize.day(dayOfWeek, {
785
+ width: 'narrow',
786
+ context: 'formatting'
787
+ });
788
+ // Tu
789
+ case 'EEEEEE':
790
+ return localize.day(dayOfWeek, {
791
+ width: 'short',
792
+ context: 'formatting'
793
+ });
794
+ // Tuesday
795
+ case 'EEEE':
796
+ default:
797
+ return localize.day(dayOfWeek, {
798
+ width: 'wide',
799
+ context: 'formatting'
800
+ });
801
+ }
802
+ },
803
+ // Local day of week
804
+ e: function e(date, token, localize, options) {
805
+ var dayOfWeek = date.getUTCDay();
806
+ var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
807
+ switch (token) {
808
+ // Numerical value (Nth day of week with current locale or weekStartsOn)
809
+ case 'e':
810
+ return String(localDayOfWeek);
811
+ // Padded numerical value
812
+ case 'ee':
813
+ return addLeadingZeros(localDayOfWeek, 2);
814
+ // 1st, 2nd, ..., 7th
815
+ case 'eo':
816
+ return localize.ordinalNumber(localDayOfWeek, {
817
+ unit: 'day'
818
+ });
819
+ case 'eee':
820
+ return localize.day(dayOfWeek, {
821
+ width: 'abbreviated',
822
+ context: 'formatting'
823
+ });
824
+ // T
825
+ case 'eeeee':
826
+ return localize.day(dayOfWeek, {
827
+ width: 'narrow',
828
+ context: 'formatting'
829
+ });
830
+ // Tu
831
+ case 'eeeeee':
832
+ return localize.day(dayOfWeek, {
833
+ width: 'short',
834
+ context: 'formatting'
835
+ });
836
+ // Tuesday
837
+ case 'eeee':
838
+ default:
839
+ return localize.day(dayOfWeek, {
840
+ width: 'wide',
841
+ context: 'formatting'
842
+ });
843
+ }
844
+ },
845
+ // Stand-alone local day of week
846
+ c: function c(date, token, localize, options) {
847
+ var dayOfWeek = date.getUTCDay();
848
+ var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
849
+ switch (token) {
850
+ // Numerical value (same as in `e`)
851
+ case 'c':
852
+ return String(localDayOfWeek);
853
+ // Padded numerical value
854
+ case 'cc':
855
+ return addLeadingZeros(localDayOfWeek, token.length);
856
+ // 1st, 2nd, ..., 7th
857
+ case 'co':
858
+ return localize.ordinalNumber(localDayOfWeek, {
859
+ unit: 'day'
860
+ });
861
+ case 'ccc':
862
+ return localize.day(dayOfWeek, {
863
+ width: 'abbreviated',
864
+ context: 'standalone'
865
+ });
866
+ // T
867
+ case 'ccccc':
868
+ return localize.day(dayOfWeek, {
869
+ width: 'narrow',
870
+ context: 'standalone'
871
+ });
872
+ // Tu
873
+ case 'cccccc':
874
+ return localize.day(dayOfWeek, {
875
+ width: 'short',
876
+ context: 'standalone'
877
+ });
878
+ // Tuesday
879
+ case 'cccc':
880
+ default:
881
+ return localize.day(dayOfWeek, {
882
+ width: 'wide',
883
+ context: 'standalone'
884
+ });
885
+ }
886
+ },
887
+ // ISO day of week
888
+ i: function i(date, token, localize) {
889
+ var dayOfWeek = date.getUTCDay();
890
+ var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
891
+ switch (token) {
892
+ // 2
893
+ case 'i':
894
+ return String(isoDayOfWeek);
895
+ // 02
896
+ case 'ii':
897
+ return addLeadingZeros(isoDayOfWeek, token.length);
898
+ // 2nd
899
+ case 'io':
900
+ return localize.ordinalNumber(isoDayOfWeek, {
901
+ unit: 'day'
902
+ });
903
+ // Tue
904
+ case 'iii':
905
+ return localize.day(dayOfWeek, {
906
+ width: 'abbreviated',
907
+ context: 'formatting'
908
+ });
909
+ // T
910
+ case 'iiiii':
911
+ return localize.day(dayOfWeek, {
912
+ width: 'narrow',
913
+ context: 'formatting'
914
+ });
915
+ // Tu
916
+ case 'iiiiii':
917
+ return localize.day(dayOfWeek, {
918
+ width: 'short',
919
+ context: 'formatting'
920
+ });
921
+ // Tuesday
922
+ case 'iiii':
923
+ default:
924
+ return localize.day(dayOfWeek, {
925
+ width: 'wide',
926
+ context: 'formatting'
927
+ });
928
+ }
929
+ },
930
+ // AM or PM
931
+ a: function a(date, token, localize) {
932
+ var hours = date.getUTCHours();
933
+ var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
934
+ switch (token) {
935
+ case 'a':
936
+ case 'aa':
937
+ return localize.dayPeriod(dayPeriodEnumValue, {
938
+ width: 'abbreviated',
939
+ context: 'formatting'
940
+ });
941
+ case 'aaa':
942
+ return localize.dayPeriod(dayPeriodEnumValue, {
943
+ width: 'abbreviated',
944
+ context: 'formatting'
945
+ }).toLowerCase();
946
+ case 'aaaaa':
947
+ return localize.dayPeriod(dayPeriodEnumValue, {
948
+ width: 'narrow',
949
+ context: 'formatting'
950
+ });
951
+ case 'aaaa':
952
+ default:
953
+ return localize.dayPeriod(dayPeriodEnumValue, {
954
+ width: 'wide',
955
+ context: 'formatting'
956
+ });
957
+ }
958
+ },
959
+ // AM, PM, midnight, noon
960
+ b: function b(date, token, localize) {
961
+ var hours = date.getUTCHours();
962
+ var dayPeriodEnumValue;
963
+ if (hours === 12) {
964
+ dayPeriodEnumValue = dayPeriodEnum.noon;
965
+ } else if (hours === 0) {
966
+ dayPeriodEnumValue = dayPeriodEnum.midnight;
967
+ } else {
968
+ dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
969
+ }
970
+ switch (token) {
971
+ case 'b':
972
+ case 'bb':
973
+ return localize.dayPeriod(dayPeriodEnumValue, {
974
+ width: 'abbreviated',
975
+ context: 'formatting'
976
+ });
977
+ case 'bbb':
978
+ return localize.dayPeriod(dayPeriodEnumValue, {
979
+ width: 'abbreviated',
980
+ context: 'formatting'
981
+ }).toLowerCase();
982
+ case 'bbbbb':
983
+ return localize.dayPeriod(dayPeriodEnumValue, {
984
+ width: 'narrow',
985
+ context: 'formatting'
986
+ });
987
+ case 'bbbb':
988
+ default:
989
+ return localize.dayPeriod(dayPeriodEnumValue, {
990
+ width: 'wide',
991
+ context: 'formatting'
992
+ });
993
+ }
994
+ },
995
+ // in the morning, in the afternoon, in the evening, at night
996
+ B: function B(date, token, localize) {
997
+ var hours = date.getUTCHours();
998
+ var dayPeriodEnumValue;
999
+ if (hours >= 17) {
1000
+ dayPeriodEnumValue = dayPeriodEnum.evening;
1001
+ } else if (hours >= 12) {
1002
+ dayPeriodEnumValue = dayPeriodEnum.afternoon;
1003
+ } else if (hours >= 4) {
1004
+ dayPeriodEnumValue = dayPeriodEnum.morning;
1005
+ } else {
1006
+ dayPeriodEnumValue = dayPeriodEnum.night;
1007
+ }
1008
+ switch (token) {
1009
+ case 'B':
1010
+ case 'BB':
1011
+ case 'BBB':
1012
+ return localize.dayPeriod(dayPeriodEnumValue, {
1013
+ width: 'abbreviated',
1014
+ context: 'formatting'
1015
+ });
1016
+ case 'BBBBB':
1017
+ return localize.dayPeriod(dayPeriodEnumValue, {
1018
+ width: 'narrow',
1019
+ context: 'formatting'
1020
+ });
1021
+ case 'BBBB':
1022
+ default:
1023
+ return localize.dayPeriod(dayPeriodEnumValue, {
1024
+ width: 'wide',
1025
+ context: 'formatting'
1026
+ });
1027
+ }
1028
+ },
1029
+ // Hour [1-12]
1030
+ h: function h(date, token, localize) {
1031
+ if (token === 'ho') {
1032
+ var hours = date.getUTCHours() % 12;
1033
+ if (hours === 0) hours = 12;
1034
+ return localize.ordinalNumber(hours, {
1035
+ unit: 'hour'
1036
+ });
1037
+ }
1038
+ return formatters$3.h(date, token);
1039
+ },
1040
+ // Hour [0-23]
1041
+ H: function H(date, token, localize) {
1042
+ if (token === 'Ho') {
1043
+ return localize.ordinalNumber(date.getUTCHours(), {
1044
+ unit: 'hour'
1045
+ });
1046
+ }
1047
+ return formatters$3.H(date, token);
1048
+ },
1049
+ // Hour [0-11]
1050
+ K: function K(date, token, localize) {
1051
+ var hours = date.getUTCHours() % 12;
1052
+ if (token === 'Ko') {
1053
+ return localize.ordinalNumber(hours, {
1054
+ unit: 'hour'
1055
+ });
1056
+ }
1057
+ return addLeadingZeros(hours, token.length);
1058
+ },
1059
+ // Hour [1-24]
1060
+ k: function k(date, token, localize) {
1061
+ var hours = date.getUTCHours();
1062
+ if (hours === 0) hours = 24;
1063
+ if (token === 'ko') {
1064
+ return localize.ordinalNumber(hours, {
1065
+ unit: 'hour'
1066
+ });
1067
+ }
1068
+ return addLeadingZeros(hours, token.length);
1069
+ },
1070
+ // Minute
1071
+ m: function m(date, token, localize) {
1072
+ if (token === 'mo') {
1073
+ return localize.ordinalNumber(date.getUTCMinutes(), {
1074
+ unit: 'minute'
1075
+ });
1076
+ }
1077
+ return formatters$3.m(date, token);
1078
+ },
1079
+ // Second
1080
+ s: function s(date, token, localize) {
1081
+ if (token === 'so') {
1082
+ return localize.ordinalNumber(date.getUTCSeconds(), {
1083
+ unit: 'second'
1084
+ });
1085
+ }
1086
+ return formatters$3.s(date, token);
1087
+ },
1088
+ // Fraction of second
1089
+ S: function S(date, token) {
1090
+ return formatters$3.S(date, token);
1091
+ },
1092
+ // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1093
+ X: function X(date, token, _localize, options) {
1094
+ var originalDate = options._originalDate || date;
1095
+ var timezoneOffset = originalDate.getTimezoneOffset();
1096
+ if (timezoneOffset === 0) {
1097
+ return 'Z';
1098
+ }
1099
+ switch (token) {
1100
+ // Hours and optional minutes
1101
+ case 'X':
1102
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
1103
+
1104
+ // Hours, minutes and optional seconds without `:` delimiter
1105
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1106
+ // so this token always has the same output as `XX`
1107
+ case 'XXXX':
1108
+ case 'XX':
1109
+ // Hours and minutes without `:` delimiter
1110
+ return formatTimezone(timezoneOffset);
1111
+
1112
+ // Hours, minutes and optional seconds with `:` delimiter
1113
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1114
+ // so this token always has the same output as `XXX`
1115
+ case 'XXXXX':
1116
+ case 'XXX': // Hours and minutes with `:` delimiter
1117
+ default:
1118
+ return formatTimezone(timezoneOffset, ':');
1119
+ }
1120
+ },
1121
+ // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
1122
+ x: function x(date, token, _localize, options) {
1123
+ var originalDate = options._originalDate || date;
1124
+ var timezoneOffset = originalDate.getTimezoneOffset();
1125
+ switch (token) {
1126
+ // Hours and optional minutes
1127
+ case 'x':
1128
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
1129
+
1130
+ // Hours, minutes and optional seconds without `:` delimiter
1131
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1132
+ // so this token always has the same output as `xx`
1133
+ case 'xxxx':
1134
+ case 'xx':
1135
+ // Hours and minutes without `:` delimiter
1136
+ return formatTimezone(timezoneOffset);
1137
+
1138
+ // Hours, minutes and optional seconds with `:` delimiter
1139
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1140
+ // so this token always has the same output as `xxx`
1141
+ case 'xxxxx':
1142
+ case 'xxx': // Hours and minutes with `:` delimiter
1143
+ default:
1144
+ return formatTimezone(timezoneOffset, ':');
1145
+ }
1146
+ },
1147
+ // Timezone (GMT)
1148
+ O: function O(date, token, _localize, options) {
1149
+ var originalDate = options._originalDate || date;
1150
+ var timezoneOffset = originalDate.getTimezoneOffset();
1151
+ switch (token) {
1152
+ // Short
1153
+ case 'O':
1154
+ case 'OO':
1155
+ case 'OOO':
1156
+ return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
1157
+ // Long
1158
+ case 'OOOO':
1159
+ default:
1160
+ return 'GMT' + formatTimezone(timezoneOffset, ':');
1161
+ }
1162
+ },
1163
+ // Timezone (specific non-location)
1164
+ z: function z(date, token, _localize, options) {
1165
+ var originalDate = options._originalDate || date;
1166
+ var timezoneOffset = originalDate.getTimezoneOffset();
1167
+ switch (token) {
1168
+ // Short
1169
+ case 'z':
1170
+ case 'zz':
1171
+ case 'zzz':
1172
+ return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
1173
+ // Long
1174
+ case 'zzzz':
1175
+ default:
1176
+ return 'GMT' + formatTimezone(timezoneOffset, ':');
1177
+ }
1178
+ },
1179
+ // Seconds timestamp
1180
+ t: function t(date, token, _localize, options) {
1181
+ var originalDate = options._originalDate || date;
1182
+ var timestamp = Math.floor(originalDate.getTime() / 1000);
1183
+ return addLeadingZeros(timestamp, token.length);
1184
+ },
1185
+ // Milliseconds timestamp
1186
+ T: function T(date, token, _localize, options) {
1187
+ var originalDate = options._originalDate || date;
1188
+ var timestamp = originalDate.getTime();
1189
+ return addLeadingZeros(timestamp, token.length);
1190
+ }
1191
+ };
1192
+ function formatTimezoneShort(offset, dirtyDelimiter) {
1193
+ var sign = offset > 0 ? '-' : '+';
1194
+ var absOffset = Math.abs(offset);
1195
+ var hours = Math.floor(absOffset / 60);
1196
+ var minutes = absOffset % 60;
1197
+ if (minutes === 0) {
1198
+ return sign + String(hours);
1199
+ }
1200
+ var delimiter = dirtyDelimiter || '';
1201
+ return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
1202
+ }
1203
+ function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
1204
+ if (offset % 60 === 0) {
1205
+ var sign = offset > 0 ? '-' : '+';
1206
+ return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
1207
+ }
1208
+ return formatTimezone(offset, dirtyDelimiter);
1209
+ }
1210
+ function formatTimezone(offset, dirtyDelimiter) {
1211
+ var delimiter = dirtyDelimiter || '';
1212
+ var sign = offset > 0 ? '-' : '+';
1213
+ var absOffset = Math.abs(offset);
1214
+ var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);
1215
+ var minutes = addLeadingZeros(absOffset % 60, 2);
1216
+ return sign + hours + delimiter + minutes;
1217
+ }
1218
+ var formatters$1 = formatters;
1219
+
1220
+ var dateLongFormatter = function dateLongFormatter(pattern, formatLong) {
1221
+ switch (pattern) {
1222
+ case 'P':
1223
+ return formatLong.date({
1224
+ width: 'short'
1225
+ });
1226
+ case 'PP':
1227
+ return formatLong.date({
1228
+ width: 'medium'
1229
+ });
1230
+ case 'PPP':
1231
+ return formatLong.date({
1232
+ width: 'long'
1233
+ });
1234
+ case 'PPPP':
1235
+ default:
1236
+ return formatLong.date({
1237
+ width: 'full'
1238
+ });
1239
+ }
1240
+ };
1241
+ var timeLongFormatter = function timeLongFormatter(pattern, formatLong) {
1242
+ switch (pattern) {
1243
+ case 'p':
1244
+ return formatLong.time({
1245
+ width: 'short'
1246
+ });
1247
+ case 'pp':
1248
+ return formatLong.time({
1249
+ width: 'medium'
1250
+ });
1251
+ case 'ppp':
1252
+ return formatLong.time({
1253
+ width: 'long'
1254
+ });
1255
+ case 'pppp':
1256
+ default:
1257
+ return formatLong.time({
1258
+ width: 'full'
1259
+ });
1260
+ }
1261
+ };
1262
+ var dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong) {
1263
+ var matchResult = pattern.match(/(P+)(p+)?/) || [];
1264
+ var datePattern = matchResult[1];
1265
+ var timePattern = matchResult[2];
1266
+ if (!timePattern) {
1267
+ return dateLongFormatter(pattern, formatLong);
1268
+ }
1269
+ var dateTimeFormat;
1270
+ switch (datePattern) {
1271
+ case 'P':
1272
+ dateTimeFormat = formatLong.dateTime({
1273
+ width: 'short'
1274
+ });
1275
+ break;
1276
+ case 'PP':
1277
+ dateTimeFormat = formatLong.dateTime({
1278
+ width: 'medium'
1279
+ });
1280
+ break;
1281
+ case 'PPP':
1282
+ dateTimeFormat = formatLong.dateTime({
1283
+ width: 'long'
1284
+ });
1285
+ break;
1286
+ case 'PPPP':
1287
+ default:
1288
+ dateTimeFormat = formatLong.dateTime({
1289
+ width: 'full'
1290
+ });
1291
+ break;
1292
+ }
1293
+ return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));
1294
+ };
1295
+ var longFormatters = {
1296
+ p: timeLongFormatter,
1297
+ P: dateTimeLongFormatter
1298
+ };
1299
+ var longFormatters$1 = longFormatters;
1300
+
1301
+ var protectedDayOfYearTokens = ['D', 'DD'];
1302
+ var protectedWeekYearTokens = ['YY', 'YYYY'];
1303
+ function isProtectedDayOfYearToken(token) {
1304
+ return protectedDayOfYearTokens.indexOf(token) !== -1;
1305
+ }
1306
+ function isProtectedWeekYearToken(token) {
1307
+ return protectedWeekYearTokens.indexOf(token) !== -1;
1308
+ }
1309
+ function throwProtectedError(token, format, input) {
1310
+ if (token === 'YYYY') {
1311
+ throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
1312
+ } else if (token === 'YY') {
1313
+ throw new RangeError("Use `yy` instead of `YY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
1314
+ } else if (token === 'D') {
1315
+ throw new RangeError("Use `d` instead of `D` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
1316
+ } else if (token === 'DD') {
1317
+ throw new RangeError("Use `dd` instead of `DD` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
1318
+ }
1319
+ }
1320
+
1321
+ var formatDistanceLocale = {
1322
+ lessThanXSeconds: {
1323
+ one: 'less than a second',
1324
+ other: 'less than {{count}} seconds'
1325
+ },
1326
+ xSeconds: {
1327
+ one: '1 second',
1328
+ other: '{{count}} seconds'
1329
+ },
1330
+ halfAMinute: 'half a minute',
1331
+ lessThanXMinutes: {
1332
+ one: 'less than a minute',
1333
+ other: 'less than {{count}} minutes'
1334
+ },
1335
+ xMinutes: {
1336
+ one: '1 minute',
1337
+ other: '{{count}} minutes'
1338
+ },
1339
+ aboutXHours: {
1340
+ one: 'about 1 hour',
1341
+ other: 'about {{count}} hours'
1342
+ },
1343
+ xHours: {
1344
+ one: '1 hour',
1345
+ other: '{{count}} hours'
1346
+ },
1347
+ xDays: {
1348
+ one: '1 day',
1349
+ other: '{{count}} days'
1350
+ },
1351
+ aboutXWeeks: {
1352
+ one: 'about 1 week',
1353
+ other: 'about {{count}} weeks'
1354
+ },
1355
+ xWeeks: {
1356
+ one: '1 week',
1357
+ other: '{{count}} weeks'
1358
+ },
1359
+ aboutXMonths: {
1360
+ one: 'about 1 month',
1361
+ other: 'about {{count}} months'
1362
+ },
1363
+ xMonths: {
1364
+ one: '1 month',
1365
+ other: '{{count}} months'
1366
+ },
1367
+ aboutXYears: {
1368
+ one: 'about 1 year',
1369
+ other: 'about {{count}} years'
1370
+ },
1371
+ xYears: {
1372
+ one: '1 year',
1373
+ other: '{{count}} years'
1374
+ },
1375
+ overXYears: {
1376
+ one: 'over 1 year',
1377
+ other: 'over {{count}} years'
1378
+ },
1379
+ almostXYears: {
1380
+ one: 'almost 1 year',
1381
+ other: 'almost {{count}} years'
1382
+ }
1383
+ };
1384
+ var formatDistance = function formatDistance(token, count, options) {
1385
+ var result;
1386
+ var tokenValue = formatDistanceLocale[token];
1387
+ if (typeof tokenValue === 'string') {
1388
+ result = tokenValue;
1389
+ } else if (count === 1) {
1390
+ result = tokenValue.one;
1391
+ } else {
1392
+ result = tokenValue.other.replace('{{count}}', count.toString());
1393
+ }
1394
+ if (options !== null && options !== void 0 && options.addSuffix) {
1395
+ if (options.comparison && options.comparison > 0) {
1396
+ return 'in ' + result;
1397
+ } else {
1398
+ return result + ' ago';
1399
+ }
1400
+ }
1401
+ return result;
1402
+ };
1403
+ var formatDistance$1 = formatDistance;
1404
+
1405
+ function buildFormatLongFn(args) {
1406
+ return function () {
1407
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1408
+ // TODO: Remove String()
1409
+ var width = options.width ? String(options.width) : args.defaultWidth;
1410
+ var format = args.formats[width] || args.formats[args.defaultWidth];
1411
+ return format;
1412
+ };
1413
+ }
1414
+
1415
+ var dateFormats = {
1416
+ full: 'EEEE, MMMM do, y',
1417
+ long: 'MMMM do, y',
1418
+ medium: 'MMM d, y',
1419
+ short: 'MM/dd/yyyy'
1420
+ };
1421
+ var timeFormats = {
1422
+ full: 'h:mm:ss a zzzz',
1423
+ long: 'h:mm:ss a z',
1424
+ medium: 'h:mm:ss a',
1425
+ short: 'h:mm a'
1426
+ };
1427
+ var dateTimeFormats = {
1428
+ full: "{{date}} 'at' {{time}}",
1429
+ long: "{{date}} 'at' {{time}}",
1430
+ medium: '{{date}}, {{time}}',
1431
+ short: '{{date}}, {{time}}'
1432
+ };
1433
+ var formatLong = {
1434
+ date: buildFormatLongFn({
1435
+ formats: dateFormats,
1436
+ defaultWidth: 'full'
1437
+ }),
1438
+ time: buildFormatLongFn({
1439
+ formats: timeFormats,
1440
+ defaultWidth: 'full'
1441
+ }),
1442
+ dateTime: buildFormatLongFn({
1443
+ formats: dateTimeFormats,
1444
+ defaultWidth: 'full'
1445
+ })
1446
+ };
1447
+ var formatLong$1 = formatLong;
1448
+
1449
+ var formatRelativeLocale = {
1450
+ lastWeek: "'last' eeee 'at' p",
1451
+ yesterday: "'yesterday at' p",
1452
+ today: "'today at' p",
1453
+ tomorrow: "'tomorrow at' p",
1454
+ nextWeek: "eeee 'at' p",
1455
+ other: 'P'
1456
+ };
1457
+ var formatRelative = function formatRelative(token, _date, _baseDate, _options) {
1458
+ return formatRelativeLocale[token];
1459
+ };
1460
+ var formatRelative$1 = formatRelative;
1461
+
1462
+ function buildLocalizeFn(args) {
1463
+ return function (dirtyIndex, options) {
1464
+ var context = options !== null && options !== void 0 && options.context ? String(options.context) : 'standalone';
1465
+ var valuesArray;
1466
+ if (context === 'formatting' && args.formattingValues) {
1467
+ var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
1468
+ var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
1469
+ valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
1470
+ } else {
1471
+ var _defaultWidth = args.defaultWidth;
1472
+ var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
1473
+ valuesArray = args.values[_width] || args.values[_defaultWidth];
1474
+ }
1475
+ var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
1476
+ // @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!
1477
+ return valuesArray[index];
1478
+ };
1479
+ }
1480
+
1481
+ var eraValues = {
1482
+ narrow: ['B', 'A'],
1483
+ abbreviated: ['BC', 'AD'],
1484
+ wide: ['Before Christ', 'Anno Domini']
1485
+ };
1486
+ var quarterValues = {
1487
+ narrow: ['1', '2', '3', '4'],
1488
+ abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
1489
+ wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']
1490
+ };
1491
+
1492
+ // Note: in English, the names of days of the week and months are capitalized.
1493
+ // If you are making a new locale based on this one, check if the same is true for the language you're working on.
1494
+ // Generally, formatted dates should look like they are in the middle of a sentence,
1495
+ // e.g. in Spanish language the weekdays and months should be in the lowercase.
1496
+ var monthValues = {
1497
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
1498
+ abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
1499
+ wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
1500
+ };
1501
+ var dayValues = {
1502
+ narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
1503
+ short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
1504
+ abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
1505
+ wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
1506
+ };
1507
+ var dayPeriodValues = {
1508
+ narrow: {
1509
+ am: 'a',
1510
+ pm: 'p',
1511
+ midnight: 'mi',
1512
+ noon: 'n',
1513
+ morning: 'morning',
1514
+ afternoon: 'afternoon',
1515
+ evening: 'evening',
1516
+ night: 'night'
1517
+ },
1518
+ abbreviated: {
1519
+ am: 'AM',
1520
+ pm: 'PM',
1521
+ midnight: 'midnight',
1522
+ noon: 'noon',
1523
+ morning: 'morning',
1524
+ afternoon: 'afternoon',
1525
+ evening: 'evening',
1526
+ night: 'night'
1527
+ },
1528
+ wide: {
1529
+ am: 'a.m.',
1530
+ pm: 'p.m.',
1531
+ midnight: 'midnight',
1532
+ noon: 'noon',
1533
+ morning: 'morning',
1534
+ afternoon: 'afternoon',
1535
+ evening: 'evening',
1536
+ night: 'night'
1537
+ }
1538
+ };
1539
+ var formattingDayPeriodValues = {
1540
+ narrow: {
1541
+ am: 'a',
1542
+ pm: 'p',
1543
+ midnight: 'mi',
1544
+ noon: 'n',
1545
+ morning: 'in the morning',
1546
+ afternoon: 'in the afternoon',
1547
+ evening: 'in the evening',
1548
+ night: 'at night'
1549
+ },
1550
+ abbreviated: {
1551
+ am: 'AM',
1552
+ pm: 'PM',
1553
+ midnight: 'midnight',
1554
+ noon: 'noon',
1555
+ morning: 'in the morning',
1556
+ afternoon: 'in the afternoon',
1557
+ evening: 'in the evening',
1558
+ night: 'at night'
1559
+ },
1560
+ wide: {
1561
+ am: 'a.m.',
1562
+ pm: 'p.m.',
1563
+ midnight: 'midnight',
1564
+ noon: 'noon',
1565
+ morning: 'in the morning',
1566
+ afternoon: 'in the afternoon',
1567
+ evening: 'in the evening',
1568
+ night: 'at night'
1569
+ }
1570
+ };
1571
+ var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
1572
+ var number = Number(dirtyNumber);
1573
+
1574
+ // If ordinal numbers depend on context, for example,
1575
+ // if they are different for different grammatical genders,
1576
+ // use `options.unit`.
1577
+ //
1578
+ // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
1579
+ // 'day', 'hour', 'minute', 'second'.
1580
+
1581
+ var rem100 = number % 100;
1582
+ if (rem100 > 20 || rem100 < 10) {
1583
+ switch (rem100 % 10) {
1584
+ case 1:
1585
+ return number + 'st';
1586
+ case 2:
1587
+ return number + 'nd';
1588
+ case 3:
1589
+ return number + 'rd';
1590
+ }
1591
+ }
1592
+ return number + 'th';
1593
+ };
1594
+ var localize = {
1595
+ ordinalNumber: ordinalNumber,
1596
+ era: buildLocalizeFn({
1597
+ values: eraValues,
1598
+ defaultWidth: 'wide'
1599
+ }),
1600
+ quarter: buildLocalizeFn({
1601
+ values: quarterValues,
1602
+ defaultWidth: 'wide',
1603
+ argumentCallback: function argumentCallback(quarter) {
1604
+ return quarter - 1;
1605
+ }
1606
+ }),
1607
+ month: buildLocalizeFn({
1608
+ values: monthValues,
1609
+ defaultWidth: 'wide'
1610
+ }),
1611
+ day: buildLocalizeFn({
1612
+ values: dayValues,
1613
+ defaultWidth: 'wide'
1614
+ }),
1615
+ dayPeriod: buildLocalizeFn({
1616
+ values: dayPeriodValues,
1617
+ defaultWidth: 'wide',
1618
+ formattingValues: formattingDayPeriodValues,
1619
+ defaultFormattingWidth: 'wide'
1620
+ })
1621
+ };
1622
+ var localize$1 = localize;
1623
+
1624
+ function buildMatchFn(args) {
1625
+ return function (string) {
1626
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1627
+ var width = options.width;
1628
+ var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
1629
+ var matchResult = string.match(matchPattern);
1630
+ if (!matchResult) {
1631
+ return null;
1632
+ }
1633
+ var matchedString = matchResult[0];
1634
+ var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
1635
+ var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {
1636
+ return pattern.test(matchedString);
1637
+ }) : findKey(parsePatterns, function (pattern) {
1638
+ return pattern.test(matchedString);
1639
+ });
1640
+ var value;
1641
+ value = args.valueCallback ? args.valueCallback(key) : key;
1642
+ value = options.valueCallback ? options.valueCallback(value) : value;
1643
+ var rest = string.slice(matchedString.length);
1644
+ return {
1645
+ value: value,
1646
+ rest: rest
1647
+ };
1648
+ };
1649
+ }
1650
+ function findKey(object, predicate) {
1651
+ for (var key in object) {
1652
+ if (object.hasOwnProperty(key) && predicate(object[key])) {
1653
+ return key;
1654
+ }
1655
+ }
1656
+ return undefined;
1657
+ }
1658
+ function findIndex(array, predicate) {
1659
+ for (var key = 0; key < array.length; key++) {
1660
+ if (predicate(array[key])) {
1661
+ return key;
1662
+ }
1663
+ }
1664
+ return undefined;
1665
+ }
1666
+
1667
+ function buildMatchPatternFn(args) {
1668
+ return function (string) {
1669
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1670
+ var matchResult = string.match(args.matchPattern);
1671
+ if (!matchResult) return null;
1672
+ var matchedString = matchResult[0];
1673
+ var parseResult = string.match(args.parsePattern);
1674
+ if (!parseResult) return null;
1675
+ var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
1676
+ value = options.valueCallback ? options.valueCallback(value) : value;
1677
+ var rest = string.slice(matchedString.length);
1678
+ return {
1679
+ value: value,
1680
+ rest: rest
1681
+ };
1682
+ };
1683
+ }
1684
+
1685
+ var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
1686
+ var parseOrdinalNumberPattern = /\d+/i;
1687
+ var matchEraPatterns = {
1688
+ narrow: /^(b|a)/i,
1689
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
1690
+ wide: /^(before christ|before common era|anno domini|common era)/i
1691
+ };
1692
+ var parseEraPatterns = {
1693
+ any: [/^b/i, /^(a|c)/i]
1694
+ };
1695
+ var matchQuarterPatterns = {
1696
+ narrow: /^[1234]/i,
1697
+ abbreviated: /^q[1234]/i,
1698
+ wide: /^[1234](th|st|nd|rd)? quarter/i
1699
+ };
1700
+ var parseQuarterPatterns = {
1701
+ any: [/1/i, /2/i, /3/i, /4/i]
1702
+ };
1703
+ var matchMonthPatterns = {
1704
+ narrow: /^[jfmasond]/i,
1705
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
1706
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
1707
+ };
1708
+ var parseMonthPatterns = {
1709
+ narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
1710
+ any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
1711
+ };
1712
+ var matchDayPatterns = {
1713
+ narrow: /^[smtwf]/i,
1714
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
1715
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
1716
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
1717
+ };
1718
+ var parseDayPatterns = {
1719
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
1720
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
1721
+ };
1722
+ var matchDayPeriodPatterns = {
1723
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
1724
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
1725
+ };
1726
+ var parseDayPeriodPatterns = {
1727
+ any: {
1728
+ am: /^a/i,
1729
+ pm: /^p/i,
1730
+ midnight: /^mi/i,
1731
+ noon: /^no/i,
1732
+ morning: /morning/i,
1733
+ afternoon: /afternoon/i,
1734
+ evening: /evening/i,
1735
+ night: /night/i
1736
+ }
1737
+ };
1738
+ var match = {
1739
+ ordinalNumber: buildMatchPatternFn({
1740
+ matchPattern: matchOrdinalNumberPattern,
1741
+ parsePattern: parseOrdinalNumberPattern,
1742
+ valueCallback: function valueCallback(value) {
1743
+ return parseInt(value, 10);
1744
+ }
1745
+ }),
1746
+ era: buildMatchFn({
1747
+ matchPatterns: matchEraPatterns,
1748
+ defaultMatchWidth: 'wide',
1749
+ parsePatterns: parseEraPatterns,
1750
+ defaultParseWidth: 'any'
1751
+ }),
1752
+ quarter: buildMatchFn({
1753
+ matchPatterns: matchQuarterPatterns,
1754
+ defaultMatchWidth: 'wide',
1755
+ parsePatterns: parseQuarterPatterns,
1756
+ defaultParseWidth: 'any',
1757
+ valueCallback: function valueCallback(index) {
1758
+ return index + 1;
1759
+ }
1760
+ }),
1761
+ month: buildMatchFn({
1762
+ matchPatterns: matchMonthPatterns,
1763
+ defaultMatchWidth: 'wide',
1764
+ parsePatterns: parseMonthPatterns,
1765
+ defaultParseWidth: 'any'
1766
+ }),
1767
+ day: buildMatchFn({
1768
+ matchPatterns: matchDayPatterns,
1769
+ defaultMatchWidth: 'wide',
1770
+ parsePatterns: parseDayPatterns,
1771
+ defaultParseWidth: 'any'
1772
+ }),
1773
+ dayPeriod: buildMatchFn({
1774
+ matchPatterns: matchDayPeriodPatterns,
1775
+ defaultMatchWidth: 'any',
1776
+ parsePatterns: parseDayPeriodPatterns,
1777
+ defaultParseWidth: 'any'
1778
+ })
1779
+ };
1780
+ var match$1 = match;
1781
+
1782
+ /**
1783
+ * @type {Locale}
1784
+ * @category Locales
1785
+ * @summary English locale (United States).
1786
+ * @language English
1787
+ * @iso-639-2 eng
1788
+ * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
1789
+ * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
1790
+ */
1791
+ var locale = {
1792
+ code: 'en-US',
1793
+ formatDistance: formatDistance$1,
1794
+ formatLong: formatLong$1,
1795
+ formatRelative: formatRelative$1,
1796
+ localize: localize$1,
1797
+ match: match$1,
1798
+ options: {
1799
+ weekStartsOn: 0 /* Sunday */,
1800
+ firstWeekContainsDate: 1
1801
+ }
1802
+ };
1803
+ var defaultLocale = locale;
1804
+
1805
+ // - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
1806
+ // (one of the certain letters followed by `o`)
1807
+ // - (\w)\1* matches any sequences of the same letter
1808
+ // - '' matches two quote characters in a row
1809
+ // - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
1810
+ // except a single quote symbol, which ends the sequence.
1811
+ // Two quote characters do not end the sequence.
1812
+ // If there is no matching single quote
1813
+ // then the sequence will continue until the end of the string.
1814
+ // - . matches any single character unmatched by previous parts of the RegExps
1815
+ var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
1816
+
1817
+ // This RegExp catches symbols escaped by quotes, and also
1818
+ // sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
1819
+ var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
1820
+ var escapedStringRegExp = /^'([^]*?)'?$/;
1821
+ var doubleQuoteRegExp = /''/g;
1822
+ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
1823
+
1824
+ /**
1825
+ * @name format
1826
+ * @category Common Helpers
1827
+ * @summary Format the date.
1828
+ *
1829
+ * @description
1830
+ * Return the formatted date string in the given format. The result may vary by locale.
1831
+ *
1832
+ * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
1833
+ * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
1834
+ *
1835
+ * The characters wrapped between two single quotes characters (') are escaped.
1836
+ * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
1837
+ * (see the last example)
1838
+ *
1839
+ * Format of the string is based on Unicode Technical Standard #35:
1840
+ * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
1841
+ * with a few additions (see note 7 below the table).
1842
+ *
1843
+ * Accepted patterns:
1844
+ * | Unit | Pattern | Result examples | Notes |
1845
+ * |---------------------------------|---------|-----------------------------------|-------|
1846
+ * | Era | G..GGG | AD, BC | |
1847
+ * | | GGGG | Anno Domini, Before Christ | 2 |
1848
+ * | | GGGGG | A, B | |
1849
+ * | Calendar year | y | 44, 1, 1900, 2017 | 5 |
1850
+ * | | yo | 44th, 1st, 0th, 17th | 5,7 |
1851
+ * | | yy | 44, 01, 00, 17 | 5 |
1852
+ * | | yyy | 044, 001, 1900, 2017 | 5 |
1853
+ * | | yyyy | 0044, 0001, 1900, 2017 | 5 |
1854
+ * | | yyyyy | ... | 3,5 |
1855
+ * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |
1856
+ * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |
1857
+ * | | YY | 44, 01, 00, 17 | 5,8 |
1858
+ * | | YYY | 044, 001, 1900, 2017 | 5 |
1859
+ * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |
1860
+ * | | YYYYY | ... | 3,5 |
1861
+ * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |
1862
+ * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |
1863
+ * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |
1864
+ * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |
1865
+ * | | RRRRR | ... | 3,5,7 |
1866
+ * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |
1867
+ * | | uu | -43, 01, 1900, 2017 | 5 |
1868
+ * | | uuu | -043, 001, 1900, 2017 | 5 |
1869
+ * | | uuuu | -0043, 0001, 1900, 2017 | 5 |
1870
+ * | | uuuuu | ... | 3,5 |
1871
+ * | Quarter (formatting) | Q | 1, 2, 3, 4 | |
1872
+ * | | Qo | 1st, 2nd, 3rd, 4th | 7 |
1873
+ * | | QQ | 01, 02, 03, 04 | |
1874
+ * | | QQQ | Q1, Q2, Q3, Q4 | |
1875
+ * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
1876
+ * | | QQQQQ | 1, 2, 3, 4 | 4 |
1877
+ * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |
1878
+ * | | qo | 1st, 2nd, 3rd, 4th | 7 |
1879
+ * | | qq | 01, 02, 03, 04 | |
1880
+ * | | qqq | Q1, Q2, Q3, Q4 | |
1881
+ * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
1882
+ * | | qqqqq | 1, 2, 3, 4 | 4 |
1883
+ * | Month (formatting) | M | 1, 2, ..., 12 | |
1884
+ * | | Mo | 1st, 2nd, ..., 12th | 7 |
1885
+ * | | MM | 01, 02, ..., 12 | |
1886
+ * | | MMM | Jan, Feb, ..., Dec | |
1887
+ * | | MMMM | January, February, ..., December | 2 |
1888
+ * | | MMMMM | J, F, ..., D | |
1889
+ * | Month (stand-alone) | L | 1, 2, ..., 12 | |
1890
+ * | | Lo | 1st, 2nd, ..., 12th | 7 |
1891
+ * | | LL | 01, 02, ..., 12 | |
1892
+ * | | LLL | Jan, Feb, ..., Dec | |
1893
+ * | | LLLL | January, February, ..., December | 2 |
1894
+ * | | LLLLL | J, F, ..., D | |
1895
+ * | Local week of year | w | 1, 2, ..., 53 | |
1896
+ * | | wo | 1st, 2nd, ..., 53th | 7 |
1897
+ * | | ww | 01, 02, ..., 53 | |
1898
+ * | ISO week of year | I | 1, 2, ..., 53 | 7 |
1899
+ * | | Io | 1st, 2nd, ..., 53th | 7 |
1900
+ * | | II | 01, 02, ..., 53 | 7 |
1901
+ * | Day of month | d | 1, 2, ..., 31 | |
1902
+ * | | do | 1st, 2nd, ..., 31st | 7 |
1903
+ * | | dd | 01, 02, ..., 31 | |
1904
+ * | Day of year | D | 1, 2, ..., 365, 366 | 9 |
1905
+ * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |
1906
+ * | | DD | 01, 02, ..., 365, 366 | 9 |
1907
+ * | | DDD | 001, 002, ..., 365, 366 | |
1908
+ * | | DDDD | ... | 3 |
1909
+ * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
1910
+ * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
1911
+ * | | EEEEE | M, T, W, T, F, S, S | |
1912
+ * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
1913
+ * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
1914
+ * | | io | 1st, 2nd, ..., 7th | 7 |
1915
+ * | | ii | 01, 02, ..., 07 | 7 |
1916
+ * | | iii | Mon, Tue, Wed, ..., Sun | 7 |
1917
+ * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
1918
+ * | | iiiii | M, T, W, T, F, S, S | 7 |
1919
+ * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
1920
+ * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
1921
+ * | | eo | 2nd, 3rd, ..., 1st | 7 |
1922
+ * | | ee | 02, 03, ..., 01 | |
1923
+ * | | eee | Mon, Tue, Wed, ..., Sun | |
1924
+ * | | eeee | Monday, Tuesday, ..., Sunday | 2 |
1925
+ * | | eeeee | M, T, W, T, F, S, S | |
1926
+ * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
1927
+ * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
1928
+ * | | co | 2nd, 3rd, ..., 1st | 7 |
1929
+ * | | cc | 02, 03, ..., 01 | |
1930
+ * | | ccc | Mon, Tue, Wed, ..., Sun | |
1931
+ * | | cccc | Monday, Tuesday, ..., Sunday | 2 |
1932
+ * | | ccccc | M, T, W, T, F, S, S | |
1933
+ * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
1934
+ * | AM, PM | a..aa | AM, PM | |
1935
+ * | | aaa | am, pm | |
1936
+ * | | aaaa | a.m., p.m. | 2 |
1937
+ * | | aaaaa | a, p | |
1938
+ * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
1939
+ * | | bbb | am, pm, noon, midnight | |
1940
+ * | | bbbb | a.m., p.m., noon, midnight | 2 |
1941
+ * | | bbbbb | a, p, n, mi | |
1942
+ * | Flexible day period | B..BBB | at night, in the morning, ... | |
1943
+ * | | BBBB | at night, in the morning, ... | 2 |
1944
+ * | | BBBBB | at night, in the morning, ... | |
1945
+ * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |
1946
+ * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |
1947
+ * | | hh | 01, 02, ..., 11, 12 | |
1948
+ * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |
1949
+ * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |
1950
+ * | | HH | 00, 01, 02, ..., 23 | |
1951
+ * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |
1952
+ * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |
1953
+ * | | KK | 01, 02, ..., 11, 00 | |
1954
+ * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |
1955
+ * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |
1956
+ * | | kk | 24, 01, 02, ..., 23 | |
1957
+ * | Minute | m | 0, 1, ..., 59 | |
1958
+ * | | mo | 0th, 1st, ..., 59th | 7 |
1959
+ * | | mm | 00, 01, ..., 59 | |
1960
+ * | Second | s | 0, 1, ..., 59 | |
1961
+ * | | so | 0th, 1st, ..., 59th | 7 |
1962
+ * | | ss | 00, 01, ..., 59 | |
1963
+ * | Fraction of second | S | 0, 1, ..., 9 | |
1964
+ * | | SS | 00, 01, ..., 99 | |
1965
+ * | | SSS | 000, 001, ..., 999 | |
1966
+ * | | SSSS | ... | 3 |
1967
+ * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
1968
+ * | | XX | -0800, +0530, Z | |
1969
+ * | | XXX | -08:00, +05:30, Z | |
1970
+ * | | XXXX | -0800, +0530, Z, +123456 | 2 |
1971
+ * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
1972
+ * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |
1973
+ * | | xx | -0800, +0530, +0000 | |
1974
+ * | | xxx | -08:00, +05:30, +00:00 | 2 |
1975
+ * | | xxxx | -0800, +0530, +0000, +123456 | |
1976
+ * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
1977
+ * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |
1978
+ * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |
1979
+ * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |
1980
+ * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |
1981
+ * | Seconds timestamp | t | 512969520 | 7 |
1982
+ * | | tt | ... | 3,7 |
1983
+ * | Milliseconds timestamp | T | 512969520900 | 7 |
1984
+ * | | TT | ... | 3,7 |
1985
+ * | Long localized date | P | 04/29/1453 | 7 |
1986
+ * | | PP | Apr 29, 1453 | 7 |
1987
+ * | | PPP | April 29th, 1453 | 7 |
1988
+ * | | PPPP | Friday, April 29th, 1453 | 2,7 |
1989
+ * | Long localized time | p | 12:00 AM | 7 |
1990
+ * | | pp | 12:00:00 AM | 7 |
1991
+ * | | ppp | 12:00:00 AM GMT+2 | 7 |
1992
+ * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
1993
+ * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
1994
+ * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
1995
+ * | | PPPppp | April 29th, 1453 at ... | 7 |
1996
+ * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
1997
+ * Notes:
1998
+ * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
1999
+ * are the same as "stand-alone" units, but are different in some languages.
2000
+ * "Formatting" units are declined according to the rules of the language
2001
+ * in the context of a date. "Stand-alone" units are always nominative singular:
2002
+ *
2003
+ * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
2004
+ *
2005
+ * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
2006
+ *
2007
+ * 2. Any sequence of the identical letters is a pattern, unless it is escaped by
2008
+ * the single quote characters (see below).
2009
+ * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
2010
+ * the output will be the same as default pattern for this unit, usually
2011
+ * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
2012
+ * are marked with "2" in the last column of the table.
2013
+ *
2014
+ * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
2015
+ *
2016
+ * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
2017
+ *
2018
+ * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
2019
+ *
2020
+ * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
2021
+ *
2022
+ * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
2023
+ *
2024
+ * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
2025
+ * The output will be padded with zeros to match the length of the pattern.
2026
+ *
2027
+ * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
2028
+ *
2029
+ * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
2030
+ * These tokens represent the shortest form of the quarter.
2031
+ *
2032
+ * 5. The main difference between `y` and `u` patterns are B.C. years:
2033
+ *
2034
+ * | Year | `y` | `u` |
2035
+ * |------|-----|-----|
2036
+ * | AC 1 | 1 | 1 |
2037
+ * | BC 1 | 1 | 0 |
2038
+ * | BC 2 | 2 | -1 |
2039
+ *
2040
+ * Also `yy` always returns the last two digits of a year,
2041
+ * while `uu` pads single digit years to 2 characters and returns other years unchanged:
2042
+ *
2043
+ * | Year | `yy` | `uu` |
2044
+ * |------|------|------|
2045
+ * | 1 | 01 | 01 |
2046
+ * | 14 | 14 | 14 |
2047
+ * | 376 | 76 | 376 |
2048
+ * | 1453 | 53 | 1453 |
2049
+ *
2050
+ * The same difference is true for local and ISO week-numbering years (`Y` and `R`),
2051
+ * except local week-numbering years are dependent on `options.weekStartsOn`
2052
+ * and `options.firstWeekContainsDate` (compare [getISOWeekYear]{@link https://date-fns.org/docs/getISOWeekYear}
2053
+ * and [getWeekYear]{@link https://date-fns.org/docs/getWeekYear}).
2054
+ *
2055
+ * 6. Specific non-location timezones are currently unavailable in `date-fns`,
2056
+ * so right now these tokens fall back to GMT timezones.
2057
+ *
2058
+ * 7. These patterns are not in the Unicode Technical Standard #35:
2059
+ * - `i`: ISO day of week
2060
+ * - `I`: ISO week of year
2061
+ * - `R`: ISO week-numbering year
2062
+ * - `t`: seconds timestamp
2063
+ * - `T`: milliseconds timestamp
2064
+ * - `o`: ordinal number modifier
2065
+ * - `P`: long localized date
2066
+ * - `p`: long localized time
2067
+ *
2068
+ * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
2069
+ * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2070
+ *
2071
+ * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
2072
+ * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2073
+ *
2074
+ * @param {Date|Number} date - the original date
2075
+ * @param {String} format - the string of tokens
2076
+ * @param {Object} [options] - an object with options.
2077
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
2078
+ * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
2079
+ * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is
2080
+ * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;
2081
+ * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2082
+ * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;
2083
+ * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2084
+ * @returns {String} the formatted date string
2085
+ * @throws {TypeError} 2 arguments required
2086
+ * @throws {RangeError} `date` must not be Invalid Date
2087
+ * @throws {RangeError} `options.locale` must contain `localize` property
2088
+ * @throws {RangeError} `options.locale` must contain `formatLong` property
2089
+ * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
2090
+ * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
2091
+ * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2092
+ * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2093
+ * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2094
+ * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2095
+ * @throws {RangeError} format string contains an unescaped latin alphabet character
2096
+ *
2097
+ * @example
2098
+ * // Represent 11 February 2014 in middle-endian format:
2099
+ * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
2100
+ * //=> '02/11/2014'
2101
+ *
2102
+ * @example
2103
+ * // Represent 2 July 2014 in Esperanto:
2104
+ * import { eoLocale } from 'date-fns/locale/eo'
2105
+ * const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
2106
+ * locale: eoLocale
2107
+ * })
2108
+ * //=> '2-a de julio 2014'
2109
+ *
2110
+ * @example
2111
+ * // Escape string by single quote characters:
2112
+ * const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
2113
+ * //=> "3 o'clock"
2114
+ */
2115
+
2116
+ function format(dirtyDate, dirtyFormatStr, options) {
2117
+ var _ref, _options$locale, _ref2, _ref3, _ref4, _options$firstWeekCon, _options$locale2, _options$locale2$opti, _defaultOptions$local, _defaultOptions$local2, _ref5, _ref6, _ref7, _options$weekStartsOn, _options$locale3, _options$locale3$opti, _defaultOptions$local3, _defaultOptions$local4;
2118
+ requiredArgs(2, arguments);
2119
+ var formatStr = String(dirtyFormatStr);
2120
+ var defaultOptions = getDefaultOptions();
2121
+ var locale = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions.locale) !== null && _ref !== void 0 ? _ref : defaultLocale;
2122
+ var firstWeekContainsDate = toInteger((_ref2 = (_ref3 = (_ref4 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale2 = options.locale) === null || _options$locale2 === void 0 ? void 0 : (_options$locale2$opti = _options$locale2.options) === null || _options$locale2$opti === void 0 ? void 0 : _options$locale2$opti.firstWeekContainsDate) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : 1);
2123
+
2124
+ // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
2125
+ if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
2126
+ throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
2127
+ }
2128
+ var weekStartsOn = toInteger((_ref5 = (_ref6 = (_ref7 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale3 = options.locale) === null || _options$locale3 === void 0 ? void 0 : (_options$locale3$opti = _options$locale3.options) === null || _options$locale3$opti === void 0 ? void 0 : _options$locale3$opti.weekStartsOn) !== null && _ref7 !== void 0 ? _ref7 : defaultOptions.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : (_defaultOptions$local3 = defaultOptions.locale) === null || _defaultOptions$local3 === void 0 ? void 0 : (_defaultOptions$local4 = _defaultOptions$local3.options) === null || _defaultOptions$local4 === void 0 ? void 0 : _defaultOptions$local4.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : 0);
2129
+
2130
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
2131
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
2132
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
2133
+ }
2134
+ if (!locale.localize) {
2135
+ throw new RangeError('locale must contain localize property');
2136
+ }
2137
+ if (!locale.formatLong) {
2138
+ throw new RangeError('locale must contain formatLong property');
2139
+ }
2140
+ var originalDate = toDate(dirtyDate);
2141
+ if (!isValid(originalDate)) {
2142
+ throw new RangeError('Invalid time value');
2143
+ }
2144
+
2145
+ // Convert the date in system timezone to the same date in UTC+00:00 timezone.
2146
+ // This ensures that when UTC functions will be implemented, locales will be compatible with them.
2147
+ // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376
2148
+ var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);
2149
+ var utcDate = subMilliseconds(originalDate, timezoneOffset);
2150
+ var formatterOptions = {
2151
+ firstWeekContainsDate: firstWeekContainsDate,
2152
+ weekStartsOn: weekStartsOn,
2153
+ locale: locale,
2154
+ _originalDate: originalDate
2155
+ };
2156
+ var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {
2157
+ var firstCharacter = substring[0];
2158
+ if (firstCharacter === 'p' || firstCharacter === 'P') {
2159
+ var longFormatter = longFormatters$1[firstCharacter];
2160
+ return longFormatter(substring, locale.formatLong);
2161
+ }
2162
+ return substring;
2163
+ }).join('').match(formattingTokensRegExp).map(function (substring) {
2164
+ // Replace two single quote characters with one single quote character
2165
+ if (substring === "''") {
2166
+ return "'";
2167
+ }
2168
+ var firstCharacter = substring[0];
2169
+ if (firstCharacter === "'") {
2170
+ return cleanEscapedString(substring);
2171
+ }
2172
+ var formatter = formatters$1[firstCharacter];
2173
+ if (formatter) {
2174
+ if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(substring)) {
2175
+ throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
2176
+ }
2177
+ if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(substring)) {
2178
+ throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
2179
+ }
2180
+ return formatter(utcDate, substring, locale.localize, formatterOptions);
2181
+ }
2182
+ if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
2183
+ throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');
2184
+ }
2185
+ return substring;
2186
+ }).join('');
2187
+ return result;
2188
+ }
2189
+ function cleanEscapedString(input) {
2190
+ var matched = input.match(escapedStringRegExp);
2191
+ if (!matched) {
2192
+ return input;
2193
+ }
2194
+ return matched[1].replace(doubleQuoteRegExp, "'");
2195
+ }
2196
+
2197
+ export { _typeof as _, toInteger as a, isDate as b, format as f, getDefaultOptions as g, isValid as i, requiredArgs as r, toDate as t };