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