@verdocs/web-sdk 4.2.36 → 4.2.40

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 (364) hide show
  1. package/dist/cjs/{EnvelopeStore-4aeb54e1.js → EnvelopeStore-6c5995f1.js} +1 -1
  2. package/dist/cjs/{TemplateFieldStore-2db70818.js → TemplateFieldStore-d621e5bd.js} +1 -1
  3. package/dist/cjs/{TemplateRoleStore-fb869e9a.js → TemplateRoleStore-a9d15077.js} +1 -1
  4. package/dist/cjs/{TemplateStore-7c7f1c50.js → TemplateStore-3e7bdff8.js} +3 -3
  5. package/dist/cjs/{Toast-818b7b3e.js → Toast-d84d7bd3.js} +1 -1
  6. package/dist/cjs/format-187ebc36.js +3232 -0
  7. package/dist/cjs/{index-3e4c5891.js → index-233cb8df.js} +1 -1
  8. package/dist/cjs/{index-cfdfab36.js → index-d2999878.js} +784 -735
  9. package/dist/cjs/{interact.min-40e2f4db.js → interact.min-1744263f.js} +1 -1
  10. package/dist/cjs/loader.cjs.js +2 -2
  11. package/dist/cjs/{utils-330fb889.js → utils-bd4accd8.js} +31 -9
  12. package/dist/cjs/verdocs-activity-box.cjs.entry.js +1 -1
  13. package/dist/cjs/verdocs-auth.cjs.entry.js +23 -18
  14. package/dist/cjs/verdocs-build.cjs.entry.js +5 -5
  15. package/dist/cjs/verdocs-button-panel_2.cjs.entry.js +1 -1
  16. package/dist/cjs/{verdocs-button_3.cjs.entry.js → verdocs-button_2.cjs.entry.js} +1 -55
  17. package/dist/cjs/{verdocs-checkbox_4.cjs.entry.js → verdocs-checkbox_5.cjs.entry.js} +114 -146
  18. package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js +2 -2
  19. package/dist/cjs/verdocs-dialog.cjs.entry.js +1 -1
  20. package/dist/cjs/verdocs-dropdown.cjs.entry.js +1 -1
  21. package/dist/cjs/verdocs-envelope-document-page.cjs.entry.js +2 -2
  22. package/dist/cjs/verdocs-envelope-recipient-link_2.cjs.entry.js +4 -4
  23. package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +4 -4
  24. package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +3 -3
  25. package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js +15 -9
  26. package/dist/cjs/verdocs-field-payment.cjs.entry.js +4 -4
  27. package/dist/cjs/verdocs-field-radio.cjs.entry.js +82 -0
  28. package/dist/cjs/verdocs-file-chooser_2.cjs.entry.js +1 -1
  29. package/dist/cjs/verdocs-kba-dialog.cjs.entry.js +1 -1
  30. package/dist/cjs/verdocs-loader.cjs.entry.js +1 -1
  31. package/dist/cjs/verdocs-ok-dialog.cjs.entry.js +1 -1
  32. package/dist/cjs/verdocs-organization-card_2.cjs.entry.js +568 -3772
  33. package/dist/cjs/verdocs-pagination_2.cjs.entry.js +2 -2
  34. package/dist/cjs/verdocs-preview_10.cjs.entry.js +78 -154
  35. package/dist/cjs/verdocs-quick-functions_2.cjs.entry.js +1 -1
  36. package/dist/cjs/verdocs-radio-button_3.cjs.entry.js +5 -5
  37. package/dist/cjs/verdocs-search-tabs.cjs.entry.js +1 -1
  38. package/dist/cjs/verdocs-search.cjs.entry.js +1 -1
  39. package/dist/cjs/verdocs-sign.cjs.entry.js +9 -5
  40. package/dist/cjs/verdocs-spinner.cjs.entry.js +1 -1
  41. package/dist/cjs/verdocs-status-indicator.cjs.entry.js +1 -1
  42. package/dist/cjs/verdocs-table.cjs.entry.js +1 -1
  43. package/dist/cjs/verdocs-template-card.cjs.entry.js +1 -1
  44. package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +9 -6
  45. package/dist/cjs/verdocs-template-star.cjs.entry.js +1 -1
  46. package/dist/cjs/verdocs-template-tags.cjs.entry.js +1 -1
  47. package/dist/cjs/verdocs-templates-list.cjs.entry.js +1 -1
  48. package/dist/cjs/verdocs-toggle.cjs.entry.js +1 -1
  49. package/dist/cjs/verdocs-view.cjs.entry.js +2 -2
  50. package/dist/cjs/verdocs-web-sdk.cjs.js +3 -3
  51. package/dist/collection/collection-manifest.json +3 -2
  52. package/dist/collection/components/controls/verdocs-file-chooser/verdocs-file-chooser.js +1 -1
  53. package/dist/collection/components/controls/verdocs-organization-card/verdocs-organization-card.js +1 -1
  54. package/dist/collection/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.js +1 -1
  55. package/dist/collection/components/dialogs/verdocs-upload-dialog/verdocs-upload-dialog.js +1 -1
  56. package/dist/collection/components/elements/verdocs-quick-functions/verdocs-quick-functions.js +1 -1
  57. package/dist/collection/components/elements/verdocs-search-box/verdocs-search-box.js +1 -1
  58. package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js +25 -18
  59. package/dist/collection/components/embeds/verdocs-build/verdocs-build.js +8 -8
  60. package/dist/collection/components/embeds/verdocs-preview/verdocs-preview.js +16 -20
  61. package/dist/collection/components/embeds/verdocs-search/verdocs-search.js +1 -1
  62. package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +3 -3
  63. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +8 -4
  64. package/dist/collection/components/embeds/verdocs-view/verdocs-view.js +3 -3
  65. package/dist/collection/components/envelopes/verdocs-activity-box/verdocs-activity-box.js +4 -4
  66. package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.js +2 -2
  67. package/dist/collection/components/envelopes/verdocs-envelope-document-page/verdocs-envelope-document-page.js +1 -1
  68. package/dist/collection/components/envelopes/verdocs-envelope-recipient-link/verdocs-envelope-recipient-link.js +2 -2
  69. package/dist/collection/components/envelopes/verdocs-envelope-recipient-summary/verdocs-envelope-recipient-summary.js +4 -4
  70. package/dist/collection/components/envelopes/verdocs-envelope-sidebar/verdocs-envelope-sidebar.js +4 -4
  71. package/dist/collection/components/envelopes/verdocs-envelopes-list/verdocs-envelopes-list.js +7 -7
  72. package/dist/collection/components/envelopes/verdocs-status-indicator/verdocs-status-indicator.js +3 -3
  73. package/dist/collection/components/fields/verdocs-field-attachment/verdocs-field-attachment.js +3 -3
  74. package/dist/collection/components/fields/verdocs-field-checkbox/verdocs-field-checkbox.js +2 -2
  75. package/dist/collection/components/fields/verdocs-field-date/verdocs-field-date.js +3 -3
  76. package/dist/collection/components/fields/verdocs-field-dropdown/verdocs-field-dropdown.js +2 -2
  77. package/dist/collection/components/fields/verdocs-field-initial/verdocs-field-initial.js +2 -2
  78. package/dist/collection/components/fields/verdocs-field-payment/verdocs-field-payment.js +2 -2
  79. package/dist/collection/components/fields/verdocs-field-radio/verdocs-field-radio.css +102 -0
  80. package/dist/collection/components/fields/verdocs-field-radio/verdocs-field-radio.js +350 -0
  81. package/dist/collection/components/fields/verdocs-field-radio-button-group/verdocs-field-radio-button.js +2 -2
  82. package/dist/collection/components/fields/verdocs-field-signature/verdocs-field-signature.js +2 -2
  83. package/dist/collection/components/fields/verdocs-field-textarea/verdocs-field-textarea.js +3 -3
  84. package/dist/collection/components/fields/verdocs-field-textbox/verdocs-field-textbox.js +28 -5
  85. package/dist/collection/components/fields/verdocs-field-timestamp/verdocs-field-timestamp.js +3 -3
  86. package/dist/collection/components/templates/verdocs-template-attachments/verdocs-template-attachments.js +4 -4
  87. package/dist/collection/components/templates/verdocs-template-build-tabs/verdocs-template-build-tabs.js +1 -1
  88. package/dist/collection/components/templates/verdocs-template-card/verdocs-template-card.js +1 -1
  89. package/dist/collection/components/templates/verdocs-template-create/verdocs-template-create.js +4 -4
  90. package/dist/collection/components/templates/verdocs-template-document-page/verdocs-template-document-page.js +6 -3
  91. package/dist/collection/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.css +7 -1
  92. package/dist/collection/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.js +59 -146
  93. package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.css +26 -1
  94. package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +62 -133
  95. package/dist/collection/components/templates/verdocs-template-name/verdocs-template-name.js +3 -3
  96. package/dist/collection/components/templates/verdocs-template-reminders/verdocs-template-reminders.js +3 -3
  97. package/dist/collection/components/templates/verdocs-template-role-properties/verdocs-template-role-properties.js +2 -2
  98. package/dist/collection/components/templates/verdocs-template-roles/verdocs-template-roles.js +3 -3
  99. package/dist/collection/components/templates/verdocs-template-sender/verdocs-template-sender.js +2 -2
  100. package/dist/collection/components/templates/verdocs-template-star/verdocs-template-star.js +2 -2
  101. package/dist/collection/components/templates/verdocs-template-visibillity/verdocs-template-visibility.js +3 -3
  102. package/dist/collection/components/templates/verdocs-templates-list/verdocs-templates-list.js +11 -11
  103. package/dist/collection/utils/Toast.js +1 -1
  104. package/dist/collection/utils/utils.js +31 -9
  105. package/dist/components/Toast.js +1 -1
  106. package/dist/components/format.js +3206 -0
  107. package/dist/components/index.js +2 -0
  108. package/dist/components/utils.js +32 -10
  109. package/dist/components/verdocs-auth.js +24 -17
  110. package/dist/components/verdocs-field-attachment2.js +1 -1
  111. package/dist/components/verdocs-field-checkbox2.js +1 -1
  112. package/dist/components/verdocs-field-date2.js +530 -3734
  113. package/dist/components/verdocs-field-dropdown2.js +1 -1
  114. package/dist/components/verdocs-field-initial2.js +1 -1
  115. package/dist/components/verdocs-field-radio-button2.js +1 -1
  116. package/dist/components/verdocs-field-radio.d.ts +11 -0
  117. package/dist/components/verdocs-field-radio.js +154 -0
  118. package/dist/components/verdocs-field-signature2.js +1 -1
  119. package/dist/components/verdocs-field-textarea2.js +1 -1
  120. package/dist/components/verdocs-field-textbox2.js +9 -3
  121. package/dist/components/verdocs-field-timestamp2.js +3 -3
  122. package/dist/components/verdocs-preview2.js +15 -19
  123. package/dist/components/verdocs-sign.js +5 -1
  124. package/dist/components/verdocs-template-document-page2.js +6 -3
  125. package/dist/components/verdocs-template-field-properties2.js +57 -144
  126. package/dist/components/verdocs-template-fields2.js +57 -128
  127. package/dist/custom-elements.json +53 -0
  128. package/dist/esm/{EnvelopeStore-1ed5dc8f.js → EnvelopeStore-dbec0399.js} +1 -1
  129. package/dist/esm/{TemplateFieldStore-32329b5a.js → TemplateFieldStore-4ee5d16c.js} +1 -1
  130. package/dist/esm/{TemplateRoleStore-0a4f98cb.js → TemplateRoleStore-018f4e74.js} +1 -1
  131. package/dist/esm/{TemplateStore-7d41d941.js → TemplateStore-b4149301.js} +3 -3
  132. package/dist/esm/{Toast-3e2645fc.js → Toast-c4843828.js} +1 -1
  133. package/dist/esm/format-2bf71189.js +3206 -0
  134. package/dist/esm/{index-b89cf6a4.js → index-3476681c.js} +784 -735
  135. package/dist/esm/{index-296aabaf.js → index-e58b15f6.js} +1 -1
  136. package/dist/esm/{interact.min-565d696f.js → interact.min-18f44045.js} +1 -1
  137. package/dist/esm/loader.js +3 -3
  138. package/dist/esm/{utils-8f9e83b4.js → utils-7d128d3c.js} +32 -10
  139. package/dist/esm/verdocs-activity-box.entry.js +1 -1
  140. package/dist/esm/verdocs-auth.entry.js +23 -18
  141. package/dist/esm/verdocs-build.entry.js +5 -5
  142. package/dist/esm/verdocs-button-panel_2.entry.js +1 -1
  143. package/dist/esm/{verdocs-button_3.entry.js → verdocs-button_2.entry.js} +2 -55
  144. package/dist/esm/{verdocs-checkbox_4.entry.js → verdocs-checkbox_5.entry.js} +114 -147
  145. package/dist/esm/verdocs-contact-picker_2.entry.js +2 -2
  146. package/dist/esm/verdocs-dialog.entry.js +1 -1
  147. package/dist/esm/verdocs-dropdown.entry.js +1 -1
  148. package/dist/esm/verdocs-envelope-document-page.entry.js +2 -2
  149. package/dist/esm/verdocs-envelope-recipient-link_2.entry.js +4 -4
  150. package/dist/esm/verdocs-envelope-sidebar.entry.js +4 -4
  151. package/dist/esm/verdocs-envelopes-list.entry.js +3 -3
  152. package/dist/esm/verdocs-field-attachment_13.entry.js +15 -9
  153. package/dist/esm/verdocs-field-payment.entry.js +4 -4
  154. package/dist/esm/verdocs-field-radio.entry.js +78 -0
  155. package/dist/esm/verdocs-file-chooser_2.entry.js +1 -1
  156. package/dist/esm/verdocs-kba-dialog.entry.js +1 -1
  157. package/dist/esm/verdocs-loader.entry.js +1 -1
  158. package/dist/esm/verdocs-ok-dialog.entry.js +1 -1
  159. package/dist/esm/verdocs-organization-card_2.entry.js +530 -3734
  160. package/dist/esm/verdocs-pagination_2.entry.js +2 -2
  161. package/dist/esm/verdocs-preview_10.entry.js +78 -154
  162. package/dist/esm/verdocs-quick-functions_2.entry.js +1 -1
  163. package/dist/esm/verdocs-radio-button_3.entry.js +5 -5
  164. package/dist/esm/verdocs-search-tabs.entry.js +1 -1
  165. package/dist/esm/verdocs-search.entry.js +1 -1
  166. package/dist/esm/verdocs-sign.entry.js +9 -5
  167. package/dist/esm/verdocs-spinner.entry.js +1 -1
  168. package/dist/esm/verdocs-status-indicator.entry.js +1 -1
  169. package/dist/esm/verdocs-table.entry.js +1 -1
  170. package/dist/esm/verdocs-template-card.entry.js +1 -1
  171. package/dist/esm/verdocs-template-document-page_2.entry.js +9 -6
  172. package/dist/esm/verdocs-template-star.entry.js +1 -1
  173. package/dist/esm/verdocs-template-tags.entry.js +1 -1
  174. package/dist/esm/verdocs-templates-list.entry.js +1 -1
  175. package/dist/esm/verdocs-toggle.entry.js +1 -1
  176. package/dist/esm/verdocs-view.entry.js +2 -2
  177. package/dist/esm/verdocs-web-sdk.js +4 -4
  178. package/dist/esm-es5/{EnvelopeStore-1ed5dc8f.js → EnvelopeStore-dbec0399.js} +1 -1
  179. package/dist/esm-es5/{TemplateFieldStore-32329b5a.js → TemplateFieldStore-4ee5d16c.js} +1 -1
  180. package/dist/esm-es5/{TemplateRoleStore-0a4f98cb.js → TemplateRoleStore-018f4e74.js} +1 -1
  181. package/dist/esm-es5/{TemplateStore-7d41d941.js → TemplateStore-b4149301.js} +1 -1
  182. package/dist/esm-es5/{Toast-3e2645fc.js → Toast-c4843828.js} +1 -1
  183. package/dist/esm-es5/format-2bf71189.js +1 -0
  184. package/dist/esm-es5/index-3476681c.js +1 -0
  185. package/dist/esm-es5/{index-296aabaf.js → index-e58b15f6.js} +1 -1
  186. package/dist/esm-es5/{interact.min-565d696f.js → interact.min-18f44045.js} +1 -1
  187. package/dist/esm-es5/loader.js +1 -1
  188. package/dist/esm-es5/{utils-8f9e83b4.js → utils-7d128d3c.js} +1 -1
  189. package/dist/esm-es5/verdocs-activity-box.entry.js +1 -1
  190. package/dist/esm-es5/verdocs-auth.entry.js +1 -1
  191. package/dist/esm-es5/verdocs-build.entry.js +1 -1
  192. package/dist/esm-es5/verdocs-button-panel_2.entry.js +1 -1
  193. package/dist/esm-es5/verdocs-button_2.entry.js +1 -0
  194. package/dist/esm-es5/verdocs-checkbox_5.entry.js +1 -0
  195. package/dist/esm-es5/verdocs-contact-picker_2.entry.js +1 -1
  196. package/dist/esm-es5/verdocs-dialog.entry.js +1 -1
  197. package/dist/esm-es5/verdocs-dropdown.entry.js +1 -1
  198. package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
  199. package/dist/esm-es5/verdocs-envelope-recipient-link_2.entry.js +1 -1
  200. package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
  201. package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
  202. package/dist/esm-es5/verdocs-field-attachment_13.entry.js +1 -1
  203. package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
  204. package/dist/esm-es5/verdocs-field-radio.entry.js +1 -0
  205. package/dist/esm-es5/verdocs-file-chooser_2.entry.js +1 -1
  206. package/dist/esm-es5/verdocs-kba-dialog.entry.js +1 -1
  207. package/dist/esm-es5/verdocs-loader.entry.js +1 -1
  208. package/dist/esm-es5/verdocs-ok-dialog.entry.js +1 -1
  209. package/dist/esm-es5/verdocs-organization-card_2.entry.js +1 -1
  210. package/dist/esm-es5/verdocs-pagination_2.entry.js +1 -1
  211. package/dist/esm-es5/verdocs-preview_10.entry.js +1 -1
  212. package/dist/esm-es5/verdocs-quick-functions_2.entry.js +1 -1
  213. package/dist/esm-es5/verdocs-radio-button_3.entry.js +1 -1
  214. package/dist/esm-es5/verdocs-search-tabs.entry.js +1 -1
  215. package/dist/esm-es5/verdocs-search.entry.js +1 -1
  216. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  217. package/dist/esm-es5/verdocs-spinner.entry.js +1 -1
  218. package/dist/esm-es5/verdocs-status-indicator.entry.js +1 -1
  219. package/dist/esm-es5/verdocs-table.entry.js +1 -1
  220. package/dist/esm-es5/verdocs-template-card.entry.js +1 -1
  221. package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
  222. package/dist/esm-es5/verdocs-template-star.entry.js +1 -1
  223. package/dist/esm-es5/verdocs-template-tags.entry.js +1 -1
  224. package/dist/esm-es5/verdocs-templates-list.entry.js +1 -1
  225. package/dist/esm-es5/verdocs-toggle.entry.js +1 -1
  226. package/dist/esm-es5/verdocs-view.entry.js +1 -1
  227. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  228. package/dist/loader/index.d.ts +3 -0
  229. package/dist/types/components/embeds/verdocs-auth/verdocs-auth.d.ts +4 -1
  230. package/dist/types/components/fields/verdocs-field-radio/verdocs-field-radio.d.ts +71 -0
  231. package/dist/types/components/fields/verdocs-field-textbox/verdocs-field-textbox.d.ts +4 -0
  232. package/dist/types/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.d.ts +3 -4
  233. package/dist/types/components/templates/verdocs-template-fields/verdocs-template-fields.d.ts +3 -3
  234. package/dist/types/components.d.ts +139 -0
  235. package/dist/types/stencil-public-runtime.d.ts +0 -2
  236. package/dist/verdocs-web-sdk/p-03a228e4.system.js +1 -0
  237. package/dist/verdocs-web-sdk/{p-fa58907b.js → p-04c07b7b.js} +1 -1
  238. package/dist/verdocs-web-sdk/{p-c293ad2e.system.entry.js → p-07bc980f.system.entry.js} +1 -1
  239. package/dist/verdocs-web-sdk/{p-3f4b3548.system.entry.js → p-0a40a589.system.entry.js} +1 -1
  240. package/dist/verdocs-web-sdk/{p-c8de3052.system.js → p-0a65f552.system.js} +1 -1
  241. package/dist/verdocs-web-sdk/p-0acffdbf.system.entry.js +1 -0
  242. package/dist/verdocs-web-sdk/{p-f2f6c646.system.entry.js → p-0c1c60c4.system.entry.js} +1 -1
  243. package/dist/verdocs-web-sdk/{p-7c61d3ea.entry.js → p-0f87aac4.entry.js} +1 -1
  244. package/dist/verdocs-web-sdk/{p-a868ee00.system.entry.js → p-0fb45829.system.entry.js} +1 -1
  245. package/dist/verdocs-web-sdk/{p-7ef593c3.system.entry.js → p-119462af.system.entry.js} +1 -1
  246. package/dist/verdocs-web-sdk/{p-62af2ee6.system.entry.js → p-1d1a3e11.system.entry.js} +1 -1
  247. package/dist/verdocs-web-sdk/{p-50ca92de.entry.js → p-2110a510.entry.js} +1 -1
  248. package/dist/verdocs-web-sdk/{p-fe246d59.entry.js → p-2199fe66.entry.js} +1 -1
  249. package/dist/verdocs-web-sdk/{p-c3167b62.system.entry.js → p-22aa1872.system.entry.js} +1 -1
  250. package/dist/verdocs-web-sdk/{p-7b222135.system.entry.js → p-28a4b760.system.entry.js} +1 -1
  251. package/dist/verdocs-web-sdk/{p-00b37c9a.js → p-2bf06d1c.js} +1 -1
  252. package/dist/verdocs-web-sdk/{p-9ef11d2d.entry.js → p-2d37e5d2.entry.js} +1 -1
  253. package/dist/verdocs-web-sdk/p-2de04937.entry.js +1 -0
  254. package/dist/verdocs-web-sdk/{p-8d4297c9.system.js → p-2f988aeb.system.js} +1 -1
  255. package/dist/verdocs-web-sdk/{p-dcbad099.system.entry.js → p-3253417f.system.entry.js} +1 -1
  256. package/dist/verdocs-web-sdk/p-39c0fdb7.system.entry.js +1 -0
  257. package/dist/verdocs-web-sdk/{p-eaf4de2f.entry.js → p-3ac72054.entry.js} +1 -1
  258. package/dist/verdocs-web-sdk/p-3f088fd6.system.js +1 -0
  259. package/dist/verdocs-web-sdk/{p-f69d8d39.js → p-3f2a26d6.js} +1 -1
  260. package/dist/verdocs-web-sdk/p-40ede7b6.entry.js +1 -0
  261. package/dist/verdocs-web-sdk/{p-f2884b26.system.entry.js → p-418c5093.system.entry.js} +1 -1
  262. package/dist/verdocs-web-sdk/{p-3306f93a.system.entry.js → p-41f88db7.system.entry.js} +1 -1
  263. package/dist/verdocs-web-sdk/p-588afca7.system.entry.js +1 -0
  264. package/dist/verdocs-web-sdk/p-59e68b3c.entry.js +1 -0
  265. package/dist/verdocs-web-sdk/{p-54a2a394.system.js → p-5aec0af9.system.js} +1 -1
  266. package/dist/verdocs-web-sdk/{p-8ce594b2.entry.js → p-5ec8c0fb.entry.js} +1 -1
  267. package/dist/verdocs-web-sdk/{p-1fec2d1e.system.entry.js → p-5fa79cee.system.entry.js} +1 -1
  268. package/dist/verdocs-web-sdk/p-630835f4.js +1 -0
  269. package/dist/verdocs-web-sdk/{p-e9a1c6be.entry.js → p-645dac6b.entry.js} +1 -1
  270. package/dist/verdocs-web-sdk/p-646fde57.js +2 -0
  271. package/dist/verdocs-web-sdk/p-66e55b97.system.js +2 -0
  272. package/dist/verdocs-web-sdk/{p-77df6385.system.entry.js → p-6b093210.system.entry.js} +1 -1
  273. package/dist/verdocs-web-sdk/p-6cedf6ae.entry.js +1 -0
  274. package/dist/verdocs-web-sdk/{p-420fc040.system.entry.js → p-7011a6dd.system.entry.js} +1 -1
  275. package/dist/verdocs-web-sdk/{p-7c77f3e7.system.entry.js → p-793788c8.system.entry.js} +1 -1
  276. package/dist/verdocs-web-sdk/{p-316fc185.js → p-7c96c9be.js} +1 -1
  277. package/dist/verdocs-web-sdk/{p-d6592bda.entry.js → p-7d9ae0f8.entry.js} +1 -1
  278. package/dist/verdocs-web-sdk/p-7dc4618c.entry.js +1 -0
  279. package/dist/verdocs-web-sdk/{p-8c3c0869.system.entry.js → p-7e0d5853.system.entry.js} +1 -1
  280. package/dist/verdocs-web-sdk/{p-f02e08da.js → p-7e48befd.js} +1 -1
  281. package/dist/verdocs-web-sdk/{p-0349f360.entry.js → p-7f5f035c.entry.js} +1 -1
  282. package/dist/verdocs-web-sdk/{p-98928410.system.entry.js → p-80bb5f38.system.entry.js} +1 -1
  283. package/dist/verdocs-web-sdk/{p-bb0ed696.system.entry.js → p-84cc575d.system.entry.js} +1 -1
  284. package/dist/verdocs-web-sdk/p-858e037c.system.entry.js +1 -0
  285. package/dist/verdocs-web-sdk/{p-96e5a460.system.entry.js → p-8883e017.system.entry.js} +1 -1
  286. package/dist/verdocs-web-sdk/{p-78b461ed.system.entry.js → p-88d08452.system.entry.js} +1 -1
  287. package/dist/verdocs-web-sdk/{p-936d6483.entry.js → p-8ca0ec18.entry.js} +1 -1
  288. package/dist/verdocs-web-sdk/{p-ba6570b4.system.entry.js → p-976c6261.system.entry.js} +1 -1
  289. package/dist/verdocs-web-sdk/{p-50439d9f.entry.js → p-98b55af8.entry.js} +1 -1
  290. package/dist/verdocs-web-sdk/{p-ad2814b4.entry.js → p-9abcb80f.entry.js} +1 -1
  291. package/dist/verdocs-web-sdk/{p-c8915559.system.js → p-9b26e4e0.system.js} +1 -1
  292. package/dist/verdocs-web-sdk/{p-67c3b3d1.entry.js → p-9b689dc7.entry.js} +1 -1
  293. package/dist/verdocs-web-sdk/{p-f7620900.system.js → p-9d51ed4e.system.js} +1 -1
  294. package/dist/verdocs-web-sdk/{p-7125a998.entry.js → p-a0d31d6b.entry.js} +1 -1
  295. package/dist/verdocs-web-sdk/{p-3093ede7.entry.js → p-a13b6f94.entry.js} +1 -1
  296. package/dist/verdocs-web-sdk/{p-82f7b16a.entry.js → p-a1a37ae8.entry.js} +1 -1
  297. package/dist/verdocs-web-sdk/{p-fc2ae858.js → p-a2733bb6.js} +1 -1
  298. package/dist/verdocs-web-sdk/{p-900006b0.system.js → p-a3e8053f.system.js} +1 -1
  299. package/dist/verdocs-web-sdk/{p-f54b4cc0.system.entry.js → p-a44de858.system.entry.js} +1 -1
  300. package/dist/verdocs-web-sdk/p-a4bf6d69.system.entry.js +1 -0
  301. package/dist/verdocs-web-sdk/p-a5728114.system.entry.js +1 -0
  302. package/dist/verdocs-web-sdk/{p-4f90b641.entry.js → p-a94dd83d.entry.js} +1 -1
  303. package/dist/verdocs-web-sdk/{p-f0a70f44.entry.js → p-ac8d5a73.entry.js} +1 -1
  304. package/dist/verdocs-web-sdk/{p-7bfe3ed2.system.entry.js → p-adaca31c.system.entry.js} +1 -1
  305. package/dist/verdocs-web-sdk/p-ae788efe.entry.js +1 -0
  306. package/dist/verdocs-web-sdk/{p-73182042.js → p-b0e1b8fb.js} +1 -1
  307. package/dist/verdocs-web-sdk/{p-ff6a4383.entry.js → p-b141fe17.entry.js} +1 -1
  308. package/dist/verdocs-web-sdk/{p-d61235cf.entry.js → p-b2588634.entry.js} +1 -1
  309. package/dist/verdocs-web-sdk/{p-30513f94.entry.js → p-b5808744.entry.js} +1 -1
  310. package/dist/verdocs-web-sdk/{p-977a5a4b.system.entry.js → p-b5e4060c.system.entry.js} +1 -1
  311. package/dist/verdocs-web-sdk/p-be4b98a7.entry.js +1 -0
  312. package/dist/verdocs-web-sdk/p-c08b2d05.entry.js +1 -0
  313. package/dist/verdocs-web-sdk/{p-0d5fb952.system.js → p-c1528477.system.js} +1 -1
  314. package/dist/verdocs-web-sdk/p-c360521c.entry.js +1 -0
  315. package/dist/verdocs-web-sdk/{p-314321b8.system.entry.js → p-c659d8f9.system.entry.js} +1 -1
  316. package/dist/verdocs-web-sdk/{p-9452b95d.system.entry.js → p-cb3b5a1e.system.entry.js} +1 -1
  317. package/dist/verdocs-web-sdk/p-d2ba0d38.entry.js +1 -0
  318. package/dist/verdocs-web-sdk/{p-daf07a17.system.entry.js → p-d663a20c.system.entry.js} +1 -1
  319. package/dist/verdocs-web-sdk/{p-7e6fa885.entry.js → p-d7530c98.entry.js} +1 -1
  320. package/dist/verdocs-web-sdk/p-d9be1983.system.entry.js +1 -0
  321. package/dist/verdocs-web-sdk/{p-4145b69a.entry.js → p-d9d7bbff.entry.js} +1 -1
  322. package/dist/verdocs-web-sdk/{p-9c955106.system.entry.js → p-db3b0b93.system.entry.js} +1 -1
  323. package/dist/verdocs-web-sdk/{p-b96e571d.system.entry.js → p-dba86af9.system.entry.js} +1 -1
  324. package/dist/verdocs-web-sdk/{p-e7360a06.system.entry.js → p-dee5314f.system.entry.js} +1 -1
  325. package/dist/verdocs-web-sdk/p-df2b5f72.entry.js +1 -0
  326. package/dist/verdocs-web-sdk/p-e49d375b.system.entry.js +1 -0
  327. package/dist/verdocs-web-sdk/{p-407cb86b.js → p-e604b646.js} +1 -1
  328. package/dist/verdocs-web-sdk/{p-1f7d5165.entry.js → p-ea23b1ad.entry.js} +1 -1
  329. package/dist/verdocs-web-sdk/{p-f978550e.entry.js → p-ee3238d9.entry.js} +1 -1
  330. package/dist/verdocs-web-sdk/{p-9d36d2ad.entry.js → p-fa7a40f6.entry.js} +1 -1
  331. package/dist/verdocs-web-sdk/{p-1dd1d686.entry.js → p-fbc78d55.entry.js} +1 -1
  332. package/dist/verdocs-web-sdk/{p-889cc411.system.js → p-fdd617a6.system.js} +1 -1
  333. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  334. package/dist/verdocs-web-sdk/verdocs-web-sdk.js +1 -1
  335. package/package.json +9 -9
  336. package/dist/collection/components/elements/verdocs-quick-functions/test/verdocs-quick-functions.e2e.js +0 -9
  337. package/dist/collection/components/elements/verdocs-quick-functions/test/verdocs-quick-functions.spec.js +0 -17
  338. package/dist/collection/components/embeds/verdocs-search/test/search-embed.e2e.js +0 -9
  339. package/dist/collection/components/embeds/verdocs-search/test/search-embed.spec.js +0 -17
  340. package/dist/collection/components/embeds/verdocs-view/test/verdocs-view.e2e.js +0 -9
  341. package/dist/collection/components/embeds/verdocs-view/test/verdocs-view.spec.js +0 -17
  342. package/dist/esm-es5/index-b89cf6a4.js +0 -1
  343. package/dist/esm-es5/verdocs-button_3.entry.js +0 -1
  344. package/dist/esm-es5/verdocs-checkbox_4.entry.js +0 -1
  345. package/dist/verdocs-web-sdk/p-11187f8f.system.entry.js +0 -1
  346. package/dist/verdocs-web-sdk/p-1175926f.system.entry.js +0 -1
  347. package/dist/verdocs-web-sdk/p-1f771dad.entry.js +0 -1
  348. package/dist/verdocs-web-sdk/p-322fa613.system.js +0 -1
  349. package/dist/verdocs-web-sdk/p-62d7e050.entry.js +0 -1
  350. package/dist/verdocs-web-sdk/p-66146676.entry.js +0 -1
  351. package/dist/verdocs-web-sdk/p-71eeeff4.entry.js +0 -1
  352. package/dist/verdocs-web-sdk/p-73a6f972.js +0 -2
  353. package/dist/verdocs-web-sdk/p-73f45012.system.entry.js +0 -1
  354. package/dist/verdocs-web-sdk/p-7a6cf9a2.entry.js +0 -1
  355. package/dist/verdocs-web-sdk/p-9f36f128.entry.js +0 -1
  356. package/dist/verdocs-web-sdk/p-aa6fbe00.entry.js +0 -1
  357. package/dist/verdocs-web-sdk/p-b2b16ce8.system.entry.js +0 -1
  358. package/dist/verdocs-web-sdk/p-b9d88831.entry.js +0 -1
  359. package/dist/verdocs-web-sdk/p-cc8f27f7.system.entry.js +0 -1
  360. package/dist/verdocs-web-sdk/p-da174bed.system.entry.js +0 -1
  361. package/dist/verdocs-web-sdk/p-dda420e7.entry.js +0 -1
  362. package/dist/verdocs-web-sdk/p-e748b2d2.system.js +0 -2
  363. package/dist/verdocs-web-sdk/p-e7578fac.entry.js +0 -1
  364. package/dist/verdocs-web-sdk/p-ebc3ed52.system.entry.js +0 -1
@@ -0,0 +1,3232 @@
1
+ 'use strict';
2
+
3
+ var toDate$1 = {};
4
+
5
+ toDate$1.toDate = toDate;
6
+
7
+ /**
8
+ * @name toDate
9
+ * @category Common Helpers
10
+ * @summary Convert the given argument to an instance of Date.
11
+ *
12
+ * @description
13
+ * Convert the given argument to an instance of Date.
14
+ *
15
+ * If the argument is an instance of Date, the function returns its clone.
16
+ *
17
+ * If the argument is a number, it is treated as a timestamp.
18
+ *
19
+ * If the argument is none of the above, the function returns Invalid Date.
20
+ *
21
+ * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
22
+ *
23
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
24
+ *
25
+ * @param argument - The value to convert
26
+ *
27
+ * @returns The parsed date in the local time zone
28
+ *
29
+ * @example
30
+ * // Clone the date:
31
+ * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
32
+ * //=> Tue Feb 11 2014 11:30:30
33
+ *
34
+ * @example
35
+ * // Convert the timestamp to date:
36
+ * const result = toDate(1392098430000)
37
+ * //=> Tue Feb 11 2014 11:30:30
38
+ */
39
+ function toDate(argument) {
40
+ const argStr = Object.prototype.toString.call(argument);
41
+
42
+ // Clone the date
43
+ if (
44
+ argument instanceof Date ||
45
+ (typeof argument === "object" && argStr === "[object Date]")
46
+ ) {
47
+ // Prevent the date to lose the milliseconds when passed to new Date() in IE10
48
+ return new argument.constructor(+argument);
49
+ } else if (
50
+ typeof argument === "number" ||
51
+ argStr === "[object Number]" ||
52
+ typeof argument === "string" ||
53
+ argStr === "[object String]"
54
+ ) {
55
+ // TODO: Can we get rid of as?
56
+ return new Date(argument);
57
+ } else {
58
+ // TODO: Can we get rid of as?
59
+ return new Date(NaN);
60
+ }
61
+ }
62
+
63
+ var constructFrom$1 = {};
64
+
65
+ constructFrom$1.constructFrom = constructFrom;
66
+
67
+ /**
68
+ * @name constructFrom
69
+ * @category Generic Helpers
70
+ * @summary Constructs a date using the reference date and the value
71
+ *
72
+ * @description
73
+ * The function constructs a new date using the constructor from the reference
74
+ * date and the given value. It helps to build generic functions that accept
75
+ * date extensions.
76
+ *
77
+ * It defaults to `Date` if the passed reference date is a number or a string.
78
+ *
79
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
80
+ *
81
+ * @param date - The reference date to take constructor from
82
+ * @param value - The value to create the date
83
+ *
84
+ * @returns Date initialized using the given date and value
85
+ *
86
+ * @example
87
+ * import { constructFrom } from 'date-fns'
88
+ *
89
+ * // A function that clones a date preserving the original type
90
+ * function cloneDate<DateType extends Date(date: DateType): DateType {
91
+ * return constructFrom(
92
+ * date, // Use contrustor from the given date
93
+ * date.getTime() // Use the date value to create a new date
94
+ * )
95
+ * }
96
+ */
97
+ function constructFrom(date, value) {
98
+ if (date instanceof Date) {
99
+ return new date.constructor(value);
100
+ } else {
101
+ return new Date(value);
102
+ }
103
+ }
104
+
105
+ var constants = {};
106
+
107
+ constants.secondsInYear =
108
+ constants.secondsInWeek =
109
+ constants.secondsInQuarter =
110
+ constants.secondsInMonth =
111
+ constants.secondsInMinute =
112
+ constants.secondsInHour =
113
+ constants.secondsInDay =
114
+ constants.quartersInYear =
115
+ constants.monthsInYear =
116
+ constants.monthsInQuarter =
117
+ constants.minutesInYear =
118
+ constants.minutesInMonth =
119
+ constants.minutesInHour =
120
+ constants.minutesInDay =
121
+ constants.minTime =
122
+ constants.millisecondsInWeek =
123
+ constants.millisecondsInSecond =
124
+ constants.millisecondsInMinute =
125
+ constants.millisecondsInHour =
126
+ constants.millisecondsInDay =
127
+ constants.maxTime =
128
+ constants.daysInYear =
129
+ constants.daysInWeek =
130
+ void 0; /**
131
+ * @module constants
132
+ * @summary Useful constants
133
+ * @description
134
+ * Collection of useful date constants.
135
+ *
136
+ * The constants could be imported from `date-fns/constants`:
137
+ *
138
+ * ```ts
139
+ * import { maxTime, minTime } from "date-fns/constants";
140
+ *
141
+ * function isAllowedTime(time) {
142
+ * return time <= maxTime && time >= minTime;
143
+ * }
144
+ * ```
145
+ */
146
+
147
+ /**
148
+ * @constant
149
+ * @name daysInWeek
150
+ * @summary Days in 1 week.
151
+ */
152
+ (constants.daysInWeek = 7);
153
+
154
+ /**
155
+ * @constant
156
+ * @name daysInYear
157
+ * @summary Days in 1 year.
158
+ *
159
+ * @description
160
+ * How many days in a year.
161
+ *
162
+ * One years equals 365.2425 days according to the formula:
163
+ *
164
+ * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400.
165
+ * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days
166
+ */
167
+ const daysInYear = (constants.daysInYear = 365.2425);
168
+
169
+ /**
170
+ * @constant
171
+ * @name maxTime
172
+ * @summary Maximum allowed time.
173
+ *
174
+ * @example
175
+ * import { maxTime } from "date-fns/constants";
176
+ *
177
+ * const isValid = 8640000000000001 <= maxTime;
178
+ * //=> false
179
+ *
180
+ * new Date(8640000000000001);
181
+ * //=> Invalid Date
182
+ */
183
+ const maxTime = (constants.maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000);
184
+
185
+ /**
186
+ * @constant
187
+ * @name minTime
188
+ * @summary Minimum allowed time.
189
+ *
190
+ * @example
191
+ * import { minTime } from "date-fns/constants";
192
+ *
193
+ * const isValid = -8640000000000001 >= minTime;
194
+ * //=> false
195
+ *
196
+ * new Date(-8640000000000001)
197
+ * //=> Invalid Date
198
+ */
199
+ (constants.minTime = -maxTime);
200
+
201
+ /**
202
+ * @constant
203
+ * @name millisecondsInWeek
204
+ * @summary Milliseconds in 1 week.
205
+ */
206
+ (constants.millisecondsInWeek = 604800000);
207
+
208
+ /**
209
+ * @constant
210
+ * @name millisecondsInDay
211
+ * @summary Milliseconds in 1 day.
212
+ */
213
+ (constants.millisecondsInDay = 86400000);
214
+
215
+ /**
216
+ * @constant
217
+ * @name millisecondsInMinute
218
+ * @summary Milliseconds in 1 minute
219
+ */
220
+ (constants.millisecondsInMinute = 60000);
221
+
222
+ /**
223
+ * @constant
224
+ * @name millisecondsInHour
225
+ * @summary Milliseconds in 1 hour
226
+ */
227
+ (constants.millisecondsInHour = 3600000);
228
+
229
+ /**
230
+ * @constant
231
+ * @name millisecondsInSecond
232
+ * @summary Milliseconds in 1 second
233
+ */
234
+ (constants.millisecondsInSecond = 1000);
235
+
236
+ /**
237
+ * @constant
238
+ * @name minutesInYear
239
+ * @summary Minutes in 1 year.
240
+ */
241
+ (constants.minutesInYear = 525600);
242
+
243
+ /**
244
+ * @constant
245
+ * @name minutesInMonth
246
+ * @summary Minutes in 1 month.
247
+ */
248
+ (constants.minutesInMonth = 43200);
249
+
250
+ /**
251
+ * @constant
252
+ * @name minutesInDay
253
+ * @summary Minutes in 1 day.
254
+ */
255
+ (constants.minutesInDay = 1440);
256
+
257
+ /**
258
+ * @constant
259
+ * @name minutesInHour
260
+ * @summary Minutes in 1 hour.
261
+ */
262
+ (constants.minutesInHour = 60);
263
+
264
+ /**
265
+ * @constant
266
+ * @name monthsInQuarter
267
+ * @summary Months in 1 quarter.
268
+ */
269
+ (constants.monthsInQuarter = 3);
270
+
271
+ /**
272
+ * @constant
273
+ * @name monthsInYear
274
+ * @summary Months in 1 year.
275
+ */
276
+ (constants.monthsInYear = 12);
277
+
278
+ /**
279
+ * @constant
280
+ * @name quartersInYear
281
+ * @summary Quarters in 1 year
282
+ */
283
+ (constants.quartersInYear = 4);
284
+
285
+ /**
286
+ * @constant
287
+ * @name secondsInHour
288
+ * @summary Seconds in 1 hour.
289
+ */
290
+ const secondsInHour = (constants.secondsInHour = 3600);
291
+
292
+ /**
293
+ * @constant
294
+ * @name secondsInMinute
295
+ * @summary Seconds in 1 minute.
296
+ */
297
+ (constants.secondsInMinute = 60);
298
+
299
+ /**
300
+ * @constant
301
+ * @name secondsInDay
302
+ * @summary Seconds in 1 day.
303
+ */
304
+ const secondsInDay = (constants.secondsInDay = secondsInHour * 24);
305
+
306
+ /**
307
+ * @constant
308
+ * @name secondsInWeek
309
+ * @summary Seconds in 1 week.
310
+ */
311
+ (constants.secondsInWeek = secondsInDay * 7);
312
+
313
+ /**
314
+ * @constant
315
+ * @name secondsInYear
316
+ * @summary Seconds in 1 year.
317
+ */
318
+ const secondsInYear = (constants.secondsInYear = secondsInDay * daysInYear);
319
+
320
+ /**
321
+ * @constant
322
+ * @name secondsInMonth
323
+ * @summary Seconds in 1 month
324
+ */
325
+ const secondsInMonth = (constants.secondsInMonth = secondsInYear / 12);
326
+
327
+ /**
328
+ * @constant
329
+ * @name secondsInQuarter
330
+ * @summary Seconds in 1 quarter.
331
+ */
332
+ (constants.secondsInQuarter = secondsInMonth * 3);
333
+
334
+ var getISOWeekYear$1 = {};
335
+
336
+ var startOfISOWeek$1 = {};
337
+
338
+ var startOfWeek$1 = {};
339
+
340
+ var defaultOptions$1 = {};
341
+
342
+ defaultOptions$1.getDefaultOptions = getDefaultOptions;
343
+ defaultOptions$1.setDefaultOptions = setDefaultOptions;
344
+
345
+ let defaultOptions = {};
346
+
347
+ function getDefaultOptions() {
348
+ return defaultOptions;
349
+ }
350
+
351
+ function setDefaultOptions(newOptions) {
352
+ defaultOptions = newOptions;
353
+ }
354
+
355
+ startOfWeek$1.startOfWeek = startOfWeek;
356
+ var _index$j = toDate$1;
357
+
358
+ var _index2$d = defaultOptions$1;
359
+
360
+ /**
361
+ * The {@link startOfWeek} function options.
362
+ */
363
+
364
+ /**
365
+ * @name startOfWeek
366
+ * @category Week Helpers
367
+ * @summary Return the start of a week for the given date.
368
+ *
369
+ * @description
370
+ * Return the start of a week for the given date.
371
+ * The result will be in the local timezone.
372
+ *
373
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
374
+ *
375
+ * @param date - The original date
376
+ * @param options - An object with options
377
+ *
378
+ * @returns The start of a week
379
+ *
380
+ * @example
381
+ * // The start of a week for 2 September 2014 11:55:00:
382
+ * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))
383
+ * //=> Sun Aug 31 2014 00:00:00
384
+ *
385
+ * @example
386
+ * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:
387
+ * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
388
+ * //=> Mon Sep 01 2014 00:00:00
389
+ */
390
+ function startOfWeek(date, options) {
391
+ const defaultOptions = (0, _index2$d.getDefaultOptions)();
392
+ const weekStartsOn =
393
+ options?.weekStartsOn ??
394
+ options?.locale?.options?.weekStartsOn ??
395
+ defaultOptions.weekStartsOn ??
396
+ defaultOptions.locale?.options?.weekStartsOn ??
397
+ 0;
398
+
399
+ const _date = (0, _index$j.toDate)(date);
400
+ const day = _date.getDay();
401
+ const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
402
+
403
+ _date.setDate(_date.getDate() - diff);
404
+ _date.setHours(0, 0, 0, 0);
405
+ return _date;
406
+ }
407
+
408
+ startOfISOWeek$1.startOfISOWeek = startOfISOWeek;
409
+ var _index$i = startOfWeek$1;
410
+
411
+ /**
412
+ * @name startOfISOWeek
413
+ * @category ISO Week Helpers
414
+ * @summary Return the start of an ISO week for the given date.
415
+ *
416
+ * @description
417
+ * Return the start of an ISO week for the given date.
418
+ * The result will be in the local timezone.
419
+ *
420
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
421
+ *
422
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
423
+ *
424
+ * @param date - The original date
425
+ *
426
+ * @returns The start of an ISO week
427
+ *
428
+ * @example
429
+ * // The start of an ISO week for 2 September 2014 11:55:00:
430
+ * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))
431
+ * //=> Mon Sep 01 2014 00:00:00
432
+ */
433
+ function startOfISOWeek(date) {
434
+ return (0, _index$i.startOfWeek)(date, { weekStartsOn: 1 });
435
+ }
436
+
437
+ getISOWeekYear$1.getISOWeekYear = getISOWeekYear;
438
+ var _index$h = constructFrom$1;
439
+ var _index2$c = startOfISOWeek$1;
440
+ var _index3$9 = toDate$1;
441
+
442
+ /**
443
+ * @name getISOWeekYear
444
+ * @category ISO Week-Numbering Year Helpers
445
+ * @summary Get the ISO week-numbering year of the given date.
446
+ *
447
+ * @description
448
+ * Get the ISO week-numbering year of the given date,
449
+ * which always starts 3 days before the year's first Thursday.
450
+ *
451
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
452
+ *
453
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
454
+ *
455
+ * @param date - The given date
456
+ *
457
+ * @returns The ISO week-numbering year
458
+ *
459
+ * @example
460
+ * // Which ISO-week numbering year is 2 January 2005?
461
+ * const result = getISOWeekYear(new Date(2005, 0, 2))
462
+ * //=> 2004
463
+ */
464
+ function getISOWeekYear(date) {
465
+ const _date = (0, _index3$9.toDate)(date);
466
+ const year = _date.getFullYear();
467
+
468
+ const fourthOfJanuaryOfNextYear = (0, _index$h.constructFrom)(date, 0);
469
+ fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
470
+ fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
471
+ const startOfNextYear = (0, _index2$c.startOfISOWeek)(
472
+ fourthOfJanuaryOfNextYear,
473
+ );
474
+
475
+ const fourthOfJanuaryOfThisYear = (0, _index$h.constructFrom)(date, 0);
476
+ fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
477
+ fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
478
+ const startOfThisYear = (0, _index2$c.startOfISOWeek)(
479
+ fourthOfJanuaryOfThisYear,
480
+ );
481
+
482
+ if (_date.getTime() >= startOfNextYear.getTime()) {
483
+ return year + 1;
484
+ } else if (_date.getTime() >= startOfThisYear.getTime()) {
485
+ return year;
486
+ } else {
487
+ return year - 1;
488
+ }
489
+ }
490
+
491
+ var differenceInCalendarDays$1 = {};
492
+
493
+ var startOfDay$1 = {};
494
+
495
+ startOfDay$1.startOfDay = startOfDay;
496
+ var _index$g = toDate$1;
497
+
498
+ /**
499
+ * @name startOfDay
500
+ * @category Day Helpers
501
+ * @summary Return the start of a day for the given date.
502
+ *
503
+ * @description
504
+ * Return the start of a day for the given date.
505
+ * The result will be in the local timezone.
506
+ *
507
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
508
+ *
509
+ * @param date - The original date
510
+ *
511
+ * @returns The start of a day
512
+ *
513
+ * @example
514
+ * // The start of a day for 2 September 2014 11:55:00:
515
+ * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
516
+ * //=> Tue Sep 02 2014 00:00:00
517
+ */
518
+ function startOfDay(date) {
519
+ const _date = (0, _index$g.toDate)(date);
520
+ _date.setHours(0, 0, 0, 0);
521
+ return _date;
522
+ }
523
+
524
+ var getTimezoneOffsetInMilliseconds$1 = {};
525
+
526
+ getTimezoneOffsetInMilliseconds$1.getTimezoneOffsetInMilliseconds = getTimezoneOffsetInMilliseconds;
527
+ var _index$f = toDate$1;
528
+
529
+ /**
530
+ * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
531
+ * They usually appear for dates that denote time before the timezones were introduced
532
+ * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
533
+ * and GMT+01:00:00 after that date)
534
+ *
535
+ * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
536
+ * which would lead to incorrect calculations.
537
+ *
538
+ * This function returns the timezone offset in milliseconds that takes seconds in account.
539
+ */
540
+ function getTimezoneOffsetInMilliseconds(date) {
541
+ const _date = (0, _index$f.toDate)(date);
542
+ const utcDate = new Date(
543
+ Date.UTC(
544
+ _date.getFullYear(),
545
+ _date.getMonth(),
546
+ _date.getDate(),
547
+ _date.getHours(),
548
+ _date.getMinutes(),
549
+ _date.getSeconds(),
550
+ _date.getMilliseconds(),
551
+ ),
552
+ );
553
+ utcDate.setUTCFullYear(_date.getFullYear());
554
+ return +date - +utcDate;
555
+ }
556
+
557
+ differenceInCalendarDays$1.differenceInCalendarDays = differenceInCalendarDays;
558
+ var _index$e = constants;
559
+ var _index2$b = startOfDay$1;
560
+ var _index3$8 = getTimezoneOffsetInMilliseconds$1;
561
+
562
+ /**
563
+ * @name differenceInCalendarDays
564
+ * @category Day Helpers
565
+ * @summary Get the number of calendar days between the given dates.
566
+ *
567
+ * @description
568
+ * Get the number of calendar days between the given dates. This means that the times are removed
569
+ * from the dates and then the difference in days is calculated.
570
+ *
571
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
572
+ *
573
+ * @param dateLeft - The later date
574
+ * @param dateRight - The earlier date
575
+ *
576
+ * @returns The number of calendar days
577
+ *
578
+ * @example
579
+ * // How many calendar days are between
580
+ * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?
581
+ * const result = differenceInCalendarDays(
582
+ * new Date(2012, 6, 2, 0, 0),
583
+ * new Date(2011, 6, 2, 23, 0)
584
+ * )
585
+ * //=> 366
586
+ * // How many calendar days are between
587
+ * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
588
+ * const result = differenceInCalendarDays(
589
+ * new Date(2011, 6, 3, 0, 1),
590
+ * new Date(2011, 6, 2, 23, 59)
591
+ * )
592
+ * //=> 1
593
+ */
594
+ function differenceInCalendarDays(dateLeft, dateRight) {
595
+ const startOfDayLeft = (0, _index2$b.startOfDay)(dateLeft);
596
+ const startOfDayRight = (0, _index2$b.startOfDay)(dateRight);
597
+
598
+ const timestampLeft =
599
+ +startOfDayLeft -
600
+ (0, _index3$8.getTimezoneOffsetInMilliseconds)(startOfDayLeft);
601
+ const timestampRight =
602
+ +startOfDayRight -
603
+ (0, _index3$8.getTimezoneOffsetInMilliseconds)(startOfDayRight);
604
+
605
+ // Round the number of days to the nearest integer because the number of
606
+ // milliseconds in a day is not constant (e.g. it's different in the week of
607
+ // the daylight saving time clock shift).
608
+ return Math.round(
609
+ (timestampLeft - timestampRight) / _index$e.millisecondsInDay,
610
+ );
611
+ }
612
+
613
+ var startOfISOWeekYear$1 = {};
614
+
615
+ startOfISOWeekYear$1.startOfISOWeekYear = startOfISOWeekYear;
616
+ var _index$d = getISOWeekYear$1;
617
+ var _index2$a = startOfISOWeek$1;
618
+ var _index3$7 = constructFrom$1;
619
+
620
+ /**
621
+ * @name startOfISOWeekYear
622
+ * @category ISO Week-Numbering Year Helpers
623
+ * @summary Return the start of an ISO week-numbering year for the given date.
624
+ *
625
+ * @description
626
+ * Return the start of an ISO week-numbering year,
627
+ * which always starts 3 days before the year's first Thursday.
628
+ * The result will be in the local timezone.
629
+ *
630
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
631
+ *
632
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
633
+ *
634
+ * @param date - The original date
635
+ *
636
+ * @returns The start of an ISO week-numbering year
637
+ *
638
+ * @example
639
+ * // The start of an ISO week-numbering year for 2 July 2005:
640
+ * const result = startOfISOWeekYear(new Date(2005, 6, 2))
641
+ * //=> Mon Jan 03 2005 00:00:00
642
+ */
643
+ function startOfISOWeekYear(date) {
644
+ const year = (0, _index$d.getISOWeekYear)(date);
645
+ const fourthOfJanuary = (0, _index3$7.constructFrom)(date, 0);
646
+ fourthOfJanuary.setFullYear(year, 0, 4);
647
+ fourthOfJanuary.setHours(0, 0, 0, 0);
648
+ return (0, _index2$a.startOfISOWeek)(fourthOfJanuary);
649
+ }
650
+
651
+ var isValid$1 = {};
652
+
653
+ var isDate$1 = {};
654
+
655
+ isDate$1.isDate = isDate; /**
656
+ * @name isDate
657
+ * @category Common Helpers
658
+ * @summary Is the given value a date?
659
+ *
660
+ * @description
661
+ * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
662
+ *
663
+ * @param value - The value to check
664
+ *
665
+ * @returns True if the given value is a date
666
+ *
667
+ * @example
668
+ * // For a valid date:
669
+ * const result = isDate(new Date())
670
+ * //=> true
671
+ *
672
+ * @example
673
+ * // For an invalid date:
674
+ * const result = isDate(new Date(NaN))
675
+ * //=> true
676
+ *
677
+ * @example
678
+ * // For some value:
679
+ * const result = isDate('2014-02-31')
680
+ * //=> false
681
+ *
682
+ * @example
683
+ * // For an object:
684
+ * const result = isDate({})
685
+ * //=> false
686
+ */
687
+ function isDate(value) {
688
+ return (
689
+ value instanceof Date ||
690
+ (typeof value === "object" &&
691
+ Object.prototype.toString.call(value) === "[object Date]")
692
+ );
693
+ }
694
+
695
+ isValid$1.isValid = isValid;
696
+ var _index$c = isDate$1;
697
+ var _index2$9 = toDate$1;
698
+
699
+ /**
700
+ * @name isValid
701
+ * @category Common Helpers
702
+ * @summary Is the given date valid?
703
+ *
704
+ * @description
705
+ * Returns false if argument is Invalid Date and true otherwise.
706
+ * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)
707
+ * Invalid Date is a Date, whose time value is NaN.
708
+ *
709
+ * Time value of Date: http://es5.github.io/#x15.9.1.1
710
+ *
711
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
712
+ *
713
+ * @param date - The date to check
714
+ *
715
+ * @returns The date is valid
716
+ *
717
+ * @example
718
+ * // For the valid date:
719
+ * const result = isValid(new Date(2014, 1, 31))
720
+ * //=> true
721
+ *
722
+ * @example
723
+ * // For the value, convertable into a date:
724
+ * const result = isValid(1393804800000)
725
+ * //=> true
726
+ *
727
+ * @example
728
+ * // For the invalid date:
729
+ * const result = isValid(new Date(''))
730
+ * //=> false
731
+ */
732
+ function isValid(date) {
733
+ if (!(0, _index$c.isDate)(date) && typeof date !== "number") {
734
+ return false;
735
+ }
736
+ const _date = (0, _index2$9.toDate)(date);
737
+ return !isNaN(Number(_date));
738
+ }
739
+
740
+ var startOfYear$1 = {};
741
+
742
+ startOfYear$1.startOfYear = startOfYear;
743
+ var _index$b = toDate$1;
744
+ var _index2$8 = constructFrom$1;
745
+
746
+ /**
747
+ * @name startOfYear
748
+ * @category Year Helpers
749
+ * @summary Return the start of a year for the given date.
750
+ *
751
+ * @description
752
+ * Return the start of a year for the given date.
753
+ * The result will be in the local timezone.
754
+ *
755
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
756
+ *
757
+ * @param date - The original date
758
+ *
759
+ * @returns The start of a year
760
+ *
761
+ * @example
762
+ * // The start of a year for 2 September 2014 11:55:00:
763
+ * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))
764
+ * //=> Wed Jan 01 2014 00:00:00
765
+ */
766
+ function startOfYear(date) {
767
+ const cleanDate = (0, _index$b.toDate)(date);
768
+ const _date = (0, _index2$8.constructFrom)(date, 0);
769
+ _date.setFullYear(cleanDate.getFullYear(), 0, 1);
770
+ _date.setHours(0, 0, 0, 0);
771
+ return _date;
772
+ }
773
+
774
+ var format = {};
775
+
776
+ var defaultLocale = {};
777
+
778
+ var enUS = {};
779
+
780
+ var formatDistance$1 = {};
781
+
782
+ formatDistance$1.formatDistance = void 0;
783
+
784
+ const formatDistanceLocale = {
785
+ lessThanXSeconds: {
786
+ one: "less than a second",
787
+ other: "less than {{count}} seconds",
788
+ },
789
+
790
+ xSeconds: {
791
+ one: "1 second",
792
+ other: "{{count}} seconds",
793
+ },
794
+
795
+ halfAMinute: "half a minute",
796
+
797
+ lessThanXMinutes: {
798
+ one: "less than a minute",
799
+ other: "less than {{count}} minutes",
800
+ },
801
+
802
+ xMinutes: {
803
+ one: "1 minute",
804
+ other: "{{count}} minutes",
805
+ },
806
+
807
+ aboutXHours: {
808
+ one: "about 1 hour",
809
+ other: "about {{count}} hours",
810
+ },
811
+
812
+ xHours: {
813
+ one: "1 hour",
814
+ other: "{{count}} hours",
815
+ },
816
+
817
+ xDays: {
818
+ one: "1 day",
819
+ other: "{{count}} days",
820
+ },
821
+
822
+ aboutXWeeks: {
823
+ one: "about 1 week",
824
+ other: "about {{count}} weeks",
825
+ },
826
+
827
+ xWeeks: {
828
+ one: "1 week",
829
+ other: "{{count}} weeks",
830
+ },
831
+
832
+ aboutXMonths: {
833
+ one: "about 1 month",
834
+ other: "about {{count}} months",
835
+ },
836
+
837
+ xMonths: {
838
+ one: "1 month",
839
+ other: "{{count}} months",
840
+ },
841
+
842
+ aboutXYears: {
843
+ one: "about 1 year",
844
+ other: "about {{count}} years",
845
+ },
846
+
847
+ xYears: {
848
+ one: "1 year",
849
+ other: "{{count}} years",
850
+ },
851
+
852
+ overXYears: {
853
+ one: "over 1 year",
854
+ other: "over {{count}} years",
855
+ },
856
+
857
+ almostXYears: {
858
+ one: "almost 1 year",
859
+ other: "almost {{count}} years",
860
+ },
861
+ };
862
+
863
+ const formatDistance = (token, count, options) => {
864
+ let result;
865
+
866
+ const tokenValue = formatDistanceLocale[token];
867
+ if (typeof tokenValue === "string") {
868
+ result = tokenValue;
869
+ } else if (count === 1) {
870
+ result = tokenValue.one;
871
+ } else {
872
+ result = tokenValue.other.replace("{{count}}", count.toString());
873
+ }
874
+
875
+ if (options?.addSuffix) {
876
+ if (options.comparison && options.comparison > 0) {
877
+ return "in " + result;
878
+ } else {
879
+ return result + " ago";
880
+ }
881
+ }
882
+
883
+ return result;
884
+ };
885
+ formatDistance$1.formatDistance = formatDistance;
886
+
887
+ var formatLong = {};
888
+
889
+ var buildFormatLongFn$1 = {};
890
+
891
+ buildFormatLongFn$1.buildFormatLongFn = buildFormatLongFn;
892
+
893
+ function buildFormatLongFn(args) {
894
+ return (options = {}) => {
895
+ // TODO: Remove String()
896
+ const width = options.width ? String(options.width) : args.defaultWidth;
897
+ const format = args.formats[width] || args.formats[args.defaultWidth];
898
+ return format;
899
+ };
900
+ }
901
+
902
+ formatLong.formatLong = void 0;
903
+ var _index$a = buildFormatLongFn$1;
904
+
905
+ const dateFormats = {
906
+ full: "EEEE, MMMM do, y",
907
+ long: "MMMM do, y",
908
+ medium: "MMM d, y",
909
+ short: "MM/dd/yyyy",
910
+ };
911
+
912
+ const timeFormats = {
913
+ full: "h:mm:ss a zzzz",
914
+ long: "h:mm:ss a z",
915
+ medium: "h:mm:ss a",
916
+ short: "h:mm a",
917
+ };
918
+
919
+ const dateTimeFormats = {
920
+ full: "{{date}} 'at' {{time}}",
921
+ long: "{{date}} 'at' {{time}}",
922
+ medium: "{{date}}, {{time}}",
923
+ short: "{{date}}, {{time}}",
924
+ };
925
+
926
+ (formatLong.formatLong = {
927
+ date: (0, _index$a.buildFormatLongFn)({
928
+ formats: dateFormats,
929
+ defaultWidth: "full",
930
+ }),
931
+
932
+ time: (0, _index$a.buildFormatLongFn)({
933
+ formats: timeFormats,
934
+ defaultWidth: "full",
935
+ }),
936
+
937
+ dateTime: (0, _index$a.buildFormatLongFn)({
938
+ formats: dateTimeFormats,
939
+ defaultWidth: "full",
940
+ }),
941
+ });
942
+
943
+ var formatRelative$1 = {};
944
+
945
+ formatRelative$1.formatRelative = void 0;
946
+
947
+ const formatRelativeLocale = {
948
+ lastWeek: "'last' eeee 'at' p",
949
+ yesterday: "'yesterday at' p",
950
+ today: "'today at' p",
951
+ tomorrow: "'tomorrow at' p",
952
+ nextWeek: "eeee 'at' p",
953
+ other: "P",
954
+ };
955
+
956
+ const formatRelative = (token, _date, _baseDate, _options) =>
957
+ formatRelativeLocale[token];
958
+ formatRelative$1.formatRelative = formatRelative;
959
+
960
+ var localize = {};
961
+
962
+ var buildLocalizeFn$1 = {};
963
+
964
+ buildLocalizeFn$1.buildLocalizeFn = buildLocalizeFn; /* eslint-disable no-unused-vars */
965
+
966
+ /**
967
+ * The localize function argument callback which allows to convert raw value to
968
+ * the actual type.
969
+ *
970
+ * @param value - The value to convert
971
+ *
972
+ * @returns The converted value
973
+ */
974
+
975
+ /**
976
+ * The map of localized values for each width.
977
+ */
978
+
979
+ /**
980
+ * The index type of the locale unit value. It types conversion of units of
981
+ * values that don't start at 0 (i.e. quarters).
982
+ */
983
+
984
+ /**
985
+ * Converts the unit value to the tuple of values.
986
+ */
987
+
988
+ /**
989
+ * The tuple of localized era values. The first element represents BC,
990
+ * the second element represents AD.
991
+ */
992
+
993
+ /**
994
+ * The tuple of localized quarter values. The first element represents Q1.
995
+ */
996
+
997
+ /**
998
+ * The tuple of localized day values. The first element represents Sunday.
999
+ */
1000
+
1001
+ /**
1002
+ * The tuple of localized month values. The first element represents January.
1003
+ */
1004
+
1005
+ function buildLocalizeFn(args) {
1006
+ return (value, options) => {
1007
+ const context = options?.context ? String(options.context) : "standalone";
1008
+
1009
+ let valuesArray;
1010
+ if (context === "formatting" && args.formattingValues) {
1011
+ const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
1012
+ const width = options?.width ? String(options.width) : defaultWidth;
1013
+
1014
+ valuesArray =
1015
+ args.formattingValues[width] || args.formattingValues[defaultWidth];
1016
+ } else {
1017
+ const defaultWidth = args.defaultWidth;
1018
+ const width = options?.width ? String(options.width) : args.defaultWidth;
1019
+
1020
+ valuesArray = args.values[width] || args.values[defaultWidth];
1021
+ }
1022
+ const index = args.argumentCallback ? args.argumentCallback(value) : value;
1023
+
1024
+ // @ts-expect-error - 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!
1025
+ return valuesArray[index];
1026
+ };
1027
+ }
1028
+
1029
+ localize.localize = void 0;
1030
+ var _index$9 = buildLocalizeFn$1;
1031
+
1032
+ const eraValues = {
1033
+ narrow: ["B", "A"],
1034
+ abbreviated: ["BC", "AD"],
1035
+ wide: ["Before Christ", "Anno Domini"],
1036
+ };
1037
+
1038
+ const quarterValues = {
1039
+ narrow: ["1", "2", "3", "4"],
1040
+ abbreviated: ["Q1", "Q2", "Q3", "Q4"],
1041
+ wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"],
1042
+ };
1043
+
1044
+ // Note: in English, the names of days of the week and months are capitalized.
1045
+ // If you are making a new locale based on this one, check if the same is true for the language you're working on.
1046
+ // Generally, formatted dates should look like they are in the middle of a sentence,
1047
+ // e.g. in Spanish language the weekdays and months should be in the lowercase.
1048
+ const monthValues = {
1049
+ narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
1050
+ abbreviated: [
1051
+ "Jan",
1052
+ "Feb",
1053
+ "Mar",
1054
+ "Apr",
1055
+ "May",
1056
+ "Jun",
1057
+ "Jul",
1058
+ "Aug",
1059
+ "Sep",
1060
+ "Oct",
1061
+ "Nov",
1062
+ "Dec",
1063
+ ],
1064
+
1065
+ wide: [
1066
+ "January",
1067
+ "February",
1068
+ "March",
1069
+ "April",
1070
+ "May",
1071
+ "June",
1072
+ "July",
1073
+ "August",
1074
+ "September",
1075
+ "October",
1076
+ "November",
1077
+ "December",
1078
+ ],
1079
+ };
1080
+
1081
+ const dayValues = {
1082
+ narrow: ["S", "M", "T", "W", "T", "F", "S"],
1083
+ short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
1084
+ abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
1085
+ wide: [
1086
+ "Sunday",
1087
+ "Monday",
1088
+ "Tuesday",
1089
+ "Wednesday",
1090
+ "Thursday",
1091
+ "Friday",
1092
+ "Saturday",
1093
+ ],
1094
+ };
1095
+
1096
+ const dayPeriodValues = {
1097
+ narrow: {
1098
+ am: "a",
1099
+ pm: "p",
1100
+ midnight: "mi",
1101
+ noon: "n",
1102
+ morning: "morning",
1103
+ afternoon: "afternoon",
1104
+ evening: "evening",
1105
+ night: "night",
1106
+ },
1107
+ abbreviated: {
1108
+ am: "AM",
1109
+ pm: "PM",
1110
+ midnight: "midnight",
1111
+ noon: "noon",
1112
+ morning: "morning",
1113
+ afternoon: "afternoon",
1114
+ evening: "evening",
1115
+ night: "night",
1116
+ },
1117
+ wide: {
1118
+ am: "a.m.",
1119
+ pm: "p.m.",
1120
+ midnight: "midnight",
1121
+ noon: "noon",
1122
+ morning: "morning",
1123
+ afternoon: "afternoon",
1124
+ evening: "evening",
1125
+ night: "night",
1126
+ },
1127
+ };
1128
+
1129
+ const formattingDayPeriodValues = {
1130
+ narrow: {
1131
+ am: "a",
1132
+ pm: "p",
1133
+ midnight: "mi",
1134
+ noon: "n",
1135
+ morning: "in the morning",
1136
+ afternoon: "in the afternoon",
1137
+ evening: "in the evening",
1138
+ night: "at night",
1139
+ },
1140
+ abbreviated: {
1141
+ am: "AM",
1142
+ pm: "PM",
1143
+ midnight: "midnight",
1144
+ noon: "noon",
1145
+ morning: "in the morning",
1146
+ afternoon: "in the afternoon",
1147
+ evening: "in the evening",
1148
+ night: "at night",
1149
+ },
1150
+ wide: {
1151
+ am: "a.m.",
1152
+ pm: "p.m.",
1153
+ midnight: "midnight",
1154
+ noon: "noon",
1155
+ morning: "in the morning",
1156
+ afternoon: "in the afternoon",
1157
+ evening: "in the evening",
1158
+ night: "at night",
1159
+ },
1160
+ };
1161
+
1162
+ const ordinalNumber = (dirtyNumber, _options) => {
1163
+ const number = Number(dirtyNumber);
1164
+
1165
+ // If ordinal numbers depend on context, for example,
1166
+ // if they are different for different grammatical genders,
1167
+ // use `options.unit`.
1168
+ //
1169
+ // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
1170
+ // 'day', 'hour', 'minute', 'second'.
1171
+
1172
+ const rem100 = number % 100;
1173
+ if (rem100 > 20 || rem100 < 10) {
1174
+ switch (rem100 % 10) {
1175
+ case 1:
1176
+ return number + "st";
1177
+ case 2:
1178
+ return number + "nd";
1179
+ case 3:
1180
+ return number + "rd";
1181
+ }
1182
+ }
1183
+ return number + "th";
1184
+ };
1185
+
1186
+ (localize.localize = {
1187
+ ordinalNumber,
1188
+
1189
+ era: (0, _index$9.buildLocalizeFn)({
1190
+ values: eraValues,
1191
+ defaultWidth: "wide",
1192
+ }),
1193
+
1194
+ quarter: (0, _index$9.buildLocalizeFn)({
1195
+ values: quarterValues,
1196
+ defaultWidth: "wide",
1197
+ argumentCallback: (quarter) => quarter - 1,
1198
+ }),
1199
+
1200
+ month: (0, _index$9.buildLocalizeFn)({
1201
+ values: monthValues,
1202
+ defaultWidth: "wide",
1203
+ }),
1204
+
1205
+ day: (0, _index$9.buildLocalizeFn)({
1206
+ values: dayValues,
1207
+ defaultWidth: "wide",
1208
+ }),
1209
+
1210
+ dayPeriod: (0, _index$9.buildLocalizeFn)({
1211
+ values: dayPeriodValues,
1212
+ defaultWidth: "wide",
1213
+ formattingValues: formattingDayPeriodValues,
1214
+ defaultFormattingWidth: "wide",
1215
+ }),
1216
+ });
1217
+
1218
+ var match = {};
1219
+
1220
+ var buildMatchFn$1 = {};
1221
+
1222
+ buildMatchFn$1.buildMatchFn = buildMatchFn;
1223
+
1224
+ function buildMatchFn(args) {
1225
+ return (string, options = {}) => {
1226
+ const width = options.width;
1227
+
1228
+ const matchPattern =
1229
+ (width && args.matchPatterns[width]) ||
1230
+ args.matchPatterns[args.defaultMatchWidth];
1231
+ const matchResult = string.match(matchPattern);
1232
+
1233
+ if (!matchResult) {
1234
+ return null;
1235
+ }
1236
+ const matchedString = matchResult[0];
1237
+
1238
+ const parsePatterns =
1239
+ (width && args.parsePatterns[width]) ||
1240
+ args.parsePatterns[args.defaultParseWidth];
1241
+
1242
+ const key = Array.isArray(parsePatterns)
1243
+ ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))
1244
+ : // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
1245
+ findKey(parsePatterns, (pattern) => pattern.test(matchedString));
1246
+
1247
+ let value;
1248
+
1249
+ value = args.valueCallback ? args.valueCallback(key) : key;
1250
+ value = options.valueCallback
1251
+ ? // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
1252
+ options.valueCallback(value)
1253
+ : value;
1254
+
1255
+ const rest = string.slice(matchedString.length);
1256
+
1257
+ return { value, rest };
1258
+ };
1259
+ }
1260
+
1261
+ function findKey(object, predicate) {
1262
+ for (const key in object) {
1263
+ if (
1264
+ Object.prototype.hasOwnProperty.call(object, key) &&
1265
+ predicate(object[key])
1266
+ ) {
1267
+ return key;
1268
+ }
1269
+ }
1270
+ return undefined;
1271
+ }
1272
+
1273
+ function findIndex(array, predicate) {
1274
+ for (let key = 0; key < array.length; key++) {
1275
+ if (predicate(array[key])) {
1276
+ return key;
1277
+ }
1278
+ }
1279
+ return undefined;
1280
+ }
1281
+
1282
+ var buildMatchPatternFn$1 = {};
1283
+
1284
+ buildMatchPatternFn$1.buildMatchPatternFn = buildMatchPatternFn;
1285
+
1286
+ function buildMatchPatternFn(args) {
1287
+ return (string, options = {}) => {
1288
+ const matchResult = string.match(args.matchPattern);
1289
+ if (!matchResult) return null;
1290
+ const matchedString = matchResult[0];
1291
+
1292
+ const parseResult = string.match(args.parsePattern);
1293
+ if (!parseResult) return null;
1294
+ let value = args.valueCallback
1295
+ ? args.valueCallback(parseResult[0])
1296
+ : parseResult[0];
1297
+
1298
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
1299
+ value = options.valueCallback ? options.valueCallback(value) : value;
1300
+
1301
+ const rest = string.slice(matchedString.length);
1302
+
1303
+ return { value, rest };
1304
+ };
1305
+ }
1306
+
1307
+ match.match = void 0;
1308
+
1309
+ var _index$8 = buildMatchFn$1;
1310
+ var _index2$7 = buildMatchPatternFn$1;
1311
+
1312
+ const matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
1313
+ const parseOrdinalNumberPattern = /\d+/i;
1314
+
1315
+ const matchEraPatterns = {
1316
+ narrow: /^(b|a)/i,
1317
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
1318
+ wide: /^(before christ|before common era|anno domini|common era)/i,
1319
+ };
1320
+ const parseEraPatterns = {
1321
+ any: [/^b/i, /^(a|c)/i],
1322
+ };
1323
+
1324
+ const matchQuarterPatterns = {
1325
+ narrow: /^[1234]/i,
1326
+ abbreviated: /^q[1234]/i,
1327
+ wide: /^[1234](th|st|nd|rd)? quarter/i,
1328
+ };
1329
+ const parseQuarterPatterns = {
1330
+ any: [/1/i, /2/i, /3/i, /4/i],
1331
+ };
1332
+
1333
+ const matchMonthPatterns = {
1334
+ narrow: /^[jfmasond]/i,
1335
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
1336
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,
1337
+ };
1338
+ const parseMonthPatterns = {
1339
+ narrow: [
1340
+ /^j/i,
1341
+ /^f/i,
1342
+ /^m/i,
1343
+ /^a/i,
1344
+ /^m/i,
1345
+ /^j/i,
1346
+ /^j/i,
1347
+ /^a/i,
1348
+ /^s/i,
1349
+ /^o/i,
1350
+ /^n/i,
1351
+ /^d/i,
1352
+ ],
1353
+
1354
+ any: [
1355
+ /^ja/i,
1356
+ /^f/i,
1357
+ /^mar/i,
1358
+ /^ap/i,
1359
+ /^may/i,
1360
+ /^jun/i,
1361
+ /^jul/i,
1362
+ /^au/i,
1363
+ /^s/i,
1364
+ /^o/i,
1365
+ /^n/i,
1366
+ /^d/i,
1367
+ ],
1368
+ };
1369
+
1370
+ const matchDayPatterns = {
1371
+ narrow: /^[smtwf]/i,
1372
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
1373
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
1374
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,
1375
+ };
1376
+ const parseDayPatterns = {
1377
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
1378
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],
1379
+ };
1380
+
1381
+ const matchDayPeriodPatterns = {
1382
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
1383
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,
1384
+ };
1385
+ const parseDayPeriodPatterns = {
1386
+ any: {
1387
+ am: /^a/i,
1388
+ pm: /^p/i,
1389
+ midnight: /^mi/i,
1390
+ noon: /^no/i,
1391
+ morning: /morning/i,
1392
+ afternoon: /afternoon/i,
1393
+ evening: /evening/i,
1394
+ night: /night/i,
1395
+ },
1396
+ };
1397
+
1398
+ (match.match = {
1399
+ ordinalNumber: (0, _index2$7.buildMatchPatternFn)({
1400
+ matchPattern: matchOrdinalNumberPattern,
1401
+ parsePattern: parseOrdinalNumberPattern,
1402
+ valueCallback: (value) => parseInt(value, 10),
1403
+ }),
1404
+
1405
+ era: (0, _index$8.buildMatchFn)({
1406
+ matchPatterns: matchEraPatterns,
1407
+ defaultMatchWidth: "wide",
1408
+ parsePatterns: parseEraPatterns,
1409
+ defaultParseWidth: "any",
1410
+ }),
1411
+
1412
+ quarter: (0, _index$8.buildMatchFn)({
1413
+ matchPatterns: matchQuarterPatterns,
1414
+ defaultMatchWidth: "wide",
1415
+ parsePatterns: parseQuarterPatterns,
1416
+ defaultParseWidth: "any",
1417
+ valueCallback: (index) => index + 1,
1418
+ }),
1419
+
1420
+ month: (0, _index$8.buildMatchFn)({
1421
+ matchPatterns: matchMonthPatterns,
1422
+ defaultMatchWidth: "wide",
1423
+ parsePatterns: parseMonthPatterns,
1424
+ defaultParseWidth: "any",
1425
+ }),
1426
+
1427
+ day: (0, _index$8.buildMatchFn)({
1428
+ matchPatterns: matchDayPatterns,
1429
+ defaultMatchWidth: "wide",
1430
+ parsePatterns: parseDayPatterns,
1431
+ defaultParseWidth: "any",
1432
+ }),
1433
+
1434
+ dayPeriod: (0, _index$8.buildMatchFn)({
1435
+ matchPatterns: matchDayPeriodPatterns,
1436
+ defaultMatchWidth: "any",
1437
+ parsePatterns: parseDayPeriodPatterns,
1438
+ defaultParseWidth: "any",
1439
+ }),
1440
+ });
1441
+
1442
+ enUS.enUS = void 0;
1443
+ var _index$7 = formatDistance$1;
1444
+ var _index2$6 = formatLong;
1445
+ var _index3$6 = formatRelative$1;
1446
+ var _index4$5 = localize;
1447
+ var _index5$1 = match;
1448
+
1449
+ /**
1450
+ * @category Locales
1451
+ * @summary English locale (United States).
1452
+ * @language English
1453
+ * @iso-639-2 eng
1454
+ * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)
1455
+ * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)
1456
+ */
1457
+ (enUS.enUS = {
1458
+ code: "en-US",
1459
+ formatDistance: _index$7.formatDistance,
1460
+ formatLong: _index2$6.formatLong,
1461
+ formatRelative: _index3$6.formatRelative,
1462
+ localize: _index4$5.localize,
1463
+ match: _index5$1.match,
1464
+ options: {
1465
+ weekStartsOn: 0 /* Sunday */,
1466
+ firstWeekContainsDate: 1,
1467
+ },
1468
+ });
1469
+
1470
+ (function (exports) {
1471
+ Object.defineProperty(exports, "defaultLocale", {
1472
+ enumerable: true,
1473
+ get: function () {
1474
+ return _index.enUS;
1475
+ },
1476
+ });
1477
+ var _index = enUS;
1478
+ }(defaultLocale));
1479
+
1480
+ var formatters = {};
1481
+
1482
+ var getDayOfYear$1 = {};
1483
+
1484
+ getDayOfYear$1.getDayOfYear = getDayOfYear;
1485
+ var _index$6 = differenceInCalendarDays$1;
1486
+ var _index2$5 = startOfYear$1;
1487
+ var _index3$5 = toDate$1;
1488
+
1489
+ /**
1490
+ * @name getDayOfYear
1491
+ * @category Day Helpers
1492
+ * @summary Get the day of the year of the given date.
1493
+ *
1494
+ * @description
1495
+ * Get the day of the year of the given date.
1496
+ *
1497
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
1498
+ *
1499
+ * @param date - The given date
1500
+ *
1501
+ * @returns The day of year
1502
+ *
1503
+ * @example
1504
+ * // Which day of the year is 2 July 2014?
1505
+ * const result = getDayOfYear(new Date(2014, 6, 2))
1506
+ * //=> 183
1507
+ */
1508
+ function getDayOfYear(date) {
1509
+ const _date = (0, _index3$5.toDate)(date);
1510
+ const diff = (0, _index$6.differenceInCalendarDays)(
1511
+ _date,
1512
+ (0, _index2$5.startOfYear)(_date),
1513
+ );
1514
+ const dayOfYear = diff + 1;
1515
+ return dayOfYear;
1516
+ }
1517
+
1518
+ var getISOWeek$1 = {};
1519
+
1520
+ getISOWeek$1.getISOWeek = getISOWeek;
1521
+ var _index$5 = constants;
1522
+ var _index2$4 = startOfISOWeek$1;
1523
+ var _index3$4 = startOfISOWeekYear$1;
1524
+ var _index4$4 = toDate$1;
1525
+
1526
+ /**
1527
+ * @name getISOWeek
1528
+ * @category ISO Week Helpers
1529
+ * @summary Get the ISO week of the given date.
1530
+ *
1531
+ * @description
1532
+ * Get the ISO week of the given date.
1533
+ *
1534
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
1535
+ *
1536
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
1537
+ *
1538
+ * @param date - The given date
1539
+ *
1540
+ * @returns The ISO week
1541
+ *
1542
+ * @example
1543
+ * // Which week of the ISO-week numbering year is 2 January 2005?
1544
+ * const result = getISOWeek(new Date(2005, 0, 2))
1545
+ * //=> 53
1546
+ */
1547
+ function getISOWeek(date) {
1548
+ const _date = (0, _index4$4.toDate)(date);
1549
+ const diff =
1550
+ +(0, _index2$4.startOfISOWeek)(_date) -
1551
+ +(0, _index3$4.startOfISOWeekYear)(_date);
1552
+
1553
+ // Round the number of weeks to the nearest integer because the number of
1554
+ // milliseconds in a week is not constant (e.g. it's different in the week of
1555
+ // the daylight saving time clock shift).
1556
+ return Math.round(diff / _index$5.millisecondsInWeek) + 1;
1557
+ }
1558
+
1559
+ var getWeek$1 = {};
1560
+
1561
+ var startOfWeekYear$1 = {};
1562
+
1563
+ var getWeekYear$1 = {};
1564
+
1565
+ getWeekYear$1.getWeekYear = getWeekYear;
1566
+ var _index$4 = constructFrom$1;
1567
+ var _index2$3 = startOfWeek$1;
1568
+ var _index3$3 = toDate$1;
1569
+
1570
+ var _index4$3 = defaultOptions$1;
1571
+
1572
+ /**
1573
+ * The {@link getWeekYear} function options.
1574
+ */
1575
+
1576
+ /**
1577
+ * @name getWeekYear
1578
+ * @category Week-Numbering Year Helpers
1579
+ * @summary Get the local week-numbering year of the given date.
1580
+ *
1581
+ * @description
1582
+ * Get the local week-numbering year of the given date.
1583
+ * The exact calculation depends on the values of
1584
+ * `options.weekStartsOn` (which is the index of the first day of the week)
1585
+ * and `options.firstWeekContainsDate` (which is the day of January, which is always in
1586
+ * the first week of the week-numbering year)
1587
+ *
1588
+ * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
1589
+ *
1590
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
1591
+ *
1592
+ * @param date - The given date
1593
+ * @param options - An object with options.
1594
+ *
1595
+ * @returns The local week-numbering year
1596
+ *
1597
+ * @example
1598
+ * // Which week numbering year is 26 December 2004 with the default settings?
1599
+ * const result = getWeekYear(new Date(2004, 11, 26))
1600
+ * //=> 2005
1601
+ *
1602
+ * @example
1603
+ * // Which week numbering year is 26 December 2004 if week starts on Saturday?
1604
+ * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })
1605
+ * //=> 2004
1606
+ *
1607
+ * @example
1608
+ * // Which week numbering year is 26 December 2004 if the first week contains 4 January?
1609
+ * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })
1610
+ * //=> 2004
1611
+ */
1612
+ function getWeekYear(date, options) {
1613
+ const _date = (0, _index3$3.toDate)(date);
1614
+ const year = _date.getFullYear();
1615
+
1616
+ const defaultOptions = (0, _index4$3.getDefaultOptions)();
1617
+ const firstWeekContainsDate =
1618
+ options?.firstWeekContainsDate ??
1619
+ options?.locale?.options?.firstWeekContainsDate ??
1620
+ defaultOptions.firstWeekContainsDate ??
1621
+ defaultOptions.locale?.options?.firstWeekContainsDate ??
1622
+ 1;
1623
+
1624
+ const firstWeekOfNextYear = (0, _index$4.constructFrom)(date, 0);
1625
+ firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
1626
+ firstWeekOfNextYear.setHours(0, 0, 0, 0);
1627
+ const startOfNextYear = (0, _index2$3.startOfWeek)(
1628
+ firstWeekOfNextYear,
1629
+ options,
1630
+ );
1631
+
1632
+ const firstWeekOfThisYear = (0, _index$4.constructFrom)(date, 0);
1633
+ firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
1634
+ firstWeekOfThisYear.setHours(0, 0, 0, 0);
1635
+ const startOfThisYear = (0, _index2$3.startOfWeek)(
1636
+ firstWeekOfThisYear,
1637
+ options,
1638
+ );
1639
+
1640
+ if (_date.getTime() >= startOfNextYear.getTime()) {
1641
+ return year + 1;
1642
+ } else if (_date.getTime() >= startOfThisYear.getTime()) {
1643
+ return year;
1644
+ } else {
1645
+ return year - 1;
1646
+ }
1647
+ }
1648
+
1649
+ startOfWeekYear$1.startOfWeekYear = startOfWeekYear;
1650
+ var _index$3 = constructFrom$1;
1651
+ var _index2$2 = getWeekYear$1;
1652
+ var _index3$2 = startOfWeek$1;
1653
+
1654
+ var _index4$2 = defaultOptions$1;
1655
+
1656
+ /**
1657
+ * The {@link startOfWeekYear} function options.
1658
+ */
1659
+
1660
+ /**
1661
+ * @name startOfWeekYear
1662
+ * @category Week-Numbering Year Helpers
1663
+ * @summary Return the start of a local week-numbering year for the given date.
1664
+ *
1665
+ * @description
1666
+ * Return the start of a local week-numbering year.
1667
+ * The exact calculation depends on the values of
1668
+ * `options.weekStartsOn` (which is the index of the first day of the week)
1669
+ * and `options.firstWeekContainsDate` (which is the day of January, which is always in
1670
+ * the first week of the week-numbering year)
1671
+ *
1672
+ * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
1673
+ *
1674
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
1675
+ *
1676
+ * @param date - The original date
1677
+ * @param options - An object with options
1678
+ *
1679
+ * @returns The start of a week-numbering year
1680
+ *
1681
+ * @example
1682
+ * // The start of an a week-numbering year for 2 July 2005 with default settings:
1683
+ * const result = startOfWeekYear(new Date(2005, 6, 2))
1684
+ * //=> Sun Dec 26 2004 00:00:00
1685
+ *
1686
+ * @example
1687
+ * // The start of a week-numbering year for 2 July 2005
1688
+ * // if Monday is the first day of week
1689
+ * // and 4 January is always in the first week of the year:
1690
+ * const result = startOfWeekYear(new Date(2005, 6, 2), {
1691
+ * weekStartsOn: 1,
1692
+ * firstWeekContainsDate: 4
1693
+ * })
1694
+ * //=> Mon Jan 03 2005 00:00:00
1695
+ */
1696
+ function startOfWeekYear(date, options) {
1697
+ const defaultOptions = (0, _index4$2.getDefaultOptions)();
1698
+ const firstWeekContainsDate =
1699
+ options?.firstWeekContainsDate ??
1700
+ options?.locale?.options?.firstWeekContainsDate ??
1701
+ defaultOptions.firstWeekContainsDate ??
1702
+ defaultOptions.locale?.options?.firstWeekContainsDate ??
1703
+ 1;
1704
+
1705
+ const year = (0, _index2$2.getWeekYear)(date, options);
1706
+ const firstWeek = (0, _index$3.constructFrom)(date, 0);
1707
+ firstWeek.setFullYear(year, 0, firstWeekContainsDate);
1708
+ firstWeek.setHours(0, 0, 0, 0);
1709
+ const _date = (0, _index3$2.startOfWeek)(firstWeek, options);
1710
+ return _date;
1711
+ }
1712
+
1713
+ getWeek$1.getWeek = getWeek;
1714
+ var _index$2 = constants;
1715
+ var _index2$1 = startOfWeek$1;
1716
+ var _index3$1 = startOfWeekYear$1;
1717
+ var _index4$1 = toDate$1;
1718
+
1719
+ /**
1720
+ * The {@link getWeek} function options.
1721
+ */
1722
+
1723
+ /**
1724
+ * @name getWeek
1725
+ * @category Week Helpers
1726
+ * @summary Get the local week index of the given date.
1727
+ *
1728
+ * @description
1729
+ * Get the local week index of the given date.
1730
+ * The exact calculation depends on the values of
1731
+ * `options.weekStartsOn` (which is the index of the first day of the week)
1732
+ * and `options.firstWeekContainsDate` (which is the day of January, which is always in
1733
+ * the first week of the week-numbering year)
1734
+ *
1735
+ * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
1736
+ *
1737
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
1738
+ *
1739
+ * @param date - The given date
1740
+ * @param options - An object with options
1741
+ *
1742
+ * @returns The week
1743
+ *
1744
+ * @example
1745
+ * // Which week of the local week numbering year is 2 January 2005 with default options?
1746
+ * const result = getWeek(new Date(2005, 0, 2))
1747
+ * //=> 2
1748
+ *
1749
+ * @example
1750
+ * // Which week of the local week numbering year is 2 January 2005,
1751
+ * // if Monday is the first day of the week,
1752
+ * // and the first week of the year always contains 4 January?
1753
+ * const result = getWeek(new Date(2005, 0, 2), {
1754
+ * weekStartsOn: 1,
1755
+ * firstWeekContainsDate: 4
1756
+ * })
1757
+ * //=> 53
1758
+ */
1759
+
1760
+ function getWeek(date, options) {
1761
+ const _date = (0, _index4$1.toDate)(date);
1762
+ const diff =
1763
+ +(0, _index2$1.startOfWeek)(_date, options) -
1764
+ +(0, _index3$1.startOfWeekYear)(_date, options);
1765
+
1766
+ // Round the number of weeks to the nearest integer because the number of
1767
+ // milliseconds in a week is not constant (e.g. it's different in the week of
1768
+ // the daylight saving time clock shift).
1769
+ return Math.round(diff / _index$2.millisecondsInWeek) + 1;
1770
+ }
1771
+
1772
+ var addLeadingZeros$1 = {};
1773
+
1774
+ addLeadingZeros$1.addLeadingZeros = addLeadingZeros;
1775
+ function addLeadingZeros(number, targetLength) {
1776
+ const sign = number < 0 ? "-" : "";
1777
+ const output = Math.abs(number).toString().padStart(targetLength, "0");
1778
+ return sign + output;
1779
+ }
1780
+
1781
+ var lightFormatters = {};
1782
+
1783
+ lightFormatters.lightFormatters = void 0;
1784
+ var _index$1 = addLeadingZeros$1;
1785
+
1786
+ /*
1787
+ * | | Unit | | Unit |
1788
+ * |-----|--------------------------------|-----|--------------------------------|
1789
+ * | a | AM, PM | A* | |
1790
+ * | d | Day of month | D | |
1791
+ * | h | Hour [1-12] | H | Hour [0-23] |
1792
+ * | m | Minute | M | Month |
1793
+ * | s | Second | S | Fraction of second |
1794
+ * | y | Year (abs) | Y | |
1795
+ *
1796
+ * Letters marked by * are not implemented but reserved by Unicode standard.
1797
+ */
1798
+
1799
+ (lightFormatters.lightFormatters = {
1800
+ // Year
1801
+ y(date, token) {
1802
+ // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
1803
+ // | Year | y | yy | yyy | yyyy | yyyyy |
1804
+ // |----------|-------|----|-------|-------|-------|
1805
+ // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
1806
+ // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
1807
+ // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
1808
+ // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
1809
+ // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
1810
+
1811
+ const signedYear = date.getFullYear();
1812
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
1813
+ const year = signedYear > 0 ? signedYear : 1 - signedYear;
1814
+ return (0, _index$1.addLeadingZeros)(
1815
+ token === "yy" ? year % 100 : year,
1816
+ token.length,
1817
+ );
1818
+ },
1819
+
1820
+ // Month
1821
+ M(date, token) {
1822
+ const month = date.getMonth();
1823
+ return token === "M"
1824
+ ? String(month + 1)
1825
+ : (0, _index$1.addLeadingZeros)(month + 1, 2);
1826
+ },
1827
+
1828
+ // Day of the month
1829
+ d(date, token) {
1830
+ return (0, _index$1.addLeadingZeros)(date.getDate(), token.length);
1831
+ },
1832
+
1833
+ // AM or PM
1834
+ a(date, token) {
1835
+ const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
1836
+
1837
+ switch (token) {
1838
+ case "a":
1839
+ case "aa":
1840
+ return dayPeriodEnumValue.toUpperCase();
1841
+ case "aaa":
1842
+ return dayPeriodEnumValue;
1843
+ case "aaaaa":
1844
+ return dayPeriodEnumValue[0];
1845
+ case "aaaa":
1846
+ default:
1847
+ return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
1848
+ }
1849
+ },
1850
+
1851
+ // Hour [1-12]
1852
+ h(date, token) {
1853
+ return (0, _index$1.addLeadingZeros)(
1854
+ date.getHours() % 12 || 12,
1855
+ token.length,
1856
+ );
1857
+ },
1858
+
1859
+ // Hour [0-23]
1860
+ H(date, token) {
1861
+ return (0, _index$1.addLeadingZeros)(date.getHours(), token.length);
1862
+ },
1863
+
1864
+ // Minute
1865
+ m(date, token) {
1866
+ return (0, _index$1.addLeadingZeros)(date.getMinutes(), token.length);
1867
+ },
1868
+
1869
+ // Second
1870
+ s(date, token) {
1871
+ return (0, _index$1.addLeadingZeros)(date.getSeconds(), token.length);
1872
+ },
1873
+
1874
+ // Fraction of second
1875
+ S(date, token) {
1876
+ const numberOfDigits = token.length;
1877
+ const milliseconds = date.getMilliseconds();
1878
+ const fractionalSeconds = Math.trunc(
1879
+ milliseconds * Math.pow(10, numberOfDigits - 3),
1880
+ );
1881
+ return (0, _index$1.addLeadingZeros)(fractionalSeconds, token.length);
1882
+ },
1883
+ });
1884
+
1885
+ formatters.formatters = void 0;
1886
+ var _index = getDayOfYear$1;
1887
+ var _index2 = getISOWeek$1;
1888
+ var _index3 = getISOWeekYear$1;
1889
+ var _index4 = getWeek$1;
1890
+ var _index5 = getWeekYear$1;
1891
+
1892
+ var _index6 = addLeadingZeros$1;
1893
+ var _index7 = lightFormatters;
1894
+
1895
+ const dayPeriodEnum = {
1896
+ am: "am",
1897
+ pm: "pm",
1898
+ midnight: "midnight",
1899
+ noon: "noon",
1900
+ morning: "morning",
1901
+ afternoon: "afternoon",
1902
+ evening: "evening",
1903
+ night: "night",
1904
+ };
1905
+
1906
+ /*
1907
+ * | | Unit | | Unit |
1908
+ * |-----|--------------------------------|-----|--------------------------------|
1909
+ * | a | AM, PM | A* | Milliseconds in day |
1910
+ * | b | AM, PM, noon, midnight | B | Flexible day period |
1911
+ * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
1912
+ * | d | Day of month | D | Day of year |
1913
+ * | e | Local day of week | E | Day of week |
1914
+ * | f | | F* | Day of week in month |
1915
+ * | g* | Modified Julian day | G | Era |
1916
+ * | h | Hour [1-12] | H | Hour [0-23] |
1917
+ * | i! | ISO day of week | I! | ISO week of year |
1918
+ * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
1919
+ * | k | Hour [1-24] | K | Hour [0-11] |
1920
+ * | l* | (deprecated) | L | Stand-alone month |
1921
+ * | m | Minute | M | Month |
1922
+ * | n | | N | |
1923
+ * | o! | Ordinal number modifier | O | Timezone (GMT) |
1924
+ * | p! | Long localized time | P! | Long localized date |
1925
+ * | q | Stand-alone quarter | Q | Quarter |
1926
+ * | r* | Related Gregorian year | R! | ISO week-numbering year |
1927
+ * | s | Second | S | Fraction of second |
1928
+ * | t! | Seconds timestamp | T! | Milliseconds timestamp |
1929
+ * | u | Extended year | U* | Cyclic year |
1930
+ * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
1931
+ * | w | Local week of year | W* | Week of month |
1932
+ * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
1933
+ * | y | Year (abs) | Y | Local week-numbering year |
1934
+ * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
1935
+ *
1936
+ * Letters marked by * are not implemented but reserved by Unicode standard.
1937
+ *
1938
+ * Letters marked by ! are non-standard, but implemented by date-fns:
1939
+ * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
1940
+ * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
1941
+ * i.e. 7 for Sunday, 1 for Monday, etc.
1942
+ * - `I` is ISO week of year, as opposed to `w` which is local week of year.
1943
+ * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
1944
+ * `R` is supposed to be used in conjunction with `I` and `i`
1945
+ * for universal ISO week-numbering date, whereas
1946
+ * `Y` is supposed to be used in conjunction with `w` and `e`
1947
+ * for week-numbering date specific to the locale.
1948
+ * - `P` is long localized date format
1949
+ * - `p` is long localized time format
1950
+ */
1951
+
1952
+ (formatters.formatters = {
1953
+ // Era
1954
+ G: function (date, token, localize) {
1955
+ const era = date.getFullYear() > 0 ? 1 : 0;
1956
+ switch (token) {
1957
+ // AD, BC
1958
+ case "G":
1959
+ case "GG":
1960
+ case "GGG":
1961
+ return localize.era(era, { width: "abbreviated" });
1962
+ // A, B
1963
+ case "GGGGG":
1964
+ return localize.era(era, { width: "narrow" });
1965
+ // Anno Domini, Before Christ
1966
+ case "GGGG":
1967
+ default:
1968
+ return localize.era(era, { width: "wide" });
1969
+ }
1970
+ },
1971
+
1972
+ // Year
1973
+ y: function (date, token, localize) {
1974
+ // Ordinal number
1975
+ if (token === "yo") {
1976
+ const signedYear = date.getFullYear();
1977
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
1978
+ const year = signedYear > 0 ? signedYear : 1 - signedYear;
1979
+ return localize.ordinalNumber(year, { unit: "year" });
1980
+ }
1981
+
1982
+ return _index7.lightFormatters.y(date, token);
1983
+ },
1984
+
1985
+ // Local week-numbering year
1986
+ Y: function (date, token, localize, options) {
1987
+ const signedWeekYear = (0, _index5.getWeekYear)(date, options);
1988
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
1989
+ const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
1990
+
1991
+ // Two digit year
1992
+ if (token === "YY") {
1993
+ const twoDigitYear = weekYear % 100;
1994
+ return (0, _index6.addLeadingZeros)(twoDigitYear, 2);
1995
+ }
1996
+
1997
+ // Ordinal number
1998
+ if (token === "Yo") {
1999
+ return localize.ordinalNumber(weekYear, { unit: "year" });
2000
+ }
2001
+
2002
+ // Padding
2003
+ return (0, _index6.addLeadingZeros)(weekYear, token.length);
2004
+ },
2005
+
2006
+ // ISO week-numbering year
2007
+ R: function (date, token) {
2008
+ const isoWeekYear = (0, _index3.getISOWeekYear)(date);
2009
+
2010
+ // Padding
2011
+ return (0, _index6.addLeadingZeros)(isoWeekYear, token.length);
2012
+ },
2013
+
2014
+ // Extended year. This is a single number designating the year of this calendar system.
2015
+ // The main difference between `y` and `u` localizers are B.C. years:
2016
+ // | Year | `y` | `u` |
2017
+ // |------|-----|-----|
2018
+ // | AC 1 | 1 | 1 |
2019
+ // | BC 1 | 1 | 0 |
2020
+ // | BC 2 | 2 | -1 |
2021
+ // Also `yy` always returns the last two digits of a year,
2022
+ // while `uu` pads single digit years to 2 characters and returns other years unchanged.
2023
+ u: function (date, token) {
2024
+ const year = date.getFullYear();
2025
+ return (0, _index6.addLeadingZeros)(year, token.length);
2026
+ },
2027
+
2028
+ // Quarter
2029
+ Q: function (date, token, localize) {
2030
+ const quarter = Math.ceil((date.getMonth() + 1) / 3);
2031
+ switch (token) {
2032
+ // 1, 2, 3, 4
2033
+ case "Q":
2034
+ return String(quarter);
2035
+ // 01, 02, 03, 04
2036
+ case "QQ":
2037
+ return (0, _index6.addLeadingZeros)(quarter, 2);
2038
+ // 1st, 2nd, 3rd, 4th
2039
+ case "Qo":
2040
+ return localize.ordinalNumber(quarter, { unit: "quarter" });
2041
+ // Q1, Q2, Q3, Q4
2042
+ case "QQQ":
2043
+ return localize.quarter(quarter, {
2044
+ width: "abbreviated",
2045
+ context: "formatting",
2046
+ });
2047
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
2048
+ case "QQQQQ":
2049
+ return localize.quarter(quarter, {
2050
+ width: "narrow",
2051
+ context: "formatting",
2052
+ });
2053
+ // 1st quarter, 2nd quarter, ...
2054
+ case "QQQQ":
2055
+ default:
2056
+ return localize.quarter(quarter, {
2057
+ width: "wide",
2058
+ context: "formatting",
2059
+ });
2060
+ }
2061
+ },
2062
+
2063
+ // Stand-alone quarter
2064
+ q: function (date, token, localize) {
2065
+ const quarter = Math.ceil((date.getMonth() + 1) / 3);
2066
+ switch (token) {
2067
+ // 1, 2, 3, 4
2068
+ case "q":
2069
+ return String(quarter);
2070
+ // 01, 02, 03, 04
2071
+ case "qq":
2072
+ return (0, _index6.addLeadingZeros)(quarter, 2);
2073
+ // 1st, 2nd, 3rd, 4th
2074
+ case "qo":
2075
+ return localize.ordinalNumber(quarter, { unit: "quarter" });
2076
+ // Q1, Q2, Q3, Q4
2077
+ case "qqq":
2078
+ return localize.quarter(quarter, {
2079
+ width: "abbreviated",
2080
+ context: "standalone",
2081
+ });
2082
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
2083
+ case "qqqqq":
2084
+ return localize.quarter(quarter, {
2085
+ width: "narrow",
2086
+ context: "standalone",
2087
+ });
2088
+ // 1st quarter, 2nd quarter, ...
2089
+ case "qqqq":
2090
+ default:
2091
+ return localize.quarter(quarter, {
2092
+ width: "wide",
2093
+ context: "standalone",
2094
+ });
2095
+ }
2096
+ },
2097
+
2098
+ // Month
2099
+ M: function (date, token, localize) {
2100
+ const month = date.getMonth();
2101
+ switch (token) {
2102
+ case "M":
2103
+ case "MM":
2104
+ return _index7.lightFormatters.M(date, token);
2105
+ // 1st, 2nd, ..., 12th
2106
+ case "Mo":
2107
+ return localize.ordinalNumber(month + 1, { unit: "month" });
2108
+ // Jan, Feb, ..., Dec
2109
+ case "MMM":
2110
+ return localize.month(month, {
2111
+ width: "abbreviated",
2112
+ context: "formatting",
2113
+ });
2114
+ // J, F, ..., D
2115
+ case "MMMMM":
2116
+ return localize.month(month, {
2117
+ width: "narrow",
2118
+ context: "formatting",
2119
+ });
2120
+ // January, February, ..., December
2121
+ case "MMMM":
2122
+ default:
2123
+ return localize.month(month, { width: "wide", context: "formatting" });
2124
+ }
2125
+ },
2126
+
2127
+ // Stand-alone month
2128
+ L: function (date, token, localize) {
2129
+ const month = date.getMonth();
2130
+ switch (token) {
2131
+ // 1, 2, ..., 12
2132
+ case "L":
2133
+ return String(month + 1);
2134
+ // 01, 02, ..., 12
2135
+ case "LL":
2136
+ return (0, _index6.addLeadingZeros)(month + 1, 2);
2137
+ // 1st, 2nd, ..., 12th
2138
+ case "Lo":
2139
+ return localize.ordinalNumber(month + 1, { unit: "month" });
2140
+ // Jan, Feb, ..., Dec
2141
+ case "LLL":
2142
+ return localize.month(month, {
2143
+ width: "abbreviated",
2144
+ context: "standalone",
2145
+ });
2146
+ // J, F, ..., D
2147
+ case "LLLLL":
2148
+ return localize.month(month, {
2149
+ width: "narrow",
2150
+ context: "standalone",
2151
+ });
2152
+ // January, February, ..., December
2153
+ case "LLLL":
2154
+ default:
2155
+ return localize.month(month, { width: "wide", context: "standalone" });
2156
+ }
2157
+ },
2158
+
2159
+ // Local week of year
2160
+ w: function (date, token, localize, options) {
2161
+ const week = (0, _index4.getWeek)(date, options);
2162
+
2163
+ if (token === "wo") {
2164
+ return localize.ordinalNumber(week, { unit: "week" });
2165
+ }
2166
+
2167
+ return (0, _index6.addLeadingZeros)(week, token.length);
2168
+ },
2169
+
2170
+ // ISO week of year
2171
+ I: function (date, token, localize) {
2172
+ const isoWeek = (0, _index2.getISOWeek)(date);
2173
+
2174
+ if (token === "Io") {
2175
+ return localize.ordinalNumber(isoWeek, { unit: "week" });
2176
+ }
2177
+
2178
+ return (0, _index6.addLeadingZeros)(isoWeek, token.length);
2179
+ },
2180
+
2181
+ // Day of the month
2182
+ d: function (date, token, localize) {
2183
+ if (token === "do") {
2184
+ return localize.ordinalNumber(date.getDate(), { unit: "date" });
2185
+ }
2186
+
2187
+ return _index7.lightFormatters.d(date, token);
2188
+ },
2189
+
2190
+ // Day of year
2191
+ D: function (date, token, localize) {
2192
+ const dayOfYear = (0, _index.getDayOfYear)(date);
2193
+
2194
+ if (token === "Do") {
2195
+ return localize.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
2196
+ }
2197
+
2198
+ return (0, _index6.addLeadingZeros)(dayOfYear, token.length);
2199
+ },
2200
+
2201
+ // Day of week
2202
+ E: function (date, token, localize) {
2203
+ const dayOfWeek = date.getDay();
2204
+ switch (token) {
2205
+ // Tue
2206
+ case "E":
2207
+ case "EE":
2208
+ case "EEE":
2209
+ return localize.day(dayOfWeek, {
2210
+ width: "abbreviated",
2211
+ context: "formatting",
2212
+ });
2213
+ // T
2214
+ case "EEEEE":
2215
+ return localize.day(dayOfWeek, {
2216
+ width: "narrow",
2217
+ context: "formatting",
2218
+ });
2219
+ // Tu
2220
+ case "EEEEEE":
2221
+ return localize.day(dayOfWeek, {
2222
+ width: "short",
2223
+ context: "formatting",
2224
+ });
2225
+ // Tuesday
2226
+ case "EEEE":
2227
+ default:
2228
+ return localize.day(dayOfWeek, {
2229
+ width: "wide",
2230
+ context: "formatting",
2231
+ });
2232
+ }
2233
+ },
2234
+
2235
+ // Local day of week
2236
+ e: function (date, token, localize, options) {
2237
+ const dayOfWeek = date.getDay();
2238
+ const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
2239
+ switch (token) {
2240
+ // Numerical value (Nth day of week with current locale or weekStartsOn)
2241
+ case "e":
2242
+ return String(localDayOfWeek);
2243
+ // Padded numerical value
2244
+ case "ee":
2245
+ return (0, _index6.addLeadingZeros)(localDayOfWeek, 2);
2246
+ // 1st, 2nd, ..., 7th
2247
+ case "eo":
2248
+ return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
2249
+ case "eee":
2250
+ return localize.day(dayOfWeek, {
2251
+ width: "abbreviated",
2252
+ context: "formatting",
2253
+ });
2254
+ // T
2255
+ case "eeeee":
2256
+ return localize.day(dayOfWeek, {
2257
+ width: "narrow",
2258
+ context: "formatting",
2259
+ });
2260
+ // Tu
2261
+ case "eeeeee":
2262
+ return localize.day(dayOfWeek, {
2263
+ width: "short",
2264
+ context: "formatting",
2265
+ });
2266
+ // Tuesday
2267
+ case "eeee":
2268
+ default:
2269
+ return localize.day(dayOfWeek, {
2270
+ width: "wide",
2271
+ context: "formatting",
2272
+ });
2273
+ }
2274
+ },
2275
+
2276
+ // Stand-alone local day of week
2277
+ c: function (date, token, localize, options) {
2278
+ const dayOfWeek = date.getDay();
2279
+ const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
2280
+ switch (token) {
2281
+ // Numerical value (same as in `e`)
2282
+ case "c":
2283
+ return String(localDayOfWeek);
2284
+ // Padded numerical value
2285
+ case "cc":
2286
+ return (0, _index6.addLeadingZeros)(localDayOfWeek, token.length);
2287
+ // 1st, 2nd, ..., 7th
2288
+ case "co":
2289
+ return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
2290
+ case "ccc":
2291
+ return localize.day(dayOfWeek, {
2292
+ width: "abbreviated",
2293
+ context: "standalone",
2294
+ });
2295
+ // T
2296
+ case "ccccc":
2297
+ return localize.day(dayOfWeek, {
2298
+ width: "narrow",
2299
+ context: "standalone",
2300
+ });
2301
+ // Tu
2302
+ case "cccccc":
2303
+ return localize.day(dayOfWeek, {
2304
+ width: "short",
2305
+ context: "standalone",
2306
+ });
2307
+ // Tuesday
2308
+ case "cccc":
2309
+ default:
2310
+ return localize.day(dayOfWeek, {
2311
+ width: "wide",
2312
+ context: "standalone",
2313
+ });
2314
+ }
2315
+ },
2316
+
2317
+ // ISO day of week
2318
+ i: function (date, token, localize) {
2319
+ const dayOfWeek = date.getDay();
2320
+ const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
2321
+ switch (token) {
2322
+ // 2
2323
+ case "i":
2324
+ return String(isoDayOfWeek);
2325
+ // 02
2326
+ case "ii":
2327
+ return (0, _index6.addLeadingZeros)(isoDayOfWeek, token.length);
2328
+ // 2nd
2329
+ case "io":
2330
+ return localize.ordinalNumber(isoDayOfWeek, { unit: "day" });
2331
+ // Tue
2332
+ case "iii":
2333
+ return localize.day(dayOfWeek, {
2334
+ width: "abbreviated",
2335
+ context: "formatting",
2336
+ });
2337
+ // T
2338
+ case "iiiii":
2339
+ return localize.day(dayOfWeek, {
2340
+ width: "narrow",
2341
+ context: "formatting",
2342
+ });
2343
+ // Tu
2344
+ case "iiiiii":
2345
+ return localize.day(dayOfWeek, {
2346
+ width: "short",
2347
+ context: "formatting",
2348
+ });
2349
+ // Tuesday
2350
+ case "iiii":
2351
+ default:
2352
+ return localize.day(dayOfWeek, {
2353
+ width: "wide",
2354
+ context: "formatting",
2355
+ });
2356
+ }
2357
+ },
2358
+
2359
+ // AM or PM
2360
+ a: function (date, token, localize) {
2361
+ const hours = date.getHours();
2362
+ const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
2363
+
2364
+ switch (token) {
2365
+ case "a":
2366
+ case "aa":
2367
+ return localize.dayPeriod(dayPeriodEnumValue, {
2368
+ width: "abbreviated",
2369
+ context: "formatting",
2370
+ });
2371
+ case "aaa":
2372
+ return localize
2373
+ .dayPeriod(dayPeriodEnumValue, {
2374
+ width: "abbreviated",
2375
+ context: "formatting",
2376
+ })
2377
+ .toLowerCase();
2378
+ case "aaaaa":
2379
+ return localize.dayPeriod(dayPeriodEnumValue, {
2380
+ width: "narrow",
2381
+ context: "formatting",
2382
+ });
2383
+ case "aaaa":
2384
+ default:
2385
+ return localize.dayPeriod(dayPeriodEnumValue, {
2386
+ width: "wide",
2387
+ context: "formatting",
2388
+ });
2389
+ }
2390
+ },
2391
+
2392
+ // AM, PM, midnight, noon
2393
+ b: function (date, token, localize) {
2394
+ const hours = date.getHours();
2395
+ let dayPeriodEnumValue;
2396
+ if (hours === 12) {
2397
+ dayPeriodEnumValue = dayPeriodEnum.noon;
2398
+ } else if (hours === 0) {
2399
+ dayPeriodEnumValue = dayPeriodEnum.midnight;
2400
+ } else {
2401
+ dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
2402
+ }
2403
+
2404
+ switch (token) {
2405
+ case "b":
2406
+ case "bb":
2407
+ return localize.dayPeriod(dayPeriodEnumValue, {
2408
+ width: "abbreviated",
2409
+ context: "formatting",
2410
+ });
2411
+ case "bbb":
2412
+ return localize
2413
+ .dayPeriod(dayPeriodEnumValue, {
2414
+ width: "abbreviated",
2415
+ context: "formatting",
2416
+ })
2417
+ .toLowerCase();
2418
+ case "bbbbb":
2419
+ return localize.dayPeriod(dayPeriodEnumValue, {
2420
+ width: "narrow",
2421
+ context: "formatting",
2422
+ });
2423
+ case "bbbb":
2424
+ default:
2425
+ return localize.dayPeriod(dayPeriodEnumValue, {
2426
+ width: "wide",
2427
+ context: "formatting",
2428
+ });
2429
+ }
2430
+ },
2431
+
2432
+ // in the morning, in the afternoon, in the evening, at night
2433
+ B: function (date, token, localize) {
2434
+ const hours = date.getHours();
2435
+ let dayPeriodEnumValue;
2436
+ if (hours >= 17) {
2437
+ dayPeriodEnumValue = dayPeriodEnum.evening;
2438
+ } else if (hours >= 12) {
2439
+ dayPeriodEnumValue = dayPeriodEnum.afternoon;
2440
+ } else if (hours >= 4) {
2441
+ dayPeriodEnumValue = dayPeriodEnum.morning;
2442
+ } else {
2443
+ dayPeriodEnumValue = dayPeriodEnum.night;
2444
+ }
2445
+
2446
+ switch (token) {
2447
+ case "B":
2448
+ case "BB":
2449
+ case "BBB":
2450
+ return localize.dayPeriod(dayPeriodEnumValue, {
2451
+ width: "abbreviated",
2452
+ context: "formatting",
2453
+ });
2454
+ case "BBBBB":
2455
+ return localize.dayPeriod(dayPeriodEnumValue, {
2456
+ width: "narrow",
2457
+ context: "formatting",
2458
+ });
2459
+ case "BBBB":
2460
+ default:
2461
+ return localize.dayPeriod(dayPeriodEnumValue, {
2462
+ width: "wide",
2463
+ context: "formatting",
2464
+ });
2465
+ }
2466
+ },
2467
+
2468
+ // Hour [1-12]
2469
+ h: function (date, token, localize) {
2470
+ if (token === "ho") {
2471
+ let hours = date.getHours() % 12;
2472
+ if (hours === 0) hours = 12;
2473
+ return localize.ordinalNumber(hours, { unit: "hour" });
2474
+ }
2475
+
2476
+ return _index7.lightFormatters.h(date, token);
2477
+ },
2478
+
2479
+ // Hour [0-23]
2480
+ H: function (date, token, localize) {
2481
+ if (token === "Ho") {
2482
+ return localize.ordinalNumber(date.getHours(), { unit: "hour" });
2483
+ }
2484
+
2485
+ return _index7.lightFormatters.H(date, token);
2486
+ },
2487
+
2488
+ // Hour [0-11]
2489
+ K: function (date, token, localize) {
2490
+ const hours = date.getHours() % 12;
2491
+
2492
+ if (token === "Ko") {
2493
+ return localize.ordinalNumber(hours, { unit: "hour" });
2494
+ }
2495
+
2496
+ return (0, _index6.addLeadingZeros)(hours, token.length);
2497
+ },
2498
+
2499
+ // Hour [1-24]
2500
+ k: function (date, token, localize) {
2501
+ let hours = date.getHours();
2502
+ if (hours === 0) hours = 24;
2503
+
2504
+ if (token === "ko") {
2505
+ return localize.ordinalNumber(hours, { unit: "hour" });
2506
+ }
2507
+
2508
+ return (0, _index6.addLeadingZeros)(hours, token.length);
2509
+ },
2510
+
2511
+ // Minute
2512
+ m: function (date, token, localize) {
2513
+ if (token === "mo") {
2514
+ return localize.ordinalNumber(date.getMinutes(), { unit: "minute" });
2515
+ }
2516
+
2517
+ return _index7.lightFormatters.m(date, token);
2518
+ },
2519
+
2520
+ // Second
2521
+ s: function (date, token, localize) {
2522
+ if (token === "so") {
2523
+ return localize.ordinalNumber(date.getSeconds(), { unit: "second" });
2524
+ }
2525
+
2526
+ return _index7.lightFormatters.s(date, token);
2527
+ },
2528
+
2529
+ // Fraction of second
2530
+ S: function (date, token) {
2531
+ return _index7.lightFormatters.S(date, token);
2532
+ },
2533
+
2534
+ // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
2535
+ X: function (date, token, _localize) {
2536
+ const timezoneOffset = date.getTimezoneOffset();
2537
+
2538
+ if (timezoneOffset === 0) {
2539
+ return "Z";
2540
+ }
2541
+
2542
+ switch (token) {
2543
+ // Hours and optional minutes
2544
+ case "X":
2545
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
2546
+
2547
+ // Hours, minutes and optional seconds without `:` delimiter
2548
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
2549
+ // so this token always has the same output as `XX`
2550
+ case "XXXX":
2551
+ case "XX": // Hours and minutes without `:` delimiter
2552
+ return formatTimezone(timezoneOffset);
2553
+
2554
+ // Hours, minutes and optional seconds with `:` delimiter
2555
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
2556
+ // so this token always has the same output as `XXX`
2557
+ case "XXXXX":
2558
+ case "XXX": // Hours and minutes with `:` delimiter
2559
+ default:
2560
+ return formatTimezone(timezoneOffset, ":");
2561
+ }
2562
+ },
2563
+
2564
+ // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
2565
+ x: function (date, token, _localize) {
2566
+ const timezoneOffset = date.getTimezoneOffset();
2567
+
2568
+ switch (token) {
2569
+ // Hours and optional minutes
2570
+ case "x":
2571
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
2572
+
2573
+ // Hours, minutes and optional seconds without `:` delimiter
2574
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
2575
+ // so this token always has the same output as `xx`
2576
+ case "xxxx":
2577
+ case "xx": // Hours and minutes without `:` delimiter
2578
+ return formatTimezone(timezoneOffset);
2579
+
2580
+ // Hours, minutes and optional seconds with `:` delimiter
2581
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
2582
+ // so this token always has the same output as `xxx`
2583
+ case "xxxxx":
2584
+ case "xxx": // Hours and minutes with `:` delimiter
2585
+ default:
2586
+ return formatTimezone(timezoneOffset, ":");
2587
+ }
2588
+ },
2589
+
2590
+ // Timezone (GMT)
2591
+ O: function (date, token, _localize) {
2592
+ const timezoneOffset = date.getTimezoneOffset();
2593
+
2594
+ switch (token) {
2595
+ // Short
2596
+ case "O":
2597
+ case "OO":
2598
+ case "OOO":
2599
+ return "GMT" + formatTimezoneShort(timezoneOffset, ":");
2600
+ // Long
2601
+ case "OOOO":
2602
+ default:
2603
+ return "GMT" + formatTimezone(timezoneOffset, ":");
2604
+ }
2605
+ },
2606
+
2607
+ // Timezone (specific non-location)
2608
+ z: function (date, token, _localize) {
2609
+ const timezoneOffset = date.getTimezoneOffset();
2610
+
2611
+ switch (token) {
2612
+ // Short
2613
+ case "z":
2614
+ case "zz":
2615
+ case "zzz":
2616
+ return "GMT" + formatTimezoneShort(timezoneOffset, ":");
2617
+ // Long
2618
+ case "zzzz":
2619
+ default:
2620
+ return "GMT" + formatTimezone(timezoneOffset, ":");
2621
+ }
2622
+ },
2623
+
2624
+ // Seconds timestamp
2625
+ t: function (date, token, _localize) {
2626
+ const timestamp = Math.trunc(date.getTime() / 1000);
2627
+ return (0, _index6.addLeadingZeros)(timestamp, token.length);
2628
+ },
2629
+
2630
+ // Milliseconds timestamp
2631
+ T: function (date, token, _localize) {
2632
+ const timestamp = date.getTime();
2633
+ return (0, _index6.addLeadingZeros)(timestamp, token.length);
2634
+ },
2635
+ });
2636
+
2637
+ function formatTimezoneShort(offset, delimiter = "") {
2638
+ const sign = offset > 0 ? "-" : "+";
2639
+ const absOffset = Math.abs(offset);
2640
+ const hours = Math.trunc(absOffset / 60);
2641
+ const minutes = absOffset % 60;
2642
+ if (minutes === 0) {
2643
+ return sign + String(hours);
2644
+ }
2645
+ return (
2646
+ sign + String(hours) + delimiter + (0, _index6.addLeadingZeros)(minutes, 2)
2647
+ );
2648
+ }
2649
+
2650
+ function formatTimezoneWithOptionalMinutes(offset, delimiter) {
2651
+ if (offset % 60 === 0) {
2652
+ const sign = offset > 0 ? "-" : "+";
2653
+ return sign + (0, _index6.addLeadingZeros)(Math.abs(offset) / 60, 2);
2654
+ }
2655
+ return formatTimezone(offset, delimiter);
2656
+ }
2657
+
2658
+ function formatTimezone(offset, delimiter = "") {
2659
+ const sign = offset > 0 ? "-" : "+";
2660
+ const absOffset = Math.abs(offset);
2661
+ const hours = (0, _index6.addLeadingZeros)(Math.trunc(absOffset / 60), 2);
2662
+ const minutes = (0, _index6.addLeadingZeros)(absOffset % 60, 2);
2663
+ return sign + hours + delimiter + minutes;
2664
+ }
2665
+
2666
+ var longFormatters = {};
2667
+
2668
+ longFormatters.longFormatters = void 0;
2669
+
2670
+ const dateLongFormatter = (pattern, formatLong) => {
2671
+ switch (pattern) {
2672
+ case "P":
2673
+ return formatLong.date({ width: "short" });
2674
+ case "PP":
2675
+ return formatLong.date({ width: "medium" });
2676
+ case "PPP":
2677
+ return formatLong.date({ width: "long" });
2678
+ case "PPPP":
2679
+ default:
2680
+ return formatLong.date({ width: "full" });
2681
+ }
2682
+ };
2683
+
2684
+ const timeLongFormatter = (pattern, formatLong) => {
2685
+ switch (pattern) {
2686
+ case "p":
2687
+ return formatLong.time({ width: "short" });
2688
+ case "pp":
2689
+ return formatLong.time({ width: "medium" });
2690
+ case "ppp":
2691
+ return formatLong.time({ width: "long" });
2692
+ case "pppp":
2693
+ default:
2694
+ return formatLong.time({ width: "full" });
2695
+ }
2696
+ };
2697
+
2698
+ const dateTimeLongFormatter = (pattern, formatLong) => {
2699
+ const matchResult = pattern.match(/(P+)(p+)?/) || [];
2700
+ const datePattern = matchResult[1];
2701
+ const timePattern = matchResult[2];
2702
+
2703
+ if (!timePattern) {
2704
+ return dateLongFormatter(pattern, formatLong);
2705
+ }
2706
+
2707
+ let dateTimeFormat;
2708
+
2709
+ switch (datePattern) {
2710
+ case "P":
2711
+ dateTimeFormat = formatLong.dateTime({ width: "short" });
2712
+ break;
2713
+ case "PP":
2714
+ dateTimeFormat = formatLong.dateTime({ width: "medium" });
2715
+ break;
2716
+ case "PPP":
2717
+ dateTimeFormat = formatLong.dateTime({ width: "long" });
2718
+ break;
2719
+ case "PPPP":
2720
+ default:
2721
+ dateTimeFormat = formatLong.dateTime({ width: "full" });
2722
+ break;
2723
+ }
2724
+
2725
+ return dateTimeFormat
2726
+ .replace("{{date}}", dateLongFormatter(datePattern, formatLong))
2727
+ .replace("{{time}}", timeLongFormatter(timePattern, formatLong));
2728
+ };
2729
+
2730
+ (longFormatters.longFormatters = {
2731
+ p: timeLongFormatter,
2732
+ P: dateTimeLongFormatter,
2733
+ });
2734
+
2735
+ var protectedTokens = {};
2736
+
2737
+ protectedTokens.isProtectedDayOfYearToken = isProtectedDayOfYearToken;
2738
+ protectedTokens.isProtectedWeekYearToken = isProtectedWeekYearToken;
2739
+ protectedTokens.warnOrThrowProtectedError = warnOrThrowProtectedError;
2740
+ const dayOfYearTokenRE = /^D+$/;
2741
+ const weekYearTokenRE = /^Y+$/;
2742
+
2743
+ const throwTokens = ["D", "DD", "YY", "YYYY"];
2744
+
2745
+ function isProtectedDayOfYearToken(token) {
2746
+ return dayOfYearTokenRE.test(token);
2747
+ }
2748
+
2749
+ function isProtectedWeekYearToken(token) {
2750
+ return weekYearTokenRE.test(token);
2751
+ }
2752
+
2753
+ function warnOrThrowProtectedError(token, format, input) {
2754
+ const _message = message(token, format, input);
2755
+ console.warn(_message);
2756
+ if (throwTokens.includes(token)) throw new RangeError(_message);
2757
+ }
2758
+
2759
+ function message(token, format, input) {
2760
+ const subject = token[0] === "Y" ? "years" : "days of the month";
2761
+ return `Use \`${token.toLowerCase()}\` instead of \`${token}\` (in \`${format}\`) for formatting ${subject} to the input \`${input}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
2762
+ }
2763
+
2764
+ (function (exports) {
2765
+ exports.format = exports.formatDate = format;
2766
+ Object.defineProperty(exports, "formatters", {
2767
+ enumerable: true,
2768
+ get: function () {
2769
+ return _index3.formatters;
2770
+ },
2771
+ });
2772
+ Object.defineProperty(exports, "longFormatters", {
2773
+ enumerable: true,
2774
+ get: function () {
2775
+ return _index4.longFormatters;
2776
+ },
2777
+ });
2778
+ var _index = defaultLocale;
2779
+ var _index2 = defaultOptions$1;
2780
+ var _index3 = formatters;
2781
+ var _index4 = longFormatters;
2782
+ var _index5 = protectedTokens;
2783
+
2784
+ var _index6 = isValid$1;
2785
+ var _index7 = toDate$1;
2786
+
2787
+ // Rexports of internal for libraries to use.
2788
+ // See: https://github.com/date-fns/date-fns/issues/3638#issuecomment-1877082874
2789
+
2790
+ // This RegExp consists of three parts separated by `|`:
2791
+ // - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
2792
+ // (one of the certain letters followed by `o`)
2793
+ // - (\w)\1* matches any sequences of the same letter
2794
+ // - '' matches two quote characters in a row
2795
+ // - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
2796
+ // except a single quote symbol, which ends the sequence.
2797
+ // Two quote characters do not end the sequence.
2798
+ // If there is no matching single quote
2799
+ // then the sequence will continue until the end of the string.
2800
+ // - . matches any single character unmatched by previous parts of the RegExps
2801
+ const formattingTokensRegExp =
2802
+ /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
2803
+
2804
+ // This RegExp catches symbols escaped by quotes, and also
2805
+ // sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
2806
+ const longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
2807
+
2808
+ const escapedStringRegExp = /^'([^]*?)'?$/;
2809
+ const doubleQuoteRegExp = /''/g;
2810
+ const unescapedLatinCharacterRegExp = /[a-zA-Z]/;
2811
+
2812
+ /**
2813
+ * The {@link format} function options.
2814
+ */
2815
+
2816
+ /**
2817
+ * @name format
2818
+ * @alias formatDate
2819
+ * @category Common Helpers
2820
+ * @summary Format the date.
2821
+ *
2822
+ * @description
2823
+ * Return the formatted date string in the given format. The result may vary by locale.
2824
+ *
2825
+ * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
2826
+ * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2827
+ *
2828
+ * The characters wrapped between two single quotes characters (') are escaped.
2829
+ * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
2830
+ * (see the last example)
2831
+ *
2832
+ * Format of the string is based on Unicode Technical Standard #35:
2833
+ * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
2834
+ * with a few additions (see note 7 below the table).
2835
+ *
2836
+ * Accepted patterns:
2837
+ * | Unit | Pattern | Result examples | Notes |
2838
+ * |---------------------------------|---------|-----------------------------------|-------|
2839
+ * | Era | G..GGG | AD, BC | |
2840
+ * | | GGGG | Anno Domini, Before Christ | 2 |
2841
+ * | | GGGGG | A, B | |
2842
+ * | Calendar year | y | 44, 1, 1900, 2017 | 5 |
2843
+ * | | yo | 44th, 1st, 0th, 17th | 5,7 |
2844
+ * | | yy | 44, 01, 00, 17 | 5 |
2845
+ * | | yyy | 044, 001, 1900, 2017 | 5 |
2846
+ * | | yyyy | 0044, 0001, 1900, 2017 | 5 |
2847
+ * | | yyyyy | ... | 3,5 |
2848
+ * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |
2849
+ * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |
2850
+ * | | YY | 44, 01, 00, 17 | 5,8 |
2851
+ * | | YYY | 044, 001, 1900, 2017 | 5 |
2852
+ * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |
2853
+ * | | YYYYY | ... | 3,5 |
2854
+ * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |
2855
+ * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |
2856
+ * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |
2857
+ * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |
2858
+ * | | RRRRR | ... | 3,5,7 |
2859
+ * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |
2860
+ * | | uu | -43, 01, 1900, 2017 | 5 |
2861
+ * | | uuu | -043, 001, 1900, 2017 | 5 |
2862
+ * | | uuuu | -0043, 0001, 1900, 2017 | 5 |
2863
+ * | | uuuuu | ... | 3,5 |
2864
+ * | Quarter (formatting) | Q | 1, 2, 3, 4 | |
2865
+ * | | Qo | 1st, 2nd, 3rd, 4th | 7 |
2866
+ * | | QQ | 01, 02, 03, 04 | |
2867
+ * | | QQQ | Q1, Q2, Q3, Q4 | |
2868
+ * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
2869
+ * | | QQQQQ | 1, 2, 3, 4 | 4 |
2870
+ * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |
2871
+ * | | qo | 1st, 2nd, 3rd, 4th | 7 |
2872
+ * | | qq | 01, 02, 03, 04 | |
2873
+ * | | qqq | Q1, Q2, Q3, Q4 | |
2874
+ * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
2875
+ * | | qqqqq | 1, 2, 3, 4 | 4 |
2876
+ * | Month (formatting) | M | 1, 2, ..., 12 | |
2877
+ * | | Mo | 1st, 2nd, ..., 12th | 7 |
2878
+ * | | MM | 01, 02, ..., 12 | |
2879
+ * | | MMM | Jan, Feb, ..., Dec | |
2880
+ * | | MMMM | January, February, ..., December | 2 |
2881
+ * | | MMMMM | J, F, ..., D | |
2882
+ * | Month (stand-alone) | L | 1, 2, ..., 12 | |
2883
+ * | | Lo | 1st, 2nd, ..., 12th | 7 |
2884
+ * | | LL | 01, 02, ..., 12 | |
2885
+ * | | LLL | Jan, Feb, ..., Dec | |
2886
+ * | | LLLL | January, February, ..., December | 2 |
2887
+ * | | LLLLL | J, F, ..., D | |
2888
+ * | Local week of year | w | 1, 2, ..., 53 | |
2889
+ * | | wo | 1st, 2nd, ..., 53th | 7 |
2890
+ * | | ww | 01, 02, ..., 53 | |
2891
+ * | ISO week of year | I | 1, 2, ..., 53 | 7 |
2892
+ * | | Io | 1st, 2nd, ..., 53th | 7 |
2893
+ * | | II | 01, 02, ..., 53 | 7 |
2894
+ * | Day of month | d | 1, 2, ..., 31 | |
2895
+ * | | do | 1st, 2nd, ..., 31st | 7 |
2896
+ * | | dd | 01, 02, ..., 31 | |
2897
+ * | Day of year | D | 1, 2, ..., 365, 366 | 9 |
2898
+ * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |
2899
+ * | | DD | 01, 02, ..., 365, 366 | 9 |
2900
+ * | | DDD | 001, 002, ..., 365, 366 | |
2901
+ * | | DDDD | ... | 3 |
2902
+ * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
2903
+ * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
2904
+ * | | EEEEE | M, T, W, T, F, S, S | |
2905
+ * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
2906
+ * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
2907
+ * | | io | 1st, 2nd, ..., 7th | 7 |
2908
+ * | | ii | 01, 02, ..., 07 | 7 |
2909
+ * | | iii | Mon, Tue, Wed, ..., Sun | 7 |
2910
+ * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
2911
+ * | | iiiii | M, T, W, T, F, S, S | 7 |
2912
+ * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
2913
+ * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
2914
+ * | | eo | 2nd, 3rd, ..., 1st | 7 |
2915
+ * | | ee | 02, 03, ..., 01 | |
2916
+ * | | eee | Mon, Tue, Wed, ..., Sun | |
2917
+ * | | eeee | Monday, Tuesday, ..., Sunday | 2 |
2918
+ * | | eeeee | M, T, W, T, F, S, S | |
2919
+ * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
2920
+ * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
2921
+ * | | co | 2nd, 3rd, ..., 1st | 7 |
2922
+ * | | cc | 02, 03, ..., 01 | |
2923
+ * | | ccc | Mon, Tue, Wed, ..., Sun | |
2924
+ * | | cccc | Monday, Tuesday, ..., Sunday | 2 |
2925
+ * | | ccccc | M, T, W, T, F, S, S | |
2926
+ * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
2927
+ * | AM, PM | a..aa | AM, PM | |
2928
+ * | | aaa | am, pm | |
2929
+ * | | aaaa | a.m., p.m. | 2 |
2930
+ * | | aaaaa | a, p | |
2931
+ * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
2932
+ * | | bbb | am, pm, noon, midnight | |
2933
+ * | | bbbb | a.m., p.m., noon, midnight | 2 |
2934
+ * | | bbbbb | a, p, n, mi | |
2935
+ * | Flexible day period | B..BBB | at night, in the morning, ... | |
2936
+ * | | BBBB | at night, in the morning, ... | 2 |
2937
+ * | | BBBBB | at night, in the morning, ... | |
2938
+ * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |
2939
+ * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |
2940
+ * | | hh | 01, 02, ..., 11, 12 | |
2941
+ * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |
2942
+ * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |
2943
+ * | | HH | 00, 01, 02, ..., 23 | |
2944
+ * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |
2945
+ * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |
2946
+ * | | KK | 01, 02, ..., 11, 00 | |
2947
+ * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |
2948
+ * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |
2949
+ * | | kk | 24, 01, 02, ..., 23 | |
2950
+ * | Minute | m | 0, 1, ..., 59 | |
2951
+ * | | mo | 0th, 1st, ..., 59th | 7 |
2952
+ * | | mm | 00, 01, ..., 59 | |
2953
+ * | Second | s | 0, 1, ..., 59 | |
2954
+ * | | so | 0th, 1st, ..., 59th | 7 |
2955
+ * | | ss | 00, 01, ..., 59 | |
2956
+ * | Fraction of second | S | 0, 1, ..., 9 | |
2957
+ * | | SS | 00, 01, ..., 99 | |
2958
+ * | | SSS | 000, 001, ..., 999 | |
2959
+ * | | SSSS | ... | 3 |
2960
+ * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
2961
+ * | | XX | -0800, +0530, Z | |
2962
+ * | | XXX | -08:00, +05:30, Z | |
2963
+ * | | XXXX | -0800, +0530, Z, +123456 | 2 |
2964
+ * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
2965
+ * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |
2966
+ * | | xx | -0800, +0530, +0000 | |
2967
+ * | | xxx | -08:00, +05:30, +00:00 | 2 |
2968
+ * | | xxxx | -0800, +0530, +0000, +123456 | |
2969
+ * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
2970
+ * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |
2971
+ * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |
2972
+ * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |
2973
+ * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |
2974
+ * | Seconds timestamp | t | 512969520 | 7 |
2975
+ * | | tt | ... | 3,7 |
2976
+ * | Milliseconds timestamp | T | 512969520900 | 7 |
2977
+ * | | TT | ... | 3,7 |
2978
+ * | Long localized date | P | 04/29/1453 | 7 |
2979
+ * | | PP | Apr 29, 1453 | 7 |
2980
+ * | | PPP | April 29th, 1453 | 7 |
2981
+ * | | PPPP | Friday, April 29th, 1453 | 2,7 |
2982
+ * | Long localized time | p | 12:00 AM | 7 |
2983
+ * | | pp | 12:00:00 AM | 7 |
2984
+ * | | ppp | 12:00:00 AM GMT+2 | 7 |
2985
+ * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
2986
+ * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
2987
+ * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
2988
+ * | | PPPppp | April 29th, 1453 at ... | 7 |
2989
+ * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
2990
+ * Notes:
2991
+ * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
2992
+ * are the same as "stand-alone" units, but are different in some languages.
2993
+ * "Formatting" units are declined according to the rules of the language
2994
+ * in the context of a date. "Stand-alone" units are always nominative singular:
2995
+ *
2996
+ * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
2997
+ *
2998
+ * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
2999
+ *
3000
+ * 2. Any sequence of the identical letters is a pattern, unless it is escaped by
3001
+ * the single quote characters (see below).
3002
+ * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
3003
+ * the output will be the same as default pattern for this unit, usually
3004
+ * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
3005
+ * are marked with "2" in the last column of the table.
3006
+ *
3007
+ * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
3008
+ *
3009
+ * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
3010
+ *
3011
+ * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
3012
+ *
3013
+ * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
3014
+ *
3015
+ * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
3016
+ *
3017
+ * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
3018
+ * The output will be padded with zeros to match the length of the pattern.
3019
+ *
3020
+ * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
3021
+ *
3022
+ * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
3023
+ * These tokens represent the shortest form of the quarter.
3024
+ *
3025
+ * 5. The main difference between `y` and `u` patterns are B.C. years:
3026
+ *
3027
+ * | Year | `y` | `u` |
3028
+ * |------|-----|-----|
3029
+ * | AC 1 | 1 | 1 |
3030
+ * | BC 1 | 1 | 0 |
3031
+ * | BC 2 | 2 | -1 |
3032
+ *
3033
+ * Also `yy` always returns the last two digits of a year,
3034
+ * while `uu` pads single digit years to 2 characters and returns other years unchanged:
3035
+ *
3036
+ * | Year | `yy` | `uu` |
3037
+ * |------|------|------|
3038
+ * | 1 | 01 | 01 |
3039
+ * | 14 | 14 | 14 |
3040
+ * | 376 | 76 | 376 |
3041
+ * | 1453 | 53 | 1453 |
3042
+ *
3043
+ * The same difference is true for local and ISO week-numbering years (`Y` and `R`),
3044
+ * except local week-numbering years are dependent on `options.weekStartsOn`
3045
+ * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)
3046
+ * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).
3047
+ *
3048
+ * 6. Specific non-location timezones are currently unavailable in `date-fns`,
3049
+ * so right now these tokens fall back to GMT timezones.
3050
+ *
3051
+ * 7. These patterns are not in the Unicode Technical Standard #35:
3052
+ * - `i`: ISO day of week
3053
+ * - `I`: ISO week of year
3054
+ * - `R`: ISO week-numbering year
3055
+ * - `t`: seconds timestamp
3056
+ * - `T`: milliseconds timestamp
3057
+ * - `o`: ordinal number modifier
3058
+ * - `P`: long localized date
3059
+ * - `p`: long localized time
3060
+ *
3061
+ * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
3062
+ * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
3063
+ *
3064
+ * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
3065
+ * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
3066
+ *
3067
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
3068
+ *
3069
+ * @param date - The original date
3070
+ * @param format - The string of tokens
3071
+ * @param options - An object with options
3072
+ *
3073
+ * @returns The formatted date string
3074
+ *
3075
+ * @throws `date` must not be Invalid Date
3076
+ * @throws `options.locale` must contain `localize` property
3077
+ * @throws `options.locale` must contain `formatLong` property
3078
+ * @throws 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
3079
+ * @throws 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
3080
+ * @throws 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
3081
+ * @throws 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
3082
+ * @throws format string contains an unescaped latin alphabet character
3083
+ *
3084
+ * @example
3085
+ * // Represent 11 February 2014 in middle-endian format:
3086
+ * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
3087
+ * //=> '02/11/2014'
3088
+ *
3089
+ * @example
3090
+ * // Represent 2 July 2014 in Esperanto:
3091
+ * import { eoLocale } from 'date-fns/locale/eo'
3092
+ * const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
3093
+ * locale: eoLocale
3094
+ * })
3095
+ * //=> '2-a de julio 2014'
3096
+ *
3097
+ * @example
3098
+ * // Escape string by single quote characters:
3099
+ * const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
3100
+ * //=> "3 o'clock"
3101
+ */
3102
+ function format(date, formatStr, options) {
3103
+ const defaultOptions = (0, _index2.getDefaultOptions)();
3104
+ const locale =
3105
+ options?.locale ?? defaultOptions.locale ?? _index.defaultLocale;
3106
+
3107
+ const firstWeekContainsDate =
3108
+ options?.firstWeekContainsDate ??
3109
+ options?.locale?.options?.firstWeekContainsDate ??
3110
+ defaultOptions.firstWeekContainsDate ??
3111
+ defaultOptions.locale?.options?.firstWeekContainsDate ??
3112
+ 1;
3113
+
3114
+ const weekStartsOn =
3115
+ options?.weekStartsOn ??
3116
+ options?.locale?.options?.weekStartsOn ??
3117
+ defaultOptions.weekStartsOn ??
3118
+ defaultOptions.locale?.options?.weekStartsOn ??
3119
+ 0;
3120
+
3121
+ const originalDate = (0, _index7.toDate)(date);
3122
+
3123
+ if (!(0, _index6.isValid)(originalDate)) {
3124
+ throw new RangeError("Invalid time value");
3125
+ }
3126
+
3127
+ let parts = formatStr
3128
+ .match(longFormattingTokensRegExp)
3129
+ .map((substring) => {
3130
+ const firstCharacter = substring[0];
3131
+ if (firstCharacter === "p" || firstCharacter === "P") {
3132
+ const longFormatter = _index4.longFormatters[firstCharacter];
3133
+ return longFormatter(substring, locale.formatLong);
3134
+ }
3135
+ return substring;
3136
+ })
3137
+ .join("")
3138
+ .match(formattingTokensRegExp)
3139
+ .map((substring) => {
3140
+ // Replace two single quote characters with one single quote character
3141
+ if (substring === "''") {
3142
+ return { isToken: false, value: "'" };
3143
+ }
3144
+
3145
+ const firstCharacter = substring[0];
3146
+ if (firstCharacter === "'") {
3147
+ return { isToken: false, value: cleanEscapedString(substring) };
3148
+ }
3149
+
3150
+ if (_index3.formatters[firstCharacter]) {
3151
+ return { isToken: true, value: substring };
3152
+ }
3153
+
3154
+ if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
3155
+ throw new RangeError(
3156
+ "Format string contains an unescaped latin alphabet character `" +
3157
+ firstCharacter +
3158
+ "`",
3159
+ );
3160
+ }
3161
+
3162
+ return { isToken: false, value: substring };
3163
+ });
3164
+
3165
+ // invoke localize preprocessor (only for french locales at the moment)
3166
+ if (locale.localize.preprocessor) {
3167
+ parts = locale.localize.preprocessor(originalDate, parts);
3168
+ }
3169
+
3170
+ const formatterOptions = {
3171
+ firstWeekContainsDate,
3172
+ weekStartsOn,
3173
+ locale,
3174
+ };
3175
+
3176
+ return parts
3177
+ .map((part) => {
3178
+ if (!part.isToken) return part.value;
3179
+
3180
+ const token = part.value;
3181
+
3182
+ if (
3183
+ (!options?.useAdditionalWeekYearTokens &&
3184
+ (0, _index5.isProtectedWeekYearToken)(token)) ||
3185
+ (!options?.useAdditionalDayOfYearTokens &&
3186
+ (0, _index5.isProtectedDayOfYearToken)(token))
3187
+ ) {
3188
+ (0, _index5.warnOrThrowProtectedError)(token, formatStr, String(date));
3189
+ }
3190
+
3191
+ const formatter = _index3.formatters[token[0]];
3192
+ return formatter(originalDate, token, locale.localize, formatterOptions);
3193
+ })
3194
+ .join("");
3195
+ }
3196
+
3197
+ function cleanEscapedString(input) {
3198
+ const matched = input.match(escapedStringRegExp);
3199
+
3200
+ if (!matched) {
3201
+ return input;
3202
+ }
3203
+
3204
+ return matched[1].replace(doubleQuoteRegExp, "'");
3205
+ }
3206
+ }(format));
3207
+
3208
+ exports.addLeadingZeros = addLeadingZeros$1;
3209
+ exports.constants = constants;
3210
+ exports.constructFrom = constructFrom$1;
3211
+ exports.defaultLocale = defaultLocale;
3212
+ exports.defaultOptions = defaultOptions$1;
3213
+ exports.differenceInCalendarDays = differenceInCalendarDays$1;
3214
+ exports.format = format;
3215
+ exports.getDayOfYear = getDayOfYear$1;
3216
+ exports.getISOWeek = getISOWeek$1;
3217
+ exports.getISOWeekYear = getISOWeekYear$1;
3218
+ exports.getTimezoneOffsetInMilliseconds = getTimezoneOffsetInMilliseconds$1;
3219
+ exports.getWeek = getWeek$1;
3220
+ exports.getWeekYear = getWeekYear$1;
3221
+ exports.isDate = isDate$1;
3222
+ exports.isValid = isValid$1;
3223
+ exports.lightFormatters = lightFormatters;
3224
+ exports.longFormatters = longFormatters;
3225
+ exports.protectedTokens = protectedTokens;
3226
+ exports.startOfDay = startOfDay$1;
3227
+ exports.startOfISOWeek = startOfISOWeek$1;
3228
+ exports.startOfISOWeekYear = startOfISOWeekYear$1;
3229
+ exports.startOfWeek = startOfWeek$1;
3230
+ exports.startOfWeekYear = startOfWeekYear$1;
3231
+ exports.startOfYear = startOfYear$1;
3232
+ exports.toDate = toDate$1;