@learncard/react 2.7.20 → 2.7.23

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 (247) hide show
  1. package/dist/base.css +1 -1
  2. package/dist/base.js +1 -1
  3. package/dist/cjs/{AchievementCard-2ad4cb64.js → AchievementCard-496e93b5.js} +4 -4
  4. package/dist/cjs/{AchievementCard-2ad4cb64.js.map → AchievementCard-496e93b5.js.map} +1 -1
  5. package/dist/cjs/{BoostGenericCard-e540e459.js → BoostGenericCard-1bfe4385.js} +8 -8
  6. package/dist/cjs/BoostGenericCard-1bfe4385.js.map +1 -0
  7. package/dist/cjs/{BoostSmallCard-9dc75a95.js → BoostSmallCard-bba7c0c9.js} +5 -5
  8. package/dist/cjs/BoostSmallCard-bba7c0c9.js.map +1 -0
  9. package/dist/cjs/Button-a7af702b.js.map +1 -1
  10. package/dist/cjs/{CertificateDisplayCard-11ebf814.js → CertificateDisplayCard-d7f6c028.js} +31 -19
  11. package/dist/{esm/CertificateDisplayCard-b69fd06f.js.map → cjs/CertificateDisplayCard-d7f6c028.js.map} +1 -1
  12. package/dist/cjs/Checkmark-f611aa4d.js.map +1 -1
  13. package/dist/cjs/CircleCheckButton-82d47ee2.js.map +1 -1
  14. package/dist/cjs/CircleIcon-617c38fa.js.map +1 -1
  15. package/dist/cjs/CircleSpinner-093cce04.js.map +1 -1
  16. package/dist/cjs/Coins-acd63f46.js.map +1 -1
  17. package/dist/cjs/CourseCard-338a32ee.js.map +1 -1
  18. package/dist/cjs/{CourseVerticalCard-5a73ab74.js → CourseVerticalCard-841960b1.js} +3 -3
  19. package/dist/cjs/{CourseVerticalCard-5a73ab74.js.map → CourseVerticalCard-841960b1.js.map} +1 -1
  20. package/dist/cjs/FlippyCard-209549c5.js.map +1 -1
  21. package/dist/cjs/GenericArrow-8dfb261d.js.map +1 -1
  22. package/dist/cjs/{GenericCard-46248807.js → GenericCard-5659339e.js} +7 -8
  23. package/dist/cjs/GenericCard-5659339e.js.map +1 -0
  24. package/dist/cjs/JobHistoryCard-05a3f98b.js.map +1 -1
  25. package/dist/cjs/JobListCard-458c8585.js.map +1 -1
  26. package/dist/cjs/LearnCardCreditCardBackFace-87cc8b9f.js.map +1 -1
  27. package/dist/cjs/{LearnCardCreditCardFrontFace-94be6a62.js → LearnCardCreditCardFrontFace-39eeb89a.js} +2 -2
  28. package/dist/cjs/{LearnCardCreditCardFrontFace-94be6a62.js.map → LearnCardCreditCardFrontFace-39eeb89a.js.map} +1 -1
  29. package/dist/cjs/LearnPill-21b47475.js.map +1 -1
  30. package/dist/cjs/{Lightbox-f19e13d2.js → Lightbox-880f4672.js} +22 -19
  31. package/dist/cjs/{Lightbox-f19e13d2.js.map → Lightbox-880f4672.js.map} +1 -1
  32. package/dist/cjs/Lightbulb-19c89d3c.js.map +1 -1
  33. package/dist/cjs/{MeritBadgeDisplayCard-70930ef2.js → MeritBadgeDisplayCard-b952091c.js} +102 -76
  34. package/dist/cjs/MeritBadgeDisplayCard-b952091c.js.map +1 -0
  35. package/dist/cjs/{MeritBadgeSkillsCount-41a273ae.js → MeritBadgeSkillsCount-59548cbb.js} +10 -4
  36. package/dist/cjs/{MeritBadgeSkillsCount-41a273ae.js.map → MeritBadgeSkillsCount-59548cbb.js.map} +1 -1
  37. package/dist/cjs/MiniVCThumbnail-a78e44f2.js.map +1 -1
  38. package/dist/cjs/Notification-d212fa7b.js.map +1 -1
  39. package/dist/cjs/NotificationBoostCard-70dfa17e.js.map +1 -1
  40. package/dist/cjs/NotificationUserAcceptedBoostCard-423b9320.js.map +1 -1
  41. package/dist/cjs/NotificationUserCard-d4dab06c.js.map +1 -1
  42. package/dist/cjs/PuzzlePiece-937c216a.js.map +1 -1
  43. package/dist/cjs/{QRCodeCard-2a818136.js → QRCodeCard-b56c11cc.js} +2 -2
  44. package/dist/cjs/{QRCodeCard-2a818136.js.map → QRCodeCard-b56c11cc.js.map} +1 -1
  45. package/dist/cjs/QRCodeIcon-81c6e96b.js.map +1 -1
  46. package/dist/cjs/RoundedPill-bda7c067.js.map +1 -1
  47. package/dist/cjs/{SchoolIDCard-c7b4153a.js → SchoolIDCard-5a0b8568.js} +1206 -10
  48. package/dist/cjs/SchoolIDCard-5a0b8568.js.map +1 -0
  49. package/dist/cjs/{SkillTabCard-d8f3f5d4.js → SkillTabCard-66677f3c.js} +2 -2
  50. package/dist/cjs/{SkillTabCard-d8f3f5d4.js.map → SkillTabCard-66677f3c.js.map} +1 -1
  51. package/dist/cjs/SkillVerticalCard-3eb3a8e9.js.map +1 -1
  52. package/dist/cjs/SkillsCard-4b6dbb4f.js.map +1 -1
  53. package/dist/cjs/SkillsStatsCard-97a35a88.js.map +1 -1
  54. package/dist/cjs/SmallAchievementCard-a1fa862b.js.map +1 -1
  55. package/dist/cjs/Trophy-3d323be3.js.map +1 -1
  56. package/dist/cjs/User-301088ac.js.map +1 -1
  57. package/dist/cjs/{VCCard-cf3590eb.js → VCCard-70f348fd.js} +4 -18
  58. package/dist/{esm/VCCard-6c8c3ff1.js.map → cjs/VCCard-70f348fd.js.map} +1 -1
  59. package/dist/cjs/{VCDisplayBackFace-9c064eef.js → VCDisplayBackFace-aab5806b.js} +3 -3
  60. package/dist/cjs/{VCDisplayBackFace-9c064eef.js.map → VCDisplayBackFace-aab5806b.js.map} +1 -1
  61. package/dist/cjs/{VCDisplayCard-929fe8b9.js → VCDisplayCard-ae0ee7c6.js} +3 -3
  62. package/dist/cjs/{VCDisplayCard-929fe8b9.js.map → VCDisplayCard-ae0ee7c6.js.map} +1 -1
  63. package/dist/cjs/{VCDisplayCard2-19613b61.js → VCDisplayCard2-653b08d5.js} +67 -48
  64. package/dist/{esm/VCDisplayCard2-06c93532.js.map → cjs/VCDisplayCard2-653b08d5.js.map} +1 -1
  65. package/dist/cjs/VCThumbnail-6bf86bb2.js.map +1 -1
  66. package/dist/cjs/VCVerificationCheck-46fa75d3.js.map +1 -1
  67. package/dist/cjs/{VCVerificationPill-09953688.js → VCVerificationPill-b8d9a33d.js} +2 -2
  68. package/dist/cjs/{VCVerificationPill-09953688.js.map → VCVerificationPill-b8d9a33d.js.map} +1 -1
  69. package/dist/cjs/{VerifierStateBadgeAndText-fd0bd814.js → VerifierStateBadgeAndText-e5f83fc7.js} +19 -9
  70. package/dist/cjs/VerifierStateBadgeAndText-e5f83fc7.js.map +1 -0
  71. package/dist/cjs/{constants-737d10f6.js → constants-5bc954cb.js} +10 -10
  72. package/dist/cjs/{constants-737d10f6.js.map → constants-5bc954cb.js.map} +1 -1
  73. package/dist/cjs/{credential.helpers-afb94f02.js → credential.helpers-39c07250.js} +874 -1296
  74. package/dist/cjs/credential.helpers-39c07250.js.map +1 -0
  75. package/dist/cjs/icons-0404f605.js.map +1 -1
  76. package/dist/cjs/index-5488badc.js.map +1 -1
  77. package/dist/cjs/index-7cd11826.js.map +1 -1
  78. package/dist/cjs/index-c831a2f6.js +2448 -0
  79. package/dist/cjs/index-c831a2f6.js.map +1 -0
  80. package/dist/cjs/{index-8082a131.js → index-ec1d26f1.js} +17 -21
  81. package/dist/cjs/index-ec1d26f1.js.map +1 -0
  82. package/dist/cjs/index.js +52 -52
  83. package/dist/cjs/index10.js +6 -6
  84. package/dist/cjs/index12.js +1 -1
  85. package/dist/cjs/index13.js +52 -52
  86. package/dist/cjs/index17.js +2 -2
  87. package/dist/cjs/index19.js +1 -1
  88. package/dist/cjs/index2.js +21 -21
  89. package/dist/cjs/index21.js +8 -7
  90. package/dist/cjs/index21.js.map +1 -1
  91. package/dist/cjs/index27.js +2 -2
  92. package/dist/cjs/index29.js +1 -1
  93. package/dist/cjs/index3.js +2 -2
  94. package/dist/cjs/index30.js +1 -2
  95. package/dist/cjs/index30.js.map +1 -1
  96. package/dist/cjs/index33.js +3 -3
  97. package/dist/cjs/index37.js +13 -13
  98. package/dist/cjs/index38.js +5 -4
  99. package/dist/cjs/index38.js.map +1 -1
  100. package/dist/cjs/index39.js +6 -5
  101. package/dist/cjs/index39.js.map +1 -1
  102. package/dist/cjs/index4.js +19 -19
  103. package/dist/cjs/index40.js +9 -9
  104. package/dist/cjs/index41.js +2 -1
  105. package/dist/cjs/index41.js.map +1 -1
  106. package/dist/cjs/index44.js +2 -2
  107. package/dist/cjs/index6.js +7 -6
  108. package/dist/cjs/index6.js.map +1 -1
  109. package/dist/cjs/notifications-56c6fc94.js.map +1 -1
  110. package/dist/cjs/types-8eab1382.js.map +1 -1
  111. package/dist/cjs/types-e4d9a257.js.map +1 -1
  112. package/dist/cjs/{types.esm-c33cbec2.js → types.esm-41aaa0d4.js} +50 -40
  113. package/dist/cjs/types.esm-41aaa0d4.js.map +1 -0
  114. package/dist/esm/{AchievementCard-1d5d1b61.js → AchievementCard-017092a3.js} +4 -4
  115. package/dist/esm/{AchievementCard-1d5d1b61.js.map → AchievementCard-017092a3.js.map} +1 -1
  116. package/dist/esm/{BoostGenericCard-de8e2a84.js → BoostGenericCard-f5200b85.js} +4 -4
  117. package/dist/esm/BoostGenericCard-f5200b85.js.map +1 -0
  118. package/dist/esm/{BoostSmallCard-902844fc.js → BoostSmallCard-7180158e.js} +6 -6
  119. package/dist/esm/BoostSmallCard-7180158e.js.map +1 -0
  120. package/dist/esm/Button-5f805204.js.map +1 -1
  121. package/dist/esm/{CertificateDisplayCard-b69fd06f.js → CertificateDisplayCard-7fbe6404.js} +31 -19
  122. package/dist/{cjs/CertificateDisplayCard-11ebf814.js.map → esm/CertificateDisplayCard-7fbe6404.js.map} +1 -1
  123. package/dist/esm/Checkmark-d8b8f43d.js.map +1 -1
  124. package/dist/esm/CircleCheckButton-5a97f071.js.map +1 -1
  125. package/dist/esm/CircleIcon-4200733b.js.map +1 -1
  126. package/dist/esm/CircleSpinner-9b8b1a6b.js.map +1 -1
  127. package/dist/esm/Coins-ed119ec6.js.map +1 -1
  128. package/dist/esm/CourseCard-663ff174.js.map +1 -1
  129. package/dist/esm/{CourseVerticalCard-6b11b2a1.js → CourseVerticalCard-130b0d91.js} +3 -3
  130. package/dist/esm/{CourseVerticalCard-6b11b2a1.js.map → CourseVerticalCard-130b0d91.js.map} +1 -1
  131. package/dist/esm/FlippyCard-a2de5cf1.js.map +1 -1
  132. package/dist/esm/GenericArrow-0dba1707.js.map +1 -1
  133. package/dist/esm/{GenericCard-7b21d3e2.js → GenericCard-fe56887c.js} +4 -5
  134. package/dist/esm/GenericCard-fe56887c.js.map +1 -0
  135. package/dist/esm/JobHistoryCard-80d4ef27.js.map +1 -1
  136. package/dist/esm/JobListCard-1299ff04.js.map +1 -1
  137. package/dist/esm/LearnCardCreditCardBackFace-9baa9e6b.js.map +1 -1
  138. package/dist/esm/{LearnCardCreditCardFrontFace-f61b789c.js → LearnCardCreditCardFrontFace-d50efb25.js} +2 -2
  139. package/dist/esm/{LearnCardCreditCardFrontFace-f61b789c.js.map → LearnCardCreditCardFrontFace-d50efb25.js.map} +1 -1
  140. package/dist/esm/LearnPill-b8885ed1.js.map +1 -1
  141. package/dist/esm/{Lightbox-a1aab9ea.js → Lightbox-883afe8f.js} +22 -19
  142. package/dist/esm/{Lightbox-a1aab9ea.js.map → Lightbox-883afe8f.js.map} +1 -1
  143. package/dist/esm/Lightbulb-b6eca510.js.map +1 -1
  144. package/dist/esm/{MeritBadgeDisplayCard-575a61ed.js → MeritBadgeDisplayCard-ec9d5238.js} +102 -76
  145. package/dist/esm/MeritBadgeDisplayCard-ec9d5238.js.map +1 -0
  146. package/dist/esm/{MeritBadgeSkillsCount-8f371ab1.js → MeritBadgeSkillsCount-1694dc2c.js} +10 -4
  147. package/dist/esm/{MeritBadgeSkillsCount-8f371ab1.js.map → MeritBadgeSkillsCount-1694dc2c.js.map} +1 -1
  148. package/dist/esm/MiniVCThumbnail-6a07e810.js.map +1 -1
  149. package/dist/esm/Notification-95d159d2.js.map +1 -1
  150. package/dist/esm/NotificationBoostCard-e614c341.js.map +1 -1
  151. package/dist/esm/NotificationUserAcceptedBoostCard-8c13bd3f.js.map +1 -1
  152. package/dist/esm/NotificationUserCard-dbcc80f9.js.map +1 -1
  153. package/dist/esm/PuzzlePiece-1fb12c2e.js.map +1 -1
  154. package/dist/esm/{QRCodeCard-79d4d253.js → QRCodeCard-aa2b9967.js} +2 -2
  155. package/dist/esm/{QRCodeCard-79d4d253.js.map → QRCodeCard-aa2b9967.js.map} +1 -1
  156. package/dist/esm/QRCodeIcon-e9569804.js.map +1 -1
  157. package/dist/esm/RoundedPill-6a6e8aaf.js.map +1 -1
  158. package/dist/esm/{SchoolIDCard-01422d53.js → SchoolIDCard-5abd1bd9.js} +1205 -9
  159. package/dist/esm/SchoolIDCard-5abd1bd9.js.map +1 -0
  160. package/dist/esm/{SkillTabCard-8177895b.js → SkillTabCard-cfe117a2.js} +2 -2
  161. package/dist/esm/{SkillTabCard-8177895b.js.map → SkillTabCard-cfe117a2.js.map} +1 -1
  162. package/dist/esm/SkillVerticalCard-108f49bb.js.map +1 -1
  163. package/dist/esm/SkillsCard-92a51db2.js.map +1 -1
  164. package/dist/esm/SkillsStatsCard-1628fe9c.js.map +1 -1
  165. package/dist/esm/SmallAchievementCard-d0220751.js.map +1 -1
  166. package/dist/esm/Trophy-ad67f46a.js.map +1 -1
  167. package/dist/esm/User-161c7f37.js.map +1 -1
  168. package/dist/esm/{VCCard-6c8c3ff1.js → VCCard-85d16242.js} +4 -18
  169. package/dist/{cjs/VCCard-cf3590eb.js.map → esm/VCCard-85d16242.js.map} +1 -1
  170. package/dist/esm/{VCDisplayBackFace-c618851f.js → VCDisplayBackFace-e5f8f858.js} +3 -3
  171. package/dist/esm/{VCDisplayBackFace-c618851f.js.map → VCDisplayBackFace-e5f8f858.js.map} +1 -1
  172. package/dist/esm/{VCDisplayCard-fb298063.js → VCDisplayCard-edcd787f.js} +3 -3
  173. package/dist/esm/{VCDisplayCard-fb298063.js.map → VCDisplayCard-edcd787f.js.map} +1 -1
  174. package/dist/esm/{VCDisplayCard2-06c93532.js → VCDisplayCard2-599e7a65.js} +67 -48
  175. package/dist/{cjs/VCDisplayCard2-19613b61.js.map → esm/VCDisplayCard2-599e7a65.js.map} +1 -1
  176. package/dist/esm/VCThumbnail-3c254bda.js.map +1 -1
  177. package/dist/esm/VCVerificationCheck-80249524.js.map +1 -1
  178. package/dist/esm/{VCVerificationPill-dc9dda81.js → VCVerificationPill-43167fd5.js} +2 -2
  179. package/dist/esm/{VCVerificationPill-dc9dda81.js.map → VCVerificationPill-43167fd5.js.map} +1 -1
  180. package/dist/esm/{VerifierStateBadgeAndText-86214479.js → VerifierStateBadgeAndText-b042bf32.js} +19 -9
  181. package/dist/esm/VerifierStateBadgeAndText-b042bf32.js.map +1 -0
  182. package/dist/esm/constants-a7601fa8.js.map +1 -1
  183. package/dist/esm/{credential.helpers-cdc2f4a3.js → credential.helpers-a5b16a5e.js} +820 -1242
  184. package/dist/esm/credential.helpers-a5b16a5e.js.map +1 -0
  185. package/dist/esm/icons-03afd795.js.map +1 -1
  186. package/dist/esm/index-28917993.js.map +1 -1
  187. package/dist/esm/{index-dff96076.js → index-2ef835bd.js} +17 -21
  188. package/dist/esm/index-2ef835bd.js.map +1 -0
  189. package/dist/esm/index-5d5219f7.js.map +1 -1
  190. package/dist/esm/index-705f3821.js +2438 -0
  191. package/dist/esm/index-705f3821.js.map +1 -0
  192. package/dist/esm/index.js +42 -42
  193. package/dist/esm/index10.js +6 -6
  194. package/dist/esm/index12.js +1 -1
  195. package/dist/esm/index13.js +42 -42
  196. package/dist/esm/index17.js +2 -2
  197. package/dist/esm/index19.js +1 -1
  198. package/dist/esm/index2.js +21 -21
  199. package/dist/esm/index21.js +8 -7
  200. package/dist/esm/index21.js.map +1 -1
  201. package/dist/esm/index27.js +2 -2
  202. package/dist/esm/index3.js +2 -2
  203. package/dist/esm/index30.js +1 -2
  204. package/dist/esm/index30.js.map +1 -1
  205. package/dist/esm/index33.js +3 -3
  206. package/dist/esm/index37.js +13 -13
  207. package/dist/esm/index38.js +5 -4
  208. package/dist/esm/index38.js.map +1 -1
  209. package/dist/esm/index39.js +6 -5
  210. package/dist/esm/index39.js.map +1 -1
  211. package/dist/esm/index4.js +19 -19
  212. package/dist/esm/index40.js +9 -9
  213. package/dist/esm/index41.js +2 -1
  214. package/dist/esm/index41.js.map +1 -1
  215. package/dist/esm/index44.js +2 -2
  216. package/dist/esm/index6.js +7 -6
  217. package/dist/esm/index6.js.map +1 -1
  218. package/dist/esm/notifications-009bbd80.js.map +1 -1
  219. package/dist/esm/types-b32d28d5.js.map +1 -1
  220. package/dist/esm/types-cfde3c2b.js.map +1 -1
  221. package/dist/esm/{types.esm-4ec5392e.js → types.esm-3a1994d5.js} +50 -40
  222. package/dist/esm/types.esm-3a1994d5.js.map +1 -0
  223. package/dist/main.css +1 -1
  224. package/dist/main.js +1 -1
  225. package/package.json +3 -3
  226. package/dist/cjs/BoostGenericCard-e540e459.js.map +0 -1
  227. package/dist/cjs/BoostSmallCard-9dc75a95.js.map +0 -1
  228. package/dist/cjs/GenericCard-46248807.js.map +0 -1
  229. package/dist/cjs/MeritBadgeDisplayCard-70930ef2.js.map +0 -1
  230. package/dist/cjs/SchoolIDCard-c7b4153a.js.map +0 -1
  231. package/dist/cjs/VerifierStateBadgeAndText-fd0bd814.js.map +0 -1
  232. package/dist/cjs/credential.helpers-afb94f02.js.map +0 -1
  233. package/dist/cjs/index-8082a131.js.map +0 -1
  234. package/dist/cjs/index-838fa72c.js +0 -1186
  235. package/dist/cjs/index-838fa72c.js.map +0 -1
  236. package/dist/cjs/types.esm-c33cbec2.js.map +0 -1
  237. package/dist/esm/BoostGenericCard-de8e2a84.js.map +0 -1
  238. package/dist/esm/BoostSmallCard-902844fc.js.map +0 -1
  239. package/dist/esm/GenericCard-7b21d3e2.js.map +0 -1
  240. package/dist/esm/MeritBadgeDisplayCard-575a61ed.js.map +0 -1
  241. package/dist/esm/SchoolIDCard-01422d53.js.map +0 -1
  242. package/dist/esm/VerifierStateBadgeAndText-86214479.js.map +0 -1
  243. package/dist/esm/credential.helpers-cdc2f4a3.js.map +0 -1
  244. package/dist/esm/index-4fa491c1.js +0 -1184
  245. package/dist/esm/index-4fa491c1.js.map +0 -1
  246. package/dist/esm/index-dff96076.js.map +0 -1
  247. package/dist/esm/types.esm-4ec5392e.js.map +0 -1
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
- import { V as VerificationStatusEnum } from './types.esm-4ec5392e.js';
2
+ import { r as requiredArgs, t as toDate, a as toInteger, _ as _typeof, g as getUTCWeekYear, b as getUTCISOWeekYear, c as getUTCWeek, d as getUTCISOWeek, e as getDefaultOptions } from './index-705f3821.js';
3
+ import { V as VerificationStatusEnum } from './types.esm-3a1994d5.js';
3
4
  import { a as LCCategoryEnum } from './index-28917993.js';
4
5
  import { P as PuzzlePiece } from './PuzzlePiece-1fb12c2e.js';
5
6
  import { U as User, B as Briefcase, G as Graduation } from './User-161c7f37.js';
@@ -83,7 +84,7 @@ const KeyIcon = ({
83
84
  }));
84
85
  };
85
86
 
86
- const ScoutsPledge = ({ className = "" }) => {
87
+ const ScoutsLogo = ({ className = "" }) => {
87
88
  return /* @__PURE__ */ React.createElement("svg", {
88
89
  width: "25",
89
90
  height: "25",
@@ -91,17 +92,25 @@ const ScoutsPledge = ({ className = "" }) => {
91
92
  fill: "none",
92
93
  xmlns: "http://www.w3.org/2000/svg",
93
94
  className
95
+ }, /* @__PURE__ */ React.createElement("g", {
96
+ clipPath: "url(#clip0_10755_290528)"
94
97
  }, /* @__PURE__ */ React.createElement("path", {
95
- fillRule: "evenodd",
96
- clipRule: "evenodd",
97
- d: "M17.5604 12.618V11.7H23.0429L21.0066 15.2632L23.0429 18.8264H18.2005C18.2034 18.7567 18.211 18.6882 18.211 18.6177V13.9435C18.211 13.4182 17.9662 12.9336 17.5604 12.618ZM13.4046 22.5045H11.5755C9.80421 22.5045 8.25688 21.3068 7.81298 19.5921L7.09022 16.8018C6.96332 16.2947 7.04862 15.7731 7.33046 15.3329C7.61252 14.8924 8.05044 14.5963 8.56422 14.4991L12.7964 13.6986C13.0331 13.654 13.2729 13.7053 13.4704 13.843C13.6681 13.9812 13.7989 14.1881 13.8387 14.4258C13.9152 14.8851 13.6203 15.329 13.1676 15.4368L10.3741 16.1018C10.1072 16.1653 9.88628 16.3439 9.76836 16.5917C9.6502 16.8398 9.65044 17.1239 9.77388 17.3807L10.4031 18.6195L11.2231 18.2027L10.8424 17.4538C11.8125 17.7464 12.5212 18.6473 12.5212 19.7117H13.4407C13.4407 18.4119 12.6787 17.2899 11.5796 16.76L13.3803 16.3313C14.143 16.1499 14.6837 15.4991 14.7593 14.7506C15.0395 15.1437 15.4982 15.4016 16.0166 15.4016C16.5458 15.4016 17.0131 15.1338 17.2915 14.7269V18.6177C17.2915 20.7609 15.5478 22.5045 13.4046 22.5045ZM1.8689 18.8264L3.9052 15.2632L1.8689 11.7H7.53458V13.9104C7.14263 14.1315 6.80701 14.4448 6.55598 14.837C6.13644 15.4926 6.00932 16.2697 6.19898 17.0285L6.66472 18.8264H1.8689ZM9.15066 5.64449C9.53479 5.64449 9.84721 5.92471 9.84721 6.26884V11.6895H10.7667V4.96792C10.7667 4.62379 11.0794 4.34358 11.4635 4.34358C11.8474 4.34358 12.1601 4.62379 12.1601 4.96792V11.6895H13.0796V6.70262C13.0796 6.35849 13.392 6.07827 13.7761 6.07827C14.1605 6.07827 14.4729 6.35849 14.4729 6.70262V11.2516L14.4727 11.2561V13.5789C14.3483 13.3894 14.1885 13.223 13.9968 13.0892C13.5945 12.8083 13.1076 12.7037 12.6253 12.7952L8.45411 13.5842V6.26884C8.45411 5.92471 8.76653 5.64449 9.15066 5.64449ZM16.0166 10.6316C16.3607 10.6316 16.6409 10.9115 16.6409 11.2561V13.8577C16.6409 14.2018 16.3607 14.4821 16.0166 14.4821C15.6724 14.4821 15.3922 14.2018 15.3922 13.8577V11.4727L15.3924 11.2539C15.3938 10.9104 15.6731 10.6316 16.0166 10.6316ZM22.0659 15.2632L24.6273 10.7805H17.4848C17.2837 10.1612 16.7021 9.71203 16.0166 9.71203C15.7945 9.71203 15.5835 9.76007 15.3924 9.8449V6.70262C15.3924 5.85137 14.6674 5.15874 13.7761 5.15874C13.5265 5.15874 13.2909 5.21461 13.0796 5.31162V4.96792C13.0796 4.11667 12.3545 3.42405 11.4635 3.42405C10.6033 3.42405 9.90008 4.06978 9.85204 4.88012C9.63939 4.78173 9.40215 4.72496 9.15066 4.72496C8.2594 4.72496 7.53458 5.41759 7.53458 6.26884V10.7805H0.284553L2.8459 15.2632L0.284553 19.7459H6.90263L6.92263 19.8225C7.47159 21.9431 9.38513 23.424 11.5755 23.424H13.4046C15.6658 23.424 17.5621 21.8528 18.0717 19.7459H24.6273L22.0659 15.2632Z",
98
- fill: "currentColor"
98
+ d: "M24 13.3477C24 19.6989 18.8513 24.8477 12.5 24.8477C6.14873 24.8477 1 19.6989 1 13.3477C1 6.99638 6.14873 1.84766 12.5 1.84766C18.8513 1.84766 24 6.99638 24 13.3477Z",
99
+ fill: "white"
99
100
  }), /* @__PURE__ */ React.createElement("path", {
100
- fillRule: "evenodd",
101
- clipRule: "evenodd",
102
- d: "M9.73278 4.68252C9.87496 3.88823 10.5979 3.28516 11.4635 3.28516C12.4298 3.28516 13.2216 4.03687 13.2216 4.96792V5.10711C13.3957 5.05094 13.582 5.01985 13.7761 5.01985C14.7426 5.01985 15.5344 5.77156 15.5344 6.70262V9.64403C15.6871 9.59816 15.8489 9.57314 16.0166 9.57314C16.7312 9.57314 17.3396 10.0184 17.5853 10.6416H24.6273C24.6776 10.6416 24.7242 10.6677 24.7497 10.7102C24.7752 10.7527 24.7758 10.8053 24.7512 10.8483L22.2286 15.2632L24.7512 19.6782C24.7758 19.7212 24.7752 19.7737 24.7497 19.8162C24.7242 19.8587 24.6776 19.8848 24.6273 19.8848H18.1827C17.6214 21.9968 15.6969 23.5629 13.4046 23.5629H11.5755C9.328 23.5629 7.36647 22.0502 6.7924 19.8848H0.284553C0.234183 19.8848 0.187583 19.8587 0.162096 19.8162C0.136608 19.7737 0.136048 19.7212 0.160624 19.6782L2.68325 15.2632L0.160624 10.8483C0.136048 10.8053 0.136608 10.7527 0.162096 10.7102C0.187583 10.6677 0.234183 10.6416 0.284553 10.6416H7.3926V6.26884C7.3926 5.3378 8.18418 4.58607 9.15066 4.58607C9.35509 4.58607 9.55075 4.62058 9.73278 4.68252ZM11.4635 3.56293C10.6764 3.56293 10.0373 4.15337 9.99377 4.88816C9.99104 4.93425 9.96507 4.976 9.92448 4.99956C9.8839 5.02312 9.834 5.02541 9.79133 5.00567C9.59662 4.91558 9.38002 4.86385 9.15066 4.86385C8.33463 4.86385 7.67655 5.49737 7.67655 6.26884V10.7805C7.67655 10.8572 7.61299 10.9194 7.53458 10.9194H0.526562L2.96983 15.1955C2.99389 15.2376 2.99389 15.2889 2.96983 15.331L0.526562 19.607H6.90263C6.96749 19.607 7.02411 19.65 7.04018 19.7115L7.06027 19.7884C7.59374 21.8492 9.45202 23.2852 11.5755 23.2852H13.4046C15.5961 23.2852 17.4381 21.7619 17.9335 19.7139C17.9487 19.6513 18.0059 19.607 18.0717 19.607H24.3853L21.942 15.331C21.9179 15.2889 21.9179 15.2376 21.942 15.1955L24.3853 10.9194H17.4848C17.423 10.9194 17.3682 10.8802 17.3495 10.8226C17.1659 10.2573 16.6365 9.85092 16.0166 9.85092C15.8157 9.85092 15.6246 9.89434 15.4511 9.97137C15.4072 9.99088 15.3561 9.98722 15.3155 9.96165C15.275 9.93609 15.2504 9.89211 15.2504 9.8449V6.70262C15.2504 5.93117 14.5922 5.29763 13.7761 5.29763C13.5484 5.29763 13.3333 5.34855 13.1399 5.43735C13.0959 5.45754 13.0445 5.45434 13.0035 5.42886C12.9625 5.40337 12.9376 5.35915 12.9376 5.31162V4.96792C12.9376 4.19646 12.2793 3.56293 11.4635 3.56293ZM11.4635 4.48246C11.1458 4.48246 10.9087 4.71171 10.9087 4.96792V11.6895C10.9087 11.7662 10.8451 11.8283 10.7667 11.8283H9.84721C9.7688 11.8283 9.70523 11.7662 9.70523 11.6895V6.26884C9.70523 6.01257 9.4683 5.78338 9.15066 5.78338C8.83302 5.78338 8.59608 6.01257 8.59608 6.26884V13.4159L12.5983 12.6589C12.5983 12.6589 12.5983 12.6589 12.5983 12.6589C13.1191 12.5601 13.6456 12.6733 14.0793 12.9762C14.0793 12.9762 14.0793 12.9762 14.0793 12.9762C14.1698 13.0393 14.2537 13.1093 14.3307 13.185V13.5789H14.4727L14.5921 13.5038C14.5169 13.3892 14.4295 13.2823 14.3307 13.185V11.2561C14.3307 11.2539 14.3307 11.2517 14.3309 11.2495L14.3309 11.2482V11.2516H14.4729L14.3311 11.2449L14.3309 11.2482V6.70262C14.3309 6.44638 14.094 6.21716 13.7761 6.21716C13.4585 6.21716 13.2216 6.44634 13.2216 6.70262V11.6895C13.2216 11.7662 13.158 11.8283 13.0796 11.8283H12.1601C12.0817 11.8283 12.0181 11.7662 12.0181 11.6895V4.96792C12.0181 4.71168 11.781 4.48246 11.4635 4.48246ZM10.6248 4.96792C10.6248 4.53587 11.0129 4.20469 11.4635 4.20469C11.9139 4.20469 12.302 4.5359 12.302 4.96792V11.5506H12.9376V6.70262C12.9376 6.27063 13.3255 5.93938 13.7761 5.93938C14.2269 5.93938 14.6149 6.27059 14.6149 6.70262V11.2516C14.6149 11.2538 14.6148 11.256 14.6147 11.2582L14.6146 11.2595V13.5789C14.6146 13.6405 14.5731 13.6948 14.5126 13.7121C14.4522 13.7295 14.3873 13.7058 14.3532 13.6539C14.2383 13.479 14.091 13.3255 13.9144 13.2023C13.5435 12.9433 13.0961 12.8474 12.6524 12.9316L8.48106 13.7205C8.43945 13.7284 8.39643 13.7177 8.36375 13.6913C8.33106 13.6649 8.31213 13.6256 8.31213 13.5842V6.26884C8.31213 5.83684 8.70003 5.5056 9.15066 5.5056C9.60129 5.5056 9.98918 5.83684 9.98918 6.26884V11.5506H10.6248V4.96792ZM15.5344 11.2544C15.5344 11.2543 15.5344 11.2545 15.5344 11.2544L15.5342 11.4727V13.8577C15.5342 14.128 15.7538 14.3432 16.0166 14.3432C16.2794 14.3432 16.4989 14.128 16.4989 13.8577V11.2561C16.4989 10.9853 16.2794 10.7704 16.0166 10.7704C15.7545 10.7704 15.5356 10.9845 15.5344 11.2544ZM15.2504 11.2533C15.2521 10.8364 15.5918 10.4927 16.0166 10.4927C16.442 10.4927 16.7829 10.8377 16.7829 11.2561V13.8577C16.7829 14.2757 16.4421 14.621 16.0166 14.621C15.5911 14.621 15.2502 14.2757 15.2502 13.8577V11.4727L15.2504 11.2537L15.2504 11.2533ZM1.74644 11.6298C1.77192 11.5873 1.81852 11.5612 1.8689 11.5612H7.53458C7.61299 11.5612 7.67655 11.6233 7.67655 11.7V13.9104C7.67655 13.96 7.64947 14.0059 7.60551 14.0307C7.23369 14.2405 6.91503 14.5378 6.67632 14.9107C6.2774 15.5341 6.15633 16.2724 6.33674 16.9949C6.33679 16.9951 6.33684 16.9953 6.33689 16.9955L6.80234 18.7923C6.8131 18.8338 6.80366 18.8779 6.77676 18.9117C6.74986 18.9455 6.70852 18.9653 6.66472 18.9653H1.8689C1.81852 18.9653 1.77192 18.9392 1.74644 18.8967C1.72095 18.8542 1.72039 18.8016 1.74497 18.7586L3.74255 15.2632L1.74497 11.7678C1.72039 11.7248 1.72095 11.6723 1.74644 11.6298ZM2.11093 11.8389L4.02913 15.1954C4.05319 15.2376 4.05319 15.2889 4.02913 15.331L2.11092 18.6875H6.48228L6.06135 17.0626L6.06106 17.0615C5.86238 16.2665 5.99559 15.451 6.43564 14.7633C6.68372 14.3757 7.011 14.061 7.3926 13.8314V11.8389H2.11093ZM17.4185 11.7C17.4185 11.6233 17.482 11.5612 17.5604 11.5612H23.0429C23.0933 11.5612 23.1399 11.5873 23.1654 11.6298C23.1909 11.6723 23.1914 11.7248 23.1668 11.7678L21.1693 15.2632L23.1668 18.7586C23.1914 18.8016 23.1909 18.8542 23.1654 18.8967C23.1399 18.9392 23.0933 18.9653 23.0429 18.9653H18.2005C18.1618 18.9653 18.1248 18.9498 18.098 18.9225C18.0712 18.8952 18.057 18.8584 18.0586 18.8206C18.0601 18.7865 18.0621 18.7579 18.0639 18.7314C18.0666 18.6928 18.069 18.6585 18.069 18.6177V13.9435C18.069 13.4608 17.8442 13.0161 17.4721 12.7267C17.4382 12.7003 17.4185 12.6603 17.4185 12.618V11.7ZM17.7024 11.8389V12.5526C18.1097 12.8945 18.353 13.3991 18.353 13.9435V18.6177C18.353 18.64 18.3522 18.6638 18.351 18.6875H22.8009L20.8827 15.331C20.8586 15.2889 20.8586 15.2376 20.8827 15.1954L22.8009 11.8389H17.7024ZM12.8233 13.835C13.0217 13.7977 13.222 13.8404 13.388 13.9561L12.8233 13.835ZM12.8233 13.835L8.59119 14.6355C8.59118 14.6355 8.5912 14.6355 8.59119 14.6355C8.11675 14.7253 7.71232 14.9982 7.45077 15.4066C7.18952 15.8147 7.11036 16.2975 7.22799 16.7683C7.22803 16.7684 7.22808 16.7686 7.22812 16.7688L7.95061 19.558C8.37903 21.2129 9.8711 22.3656 11.5755 22.3656H13.4046C15.4665 22.3656 17.1495 20.6871 17.1495 18.6177V15.1024C16.8506 15.3739 16.4533 15.5405 16.0166 15.5405C15.5609 15.5405 15.1485 15.3585 14.8457 15.0657C14.6674 15.7386 14.1336 16.295 13.4139 16.4662C13.4138 16.4662 13.4139 16.4662 13.4139 16.4662L11.963 16.8116C12.9342 17.4148 13.5827 18.488 13.5827 19.7117C13.5827 19.7884 13.5191 19.8506 13.4407 19.8506H12.5212C12.4428 19.8506 12.3792 19.7884 12.3792 19.7117C12.3792 18.8361 11.8704 18.0793 11.1353 17.7182L11.3502 18.1409C11.3847 18.2087 11.3572 18.291 11.2885 18.326L10.4685 18.7427C10.4347 18.7599 10.3953 18.7631 10.359 18.7515C10.3228 18.74 10.2929 18.7147 10.2759 18.6813L9.64538 17.4398C9.50433 17.1464 9.50341 16.8191 9.63964 16.5331C9.77542 16.2478 10.0309 16.0405 10.3405 15.9669C10.3405 15.9669 10.3405 15.9669 10.3405 15.9669L13.134 15.3018C13.5123 15.2117 13.7635 14.8381 13.6985 14.4481C13.6648 14.2465 13.5544 14.0725 13.388 13.9561M12.7695 13.5622C13.0446 13.5104 13.3239 13.5703 13.5528 13.7299C13.7817 13.8899 13.933 14.1297 13.9788 14.4033C14.0669 14.932 13.7282 15.4462 13.2012 15.5717L10.4077 16.2368C10.1835 16.2901 9.99714 16.4401 9.89707 16.6503C9.79721 16.86 9.79653 17.1005 9.90172 17.3202L10.4659 18.431L11.0338 18.1424L10.7152 17.5156C10.69 17.4659 10.6974 17.4062 10.7342 17.3639C10.7709 17.3215 10.8299 17.3047 10.8842 17.3211C11.871 17.6187 12.6006 18.5083 12.6593 19.5728H13.2957C13.2437 18.3866 12.5293 17.3727 11.5168 16.8846C11.4633 16.8587 11.432 16.8029 11.4385 16.7448C11.445 16.6867 11.488 16.6388 11.546 16.625L13.3467 16.1963C14.0473 16.0297 14.548 15.4303 14.618 14.7369C14.6239 14.6791 14.666 14.6309 14.7235 14.6162C14.781 14.6015 14.8418 14.6234 14.8758 14.6711C15.1314 15.0297 15.5478 15.2627 16.0166 15.2627C16.4953 15.2627 16.9197 15.0206 17.1735 14.6496C17.2083 14.5988 17.2729 14.5762 17.3327 14.594C17.3926 14.6118 17.4335 14.6657 17.4335 14.7269V18.6177C17.4335 20.8347 15.6292 22.6434 13.4046 22.6434H11.5755C9.73731 22.6434 8.13473 21.4007 7.67535 19.6262L6.95259 16.8359L6.95232 16.8348C6.81635 16.2915 6.90782 15.7314 7.21013 15.2591C7.51271 14.7867 7.98412 14.4674 8.53726 14.3627L12.7695 13.5622Z",
103
- fill: "currentColor"
104
- }));
101
+ d: "M12.1426 14.0634C12.1426 14.7372 12.1426 15.3402 12.149 15.8818H12.8519C12.8583 15.3402 12.8583 14.7405 12.8583 14.0634C12.8583 10.0042 12.7874 7.33138 12.5005 5.98047C12.2135 7.33461 12.1426 10.0042 12.1426 14.0634Z",
102
+ fill: "#622599"
103
+ }), /* @__PURE__ */ React.createElement("path", {
104
+ d: "M12.5 0.847656C5.59711 0.847656 0 6.44477 0 13.3477C0 20.2505 5.59711 25.8477 12.5 25.8477C19.4029 25.8477 25 20.2505 25 13.3477C25 6.44477 19.4029 0.847656 12.5 0.847656ZM8.47305 20.0539C7.40908 20.0539 6.88354 19.1318 7.17049 18.3547C7.57996 18.6256 8.04101 18.7352 8.48272 18.6159C9.03082 18.4644 9.41772 18.0033 9.59827 17.3972H10.5043C10.2592 19.222 9.39193 20.0539 8.46982 20.0539M12.5 22.7557C11.033 22.0206 9.97872 20.7761 9.97872 20.7761C10.7364 19.8153 11.1297 18.7384 11.2619 17.394H12.1744C12.2195 19.1318 12.3194 20.07 12.5 21.0179C12.6838 20.0732 12.7805 19.1318 12.8256 17.394H13.7381C13.8703 18.7384 14.2636 19.8153 15.0213 20.7761C15.0213 20.7761 13.9638 22.0206 12.5 22.7557ZM16.527 20.0539C15.6081 20.0539 14.7376 19.222 14.4925 17.3972H15.3985C15.5823 18.0033 15.966 18.4644 16.5141 18.6159C16.959 18.7384 17.42 18.6288 17.8263 18.3547C18.1132 19.1318 17.5877 20.0539 16.5237 20.0539M18.8483 16.4106C19.4255 15.2563 18.9257 14.0731 17.7973 13.8474C16.801 13.6507 15.6403 14.3439 15.3437 15.8786H16.2884C16.3819 16.0011 16.4431 16.1527 16.4431 16.3235C16.4431 16.4944 16.3819 16.646 16.2884 16.7685H8.71486C8.61491 16.6395 8.56332 16.4847 8.5601 16.3235C8.5601 16.1527 8.62136 16.0011 8.71486 15.8786H9.65953C9.36291 14.3439 8.20222 13.6507 7.20596 13.8474C6.07751 14.0731 5.57777 15.2531 6.15489 16.4106C4.60085 16.2397 3.39502 14.9339 3.39502 13.3477C3.39502 11.6453 4.78463 10.2654 6.49665 10.2654C8.87606 10.2654 10.4333 12.8253 10.5655 15.8786H11.3103C11.1878 12.3578 9.29843 10.9844 9.29843 8.65008C9.29843 6.12235 11.8971 3.84611 12.5 3.24642C13.1029 3.84288 15.7016 6.12235 15.7016 8.65008C15.7016 10.9876 13.8154 12.3578 13.6897 15.8786H14.4345C14.5699 12.8253 16.1239 10.2654 18.5034 10.2654C20.2186 10.2654 21.605 11.6453 21.605 13.3477C21.605 14.9339 20.3959 16.2397 18.8451 16.4106",
105
+ fill: "#622599"
106
+ })), /* @__PURE__ */ React.createElement("defs", null, /* @__PURE__ */ React.createElement("clipPath", {
107
+ id: "clip0_10755_290528"
108
+ }, /* @__PURE__ */ React.createElement("rect", {
109
+ width: "25",
110
+ height: "25",
111
+ fill: "white",
112
+ transform: "translate(0 0.847656)"
113
+ }))));
105
114
  };
106
115
 
107
116
  const SocialBadgesIcon = ({
@@ -136,78 +145,6 @@ const SocialBadgesIcon = ({
136
145
  }));
137
146
  };
138
147
 
139
- function toInteger(dirtyNumber) {
140
- if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
141
- return NaN;
142
- }
143
-
144
- var number = Number(dirtyNumber);
145
-
146
- if (isNaN(number)) {
147
- return number;
148
- }
149
-
150
- return number < 0 ? Math.ceil(number) : Math.floor(number);
151
- }
152
-
153
- function requiredArgs(required, args) {
154
- if (args.length < required) {
155
- throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
156
- }
157
- }
158
-
159
- /**
160
- * @name toDate
161
- * @category Common Helpers
162
- * @summary Convert the given argument to an instance of Date.
163
- *
164
- * @description
165
- * Convert the given argument to an instance of Date.
166
- *
167
- * If the argument is an instance of Date, the function returns its clone.
168
- *
169
- * If the argument is a number, it is treated as a timestamp.
170
- *
171
- * If the argument is none of the above, the function returns Invalid Date.
172
- *
173
- * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
174
- *
175
- * @param {Date|Number} argument - the value to convert
176
- * @returns {Date} the parsed date in the local time zone
177
- * @throws {TypeError} 1 argument required
178
- *
179
- * @example
180
- * // Clone the date:
181
- * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
182
- * //=> Tue Feb 11 2014 11:30:30
183
- *
184
- * @example
185
- * // Convert the timestamp to date:
186
- * const result = toDate(1392098430000)
187
- * //=> Tue Feb 11 2014 11:30:30
188
- */
189
-
190
- function toDate(argument) {
191
- requiredArgs(1, arguments);
192
- var argStr = Object.prototype.toString.call(argument); // Clone the date
193
-
194
- if (argument instanceof Date || typeof argument === 'object' && argStr === '[object Date]') {
195
- // Prevent the date to lose the milliseconds when passed to new Date() in IE10
196
- return new Date(argument.getTime());
197
- } else if (typeof argument === 'number' || argStr === '[object Number]') {
198
- return new Date(argument);
199
- } else {
200
- if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
201
- // eslint-disable-next-line no-console
202
- 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://git.io/fjule"); // eslint-disable-next-line no-console
203
-
204
- console.warn(new Error().stack);
205
- }
206
-
207
- return new Date(NaN);
208
- }
209
- }
210
-
211
148
  /**
212
149
  * @name addMilliseconds
213
150
  * @category Millisecond Helpers
@@ -216,10 +153,6 @@ function toDate(argument) {
216
153
  * @description
217
154
  * Add the specified number of milliseconds to the given date.
218
155
  *
219
- * ### v2.0.0 breaking changes:
220
- *
221
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
222
- *
223
156
  * @param {Date|Number} date - the date to be changed
224
157
  * @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`.
225
158
  * @returns {Date} the new date with the milliseconds added
@@ -230,7 +163,6 @@ function toDate(argument) {
230
163
  * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
231
164
  * //=> Thu Jul 10 2014 12:45:30.750
232
165
  */
233
-
234
166
  function addMilliseconds(dirtyDate, dirtyAmount) {
235
167
  requiredArgs(2, arguments);
236
168
  var timestamp = toDate(dirtyDate).getTime();
@@ -263,10 +195,6 @@ function getTimezoneOffsetInMilliseconds(date) {
263
195
  * @description
264
196
  * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
265
197
  *
266
- * ### v2.0.0 breaking changes:
267
- *
268
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
269
- *
270
198
  * @param {*} value - the value to check
271
199
  * @returns {boolean} true if the given value is a date
272
200
  * @throws {TypeError} 1 arguments required
@@ -291,10 +219,9 @@ function getTimezoneOffsetInMilliseconds(date) {
291
219
  * const result = isDate({})
292
220
  * //=> false
293
221
  */
294
-
295
222
  function isDate(value) {
296
223
  requiredArgs(1, arguments);
297
- return value instanceof Date || typeof value === 'object' && Object.prototype.toString.call(value) === '[object Date]';
224
+ return value instanceof Date || _typeof(value) === 'object' && Object.prototype.toString.call(value) === '[object Date]';
298
225
  }
299
226
 
300
227
  /**
@@ -309,32 +236,6 @@ function isDate(value) {
309
236
  *
310
237
  * Time value of Date: http://es5.github.io/#x15.9.1.1
311
238
  *
312
- * ### v2.0.0 breaking changes:
313
- *
314
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
315
- *
316
- * - Now `isValid` doesn't throw an exception
317
- * if the first argument is not an instance of Date.
318
- * Instead, argument is converted beforehand using `toDate`.
319
- *
320
- * Examples:
321
- *
322
- * | `isValid` argument | Before v2.0.0 | v2.0.0 onward |
323
- * |---------------------------|---------------|---------------|
324
- * | `new Date()` | `true` | `true` |
325
- * | `new Date('2016-01-01')` | `true` | `true` |
326
- * | `new Date('')` | `false` | `false` |
327
- * | `new Date(1488370835081)` | `true` | `true` |
328
- * | `new Date(NaN)` | `false` | `false` |
329
- * | `'2016-01-01'` | `TypeError` | `false` |
330
- * | `''` | `TypeError` | `false` |
331
- * | `1488370835081` | `TypeError` | `true` |
332
- * | `NaN` | `TypeError` | `false` |
333
- *
334
- * We introduce this change to make *date-fns* consistent with ECMAScript behavior
335
- * that try to coerce arguments to the expected type
336
- * (which is also the case with other *date-fns* functions).
337
- *
338
239
  * @param {*} date - the date to check
339
240
  * @returns {Boolean} the date is valid
340
241
  * @throws {TypeError} 1 argument required
@@ -354,811 +255,148 @@ function isDate(value) {
354
255
  * const result = isValid(new Date(''))
355
256
  * //=> false
356
257
  */
357
-
358
258
  function isValid(dirtyDate) {
359
259
  requiredArgs(1, arguments);
360
-
361
260
  if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {
362
261
  return false;
363
262
  }
364
-
365
263
  var date = toDate(dirtyDate);
366
264
  return !isNaN(Number(date));
367
265
  }
368
266
 
369
- var formatDistanceLocale = {
370
- lessThanXSeconds: {
371
- one: 'less than a second',
372
- other: 'less than {{count}} seconds'
373
- },
374
- xSeconds: {
375
- one: '1 second',
376
- other: '{{count}} seconds'
377
- },
378
- halfAMinute: 'half a minute',
379
- lessThanXMinutes: {
380
- one: 'less than a minute',
381
- other: 'less than {{count}} minutes'
382
- },
383
- xMinutes: {
384
- one: '1 minute',
385
- other: '{{count}} minutes'
386
- },
387
- aboutXHours: {
388
- one: 'about 1 hour',
389
- other: 'about {{count}} hours'
390
- },
391
- xHours: {
392
- one: '1 hour',
393
- other: '{{count}} hours'
394
- },
395
- xDays: {
396
- one: '1 day',
397
- other: '{{count}} days'
267
+ /**
268
+ * @name subMilliseconds
269
+ * @category Millisecond Helpers
270
+ * @summary Subtract the specified number of milliseconds from the given date.
271
+ *
272
+ * @description
273
+ * Subtract the specified number of milliseconds from the given date.
274
+ *
275
+ * @param {Date|Number} date - the date to be changed
276
+ * @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`.
277
+ * @returns {Date} the new date with the milliseconds subtracted
278
+ * @throws {TypeError} 2 arguments required
279
+ *
280
+ * @example
281
+ * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:
282
+ * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
283
+ * //=> Thu Jul 10 2014 12:45:29.250
284
+ */
285
+ function subMilliseconds(dirtyDate, dirtyAmount) {
286
+ requiredArgs(2, arguments);
287
+ var amount = toInteger(dirtyAmount);
288
+ return addMilliseconds(dirtyDate, -amount);
289
+ }
290
+
291
+ var MILLISECONDS_IN_DAY = 86400000;
292
+ function getUTCDayOfYear(dirtyDate) {
293
+ requiredArgs(1, arguments);
294
+ var date = toDate(dirtyDate);
295
+ var timestamp = date.getTime();
296
+ date.setUTCMonth(0, 1);
297
+ date.setUTCHours(0, 0, 0, 0);
298
+ var startOfYearTimestamp = date.getTime();
299
+ var difference = timestamp - startOfYearTimestamp;
300
+ return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
301
+ }
302
+
303
+ function addLeadingZeros(number, targetLength) {
304
+ var sign = number < 0 ? '-' : '';
305
+ var output = Math.abs(number).toString();
306
+ while (output.length < targetLength) {
307
+ output = '0' + output;
308
+ }
309
+ return sign + output;
310
+ }
311
+
312
+ /*
313
+ * | | Unit | | Unit |
314
+ * |-----|--------------------------------|-----|--------------------------------|
315
+ * | a | AM, PM | A* | |
316
+ * | d | Day of month | D | |
317
+ * | h | Hour [1-12] | H | Hour [0-23] |
318
+ * | m | Minute | M | Month |
319
+ * | s | Second | S | Fraction of second |
320
+ * | y | Year (abs) | Y | |
321
+ *
322
+ * Letters marked by * are not implemented but reserved by Unicode standard.
323
+ */
324
+ var formatters$1 = {
325
+ // Year
326
+ y: function y(date, token) {
327
+ // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
328
+ // | Year | y | yy | yyy | yyyy | yyyyy |
329
+ // |----------|-------|----|-------|-------|-------|
330
+ // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
331
+ // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
332
+ // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
333
+ // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
334
+ // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
335
+
336
+ var signedYear = date.getUTCFullYear();
337
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
338
+ var year = signedYear > 0 ? signedYear : 1 - signedYear;
339
+ return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
398
340
  },
399
- aboutXWeeks: {
400
- one: 'about 1 week',
401
- other: 'about {{count}} weeks'
341
+ // Month
342
+ M: function M(date, token) {
343
+ var month = date.getUTCMonth();
344
+ return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);
402
345
  },
403
- xWeeks: {
404
- one: '1 week',
405
- other: '{{count}} weeks'
346
+ // Day of the month
347
+ d: function d(date, token) {
348
+ return addLeadingZeros(date.getUTCDate(), token.length);
406
349
  },
407
- aboutXMonths: {
408
- one: 'about 1 month',
409
- other: 'about {{count}} months'
350
+ // AM or PM
351
+ a: function a(date, token) {
352
+ var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
353
+ switch (token) {
354
+ case 'a':
355
+ case 'aa':
356
+ return dayPeriodEnumValue.toUpperCase();
357
+ case 'aaa':
358
+ return dayPeriodEnumValue;
359
+ case 'aaaaa':
360
+ return dayPeriodEnumValue[0];
361
+ case 'aaaa':
362
+ default:
363
+ return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
364
+ }
410
365
  },
411
- xMonths: {
412
- one: '1 month',
413
- other: '{{count}} months'
366
+ // Hour [1-12]
367
+ h: function h(date, token) {
368
+ return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
414
369
  },
415
- aboutXYears: {
416
- one: 'about 1 year',
417
- other: 'about {{count}} years'
370
+ // Hour [0-23]
371
+ H: function H(date, token) {
372
+ return addLeadingZeros(date.getUTCHours(), token.length);
418
373
  },
419
- xYears: {
420
- one: '1 year',
421
- other: '{{count}} years'
374
+ // Minute
375
+ m: function m(date, token) {
376
+ return addLeadingZeros(date.getUTCMinutes(), token.length);
422
377
  },
423
- overXYears: {
424
- one: 'over 1 year',
425
- other: 'over {{count}} years'
378
+ // Second
379
+ s: function s(date, token) {
380
+ return addLeadingZeros(date.getUTCSeconds(), token.length);
426
381
  },
427
- almostXYears: {
428
- one: 'almost 1 year',
429
- other: 'almost {{count}} years'
382
+ // Fraction of second
383
+ S: function S(date, token) {
384
+ var numberOfDigits = token.length;
385
+ var milliseconds = date.getUTCMilliseconds();
386
+ var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
387
+ return addLeadingZeros(fractionalSeconds, token.length);
430
388
  }
431
389
  };
432
390
 
433
- var formatDistance = function (token, count, options) {
434
- var result;
435
- var tokenValue = formatDistanceLocale[token];
436
-
437
- if (typeof tokenValue === 'string') {
438
- result = tokenValue;
439
- } else if (count === 1) {
440
- result = tokenValue.one;
441
- } else {
442
- result = tokenValue.other.replace('{{count}}', count.toString());
443
- }
444
-
445
- if (options !== null && options !== void 0 && options.addSuffix) {
446
- if (options.comparison && options.comparison > 0) {
447
- return 'in ' + result;
448
- } else {
449
- return result + ' ago';
450
- }
451
- }
452
-
453
- return result;
454
- };
455
-
456
- function buildFormatLongFn(args) {
457
- return function () {
458
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
459
- // TODO: Remove String()
460
- var width = options.width ? String(options.width) : args.defaultWidth;
461
- var format = args.formats[width] || args.formats[args.defaultWidth];
462
- return format;
463
- };
464
- }
465
-
466
- var dateFormats = {
467
- full: 'EEEE, MMMM do, y',
468
- long: 'MMMM do, y',
469
- medium: 'MMM d, y',
470
- short: 'MM/dd/yyyy'
471
- };
472
- var timeFormats = {
473
- full: 'h:mm:ss a zzzz',
474
- long: 'h:mm:ss a z',
475
- medium: 'h:mm:ss a',
476
- short: 'h:mm a'
477
- };
478
- var dateTimeFormats = {
479
- full: "{{date}} 'at' {{time}}",
480
- long: "{{date}} 'at' {{time}}",
481
- medium: '{{date}}, {{time}}',
482
- short: '{{date}}, {{time}}'
483
- };
484
- var formatLong = {
485
- date: buildFormatLongFn({
486
- formats: dateFormats,
487
- defaultWidth: 'full'
488
- }),
489
- time: buildFormatLongFn({
490
- formats: timeFormats,
491
- defaultWidth: 'full'
492
- }),
493
- dateTime: buildFormatLongFn({
494
- formats: dateTimeFormats,
495
- defaultWidth: 'full'
496
- })
497
- };
498
-
499
- var formatRelativeLocale = {
500
- lastWeek: "'last' eeee 'at' p",
501
- yesterday: "'yesterday at' p",
502
- today: "'today at' p",
503
- tomorrow: "'tomorrow at' p",
504
- nextWeek: "eeee 'at' p",
505
- other: 'P'
506
- };
507
-
508
- var formatRelative = function (token, _date, _baseDate, _options) {
509
- return formatRelativeLocale[token];
510
- };
511
-
512
- function buildLocalizeFn(args) {
513
- return function (dirtyIndex, dirtyOptions) {
514
- var options = dirtyOptions || {};
515
- var context = options.context ? String(options.context) : 'standalone';
516
- var valuesArray;
517
-
518
- if (context === 'formatting' && args.formattingValues) {
519
- var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
520
- var width = options.width ? String(options.width) : defaultWidth;
521
- valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
522
- } else {
523
- var _defaultWidth = args.defaultWidth;
524
-
525
- var _width = options.width ? String(options.width) : args.defaultWidth;
526
-
527
- valuesArray = args.values[_width] || args.values[_defaultWidth];
528
- }
529
-
530
- var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex; // @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!
531
-
532
- return valuesArray[index];
533
- };
534
- }
535
-
536
- var eraValues = {
537
- narrow: ['B', 'A'],
538
- abbreviated: ['BC', 'AD'],
539
- wide: ['Before Christ', 'Anno Domini']
540
- };
541
- var quarterValues = {
542
- narrow: ['1', '2', '3', '4'],
543
- abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
544
- wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']
545
- }; // Note: in English, the names of days of the week and months are capitalized.
546
- // If you are making a new locale based on this one, check if the same is true for the language you're working on.
547
- // Generally, formatted dates should look like they are in the middle of a sentence,
548
- // e.g. in Spanish language the weekdays and months should be in the lowercase.
549
-
550
- var monthValues = {
551
- narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
552
- abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
553
- wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
554
- };
555
- var dayValues = {
556
- narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
557
- short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
558
- abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
559
- wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
560
- };
561
- var dayPeriodValues = {
562
- narrow: {
563
- am: 'a',
564
- pm: 'p',
565
- midnight: 'mi',
566
- noon: 'n',
567
- morning: 'morning',
568
- afternoon: 'afternoon',
569
- evening: 'evening',
570
- night: 'night'
571
- },
572
- abbreviated: {
573
- am: 'AM',
574
- pm: 'PM',
575
- midnight: 'midnight',
576
- noon: 'noon',
577
- morning: 'morning',
578
- afternoon: 'afternoon',
579
- evening: 'evening',
580
- night: 'night'
581
- },
582
- wide: {
583
- am: 'a.m.',
584
- pm: 'p.m.',
585
- midnight: 'midnight',
586
- noon: 'noon',
587
- morning: 'morning',
588
- afternoon: 'afternoon',
589
- evening: 'evening',
590
- night: 'night'
591
- }
592
- };
593
- var formattingDayPeriodValues = {
594
- narrow: {
595
- am: 'a',
596
- pm: 'p',
597
- midnight: 'mi',
598
- noon: 'n',
599
- morning: 'in the morning',
600
- afternoon: 'in the afternoon',
601
- evening: 'in the evening',
602
- night: 'at night'
603
- },
604
- abbreviated: {
605
- am: 'AM',
606
- pm: 'PM',
607
- midnight: 'midnight',
608
- noon: 'noon',
609
- morning: 'in the morning',
610
- afternoon: 'in the afternoon',
611
- evening: 'in the evening',
612
- night: 'at night'
613
- },
614
- wide: {
615
- am: 'a.m.',
616
- pm: 'p.m.',
617
- midnight: 'midnight',
618
- noon: 'noon',
619
- morning: 'in the morning',
620
- afternoon: 'in the afternoon',
621
- evening: 'in the evening',
622
- night: 'at night'
623
- }
624
- };
625
-
626
- var ordinalNumber = function (dirtyNumber, _options) {
627
- var number = Number(dirtyNumber); // If ordinal numbers depend on context, for example,
628
- // if they are different for different grammatical genders,
629
- // use `options.unit`.
630
- //
631
- // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
632
- // 'day', 'hour', 'minute', 'second'.
633
-
634
- var rem100 = number % 100;
635
-
636
- if (rem100 > 20 || rem100 < 10) {
637
- switch (rem100 % 10) {
638
- case 1:
639
- return number + 'st';
640
-
641
- case 2:
642
- return number + 'nd';
643
-
644
- case 3:
645
- return number + 'rd';
646
- }
647
- }
648
-
649
- return number + 'th';
650
- };
651
-
652
- var localize = {
653
- ordinalNumber: ordinalNumber,
654
- era: buildLocalizeFn({
655
- values: eraValues,
656
- defaultWidth: 'wide'
657
- }),
658
- quarter: buildLocalizeFn({
659
- values: quarterValues,
660
- defaultWidth: 'wide',
661
- argumentCallback: function (quarter) {
662
- return quarter - 1;
663
- }
664
- }),
665
- month: buildLocalizeFn({
666
- values: monthValues,
667
- defaultWidth: 'wide'
668
- }),
669
- day: buildLocalizeFn({
670
- values: dayValues,
671
- defaultWidth: 'wide'
672
- }),
673
- dayPeriod: buildLocalizeFn({
674
- values: dayPeriodValues,
675
- defaultWidth: 'wide',
676
- formattingValues: formattingDayPeriodValues,
677
- defaultFormattingWidth: 'wide'
678
- })
679
- };
680
-
681
- function buildMatchFn(args) {
682
- return function (string) {
683
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
684
- var width = options.width;
685
- var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
686
- var matchResult = string.match(matchPattern);
687
-
688
- if (!matchResult) {
689
- return null;
690
- }
691
-
692
- var matchedString = matchResult[0];
693
- var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
694
- var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {
695
- return pattern.test(matchedString);
696
- }) : findKey(parsePatterns, function (pattern) {
697
- return pattern.test(matchedString);
698
- });
699
- var value;
700
- value = args.valueCallback ? args.valueCallback(key) : key;
701
- value = options.valueCallback ? options.valueCallback(value) : value;
702
- var rest = string.slice(matchedString.length);
703
- return {
704
- value: value,
705
- rest: rest
706
- };
707
- };
708
- }
709
-
710
- function findKey(object, predicate) {
711
- for (var key in object) {
712
- if (object.hasOwnProperty(key) && predicate(object[key])) {
713
- return key;
714
- }
715
- }
716
-
717
- return undefined;
718
- }
719
-
720
- function findIndex(array, predicate) {
721
- for (var key = 0; key < array.length; key++) {
722
- if (predicate(array[key])) {
723
- return key;
724
- }
725
- }
726
-
727
- return undefined;
728
- }
729
-
730
- function buildMatchPatternFn(args) {
731
- return function (string) {
732
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
733
- var matchResult = string.match(args.matchPattern);
734
- if (!matchResult) return null;
735
- var matchedString = matchResult[0];
736
- var parseResult = string.match(args.parsePattern);
737
- if (!parseResult) return null;
738
- var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
739
- value = options.valueCallback ? options.valueCallback(value) : value;
740
- var rest = string.slice(matchedString.length);
741
- return {
742
- value: value,
743
- rest: rest
744
- };
745
- };
746
- }
747
-
748
- var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
749
- var parseOrdinalNumberPattern = /\d+/i;
750
- var matchEraPatterns = {
751
- narrow: /^(b|a)/i,
752
- abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
753
- wide: /^(before christ|before common era|anno domini|common era)/i
754
- };
755
- var parseEraPatterns = {
756
- any: [/^b/i, /^(a|c)/i]
757
- };
758
- var matchQuarterPatterns = {
759
- narrow: /^[1234]/i,
760
- abbreviated: /^q[1234]/i,
761
- wide: /^[1234](th|st|nd|rd)? quarter/i
762
- };
763
- var parseQuarterPatterns = {
764
- any: [/1/i, /2/i, /3/i, /4/i]
765
- };
766
- var matchMonthPatterns = {
767
- narrow: /^[jfmasond]/i,
768
- abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
769
- wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
770
- };
771
- var parseMonthPatterns = {
772
- 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],
773
- 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]
774
- };
775
- var matchDayPatterns = {
776
- narrow: /^[smtwf]/i,
777
- short: /^(su|mo|tu|we|th|fr|sa)/i,
778
- abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
779
- wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
780
- };
781
- var parseDayPatterns = {
782
- narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
783
- any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
784
- };
785
- var matchDayPeriodPatterns = {
786
- narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
787
- any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
788
- };
789
- var parseDayPeriodPatterns = {
790
- any: {
791
- am: /^a/i,
792
- pm: /^p/i,
793
- midnight: /^mi/i,
794
- noon: /^no/i,
795
- morning: /morning/i,
796
- afternoon: /afternoon/i,
797
- evening: /evening/i,
798
- night: /night/i
799
- }
800
- };
801
- var match = {
802
- ordinalNumber: buildMatchPatternFn({
803
- matchPattern: matchOrdinalNumberPattern,
804
- parsePattern: parseOrdinalNumberPattern,
805
- valueCallback: function (value) {
806
- return parseInt(value, 10);
807
- }
808
- }),
809
- era: buildMatchFn({
810
- matchPatterns: matchEraPatterns,
811
- defaultMatchWidth: 'wide',
812
- parsePatterns: parseEraPatterns,
813
- defaultParseWidth: 'any'
814
- }),
815
- quarter: buildMatchFn({
816
- matchPatterns: matchQuarterPatterns,
817
- defaultMatchWidth: 'wide',
818
- parsePatterns: parseQuarterPatterns,
819
- defaultParseWidth: 'any',
820
- valueCallback: function (index) {
821
- return index + 1;
822
- }
823
- }),
824
- month: buildMatchFn({
825
- matchPatterns: matchMonthPatterns,
826
- defaultMatchWidth: 'wide',
827
- parsePatterns: parseMonthPatterns,
828
- defaultParseWidth: 'any'
829
- }),
830
- day: buildMatchFn({
831
- matchPatterns: matchDayPatterns,
832
- defaultMatchWidth: 'wide',
833
- parsePatterns: parseDayPatterns,
834
- defaultParseWidth: 'any'
835
- }),
836
- dayPeriod: buildMatchFn({
837
- matchPatterns: matchDayPeriodPatterns,
838
- defaultMatchWidth: 'any',
839
- parsePatterns: parseDayPeriodPatterns,
840
- defaultParseWidth: 'any'
841
- })
842
- };
843
-
844
- /**
845
- * @type {Locale}
846
- * @category Locales
847
- * @summary English locale (United States).
848
- * @language English
849
- * @iso-639-2 eng
850
- * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
851
- * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
852
- */
853
- var locale = {
854
- code: 'en-US',
855
- formatDistance: formatDistance,
856
- formatLong: formatLong,
857
- formatRelative: formatRelative,
858
- localize: localize,
859
- match: match,
860
- options: {
861
- weekStartsOn: 0
862
- /* Sunday */
863
- ,
864
- firstWeekContainsDate: 1
865
- }
866
- };
867
-
868
- /**
869
- * @name subMilliseconds
870
- * @category Millisecond Helpers
871
- * @summary Subtract the specified number of milliseconds from the given date.
872
- *
873
- * @description
874
- * Subtract the specified number of milliseconds from the given date.
875
- *
876
- * ### v2.0.0 breaking changes:
877
- *
878
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
879
- *
880
- * @param {Date|Number} date - the date to be changed
881
- * @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`.
882
- * @returns {Date} the new date with the milliseconds subtracted
883
- * @throws {TypeError} 2 arguments required
884
- *
885
- * @example
886
- * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:
887
- * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
888
- * //=> Thu Jul 10 2014 12:45:29.250
889
- */
890
-
891
- function subMilliseconds(dirtyDate, dirtyAmount) {
892
- requiredArgs(2, arguments);
893
- var amount = toInteger(dirtyAmount);
894
- return addMilliseconds(dirtyDate, -amount);
895
- }
896
-
897
- var MILLISECONDS_IN_DAY = 86400000; // This function will be a part of public API when UTC function will be implemented.
898
- // See issue: https://github.com/date-fns/date-fns/issues/376
899
-
900
- function getUTCDayOfYear(dirtyDate) {
901
- requiredArgs(1, arguments);
902
- var date = toDate(dirtyDate);
903
- var timestamp = date.getTime();
904
- date.setUTCMonth(0, 1);
905
- date.setUTCHours(0, 0, 0, 0);
906
- var startOfYearTimestamp = date.getTime();
907
- var difference = timestamp - startOfYearTimestamp;
908
- return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
909
- }
910
-
911
- // See issue: https://github.com/date-fns/date-fns/issues/376
912
-
913
- function startOfUTCISOWeek(dirtyDate) {
914
- requiredArgs(1, arguments);
915
- var weekStartsOn = 1;
916
- var date = toDate(dirtyDate);
917
- var day = date.getUTCDay();
918
- var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
919
- date.setUTCDate(date.getUTCDate() - diff);
920
- date.setUTCHours(0, 0, 0, 0);
921
- return date;
922
- }
923
-
924
- // See issue: https://github.com/date-fns/date-fns/issues/376
925
-
926
- function getUTCISOWeekYear(dirtyDate) {
927
- requiredArgs(1, arguments);
928
- var date = toDate(dirtyDate);
929
- var year = date.getUTCFullYear();
930
- var fourthOfJanuaryOfNextYear = new Date(0);
931
- fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
932
- fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
933
- var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);
934
- var fourthOfJanuaryOfThisYear = new Date(0);
935
- fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
936
- fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
937
- var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
938
-
939
- if (date.getTime() >= startOfNextYear.getTime()) {
940
- return year + 1;
941
- } else if (date.getTime() >= startOfThisYear.getTime()) {
942
- return year;
943
- } else {
944
- return year - 1;
945
- }
946
- }
947
-
948
- // See issue: https://github.com/date-fns/date-fns/issues/376
949
-
950
- function startOfUTCISOWeekYear(dirtyDate) {
951
- requiredArgs(1, arguments);
952
- var year = getUTCISOWeekYear(dirtyDate);
953
- var fourthOfJanuary = new Date(0);
954
- fourthOfJanuary.setUTCFullYear(year, 0, 4);
955
- fourthOfJanuary.setUTCHours(0, 0, 0, 0);
956
- var date = startOfUTCISOWeek(fourthOfJanuary);
957
- return date;
958
- }
959
-
960
- var MILLISECONDS_IN_WEEK$1 = 604800000; // This function will be a part of public API when UTC function will be implemented.
961
- // See issue: https://github.com/date-fns/date-fns/issues/376
962
-
963
- function getUTCISOWeek(dirtyDate) {
964
- requiredArgs(1, arguments);
965
- var date = toDate(dirtyDate);
966
- var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer
967
- // because the number of milliseconds in a week is not constant
968
- // (e.g. it's different in the week of the daylight saving time clock shift)
969
-
970
- return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
971
- }
972
-
973
- // See issue: https://github.com/date-fns/date-fns/issues/376
974
-
975
- function startOfUTCWeek(dirtyDate, dirtyOptions) {
976
- requiredArgs(1, arguments);
977
- var options = dirtyOptions || {};
978
- var locale = options.locale;
979
- var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;
980
- var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
981
- var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
982
-
983
- if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
984
- throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
985
- }
986
-
987
- var date = toDate(dirtyDate);
988
- var day = date.getUTCDay();
989
- var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
990
- date.setUTCDate(date.getUTCDate() - diff);
991
- date.setUTCHours(0, 0, 0, 0);
992
- return date;
993
- }
994
-
995
- // See issue: https://github.com/date-fns/date-fns/issues/376
996
-
997
- function getUTCWeekYear(dirtyDate, dirtyOptions) {
998
- requiredArgs(1, arguments);
999
- var date = toDate(dirtyDate);
1000
- var year = date.getUTCFullYear();
1001
- var options = dirtyOptions || {};
1002
- var locale = options.locale;
1003
- var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;
1004
- var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
1005
- var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
1006
-
1007
- if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
1008
- throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
1009
- }
1010
-
1011
- var firstWeekOfNextYear = new Date(0);
1012
- firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
1013
- firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
1014
- var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, dirtyOptions);
1015
- var firstWeekOfThisYear = new Date(0);
1016
- firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
1017
- firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
1018
- var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, dirtyOptions);
1019
-
1020
- if (date.getTime() >= startOfNextYear.getTime()) {
1021
- return year + 1;
1022
- } else if (date.getTime() >= startOfThisYear.getTime()) {
1023
- return year;
1024
- } else {
1025
- return year - 1;
1026
- }
1027
- }
1028
-
1029
- // See issue: https://github.com/date-fns/date-fns/issues/376
1030
-
1031
- function startOfUTCWeekYear(dirtyDate, dirtyOptions) {
1032
- requiredArgs(1, arguments);
1033
- var options = dirtyOptions || {};
1034
- var locale = options.locale;
1035
- var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;
1036
- var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
1037
- var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);
1038
- var year = getUTCWeekYear(dirtyDate, dirtyOptions);
1039
- var firstWeek = new Date(0);
1040
- firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
1041
- firstWeek.setUTCHours(0, 0, 0, 0);
1042
- var date = startOfUTCWeek(firstWeek, dirtyOptions);
1043
- return date;
1044
- }
1045
-
1046
- var MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.
1047
- // See issue: https://github.com/date-fns/date-fns/issues/376
1048
-
1049
- function getUTCWeek(dirtyDate, options) {
1050
- requiredArgs(1, arguments);
1051
- var date = toDate(dirtyDate);
1052
- var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer
1053
- // because the number of milliseconds in a week is not constant
1054
- // (e.g. it's different in the week of the daylight saving time clock shift)
1055
-
1056
- return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
1057
- }
1058
-
1059
- function addLeadingZeros(number, targetLength) {
1060
- var sign = number < 0 ? '-' : '';
1061
- var output = Math.abs(number).toString();
1062
-
1063
- while (output.length < targetLength) {
1064
- output = '0' + output;
1065
- }
1066
-
1067
- return sign + output;
1068
- }
1069
-
1070
- /*
1071
- * | | Unit | | Unit |
1072
- * |-----|--------------------------------|-----|--------------------------------|
1073
- * | a | AM, PM | A* | |
1074
- * | d | Day of month | D | |
1075
- * | h | Hour [1-12] | H | Hour [0-23] |
1076
- * | m | Minute | M | Month |
1077
- * | s | Second | S | Fraction of second |
1078
- * | y | Year (abs) | Y | |
1079
- *
1080
- * Letters marked by * are not implemented but reserved by Unicode standard.
1081
- */
1082
-
1083
- var formatters$1 = {
1084
- // Year
1085
- y: function (date, token) {
1086
- // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
1087
- // | Year | y | yy | yyy | yyyy | yyyyy |
1088
- // |----------|-------|----|-------|-------|-------|
1089
- // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
1090
- // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
1091
- // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
1092
- // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
1093
- // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
1094
- var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
1095
-
1096
- var year = signedYear > 0 ? signedYear : 1 - signedYear;
1097
- return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
1098
- },
1099
- // Month
1100
- M: function (date, token) {
1101
- var month = date.getUTCMonth();
1102
- return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);
1103
- },
1104
- // Day of the month
1105
- d: function (date, token) {
1106
- return addLeadingZeros(date.getUTCDate(), token.length);
1107
- },
1108
- // AM or PM
1109
- a: function (date, token) {
1110
- var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
1111
-
1112
- switch (token) {
1113
- case 'a':
1114
- case 'aa':
1115
- return dayPeriodEnumValue.toUpperCase();
1116
-
1117
- case 'aaa':
1118
- return dayPeriodEnumValue;
1119
-
1120
- case 'aaaaa':
1121
- return dayPeriodEnumValue[0];
1122
-
1123
- case 'aaaa':
1124
- default:
1125
- return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
1126
- }
1127
- },
1128
- // Hour [1-12]
1129
- h: function (date, token) {
1130
- return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
1131
- },
1132
- // Hour [0-23]
1133
- H: function (date, token) {
1134
- return addLeadingZeros(date.getUTCHours(), token.length);
1135
- },
1136
- // Minute
1137
- m: function (date, token) {
1138
- return addLeadingZeros(date.getUTCMinutes(), token.length);
1139
- },
1140
- // Second
1141
- s: function (date, token) {
1142
- return addLeadingZeros(date.getUTCSeconds(), token.length);
1143
- },
1144
- // Fraction of second
1145
- S: function (date, token) {
1146
- var numberOfDigits = token.length;
1147
- var milliseconds = date.getUTCMilliseconds();
1148
- var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
1149
- return addLeadingZeros(fractionalSeconds, token.length);
1150
- }
1151
- };
1152
-
1153
- var dayPeriodEnum = {
1154
- am: 'am',
1155
- pm: 'pm',
1156
- midnight: 'midnight',
1157
- noon: 'noon',
1158
- morning: 'morning',
1159
- afternoon: 'afternoon',
1160
- evening: 'evening',
1161
- night: 'night'
391
+ var dayPeriodEnum = {
392
+ am: 'am',
393
+ pm: 'pm',
394
+ midnight: 'midnight',
395
+ noon: 'noon',
396
+ morning: 'morning',
397
+ afternoon: 'afternoon',
398
+ evening: 'evening',
399
+ night: 'night'
1162
400
  };
1163
401
  /*
1164
402
  * | | Unit | | Unit |
@@ -1208,9 +446,8 @@ var dayPeriodEnum = {
1208
446
 
1209
447
  var formatters = {
1210
448
  // Era
1211
- G: function (date, token, localize) {
449
+ G: function G(date, token, localize) {
1212
450
  var era = date.getUTCFullYear() > 0 ? 1 : 0;
1213
-
1214
451
  switch (token) {
1215
452
  // AD, BC
1216
453
  case 'G':
@@ -1220,13 +457,11 @@ var formatters = {
1220
457
  width: 'abbreviated'
1221
458
  });
1222
459
  // A, B
1223
-
1224
460
  case 'GGGGG':
1225
461
  return localize.era(era, {
1226
462
  width: 'narrow'
1227
463
  });
1228
464
  // Anno Domini, Before Christ
1229
-
1230
465
  case 'GGGG':
1231
466
  default:
1232
467
  return localize.era(era, {
@@ -1235,44 +470,45 @@ var formatters = {
1235
470
  }
1236
471
  },
1237
472
  // Year
1238
- y: function (date, token, localize) {
473
+ y: function y(date, token, localize) {
1239
474
  // Ordinal number
1240
475
  if (token === 'yo') {
1241
- var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
1242
-
476
+ var signedYear = date.getUTCFullYear();
477
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
1243
478
  var year = signedYear > 0 ? signedYear : 1 - signedYear;
1244
479
  return localize.ordinalNumber(year, {
1245
480
  unit: 'year'
1246
481
  });
1247
482
  }
1248
-
1249
483
  return formatters$1.y(date, token);
1250
484
  },
1251
485
  // Local week-numbering year
1252
- Y: function (date, token, localize, options) {
1253
- var signedWeekYear = getUTCWeekYear(date, options); // Returns 1 for 1 BC (which is year 0 in JavaScript)
1254
-
1255
- var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; // Two digit year
486
+ Y: function Y(date, token, localize, options) {
487
+ var signedWeekYear = getUTCWeekYear(date, options);
488
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
489
+ var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
1256
490
 
491
+ // Two digit year
1257
492
  if (token === 'YY') {
1258
493
  var twoDigitYear = weekYear % 100;
1259
494
  return addLeadingZeros(twoDigitYear, 2);
1260
- } // Ordinal number
1261
-
495
+ }
1262
496
 
497
+ // Ordinal number
1263
498
  if (token === 'Yo') {
1264
499
  return localize.ordinalNumber(weekYear, {
1265
500
  unit: 'year'
1266
501
  });
1267
- } // Padding
1268
-
502
+ }
1269
503
 
504
+ // Padding
1270
505
  return addLeadingZeros(weekYear, token.length);
1271
506
  },
1272
507
  // ISO week-numbering year
1273
- R: function (date, token) {
1274
- var isoWeekYear = getUTCISOWeekYear(date); // Padding
508
+ R: function R(date, token) {
509
+ var isoWeekYear = getUTCISOWeekYear(date);
1275
510
 
511
+ // Padding
1276
512
  return addLeadingZeros(isoWeekYear, token.length);
1277
513
  },
1278
514
  // Extended year. This is a single number designating the year of this calendar system.
@@ -1284,44 +520,38 @@ var formatters = {
1284
520
  // | BC 2 | 2 | -1 |
1285
521
  // Also `yy` always returns the last two digits of a year,
1286
522
  // while `uu` pads single digit years to 2 characters and returns other years unchanged.
1287
- u: function (date, token) {
523
+ u: function u(date, token) {
1288
524
  var year = date.getUTCFullYear();
1289
525
  return addLeadingZeros(year, token.length);
1290
526
  },
1291
527
  // Quarter
1292
- Q: function (date, token, localize) {
528
+ Q: function Q(date, token, localize) {
1293
529
  var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
1294
-
1295
530
  switch (token) {
1296
531
  // 1, 2, 3, 4
1297
532
  case 'Q':
1298
533
  return String(quarter);
1299
534
  // 01, 02, 03, 04
1300
-
1301
535
  case 'QQ':
1302
536
  return addLeadingZeros(quarter, 2);
1303
537
  // 1st, 2nd, 3rd, 4th
1304
-
1305
538
  case 'Qo':
1306
539
  return localize.ordinalNumber(quarter, {
1307
540
  unit: 'quarter'
1308
541
  });
1309
542
  // Q1, Q2, Q3, Q4
1310
-
1311
543
  case 'QQQ':
1312
544
  return localize.quarter(quarter, {
1313
545
  width: 'abbreviated',
1314
546
  context: 'formatting'
1315
547
  });
1316
548
  // 1, 2, 3, 4 (narrow quarter; could be not numerical)
1317
-
1318
549
  case 'QQQQQ':
1319
550
  return localize.quarter(quarter, {
1320
551
  width: 'narrow',
1321
552
  context: 'formatting'
1322
553
  });
1323
554
  // 1st quarter, 2nd quarter, ...
1324
-
1325
555
  case 'QQQQ':
1326
556
  default:
1327
557
  return localize.quarter(quarter, {
@@ -1331,39 +561,33 @@ var formatters = {
1331
561
  }
1332
562
  },
1333
563
  // Stand-alone quarter
1334
- q: function (date, token, localize) {
564
+ q: function q(date, token, localize) {
1335
565
  var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
1336
-
1337
566
  switch (token) {
1338
567
  // 1, 2, 3, 4
1339
568
  case 'q':
1340
569
  return String(quarter);
1341
570
  // 01, 02, 03, 04
1342
-
1343
571
  case 'qq':
1344
572
  return addLeadingZeros(quarter, 2);
1345
573
  // 1st, 2nd, 3rd, 4th
1346
-
1347
574
  case 'qo':
1348
575
  return localize.ordinalNumber(quarter, {
1349
576
  unit: 'quarter'
1350
577
  });
1351
578
  // Q1, Q2, Q3, Q4
1352
-
1353
579
  case 'qqq':
1354
580
  return localize.quarter(quarter, {
1355
581
  width: 'abbreviated',
1356
582
  context: 'standalone'
1357
583
  });
1358
584
  // 1, 2, 3, 4 (narrow quarter; could be not numerical)
1359
-
1360
585
  case 'qqqqq':
1361
586
  return localize.quarter(quarter, {
1362
587
  width: 'narrow',
1363
588
  context: 'standalone'
1364
589
  });
1365
590
  // 1st quarter, 2nd quarter, ...
1366
-
1367
591
  case 'qqqq':
1368
592
  default:
1369
593
  return localize.quarter(quarter, {
@@ -1373,35 +597,30 @@ var formatters = {
1373
597
  }
1374
598
  },
1375
599
  // Month
1376
- M: function (date, token, localize) {
600
+ M: function M(date, token, localize) {
1377
601
  var month = date.getUTCMonth();
1378
-
1379
602
  switch (token) {
1380
603
  case 'M':
1381
604
  case 'MM':
1382
605
  return formatters$1.M(date, token);
1383
606
  // 1st, 2nd, ..., 12th
1384
-
1385
607
  case 'Mo':
1386
608
  return localize.ordinalNumber(month + 1, {
1387
609
  unit: 'month'
1388
610
  });
1389
611
  // Jan, Feb, ..., Dec
1390
-
1391
612
  case 'MMM':
1392
613
  return localize.month(month, {
1393
614
  width: 'abbreviated',
1394
615
  context: 'formatting'
1395
616
  });
1396
617
  // J, F, ..., D
1397
-
1398
618
  case 'MMMMM':
1399
619
  return localize.month(month, {
1400
620
  width: 'narrow',
1401
621
  context: 'formatting'
1402
622
  });
1403
623
  // January, February, ..., December
1404
-
1405
624
  case 'MMMM':
1406
625
  default:
1407
626
  return localize.month(month, {
@@ -1411,39 +630,33 @@ var formatters = {
1411
630
  }
1412
631
  },
1413
632
  // Stand-alone month
1414
- L: function (date, token, localize) {
633
+ L: function L(date, token, localize) {
1415
634
  var month = date.getUTCMonth();
1416
-
1417
635
  switch (token) {
1418
636
  // 1, 2, ..., 12
1419
637
  case 'L':
1420
638
  return String(month + 1);
1421
639
  // 01, 02, ..., 12
1422
-
1423
640
  case 'LL':
1424
641
  return addLeadingZeros(month + 1, 2);
1425
642
  // 1st, 2nd, ..., 12th
1426
-
1427
643
  case 'Lo':
1428
644
  return localize.ordinalNumber(month + 1, {
1429
645
  unit: 'month'
1430
646
  });
1431
647
  // Jan, Feb, ..., Dec
1432
-
1433
648
  case 'LLL':
1434
649
  return localize.month(month, {
1435
650
  width: 'abbreviated',
1436
651
  context: 'standalone'
1437
652
  });
1438
653
  // J, F, ..., D
1439
-
1440
654
  case 'LLLLL':
1441
655
  return localize.month(month, {
1442
656
  width: 'narrow',
1443
657
  context: 'standalone'
1444
658
  });
1445
659
  // January, February, ..., December
1446
-
1447
660
  case 'LLLL':
1448
661
  default:
1449
662
  return localize.month(month, {
@@ -1453,55 +666,47 @@ var formatters = {
1453
666
  }
1454
667
  },
1455
668
  // Local week of year
1456
- w: function (date, token, localize, options) {
669
+ w: function w(date, token, localize, options) {
1457
670
  var week = getUTCWeek(date, options);
1458
-
1459
671
  if (token === 'wo') {
1460
672
  return localize.ordinalNumber(week, {
1461
673
  unit: 'week'
1462
674
  });
1463
675
  }
1464
-
1465
676
  return addLeadingZeros(week, token.length);
1466
677
  },
1467
678
  // ISO week of year
1468
- I: function (date, token, localize) {
679
+ I: function I(date, token, localize) {
1469
680
  var isoWeek = getUTCISOWeek(date);
1470
-
1471
681
  if (token === 'Io') {
1472
682
  return localize.ordinalNumber(isoWeek, {
1473
683
  unit: 'week'
1474
684
  });
1475
685
  }
1476
-
1477
686
  return addLeadingZeros(isoWeek, token.length);
1478
687
  },
1479
688
  // Day of the month
1480
- d: function (date, token, localize) {
689
+ d: function d(date, token, localize) {
1481
690
  if (token === 'do') {
1482
691
  return localize.ordinalNumber(date.getUTCDate(), {
1483
692
  unit: 'date'
1484
693
  });
1485
694
  }
1486
-
1487
695
  return formatters$1.d(date, token);
1488
696
  },
1489
697
  // Day of year
1490
- D: function (date, token, localize) {
698
+ D: function D(date, token, localize) {
1491
699
  var dayOfYear = getUTCDayOfYear(date);
1492
-
1493
700
  if (token === 'Do') {
1494
701
  return localize.ordinalNumber(dayOfYear, {
1495
702
  unit: 'dayOfYear'
1496
703
  });
1497
704
  }
1498
-
1499
705
  return addLeadingZeros(dayOfYear, token.length);
1500
706
  },
1501
707
  // Day of week
1502
- E: function (date, token, localize) {
708
+ E: function E(date, token, localize) {
1503
709
  var dayOfWeek = date.getUTCDay();
1504
-
1505
710
  switch (token) {
1506
711
  // Tue
1507
712
  case 'E':
@@ -1512,21 +717,18 @@ var formatters = {
1512
717
  context: 'formatting'
1513
718
  });
1514
719
  // T
1515
-
1516
720
  case 'EEEEE':
1517
721
  return localize.day(dayOfWeek, {
1518
722
  width: 'narrow',
1519
723
  context: 'formatting'
1520
724
  });
1521
725
  // Tu
1522
-
1523
726
  case 'EEEEEE':
1524
727
  return localize.day(dayOfWeek, {
1525
728
  width: 'short',
1526
729
  context: 'formatting'
1527
730
  });
1528
731
  // Tuesday
1529
-
1530
732
  case 'EEEE':
1531
733
  default:
1532
734
  return localize.day(dayOfWeek, {
@@ -1536,46 +738,39 @@ var formatters = {
1536
738
  }
1537
739
  },
1538
740
  // Local day of week
1539
- e: function (date, token, localize, options) {
741
+ e: function e(date, token, localize, options) {
1540
742
  var dayOfWeek = date.getUTCDay();
1541
743
  var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
1542
-
1543
744
  switch (token) {
1544
745
  // Numerical value (Nth day of week with current locale or weekStartsOn)
1545
746
  case 'e':
1546
747
  return String(localDayOfWeek);
1547
748
  // Padded numerical value
1548
-
1549
749
  case 'ee':
1550
750
  return addLeadingZeros(localDayOfWeek, 2);
1551
751
  // 1st, 2nd, ..., 7th
1552
-
1553
752
  case 'eo':
1554
753
  return localize.ordinalNumber(localDayOfWeek, {
1555
754
  unit: 'day'
1556
755
  });
1557
-
1558
756
  case 'eee':
1559
757
  return localize.day(dayOfWeek, {
1560
758
  width: 'abbreviated',
1561
759
  context: 'formatting'
1562
760
  });
1563
761
  // T
1564
-
1565
762
  case 'eeeee':
1566
763
  return localize.day(dayOfWeek, {
1567
764
  width: 'narrow',
1568
765
  context: 'formatting'
1569
766
  });
1570
767
  // Tu
1571
-
1572
768
  case 'eeeeee':
1573
769
  return localize.day(dayOfWeek, {
1574
770
  width: 'short',
1575
771
  context: 'formatting'
1576
772
  });
1577
773
  // Tuesday
1578
-
1579
774
  case 'eeee':
1580
775
  default:
1581
776
  return localize.day(dayOfWeek, {
@@ -1585,46 +780,39 @@ var formatters = {
1585
780
  }
1586
781
  },
1587
782
  // Stand-alone local day of week
1588
- c: function (date, token, localize, options) {
783
+ c: function c(date, token, localize, options) {
1589
784
  var dayOfWeek = date.getUTCDay();
1590
785
  var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
1591
-
1592
786
  switch (token) {
1593
787
  // Numerical value (same as in `e`)
1594
788
  case 'c':
1595
789
  return String(localDayOfWeek);
1596
790
  // Padded numerical value
1597
-
1598
791
  case 'cc':
1599
792
  return addLeadingZeros(localDayOfWeek, token.length);
1600
793
  // 1st, 2nd, ..., 7th
1601
-
1602
794
  case 'co':
1603
795
  return localize.ordinalNumber(localDayOfWeek, {
1604
796
  unit: 'day'
1605
797
  });
1606
-
1607
798
  case 'ccc':
1608
799
  return localize.day(dayOfWeek, {
1609
800
  width: 'abbreviated',
1610
801
  context: 'standalone'
1611
802
  });
1612
803
  // T
1613
-
1614
804
  case 'ccccc':
1615
805
  return localize.day(dayOfWeek, {
1616
806
  width: 'narrow',
1617
807
  context: 'standalone'
1618
808
  });
1619
809
  // Tu
1620
-
1621
810
  case 'cccccc':
1622
811
  return localize.day(dayOfWeek, {
1623
812
  width: 'short',
1624
813
  context: 'standalone'
1625
814
  });
1626
815
  // Tuesday
1627
-
1628
816
  case 'cccc':
1629
817
  default:
1630
818
  return localize.day(dayOfWeek, {
@@ -1634,47 +822,40 @@ var formatters = {
1634
822
  }
1635
823
  },
1636
824
  // ISO day of week
1637
- i: function (date, token, localize) {
825
+ i: function i(date, token, localize) {
1638
826
  var dayOfWeek = date.getUTCDay();
1639
827
  var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
1640
-
1641
828
  switch (token) {
1642
829
  // 2
1643
830
  case 'i':
1644
831
  return String(isoDayOfWeek);
1645
832
  // 02
1646
-
1647
833
  case 'ii':
1648
834
  return addLeadingZeros(isoDayOfWeek, token.length);
1649
835
  // 2nd
1650
-
1651
836
  case 'io':
1652
837
  return localize.ordinalNumber(isoDayOfWeek, {
1653
838
  unit: 'day'
1654
839
  });
1655
840
  // Tue
1656
-
1657
841
  case 'iii':
1658
842
  return localize.day(dayOfWeek, {
1659
843
  width: 'abbreviated',
1660
844
  context: 'formatting'
1661
845
  });
1662
846
  // T
1663
-
1664
847
  case 'iiiii':
1665
848
  return localize.day(dayOfWeek, {
1666
849
  width: 'narrow',
1667
850
  context: 'formatting'
1668
851
  });
1669
852
  // Tu
1670
-
1671
853
  case 'iiiiii':
1672
854
  return localize.day(dayOfWeek, {
1673
855
  width: 'short',
1674
856
  context: 'formatting'
1675
857
  });
1676
858
  // Tuesday
1677
-
1678
859
  case 'iiii':
1679
860
  default:
1680
861
  return localize.day(dayOfWeek, {
@@ -1684,10 +865,9 @@ var formatters = {
1684
865
  }
1685
866
  },
1686
867
  // AM or PM
1687
- a: function (date, token, localize) {
868
+ a: function a(date, token, localize) {
1688
869
  var hours = date.getUTCHours();
1689
870
  var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
1690
-
1691
871
  switch (token) {
1692
872
  case 'a':
1693
873
  case 'aa':
@@ -1695,19 +875,16 @@ var formatters = {
1695
875
  width: 'abbreviated',
1696
876
  context: 'formatting'
1697
877
  });
1698
-
1699
878
  case 'aaa':
1700
879
  return localize.dayPeriod(dayPeriodEnumValue, {
1701
880
  width: 'abbreviated',
1702
881
  context: 'formatting'
1703
882
  }).toLowerCase();
1704
-
1705
883
  case 'aaaaa':
1706
884
  return localize.dayPeriod(dayPeriodEnumValue, {
1707
885
  width: 'narrow',
1708
886
  context: 'formatting'
1709
887
  });
1710
-
1711
888
  case 'aaaa':
1712
889
  default:
1713
890
  return localize.dayPeriod(dayPeriodEnumValue, {
@@ -1717,10 +894,9 @@ var formatters = {
1717
894
  }
1718
895
  },
1719
896
  // AM, PM, midnight, noon
1720
- b: function (date, token, localize) {
897
+ b: function b(date, token, localize) {
1721
898
  var hours = date.getUTCHours();
1722
899
  var dayPeriodEnumValue;
1723
-
1724
900
  if (hours === 12) {
1725
901
  dayPeriodEnumValue = dayPeriodEnum.noon;
1726
902
  } else if (hours === 0) {
@@ -1728,7 +904,6 @@ var formatters = {
1728
904
  } else {
1729
905
  dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
1730
906
  }
1731
-
1732
907
  switch (token) {
1733
908
  case 'b':
1734
909
  case 'bb':
@@ -1736,19 +911,16 @@ var formatters = {
1736
911
  width: 'abbreviated',
1737
912
  context: 'formatting'
1738
913
  });
1739
-
1740
914
  case 'bbb':
1741
915
  return localize.dayPeriod(dayPeriodEnumValue, {
1742
916
  width: 'abbreviated',
1743
917
  context: 'formatting'
1744
918
  }).toLowerCase();
1745
-
1746
919
  case 'bbbbb':
1747
920
  return localize.dayPeriod(dayPeriodEnumValue, {
1748
921
  width: 'narrow',
1749
922
  context: 'formatting'
1750
923
  });
1751
-
1752
924
  case 'bbbb':
1753
925
  default:
1754
926
  return localize.dayPeriod(dayPeriodEnumValue, {
@@ -1758,10 +930,9 @@ var formatters = {
1758
930
  }
1759
931
  },
1760
932
  // in the morning, in the afternoon, in the evening, at night
1761
- B: function (date, token, localize) {
933
+ B: function B(date, token, localize) {
1762
934
  var hours = date.getUTCHours();
1763
935
  var dayPeriodEnumValue;
1764
-
1765
936
  if (hours >= 17) {
1766
937
  dayPeriodEnumValue = dayPeriodEnum.evening;
1767
938
  } else if (hours >= 12) {
@@ -1771,7 +942,6 @@ var formatters = {
1771
942
  } else {
1772
943
  dayPeriodEnumValue = dayPeriodEnum.night;
1773
944
  }
1774
-
1775
945
  switch (token) {
1776
946
  case 'B':
1777
947
  case 'BB':
@@ -1780,13 +950,11 @@ var formatters = {
1780
950
  width: 'abbreviated',
1781
951
  context: 'formatting'
1782
952
  });
1783
-
1784
953
  case 'BBBBB':
1785
954
  return localize.dayPeriod(dayPeriodEnumValue, {
1786
955
  width: 'narrow',
1787
956
  context: 'formatting'
1788
957
  });
1789
-
1790
958
  case 'BBBB':
1791
959
  default:
1792
960
  return localize.dayPeriod(dayPeriodEnumValue, {
@@ -1796,7 +964,7 @@ var formatters = {
1796
964
  }
1797
965
  },
1798
966
  // Hour [1-12]
1799
- h: function (date, token, localize) {
967
+ h: function h(date, token, localize) {
1800
968
  if (token === 'ho') {
1801
969
  var hours = date.getUTCHours() % 12;
1802
970
  if (hours === 0) hours = 12;
@@ -1804,133 +972,119 @@ var formatters = {
1804
972
  unit: 'hour'
1805
973
  });
1806
974
  }
1807
-
1808
975
  return formatters$1.h(date, token);
1809
976
  },
1810
977
  // Hour [0-23]
1811
- H: function (date, token, localize) {
978
+ H: function H(date, token, localize) {
1812
979
  if (token === 'Ho') {
1813
980
  return localize.ordinalNumber(date.getUTCHours(), {
1814
981
  unit: 'hour'
1815
982
  });
1816
983
  }
1817
-
1818
984
  return formatters$1.H(date, token);
1819
985
  },
1820
986
  // Hour [0-11]
1821
- K: function (date, token, localize) {
987
+ K: function K(date, token, localize) {
1822
988
  var hours = date.getUTCHours() % 12;
1823
-
1824
989
  if (token === 'Ko') {
1825
990
  return localize.ordinalNumber(hours, {
1826
991
  unit: 'hour'
1827
992
  });
1828
993
  }
1829
-
1830
994
  return addLeadingZeros(hours, token.length);
1831
995
  },
1832
996
  // Hour [1-24]
1833
- k: function (date, token, localize) {
997
+ k: function k(date, token, localize) {
1834
998
  var hours = date.getUTCHours();
1835
999
  if (hours === 0) hours = 24;
1836
-
1837
1000
  if (token === 'ko') {
1838
1001
  return localize.ordinalNumber(hours, {
1839
1002
  unit: 'hour'
1840
1003
  });
1841
1004
  }
1842
-
1843
1005
  return addLeadingZeros(hours, token.length);
1844
1006
  },
1845
1007
  // Minute
1846
- m: function (date, token, localize) {
1008
+ m: function m(date, token, localize) {
1847
1009
  if (token === 'mo') {
1848
1010
  return localize.ordinalNumber(date.getUTCMinutes(), {
1849
1011
  unit: 'minute'
1850
1012
  });
1851
1013
  }
1852
-
1853
1014
  return formatters$1.m(date, token);
1854
1015
  },
1855
1016
  // Second
1856
- s: function (date, token, localize) {
1017
+ s: function s(date, token, localize) {
1857
1018
  if (token === 'so') {
1858
1019
  return localize.ordinalNumber(date.getUTCSeconds(), {
1859
1020
  unit: 'second'
1860
1021
  });
1861
1022
  }
1862
-
1863
1023
  return formatters$1.s(date, token);
1864
1024
  },
1865
1025
  // Fraction of second
1866
- S: function (date, token) {
1026
+ S: function S(date, token) {
1867
1027
  return formatters$1.S(date, token);
1868
1028
  },
1869
1029
  // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1870
- X: function (date, token, _localize, options) {
1030
+ X: function X(date, token, _localize, options) {
1871
1031
  var originalDate = options._originalDate || date;
1872
1032
  var timezoneOffset = originalDate.getTimezoneOffset();
1873
-
1874
1033
  if (timezoneOffset === 0) {
1875
1034
  return 'Z';
1876
1035
  }
1877
-
1878
1036
  switch (token) {
1879
1037
  // Hours and optional minutes
1880
1038
  case 'X':
1881
1039
  return formatTimezoneWithOptionalMinutes(timezoneOffset);
1040
+
1882
1041
  // Hours, minutes and optional seconds without `:` delimiter
1883
1042
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1884
1043
  // so this token always has the same output as `XX`
1885
-
1886
1044
  case 'XXXX':
1887
1045
  case 'XX':
1888
1046
  // Hours and minutes without `:` delimiter
1889
1047
  return formatTimezone(timezoneOffset);
1048
+
1890
1049
  // Hours, minutes and optional seconds with `:` delimiter
1891
1050
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1892
1051
  // so this token always has the same output as `XXX`
1893
-
1894
1052
  case 'XXXXX':
1895
1053
  case 'XXX': // Hours and minutes with `:` delimiter
1896
-
1897
1054
  default:
1898
1055
  return formatTimezone(timezoneOffset, ':');
1899
1056
  }
1900
1057
  },
1901
1058
  // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
1902
- x: function (date, token, _localize, options) {
1059
+ x: function x(date, token, _localize, options) {
1903
1060
  var originalDate = options._originalDate || date;
1904
1061
  var timezoneOffset = originalDate.getTimezoneOffset();
1905
-
1906
1062
  switch (token) {
1907
1063
  // Hours and optional minutes
1908
1064
  case 'x':
1909
1065
  return formatTimezoneWithOptionalMinutes(timezoneOffset);
1066
+
1910
1067
  // Hours, minutes and optional seconds without `:` delimiter
1911
1068
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1912
1069
  // so this token always has the same output as `xx`
1913
-
1914
1070
  case 'xxxx':
1915
1071
  case 'xx':
1916
1072
  // Hours and minutes without `:` delimiter
1917
1073
  return formatTimezone(timezoneOffset);
1074
+
1918
1075
  // Hours, minutes and optional seconds with `:` delimiter
1919
1076
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1920
1077
  // so this token always has the same output as `xxx`
1921
-
1922
1078
  case 'xxxxx':
1923
1079
  case 'xxx': // Hours and minutes with `:` delimiter
1924
-
1925
1080
  default:
1926
1081
  return formatTimezone(timezoneOffset, ':');
1927
1082
  }
1928
1083
  },
1929
1084
  // Timezone (GMT)
1930
- O: function (date, token, _localize, options) {
1085
+ O: function O(date, token, _localize, options) {
1931
1086
  var originalDate = options._originalDate || date;
1932
1087
  var timezoneOffset = originalDate.getTimezoneOffset();
1933
-
1934
1088
  switch (token) {
1935
1089
  // Short
1936
1090
  case 'O':
@@ -1938,17 +1092,15 @@ var formatters = {
1938
1092
  case 'OOO':
1939
1093
  return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
1940
1094
  // Long
1941
-
1942
1095
  case 'OOOO':
1943
1096
  default:
1944
1097
  return 'GMT' + formatTimezone(timezoneOffset, ':');
1945
1098
  }
1946
1099
  },
1947
1100
  // Timezone (specific non-location)
1948
- z: function (date, token, _localize, options) {
1101
+ z: function z(date, token, _localize, options) {
1949
1102
  var originalDate = options._originalDate || date;
1950
1103
  var timezoneOffset = originalDate.getTimezoneOffset();
1951
-
1952
1104
  switch (token) {
1953
1105
  // Short
1954
1106
  case 'z':
@@ -1956,173 +1108,628 @@ var formatters = {
1956
1108
  case 'zzz':
1957
1109
  return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
1958
1110
  // Long
1959
-
1960
1111
  case 'zzzz':
1961
1112
  default:
1962
1113
  return 'GMT' + formatTimezone(timezoneOffset, ':');
1963
1114
  }
1964
1115
  },
1965
1116
  // Seconds timestamp
1966
- t: function (date, token, _localize, options) {
1117
+ t: function t(date, token, _localize, options) {
1967
1118
  var originalDate = options._originalDate || date;
1968
1119
  var timestamp = Math.floor(originalDate.getTime() / 1000);
1969
1120
  return addLeadingZeros(timestamp, token.length);
1970
1121
  },
1971
1122
  // Milliseconds timestamp
1972
- T: function (date, token, _localize, options) {
1123
+ T: function T(date, token, _localize, options) {
1973
1124
  var originalDate = options._originalDate || date;
1974
1125
  var timestamp = originalDate.getTime();
1975
1126
  return addLeadingZeros(timestamp, token.length);
1976
1127
  }
1977
1128
  };
1129
+ function formatTimezoneShort(offset, dirtyDelimiter) {
1130
+ var sign = offset > 0 ? '-' : '+';
1131
+ var absOffset = Math.abs(offset);
1132
+ var hours = Math.floor(absOffset / 60);
1133
+ var minutes = absOffset % 60;
1134
+ if (minutes === 0) {
1135
+ return sign + String(hours);
1136
+ }
1137
+ var delimiter = dirtyDelimiter || '';
1138
+ return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
1139
+ }
1140
+ function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
1141
+ if (offset % 60 === 0) {
1142
+ var sign = offset > 0 ? '-' : '+';
1143
+ return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
1144
+ }
1145
+ return formatTimezone(offset, dirtyDelimiter);
1146
+ }
1147
+ function formatTimezone(offset, dirtyDelimiter) {
1148
+ var delimiter = dirtyDelimiter || '';
1149
+ var sign = offset > 0 ? '-' : '+';
1150
+ var absOffset = Math.abs(offset);
1151
+ var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);
1152
+ var minutes = addLeadingZeros(absOffset % 60, 2);
1153
+ return sign + hours + delimiter + minutes;
1154
+ }
1155
+
1156
+ var dateLongFormatter = function dateLongFormatter(pattern, formatLong) {
1157
+ switch (pattern) {
1158
+ case 'P':
1159
+ return formatLong.date({
1160
+ width: 'short'
1161
+ });
1162
+ case 'PP':
1163
+ return formatLong.date({
1164
+ width: 'medium'
1165
+ });
1166
+ case 'PPP':
1167
+ return formatLong.date({
1168
+ width: 'long'
1169
+ });
1170
+ case 'PPPP':
1171
+ default:
1172
+ return formatLong.date({
1173
+ width: 'full'
1174
+ });
1175
+ }
1176
+ };
1177
+ var timeLongFormatter = function timeLongFormatter(pattern, formatLong) {
1178
+ switch (pattern) {
1179
+ case 'p':
1180
+ return formatLong.time({
1181
+ width: 'short'
1182
+ });
1183
+ case 'pp':
1184
+ return formatLong.time({
1185
+ width: 'medium'
1186
+ });
1187
+ case 'ppp':
1188
+ return formatLong.time({
1189
+ width: 'long'
1190
+ });
1191
+ case 'pppp':
1192
+ default:
1193
+ return formatLong.time({
1194
+ width: 'full'
1195
+ });
1196
+ }
1197
+ };
1198
+ var dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong) {
1199
+ var matchResult = pattern.match(/(P+)(p+)?/) || [];
1200
+ var datePattern = matchResult[1];
1201
+ var timePattern = matchResult[2];
1202
+ if (!timePattern) {
1203
+ return dateLongFormatter(pattern, formatLong);
1204
+ }
1205
+ var dateTimeFormat;
1206
+ switch (datePattern) {
1207
+ case 'P':
1208
+ dateTimeFormat = formatLong.dateTime({
1209
+ width: 'short'
1210
+ });
1211
+ break;
1212
+ case 'PP':
1213
+ dateTimeFormat = formatLong.dateTime({
1214
+ width: 'medium'
1215
+ });
1216
+ break;
1217
+ case 'PPP':
1218
+ dateTimeFormat = formatLong.dateTime({
1219
+ width: 'long'
1220
+ });
1221
+ break;
1222
+ case 'PPPP':
1223
+ default:
1224
+ dateTimeFormat = formatLong.dateTime({
1225
+ width: 'full'
1226
+ });
1227
+ break;
1228
+ }
1229
+ return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));
1230
+ };
1231
+ var longFormatters = {
1232
+ p: timeLongFormatter,
1233
+ P: dateTimeLongFormatter
1234
+ };
1235
+
1236
+ var protectedDayOfYearTokens = ['D', 'DD'];
1237
+ var protectedWeekYearTokens = ['YY', 'YYYY'];
1238
+ function isProtectedDayOfYearToken(token) {
1239
+ return protectedDayOfYearTokens.indexOf(token) !== -1;
1240
+ }
1241
+ function isProtectedWeekYearToken(token) {
1242
+ return protectedWeekYearTokens.indexOf(token) !== -1;
1243
+ }
1244
+ function throwProtectedError(token, format, input) {
1245
+ if (token === 'YYYY') {
1246
+ 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"));
1247
+ } else if (token === 'YY') {
1248
+ 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"));
1249
+ } else if (token === 'D') {
1250
+ 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"));
1251
+ } else if (token === 'DD') {
1252
+ 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"));
1253
+ }
1254
+ }
1255
+
1256
+ var formatDistanceLocale = {
1257
+ lessThanXSeconds: {
1258
+ one: 'less than a second',
1259
+ other: 'less than {{count}} seconds'
1260
+ },
1261
+ xSeconds: {
1262
+ one: '1 second',
1263
+ other: '{{count}} seconds'
1264
+ },
1265
+ halfAMinute: 'half a minute',
1266
+ lessThanXMinutes: {
1267
+ one: 'less than a minute',
1268
+ other: 'less than {{count}} minutes'
1269
+ },
1270
+ xMinutes: {
1271
+ one: '1 minute',
1272
+ other: '{{count}} minutes'
1273
+ },
1274
+ aboutXHours: {
1275
+ one: 'about 1 hour',
1276
+ other: 'about {{count}} hours'
1277
+ },
1278
+ xHours: {
1279
+ one: '1 hour',
1280
+ other: '{{count}} hours'
1281
+ },
1282
+ xDays: {
1283
+ one: '1 day',
1284
+ other: '{{count}} days'
1285
+ },
1286
+ aboutXWeeks: {
1287
+ one: 'about 1 week',
1288
+ other: 'about {{count}} weeks'
1289
+ },
1290
+ xWeeks: {
1291
+ one: '1 week',
1292
+ other: '{{count}} weeks'
1293
+ },
1294
+ aboutXMonths: {
1295
+ one: 'about 1 month',
1296
+ other: 'about {{count}} months'
1297
+ },
1298
+ xMonths: {
1299
+ one: '1 month',
1300
+ other: '{{count}} months'
1301
+ },
1302
+ aboutXYears: {
1303
+ one: 'about 1 year',
1304
+ other: 'about {{count}} years'
1305
+ },
1306
+ xYears: {
1307
+ one: '1 year',
1308
+ other: '{{count}} years'
1309
+ },
1310
+ overXYears: {
1311
+ one: 'over 1 year',
1312
+ other: 'over {{count}} years'
1313
+ },
1314
+ almostXYears: {
1315
+ one: 'almost 1 year',
1316
+ other: 'almost {{count}} years'
1317
+ }
1318
+ };
1319
+ var formatDistance = function formatDistance(token, count, options) {
1320
+ var result;
1321
+ var tokenValue = formatDistanceLocale[token];
1322
+ if (typeof tokenValue === 'string') {
1323
+ result = tokenValue;
1324
+ } else if (count === 1) {
1325
+ result = tokenValue.one;
1326
+ } else {
1327
+ result = tokenValue.other.replace('{{count}}', count.toString());
1328
+ }
1329
+ if (options !== null && options !== void 0 && options.addSuffix) {
1330
+ if (options.comparison && options.comparison > 0) {
1331
+ return 'in ' + result;
1332
+ } else {
1333
+ return result + ' ago';
1334
+ }
1335
+ }
1336
+ return result;
1337
+ };
1978
1338
 
1979
- function formatTimezoneShort(offset, dirtyDelimiter) {
1980
- var sign = offset > 0 ? '-' : '+';
1981
- var absOffset = Math.abs(offset);
1982
- var hours = Math.floor(absOffset / 60);
1983
- var minutes = absOffset % 60;
1984
-
1985
- if (minutes === 0) {
1986
- return sign + String(hours);
1987
- }
1988
-
1989
- var delimiter = dirtyDelimiter || '';
1990
- return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
1339
+ function buildFormatLongFn(args) {
1340
+ return function () {
1341
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1342
+ // TODO: Remove String()
1343
+ var width = options.width ? String(options.width) : args.defaultWidth;
1344
+ var format = args.formats[width] || args.formats[args.defaultWidth];
1345
+ return format;
1346
+ };
1991
1347
  }
1992
1348
 
1993
- function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
1994
- if (offset % 60 === 0) {
1995
- var sign = offset > 0 ? '-' : '+';
1996
- return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
1997
- }
1349
+ var dateFormats = {
1350
+ full: 'EEEE, MMMM do, y',
1351
+ long: 'MMMM do, y',
1352
+ medium: 'MMM d, y',
1353
+ short: 'MM/dd/yyyy'
1354
+ };
1355
+ var timeFormats = {
1356
+ full: 'h:mm:ss a zzzz',
1357
+ long: 'h:mm:ss a z',
1358
+ medium: 'h:mm:ss a',
1359
+ short: 'h:mm a'
1360
+ };
1361
+ var dateTimeFormats = {
1362
+ full: "{{date}} 'at' {{time}}",
1363
+ long: "{{date}} 'at' {{time}}",
1364
+ medium: '{{date}}, {{time}}',
1365
+ short: '{{date}}, {{time}}'
1366
+ };
1367
+ var formatLong = {
1368
+ date: buildFormatLongFn({
1369
+ formats: dateFormats,
1370
+ defaultWidth: 'full'
1371
+ }),
1372
+ time: buildFormatLongFn({
1373
+ formats: timeFormats,
1374
+ defaultWidth: 'full'
1375
+ }),
1376
+ dateTime: buildFormatLongFn({
1377
+ formats: dateTimeFormats,
1378
+ defaultWidth: 'full'
1379
+ })
1380
+ };
1998
1381
 
1999
- return formatTimezone(offset, dirtyDelimiter);
2000
- }
1382
+ var formatRelativeLocale = {
1383
+ lastWeek: "'last' eeee 'at' p",
1384
+ yesterday: "'yesterday at' p",
1385
+ today: "'today at' p",
1386
+ tomorrow: "'tomorrow at' p",
1387
+ nextWeek: "eeee 'at' p",
1388
+ other: 'P'
1389
+ };
1390
+ var formatRelative = function formatRelative(token, _date, _baseDate, _options) {
1391
+ return formatRelativeLocale[token];
1392
+ };
2001
1393
 
2002
- function formatTimezone(offset, dirtyDelimiter) {
2003
- var delimiter = dirtyDelimiter || '';
2004
- var sign = offset > 0 ? '-' : '+';
2005
- var absOffset = Math.abs(offset);
2006
- var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);
2007
- var minutes = addLeadingZeros(absOffset % 60, 2);
2008
- return sign + hours + delimiter + minutes;
1394
+ function buildLocalizeFn(args) {
1395
+ return function (dirtyIndex, options) {
1396
+ var context = options !== null && options !== void 0 && options.context ? String(options.context) : 'standalone';
1397
+ var valuesArray;
1398
+ if (context === 'formatting' && args.formattingValues) {
1399
+ var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
1400
+ var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
1401
+ valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
1402
+ } else {
1403
+ var _defaultWidth = args.defaultWidth;
1404
+ var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
1405
+ valuesArray = args.values[_width] || args.values[_defaultWidth];
1406
+ }
1407
+ var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
1408
+ // @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!
1409
+ return valuesArray[index];
1410
+ };
2009
1411
  }
2010
1412
 
2011
- function dateLongFormatter(pattern, formatLong) {
2012
- switch (pattern) {
2013
- case 'P':
2014
- return formatLong.date({
2015
- width: 'short'
2016
- });
2017
-
2018
- case 'PP':
2019
- return formatLong.date({
2020
- width: 'medium'
2021
- });
2022
-
2023
- case 'PPP':
2024
- return formatLong.date({
2025
- width: 'long'
2026
- });
1413
+ var eraValues = {
1414
+ narrow: ['B', 'A'],
1415
+ abbreviated: ['BC', 'AD'],
1416
+ wide: ['Before Christ', 'Anno Domini']
1417
+ };
1418
+ var quarterValues = {
1419
+ narrow: ['1', '2', '3', '4'],
1420
+ abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
1421
+ wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']
1422
+ };
2027
1423
 
2028
- case 'PPPP':
2029
- default:
2030
- return formatLong.date({
2031
- width: 'full'
2032
- });
1424
+ // Note: in English, the names of days of the week and months are capitalized.
1425
+ // If you are making a new locale based on this one, check if the same is true for the language you're working on.
1426
+ // Generally, formatted dates should look like they are in the middle of a sentence,
1427
+ // e.g. in Spanish language the weekdays and months should be in the lowercase.
1428
+ var monthValues = {
1429
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
1430
+ abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
1431
+ wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
1432
+ };
1433
+ var dayValues = {
1434
+ narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
1435
+ short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
1436
+ abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
1437
+ wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
1438
+ };
1439
+ var dayPeriodValues = {
1440
+ narrow: {
1441
+ am: 'a',
1442
+ pm: 'p',
1443
+ midnight: 'mi',
1444
+ noon: 'n',
1445
+ morning: 'morning',
1446
+ afternoon: 'afternoon',
1447
+ evening: 'evening',
1448
+ night: 'night'
1449
+ },
1450
+ abbreviated: {
1451
+ am: 'AM',
1452
+ pm: 'PM',
1453
+ midnight: 'midnight',
1454
+ noon: 'noon',
1455
+ morning: 'morning',
1456
+ afternoon: 'afternoon',
1457
+ evening: 'evening',
1458
+ night: 'night'
1459
+ },
1460
+ wide: {
1461
+ am: 'a.m.',
1462
+ pm: 'p.m.',
1463
+ midnight: 'midnight',
1464
+ noon: 'noon',
1465
+ morning: 'morning',
1466
+ afternoon: 'afternoon',
1467
+ evening: 'evening',
1468
+ night: 'night'
2033
1469
  }
2034
- }
2035
-
2036
- function timeLongFormatter(pattern, formatLong) {
2037
- switch (pattern) {
2038
- case 'p':
2039
- return formatLong.time({
2040
- width: 'short'
2041
- });
1470
+ };
1471
+ var formattingDayPeriodValues = {
1472
+ narrow: {
1473
+ am: 'a',
1474
+ pm: 'p',
1475
+ midnight: 'mi',
1476
+ noon: 'n',
1477
+ morning: 'in the morning',
1478
+ afternoon: 'in the afternoon',
1479
+ evening: 'in the evening',
1480
+ night: 'at night'
1481
+ },
1482
+ abbreviated: {
1483
+ am: 'AM',
1484
+ pm: 'PM',
1485
+ midnight: 'midnight',
1486
+ noon: 'noon',
1487
+ morning: 'in the morning',
1488
+ afternoon: 'in the afternoon',
1489
+ evening: 'in the evening',
1490
+ night: 'at night'
1491
+ },
1492
+ wide: {
1493
+ am: 'a.m.',
1494
+ pm: 'p.m.',
1495
+ midnight: 'midnight',
1496
+ noon: 'noon',
1497
+ morning: 'in the morning',
1498
+ afternoon: 'in the afternoon',
1499
+ evening: 'in the evening',
1500
+ night: 'at night'
1501
+ }
1502
+ };
1503
+ var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
1504
+ var number = Number(dirtyNumber);
2042
1505
 
2043
- case 'pp':
2044
- return formatLong.time({
2045
- width: 'medium'
2046
- });
1506
+ // If ordinal numbers depend on context, for example,
1507
+ // if they are different for different grammatical genders,
1508
+ // use `options.unit`.
1509
+ //
1510
+ // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
1511
+ // 'day', 'hour', 'minute', 'second'.
2047
1512
 
2048
- case 'ppp':
2049
- return formatLong.time({
2050
- width: 'long'
2051
- });
1513
+ var rem100 = number % 100;
1514
+ if (rem100 > 20 || rem100 < 10) {
1515
+ switch (rem100 % 10) {
1516
+ case 1:
1517
+ return number + 'st';
1518
+ case 2:
1519
+ return number + 'nd';
1520
+ case 3:
1521
+ return number + 'rd';
1522
+ }
1523
+ }
1524
+ return number + 'th';
1525
+ };
1526
+ var localize = {
1527
+ ordinalNumber: ordinalNumber,
1528
+ era: buildLocalizeFn({
1529
+ values: eraValues,
1530
+ defaultWidth: 'wide'
1531
+ }),
1532
+ quarter: buildLocalizeFn({
1533
+ values: quarterValues,
1534
+ defaultWidth: 'wide',
1535
+ argumentCallback: function argumentCallback(quarter) {
1536
+ return quarter - 1;
1537
+ }
1538
+ }),
1539
+ month: buildLocalizeFn({
1540
+ values: monthValues,
1541
+ defaultWidth: 'wide'
1542
+ }),
1543
+ day: buildLocalizeFn({
1544
+ values: dayValues,
1545
+ defaultWidth: 'wide'
1546
+ }),
1547
+ dayPeriod: buildLocalizeFn({
1548
+ values: dayPeriodValues,
1549
+ defaultWidth: 'wide',
1550
+ formattingValues: formattingDayPeriodValues,
1551
+ defaultFormattingWidth: 'wide'
1552
+ })
1553
+ };
2052
1554
 
2053
- case 'pppp':
2054
- default:
2055
- return formatLong.time({
2056
- width: 'full'
2057
- });
2058
- }
1555
+ function buildMatchFn(args) {
1556
+ return function (string) {
1557
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1558
+ var width = options.width;
1559
+ var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
1560
+ var matchResult = string.match(matchPattern);
1561
+ if (!matchResult) {
1562
+ return null;
1563
+ }
1564
+ var matchedString = matchResult[0];
1565
+ var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
1566
+ var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {
1567
+ return pattern.test(matchedString);
1568
+ }) : findKey(parsePatterns, function (pattern) {
1569
+ return pattern.test(matchedString);
1570
+ });
1571
+ var value;
1572
+ value = args.valueCallback ? args.valueCallback(key) : key;
1573
+ value = options.valueCallback ? options.valueCallback(value) : value;
1574
+ var rest = string.slice(matchedString.length);
1575
+ return {
1576
+ value: value,
1577
+ rest: rest
1578
+ };
1579
+ };
2059
1580
  }
2060
-
2061
- function dateTimeLongFormatter(pattern, formatLong) {
2062
- var matchResult = pattern.match(/(P+)(p+)?/) || [];
2063
- var datePattern = matchResult[1];
2064
- var timePattern = matchResult[2];
2065
-
2066
- if (!timePattern) {
2067
- return dateLongFormatter(pattern, formatLong);
1581
+ function findKey(object, predicate) {
1582
+ for (var key in object) {
1583
+ if (object.hasOwnProperty(key) && predicate(object[key])) {
1584
+ return key;
1585
+ }
2068
1586
  }
2069
-
2070
- var dateTimeFormat;
2071
-
2072
- switch (datePattern) {
2073
- case 'P':
2074
- dateTimeFormat = formatLong.dateTime({
2075
- width: 'short'
2076
- });
2077
- break;
2078
-
2079
- case 'PP':
2080
- dateTimeFormat = formatLong.dateTime({
2081
- width: 'medium'
2082
- });
2083
- break;
2084
-
2085
- case 'PPP':
2086
- dateTimeFormat = formatLong.dateTime({
2087
- width: 'long'
2088
- });
2089
- break;
2090
-
2091
- case 'PPPP':
2092
- default:
2093
- dateTimeFormat = formatLong.dateTime({
2094
- width: 'full'
2095
- });
2096
- break;
1587
+ return undefined;
1588
+ }
1589
+ function findIndex(array, predicate) {
1590
+ for (var key = 0; key < array.length; key++) {
1591
+ if (predicate(array[key])) {
1592
+ return key;
1593
+ }
2097
1594
  }
1595
+ return undefined;
1596
+ }
2098
1597
 
2099
- return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));
1598
+ function buildMatchPatternFn(args) {
1599
+ return function (string) {
1600
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1601
+ var matchResult = string.match(args.matchPattern);
1602
+ if (!matchResult) return null;
1603
+ var matchedString = matchResult[0];
1604
+ var parseResult = string.match(args.parsePattern);
1605
+ if (!parseResult) return null;
1606
+ var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
1607
+ value = options.valueCallback ? options.valueCallback(value) : value;
1608
+ var rest = string.slice(matchedString.length);
1609
+ return {
1610
+ value: value,
1611
+ rest: rest
1612
+ };
1613
+ };
2100
1614
  }
2101
1615
 
2102
- var longFormatters = {
2103
- p: timeLongFormatter,
2104
- P: dateTimeLongFormatter
1616
+ var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
1617
+ var parseOrdinalNumberPattern = /\d+/i;
1618
+ var matchEraPatterns = {
1619
+ narrow: /^(b|a)/i,
1620
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
1621
+ wide: /^(before christ|before common era|anno domini|common era)/i
1622
+ };
1623
+ var parseEraPatterns = {
1624
+ any: [/^b/i, /^(a|c)/i]
1625
+ };
1626
+ var matchQuarterPatterns = {
1627
+ narrow: /^[1234]/i,
1628
+ abbreviated: /^q[1234]/i,
1629
+ wide: /^[1234](th|st|nd|rd)? quarter/i
1630
+ };
1631
+ var parseQuarterPatterns = {
1632
+ any: [/1/i, /2/i, /3/i, /4/i]
1633
+ };
1634
+ var matchMonthPatterns = {
1635
+ narrow: /^[jfmasond]/i,
1636
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
1637
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
1638
+ };
1639
+ var parseMonthPatterns = {
1640
+ 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],
1641
+ 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]
1642
+ };
1643
+ var matchDayPatterns = {
1644
+ narrow: /^[smtwf]/i,
1645
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
1646
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
1647
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
1648
+ };
1649
+ var parseDayPatterns = {
1650
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
1651
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
1652
+ };
1653
+ var matchDayPeriodPatterns = {
1654
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
1655
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
1656
+ };
1657
+ var parseDayPeriodPatterns = {
1658
+ any: {
1659
+ am: /^a/i,
1660
+ pm: /^p/i,
1661
+ midnight: /^mi/i,
1662
+ noon: /^no/i,
1663
+ morning: /morning/i,
1664
+ afternoon: /afternoon/i,
1665
+ evening: /evening/i,
1666
+ night: /night/i
1667
+ }
1668
+ };
1669
+ var match = {
1670
+ ordinalNumber: buildMatchPatternFn({
1671
+ matchPattern: matchOrdinalNumberPattern,
1672
+ parsePattern: parseOrdinalNumberPattern,
1673
+ valueCallback: function valueCallback(value) {
1674
+ return parseInt(value, 10);
1675
+ }
1676
+ }),
1677
+ era: buildMatchFn({
1678
+ matchPatterns: matchEraPatterns,
1679
+ defaultMatchWidth: 'wide',
1680
+ parsePatterns: parseEraPatterns,
1681
+ defaultParseWidth: 'any'
1682
+ }),
1683
+ quarter: buildMatchFn({
1684
+ matchPatterns: matchQuarterPatterns,
1685
+ defaultMatchWidth: 'wide',
1686
+ parsePatterns: parseQuarterPatterns,
1687
+ defaultParseWidth: 'any',
1688
+ valueCallback: function valueCallback(index) {
1689
+ return index + 1;
1690
+ }
1691
+ }),
1692
+ month: buildMatchFn({
1693
+ matchPatterns: matchMonthPatterns,
1694
+ defaultMatchWidth: 'wide',
1695
+ parsePatterns: parseMonthPatterns,
1696
+ defaultParseWidth: 'any'
1697
+ }),
1698
+ day: buildMatchFn({
1699
+ matchPatterns: matchDayPatterns,
1700
+ defaultMatchWidth: 'wide',
1701
+ parsePatterns: parseDayPatterns,
1702
+ defaultParseWidth: 'any'
1703
+ }),
1704
+ dayPeriod: buildMatchFn({
1705
+ matchPatterns: matchDayPeriodPatterns,
1706
+ defaultMatchWidth: 'any',
1707
+ parsePatterns: parseDayPeriodPatterns,
1708
+ defaultParseWidth: 'any'
1709
+ })
2105
1710
  };
2106
1711
 
2107
- var protectedDayOfYearTokens = ['D', 'DD'];
2108
- var protectedWeekYearTokens = ['YY', 'YYYY'];
2109
- function isProtectedDayOfYearToken(token) {
2110
- return protectedDayOfYearTokens.indexOf(token) !== -1;
2111
- }
2112
- function isProtectedWeekYearToken(token) {
2113
- return protectedWeekYearTokens.indexOf(token) !== -1;
2114
- }
2115
- function throwProtectedError(token, format, input) {
2116
- if (token === 'YYYY') {
2117
- throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
2118
- } else if (token === 'YY') {
2119
- throw new RangeError("Use `yy` instead of `YY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
2120
- } else if (token === 'D') {
2121
- throw new RangeError("Use `d` instead of `D` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://git.io/fxCyr"));
2122
- } else if (token === 'DD') {
2123
- throw new RangeError("Use `dd` instead of `DD` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://git.io/fxCyr"));
1712
+ /**
1713
+ * @type {Locale}
1714
+ * @category Locales
1715
+ * @summary English locale (United States).
1716
+ * @language English
1717
+ * @iso-639-2 eng
1718
+ * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
1719
+ * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
1720
+ */
1721
+ var locale = {
1722
+ code: 'en-US',
1723
+ formatDistance: formatDistance,
1724
+ formatLong: formatLong,
1725
+ formatRelative: formatRelative,
1726
+ localize: localize,
1727
+ match: match,
1728
+ options: {
1729
+ weekStartsOn: 0 /* Sunday */,
1730
+ firstWeekContainsDate: 1
2124
1731
  }
2125
- }
1732
+ };
2126
1733
 
2127
1734
  // - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
2128
1735
  // (one of the certain letters followed by `o`)
@@ -2134,14 +1741,15 @@ function throwProtectedError(token, format, input) {
2134
1741
  // If there is no matching single quote
2135
1742
  // then the sequence will continue until the end of the string.
2136
1743
  // - . matches any single character unmatched by previous parts of the RegExps
1744
+ var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
2137
1745
 
2138
- var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also
1746
+ // This RegExp catches symbols escaped by quotes, and also
2139
1747
  // sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
2140
-
2141
1748
  var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
2142
1749
  var escapedStringRegExp = /^'([^]*?)'?$/;
2143
1750
  var doubleQuoteRegExp = /''/g;
2144
1751
  var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
1752
+
2145
1753
  /**
2146
1754
  * @name format
2147
1755
  * @category Common Helpers
@@ -2151,7 +1759,7 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
2151
1759
  * Return the formatted date string in the given format. The result may vary by locale.
2152
1760
  *
2153
1761
  * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
2154
- * > See: https://git.io/fxCyr
1762
+ * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2155
1763
  *
2156
1764
  * The characters wrapped between two single quotes characters (') are escaped.
2157
1765
  * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
@@ -2387,30 +1995,10 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
2387
1995
  * - `p`: long localized time
2388
1996
  *
2389
1997
  * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
2390
- * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr
1998
+ * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2391
1999
  *
2392
2000
  * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
2393
- * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr
2394
- *
2395
- * ### v2.0.0 breaking changes:
2396
- *
2397
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
2398
- *
2399
- * - The second argument is now required for the sake of explicitness.
2400
- *
2401
- * ```javascript
2402
- * // Before v2.0.0
2403
- * format(new Date(2016, 0, 1))
2404
- *
2405
- * // v2.0.0 onward
2406
- * format(new Date(2016, 0, 1), "yyyy-MM-dd'T'HH:mm:ss.SSSxxx")
2407
- * ```
2408
- *
2409
- * - New format string API for `format` function
2410
- * which is based on [Unicode Technical Standard #35](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).
2411
- * See [this post](https://blog.date-fns.org/post/unicode-tokens-in-date-fns-v2-sreatyki91jg) for more details.
2412
- *
2413
- * - Characters are now escaped using single quote symbols (`'`) instead of square brackets.
2001
+ * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2414
2002
  *
2415
2003
  * @param {Date|Number} date - the original date
2416
2004
  * @param {String} format - the string of tokens
@@ -2419,9 +2007,9 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
2419
2007
  * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
2420
2008
  * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is
2421
2009
  * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;
2422
- * see: https://git.io/fxCyr
2010
+ * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2423
2011
  * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;
2424
- * see: https://git.io/fxCyr
2012
+ * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2425
2013
  * @returns {String} the formatted date string
2426
2014
  * @throws {TypeError} 2 arguments required
2427
2015
  * @throws {RangeError} `date` must not be Invalid Date
@@ -2429,69 +2017,63 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
2429
2017
  * @throws {RangeError} `options.locale` must contain `formatLong` property
2430
2018
  * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
2431
2019
  * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
2432
- * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr
2433
- * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr
2434
- * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr
2435
- * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr
2020
+ * @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
2021
+ * @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
2022
+ * @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
2023
+ * @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
2436
2024
  * @throws {RangeError} format string contains an unescaped latin alphabet character
2437
2025
  *
2438
2026
  * @example
2439
2027
  * // Represent 11 February 2014 in middle-endian format:
2440
- * var result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
2028
+ * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
2441
2029
  * //=> '02/11/2014'
2442
2030
  *
2443
2031
  * @example
2444
2032
  * // Represent 2 July 2014 in Esperanto:
2445
2033
  * import { eoLocale } from 'date-fns/locale/eo'
2446
- * var result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
2034
+ * const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
2447
2035
  * locale: eoLocale
2448
2036
  * })
2449
2037
  * //=> '2-a de julio 2014'
2450
2038
  *
2451
2039
  * @example
2452
2040
  * // Escape string by single quote characters:
2453
- * var result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
2041
+ * const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
2454
2042
  * //=> "3 o'clock"
2455
2043
  */
2456
2044
 
2457
- function format(dirtyDate, dirtyFormatStr, dirtyOptions) {
2045
+ function format(dirtyDate, dirtyFormatStr, options) {
2046
+ 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;
2458
2047
  requiredArgs(2, arguments);
2459
2048
  var formatStr = String(dirtyFormatStr);
2460
- var options = dirtyOptions || {};
2461
- var locale$1 = options.locale || locale;
2462
- var localeFirstWeekContainsDate = locale$1.options && locale$1.options.firstWeekContainsDate;
2463
- var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
2464
- var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
2049
+ var defaultOptions = getDefaultOptions();
2050
+ var locale$1 = (_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 : locale;
2051
+ 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);
2465
2052
 
2053
+ // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
2466
2054
  if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
2467
2055
  throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
2468
2056
  }
2057
+ 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);
2469
2058
 
2470
- var localeWeekStartsOn = locale$1.options && locale$1.options.weekStartsOn;
2471
- var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
2472
- var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
2473
-
2059
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
2474
2060
  if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
2475
2061
  throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
2476
2062
  }
2477
-
2478
2063
  if (!locale$1.localize) {
2479
2064
  throw new RangeError('locale must contain localize property');
2480
2065
  }
2481
-
2482
2066
  if (!locale$1.formatLong) {
2483
2067
  throw new RangeError('locale must contain formatLong property');
2484
2068
  }
2485
-
2486
2069
  var originalDate = toDate(dirtyDate);
2487
-
2488
2070
  if (!isValid(originalDate)) {
2489
2071
  throw new RangeError('Invalid time value');
2490
- } // Convert the date in system timezone to the same date in UTC+00:00 timezone.
2072
+ }
2073
+
2074
+ // Convert the date in system timezone to the same date in UTC+00:00 timezone.
2491
2075
  // This ensures that when UTC functions will be implemented, locales will be compatible with them.
2492
2076
  // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376
2493
-
2494
-
2495
2077
  var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);
2496
2078
  var utcDate = subMilliseconds(originalDate, timezoneOffset);
2497
2079
  var formatterOptions = {
@@ -2502,50 +2084,43 @@ function format(dirtyDate, dirtyFormatStr, dirtyOptions) {
2502
2084
  };
2503
2085
  var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {
2504
2086
  var firstCharacter = substring[0];
2505
-
2506
2087
  if (firstCharacter === 'p' || firstCharacter === 'P') {
2507
2088
  var longFormatter = longFormatters[firstCharacter];
2508
- return longFormatter(substring, locale$1.formatLong, formatterOptions);
2089
+ return longFormatter(substring, locale$1.formatLong);
2509
2090
  }
2510
-
2511
2091
  return substring;
2512
2092
  }).join('').match(formattingTokensRegExp).map(function (substring) {
2513
2093
  // Replace two single quote characters with one single quote character
2514
2094
  if (substring === "''") {
2515
2095
  return "'";
2516
2096
  }
2517
-
2518
2097
  var firstCharacter = substring[0];
2519
-
2520
2098
  if (firstCharacter === "'") {
2521
2099
  return cleanEscapedString(substring);
2522
2100
  }
2523
-
2524
2101
  var formatter = formatters[firstCharacter];
2525
-
2526
2102
  if (formatter) {
2527
- if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(substring)) {
2528
- throwProtectedError(substring, dirtyFormatStr, dirtyDate);
2103
+ if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(substring)) {
2104
+ throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
2529
2105
  }
2530
-
2531
- if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(substring)) {
2532
- throwProtectedError(substring, dirtyFormatStr, dirtyDate);
2106
+ if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(substring)) {
2107
+ throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
2533
2108
  }
2534
-
2535
2109
  return formatter(utcDate, substring, locale$1.localize, formatterOptions);
2536
2110
  }
2537
-
2538
2111
  if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
2539
2112
  throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');
2540
2113
  }
2541
-
2542
2114
  return substring;
2543
2115
  }).join('');
2544
2116
  return result;
2545
2117
  }
2546
-
2547
2118
  function cleanEscapedString(input) {
2548
- return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'");
2119
+ var matched = input.match(escapedStringRegExp);
2120
+ if (!matched) {
2121
+ return input;
2122
+ }
2123
+ return matched[1].replace(doubleQuoteRegExp, "'");
2549
2124
  }
2550
2125
 
2551
2126
  const getImageFromImage = (image) => {
@@ -2696,7 +2271,7 @@ const getCategoryIcon = (category = LCCategoryEnum.achievement) => {
2696
2271
  size: "21"
2697
2272
  });
2698
2273
  case LCCategoryEnum.meritBadge:
2699
- return /* @__PURE__ */ React.createElement(ScoutsPledge, null);
2274
+ return /* @__PURE__ */ React.createElement(ScoutsLogo, null);
2700
2275
  case LCCategoryEnum.currency:
2701
2276
  default:
2702
2277
  console.log("\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525}");
@@ -2721,10 +2296,13 @@ const categorizeSkills = (skills) => {
2721
2296
  acc[obj.category].push(obj);
2722
2297
  acc[obj.category].totalSkills++;
2723
2298
  }
2724
- let totalSubskillsCount = acc[obj.category].reduce((total, skill) => {
2725
- var _a2, _b;
2726
- return total + ((_b = (_a2 = skill == null ? void 0 : skill.subskills) == null ? void 0 : _a2.length) != null ? _b : 0);
2727
- }, 0);
2299
+ let totalSubskillsCount = acc[obj.category].reduce(
2300
+ (total, skill) => {
2301
+ var _a2, _b;
2302
+ return total + ((_b = (_a2 = skill == null ? void 0 : skill.subskills) == null ? void 0 : _a2.length) != null ? _b : 0);
2303
+ },
2304
+ 0
2305
+ );
2728
2306
  acc[obj.category].totalSubskillsCount = totalSubskillsCount;
2729
2307
  return acc;
2730
2308
  }, {});
@@ -2744,4 +2322,4 @@ const getTotalCountOfSkills = (skills) => {
2744
2322
  };
2745
2323
 
2746
2324
  export { getColorForVerificationStatus as a, getInfoFromCredential as b, categorizeSkills as c, getCategoryDarkColor as d, getCategoryLightColor as e, getCategoryIcon as f, getTotalCountOfSkills as g, getNameFromProfile as h, getImageFromProfile as i, format as j, getCategoryColor as k };
2747
- //# sourceMappingURL=credential.helpers-cdc2f4a3.js.map
2325
+ //# sourceMappingURL=credential.helpers-a5b16a5e.js.map