@learncard/react 2.5.17 → 2.5.18

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