@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,8 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  var React = require('react');
4
- var types_esm = require('./types.esm-c33cbec2.js');
5
- var index = require('./index-5488badc.js');
4
+ var index = require('./index-c831a2f6.js');
5
+ var types_esm = require('./types.esm-41aaa0d4.js');
6
+ var index$1 = require('./index-5488badc.js');
6
7
  var PuzzlePiece = require('./PuzzlePiece-937c216a.js');
7
8
  var User = require('./User-301088ac.js');
8
9
  var Trophy = require('./Trophy-3d323be3.js');
@@ -89,7 +90,7 @@ const KeyIcon = ({
89
90
  }));
90
91
  };
91
92
 
92
- const ScoutsPledge = ({ className = "" }) => {
93
+ const ScoutsLogo = ({ className = "" }) => {
93
94
  return /* @__PURE__ */ React__default["default"].createElement("svg", {
94
95
  width: "25",
95
96
  height: "25",
@@ -97,17 +98,25 @@ const ScoutsPledge = ({ className = "" }) => {
97
98
  fill: "none",
98
99
  xmlns: "http://www.w3.org/2000/svg",
99
100
  className
101
+ }, /* @__PURE__ */ React__default["default"].createElement("g", {
102
+ clipPath: "url(#clip0_10755_290528)"
100
103
  }, /* @__PURE__ */ React__default["default"].createElement("path", {
101
- fillRule: "evenodd",
102
- clipRule: "evenodd",
103
- 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",
104
- fill: "currentColor"
104
+ 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",
105
+ fill: "white"
105
106
  }), /* @__PURE__ */ React__default["default"].createElement("path", {
106
- fillRule: "evenodd",
107
- clipRule: "evenodd",
108
- 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",
109
- fill: "currentColor"
110
- }));
107
+ 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",
108
+ fill: "#622599"
109
+ }), /* @__PURE__ */ React__default["default"].createElement("path", {
110
+ 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",
111
+ fill: "#622599"
112
+ })), /* @__PURE__ */ React__default["default"].createElement("defs", null, /* @__PURE__ */ React__default["default"].createElement("clipPath", {
113
+ id: "clip0_10755_290528"
114
+ }, /* @__PURE__ */ React__default["default"].createElement("rect", {
115
+ width: "25",
116
+ height: "25",
117
+ fill: "white",
118
+ transform: "translate(0 0.847656)"
119
+ }))));
111
120
  };
112
121
 
113
122
  const SocialBadgesIcon = ({
@@ -142,78 +151,6 @@ const SocialBadgesIcon = ({
142
151
  }));
143
152
  };
144
153
 
145
- function toInteger(dirtyNumber) {
146
- if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
147
- return NaN;
148
- }
149
-
150
- var number = Number(dirtyNumber);
151
-
152
- if (isNaN(number)) {
153
- return number;
154
- }
155
-
156
- return number < 0 ? Math.ceil(number) : Math.floor(number);
157
- }
158
-
159
- function requiredArgs(required, args) {
160
- if (args.length < required) {
161
- throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
162
- }
163
- }
164
-
165
- /**
166
- * @name toDate
167
- * @category Common Helpers
168
- * @summary Convert the given argument to an instance of Date.
169
- *
170
- * @description
171
- * Convert the given argument to an instance of Date.
172
- *
173
- * If the argument is an instance of Date, the function returns its clone.
174
- *
175
- * If the argument is a number, it is treated as a timestamp.
176
- *
177
- * If the argument is none of the above, the function returns Invalid Date.
178
- *
179
- * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
180
- *
181
- * @param {Date|Number} argument - the value to convert
182
- * @returns {Date} the parsed date in the local time zone
183
- * @throws {TypeError} 1 argument required
184
- *
185
- * @example
186
- * // Clone the date:
187
- * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
188
- * //=> Tue Feb 11 2014 11:30:30
189
- *
190
- * @example
191
- * // Convert the timestamp to date:
192
- * const result = toDate(1392098430000)
193
- * //=> Tue Feb 11 2014 11:30:30
194
- */
195
-
196
- function toDate(argument) {
197
- requiredArgs(1, arguments);
198
- var argStr = Object.prototype.toString.call(argument); // Clone the date
199
-
200
- if (argument instanceof Date || typeof argument === 'object' && argStr === '[object Date]') {
201
- // Prevent the date to lose the milliseconds when passed to new Date() in IE10
202
- return new Date(argument.getTime());
203
- } else if (typeof argument === 'number' || argStr === '[object Number]') {
204
- return new Date(argument);
205
- } else {
206
- if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
207
- // eslint-disable-next-line no-console
208
- 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
209
-
210
- console.warn(new Error().stack);
211
- }
212
-
213
- return new Date(NaN);
214
- }
215
- }
216
-
217
154
  /**
218
155
  * @name addMilliseconds
219
156
  * @category Millisecond Helpers
@@ -222,10 +159,6 @@ function toDate(argument) {
222
159
  * @description
223
160
  * Add the specified number of milliseconds to the given date.
224
161
  *
225
- * ### v2.0.0 breaking changes:
226
- *
227
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
228
- *
229
162
  * @param {Date|Number} date - the date to be changed
230
163
  * @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`.
231
164
  * @returns {Date} the new date with the milliseconds added
@@ -236,11 +169,10 @@ function toDate(argument) {
236
169
  * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
237
170
  * //=> Thu Jul 10 2014 12:45:30.750
238
171
  */
239
-
240
172
  function addMilliseconds(dirtyDate, dirtyAmount) {
241
- requiredArgs(2, arguments);
242
- var timestamp = toDate(dirtyDate).getTime();
243
- var amount = toInteger(dirtyAmount);
173
+ index.requiredArgs(2, arguments);
174
+ var timestamp = index.toDate(dirtyDate).getTime();
175
+ var amount = index.toInteger(dirtyAmount);
244
176
  return new Date(timestamp + amount);
245
177
  }
246
178
 
@@ -269,10 +201,6 @@ function getTimezoneOffsetInMilliseconds(date) {
269
201
  * @description
270
202
  * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
271
203
  *
272
- * ### v2.0.0 breaking changes:
273
- *
274
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
275
- *
276
204
  * @param {*} value - the value to check
277
205
  * @returns {boolean} true if the given value is a date
278
206
  * @throws {TypeError} 1 arguments required
@@ -297,10 +225,9 @@ function getTimezoneOffsetInMilliseconds(date) {
297
225
  * const result = isDate({})
298
226
  * //=> false
299
227
  */
300
-
301
228
  function isDate(value) {
302
- requiredArgs(1, arguments);
303
- return value instanceof Date || typeof value === 'object' && Object.prototype.toString.call(value) === '[object Date]';
229
+ index.requiredArgs(1, arguments);
230
+ return value instanceof Date || index._typeof(value) === 'object' && Object.prototype.toString.call(value) === '[object Date]';
304
231
  }
305
232
 
306
233
  /**
@@ -315,32 +242,6 @@ function isDate(value) {
315
242
  *
316
243
  * Time value of Date: http://es5.github.io/#x15.9.1.1
317
244
  *
318
- * ### v2.0.0 breaking changes:
319
- *
320
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
321
- *
322
- * - Now `isValid` doesn't throw an exception
323
- * if the first argument is not an instance of Date.
324
- * Instead, argument is converted beforehand using `toDate`.
325
- *
326
- * Examples:
327
- *
328
- * | `isValid` argument | Before v2.0.0 | v2.0.0 onward |
329
- * |---------------------------|---------------|---------------|
330
- * | `new Date()` | `true` | `true` |
331
- * | `new Date('2016-01-01')` | `true` | `true` |
332
- * | `new Date('')` | `false` | `false` |
333
- * | `new Date(1488370835081)` | `true` | `true` |
334
- * | `new Date(NaN)` | `false` | `false` |
335
- * | `'2016-01-01'` | `TypeError` | `false` |
336
- * | `''` | `TypeError` | `false` |
337
- * | `1488370835081` | `TypeError` | `true` |
338
- * | `NaN` | `TypeError` | `false` |
339
- *
340
- * We introduce this change to make *date-fns* consistent with ECMAScript behavior
341
- * that try to coerce arguments to the expected type
342
- * (which is also the case with other *date-fns* functions).
343
- *
344
245
  * @param {*} date - the date to check
345
246
  * @returns {Boolean} the date is valid
346
247
  * @throws {TypeError} 1 argument required
@@ -360,811 +261,148 @@ function isDate(value) {
360
261
  * const result = isValid(new Date(''))
361
262
  * //=> false
362
263
  */
363
-
364
264
  function isValid(dirtyDate) {
365
- requiredArgs(1, arguments);
366
-
265
+ index.requiredArgs(1, arguments);
367
266
  if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {
368
267
  return false;
369
268
  }
370
-
371
- var date = toDate(dirtyDate);
269
+ var date = index.toDate(dirtyDate);
372
270
  return !isNaN(Number(date));
373
271
  }
374
272
 
375
- var formatDistanceLocale = {
376
- lessThanXSeconds: {
377
- one: 'less than a second',
378
- other: 'less than {{count}} seconds'
379
- },
380
- xSeconds: {
381
- one: '1 second',
382
- other: '{{count}} seconds'
383
- },
384
- halfAMinute: 'half a minute',
385
- lessThanXMinutes: {
386
- one: 'less than a minute',
387
- other: 'less than {{count}} minutes'
388
- },
389
- xMinutes: {
390
- one: '1 minute',
391
- other: '{{count}} minutes'
392
- },
393
- aboutXHours: {
394
- one: 'about 1 hour',
395
- other: 'about {{count}} hours'
396
- },
397
- xHours: {
398
- one: '1 hour',
399
- other: '{{count}} hours'
400
- },
401
- xDays: {
402
- one: '1 day',
403
- other: '{{count}} days'
273
+ /**
274
+ * @name subMilliseconds
275
+ * @category Millisecond Helpers
276
+ * @summary Subtract the specified number of milliseconds from the given date.
277
+ *
278
+ * @description
279
+ * Subtract the specified number of milliseconds from the given date.
280
+ *
281
+ * @param {Date|Number} date - the date to be changed
282
+ * @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`.
283
+ * @returns {Date} the new date with the milliseconds subtracted
284
+ * @throws {TypeError} 2 arguments required
285
+ *
286
+ * @example
287
+ * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:
288
+ * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
289
+ * //=> Thu Jul 10 2014 12:45:29.250
290
+ */
291
+ function subMilliseconds(dirtyDate, dirtyAmount) {
292
+ index.requiredArgs(2, arguments);
293
+ var amount = index.toInteger(dirtyAmount);
294
+ return addMilliseconds(dirtyDate, -amount);
295
+ }
296
+
297
+ var MILLISECONDS_IN_DAY = 86400000;
298
+ function getUTCDayOfYear(dirtyDate) {
299
+ index.requiredArgs(1, arguments);
300
+ var date = index.toDate(dirtyDate);
301
+ var timestamp = date.getTime();
302
+ date.setUTCMonth(0, 1);
303
+ date.setUTCHours(0, 0, 0, 0);
304
+ var startOfYearTimestamp = date.getTime();
305
+ var difference = timestamp - startOfYearTimestamp;
306
+ return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
307
+ }
308
+
309
+ function addLeadingZeros(number, targetLength) {
310
+ var sign = number < 0 ? '-' : '';
311
+ var output = Math.abs(number).toString();
312
+ while (output.length < targetLength) {
313
+ output = '0' + output;
314
+ }
315
+ return sign + output;
316
+ }
317
+
318
+ /*
319
+ * | | Unit | | Unit |
320
+ * |-----|--------------------------------|-----|--------------------------------|
321
+ * | a | AM, PM | A* | |
322
+ * | d | Day of month | D | |
323
+ * | h | Hour [1-12] | H | Hour [0-23] |
324
+ * | m | Minute | M | Month |
325
+ * | s | Second | S | Fraction of second |
326
+ * | y | Year (abs) | Y | |
327
+ *
328
+ * Letters marked by * are not implemented but reserved by Unicode standard.
329
+ */
330
+ var formatters$1 = {
331
+ // Year
332
+ y: function y(date, token) {
333
+ // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
334
+ // | Year | y | yy | yyy | yyyy | yyyyy |
335
+ // |----------|-------|----|-------|-------|-------|
336
+ // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
337
+ // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
338
+ // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
339
+ // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
340
+ // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
341
+
342
+ var signedYear = date.getUTCFullYear();
343
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
344
+ var year = signedYear > 0 ? signedYear : 1 - signedYear;
345
+ return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
404
346
  },
405
- aboutXWeeks: {
406
- one: 'about 1 week',
407
- other: 'about {{count}} weeks'
347
+ // Month
348
+ M: function M(date, token) {
349
+ var month = date.getUTCMonth();
350
+ return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);
408
351
  },
409
- xWeeks: {
410
- one: '1 week',
411
- other: '{{count}} weeks'
352
+ // Day of the month
353
+ d: function d(date, token) {
354
+ return addLeadingZeros(date.getUTCDate(), token.length);
412
355
  },
413
- aboutXMonths: {
414
- one: 'about 1 month',
415
- other: 'about {{count}} months'
356
+ // AM or PM
357
+ a: function a(date, token) {
358
+ var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
359
+ switch (token) {
360
+ case 'a':
361
+ case 'aa':
362
+ return dayPeriodEnumValue.toUpperCase();
363
+ case 'aaa':
364
+ return dayPeriodEnumValue;
365
+ case 'aaaaa':
366
+ return dayPeriodEnumValue[0];
367
+ case 'aaaa':
368
+ default:
369
+ return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
370
+ }
416
371
  },
417
- xMonths: {
418
- one: '1 month',
419
- other: '{{count}} months'
372
+ // Hour [1-12]
373
+ h: function h(date, token) {
374
+ return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
420
375
  },
421
- aboutXYears: {
422
- one: 'about 1 year',
423
- other: 'about {{count}} years'
376
+ // Hour [0-23]
377
+ H: function H(date, token) {
378
+ return addLeadingZeros(date.getUTCHours(), token.length);
424
379
  },
425
- xYears: {
426
- one: '1 year',
427
- other: '{{count}} years'
380
+ // Minute
381
+ m: function m(date, token) {
382
+ return addLeadingZeros(date.getUTCMinutes(), token.length);
428
383
  },
429
- overXYears: {
430
- one: 'over 1 year',
431
- other: 'over {{count}} years'
384
+ // Second
385
+ s: function s(date, token) {
386
+ return addLeadingZeros(date.getUTCSeconds(), token.length);
432
387
  },
433
- almostXYears: {
434
- one: 'almost 1 year',
435
- other: 'almost {{count}} years'
436
- }
437
- };
438
-
439
- var formatDistance = function (token, count, options) {
440
- var result;
441
- var tokenValue = formatDistanceLocale[token];
442
-
443
- if (typeof tokenValue === 'string') {
444
- result = tokenValue;
445
- } else if (count === 1) {
446
- result = tokenValue.one;
447
- } else {
448
- result = tokenValue.other.replace('{{count}}', count.toString());
449
- }
450
-
451
- if (options !== null && options !== void 0 && options.addSuffix) {
452
- if (options.comparison && options.comparison > 0) {
453
- return 'in ' + result;
454
- } else {
455
- return result + ' ago';
456
- }
388
+ // Fraction of second
389
+ S: function S(date, token) {
390
+ var numberOfDigits = token.length;
391
+ var milliseconds = date.getUTCMilliseconds();
392
+ var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
393
+ return addLeadingZeros(fractionalSeconds, token.length);
457
394
  }
458
-
459
- return result;
460
395
  };
461
396
 
462
- function buildFormatLongFn(args) {
463
- return function () {
464
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
465
- // TODO: Remove String()
466
- var width = options.width ? String(options.width) : args.defaultWidth;
467
- var format = args.formats[width] || args.formats[args.defaultWidth];
468
- return format;
469
- };
470
- }
471
-
472
- var dateFormats = {
473
- full: 'EEEE, MMMM do, y',
474
- long: 'MMMM do, y',
475
- medium: 'MMM d, y',
476
- short: 'MM/dd/yyyy'
477
- };
478
- var timeFormats = {
479
- full: 'h:mm:ss a zzzz',
480
- long: 'h:mm:ss a z',
481
- medium: 'h:mm:ss a',
482
- short: 'h:mm a'
483
- };
484
- var dateTimeFormats = {
485
- full: "{{date}} 'at' {{time}}",
486
- long: "{{date}} 'at' {{time}}",
487
- medium: '{{date}}, {{time}}',
488
- short: '{{date}}, {{time}}'
489
- };
490
- var formatLong = {
491
- date: buildFormatLongFn({
492
- formats: dateFormats,
493
- defaultWidth: 'full'
494
- }),
495
- time: buildFormatLongFn({
496
- formats: timeFormats,
497
- defaultWidth: 'full'
498
- }),
499
- dateTime: buildFormatLongFn({
500
- formats: dateTimeFormats,
501
- defaultWidth: 'full'
502
- })
503
- };
504
-
505
- var formatRelativeLocale = {
506
- lastWeek: "'last' eeee 'at' p",
507
- yesterday: "'yesterday at' p",
508
- today: "'today at' p",
509
- tomorrow: "'tomorrow at' p",
510
- nextWeek: "eeee 'at' p",
511
- other: 'P'
512
- };
513
-
514
- var formatRelative = function (token, _date, _baseDate, _options) {
515
- return formatRelativeLocale[token];
516
- };
517
-
518
- function buildLocalizeFn(args) {
519
- return function (dirtyIndex, dirtyOptions) {
520
- var options = dirtyOptions || {};
521
- var context = options.context ? String(options.context) : 'standalone';
522
- var valuesArray;
523
-
524
- if (context === 'formatting' && args.formattingValues) {
525
- var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
526
- var width = options.width ? String(options.width) : defaultWidth;
527
- valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
528
- } else {
529
- var _defaultWidth = args.defaultWidth;
530
-
531
- var _width = options.width ? String(options.width) : args.defaultWidth;
532
-
533
- valuesArray = args.values[_width] || args.values[_defaultWidth];
534
- }
535
-
536
- 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!
537
-
538
- return valuesArray[index];
539
- };
540
- }
541
-
542
- var eraValues = {
543
- narrow: ['B', 'A'],
544
- abbreviated: ['BC', 'AD'],
545
- wide: ['Before Christ', 'Anno Domini']
546
- };
547
- var quarterValues = {
548
- narrow: ['1', '2', '3', '4'],
549
- abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
550
- wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']
551
- }; // Note: in English, the names of days of the week and months are capitalized.
552
- // If you are making a new locale based on this one, check if the same is true for the language you're working on.
553
- // Generally, formatted dates should look like they are in the middle of a sentence,
554
- // e.g. in Spanish language the weekdays and months should be in the lowercase.
555
-
556
- var monthValues = {
557
- narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
558
- abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
559
- wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
560
- };
561
- var dayValues = {
562
- narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
563
- short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
564
- abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
565
- wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
566
- };
567
- var dayPeriodValues = {
568
- narrow: {
569
- am: 'a',
570
- pm: 'p',
571
- midnight: 'mi',
572
- noon: 'n',
573
- morning: 'morning',
574
- afternoon: 'afternoon',
575
- evening: 'evening',
576
- night: 'night'
577
- },
578
- abbreviated: {
579
- am: 'AM',
580
- pm: 'PM',
581
- midnight: 'midnight',
582
- noon: 'noon',
583
- morning: 'morning',
584
- afternoon: 'afternoon',
585
- evening: 'evening',
586
- night: 'night'
587
- },
588
- wide: {
589
- am: 'a.m.',
590
- pm: 'p.m.',
591
- midnight: 'midnight',
592
- noon: 'noon',
593
- morning: 'morning',
594
- afternoon: 'afternoon',
595
- evening: 'evening',
596
- night: 'night'
597
- }
598
- };
599
- var formattingDayPeriodValues = {
600
- narrow: {
601
- am: 'a',
602
- pm: 'p',
603
- midnight: 'mi',
604
- noon: 'n',
605
- morning: 'in the morning',
606
- afternoon: 'in the afternoon',
607
- evening: 'in the evening',
608
- night: 'at night'
609
- },
610
- abbreviated: {
611
- am: 'AM',
612
- pm: 'PM',
613
- midnight: 'midnight',
614
- noon: 'noon',
615
- morning: 'in the morning',
616
- afternoon: 'in the afternoon',
617
- evening: 'in the evening',
618
- night: 'at night'
619
- },
620
- wide: {
621
- am: 'a.m.',
622
- pm: 'p.m.',
623
- midnight: 'midnight',
624
- noon: 'noon',
625
- morning: 'in the morning',
626
- afternoon: 'in the afternoon',
627
- evening: 'in the evening',
628
- night: 'at night'
629
- }
630
- };
631
-
632
- var ordinalNumber = function (dirtyNumber, _options) {
633
- var number = Number(dirtyNumber); // If ordinal numbers depend on context, for example,
634
- // if they are different for different grammatical genders,
635
- // use `options.unit`.
636
- //
637
- // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
638
- // 'day', 'hour', 'minute', 'second'.
639
-
640
- var rem100 = number % 100;
641
-
642
- if (rem100 > 20 || rem100 < 10) {
643
- switch (rem100 % 10) {
644
- case 1:
645
- return number + 'st';
646
-
647
- case 2:
648
- return number + 'nd';
649
-
650
- case 3:
651
- return number + 'rd';
652
- }
653
- }
654
-
655
- return number + 'th';
656
- };
657
-
658
- var localize = {
659
- ordinalNumber: ordinalNumber,
660
- era: buildLocalizeFn({
661
- values: eraValues,
662
- defaultWidth: 'wide'
663
- }),
664
- quarter: buildLocalizeFn({
665
- values: quarterValues,
666
- defaultWidth: 'wide',
667
- argumentCallback: function (quarter) {
668
- return quarter - 1;
669
- }
670
- }),
671
- month: buildLocalizeFn({
672
- values: monthValues,
673
- defaultWidth: 'wide'
674
- }),
675
- day: buildLocalizeFn({
676
- values: dayValues,
677
- defaultWidth: 'wide'
678
- }),
679
- dayPeriod: buildLocalizeFn({
680
- values: dayPeriodValues,
681
- defaultWidth: 'wide',
682
- formattingValues: formattingDayPeriodValues,
683
- defaultFormattingWidth: 'wide'
684
- })
685
- };
686
-
687
- function buildMatchFn(args) {
688
- return function (string) {
689
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
690
- var width = options.width;
691
- var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
692
- var matchResult = string.match(matchPattern);
693
-
694
- if (!matchResult) {
695
- return null;
696
- }
697
-
698
- var matchedString = matchResult[0];
699
- var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
700
- var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {
701
- return pattern.test(matchedString);
702
- }) : findKey(parsePatterns, function (pattern) {
703
- return pattern.test(matchedString);
704
- });
705
- var value;
706
- value = args.valueCallback ? args.valueCallback(key) : key;
707
- value = options.valueCallback ? options.valueCallback(value) : value;
708
- var rest = string.slice(matchedString.length);
709
- return {
710
- value: value,
711
- rest: rest
712
- };
713
- };
714
- }
715
-
716
- function findKey(object, predicate) {
717
- for (var key in object) {
718
- if (object.hasOwnProperty(key) && predicate(object[key])) {
719
- return key;
720
- }
721
- }
722
-
723
- return undefined;
724
- }
725
-
726
- function findIndex(array, predicate) {
727
- for (var key = 0; key < array.length; key++) {
728
- if (predicate(array[key])) {
729
- return key;
730
- }
731
- }
732
-
733
- return undefined;
734
- }
735
-
736
- function buildMatchPatternFn(args) {
737
- return function (string) {
738
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
739
- var matchResult = string.match(args.matchPattern);
740
- if (!matchResult) return null;
741
- var matchedString = matchResult[0];
742
- var parseResult = string.match(args.parsePattern);
743
- if (!parseResult) return null;
744
- var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
745
- value = options.valueCallback ? options.valueCallback(value) : value;
746
- var rest = string.slice(matchedString.length);
747
- return {
748
- value: value,
749
- rest: rest
750
- };
751
- };
752
- }
753
-
754
- var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
755
- var parseOrdinalNumberPattern = /\d+/i;
756
- var matchEraPatterns = {
757
- narrow: /^(b|a)/i,
758
- abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
759
- wide: /^(before christ|before common era|anno domini|common era)/i
760
- };
761
- var parseEraPatterns = {
762
- any: [/^b/i, /^(a|c)/i]
763
- };
764
- var matchQuarterPatterns = {
765
- narrow: /^[1234]/i,
766
- abbreviated: /^q[1234]/i,
767
- wide: /^[1234](th|st|nd|rd)? quarter/i
768
- };
769
- var parseQuarterPatterns = {
770
- any: [/1/i, /2/i, /3/i, /4/i]
771
- };
772
- var matchMonthPatterns = {
773
- narrow: /^[jfmasond]/i,
774
- abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
775
- wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
776
- };
777
- var parseMonthPatterns = {
778
- 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],
779
- 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]
780
- };
781
- var matchDayPatterns = {
782
- narrow: /^[smtwf]/i,
783
- short: /^(su|mo|tu|we|th|fr|sa)/i,
784
- abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
785
- wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
786
- };
787
- var parseDayPatterns = {
788
- narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
789
- any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
790
- };
791
- var matchDayPeriodPatterns = {
792
- narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
793
- any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
794
- };
795
- var parseDayPeriodPatterns = {
796
- any: {
797
- am: /^a/i,
798
- pm: /^p/i,
799
- midnight: /^mi/i,
800
- noon: /^no/i,
801
- morning: /morning/i,
802
- afternoon: /afternoon/i,
803
- evening: /evening/i,
804
- night: /night/i
805
- }
806
- };
807
- var match = {
808
- ordinalNumber: buildMatchPatternFn({
809
- matchPattern: matchOrdinalNumberPattern,
810
- parsePattern: parseOrdinalNumberPattern,
811
- valueCallback: function (value) {
812
- return parseInt(value, 10);
813
- }
814
- }),
815
- era: buildMatchFn({
816
- matchPatterns: matchEraPatterns,
817
- defaultMatchWidth: 'wide',
818
- parsePatterns: parseEraPatterns,
819
- defaultParseWidth: 'any'
820
- }),
821
- quarter: buildMatchFn({
822
- matchPatterns: matchQuarterPatterns,
823
- defaultMatchWidth: 'wide',
824
- parsePatterns: parseQuarterPatterns,
825
- defaultParseWidth: 'any',
826
- valueCallback: function (index) {
827
- return index + 1;
828
- }
829
- }),
830
- month: buildMatchFn({
831
- matchPatterns: matchMonthPatterns,
832
- defaultMatchWidth: 'wide',
833
- parsePatterns: parseMonthPatterns,
834
- defaultParseWidth: 'any'
835
- }),
836
- day: buildMatchFn({
837
- matchPatterns: matchDayPatterns,
838
- defaultMatchWidth: 'wide',
839
- parsePatterns: parseDayPatterns,
840
- defaultParseWidth: 'any'
841
- }),
842
- dayPeriod: buildMatchFn({
843
- matchPatterns: matchDayPeriodPatterns,
844
- defaultMatchWidth: 'any',
845
- parsePatterns: parseDayPeriodPatterns,
846
- defaultParseWidth: 'any'
847
- })
848
- };
849
-
850
- /**
851
- * @type {Locale}
852
- * @category Locales
853
- * @summary English locale (United States).
854
- * @language English
855
- * @iso-639-2 eng
856
- * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
857
- * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
858
- */
859
- var locale = {
860
- code: 'en-US',
861
- formatDistance: formatDistance,
862
- formatLong: formatLong,
863
- formatRelative: formatRelative,
864
- localize: localize,
865
- match: match,
866
- options: {
867
- weekStartsOn: 0
868
- /* Sunday */
869
- ,
870
- firstWeekContainsDate: 1
871
- }
872
- };
873
-
874
- /**
875
- * @name subMilliseconds
876
- * @category Millisecond Helpers
877
- * @summary Subtract the specified number of milliseconds from the given date.
878
- *
879
- * @description
880
- * Subtract the specified number of milliseconds from the given date.
881
- *
882
- * ### v2.0.0 breaking changes:
883
- *
884
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
885
- *
886
- * @param {Date|Number} date - the date to be changed
887
- * @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`.
888
- * @returns {Date} the new date with the milliseconds subtracted
889
- * @throws {TypeError} 2 arguments required
890
- *
891
- * @example
892
- * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:
893
- * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
894
- * //=> Thu Jul 10 2014 12:45:29.250
895
- */
896
-
897
- function subMilliseconds(dirtyDate, dirtyAmount) {
898
- requiredArgs(2, arguments);
899
- var amount = toInteger(dirtyAmount);
900
- return addMilliseconds(dirtyDate, -amount);
901
- }
902
-
903
- var MILLISECONDS_IN_DAY = 86400000; // This function will be a part of public API when UTC function will be implemented.
904
- // See issue: https://github.com/date-fns/date-fns/issues/376
905
-
906
- function getUTCDayOfYear(dirtyDate) {
907
- requiredArgs(1, arguments);
908
- var date = toDate(dirtyDate);
909
- var timestamp = date.getTime();
910
- date.setUTCMonth(0, 1);
911
- date.setUTCHours(0, 0, 0, 0);
912
- var startOfYearTimestamp = date.getTime();
913
- var difference = timestamp - startOfYearTimestamp;
914
- return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
915
- }
916
-
917
- // See issue: https://github.com/date-fns/date-fns/issues/376
918
-
919
- function startOfUTCISOWeek(dirtyDate) {
920
- requiredArgs(1, arguments);
921
- var weekStartsOn = 1;
922
- var date = toDate(dirtyDate);
923
- var day = date.getUTCDay();
924
- var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
925
- date.setUTCDate(date.getUTCDate() - diff);
926
- date.setUTCHours(0, 0, 0, 0);
927
- return date;
928
- }
929
-
930
- // See issue: https://github.com/date-fns/date-fns/issues/376
931
-
932
- function getUTCISOWeekYear(dirtyDate) {
933
- requiredArgs(1, arguments);
934
- var date = toDate(dirtyDate);
935
- var year = date.getUTCFullYear();
936
- var fourthOfJanuaryOfNextYear = new Date(0);
937
- fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
938
- fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
939
- var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);
940
- var fourthOfJanuaryOfThisYear = new Date(0);
941
- fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
942
- fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
943
- var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
944
-
945
- if (date.getTime() >= startOfNextYear.getTime()) {
946
- return year + 1;
947
- } else if (date.getTime() >= startOfThisYear.getTime()) {
948
- return year;
949
- } else {
950
- return year - 1;
951
- }
952
- }
953
-
954
- // See issue: https://github.com/date-fns/date-fns/issues/376
955
-
956
- function startOfUTCISOWeekYear(dirtyDate) {
957
- requiredArgs(1, arguments);
958
- var year = getUTCISOWeekYear(dirtyDate);
959
- var fourthOfJanuary = new Date(0);
960
- fourthOfJanuary.setUTCFullYear(year, 0, 4);
961
- fourthOfJanuary.setUTCHours(0, 0, 0, 0);
962
- var date = startOfUTCISOWeek(fourthOfJanuary);
963
- return date;
964
- }
965
-
966
- var MILLISECONDS_IN_WEEK$1 = 604800000; // This function will be a part of public API when UTC function will be implemented.
967
- // See issue: https://github.com/date-fns/date-fns/issues/376
968
-
969
- function getUTCISOWeek(dirtyDate) {
970
- requiredArgs(1, arguments);
971
- var date = toDate(dirtyDate);
972
- var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer
973
- // because the number of milliseconds in a week is not constant
974
- // (e.g. it's different in the week of the daylight saving time clock shift)
975
-
976
- return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
977
- }
978
-
979
- // See issue: https://github.com/date-fns/date-fns/issues/376
980
-
981
- function startOfUTCWeek(dirtyDate, dirtyOptions) {
982
- requiredArgs(1, arguments);
983
- var options = dirtyOptions || {};
984
- var locale = options.locale;
985
- var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;
986
- var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
987
- var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
988
-
989
- if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
990
- throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
991
- }
992
-
993
- var date = toDate(dirtyDate);
994
- var day = date.getUTCDay();
995
- var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
996
- date.setUTCDate(date.getUTCDate() - diff);
997
- date.setUTCHours(0, 0, 0, 0);
998
- return date;
999
- }
1000
-
1001
- // See issue: https://github.com/date-fns/date-fns/issues/376
1002
-
1003
- function getUTCWeekYear(dirtyDate, dirtyOptions) {
1004
- requiredArgs(1, arguments);
1005
- var date = toDate(dirtyDate);
1006
- var year = date.getUTCFullYear();
1007
- var options = dirtyOptions || {};
1008
- var locale = options.locale;
1009
- var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;
1010
- var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
1011
- var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
1012
-
1013
- if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
1014
- throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
1015
- }
1016
-
1017
- var firstWeekOfNextYear = new Date(0);
1018
- firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
1019
- firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
1020
- var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, dirtyOptions);
1021
- var firstWeekOfThisYear = new Date(0);
1022
- firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
1023
- firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
1024
- var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, dirtyOptions);
1025
-
1026
- if (date.getTime() >= startOfNextYear.getTime()) {
1027
- return year + 1;
1028
- } else if (date.getTime() >= startOfThisYear.getTime()) {
1029
- return year;
1030
- } else {
1031
- return year - 1;
1032
- }
1033
- }
1034
-
1035
- // See issue: https://github.com/date-fns/date-fns/issues/376
1036
-
1037
- function startOfUTCWeekYear(dirtyDate, dirtyOptions) {
1038
- requiredArgs(1, arguments);
1039
- var options = dirtyOptions || {};
1040
- var locale = options.locale;
1041
- var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;
1042
- var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
1043
- var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);
1044
- var year = getUTCWeekYear(dirtyDate, dirtyOptions);
1045
- var firstWeek = new Date(0);
1046
- firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
1047
- firstWeek.setUTCHours(0, 0, 0, 0);
1048
- var date = startOfUTCWeek(firstWeek, dirtyOptions);
1049
- return date;
1050
- }
1051
-
1052
- var MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.
1053
- // See issue: https://github.com/date-fns/date-fns/issues/376
1054
-
1055
- function getUTCWeek(dirtyDate, options) {
1056
- requiredArgs(1, arguments);
1057
- var date = toDate(dirtyDate);
1058
- var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer
1059
- // because the number of milliseconds in a week is not constant
1060
- // (e.g. it's different in the week of the daylight saving time clock shift)
1061
-
1062
- return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
1063
- }
1064
-
1065
- function addLeadingZeros(number, targetLength) {
1066
- var sign = number < 0 ? '-' : '';
1067
- var output = Math.abs(number).toString();
1068
-
1069
- while (output.length < targetLength) {
1070
- output = '0' + output;
1071
- }
1072
-
1073
- return sign + output;
1074
- }
1075
-
1076
- /*
1077
- * | | Unit | | Unit |
1078
- * |-----|--------------------------------|-----|--------------------------------|
1079
- * | a | AM, PM | A* | |
1080
- * | d | Day of month | D | |
1081
- * | h | Hour [1-12] | H | Hour [0-23] |
1082
- * | m | Minute | M | Month |
1083
- * | s | Second | S | Fraction of second |
1084
- * | y | Year (abs) | Y | |
1085
- *
1086
- * Letters marked by * are not implemented but reserved by Unicode standard.
1087
- */
1088
-
1089
- var formatters$1 = {
1090
- // Year
1091
- y: function (date, token) {
1092
- // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
1093
- // | Year | y | yy | yyy | yyyy | yyyyy |
1094
- // |----------|-------|----|-------|-------|-------|
1095
- // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
1096
- // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
1097
- // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
1098
- // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
1099
- // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
1100
- var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
1101
-
1102
- var year = signedYear > 0 ? signedYear : 1 - signedYear;
1103
- return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
1104
- },
1105
- // Month
1106
- M: function (date, token) {
1107
- var month = date.getUTCMonth();
1108
- return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);
1109
- },
1110
- // Day of the month
1111
- d: function (date, token) {
1112
- return addLeadingZeros(date.getUTCDate(), token.length);
1113
- },
1114
- // AM or PM
1115
- a: function (date, token) {
1116
- var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
1117
-
1118
- switch (token) {
1119
- case 'a':
1120
- case 'aa':
1121
- return dayPeriodEnumValue.toUpperCase();
1122
-
1123
- case 'aaa':
1124
- return dayPeriodEnumValue;
1125
-
1126
- case 'aaaaa':
1127
- return dayPeriodEnumValue[0];
1128
-
1129
- case 'aaaa':
1130
- default:
1131
- return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
1132
- }
1133
- },
1134
- // Hour [1-12]
1135
- h: function (date, token) {
1136
- return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
1137
- },
1138
- // Hour [0-23]
1139
- H: function (date, token) {
1140
- return addLeadingZeros(date.getUTCHours(), token.length);
1141
- },
1142
- // Minute
1143
- m: function (date, token) {
1144
- return addLeadingZeros(date.getUTCMinutes(), token.length);
1145
- },
1146
- // Second
1147
- s: function (date, token) {
1148
- return addLeadingZeros(date.getUTCSeconds(), token.length);
1149
- },
1150
- // Fraction of second
1151
- S: function (date, token) {
1152
- var numberOfDigits = token.length;
1153
- var milliseconds = date.getUTCMilliseconds();
1154
- var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
1155
- return addLeadingZeros(fractionalSeconds, token.length);
1156
- }
1157
- };
1158
-
1159
- var dayPeriodEnum = {
1160
- am: 'am',
1161
- pm: 'pm',
1162
- midnight: 'midnight',
1163
- noon: 'noon',
1164
- morning: 'morning',
1165
- afternoon: 'afternoon',
1166
- evening: 'evening',
1167
- night: 'night'
397
+ var dayPeriodEnum = {
398
+ am: 'am',
399
+ pm: 'pm',
400
+ midnight: 'midnight',
401
+ noon: 'noon',
402
+ morning: 'morning',
403
+ afternoon: 'afternoon',
404
+ evening: 'evening',
405
+ night: 'night'
1168
406
  };
1169
407
  /*
1170
408
  * | | Unit | | Unit |
@@ -1214,9 +452,8 @@ var dayPeriodEnum = {
1214
452
 
1215
453
  var formatters = {
1216
454
  // Era
1217
- G: function (date, token, localize) {
455
+ G: function G(date, token, localize) {
1218
456
  var era = date.getUTCFullYear() > 0 ? 1 : 0;
1219
-
1220
457
  switch (token) {
1221
458
  // AD, BC
1222
459
  case 'G':
@@ -1226,13 +463,11 @@ var formatters = {
1226
463
  width: 'abbreviated'
1227
464
  });
1228
465
  // A, B
1229
-
1230
466
  case 'GGGGG':
1231
467
  return localize.era(era, {
1232
468
  width: 'narrow'
1233
469
  });
1234
470
  // Anno Domini, Before Christ
1235
-
1236
471
  case 'GGGG':
1237
472
  default:
1238
473
  return localize.era(era, {
@@ -1241,44 +476,45 @@ var formatters = {
1241
476
  }
1242
477
  },
1243
478
  // Year
1244
- y: function (date, token, localize) {
479
+ y: function y(date, token, localize) {
1245
480
  // Ordinal number
1246
481
  if (token === 'yo') {
1247
- var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
1248
-
482
+ var signedYear = date.getUTCFullYear();
483
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
1249
484
  var year = signedYear > 0 ? signedYear : 1 - signedYear;
1250
485
  return localize.ordinalNumber(year, {
1251
486
  unit: 'year'
1252
487
  });
1253
488
  }
1254
-
1255
489
  return formatters$1.y(date, token);
1256
490
  },
1257
491
  // Local week-numbering year
1258
- Y: function (date, token, localize, options) {
1259
- var signedWeekYear = getUTCWeekYear(date, options); // Returns 1 for 1 BC (which is year 0 in JavaScript)
1260
-
1261
- var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; // Two digit year
492
+ Y: function Y(date, token, localize, options) {
493
+ var signedWeekYear = index.getUTCWeekYear(date, options);
494
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
495
+ var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
1262
496
 
497
+ // Two digit year
1263
498
  if (token === 'YY') {
1264
499
  var twoDigitYear = weekYear % 100;
1265
500
  return addLeadingZeros(twoDigitYear, 2);
1266
- } // Ordinal number
1267
-
501
+ }
1268
502
 
503
+ // Ordinal number
1269
504
  if (token === 'Yo') {
1270
505
  return localize.ordinalNumber(weekYear, {
1271
506
  unit: 'year'
1272
507
  });
1273
- } // Padding
1274
-
508
+ }
1275
509
 
510
+ // Padding
1276
511
  return addLeadingZeros(weekYear, token.length);
1277
512
  },
1278
513
  // ISO week-numbering year
1279
- R: function (date, token) {
1280
- var isoWeekYear = getUTCISOWeekYear(date); // Padding
514
+ R: function R(date, token) {
515
+ var isoWeekYear = index.getUTCISOWeekYear(date);
1281
516
 
517
+ // Padding
1282
518
  return addLeadingZeros(isoWeekYear, token.length);
1283
519
  },
1284
520
  // Extended year. This is a single number designating the year of this calendar system.
@@ -1290,44 +526,38 @@ var formatters = {
1290
526
  // | BC 2 | 2 | -1 |
1291
527
  // Also `yy` always returns the last two digits of a year,
1292
528
  // while `uu` pads single digit years to 2 characters and returns other years unchanged.
1293
- u: function (date, token) {
529
+ u: function u(date, token) {
1294
530
  var year = date.getUTCFullYear();
1295
531
  return addLeadingZeros(year, token.length);
1296
532
  },
1297
533
  // Quarter
1298
- Q: function (date, token, localize) {
534
+ Q: function Q(date, token, localize) {
1299
535
  var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
1300
-
1301
536
  switch (token) {
1302
537
  // 1, 2, 3, 4
1303
538
  case 'Q':
1304
539
  return String(quarter);
1305
540
  // 01, 02, 03, 04
1306
-
1307
541
  case 'QQ':
1308
542
  return addLeadingZeros(quarter, 2);
1309
543
  // 1st, 2nd, 3rd, 4th
1310
-
1311
544
  case 'Qo':
1312
545
  return localize.ordinalNumber(quarter, {
1313
546
  unit: 'quarter'
1314
547
  });
1315
548
  // Q1, Q2, Q3, Q4
1316
-
1317
549
  case 'QQQ':
1318
550
  return localize.quarter(quarter, {
1319
551
  width: 'abbreviated',
1320
552
  context: 'formatting'
1321
553
  });
1322
554
  // 1, 2, 3, 4 (narrow quarter; could be not numerical)
1323
-
1324
555
  case 'QQQQQ':
1325
556
  return localize.quarter(quarter, {
1326
557
  width: 'narrow',
1327
558
  context: 'formatting'
1328
559
  });
1329
560
  // 1st quarter, 2nd quarter, ...
1330
-
1331
561
  case 'QQQQ':
1332
562
  default:
1333
563
  return localize.quarter(quarter, {
@@ -1337,39 +567,33 @@ var formatters = {
1337
567
  }
1338
568
  },
1339
569
  // Stand-alone quarter
1340
- q: function (date, token, localize) {
570
+ q: function q(date, token, localize) {
1341
571
  var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
1342
-
1343
572
  switch (token) {
1344
573
  // 1, 2, 3, 4
1345
574
  case 'q':
1346
575
  return String(quarter);
1347
576
  // 01, 02, 03, 04
1348
-
1349
577
  case 'qq':
1350
578
  return addLeadingZeros(quarter, 2);
1351
579
  // 1st, 2nd, 3rd, 4th
1352
-
1353
580
  case 'qo':
1354
581
  return localize.ordinalNumber(quarter, {
1355
582
  unit: 'quarter'
1356
583
  });
1357
584
  // Q1, Q2, Q3, Q4
1358
-
1359
585
  case 'qqq':
1360
586
  return localize.quarter(quarter, {
1361
587
  width: 'abbreviated',
1362
588
  context: 'standalone'
1363
589
  });
1364
590
  // 1, 2, 3, 4 (narrow quarter; could be not numerical)
1365
-
1366
591
  case 'qqqqq':
1367
592
  return localize.quarter(quarter, {
1368
593
  width: 'narrow',
1369
594
  context: 'standalone'
1370
595
  });
1371
596
  // 1st quarter, 2nd quarter, ...
1372
-
1373
597
  case 'qqqq':
1374
598
  default:
1375
599
  return localize.quarter(quarter, {
@@ -1379,35 +603,30 @@ var formatters = {
1379
603
  }
1380
604
  },
1381
605
  // Month
1382
- M: function (date, token, localize) {
606
+ M: function M(date, token, localize) {
1383
607
  var month = date.getUTCMonth();
1384
-
1385
608
  switch (token) {
1386
609
  case 'M':
1387
610
  case 'MM':
1388
611
  return formatters$1.M(date, token);
1389
612
  // 1st, 2nd, ..., 12th
1390
-
1391
613
  case 'Mo':
1392
614
  return localize.ordinalNumber(month + 1, {
1393
615
  unit: 'month'
1394
616
  });
1395
617
  // Jan, Feb, ..., Dec
1396
-
1397
618
  case 'MMM':
1398
619
  return localize.month(month, {
1399
620
  width: 'abbreviated',
1400
621
  context: 'formatting'
1401
622
  });
1402
623
  // J, F, ..., D
1403
-
1404
624
  case 'MMMMM':
1405
625
  return localize.month(month, {
1406
626
  width: 'narrow',
1407
627
  context: 'formatting'
1408
628
  });
1409
629
  // January, February, ..., December
1410
-
1411
630
  case 'MMMM':
1412
631
  default:
1413
632
  return localize.month(month, {
@@ -1417,39 +636,33 @@ var formatters = {
1417
636
  }
1418
637
  },
1419
638
  // Stand-alone month
1420
- L: function (date, token, localize) {
639
+ L: function L(date, token, localize) {
1421
640
  var month = date.getUTCMonth();
1422
-
1423
641
  switch (token) {
1424
642
  // 1, 2, ..., 12
1425
643
  case 'L':
1426
644
  return String(month + 1);
1427
645
  // 01, 02, ..., 12
1428
-
1429
646
  case 'LL':
1430
647
  return addLeadingZeros(month + 1, 2);
1431
648
  // 1st, 2nd, ..., 12th
1432
-
1433
649
  case 'Lo':
1434
650
  return localize.ordinalNumber(month + 1, {
1435
651
  unit: 'month'
1436
652
  });
1437
653
  // Jan, Feb, ..., Dec
1438
-
1439
654
  case 'LLL':
1440
655
  return localize.month(month, {
1441
656
  width: 'abbreviated',
1442
657
  context: 'standalone'
1443
658
  });
1444
659
  // J, F, ..., D
1445
-
1446
660
  case 'LLLLL':
1447
661
  return localize.month(month, {
1448
662
  width: 'narrow',
1449
663
  context: 'standalone'
1450
664
  });
1451
665
  // January, February, ..., December
1452
-
1453
666
  case 'LLLL':
1454
667
  default:
1455
668
  return localize.month(month, {
@@ -1459,55 +672,47 @@ var formatters = {
1459
672
  }
1460
673
  },
1461
674
  // Local week of year
1462
- w: function (date, token, localize, options) {
1463
- var week = getUTCWeek(date, options);
1464
-
675
+ w: function w(date, token, localize, options) {
676
+ var week = index.getUTCWeek(date, options);
1465
677
  if (token === 'wo') {
1466
678
  return localize.ordinalNumber(week, {
1467
679
  unit: 'week'
1468
680
  });
1469
681
  }
1470
-
1471
682
  return addLeadingZeros(week, token.length);
1472
683
  },
1473
684
  // ISO week of year
1474
- I: function (date, token, localize) {
1475
- var isoWeek = getUTCISOWeek(date);
1476
-
685
+ I: function I(date, token, localize) {
686
+ var isoWeek = index.getUTCISOWeek(date);
1477
687
  if (token === 'Io') {
1478
688
  return localize.ordinalNumber(isoWeek, {
1479
689
  unit: 'week'
1480
690
  });
1481
691
  }
1482
-
1483
692
  return addLeadingZeros(isoWeek, token.length);
1484
693
  },
1485
694
  // Day of the month
1486
- d: function (date, token, localize) {
695
+ d: function d(date, token, localize) {
1487
696
  if (token === 'do') {
1488
697
  return localize.ordinalNumber(date.getUTCDate(), {
1489
698
  unit: 'date'
1490
699
  });
1491
700
  }
1492
-
1493
701
  return formatters$1.d(date, token);
1494
702
  },
1495
703
  // Day of year
1496
- D: function (date, token, localize) {
704
+ D: function D(date, token, localize) {
1497
705
  var dayOfYear = getUTCDayOfYear(date);
1498
-
1499
706
  if (token === 'Do') {
1500
707
  return localize.ordinalNumber(dayOfYear, {
1501
708
  unit: 'dayOfYear'
1502
709
  });
1503
710
  }
1504
-
1505
711
  return addLeadingZeros(dayOfYear, token.length);
1506
712
  },
1507
713
  // Day of week
1508
- E: function (date, token, localize) {
714
+ E: function E(date, token, localize) {
1509
715
  var dayOfWeek = date.getUTCDay();
1510
-
1511
716
  switch (token) {
1512
717
  // Tue
1513
718
  case 'E':
@@ -1518,21 +723,18 @@ var formatters = {
1518
723
  context: 'formatting'
1519
724
  });
1520
725
  // T
1521
-
1522
726
  case 'EEEEE':
1523
727
  return localize.day(dayOfWeek, {
1524
728
  width: 'narrow',
1525
729
  context: 'formatting'
1526
730
  });
1527
731
  // Tu
1528
-
1529
732
  case 'EEEEEE':
1530
733
  return localize.day(dayOfWeek, {
1531
734
  width: 'short',
1532
735
  context: 'formatting'
1533
736
  });
1534
737
  // Tuesday
1535
-
1536
738
  case 'EEEE':
1537
739
  default:
1538
740
  return localize.day(dayOfWeek, {
@@ -1542,46 +744,39 @@ var formatters = {
1542
744
  }
1543
745
  },
1544
746
  // Local day of week
1545
- e: function (date, token, localize, options) {
747
+ e: function e(date, token, localize, options) {
1546
748
  var dayOfWeek = date.getUTCDay();
1547
749
  var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
1548
-
1549
750
  switch (token) {
1550
751
  // Numerical value (Nth day of week with current locale or weekStartsOn)
1551
752
  case 'e':
1552
753
  return String(localDayOfWeek);
1553
754
  // Padded numerical value
1554
-
1555
755
  case 'ee':
1556
756
  return addLeadingZeros(localDayOfWeek, 2);
1557
757
  // 1st, 2nd, ..., 7th
1558
-
1559
758
  case 'eo':
1560
759
  return localize.ordinalNumber(localDayOfWeek, {
1561
760
  unit: 'day'
1562
761
  });
1563
-
1564
762
  case 'eee':
1565
763
  return localize.day(dayOfWeek, {
1566
764
  width: 'abbreviated',
1567
765
  context: 'formatting'
1568
766
  });
1569
767
  // T
1570
-
1571
768
  case 'eeeee':
1572
769
  return localize.day(dayOfWeek, {
1573
770
  width: 'narrow',
1574
771
  context: 'formatting'
1575
772
  });
1576
773
  // Tu
1577
-
1578
774
  case 'eeeeee':
1579
775
  return localize.day(dayOfWeek, {
1580
776
  width: 'short',
1581
777
  context: 'formatting'
1582
778
  });
1583
779
  // Tuesday
1584
-
1585
780
  case 'eeee':
1586
781
  default:
1587
782
  return localize.day(dayOfWeek, {
@@ -1591,46 +786,39 @@ var formatters = {
1591
786
  }
1592
787
  },
1593
788
  // Stand-alone local day of week
1594
- c: function (date, token, localize, options) {
789
+ c: function c(date, token, localize, options) {
1595
790
  var dayOfWeek = date.getUTCDay();
1596
791
  var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
1597
-
1598
792
  switch (token) {
1599
793
  // Numerical value (same as in `e`)
1600
794
  case 'c':
1601
795
  return String(localDayOfWeek);
1602
796
  // Padded numerical value
1603
-
1604
797
  case 'cc':
1605
798
  return addLeadingZeros(localDayOfWeek, token.length);
1606
799
  // 1st, 2nd, ..., 7th
1607
-
1608
800
  case 'co':
1609
801
  return localize.ordinalNumber(localDayOfWeek, {
1610
802
  unit: 'day'
1611
803
  });
1612
-
1613
804
  case 'ccc':
1614
805
  return localize.day(dayOfWeek, {
1615
806
  width: 'abbreviated',
1616
807
  context: 'standalone'
1617
808
  });
1618
809
  // T
1619
-
1620
810
  case 'ccccc':
1621
811
  return localize.day(dayOfWeek, {
1622
812
  width: 'narrow',
1623
813
  context: 'standalone'
1624
814
  });
1625
815
  // Tu
1626
-
1627
816
  case 'cccccc':
1628
817
  return localize.day(dayOfWeek, {
1629
818
  width: 'short',
1630
819
  context: 'standalone'
1631
820
  });
1632
821
  // Tuesday
1633
-
1634
822
  case 'cccc':
1635
823
  default:
1636
824
  return localize.day(dayOfWeek, {
@@ -1640,47 +828,40 @@ var formatters = {
1640
828
  }
1641
829
  },
1642
830
  // ISO day of week
1643
- i: function (date, token, localize) {
831
+ i: function i(date, token, localize) {
1644
832
  var dayOfWeek = date.getUTCDay();
1645
833
  var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
1646
-
1647
834
  switch (token) {
1648
835
  // 2
1649
836
  case 'i':
1650
837
  return String(isoDayOfWeek);
1651
838
  // 02
1652
-
1653
839
  case 'ii':
1654
840
  return addLeadingZeros(isoDayOfWeek, token.length);
1655
841
  // 2nd
1656
-
1657
842
  case 'io':
1658
843
  return localize.ordinalNumber(isoDayOfWeek, {
1659
844
  unit: 'day'
1660
845
  });
1661
846
  // Tue
1662
-
1663
847
  case 'iii':
1664
848
  return localize.day(dayOfWeek, {
1665
849
  width: 'abbreviated',
1666
850
  context: 'formatting'
1667
851
  });
1668
852
  // T
1669
-
1670
853
  case 'iiiii':
1671
854
  return localize.day(dayOfWeek, {
1672
855
  width: 'narrow',
1673
856
  context: 'formatting'
1674
857
  });
1675
858
  // Tu
1676
-
1677
859
  case 'iiiiii':
1678
860
  return localize.day(dayOfWeek, {
1679
861
  width: 'short',
1680
862
  context: 'formatting'
1681
863
  });
1682
864
  // Tuesday
1683
-
1684
865
  case 'iiii':
1685
866
  default:
1686
867
  return localize.day(dayOfWeek, {
@@ -1690,10 +871,9 @@ var formatters = {
1690
871
  }
1691
872
  },
1692
873
  // AM or PM
1693
- a: function (date, token, localize) {
874
+ a: function a(date, token, localize) {
1694
875
  var hours = date.getUTCHours();
1695
876
  var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
1696
-
1697
877
  switch (token) {
1698
878
  case 'a':
1699
879
  case 'aa':
@@ -1701,19 +881,16 @@ var formatters = {
1701
881
  width: 'abbreviated',
1702
882
  context: 'formatting'
1703
883
  });
1704
-
1705
884
  case 'aaa':
1706
885
  return localize.dayPeriod(dayPeriodEnumValue, {
1707
886
  width: 'abbreviated',
1708
887
  context: 'formatting'
1709
888
  }).toLowerCase();
1710
-
1711
889
  case 'aaaaa':
1712
890
  return localize.dayPeriod(dayPeriodEnumValue, {
1713
891
  width: 'narrow',
1714
892
  context: 'formatting'
1715
893
  });
1716
-
1717
894
  case 'aaaa':
1718
895
  default:
1719
896
  return localize.dayPeriod(dayPeriodEnumValue, {
@@ -1723,10 +900,9 @@ var formatters = {
1723
900
  }
1724
901
  },
1725
902
  // AM, PM, midnight, noon
1726
- b: function (date, token, localize) {
903
+ b: function b(date, token, localize) {
1727
904
  var hours = date.getUTCHours();
1728
905
  var dayPeriodEnumValue;
1729
-
1730
906
  if (hours === 12) {
1731
907
  dayPeriodEnumValue = dayPeriodEnum.noon;
1732
908
  } else if (hours === 0) {
@@ -1734,7 +910,6 @@ var formatters = {
1734
910
  } else {
1735
911
  dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
1736
912
  }
1737
-
1738
913
  switch (token) {
1739
914
  case 'b':
1740
915
  case 'bb':
@@ -1742,19 +917,16 @@ var formatters = {
1742
917
  width: 'abbreviated',
1743
918
  context: 'formatting'
1744
919
  });
1745
-
1746
920
  case 'bbb':
1747
921
  return localize.dayPeriod(dayPeriodEnumValue, {
1748
922
  width: 'abbreviated',
1749
923
  context: 'formatting'
1750
924
  }).toLowerCase();
1751
-
1752
925
  case 'bbbbb':
1753
926
  return localize.dayPeriod(dayPeriodEnumValue, {
1754
927
  width: 'narrow',
1755
928
  context: 'formatting'
1756
929
  });
1757
-
1758
930
  case 'bbbb':
1759
931
  default:
1760
932
  return localize.dayPeriod(dayPeriodEnumValue, {
@@ -1764,10 +936,9 @@ var formatters = {
1764
936
  }
1765
937
  },
1766
938
  // in the morning, in the afternoon, in the evening, at night
1767
- B: function (date, token, localize) {
939
+ B: function B(date, token, localize) {
1768
940
  var hours = date.getUTCHours();
1769
941
  var dayPeriodEnumValue;
1770
-
1771
942
  if (hours >= 17) {
1772
943
  dayPeriodEnumValue = dayPeriodEnum.evening;
1773
944
  } else if (hours >= 12) {
@@ -1777,7 +948,6 @@ var formatters = {
1777
948
  } else {
1778
949
  dayPeriodEnumValue = dayPeriodEnum.night;
1779
950
  }
1780
-
1781
951
  switch (token) {
1782
952
  case 'B':
1783
953
  case 'BB':
@@ -1786,13 +956,11 @@ var formatters = {
1786
956
  width: 'abbreviated',
1787
957
  context: 'formatting'
1788
958
  });
1789
-
1790
959
  case 'BBBBB':
1791
960
  return localize.dayPeriod(dayPeriodEnumValue, {
1792
961
  width: 'narrow',
1793
962
  context: 'formatting'
1794
963
  });
1795
-
1796
964
  case 'BBBB':
1797
965
  default:
1798
966
  return localize.dayPeriod(dayPeriodEnumValue, {
@@ -1802,7 +970,7 @@ var formatters = {
1802
970
  }
1803
971
  },
1804
972
  // Hour [1-12]
1805
- h: function (date, token, localize) {
973
+ h: function h(date, token, localize) {
1806
974
  if (token === 'ho') {
1807
975
  var hours = date.getUTCHours() % 12;
1808
976
  if (hours === 0) hours = 12;
@@ -1810,133 +978,119 @@ var formatters = {
1810
978
  unit: 'hour'
1811
979
  });
1812
980
  }
1813
-
1814
981
  return formatters$1.h(date, token);
1815
982
  },
1816
983
  // Hour [0-23]
1817
- H: function (date, token, localize) {
984
+ H: function H(date, token, localize) {
1818
985
  if (token === 'Ho') {
1819
986
  return localize.ordinalNumber(date.getUTCHours(), {
1820
987
  unit: 'hour'
1821
988
  });
1822
989
  }
1823
-
1824
990
  return formatters$1.H(date, token);
1825
991
  },
1826
992
  // Hour [0-11]
1827
- K: function (date, token, localize) {
993
+ K: function K(date, token, localize) {
1828
994
  var hours = date.getUTCHours() % 12;
1829
-
1830
995
  if (token === 'Ko') {
1831
996
  return localize.ordinalNumber(hours, {
1832
997
  unit: 'hour'
1833
998
  });
1834
999
  }
1835
-
1836
1000
  return addLeadingZeros(hours, token.length);
1837
1001
  },
1838
1002
  // Hour [1-24]
1839
- k: function (date, token, localize) {
1003
+ k: function k(date, token, localize) {
1840
1004
  var hours = date.getUTCHours();
1841
1005
  if (hours === 0) hours = 24;
1842
-
1843
1006
  if (token === 'ko') {
1844
1007
  return localize.ordinalNumber(hours, {
1845
1008
  unit: 'hour'
1846
1009
  });
1847
1010
  }
1848
-
1849
1011
  return addLeadingZeros(hours, token.length);
1850
1012
  },
1851
1013
  // Minute
1852
- m: function (date, token, localize) {
1014
+ m: function m(date, token, localize) {
1853
1015
  if (token === 'mo') {
1854
1016
  return localize.ordinalNumber(date.getUTCMinutes(), {
1855
1017
  unit: 'minute'
1856
1018
  });
1857
1019
  }
1858
-
1859
1020
  return formatters$1.m(date, token);
1860
1021
  },
1861
1022
  // Second
1862
- s: function (date, token, localize) {
1023
+ s: function s(date, token, localize) {
1863
1024
  if (token === 'so') {
1864
1025
  return localize.ordinalNumber(date.getUTCSeconds(), {
1865
1026
  unit: 'second'
1866
1027
  });
1867
1028
  }
1868
-
1869
1029
  return formatters$1.s(date, token);
1870
1030
  },
1871
1031
  // Fraction of second
1872
- S: function (date, token) {
1032
+ S: function S(date, token) {
1873
1033
  return formatters$1.S(date, token);
1874
1034
  },
1875
1035
  // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1876
- X: function (date, token, _localize, options) {
1036
+ X: function X(date, token, _localize, options) {
1877
1037
  var originalDate = options._originalDate || date;
1878
1038
  var timezoneOffset = originalDate.getTimezoneOffset();
1879
-
1880
1039
  if (timezoneOffset === 0) {
1881
1040
  return 'Z';
1882
1041
  }
1883
-
1884
1042
  switch (token) {
1885
1043
  // Hours and optional minutes
1886
1044
  case 'X':
1887
1045
  return formatTimezoneWithOptionalMinutes(timezoneOffset);
1046
+
1888
1047
  // Hours, minutes and optional seconds without `:` delimiter
1889
1048
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1890
1049
  // so this token always has the same output as `XX`
1891
-
1892
1050
  case 'XXXX':
1893
1051
  case 'XX':
1894
1052
  // Hours and minutes without `:` delimiter
1895
1053
  return formatTimezone(timezoneOffset);
1054
+
1896
1055
  // Hours, minutes and optional seconds with `:` delimiter
1897
1056
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1898
1057
  // so this token always has the same output as `XXX`
1899
-
1900
1058
  case 'XXXXX':
1901
1059
  case 'XXX': // Hours and minutes with `:` delimiter
1902
-
1903
1060
  default:
1904
1061
  return formatTimezone(timezoneOffset, ':');
1905
1062
  }
1906
1063
  },
1907
1064
  // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
1908
- x: function (date, token, _localize, options) {
1065
+ x: function x(date, token, _localize, options) {
1909
1066
  var originalDate = options._originalDate || date;
1910
1067
  var timezoneOffset = originalDate.getTimezoneOffset();
1911
-
1912
1068
  switch (token) {
1913
1069
  // Hours and optional minutes
1914
1070
  case 'x':
1915
1071
  return formatTimezoneWithOptionalMinutes(timezoneOffset);
1072
+
1916
1073
  // Hours, minutes and optional seconds without `:` delimiter
1917
1074
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1918
1075
  // so this token always has the same output as `xx`
1919
-
1920
1076
  case 'xxxx':
1921
1077
  case 'xx':
1922
1078
  // Hours and minutes without `:` delimiter
1923
1079
  return formatTimezone(timezoneOffset);
1080
+
1924
1081
  // Hours, minutes and optional seconds with `:` delimiter
1925
1082
  // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1926
1083
  // so this token always has the same output as `xxx`
1927
-
1928
1084
  case 'xxxxx':
1929
1085
  case 'xxx': // Hours and minutes with `:` delimiter
1930
-
1931
1086
  default:
1932
1087
  return formatTimezone(timezoneOffset, ':');
1933
1088
  }
1934
1089
  },
1935
1090
  // Timezone (GMT)
1936
- O: function (date, token, _localize, options) {
1091
+ O: function O(date, token, _localize, options) {
1937
1092
  var originalDate = options._originalDate || date;
1938
1093
  var timezoneOffset = originalDate.getTimezoneOffset();
1939
-
1940
1094
  switch (token) {
1941
1095
  // Short
1942
1096
  case 'O':
@@ -1944,17 +1098,15 @@ var formatters = {
1944
1098
  case 'OOO':
1945
1099
  return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
1946
1100
  // Long
1947
-
1948
1101
  case 'OOOO':
1949
1102
  default:
1950
1103
  return 'GMT' + formatTimezone(timezoneOffset, ':');
1951
1104
  }
1952
1105
  },
1953
1106
  // Timezone (specific non-location)
1954
- z: function (date, token, _localize, options) {
1107
+ z: function z(date, token, _localize, options) {
1955
1108
  var originalDate = options._originalDate || date;
1956
1109
  var timezoneOffset = originalDate.getTimezoneOffset();
1957
-
1958
1110
  switch (token) {
1959
1111
  // Short
1960
1112
  case 'z':
@@ -1962,173 +1114,628 @@ var formatters = {
1962
1114
  case 'zzz':
1963
1115
  return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
1964
1116
  // Long
1965
-
1966
1117
  case 'zzzz':
1967
1118
  default:
1968
1119
  return 'GMT' + formatTimezone(timezoneOffset, ':');
1969
1120
  }
1970
1121
  },
1971
1122
  // Seconds 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 = Math.floor(originalDate.getTime() / 1000);
1975
1126
  return addLeadingZeros(timestamp, token.length);
1976
1127
  },
1977
1128
  // Milliseconds timestamp
1978
- T: function (date, token, _localize, options) {
1129
+ T: function T(date, token, _localize, options) {
1979
1130
  var originalDate = options._originalDate || date;
1980
1131
  var timestamp = originalDate.getTime();
1981
1132
  return addLeadingZeros(timestamp, token.length);
1982
1133
  }
1983
1134
  };
1135
+ function formatTimezoneShort(offset, dirtyDelimiter) {
1136
+ var sign = offset > 0 ? '-' : '+';
1137
+ var absOffset = Math.abs(offset);
1138
+ var hours = Math.floor(absOffset / 60);
1139
+ var minutes = absOffset % 60;
1140
+ if (minutes === 0) {
1141
+ return sign + String(hours);
1142
+ }
1143
+ var delimiter = dirtyDelimiter || '';
1144
+ return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
1145
+ }
1146
+ function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
1147
+ if (offset % 60 === 0) {
1148
+ var sign = offset > 0 ? '-' : '+';
1149
+ return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
1150
+ }
1151
+ return formatTimezone(offset, dirtyDelimiter);
1152
+ }
1153
+ function formatTimezone(offset, dirtyDelimiter) {
1154
+ var delimiter = dirtyDelimiter || '';
1155
+ var sign = offset > 0 ? '-' : '+';
1156
+ var absOffset = Math.abs(offset);
1157
+ var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);
1158
+ var minutes = addLeadingZeros(absOffset % 60, 2);
1159
+ return sign + hours + delimiter + minutes;
1160
+ }
1161
+
1162
+ var dateLongFormatter = function dateLongFormatter(pattern, formatLong) {
1163
+ switch (pattern) {
1164
+ case 'P':
1165
+ return formatLong.date({
1166
+ width: 'short'
1167
+ });
1168
+ case 'PP':
1169
+ return formatLong.date({
1170
+ width: 'medium'
1171
+ });
1172
+ case 'PPP':
1173
+ return formatLong.date({
1174
+ width: 'long'
1175
+ });
1176
+ case 'PPPP':
1177
+ default:
1178
+ return formatLong.date({
1179
+ width: 'full'
1180
+ });
1181
+ }
1182
+ };
1183
+ var timeLongFormatter = function timeLongFormatter(pattern, formatLong) {
1184
+ switch (pattern) {
1185
+ case 'p':
1186
+ return formatLong.time({
1187
+ width: 'short'
1188
+ });
1189
+ case 'pp':
1190
+ return formatLong.time({
1191
+ width: 'medium'
1192
+ });
1193
+ case 'ppp':
1194
+ return formatLong.time({
1195
+ width: 'long'
1196
+ });
1197
+ case 'pppp':
1198
+ default:
1199
+ return formatLong.time({
1200
+ width: 'full'
1201
+ });
1202
+ }
1203
+ };
1204
+ var dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong) {
1205
+ var matchResult = pattern.match(/(P+)(p+)?/) || [];
1206
+ var datePattern = matchResult[1];
1207
+ var timePattern = matchResult[2];
1208
+ if (!timePattern) {
1209
+ return dateLongFormatter(pattern, formatLong);
1210
+ }
1211
+ var dateTimeFormat;
1212
+ switch (datePattern) {
1213
+ case 'P':
1214
+ dateTimeFormat = formatLong.dateTime({
1215
+ width: 'short'
1216
+ });
1217
+ break;
1218
+ case 'PP':
1219
+ dateTimeFormat = formatLong.dateTime({
1220
+ width: 'medium'
1221
+ });
1222
+ break;
1223
+ case 'PPP':
1224
+ dateTimeFormat = formatLong.dateTime({
1225
+ width: 'long'
1226
+ });
1227
+ break;
1228
+ case 'PPPP':
1229
+ default:
1230
+ dateTimeFormat = formatLong.dateTime({
1231
+ width: 'full'
1232
+ });
1233
+ break;
1234
+ }
1235
+ return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));
1236
+ };
1237
+ var longFormatters = {
1238
+ p: timeLongFormatter,
1239
+ P: dateTimeLongFormatter
1240
+ };
1241
+
1242
+ var protectedDayOfYearTokens = ['D', 'DD'];
1243
+ var protectedWeekYearTokens = ['YY', 'YYYY'];
1244
+ function isProtectedDayOfYearToken(token) {
1245
+ return protectedDayOfYearTokens.indexOf(token) !== -1;
1246
+ }
1247
+ function isProtectedWeekYearToken(token) {
1248
+ return protectedWeekYearTokens.indexOf(token) !== -1;
1249
+ }
1250
+ function throwProtectedError(token, format, input) {
1251
+ if (token === 'YYYY') {
1252
+ 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"));
1253
+ } else if (token === 'YY') {
1254
+ 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"));
1255
+ } else if (token === 'D') {
1256
+ 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"));
1257
+ } else if (token === 'DD') {
1258
+ 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"));
1259
+ }
1260
+ }
1261
+
1262
+ var formatDistanceLocale = {
1263
+ lessThanXSeconds: {
1264
+ one: 'less than a second',
1265
+ other: 'less than {{count}} seconds'
1266
+ },
1267
+ xSeconds: {
1268
+ one: '1 second',
1269
+ other: '{{count}} seconds'
1270
+ },
1271
+ halfAMinute: 'half a minute',
1272
+ lessThanXMinutes: {
1273
+ one: 'less than a minute',
1274
+ other: 'less than {{count}} minutes'
1275
+ },
1276
+ xMinutes: {
1277
+ one: '1 minute',
1278
+ other: '{{count}} minutes'
1279
+ },
1280
+ aboutXHours: {
1281
+ one: 'about 1 hour',
1282
+ other: 'about {{count}} hours'
1283
+ },
1284
+ xHours: {
1285
+ one: '1 hour',
1286
+ other: '{{count}} hours'
1287
+ },
1288
+ xDays: {
1289
+ one: '1 day',
1290
+ other: '{{count}} days'
1291
+ },
1292
+ aboutXWeeks: {
1293
+ one: 'about 1 week',
1294
+ other: 'about {{count}} weeks'
1295
+ },
1296
+ xWeeks: {
1297
+ one: '1 week',
1298
+ other: '{{count}} weeks'
1299
+ },
1300
+ aboutXMonths: {
1301
+ one: 'about 1 month',
1302
+ other: 'about {{count}} months'
1303
+ },
1304
+ xMonths: {
1305
+ one: '1 month',
1306
+ other: '{{count}} months'
1307
+ },
1308
+ aboutXYears: {
1309
+ one: 'about 1 year',
1310
+ other: 'about {{count}} years'
1311
+ },
1312
+ xYears: {
1313
+ one: '1 year',
1314
+ other: '{{count}} years'
1315
+ },
1316
+ overXYears: {
1317
+ one: 'over 1 year',
1318
+ other: 'over {{count}} years'
1319
+ },
1320
+ almostXYears: {
1321
+ one: 'almost 1 year',
1322
+ other: 'almost {{count}} years'
1323
+ }
1324
+ };
1325
+ var formatDistance = function formatDistance(token, count, options) {
1326
+ var result;
1327
+ var tokenValue = formatDistanceLocale[token];
1328
+ if (typeof tokenValue === 'string') {
1329
+ result = tokenValue;
1330
+ } else if (count === 1) {
1331
+ result = tokenValue.one;
1332
+ } else {
1333
+ result = tokenValue.other.replace('{{count}}', count.toString());
1334
+ }
1335
+ if (options !== null && options !== void 0 && options.addSuffix) {
1336
+ if (options.comparison && options.comparison > 0) {
1337
+ return 'in ' + result;
1338
+ } else {
1339
+ return result + ' ago';
1340
+ }
1341
+ }
1342
+ return result;
1343
+ };
1984
1344
 
1985
- function formatTimezoneShort(offset, dirtyDelimiter) {
1986
- var sign = offset > 0 ? '-' : '+';
1987
- var absOffset = Math.abs(offset);
1988
- var hours = Math.floor(absOffset / 60);
1989
- var minutes = absOffset % 60;
1990
-
1991
- if (minutes === 0) {
1992
- return sign + String(hours);
1993
- }
1994
-
1995
- var delimiter = dirtyDelimiter || '';
1996
- return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
1345
+ function buildFormatLongFn(args) {
1346
+ return function () {
1347
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1348
+ // TODO: Remove String()
1349
+ var width = options.width ? String(options.width) : args.defaultWidth;
1350
+ var format = args.formats[width] || args.formats[args.defaultWidth];
1351
+ return format;
1352
+ };
1997
1353
  }
1998
1354
 
1999
- function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
2000
- if (offset % 60 === 0) {
2001
- var sign = offset > 0 ? '-' : '+';
2002
- return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
2003
- }
1355
+ var dateFormats = {
1356
+ full: 'EEEE, MMMM do, y',
1357
+ long: 'MMMM do, y',
1358
+ medium: 'MMM d, y',
1359
+ short: 'MM/dd/yyyy'
1360
+ };
1361
+ var timeFormats = {
1362
+ full: 'h:mm:ss a zzzz',
1363
+ long: 'h:mm:ss a z',
1364
+ medium: 'h:mm:ss a',
1365
+ short: 'h:mm a'
1366
+ };
1367
+ var dateTimeFormats = {
1368
+ full: "{{date}} 'at' {{time}}",
1369
+ long: "{{date}} 'at' {{time}}",
1370
+ medium: '{{date}}, {{time}}',
1371
+ short: '{{date}}, {{time}}'
1372
+ };
1373
+ var formatLong = {
1374
+ date: buildFormatLongFn({
1375
+ formats: dateFormats,
1376
+ defaultWidth: 'full'
1377
+ }),
1378
+ time: buildFormatLongFn({
1379
+ formats: timeFormats,
1380
+ defaultWidth: 'full'
1381
+ }),
1382
+ dateTime: buildFormatLongFn({
1383
+ formats: dateTimeFormats,
1384
+ defaultWidth: 'full'
1385
+ })
1386
+ };
2004
1387
 
2005
- return formatTimezone(offset, dirtyDelimiter);
2006
- }
1388
+ var formatRelativeLocale = {
1389
+ lastWeek: "'last' eeee 'at' p",
1390
+ yesterday: "'yesterday at' p",
1391
+ today: "'today at' p",
1392
+ tomorrow: "'tomorrow at' p",
1393
+ nextWeek: "eeee 'at' p",
1394
+ other: 'P'
1395
+ };
1396
+ var formatRelative = function formatRelative(token, _date, _baseDate, _options) {
1397
+ return formatRelativeLocale[token];
1398
+ };
2007
1399
 
2008
- function formatTimezone(offset, dirtyDelimiter) {
2009
- var delimiter = dirtyDelimiter || '';
2010
- var sign = offset > 0 ? '-' : '+';
2011
- var absOffset = Math.abs(offset);
2012
- var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);
2013
- var minutes = addLeadingZeros(absOffset % 60, 2);
2014
- return sign + hours + delimiter + minutes;
1400
+ function buildLocalizeFn(args) {
1401
+ return function (dirtyIndex, options) {
1402
+ var context = options !== null && options !== void 0 && options.context ? String(options.context) : 'standalone';
1403
+ var valuesArray;
1404
+ if (context === 'formatting' && args.formattingValues) {
1405
+ var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
1406
+ var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
1407
+ valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
1408
+ } else {
1409
+ var _defaultWidth = args.defaultWidth;
1410
+ var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
1411
+ valuesArray = args.values[_width] || args.values[_defaultWidth];
1412
+ }
1413
+ var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
1414
+ // @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!
1415
+ return valuesArray[index];
1416
+ };
2015
1417
  }
2016
1418
 
2017
- function dateLongFormatter(pattern, formatLong) {
2018
- switch (pattern) {
2019
- case 'P':
2020
- return formatLong.date({
2021
- width: 'short'
2022
- });
2023
-
2024
- case 'PP':
2025
- return formatLong.date({
2026
- width: 'medium'
2027
- });
2028
-
2029
- case 'PPP':
2030
- return formatLong.date({
2031
- width: 'long'
2032
- });
1419
+ var eraValues = {
1420
+ narrow: ['B', 'A'],
1421
+ abbreviated: ['BC', 'AD'],
1422
+ wide: ['Before Christ', 'Anno Domini']
1423
+ };
1424
+ var quarterValues = {
1425
+ narrow: ['1', '2', '3', '4'],
1426
+ abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
1427
+ wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']
1428
+ };
2033
1429
 
2034
- case 'PPPP':
2035
- default:
2036
- return formatLong.date({
2037
- width: 'full'
2038
- });
1430
+ // Note: in English, the names of days of the week and months are capitalized.
1431
+ // If you are making a new locale based on this one, check if the same is true for the language you're working on.
1432
+ // Generally, formatted dates should look like they are in the middle of a sentence,
1433
+ // e.g. in Spanish language the weekdays and months should be in the lowercase.
1434
+ var monthValues = {
1435
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
1436
+ abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
1437
+ wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
1438
+ };
1439
+ var dayValues = {
1440
+ narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
1441
+ short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
1442
+ abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
1443
+ wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
1444
+ };
1445
+ var dayPeriodValues = {
1446
+ narrow: {
1447
+ am: 'a',
1448
+ pm: 'p',
1449
+ midnight: 'mi',
1450
+ noon: 'n',
1451
+ morning: 'morning',
1452
+ afternoon: 'afternoon',
1453
+ evening: 'evening',
1454
+ night: 'night'
1455
+ },
1456
+ abbreviated: {
1457
+ am: 'AM',
1458
+ pm: 'PM',
1459
+ midnight: 'midnight',
1460
+ noon: 'noon',
1461
+ morning: 'morning',
1462
+ afternoon: 'afternoon',
1463
+ evening: 'evening',
1464
+ night: 'night'
1465
+ },
1466
+ wide: {
1467
+ am: 'a.m.',
1468
+ pm: 'p.m.',
1469
+ midnight: 'midnight',
1470
+ noon: 'noon',
1471
+ morning: 'morning',
1472
+ afternoon: 'afternoon',
1473
+ evening: 'evening',
1474
+ night: 'night'
2039
1475
  }
2040
- }
2041
-
2042
- function timeLongFormatter(pattern, formatLong) {
2043
- switch (pattern) {
2044
- case 'p':
2045
- return formatLong.time({
2046
- width: 'short'
2047
- });
1476
+ };
1477
+ var formattingDayPeriodValues = {
1478
+ narrow: {
1479
+ am: 'a',
1480
+ pm: 'p',
1481
+ midnight: 'mi',
1482
+ noon: 'n',
1483
+ morning: 'in the morning',
1484
+ afternoon: 'in the afternoon',
1485
+ evening: 'in the evening',
1486
+ night: 'at night'
1487
+ },
1488
+ abbreviated: {
1489
+ am: 'AM',
1490
+ pm: 'PM',
1491
+ midnight: 'midnight',
1492
+ noon: 'noon',
1493
+ morning: 'in the morning',
1494
+ afternoon: 'in the afternoon',
1495
+ evening: 'in the evening',
1496
+ night: 'at night'
1497
+ },
1498
+ wide: {
1499
+ am: 'a.m.',
1500
+ pm: 'p.m.',
1501
+ midnight: 'midnight',
1502
+ noon: 'noon',
1503
+ morning: 'in the morning',
1504
+ afternoon: 'in the afternoon',
1505
+ evening: 'in the evening',
1506
+ night: 'at night'
1507
+ }
1508
+ };
1509
+ var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
1510
+ var number = Number(dirtyNumber);
2048
1511
 
2049
- case 'pp':
2050
- return formatLong.time({
2051
- width: 'medium'
2052
- });
1512
+ // If ordinal numbers depend on context, for example,
1513
+ // if they are different for different grammatical genders,
1514
+ // use `options.unit`.
1515
+ //
1516
+ // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
1517
+ // 'day', 'hour', 'minute', 'second'.
2053
1518
 
2054
- case 'ppp':
2055
- return formatLong.time({
2056
- width: 'long'
2057
- });
1519
+ var rem100 = number % 100;
1520
+ if (rem100 > 20 || rem100 < 10) {
1521
+ switch (rem100 % 10) {
1522
+ case 1:
1523
+ return number + 'st';
1524
+ case 2:
1525
+ return number + 'nd';
1526
+ case 3:
1527
+ return number + 'rd';
1528
+ }
1529
+ }
1530
+ return number + 'th';
1531
+ };
1532
+ var localize = {
1533
+ ordinalNumber: ordinalNumber,
1534
+ era: buildLocalizeFn({
1535
+ values: eraValues,
1536
+ defaultWidth: 'wide'
1537
+ }),
1538
+ quarter: buildLocalizeFn({
1539
+ values: quarterValues,
1540
+ defaultWidth: 'wide',
1541
+ argumentCallback: function argumentCallback(quarter) {
1542
+ return quarter - 1;
1543
+ }
1544
+ }),
1545
+ month: buildLocalizeFn({
1546
+ values: monthValues,
1547
+ defaultWidth: 'wide'
1548
+ }),
1549
+ day: buildLocalizeFn({
1550
+ values: dayValues,
1551
+ defaultWidth: 'wide'
1552
+ }),
1553
+ dayPeriod: buildLocalizeFn({
1554
+ values: dayPeriodValues,
1555
+ defaultWidth: 'wide',
1556
+ formattingValues: formattingDayPeriodValues,
1557
+ defaultFormattingWidth: 'wide'
1558
+ })
1559
+ };
2058
1560
 
2059
- case 'pppp':
2060
- default:
2061
- return formatLong.time({
2062
- width: 'full'
2063
- });
2064
- }
1561
+ function buildMatchFn(args) {
1562
+ return function (string) {
1563
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1564
+ var width = options.width;
1565
+ var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
1566
+ var matchResult = string.match(matchPattern);
1567
+ if (!matchResult) {
1568
+ return null;
1569
+ }
1570
+ var matchedString = matchResult[0];
1571
+ var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
1572
+ var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {
1573
+ return pattern.test(matchedString);
1574
+ }) : findKey(parsePatterns, function (pattern) {
1575
+ return pattern.test(matchedString);
1576
+ });
1577
+ var value;
1578
+ value = args.valueCallback ? args.valueCallback(key) : key;
1579
+ value = options.valueCallback ? options.valueCallback(value) : value;
1580
+ var rest = string.slice(matchedString.length);
1581
+ return {
1582
+ value: value,
1583
+ rest: rest
1584
+ };
1585
+ };
2065
1586
  }
2066
-
2067
- function dateTimeLongFormatter(pattern, formatLong) {
2068
- var matchResult = pattern.match(/(P+)(p+)?/) || [];
2069
- var datePattern = matchResult[1];
2070
- var timePattern = matchResult[2];
2071
-
2072
- if (!timePattern) {
2073
- return dateLongFormatter(pattern, formatLong);
1587
+ function findKey(object, predicate) {
1588
+ for (var key in object) {
1589
+ if (object.hasOwnProperty(key) && predicate(object[key])) {
1590
+ return key;
1591
+ }
2074
1592
  }
2075
-
2076
- var dateTimeFormat;
2077
-
2078
- switch (datePattern) {
2079
- case 'P':
2080
- dateTimeFormat = formatLong.dateTime({
2081
- width: 'short'
2082
- });
2083
- break;
2084
-
2085
- case 'PP':
2086
- dateTimeFormat = formatLong.dateTime({
2087
- width: 'medium'
2088
- });
2089
- break;
2090
-
2091
- case 'PPP':
2092
- dateTimeFormat = formatLong.dateTime({
2093
- width: 'long'
2094
- });
2095
- break;
2096
-
2097
- case 'PPPP':
2098
- default:
2099
- dateTimeFormat = formatLong.dateTime({
2100
- width: 'full'
2101
- });
2102
- break;
1593
+ return undefined;
1594
+ }
1595
+ function findIndex(array, predicate) {
1596
+ for (var key = 0; key < array.length; key++) {
1597
+ if (predicate(array[key])) {
1598
+ return key;
1599
+ }
2103
1600
  }
1601
+ return undefined;
1602
+ }
2104
1603
 
2105
- return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));
1604
+ function buildMatchPatternFn(args) {
1605
+ return function (string) {
1606
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1607
+ var matchResult = string.match(args.matchPattern);
1608
+ if (!matchResult) return null;
1609
+ var matchedString = matchResult[0];
1610
+ var parseResult = string.match(args.parsePattern);
1611
+ if (!parseResult) return null;
1612
+ var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
1613
+ value = options.valueCallback ? options.valueCallback(value) : value;
1614
+ var rest = string.slice(matchedString.length);
1615
+ return {
1616
+ value: value,
1617
+ rest: rest
1618
+ };
1619
+ };
2106
1620
  }
2107
1621
 
2108
- var longFormatters = {
2109
- p: timeLongFormatter,
2110
- P: dateTimeLongFormatter
1622
+ var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
1623
+ var parseOrdinalNumberPattern = /\d+/i;
1624
+ var matchEraPatterns = {
1625
+ narrow: /^(b|a)/i,
1626
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
1627
+ wide: /^(before christ|before common era|anno domini|common era)/i
1628
+ };
1629
+ var parseEraPatterns = {
1630
+ any: [/^b/i, /^(a|c)/i]
1631
+ };
1632
+ var matchQuarterPatterns = {
1633
+ narrow: /^[1234]/i,
1634
+ abbreviated: /^q[1234]/i,
1635
+ wide: /^[1234](th|st|nd|rd)? quarter/i
1636
+ };
1637
+ var parseQuarterPatterns = {
1638
+ any: [/1/i, /2/i, /3/i, /4/i]
1639
+ };
1640
+ var matchMonthPatterns = {
1641
+ narrow: /^[jfmasond]/i,
1642
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
1643
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
1644
+ };
1645
+ var parseMonthPatterns = {
1646
+ 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],
1647
+ 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]
1648
+ };
1649
+ var matchDayPatterns = {
1650
+ narrow: /^[smtwf]/i,
1651
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
1652
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
1653
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
1654
+ };
1655
+ var parseDayPatterns = {
1656
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
1657
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
1658
+ };
1659
+ var matchDayPeriodPatterns = {
1660
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
1661
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
1662
+ };
1663
+ var parseDayPeriodPatterns = {
1664
+ any: {
1665
+ am: /^a/i,
1666
+ pm: /^p/i,
1667
+ midnight: /^mi/i,
1668
+ noon: /^no/i,
1669
+ morning: /morning/i,
1670
+ afternoon: /afternoon/i,
1671
+ evening: /evening/i,
1672
+ night: /night/i
1673
+ }
1674
+ };
1675
+ var match = {
1676
+ ordinalNumber: buildMatchPatternFn({
1677
+ matchPattern: matchOrdinalNumberPattern,
1678
+ parsePattern: parseOrdinalNumberPattern,
1679
+ valueCallback: function valueCallback(value) {
1680
+ return parseInt(value, 10);
1681
+ }
1682
+ }),
1683
+ era: buildMatchFn({
1684
+ matchPatterns: matchEraPatterns,
1685
+ defaultMatchWidth: 'wide',
1686
+ parsePatterns: parseEraPatterns,
1687
+ defaultParseWidth: 'any'
1688
+ }),
1689
+ quarter: buildMatchFn({
1690
+ matchPatterns: matchQuarterPatterns,
1691
+ defaultMatchWidth: 'wide',
1692
+ parsePatterns: parseQuarterPatterns,
1693
+ defaultParseWidth: 'any',
1694
+ valueCallback: function valueCallback(index) {
1695
+ return index + 1;
1696
+ }
1697
+ }),
1698
+ month: buildMatchFn({
1699
+ matchPatterns: matchMonthPatterns,
1700
+ defaultMatchWidth: 'wide',
1701
+ parsePatterns: parseMonthPatterns,
1702
+ defaultParseWidth: 'any'
1703
+ }),
1704
+ day: buildMatchFn({
1705
+ matchPatterns: matchDayPatterns,
1706
+ defaultMatchWidth: 'wide',
1707
+ parsePatterns: parseDayPatterns,
1708
+ defaultParseWidth: 'any'
1709
+ }),
1710
+ dayPeriod: buildMatchFn({
1711
+ matchPatterns: matchDayPeriodPatterns,
1712
+ defaultMatchWidth: 'any',
1713
+ parsePatterns: parseDayPeriodPatterns,
1714
+ defaultParseWidth: 'any'
1715
+ })
2111
1716
  };
2112
1717
 
2113
- var protectedDayOfYearTokens = ['D', 'DD'];
2114
- var protectedWeekYearTokens = ['YY', 'YYYY'];
2115
- function isProtectedDayOfYearToken(token) {
2116
- return protectedDayOfYearTokens.indexOf(token) !== -1;
2117
- }
2118
- function isProtectedWeekYearToken(token) {
2119
- return protectedWeekYearTokens.indexOf(token) !== -1;
2120
- }
2121
- function throwProtectedError(token, format, input) {
2122
- if (token === 'YYYY') {
2123
- throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
2124
- } else if (token === 'YY') {
2125
- throw new RangeError("Use `yy` instead of `YY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
2126
- } else if (token === 'D') {
2127
- 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"));
2128
- } else if (token === 'DD') {
2129
- 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"));
1718
+ /**
1719
+ * @type {Locale}
1720
+ * @category Locales
1721
+ * @summary English locale (United States).
1722
+ * @language English
1723
+ * @iso-639-2 eng
1724
+ * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
1725
+ * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
1726
+ */
1727
+ var locale = {
1728
+ code: 'en-US',
1729
+ formatDistance: formatDistance,
1730
+ formatLong: formatLong,
1731
+ formatRelative: formatRelative,
1732
+ localize: localize,
1733
+ match: match,
1734
+ options: {
1735
+ weekStartsOn: 0 /* Sunday */,
1736
+ firstWeekContainsDate: 1
2130
1737
  }
2131
- }
1738
+ };
2132
1739
 
2133
1740
  // - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
2134
1741
  // (one of the certain letters followed by `o`)
@@ -2140,14 +1747,15 @@ function throwProtectedError(token, format, input) {
2140
1747
  // If there is no matching single quote
2141
1748
  // then the sequence will continue until the end of the string.
2142
1749
  // - . matches any single character unmatched by previous parts of the RegExps
1750
+ var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
2143
1751
 
2144
- var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also
1752
+ // This RegExp catches symbols escaped by quotes, and also
2145
1753
  // sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
2146
-
2147
1754
  var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
2148
1755
  var escapedStringRegExp = /^'([^]*?)'?$/;
2149
1756
  var doubleQuoteRegExp = /''/g;
2150
1757
  var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
1758
+
2151
1759
  /**
2152
1760
  * @name format
2153
1761
  * @category Common Helpers
@@ -2157,7 +1765,7 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
2157
1765
  * Return the formatted date string in the given format. The result may vary by locale.
2158
1766
  *
2159
1767
  * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
2160
- * > See: https://git.io/fxCyr
1768
+ * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2161
1769
  *
2162
1770
  * The characters wrapped between two single quotes characters (') are escaped.
2163
1771
  * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
@@ -2393,30 +2001,10 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
2393
2001
  * - `p`: long localized time
2394
2002
  *
2395
2003
  * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
2396
- * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr
2004
+ * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2397
2005
  *
2398
2006
  * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
2399
- * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr
2400
- *
2401
- * ### v2.0.0 breaking changes:
2402
- *
2403
- * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
2404
- *
2405
- * - The second argument is now required for the sake of explicitness.
2406
- *
2407
- * ```javascript
2408
- * // Before v2.0.0
2409
- * format(new Date(2016, 0, 1))
2410
- *
2411
- * // v2.0.0 onward
2412
- * format(new Date(2016, 0, 1), "yyyy-MM-dd'T'HH:mm:ss.SSSxxx")
2413
- * ```
2414
- *
2415
- * - New format string API for `format` function
2416
- * which is based on [Unicode Technical Standard #35](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).
2417
- * See [this post](https://blog.date-fns.org/post/unicode-tokens-in-date-fns-v2-sreatyki91jg) for more details.
2418
- *
2419
- * - Characters are now escaped using single quote symbols (`'`) instead of square brackets.
2007
+ * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2420
2008
  *
2421
2009
  * @param {Date|Number} date - the original date
2422
2010
  * @param {String} format - the string of tokens
@@ -2425,9 +2013,9 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
2425
2013
  * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
2426
2014
  * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is
2427
2015
  * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;
2428
- * see: https://git.io/fxCyr
2016
+ * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2429
2017
  * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;
2430
- * see: https://git.io/fxCyr
2018
+ * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2431
2019
  * @returns {String} the formatted date string
2432
2020
  * @throws {TypeError} 2 arguments required
2433
2021
  * @throws {RangeError} `date` must not be Invalid Date
@@ -2435,69 +2023,63 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
2435
2023
  * @throws {RangeError} `options.locale` must contain `formatLong` property
2436
2024
  * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
2437
2025
  * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
2438
- * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr
2439
- * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr
2440
- * @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
2441
- * @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
2026
+ * @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
2027
+ * @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
2028
+ * @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
2029
+ * @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
2442
2030
  * @throws {RangeError} format string contains an unescaped latin alphabet character
2443
2031
  *
2444
2032
  * @example
2445
2033
  * // Represent 11 February 2014 in middle-endian format:
2446
- * var result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
2034
+ * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
2447
2035
  * //=> '02/11/2014'
2448
2036
  *
2449
2037
  * @example
2450
2038
  * // Represent 2 July 2014 in Esperanto:
2451
2039
  * import { eoLocale } from 'date-fns/locale/eo'
2452
- * var result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
2040
+ * const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
2453
2041
  * locale: eoLocale
2454
2042
  * })
2455
2043
  * //=> '2-a de julio 2014'
2456
2044
  *
2457
2045
  * @example
2458
2046
  * // Escape string by single quote characters:
2459
- * var result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
2047
+ * const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
2460
2048
  * //=> "3 o'clock"
2461
2049
  */
2462
2050
 
2463
- function format(dirtyDate, dirtyFormatStr, dirtyOptions) {
2464
- requiredArgs(2, arguments);
2051
+ function format(dirtyDate, dirtyFormatStr, options) {
2052
+ 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;
2053
+ index.requiredArgs(2, arguments);
2465
2054
  var formatStr = String(dirtyFormatStr);
2466
- var options = dirtyOptions || {};
2467
- var locale$1 = options.locale || locale;
2468
- var localeFirstWeekContainsDate = locale$1.options && locale$1.options.firstWeekContainsDate;
2469
- var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
2470
- var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
2055
+ var defaultOptions = index.getDefaultOptions();
2056
+ 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;
2057
+ var firstWeekContainsDate = index.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);
2471
2058
 
2059
+ // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
2472
2060
  if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
2473
2061
  throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
2474
2062
  }
2063
+ var weekStartsOn = index.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);
2475
2064
 
2476
- var localeWeekStartsOn = locale$1.options && locale$1.options.weekStartsOn;
2477
- var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
2478
- var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
2479
-
2065
+ // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
2480
2066
  if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
2481
2067
  throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
2482
2068
  }
2483
-
2484
2069
  if (!locale$1.localize) {
2485
2070
  throw new RangeError('locale must contain localize property');
2486
2071
  }
2487
-
2488
2072
  if (!locale$1.formatLong) {
2489
2073
  throw new RangeError('locale must contain formatLong property');
2490
2074
  }
2491
-
2492
- var originalDate = toDate(dirtyDate);
2493
-
2075
+ var originalDate = index.toDate(dirtyDate);
2494
2076
  if (!isValid(originalDate)) {
2495
2077
  throw new RangeError('Invalid time value');
2496
- } // Convert the date in system timezone to the same date in UTC+00:00 timezone.
2078
+ }
2079
+
2080
+ // Convert the date in system timezone to the same date in UTC+00:00 timezone.
2497
2081
  // This ensures that when UTC functions will be implemented, locales will be compatible with them.
2498
2082
  // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376
2499
-
2500
-
2501
2083
  var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);
2502
2084
  var utcDate = subMilliseconds(originalDate, timezoneOffset);
2503
2085
  var formatterOptions = {
@@ -2508,50 +2090,43 @@ function format(dirtyDate, dirtyFormatStr, dirtyOptions) {
2508
2090
  };
2509
2091
  var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {
2510
2092
  var firstCharacter = substring[0];
2511
-
2512
2093
  if (firstCharacter === 'p' || firstCharacter === 'P') {
2513
2094
  var longFormatter = longFormatters[firstCharacter];
2514
- return longFormatter(substring, locale$1.formatLong, formatterOptions);
2095
+ return longFormatter(substring, locale$1.formatLong);
2515
2096
  }
2516
-
2517
2097
  return substring;
2518
2098
  }).join('').match(formattingTokensRegExp).map(function (substring) {
2519
2099
  // Replace two single quote characters with one single quote character
2520
2100
  if (substring === "''") {
2521
2101
  return "'";
2522
2102
  }
2523
-
2524
2103
  var firstCharacter = substring[0];
2525
-
2526
2104
  if (firstCharacter === "'") {
2527
2105
  return cleanEscapedString(substring);
2528
2106
  }
2529
-
2530
2107
  var formatter = formatters[firstCharacter];
2531
-
2532
2108
  if (formatter) {
2533
- if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(substring)) {
2534
- throwProtectedError(substring, dirtyFormatStr, dirtyDate);
2109
+ if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(substring)) {
2110
+ throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
2535
2111
  }
2536
-
2537
- if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(substring)) {
2538
- throwProtectedError(substring, dirtyFormatStr, dirtyDate);
2112
+ if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(substring)) {
2113
+ throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
2539
2114
  }
2540
-
2541
2115
  return formatter(utcDate, substring, locale$1.localize, formatterOptions);
2542
2116
  }
2543
-
2544
2117
  if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
2545
2118
  throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');
2546
2119
  }
2547
-
2548
2120
  return substring;
2549
2121
  }).join('');
2550
2122
  return result;
2551
2123
  }
2552
-
2553
2124
  function cleanEscapedString(input) {
2554
- return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'");
2125
+ var matched = input.match(escapedStringRegExp);
2126
+ if (!matched) {
2127
+ return input;
2128
+ }
2129
+ return matched[1].replace(doubleQuoteRegExp, "'");
2555
2130
  }
2556
2131
 
2557
2132
  const getImageFromImage = (image) => {
@@ -2596,114 +2171,114 @@ const getColorForVerificationStatus = (status) => {
2596
2171
  return "#000000";
2597
2172
  }
2598
2173
  };
2599
- const getCategoryColor = (category = index.LCCategoryEnum.achievement) => {
2174
+ const getCategoryColor = (category = index$1.LCCategoryEnum.achievement) => {
2600
2175
  switch (category) {
2601
- case index.LCCategoryEnum.socialBadge:
2176
+ case index$1.LCCategoryEnum.socialBadge:
2602
2177
  return "cyan-700";
2603
- case index.LCCategoryEnum.skill:
2178
+ case index$1.LCCategoryEnum.skill:
2604
2179
  return "indigo-600";
2605
- case index.LCCategoryEnum.achievement:
2180
+ case index$1.LCCategoryEnum.achievement:
2606
2181
  return "spice-600";
2607
- case index.LCCategoryEnum.learningHistory:
2182
+ case index$1.LCCategoryEnum.learningHistory:
2608
2183
  return "emerald-700";
2609
- case index.LCCategoryEnum.id:
2184
+ case index$1.LCCategoryEnum.id:
2610
2185
  return "yellow-400";
2611
- case index.LCCategoryEnum.workHistory:
2186
+ case index$1.LCCategoryEnum.workHistory:
2612
2187
  return "blue-400";
2613
- case index.LCCategoryEnum.job:
2188
+ case index$1.LCCategoryEnum.job:
2614
2189
  return "rose-600";
2615
- case index.LCCategoryEnum.course:
2190
+ case index$1.LCCategoryEnum.course:
2616
2191
  return "emerald-700";
2617
- case index.LCCategoryEnum.currency:
2192
+ case index$1.LCCategoryEnum.currency:
2618
2193
  return "cyan-700";
2619
- case index.LCCategoryEnum.membership:
2194
+ case index$1.LCCategoryEnum.membership:
2620
2195
  return "teal-500";
2621
2196
  default:
2622
2197
  return "spice-600";
2623
2198
  }
2624
2199
  };
2625
- const getCategoryPrimaryColor = (category = index.LCCategoryEnum.achievement) => {
2200
+ const getCategoryPrimaryColor = (category = index$1.LCCategoryEnum.achievement) => {
2626
2201
  switch (category) {
2627
- case index.LCCategoryEnum.socialBadge:
2202
+ case index$1.LCCategoryEnum.socialBadge:
2628
2203
  return "cyan";
2629
- case index.LCCategoryEnum.skill:
2204
+ case index$1.LCCategoryEnum.skill:
2630
2205
  return "indigo";
2631
- case index.LCCategoryEnum.achievement:
2206
+ case index$1.LCCategoryEnum.achievement:
2632
2207
  return "spice";
2633
- case index.LCCategoryEnum.learningHistory:
2208
+ case index$1.LCCategoryEnum.learningHistory:
2634
2209
  return "emerald";
2635
- case index.LCCategoryEnum.id:
2210
+ case index$1.LCCategoryEnum.id:
2636
2211
  return "yellow";
2637
- case index.LCCategoryEnum.workHistory:
2212
+ case index$1.LCCategoryEnum.workHistory:
2638
2213
  return "blue";
2639
- case index.LCCategoryEnum.job:
2214
+ case index$1.LCCategoryEnum.job:
2640
2215
  return "rose";
2641
- case index.LCCategoryEnum.course:
2216
+ case index$1.LCCategoryEnum.course:
2642
2217
  return "emerald";
2643
- case index.LCCategoryEnum.currency:
2218
+ case index$1.LCCategoryEnum.currency:
2644
2219
  return "cyan";
2645
- case index.LCCategoryEnum.membership:
2220
+ case index$1.LCCategoryEnum.membership:
2646
2221
  return "teal";
2647
- case index.LCCategoryEnum.accommodations:
2222
+ case index$1.LCCategoryEnum.accommodations:
2648
2223
  return "amber";
2649
- case index.LCCategoryEnum.accomplishments:
2224
+ case index$1.LCCategoryEnum.accomplishments:
2650
2225
  return "lime";
2651
2226
  default:
2652
2227
  return "spice";
2653
2228
  }
2654
2229
  };
2655
- const getCategoryLightColor = (category = index.LCCategoryEnum.achievement) => {
2656
- if (category === index.LCCategoryEnum.meritBadge) {
2230
+ const getCategoryLightColor = (category = index$1.LCCategoryEnum.achievement) => {
2231
+ if (category === index$1.LCCategoryEnum.meritBadge) {
2657
2232
  return "sp-purple-base";
2658
2233
  }
2659
2234
  return `${getCategoryPrimaryColor(category)}-500`;
2660
2235
  };
2661
- const getCategoryDarkColor = (category = index.LCCategoryEnum.achievement) => {
2662
- if (category === index.LCCategoryEnum.meritBadge) {
2236
+ const getCategoryDarkColor = (category = index$1.LCCategoryEnum.achievement) => {
2237
+ if (category === index$1.LCCategoryEnum.meritBadge) {
2663
2238
  return "sp-purple-base";
2664
2239
  }
2665
2240
  return `${getCategoryPrimaryColor(category)}-700`;
2666
2241
  };
2667
- const getCategoryIcon = (category = index.LCCategoryEnum.achievement) => {
2242
+ const getCategoryIcon = (category = index$1.LCCategoryEnum.achievement) => {
2668
2243
  switch (category) {
2669
- case index.LCCategoryEnum.socialBadge:
2244
+ case index$1.LCCategoryEnum.socialBadge:
2670
2245
  return /* @__PURE__ */ React__default["default"].createElement(SocialBadgesIcon, null);
2671
- case index.LCCategoryEnum.skill:
2246
+ case index$1.LCCategoryEnum.skill:
2672
2247
  return /* @__PURE__ */ React__default["default"].createElement(PuzzlePiece.PuzzlePiece, null);
2673
- case index.LCCategoryEnum.achievement:
2248
+ case index$1.LCCategoryEnum.achievement:
2674
2249
  return /* @__PURE__ */ React__default["default"].createElement(Trophy.Trophy, {
2675
2250
  size: "21"
2676
2251
  });
2677
- case index.LCCategoryEnum.course:
2678
- case index.LCCategoryEnum.learningHistory:
2252
+ case index$1.LCCategoryEnum.course:
2253
+ case index$1.LCCategoryEnum.learningHistory:
2679
2254
  return /* @__PURE__ */ React__default["default"].createElement(User.Graduation, {
2680
2255
  size: "21"
2681
2256
  });
2682
- case index.LCCategoryEnum.job:
2683
- case index.LCCategoryEnum.workHistory:
2257
+ case index$1.LCCategoryEnum.job:
2258
+ case index$1.LCCategoryEnum.workHistory:
2684
2259
  return /* @__PURE__ */ React__default["default"].createElement(User.Briefcase, {
2685
2260
  size: "21"
2686
2261
  });
2687
- case index.LCCategoryEnum.id:
2262
+ case index$1.LCCategoryEnum.id:
2688
2263
  return /* @__PURE__ */ React__default["default"].createElement(User.User, {
2689
2264
  size: "21"
2690
2265
  });
2691
- case index.LCCategoryEnum.membership:
2266
+ case index$1.LCCategoryEnum.membership:
2692
2267
  return /* @__PURE__ */ React__default["default"].createElement(KeyIcon, {
2693
2268
  size: "21"
2694
2269
  });
2695
- case index.LCCategoryEnum.currency:
2696
- case index.LCCategoryEnum.accommodations:
2270
+ case index$1.LCCategoryEnum.currency:
2271
+ case index$1.LCCategoryEnum.accommodations:
2697
2272
  return /* @__PURE__ */ React__default["default"].createElement(AccommodationsIcon, {
2698
2273
  size: "21"
2699
2274
  });
2700
- case index.LCCategoryEnum.accomplishments:
2275
+ case index$1.LCCategoryEnum.accomplishments:
2701
2276
  return /* @__PURE__ */ React__default["default"].createElement(AccomplishmentsIcon, {
2702
2277
  size: "21"
2703
2278
  });
2704
- case index.LCCategoryEnum.meritBadge:
2705
- return /* @__PURE__ */ React__default["default"].createElement(ScoutsPledge, null);
2706
- case index.LCCategoryEnum.currency:
2279
+ case index$1.LCCategoryEnum.meritBadge:
2280
+ return /* @__PURE__ */ React__default["default"].createElement(ScoutsLogo, null);
2281
+ case index$1.LCCategoryEnum.currency:
2707
2282
  default:
2708
2283
  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}");
2709
2284
  console.log("getCategoryIcon - unhandled category:", category);
@@ -2727,10 +2302,13 @@ const categorizeSkills = (skills) => {
2727
2302
  acc[obj.category].push(obj);
2728
2303
  acc[obj.category].totalSkills++;
2729
2304
  }
2730
- let totalSubskillsCount = acc[obj.category].reduce((total, skill) => {
2731
- var _a2, _b;
2732
- return total + ((_b = (_a2 = skill == null ? void 0 : skill.subskills) == null ? void 0 : _a2.length) != null ? _b : 0);
2733
- }, 0);
2305
+ let totalSubskillsCount = acc[obj.category].reduce(
2306
+ (total, skill) => {
2307
+ var _a2, _b;
2308
+ return total + ((_b = (_a2 = skill == null ? void 0 : skill.subskills) == null ? void 0 : _a2.length) != null ? _b : 0);
2309
+ },
2310
+ 0
2311
+ );
2734
2312
  acc[obj.category].totalSubskillsCount = totalSubskillsCount;
2735
2313
  return acc;
2736
2314
  }, {});
@@ -2760,4 +2338,4 @@ exports.getImageFromProfile = getImageFromProfile;
2760
2338
  exports.getInfoFromCredential = getInfoFromCredential;
2761
2339
  exports.getNameFromProfile = getNameFromProfile;
2762
2340
  exports.getTotalCountOfSkills = getTotalCountOfSkills;
2763
- //# sourceMappingURL=credential.helpers-afb94f02.js.map
2341
+ //# sourceMappingURL=credential.helpers-39c07250.js.map