@verdocs/web-sdk 1.9.16 → 1.9.20

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