@brainfish-ai/components 0.26.0 → 0.27.0

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 (243) hide show
  1. package/dist/alert-dialog.d.ts +6 -2
  2. package/dist/button.d.ts +4 -2
  3. package/dist/chat-search.d.ts +14 -1
  4. package/dist/confirm-dialog.d.ts +3 -1
  5. package/dist/convos.d.ts +3 -0
  6. package/dist/esm/chunks/ChatSearch.bblH7kYY.js +95 -0
  7. package/dist/esm/chunks/ChatSearch.bblH7kYY.js.map +1 -0
  8. package/dist/esm/chunks/Conversation.CuRp-tJL.js +22 -0
  9. package/dist/esm/chunks/{Conversation.BriXFYqU.js.map → Conversation.CuRp-tJL.js.map} +1 -1
  10. package/dist/esm/chunks/FormattedMessage.XNMN23hm.js +23 -0
  11. package/dist/esm/chunks/FormattedMessage.XNMN23hm.js.map +1 -0
  12. package/dist/esm/chunks/MermaidDiagram.PRgXQ5Yh.js +2 -0
  13. package/dist/esm/chunks/{MermaidDiagram.xQ0CVFOI.js.map → MermaidDiagram.PRgXQ5Yh.js.map} +1 -1
  14. package/dist/esm/chunks/_commonjsHelpers.lGe4XDVY.js +2 -0
  15. package/dist/esm/chunks/_commonjsHelpers.lGe4XDVY.js.map +1 -0
  16. package/dist/esm/chunks/button.D_2SonNs.js +3 -0
  17. package/dist/esm/chunks/button.D_2SonNs.js.map +1 -0
  18. package/dist/esm/chunks/chart.BDL2tf-S.js +10 -0
  19. package/dist/esm/chunks/{chart.4ZbtBMmR.js.map → chart.BDL2tf-S.js.map} +1 -1
  20. package/dist/esm/chunks/chat-logo.CqPppEb9.js +3 -0
  21. package/dist/esm/chunks/chat-logo.CqPppEb9.js.map +1 -0
  22. package/dist/esm/chunks/combobox.MyoPH18G.js +6 -0
  23. package/dist/esm/chunks/{combobox.CJKym3Z1.js.map → combobox.MyoPH18G.js.map} +1 -1
  24. package/dist/esm/chunks/dark.DuW7JuAk.js +2 -0
  25. package/dist/esm/chunks/{dark.Cq2RCgy4.js.map → dark.DuW7JuAk.js.map} +1 -1
  26. package/dist/esm/chunks/data-table.CJOR-1Kf.js +5 -0
  27. package/dist/esm/chunks/{data-table.DbcAYxMY.js.map → data-table.CJOR-1Kf.js.map} +1 -1
  28. package/dist/esm/chunks/date-picker.C2VT_rZ9.js +4 -0
  29. package/dist/esm/chunks/{date-picker._cBTpdEK.js.map → date-picker.C2VT_rZ9.js.map} +1 -1
  30. package/dist/esm/chunks/extends.DPdBf6DS.js +2 -0
  31. package/dist/esm/chunks/extends.DPdBf6DS.js.map +1 -0
  32. package/dist/esm/chunks/feature-flags.DOcVlPHk.js +3 -0
  33. package/dist/esm/chunks/{feature-flags.DeDEcnd1.js.map → feature-flags.DOcVlPHk.js.map} +1 -1
  34. package/dist/esm/chunks/feedback.CLMuSvsg.js +13 -0
  35. package/dist/esm/chunks/{feedback.W2OzN-5r.js.map → feedback.CLMuSvsg.js.map} +1 -1
  36. package/dist/esm/chunks/file-upload-status.D8RhMcbO.js +8 -0
  37. package/dist/esm/chunks/{file-upload-status.DP2iuttI.js.map → file-upload-status.D8RhMcbO.js.map} +1 -1
  38. package/dist/esm/chunks/filters.BHp3ukNW.js +22 -0
  39. package/dist/esm/chunks/{filters.-7vSLEQ2.js.map → filters.BHp3ukNW.js.map} +1 -1
  40. package/dist/esm/chunks/font-picker.B9GPXyK4.js +6 -0
  41. package/dist/esm/chunks/{font-picker.DisEoE8a.js.map → font-picker.B9GPXyK4.js.map} +1 -1
  42. package/dist/esm/chunks/formatDate.D2xEZm8f.js +2 -0
  43. package/dist/esm/chunks/{formatDate.CWN6IFKq.js.map → formatDate.D2xEZm8f.js.map} +1 -1
  44. package/dist/esm/chunks/formatNumber.DhVn228t.js +2 -0
  45. package/dist/esm/chunks/{formatNumber.Bm2k8QrT.js.map → formatNumber.DhVn228t.js.map} +1 -1
  46. package/dist/esm/chunks/generating-star.BN9p_FDu.js +7 -0
  47. package/dist/esm/chunks/generating-star.BN9p_FDu.js.map +1 -0
  48. package/dist/esm/chunks/header-nav.DdOXbPSM.js +10 -0
  49. package/dist/esm/chunks/{header-nav.b4hvOsKc.js.map → header-nav.DdOXbPSM.js.map} +1 -1
  50. package/dist/esm/chunks/header-pane.DrVjpN5S.js +20 -0
  51. package/dist/esm/chunks/{header-pane.BFXHXxVn.js.map → header-pane.DrVjpN5S.js.map} +1 -1
  52. package/dist/esm/chunks/hooks.BQTKhHSv.js +2 -0
  53. package/dist/esm/chunks/hooks.BQTKhHSv.js.map +1 -0
  54. package/dist/esm/chunks/index.uF4ME3WQ.js +4 -0
  55. package/dist/esm/chunks/{index.BqibIWDw.js.map → index.uF4ME3WQ.js.map} +1 -1
  56. package/dist/esm/chunks/input-with-tags.DLv9e0XI.js +5 -0
  57. package/dist/esm/chunks/{input-with-tags.tg2nhPFv.js.map → input-with-tags.DLv9e0XI.js.map} +1 -1
  58. package/dist/esm/chunks/logo.CketsPBx.js +5 -0
  59. package/dist/esm/chunks/{logo.D5BMN6Db.js.map → logo.CketsPBx.js.map} +1 -1
  60. package/dist/esm/chunks/primary.CMQbo1GJ.js +2 -0
  61. package/dist/esm/chunks/{primary.CtiRZbqq.js.map → primary.CMQbo1GJ.js.map} +1 -1
  62. package/dist/esm/chunks/review-list.Cn5bw-lP.js +6 -0
  63. package/dist/esm/chunks/review-list.Cn5bw-lP.js.map +1 -0
  64. package/dist/esm/chunks/sidebar.DsEgGwJU.js +25 -0
  65. package/dist/esm/chunks/sidebar.DsEgGwJU.js.map +1 -0
  66. package/dist/esm/chunks/simpleSelect.DK1qZSXM.js +3 -0
  67. package/dist/esm/chunks/{simpleSelect.B1rktKkt.js.map → simpleSelect.DK1qZSXM.js.map} +1 -1
  68. package/dist/esm/chunks/status-badge.BLB0pWDn.js +3 -0
  69. package/dist/esm/chunks/status-badge.BLB0pWDn.js.map +1 -0
  70. package/dist/esm/chunks/trend-value.BPBDBsk2.js +3 -0
  71. package/dist/esm/chunks/{trend-value.COSukPwk.js.map → trend-value.BPBDBsk2.js.map} +1 -1
  72. package/dist/esm/chunks/two-level-combobox.DJYP--W9.js +8 -0
  73. package/dist/esm/chunks/{two-level-combobox.BXs2z9u5.js.map → two-level-combobox.DJYP--W9.js.map} +1 -1
  74. package/dist/esm/chunks/useChartDateFormatters.Dx2h5AAm.js +2 -0
  75. package/dist/esm/chunks/{useChartDateFormatters.DS9ASgFO.js.map → useChartDateFormatters.Dx2h5AAm.js.map} +1 -1
  76. package/dist/esm/chunks/utils.C6Qu-kwd.js +2 -0
  77. package/dist/esm/chunks/{utils.Cwtlq8dh.js.map → utils.C6Qu-kwd.js.map} +1 -1
  78. package/dist/esm/colors.js +1 -169
  79. package/dist/esm/colors.js.map +1 -1
  80. package/dist/esm/components/article-suggestions-banner.js +4 -53
  81. package/dist/esm/components/article-suggestions-banner.js.map +1 -1
  82. package/dist/esm/components/articles-coverage.js +4 -116
  83. package/dist/esm/components/articles-coverage.js.map +1 -1
  84. package/dist/esm/components/articles-updated.js +4 -74
  85. package/dist/esm/components/articles-updated.js.map +1 -1
  86. package/dist/esm/components/breadcrumbs.js +3 -13
  87. package/dist/esm/components/breadcrumbs.js.map +1 -1
  88. package/dist/esm/components/chart-area-linear.js +6 -66
  89. package/dist/esm/components/chart-area-linear.js.map +1 -1
  90. package/dist/esm/components/chart-radial-stacked.js +2 -48
  91. package/dist/esm/components/chart-radial-stacked.js.map +1 -1
  92. package/dist/esm/components/chat-search.js +1 -1
  93. package/dist/esm/components/combobox.js +1 -1
  94. package/dist/esm/components/confirm-dialog.js +2 -47
  95. package/dist/esm/components/confirm-dialog.js.map +1 -1
  96. package/dist/esm/components/conversation.js +1 -1
  97. package/dist/esm/components/convos.js +27 -607
  98. package/dist/esm/components/convos.js.map +1 -1
  99. package/dist/esm/components/data-table.js +1 -1
  100. package/dist/esm/components/date-picker.js +1 -1
  101. package/dist/esm/components/discoveries-created.js +4 -64
  102. package/dist/esm/components/discoveries-created.js.map +1 -1
  103. package/dist/esm/components/feedback.js +1 -1
  104. package/dist/esm/components/file-upload.js +1 -1
  105. package/dist/esm/components/filter.js +1 -1
  106. package/dist/esm/components/font-picker.js +1 -1
  107. package/dist/esm/components/generating-star.js +1 -1
  108. package/dist/esm/components/input-with-tags.js +1 -1
  109. package/dist/esm/components/logo.js +1 -1
  110. package/dist/esm/components/markdown.js +1 -2
  111. package/dist/esm/components/markdown.js.map +1 -1
  112. package/dist/esm/components/metric-card.js +3 -29
  113. package/dist/esm/components/metric-card.js.map +1 -1
  114. package/dist/esm/components/select.js +1 -1
  115. package/dist/esm/components/trend-value.js +1 -1
  116. package/dist/esm/components/two-level-combobox.js +1 -1
  117. package/dist/esm/components/ui/accordion.js +7 -46
  118. package/dist/esm/components/ui/accordion.js.map +1 -1
  119. package/dist/esm/components/ui/alert-dialog.js +3 -114
  120. package/dist/esm/components/ui/alert-dialog.js.map +1 -1
  121. package/dist/esm/components/ui/alert.js +4 -103
  122. package/dist/esm/components/ui/alert.js.map +1 -1
  123. package/dist/esm/components/ui/avatar.js +7 -89
  124. package/dist/esm/components/ui/avatar.js.map +1 -1
  125. package/dist/esm/components/ui/badge.js +2 -26
  126. package/dist/esm/components/ui/badge.js.map +1 -1
  127. package/dist/esm/components/ui/breadcrumb.js +4 -60
  128. package/dist/esm/components/ui/breadcrumb.js.map +1 -1
  129. package/dist/esm/components/ui/button-group.js +4 -88
  130. package/dist/esm/components/ui/button-group.js.map +1 -1
  131. package/dist/esm/components/ui/button.js +1 -5
  132. package/dist/esm/components/ui/button.js.map +1 -1
  133. package/dist/esm/components/ui/calendar.js +2 -20
  134. package/dist/esm/components/ui/calendar.js.map +1 -1
  135. package/dist/esm/components/ui/card.js +1 -55
  136. package/dist/esm/components/ui/card.js.map +1 -1
  137. package/dist/esm/components/ui/collapsible.js +1 -33
  138. package/dist/esm/components/ui/collapsible.js.map +1 -1
  139. package/dist/esm/components/ui/combobox.js +1 -1
  140. package/dist/esm/components/ui/command.js +2 -79
  141. package/dist/esm/components/ui/command.js.map +1 -1
  142. package/dist/esm/components/ui/dialog.js +4 -60
  143. package/dist/esm/components/ui/dialog.js.map +1 -1
  144. package/dist/esm/components/ui/div-button.js +2 -61
  145. package/dist/esm/components/ui/div-button.js.map +1 -1
  146. package/dist/esm/components/ui/dropdown-menu.js +3 -114
  147. package/dist/esm/components/ui/dropdown-menu.js.map +1 -1
  148. package/dist/esm/components/ui/icon.js +2 -25
  149. package/dist/esm/components/ui/icon.js.map +1 -1
  150. package/dist/esm/components/ui/input.js +4 -47
  151. package/dist/esm/components/ui/input.js.map +1 -1
  152. package/dist/esm/components/ui/item.js +11 -140
  153. package/dist/esm/components/ui/item.js.map +1 -1
  154. package/dist/esm/components/ui/label.js +1 -19
  155. package/dist/esm/components/ui/label.js.map +1 -1
  156. package/dist/esm/components/ui/popover.js +1 -31
  157. package/dist/esm/components/ui/popover.js.map +1 -1
  158. package/dist/esm/components/ui/progress.js +2 -22
  159. package/dist/esm/components/ui/progress.js.map +1 -1
  160. package/dist/esm/components/ui/scroll-area.js +2 -32
  161. package/dist/esm/components/ui/scroll-area.js.map +1 -1
  162. package/dist/esm/components/ui/select.js +5 -66
  163. package/dist/esm/components/ui/select.js.map +1 -1
  164. package/dist/esm/components/ui/separator.js +1 -23
  165. package/dist/esm/components/ui/separator.js.map +1 -1
  166. package/dist/esm/components/ui/sheet.js +3 -62
  167. package/dist/esm/components/ui/sheet.js.map +1 -1
  168. package/dist/esm/components/ui/spinner.js +2 -17
  169. package/dist/esm/components/ui/spinner.js.map +1 -1
  170. package/dist/esm/components/ui/switch.js +2 -26
  171. package/dist/esm/components/ui/switch.js.map +1 -1
  172. package/dist/esm/components/ui/table.js +1 -82
  173. package/dist/esm/components/ui/table.js.map +1 -1
  174. package/dist/esm/components/ui/textarea.js +1 -33
  175. package/dist/esm/components/ui/textarea.js.map +1 -1
  176. package/dist/esm/components/ui/tooltip.js +3 -31
  177. package/dist/esm/components/ui/tooltip.js.map +1 -1
  178. package/dist/esm/global.css +1 -1
  179. package/dist/esm/index.js +1 -53
  180. package/dist/esm/index.js.map +1 -1
  181. package/dist/esm/layouts/full-layout.js +1 -1
  182. package/dist/esm/layouts/header-nav.js +1 -1
  183. package/dist/esm/layouts/sidebar.js +1 -1
  184. package/dist/esm/logos/microsoft-logo.js +6 -66
  185. package/dist/esm/logos/microsoft-logo.js.map +1 -1
  186. package/dist/esm/logos/microsoft-teams-logo.js +12 -112
  187. package/dist/esm/logos/microsoft-teams-logo.js.map +1 -1
  188. package/dist/esm/logos/slack-logo.js +3 -39
  189. package/dist/esm/logos/slack-logo.js.map +1 -1
  190. package/dist/esm/scenes/knowledge-review.js +17 -380
  191. package/dist/esm/scenes/knowledge-review.js.map +1 -1
  192. package/dist/esm/tailwind.preset.js +1 -1526
  193. package/dist/esm/tailwind.preset.js.map +1 -1
  194. package/dist/index.d.ts +32 -5
  195. package/dist/logo.d.ts +9 -0
  196. package/dist/stats.html +47 -46
  197. package/package.json +17 -18
  198. package/tailwind.preset.ts +1 -0
  199. package/dist/esm/chunks/ChatSearch.CeQrTOVx.js +0 -6825
  200. package/dist/esm/chunks/ChatSearch.CeQrTOVx.js.map +0 -1
  201. package/dist/esm/chunks/Conversation.BriXFYqU.js +0 -831
  202. package/dist/esm/chunks/FormattedMessage.CRbM-hF6.js +0 -39715
  203. package/dist/esm/chunks/FormattedMessage.CRbM-hF6.js.map +0 -1
  204. package/dist/esm/chunks/MermaidDiagram.xQ0CVFOI.js +0 -50
  205. package/dist/esm/chunks/_commonjsHelpers.BFTU3MAI.js +0 -8
  206. package/dist/esm/chunks/_commonjsHelpers.BFTU3MAI.js.map +0 -1
  207. package/dist/esm/chunks/button.DQL6gCAt.js +0 -48
  208. package/dist/esm/chunks/button.DQL6gCAt.js.map +0 -1
  209. package/dist/esm/chunks/chart.4ZbtBMmR.js +0 -199
  210. package/dist/esm/chunks/combobox.CJKym3Z1.js +0 -95
  211. package/dist/esm/chunks/dark.Cq2RCgy4.js +0 -18
  212. package/dist/esm/chunks/data-table.DbcAYxMY.js +0 -102
  213. package/dist/esm/chunks/date-picker._cBTpdEK.js +0 -26
  214. package/dist/esm/chunks/extends.mO86zOh3.js +0 -12
  215. package/dist/esm/chunks/extends.mO86zOh3.js.map +0 -1
  216. package/dist/esm/chunks/feature-flags.DeDEcnd1.js +0 -22
  217. package/dist/esm/chunks/feedback.W2OzN-5r.js +0 -214
  218. package/dist/esm/chunks/file-upload-status.DP2iuttI.js +0 -141
  219. package/dist/esm/chunks/filters.-7vSLEQ2.js +0 -565
  220. package/dist/esm/chunks/font-picker.DisEoE8a.js +0 -181
  221. package/dist/esm/chunks/formatDate.CWN6IFKq.js +0 -952
  222. package/dist/esm/chunks/formatNumber.Bm2k8QrT.js +0 -10
  223. package/dist/esm/chunks/generating-star.DMDPNTaM.js +0 -1501
  224. package/dist/esm/chunks/generating-star.DMDPNTaM.js.map +0 -1
  225. package/dist/esm/chunks/header-nav.b4hvOsKc.js +0 -197
  226. package/dist/esm/chunks/header-pane.BFXHXxVn.js +0 -559
  227. package/dist/esm/chunks/hooks.BWVaVAT-.js +0 -343
  228. package/dist/esm/chunks/hooks.BWVaVAT-.js.map +0 -1
  229. package/dist/esm/chunks/index.BqibIWDw.js +0 -137
  230. package/dist/esm/chunks/input-with-tags.tg2nhPFv.js +0 -110
  231. package/dist/esm/chunks/logo.D5BMN6Db.js +0 -191
  232. package/dist/esm/chunks/primary.CtiRZbqq.js +0 -18
  233. package/dist/esm/chunks/review-list.BtSnfpSc.js +0 -117
  234. package/dist/esm/chunks/review-list.BtSnfpSc.js.map +0 -1
  235. package/dist/esm/chunks/sidebar.BamKohb5.js +0 -803
  236. package/dist/esm/chunks/sidebar.BamKohb5.js.map +0 -1
  237. package/dist/esm/chunks/simpleSelect.B1rktKkt.js +0 -23
  238. package/dist/esm/chunks/status-badge.eFJ1PYeb.js +0 -18
  239. package/dist/esm/chunks/status-badge.eFJ1PYeb.js.map +0 -1
  240. package/dist/esm/chunks/trend-value.COSukPwk.js +0 -51
  241. package/dist/esm/chunks/two-level-combobox.BXs2z9u5.js +0 -132
  242. package/dist/esm/chunks/useChartDateFormatters.DS9ASgFO.js +0 -11
  243. package/dist/esm/chunks/utils.Cwtlq8dh.js +0 -45
@@ -1 +1 @@
1
- {"version":3,"file":"formatDate.CWN6IFKq.js","sources":["../../../node_modules/date-fns/constants.js","../../../node_modules/date-fns/constructFrom.js","../../../node_modules/date-fns/_lib/normalizeDates.js","../../../node_modules/date-fns/toDate.js","../../../node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js","../../../node_modules/date-fns/startOfDay.js","../../../node_modules/date-fns/differenceInCalendarDays.js","../../../node_modules/date-fns/differenceInCalendarMonths.js","../../../node_modules/date-fns/getQuarter.js","../../../node_modules/date-fns/differenceInCalendarQuarters.js","../../../node_modules/date-fns/_lib/defaultOptions.js","../../../node_modules/date-fns/startOfWeek.js","../../../node_modules/date-fns/differenceInCalendarWeeks.js","../../../node_modules/date-fns/differenceInCalendarYears.js","../../../node_modules/date-fns/_lib/getRoundingMethod.js","../../../node_modules/date-fns/differenceInHours.js","../../../node_modules/date-fns/differenceInMilliseconds.js","../../../node_modules/date-fns/differenceInMinutes.js","../../../node_modules/date-fns/differenceInSeconds.js","../../../node_modules/date-fns/intlFormatDistance.js","../../../src/lib/formatDate.ts"],"sourcesContent":["/**\n * @module constants\n * @summary Useful constants\n * @description\n * Collection of useful date constants.\n *\n * The constants could be imported from `date-fns/constants`:\n *\n * ```ts\n * import { maxTime, minTime } from \"./constants/date-fns/constants\";\n *\n * function isAllowedTime(time) {\n * return time <= maxTime && time >= minTime;\n * }\n * ```\n */\n\n/**\n * @constant\n * @name daysInWeek\n * @summary Days in 1 week.\n */\nexport const daysInWeek = 7;\n\n/**\n * @constant\n * @name daysInYear\n * @summary Days in 1 year.\n *\n * @description\n * How many days in a year.\n *\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occurs every 4 years, except for years that are divisible by 100 and not divisible by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n */\nexport const daysInYear = 365.2425;\n\n/**\n * @constant\n * @name maxTime\n * @summary Maximum allowed time.\n *\n * @example\n * import { maxTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = 8640000000000001 <= maxTime;\n * //=> false\n *\n * new Date(8640000000000001);\n * //=> Invalid Date\n */\nexport const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n\n/**\n * @constant\n * @name minTime\n * @summary Minimum allowed time.\n *\n * @example\n * import { minTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = -8640000000000001 >= minTime;\n * //=> false\n *\n * new Date(-8640000000000001)\n * //=> Invalid Date\n */\nexport const minTime = -maxTime;\n\n/**\n * @constant\n * @name millisecondsInWeek\n * @summary Milliseconds in 1 week.\n */\nexport const millisecondsInWeek = 604800000;\n\n/**\n * @constant\n * @name millisecondsInDay\n * @summary Milliseconds in 1 day.\n */\nexport const millisecondsInDay = 86400000;\n\n/**\n * @constant\n * @name millisecondsInMinute\n * @summary Milliseconds in 1 minute\n */\nexport const millisecondsInMinute = 60000;\n\n/**\n * @constant\n * @name millisecondsInHour\n * @summary Milliseconds in 1 hour\n */\nexport const millisecondsInHour = 3600000;\n\n/**\n * @constant\n * @name millisecondsInSecond\n * @summary Milliseconds in 1 second\n */\nexport const millisecondsInSecond = 1000;\n\n/**\n * @constant\n * @name minutesInYear\n * @summary Minutes in 1 year.\n */\nexport const minutesInYear = 525600;\n\n/**\n * @constant\n * @name minutesInMonth\n * @summary Minutes in 1 month.\n */\nexport const minutesInMonth = 43200;\n\n/**\n * @constant\n * @name minutesInDay\n * @summary Minutes in 1 day.\n */\nexport const minutesInDay = 1440;\n\n/**\n * @constant\n * @name minutesInHour\n * @summary Minutes in 1 hour.\n */\nexport const minutesInHour = 60;\n\n/**\n * @constant\n * @name monthsInQuarter\n * @summary Months in 1 quarter.\n */\nexport const monthsInQuarter = 3;\n\n/**\n * @constant\n * @name monthsInYear\n * @summary Months in 1 year.\n */\nexport const monthsInYear = 12;\n\n/**\n * @constant\n * @name quartersInYear\n * @summary Quarters in 1 year\n */\nexport const quartersInYear = 4;\n\n/**\n * @constant\n * @name secondsInHour\n * @summary Seconds in 1 hour.\n */\nexport const secondsInHour = 3600;\n\n/**\n * @constant\n * @name secondsInMinute\n * @summary Seconds in 1 minute.\n */\nexport const secondsInMinute = 60;\n\n/**\n * @constant\n * @name secondsInDay\n * @summary Seconds in 1 day.\n */\nexport const secondsInDay = secondsInHour * 24;\n\n/**\n * @constant\n * @name secondsInWeek\n * @summary Seconds in 1 week.\n */\nexport const secondsInWeek = secondsInDay * 7;\n\n/**\n * @constant\n * @name secondsInYear\n * @summary Seconds in 1 year.\n */\nexport const secondsInYear = secondsInDay * daysInYear;\n\n/**\n * @constant\n * @name secondsInMonth\n * @summary Seconds in 1 month\n */\nexport const secondsInMonth = secondsInYear / 12;\n\n/**\n * @constant\n * @name secondsInQuarter\n * @summary Seconds in 1 quarter.\n */\nexport const secondsInQuarter = secondsInMonth * 3;\n\n/**\n * @constant\n * @name constructFromSymbol\n * @summary Symbol enabling Date extensions to inherit properties from the reference date.\n *\n * The symbol is used to enable the `constructFrom` function to construct a date\n * using a reference date and a value. It allows to transfer extra properties\n * from the reference date to the new date. It's useful for extensions like\n * [`TZDate`](https://github.com/date-fns/tz) that accept a time zone as\n * a constructor argument.\n */\nexport const constructFromSymbol = Symbol.for(\"constructDateFrom\");\n","import { constructFromSymbol } from \"./constants.js\";\n\n/**\n * @name constructFrom\n * @category Generic Helpers\n * @summary Constructs a date using the reference date and the value\n *\n * @description\n * The function constructs a new date using the constructor from the reference\n * date and the given value. It helps to build generic functions that accept\n * date extensions.\n *\n * It defaults to `Date` if the passed reference date is a number or a string.\n *\n * Starting from v3.7.0, it allows to construct a date using `[Symbol.for(\"constructDateFrom\")]`\n * enabling to transfer extra properties from the reference date to the new date.\n * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)\n * that accept a time zone as a constructor argument.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The reference date to take constructor from\n * @param value - The value to create the date\n *\n * @returns Date initialized using the given date and value\n *\n * @example\n * import { constructFrom } from \"./constructFrom/date-fns\";\n *\n * // A function that clones a date preserving the original type\n * function cloneDate<DateType extends Date>(date: DateType): DateType {\n * return constructFrom(\n * date, // Use constructor from the given date\n * date.getTime() // Use the date value to create a new date\n * );\n * }\n */\nexport function constructFrom(date, value) {\n if (typeof date === \"function\") return date(value);\n\n if (date && typeof date === \"object\" && constructFromSymbol in date)\n return date[constructFromSymbol](value);\n\n if (date instanceof Date) return new date.constructor(value);\n\n return new Date(value);\n}\n\n// Fallback for modularized imports:\nexport default constructFrom;\n","import { constructFrom } from \"../constructFrom.js\";\n\nexport function normalizeDates(context, ...dates) {\n const normalize = constructFrom.bind(\n null,\n context || dates.find((date) => typeof date === \"object\"),\n );\n return dates.map(normalize);\n}\n","import { constructFrom } from \"./constructFrom.js\";\n\n/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * Starting from v3.7.0, it clones a date using `[Symbol.for(\"constructDateFrom\")]`\n * enabling to transfer extra properties from the reference date to the new date.\n * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)\n * that accept a time zone as a constructor argument.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param argument - The value to convert\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport function toDate(argument, context) {\n // [TODO] Get rid of `toDate` or `constructFrom`?\n return constructFrom(context || argument, argument);\n}\n\n// Fallback for modularized imports:\nexport default toDate;\n","import { toDate } from \"../toDate.js\";\n\n/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nexport function getTimezoneOffsetInMilliseconds(date) {\n const _date = toDate(date);\n const utcDate = new Date(\n Date.UTC(\n _date.getFullYear(),\n _date.getMonth(),\n _date.getDate(),\n _date.getHours(),\n _date.getMinutes(),\n _date.getSeconds(),\n _date.getMilliseconds(),\n ),\n );\n utcDate.setUTCFullYear(_date.getFullYear());\n return +date - +utcDate;\n}\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link startOfDay} function options.\n */\n\n/**\n * @name startOfDay\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - The options\n *\n * @returns The start of a day\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\nexport function startOfDay(date, options) {\n const _date = toDate(date, options?.in);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfDay;\n","import { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.js\";\nimport { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { millisecondsInDay } from \"./constants.js\";\nimport { startOfDay } from \"./startOfDay.js\";\n\n/**\n * The {@link differenceInCalendarDays} function options.\n */\n\n/**\n * @name differenceInCalendarDays\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates. This means that the times are removed\n * from the dates and then the difference in days is calculated.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - The options object\n *\n * @returns The number of calendar days\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n * // How many calendar days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInCalendarDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 1\n */\nexport function differenceInCalendarDays(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n\n const laterStartOfDay = startOfDay(laterDate_);\n const earlierStartOfDay = startOfDay(earlierDate_);\n\n const laterTimestamp =\n +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);\n const earlierTimestamp =\n +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);\n\n // Round the number of days to the nearest integer because the number of\n // milliseconds in a day is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarDays;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\n\n/**\n * The {@link differenceInCalendarMonths} function options.\n */\n\n/**\n * @name differenceInCalendarMonths\n * @category Month Helpers\n * @summary Get the number of calendar months between the given dates.\n *\n * @description\n * Get the number of calendar months between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options\n *\n * @returns The number of calendar months\n *\n * @example\n * // How many calendar months are between 31 January 2014 and 1 September 2014?\n * const result = differenceInCalendarMonths(\n * new Date(2014, 8, 1),\n * new Date(2014, 0, 31)\n * )\n * //=> 8\n */\nexport function differenceInCalendarMonths(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n\n const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();\n const monthsDiff = laterDate_.getMonth() - earlierDate_.getMonth();\n\n return yearsDiff * 12 + monthsDiff;\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarMonths;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getQuarter} function options.\n */\n\n/**\n * @name getQuarter\n * @category Quarter Helpers\n * @summary Get the year quarter of the given date.\n *\n * @description\n * Get the year quarter of the given date.\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The quarter\n *\n * @example\n * // Which quarter is 2 July 2014?\n * const result = getQuarter(new Date(2014, 6, 2));\n * //=> 3\n */\nexport function getQuarter(date, options) {\n const _date = toDate(date, options?.in);\n const quarter = Math.trunc(_date.getMonth() / 3) + 1;\n return quarter;\n}\n\n// Fallback for modularized imports:\nexport default getQuarter;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { getQuarter } from \"./getQuarter.js\";\n\n/**\n * The {@link differenceInCalendarQuarters} function options.\n */\n\n/**\n * @name differenceInCalendarQuarters\n * @category Quarter Helpers\n * @summary Get the number of calendar quarters between the given dates.\n *\n * @description\n * Get the number of calendar quarters between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options\n *\n * @returns The number of calendar quarters\n *\n * @example\n * // How many calendar quarters are between 31 December 2013 and 2 July 2014?\n * const result = differenceInCalendarQuarters(\n * new Date(2014, 6, 2),\n * new Date(2013, 11, 31)\n * )\n * //=> 3\n */\nexport function differenceInCalendarQuarters(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n\n const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();\n const quartersDiff = getQuarter(laterDate_) - getQuarter(earlierDate_);\n\n return yearsDiff * 4 + quartersDiff;\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarQuarters;\n","let defaultOptions = {};\n\nexport function getDefaultOptions() {\n return defaultOptions;\n}\n\nexport function setDefaultOptions(newOptions) {\n defaultOptions = newOptions;\n}\n","import { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link startOfWeek} function options.\n */\n\n/**\n * @name startOfWeek\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfWeek(date, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date, options?.in);\n const day = _date.getDay();\n const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n\n _date.setDate(_date.getDate() - diff);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeek;\n","import { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.js\";\nimport { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { millisecondsInWeek } from \"./constants.js\";\nimport { startOfWeek } from \"./startOfWeek.js\";\n\n/**\n * The {@link differenceInCalendarWeeks} function options.\n */\n\n/**\n * @name differenceInCalendarWeeks\n * @category Week Helpers\n * @summary Get the number of calendar weeks between the given dates.\n *\n * @description\n * Get the number of calendar weeks between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options.\n *\n * @returns The number of calendar weeks\n *\n * @example\n * // How many calendar weeks are between 5 July 2014 and 20 July 2014?\n * const result = differenceInCalendarWeeks(\n * new Date(2014, 6, 20),\n * new Date(2014, 6, 5)\n * )\n * //=> 3\n *\n * @example\n * // If the week starts on Monday,\n * // how many calendar weeks are between 5 July 2014 and 20 July 2014?\n * const result = differenceInCalendarWeeks(\n * new Date(2014, 6, 20),\n * new Date(2014, 6, 5),\n * { weekStartsOn: 1 }\n * )\n * //=> 2\n */\nexport function differenceInCalendarWeeks(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n\n const laterStartOfWeek = startOfWeek(laterDate_, options);\n const earlierStartOfWeek = startOfWeek(earlierDate_, options);\n\n const laterTimestamp =\n +laterStartOfWeek - getTimezoneOffsetInMilliseconds(laterStartOfWeek);\n const earlierTimestamp =\n +earlierStartOfWeek - getTimezoneOffsetInMilliseconds(earlierStartOfWeek);\n\n return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInWeek);\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarWeeks;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\n\n/**\n * The {@link differenceInCalendarYears} function options.\n */\n\n/**\n * @name differenceInCalendarYears\n * @category Year Helpers\n * @summary Get the number of calendar years between the given dates.\n *\n * @description\n * Get the number of calendar years between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options\n\n * @returns The number of calendar years\n *\n * @example\n * // How many calendar years are between 31 December 2013 and 11 February 2015?\n * const result = differenceInCalendarYears(\n * new Date(2015, 1, 11),\n * new Date(2013, 11, 31)\n * );\n * //=> 2\n */\nexport function differenceInCalendarYears(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n return laterDate_.getFullYear() - earlierDate_.getFullYear();\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarYears;\n","export function getRoundingMethod(method) {\n return (number) => {\n const round = method ? Math[method] : Math.trunc;\n const result = round(number);\n // Prevent negative zero\n return result === 0 ? 0 : result;\n };\n}\n","import { getRoundingMethod } from \"./_lib/getRoundingMethod.js\";\nimport { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { millisecondsInHour } from \"./constants.js\";\n\n/**\n * The {@link differenceInHours} function options.\n */\n\n/**\n * @name differenceInHours\n * @category Hour Helpers\n * @summary Get the number of hours between the given dates.\n *\n * @description\n * Get the number of hours between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options.\n *\n * @returns The number of hours\n *\n * @example\n * // How many hours are between 2 July 2014 06:50:00 and 2 July 2014 19:00:00?\n * const result = differenceInHours(\n * new Date(2014, 6, 2, 19, 0),\n * new Date(2014, 6, 2, 6, 50)\n * )\n * //=> 12\n */\nexport function differenceInHours(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n const diff = (+laterDate_ - +earlierDate_) / millisecondsInHour;\n return getRoundingMethod(options?.roundingMethod)(diff);\n}\n\n// Fallback for modularized imports:\nexport default differenceInHours;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * @name differenceInMilliseconds\n * @category Millisecond Helpers\n * @summary Get the number of milliseconds between the given dates.\n *\n * @description\n * Get the number of milliseconds between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n *\n * @returns The number of milliseconds\n *\n * @example\n * // How many milliseconds are between\n * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?\n * const result = differenceInMilliseconds(\n * new Date(2014, 6, 2, 12, 30, 21, 700),\n * new Date(2014, 6, 2, 12, 30, 20, 600)\n * )\n * //=> 1100\n */\nexport function differenceInMilliseconds(laterDate, earlierDate) {\n return +toDate(laterDate) - +toDate(earlierDate);\n}\n\n// Fallback for modularized imports:\nexport default differenceInMilliseconds;\n","import { getRoundingMethod } from \"./_lib/getRoundingMethod.js\";\nimport { millisecondsInMinute } from \"./constants.js\";\nimport { differenceInMilliseconds } from \"./differenceInMilliseconds.js\";\n\n/**\n * The {@link differenceInMinutes} function options.\n */\n\n/**\n * @name differenceInMinutes\n * @category Minute Helpers\n * @summary Get the number of minutes between the given dates.\n *\n * @description\n * Get the signed number of full (rounded towards 0) minutes between the given dates.\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n * @param options - An object with options.\n *\n * @returns The number of minutes\n *\n * @example\n * // How many minutes are between 2 July 2014 12:07:59 and 2 July 2014 12:20:00?\n * const result = differenceInMinutes(\n * new Date(2014, 6, 2, 12, 20, 0),\n * new Date(2014, 6, 2, 12, 7, 59)\n * )\n * //=> 12\n *\n * @example\n * // How many minutes are between 10:01:59 and 10:00:00\n * const result = differenceInMinutes(\n * new Date(2000, 0, 1, 10, 0, 0),\n * new Date(2000, 0, 1, 10, 1, 59)\n * )\n * //=> -1\n */\nexport function differenceInMinutes(dateLeft, dateRight, options) {\n const diff =\n differenceInMilliseconds(dateLeft, dateRight) / millisecondsInMinute;\n return getRoundingMethod(options?.roundingMethod)(diff);\n}\n\n// Fallback for modularized imports:\nexport default differenceInMinutes;\n","import { getRoundingMethod } from \"./_lib/getRoundingMethod.js\";\nimport { differenceInMilliseconds } from \"./differenceInMilliseconds.js\";\n\n/**\n * The {@link differenceInSeconds} function options.\n */\n\n/**\n * @name differenceInSeconds\n * @category Second Helpers\n * @summary Get the number of seconds between the given dates.\n *\n * @description\n * Get the number of seconds between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options.\n *\n * @returns The number of seconds\n *\n * @example\n * // How many seconds are between\n * // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000?\n * const result = differenceInSeconds(\n * new Date(2014, 6, 2, 12, 30, 20, 0),\n * new Date(2014, 6, 2, 12, 30, 7, 999)\n * )\n * //=> 12\n */\nexport function differenceInSeconds(laterDate, earlierDate, options) {\n const diff = differenceInMilliseconds(laterDate, earlierDate) / 1000;\n return getRoundingMethod(options?.roundingMethod)(diff);\n}\n\n// Fallback for modularized imports:\nexport default differenceInSeconds;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport {\n secondsInDay,\n secondsInHour,\n secondsInMinute,\n secondsInMonth,\n secondsInQuarter,\n secondsInWeek,\n secondsInYear,\n} from \"./constants.js\";\nimport { differenceInCalendarDays } from \"./differenceInCalendarDays.js\";\nimport { differenceInCalendarMonths } from \"./differenceInCalendarMonths.js\";\nimport { differenceInCalendarQuarters } from \"./differenceInCalendarQuarters.js\";\nimport { differenceInCalendarWeeks } from \"./differenceInCalendarWeeks.js\";\nimport { differenceInCalendarYears } from \"./differenceInCalendarYears.js\";\nimport { differenceInHours } from \"./differenceInHours.js\";\nimport { differenceInMinutes } from \"./differenceInMinutes.js\";\nimport { differenceInSeconds } from \"./differenceInSeconds.js\";\n\n/**\n * The {@link intlFormatDistance} function options.\n */\n\n/**\n * The unit used to format the distance in {@link intlFormatDistance}.\n */\n\n/**\n * @name intlFormatDistance\n * @category Common Helpers\n * @summary Formats distance between two dates in a human-readable format\n * @description\n * The function calculates the difference between two dates and formats it as a human-readable string.\n *\n * The function will pick the most appropriate unit depending on the distance between dates. For example, if the distance is a few hours, it might return `x hours`. If the distance is a few months, it might return `x months`.\n *\n * You can also specify a unit to force using it regardless of the distance to get a result like `123456 hours`.\n *\n * See the table below for the unit picking logic:\n *\n * | Distance between dates | Result (past) | Result (future) |\n * | ---------------------- | -------------- | --------------- |\n * | 0 seconds | now | now |\n * | 1-59 seconds | X seconds ago | in X seconds |\n * | 1-59 minutes | X minutes ago | in X minutes |\n * | 1-23 hours | X hours ago | in X hours |\n * | 1 day | yesterday | tomorrow |\n * | 2-6 days | X days ago | in X days |\n * | 7 days | last week | next week |\n * | 8 days-1 month | X weeks ago | in X weeks |\n * | 1 month | last month | next month |\n * | 2-3 months | X months ago | in X months |\n * | 1 quarter | last quarter | next quarter |\n * | 2-3 quarters | X quarters ago | in X quarters |\n * | 1 year | last year | next year |\n * | 2+ years | X years ago | in X years |\n *\n * @param laterDate - The date\n * @param earlierDate - The date to compare with.\n * @param options - An object with options.\n * See MDN for details [Locale identification and negotiation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation)\n * The narrow one could be similar to the short one for some locales.\n *\n * @returns The distance in words according to language-sensitive relative time formatting.\n *\n * @throws `date` must not be Invalid Date\n * @throws `baseDate` must not be Invalid Date\n * @throws `options.unit` must not be invalid Unit\n * @throws `options.locale` must not be invalid locale\n * @throws `options.localeMatcher` must not be invalid localeMatcher\n * @throws `options.numeric` must not be invalid numeric\n * @throws `options.style` must not be invalid style\n *\n * @example\n * // What is the distance between the dates when the fist date is after the second?\n * intlFormatDistance(\n * new Date(1986, 3, 4, 11, 30, 0),\n * new Date(1986, 3, 4, 10, 30, 0)\n * )\n * //=> 'in 1 hour'\n *\n * // What is the distance between the dates when the fist date is before the second?\n * intlFormatDistance(\n * new Date(1986, 3, 4, 10, 30, 0),\n * new Date(1986, 3, 4, 11, 30, 0)\n * )\n * //=> '1 hour ago'\n *\n * @example\n * // Use the unit option to force the function to output the result in quarters. Without setting it, the example would return \"next year\"\n * intlFormatDistance(\n * new Date(1987, 6, 4, 10, 30, 0),\n * new Date(1986, 3, 4, 10, 30, 0),\n * { unit: 'quarter' }\n * )\n * //=> 'in 5 quarters'\n *\n * @example\n * // Use the locale option to get the result in Spanish. Without setting it, the example would return \"in 1 hour\".\n * intlFormatDistance(\n * new Date(1986, 3, 4, 11, 30, 0),\n * new Date(1986, 3, 4, 10, 30, 0),\n * { locale: 'es' }\n * )\n * //=> 'dentro de 1 hora'\n *\n * @example\n * // Use the numeric option to force the function to use numeric values. Without setting it, the example would return \"tomorrow\".\n * intlFormatDistance(\n * new Date(1986, 3, 5, 11, 30, 0),\n * new Date(1986, 3, 4, 11, 30, 0),\n * { numeric: 'always' }\n * )\n * //=> 'in 1 day'\n *\n * @example\n * // Use the style option to force the function to use short values. Without setting it, the example would return \"in 2 years\".\n * intlFormatDistance(\n * new Date(1988, 3, 4, 11, 30, 0),\n * new Date(1986, 3, 4, 11, 30, 0),\n * { style: 'short' }\n * )\n * //=> 'in 2 yr'\n */\nexport function intlFormatDistance(laterDate, earlierDate, options) {\n let value = 0;\n let unit;\n\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n\n if (!options?.unit) {\n // Get the unit based on diffInSeconds calculations if no unit is specified\n const diffInSeconds = differenceInSeconds(laterDate_, earlierDate_); // The smallest unit\n\n if (Math.abs(diffInSeconds) < secondsInMinute) {\n value = differenceInSeconds(laterDate_, earlierDate_);\n unit = \"second\";\n } else if (Math.abs(diffInSeconds) < secondsInHour) {\n value = differenceInMinutes(laterDate_, earlierDate_);\n unit = \"minute\";\n } else if (\n Math.abs(diffInSeconds) < secondsInDay &&\n Math.abs(differenceInCalendarDays(laterDate_, earlierDate_)) < 1\n ) {\n value = differenceInHours(laterDate_, earlierDate_);\n unit = \"hour\";\n } else if (\n Math.abs(diffInSeconds) < secondsInWeek &&\n (value = differenceInCalendarDays(laterDate_, earlierDate_)) &&\n Math.abs(value) < 7\n ) {\n unit = \"day\";\n } else if (Math.abs(diffInSeconds) < secondsInMonth) {\n value = differenceInCalendarWeeks(laterDate_, earlierDate_);\n unit = \"week\";\n } else if (Math.abs(diffInSeconds) < secondsInQuarter) {\n value = differenceInCalendarMonths(laterDate_, earlierDate_);\n unit = \"month\";\n } else if (Math.abs(diffInSeconds) < secondsInYear) {\n if (differenceInCalendarQuarters(laterDate_, earlierDate_) < 4) {\n // To filter out cases that are less than a year but match 4 quarters\n value = differenceInCalendarQuarters(laterDate_, earlierDate_);\n unit = \"quarter\";\n } else {\n value = differenceInCalendarYears(laterDate_, earlierDate_);\n unit = \"year\";\n }\n } else {\n value = differenceInCalendarYears(laterDate_, earlierDate_);\n unit = \"year\";\n }\n } else {\n // Get the value if unit is specified\n unit = options?.unit;\n if (unit === \"second\") {\n value = differenceInSeconds(laterDate_, earlierDate_);\n } else if (unit === \"minute\") {\n value = differenceInMinutes(laterDate_, earlierDate_);\n } else if (unit === \"hour\") {\n value = differenceInHours(laterDate_, earlierDate_);\n } else if (unit === \"day\") {\n value = differenceInCalendarDays(laterDate_, earlierDate_);\n } else if (unit === \"week\") {\n value = differenceInCalendarWeeks(laterDate_, earlierDate_);\n } else if (unit === \"month\") {\n value = differenceInCalendarMonths(laterDate_, earlierDate_);\n } else if (unit === \"quarter\") {\n value = differenceInCalendarQuarters(laterDate_, earlierDate_);\n } else if (unit === \"year\") {\n value = differenceInCalendarYears(laterDate_, earlierDate_);\n }\n }\n\n const rtf = new Intl.RelativeTimeFormat(options?.locale, {\n numeric: \"auto\",\n ...options,\n });\n\n return rtf.format(value, unit);\n}\n\n// Fallback for modularized imports:\nexport default intlFormatDistance;\n","import { intlFormatDistance } from 'date-fns/intlFormatDistance';\n\nfunction getLocale(locale?: string) {\n const defaultLocale = 'en-US';\n if (!locale) {\n if (typeof navigator !== 'undefined') {\n locale = navigator.language;\n } else {\n locale = defaultLocale;\n }\n }\n\n return locale;\n}\nexport function formatDistance(timestamp: Date, localeParam?: string) {\n const locale = getLocale(localeParam);\n\n return intlFormatDistance(timestamp, new Date(), { locale, style: 'short' });\n}\n\nexport function formatDate(date: Date, localeParam?: string) {\n const locale = getLocale(localeParam);\n\n return date.toLocaleDateString(locale, {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n hour12: true,\n });\n}\n\nexport function formatChartTick(value: Date | string | undefined, locale = 'en-US'): string {\n if (typeof value === 'string') return value;\n if (!(value instanceof Date)) return '';\n\n return value.toLocaleDateString(locale, { month: 'short', day: 'numeric' });\n}\n\nexport function formatChartLabel(value: Date | string | undefined, locale = 'en-US'): string {\n if (typeof value === 'string') return value;\n if (!(value instanceof Date)) return '';\n\n return value.toLocaleDateString(locale, { month: 'long', day: 'numeric', year: 'numeric' });\n}\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,UAAU,GAAG,QAAQ;;AAkClC;AACA;AACA;AACA;AACA;AACO,MAAM,kBAAkB,GAAG,SAAS;;AAE3C;AACA;AACA;AACA;AACA;AACO,MAAM,iBAAiB,GAAG,QAAQ;;AAEzC;AACA;AACA;AACA;AACA;AACO,MAAM,oBAAoB,GAAG,KAAK;;AAEzC;AACA;AACA;AACA;AACA;AACO,MAAM,kBAAkB,GAAG,OAAO;;AA0DzC;AACA;AACA;AACA;AACA;AACO,MAAM,aAAa,GAAG,IAAI;;AAEjC;AACA;AACA;AACA;AACA;AACO,MAAM,eAAe,GAAG,EAAE;;AAEjC;AACA;AACA;AACA;AACA;AACO,MAAM,YAAY,GAAG,aAAa,GAAG,EAAE;;AAE9C;AACA;AACA;AACA;AACA;AACO,MAAM,aAAa,G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EAAK,WAAW,CAAA;AAC5E;AAEO,SAAS,gBAAA,CAAiB,KAAA,EAAkC,MAAA,GAAS,OAAA,EAAiB;AAC3F,EAAA,IAAI,OAAO,KAAA,KAAU,QAAA,EAAU,OAAO,KAAA;AACtC,EAAA,IAAI,EAAE,KAAA,YAAiB,IAAA,CAAA,EAAO,OAAO,EAAA;AAErC,EAAA,OAAO,KAAA,CAAM,kBAAA,CAAmB,MAAA,EAAQ,EAAE,KAAA,EAAO,QAAQ,GAAA,EAAK,SAAA,EAAW,IAAA,EAAM,SAAA,EAAW,CAAA;AAC5F;;;;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]}
1
+ {"version":3,"file":"formatDate.D2xEZm8f.js","sources":["../../../node_modules/date-fns/constants.js","../../../node_modules/date-fns/constructFrom.js","../../../node_modules/date-fns/_lib/normalizeDates.js","../../../node_modules/date-fns/toDate.js","../../../node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js","../../../node_modules/date-fns/startOfDay.js","../../../node_modules/date-fns/differenceInCalendarDays.js","../../../node_modules/date-fns/differenceInCalendarMonths.js","../../../node_modules/date-fns/getQuarter.js","../../../node_modules/date-fns/differenceInCalendarQuarters.js","../../../node_modules/date-fns/_lib/defaultOptions.js","../../../node_modules/date-fns/startOfWeek.js","../../../node_modules/date-fns/differenceInCalendarWeeks.js","../../../node_modules/date-fns/differenceInCalendarYears.js","../../../node_modules/date-fns/_lib/getRoundingMethod.js","../../../node_modules/date-fns/differenceInHours.js","../../../node_modules/date-fns/differenceInMilliseconds.js","../../../node_modules/date-fns/differenceInMinutes.js","../../../node_modules/date-fns/differenceInSeconds.js","../../../src/lib/formatDate.ts","../../../node_modules/date-fns/intlFormatDistance.js"],"sourcesContent":["/**\n * @module constants\n * @summary Useful constants\n * @description\n * Collection of useful date constants.\n *\n * The constants could be imported from `date-fns/constants`:\n *\n * ```ts\n * import { maxTime, minTime } from \"./constants/date-fns/constants\";\n *\n * function isAllowedTime(time) {\n * return time <= maxTime && time >= minTime;\n * }\n * ```\n */\n\n/**\n * @constant\n * @name daysInWeek\n * @summary Days in 1 week.\n */\nexport const daysInWeek = 7;\n\n/**\n * @constant\n * @name daysInYear\n * @summary Days in 1 year.\n *\n * @description\n * How many days in a year.\n *\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occurs every 4 years, except for years that are divisible by 100 and not divisible by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n */\nexport const daysInYear = 365.2425;\n\n/**\n * @constant\n * @name maxTime\n * @summary Maximum allowed time.\n *\n * @example\n * import { maxTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = 8640000000000001 <= maxTime;\n * //=> false\n *\n * new Date(8640000000000001);\n * //=> Invalid Date\n */\nexport const maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n\n/**\n * @constant\n * @name minTime\n * @summary Minimum allowed time.\n *\n * @example\n * import { minTime } from \"./constants/date-fns/constants\";\n *\n * const isValid = -8640000000000001 >= minTime;\n * //=> false\n *\n * new Date(-8640000000000001)\n * //=> Invalid Date\n */\nexport const minTime = -maxTime;\n\n/**\n * @constant\n * @name millisecondsInWeek\n * @summary Milliseconds in 1 week.\n */\nexport const millisecondsInWeek = 604800000;\n\n/**\n * @constant\n * @name millisecondsInDay\n * @summary Milliseconds in 1 day.\n */\nexport const millisecondsInDay = 86400000;\n\n/**\n * @constant\n * @name millisecondsInMinute\n * @summary Milliseconds in 1 minute\n */\nexport const millisecondsInMinute = 60000;\n\n/**\n * @constant\n * @name millisecondsInHour\n * @summary Milliseconds in 1 hour\n */\nexport const millisecondsInHour = 3600000;\n\n/**\n * @constant\n * @name millisecondsInSecond\n * @summary Milliseconds in 1 second\n */\nexport const millisecondsInSecond = 1000;\n\n/**\n * @constant\n * @name minutesInYear\n * @summary Minutes in 1 year.\n */\nexport const minutesInYear = 525600;\n\n/**\n * @constant\n * @name minutesInMonth\n * @summary Minutes in 1 month.\n */\nexport const minutesInMonth = 43200;\n\n/**\n * @constant\n * @name minutesInDay\n * @summary Minutes in 1 day.\n */\nexport const minutesInDay = 1440;\n\n/**\n * @constant\n * @name minutesInHour\n * @summary Minutes in 1 hour.\n */\nexport const minutesInHour = 60;\n\n/**\n * @constant\n * @name monthsInQuarter\n * @summary Months in 1 quarter.\n */\nexport const monthsInQuarter = 3;\n\n/**\n * @constant\n * @name monthsInYear\n * @summary Months in 1 year.\n */\nexport const monthsInYear = 12;\n\n/**\n * @constant\n * @name quartersInYear\n * @summary Quarters in 1 year\n */\nexport const quartersInYear = 4;\n\n/**\n * @constant\n * @name secondsInHour\n * @summary Seconds in 1 hour.\n */\nexport const secondsInHour = 3600;\n\n/**\n * @constant\n * @name secondsInMinute\n * @summary Seconds in 1 minute.\n */\nexport const secondsInMinute = 60;\n\n/**\n * @constant\n * @name secondsInDay\n * @summary Seconds in 1 day.\n */\nexport const secondsInDay = secondsInHour * 24;\n\n/**\n * @constant\n * @name secondsInWeek\n * @summary Seconds in 1 week.\n */\nexport const secondsInWeek = secondsInDay * 7;\n\n/**\n * @constant\n * @name secondsInYear\n * @summary Seconds in 1 year.\n */\nexport const secondsInYear = secondsInDay * daysInYear;\n\n/**\n * @constant\n * @name secondsInMonth\n * @summary Seconds in 1 month\n */\nexport const secondsInMonth = secondsInYear / 12;\n\n/**\n * @constant\n * @name secondsInQuarter\n * @summary Seconds in 1 quarter.\n */\nexport const secondsInQuarter = secondsInMonth * 3;\n\n/**\n * @constant\n * @name constructFromSymbol\n * @summary Symbol enabling Date extensions to inherit properties from the reference date.\n *\n * The symbol is used to enable the `constructFrom` function to construct a date\n * using a reference date and a value. It allows to transfer extra properties\n * from the reference date to the new date. It's useful for extensions like\n * [`TZDate`](https://github.com/date-fns/tz) that accept a time zone as\n * a constructor argument.\n */\nexport const constructFromSymbol = Symbol.for(\"constructDateFrom\");\n","import { constructFromSymbol } from \"./constants.js\";\n\n/**\n * @name constructFrom\n * @category Generic Helpers\n * @summary Constructs a date using the reference date and the value\n *\n * @description\n * The function constructs a new date using the constructor from the reference\n * date and the given value. It helps to build generic functions that accept\n * date extensions.\n *\n * It defaults to `Date` if the passed reference date is a number or a string.\n *\n * Starting from v3.7.0, it allows to construct a date using `[Symbol.for(\"constructDateFrom\")]`\n * enabling to transfer extra properties from the reference date to the new date.\n * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)\n * that accept a time zone as a constructor argument.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The reference date to take constructor from\n * @param value - The value to create the date\n *\n * @returns Date initialized using the given date and value\n *\n * @example\n * import { constructFrom } from \"./constructFrom/date-fns\";\n *\n * // A function that clones a date preserving the original type\n * function cloneDate<DateType extends Date>(date: DateType): DateType {\n * return constructFrom(\n * date, // Use constructor from the given date\n * date.getTime() // Use the date value to create a new date\n * );\n * }\n */\nexport function constructFrom(date, value) {\n if (typeof date === \"function\") return date(value);\n\n if (date && typeof date === \"object\" && constructFromSymbol in date)\n return date[constructFromSymbol](value);\n\n if (date instanceof Date) return new date.constructor(value);\n\n return new Date(value);\n}\n\n// Fallback for modularized imports:\nexport default constructFrom;\n","import { constructFrom } from \"../constructFrom.js\";\n\nexport function normalizeDates(context, ...dates) {\n const normalize = constructFrom.bind(\n null,\n context || dates.find((date) => typeof date === \"object\"),\n );\n return dates.map(normalize);\n}\n","import { constructFrom } from \"./constructFrom.js\";\n\n/**\n * @name toDate\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If the argument is none of the above, the function returns Invalid Date.\n *\n * Starting from v3.7.0, it clones a date using `[Symbol.for(\"constructDateFrom\")]`\n * enabling to transfer extra properties from the reference date to the new date.\n * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)\n * that accept a time zone as a constructor argument.\n *\n * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param argument - The value to convert\n *\n * @returns The parsed date in the local time zone\n *\n * @example\n * // Clone the date:\n * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert the timestamp to date:\n * const result = toDate(1392098430000)\n * //=> Tue Feb 11 2014 11:30:30\n */\nexport function toDate(argument, context) {\n // [TODO] Get rid of `toDate` or `constructFrom`?\n return constructFrom(context || argument, argument);\n}\n\n// Fallback for modularized imports:\nexport default toDate;\n","import { toDate } from \"../toDate.js\";\n\n/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nexport function getTimezoneOffsetInMilliseconds(date) {\n const _date = toDate(date);\n const utcDate = new Date(\n Date.UTC(\n _date.getFullYear(),\n _date.getMonth(),\n _date.getDate(),\n _date.getHours(),\n _date.getMinutes(),\n _date.getSeconds(),\n _date.getMilliseconds(),\n ),\n );\n utcDate.setUTCFullYear(_date.getFullYear());\n return +date - +utcDate;\n}\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link startOfDay} function options.\n */\n\n/**\n * @name startOfDay\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - The options\n *\n * @returns The start of a day\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\nexport function startOfDay(date, options) {\n const _date = toDate(date, options?.in);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfDay;\n","import { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.js\";\nimport { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { millisecondsInDay } from \"./constants.js\";\nimport { startOfDay } from \"./startOfDay.js\";\n\n/**\n * The {@link differenceInCalendarDays} function options.\n */\n\n/**\n * @name differenceInCalendarDays\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates. This means that the times are removed\n * from the dates and then the difference in days is calculated.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - The options object\n *\n * @returns The number of calendar days\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n * // How many calendar days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInCalendarDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 1\n */\nexport function differenceInCalendarDays(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n\n const laterStartOfDay = startOfDay(laterDate_);\n const earlierStartOfDay = startOfDay(earlierDate_);\n\n const laterTimestamp =\n +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);\n const earlierTimestamp =\n +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);\n\n // Round the number of days to the nearest integer because the number of\n // milliseconds in a day is not constant (e.g. it's different in the week of\n // the daylight saving time clock shift).\n return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarDays;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\n\n/**\n * The {@link differenceInCalendarMonths} function options.\n */\n\n/**\n * @name differenceInCalendarMonths\n * @category Month Helpers\n * @summary Get the number of calendar months between the given dates.\n *\n * @description\n * Get the number of calendar months between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options\n *\n * @returns The number of calendar months\n *\n * @example\n * // How many calendar months are between 31 January 2014 and 1 September 2014?\n * const result = differenceInCalendarMonths(\n * new Date(2014, 8, 1),\n * new Date(2014, 0, 31)\n * )\n * //=> 8\n */\nexport function differenceInCalendarMonths(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n\n const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();\n const monthsDiff = laterDate_.getMonth() - earlierDate_.getMonth();\n\n return yearsDiff * 12 + monthsDiff;\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarMonths;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * The {@link getQuarter} function options.\n */\n\n/**\n * @name getQuarter\n * @category Quarter Helpers\n * @summary Get the year quarter of the given date.\n *\n * @description\n * Get the year quarter of the given date.\n *\n * @param date - The given date\n * @param options - An object with options\n *\n * @returns The quarter\n *\n * @example\n * // Which quarter is 2 July 2014?\n * const result = getQuarter(new Date(2014, 6, 2));\n * //=> 3\n */\nexport function getQuarter(date, options) {\n const _date = toDate(date, options?.in);\n const quarter = Math.trunc(_date.getMonth() / 3) + 1;\n return quarter;\n}\n\n// Fallback for modularized imports:\nexport default getQuarter;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { getQuarter } from \"./getQuarter.js\";\n\n/**\n * The {@link differenceInCalendarQuarters} function options.\n */\n\n/**\n * @name differenceInCalendarQuarters\n * @category Quarter Helpers\n * @summary Get the number of calendar quarters between the given dates.\n *\n * @description\n * Get the number of calendar quarters between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options\n *\n * @returns The number of calendar quarters\n *\n * @example\n * // How many calendar quarters are between 31 December 2013 and 2 July 2014?\n * const result = differenceInCalendarQuarters(\n * new Date(2014, 6, 2),\n * new Date(2013, 11, 31)\n * )\n * //=> 3\n */\nexport function differenceInCalendarQuarters(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n\n const yearsDiff = laterDate_.getFullYear() - earlierDate_.getFullYear();\n const quartersDiff = getQuarter(laterDate_) - getQuarter(earlierDate_);\n\n return yearsDiff * 4 + quartersDiff;\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarQuarters;\n","let defaultOptions = {};\n\nexport function getDefaultOptions() {\n return defaultOptions;\n}\n\nexport function setDefaultOptions(newOptions) {\n defaultOptions = newOptions;\n}\n","import { getDefaultOptions } from \"./_lib/defaultOptions.js\";\nimport { toDate } from \"./toDate.js\";\n\n/**\n * The {@link startOfWeek} function options.\n */\n\n/**\n * @name startOfWeek\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.\n *\n * @param date - The original date\n * @param options - An object with options\n *\n * @returns The start of a week\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport function startOfWeek(date, options) {\n const defaultOptions = getDefaultOptions();\n const weekStartsOn =\n options?.weekStartsOn ??\n options?.locale?.options?.weekStartsOn ??\n defaultOptions.weekStartsOn ??\n defaultOptions.locale?.options?.weekStartsOn ??\n 0;\n\n const _date = toDate(date, options?.in);\n const day = _date.getDay();\n const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n\n _date.setDate(_date.getDate() - diff);\n _date.setHours(0, 0, 0, 0);\n return _date;\n}\n\n// Fallback for modularized imports:\nexport default startOfWeek;\n","import { getTimezoneOffsetInMilliseconds } from \"./_lib/getTimezoneOffsetInMilliseconds.js\";\nimport { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { millisecondsInWeek } from \"./constants.js\";\nimport { startOfWeek } from \"./startOfWeek.js\";\n\n/**\n * The {@link differenceInCalendarWeeks} function options.\n */\n\n/**\n * @name differenceInCalendarWeeks\n * @category Week Helpers\n * @summary Get the number of calendar weeks between the given dates.\n *\n * @description\n * Get the number of calendar weeks between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options.\n *\n * @returns The number of calendar weeks\n *\n * @example\n * // How many calendar weeks are between 5 July 2014 and 20 July 2014?\n * const result = differenceInCalendarWeeks(\n * new Date(2014, 6, 20),\n * new Date(2014, 6, 5)\n * )\n * //=> 3\n *\n * @example\n * // If the week starts on Monday,\n * // how many calendar weeks are between 5 July 2014 and 20 July 2014?\n * const result = differenceInCalendarWeeks(\n * new Date(2014, 6, 20),\n * new Date(2014, 6, 5),\n * { weekStartsOn: 1 }\n * )\n * //=> 2\n */\nexport function differenceInCalendarWeeks(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n\n const laterStartOfWeek = startOfWeek(laterDate_, options);\n const earlierStartOfWeek = startOfWeek(earlierDate_, options);\n\n const laterTimestamp =\n +laterStartOfWeek - getTimezoneOffsetInMilliseconds(laterStartOfWeek);\n const earlierTimestamp =\n +earlierStartOfWeek - getTimezoneOffsetInMilliseconds(earlierStartOfWeek);\n\n return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInWeek);\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarWeeks;\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\n\n/**\n * The {@link differenceInCalendarYears} function options.\n */\n\n/**\n * @name differenceInCalendarYears\n * @category Year Helpers\n * @summary Get the number of calendar years between the given dates.\n *\n * @description\n * Get the number of calendar years between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options\n\n * @returns The number of calendar years\n *\n * @example\n * // How many calendar years are between 31 December 2013 and 11 February 2015?\n * const result = differenceInCalendarYears(\n * new Date(2015, 1, 11),\n * new Date(2013, 11, 31)\n * );\n * //=> 2\n */\nexport function differenceInCalendarYears(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n return laterDate_.getFullYear() - earlierDate_.getFullYear();\n}\n\n// Fallback for modularized imports:\nexport default differenceInCalendarYears;\n","export function getRoundingMethod(method) {\n return (number) => {\n const round = method ? Math[method] : Math.trunc;\n const result = round(number);\n // Prevent negative zero\n return result === 0 ? 0 : result;\n };\n}\n","import { getRoundingMethod } from \"./_lib/getRoundingMethod.js\";\nimport { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { millisecondsInHour } from \"./constants.js\";\n\n/**\n * The {@link differenceInHours} function options.\n */\n\n/**\n * @name differenceInHours\n * @category Hour Helpers\n * @summary Get the number of hours between the given dates.\n *\n * @description\n * Get the number of hours between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options.\n *\n * @returns The number of hours\n *\n * @example\n * // How many hours are between 2 July 2014 06:50:00 and 2 July 2014 19:00:00?\n * const result = differenceInHours(\n * new Date(2014, 6, 2, 19, 0),\n * new Date(2014, 6, 2, 6, 50)\n * )\n * //=> 12\n */\nexport function differenceInHours(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n const diff = (+laterDate_ - +earlierDate_) / millisecondsInHour;\n return getRoundingMethod(options?.roundingMethod)(diff);\n}\n\n// Fallback for modularized imports:\nexport default differenceInHours;\n","import { toDate } from \"./toDate.js\";\n\n/**\n * @name differenceInMilliseconds\n * @category Millisecond Helpers\n * @summary Get the number of milliseconds between the given dates.\n *\n * @description\n * Get the number of milliseconds between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n *\n * @returns The number of milliseconds\n *\n * @example\n * // How many milliseconds are between\n * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?\n * const result = differenceInMilliseconds(\n * new Date(2014, 6, 2, 12, 30, 21, 700),\n * new Date(2014, 6, 2, 12, 30, 20, 600)\n * )\n * //=> 1100\n */\nexport function differenceInMilliseconds(laterDate, earlierDate) {\n return +toDate(laterDate) - +toDate(earlierDate);\n}\n\n// Fallback for modularized imports:\nexport default differenceInMilliseconds;\n","import { getRoundingMethod } from \"./_lib/getRoundingMethod.js\";\nimport { millisecondsInMinute } from \"./constants.js\";\nimport { differenceInMilliseconds } from \"./differenceInMilliseconds.js\";\n\n/**\n * The {@link differenceInMinutes} function options.\n */\n\n/**\n * @name differenceInMinutes\n * @category Minute Helpers\n * @summary Get the number of minutes between the given dates.\n *\n * @description\n * Get the signed number of full (rounded towards 0) minutes between the given dates.\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n * @param options - An object with options.\n *\n * @returns The number of minutes\n *\n * @example\n * // How many minutes are between 2 July 2014 12:07:59 and 2 July 2014 12:20:00?\n * const result = differenceInMinutes(\n * new Date(2014, 6, 2, 12, 20, 0),\n * new Date(2014, 6, 2, 12, 7, 59)\n * )\n * //=> 12\n *\n * @example\n * // How many minutes are between 10:01:59 and 10:00:00\n * const result = differenceInMinutes(\n * new Date(2000, 0, 1, 10, 0, 0),\n * new Date(2000, 0, 1, 10, 1, 59)\n * )\n * //=> -1\n */\nexport function differenceInMinutes(dateLeft, dateRight, options) {\n const diff =\n differenceInMilliseconds(dateLeft, dateRight) / millisecondsInMinute;\n return getRoundingMethod(options?.roundingMethod)(diff);\n}\n\n// Fallback for modularized imports:\nexport default differenceInMinutes;\n","import { getRoundingMethod } from \"./_lib/getRoundingMethod.js\";\nimport { differenceInMilliseconds } from \"./differenceInMilliseconds.js\";\n\n/**\n * The {@link differenceInSeconds} function options.\n */\n\n/**\n * @name differenceInSeconds\n * @category Second Helpers\n * @summary Get the number of seconds between the given dates.\n *\n * @description\n * Get the number of seconds between the given dates.\n *\n * @param laterDate - The later date\n * @param earlierDate - The earlier date\n * @param options - An object with options.\n *\n * @returns The number of seconds\n *\n * @example\n * // How many seconds are between\n * // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000?\n * const result = differenceInSeconds(\n * new Date(2014, 6, 2, 12, 30, 20, 0),\n * new Date(2014, 6, 2, 12, 30, 7, 999)\n * )\n * //=> 12\n */\nexport function differenceInSeconds(laterDate, earlierDate, options) {\n const diff = differenceInMilliseconds(laterDate, earlierDate) / 1000;\n return getRoundingMethod(options?.roundingMethod)(diff);\n}\n\n// Fallback for modularized imports:\nexport default differenceInSeconds;\n","import { intlFormatDistance } from 'date-fns/intlFormatDistance';\n\nfunction getLocale(locale?: string) {\n const defaultLocale = 'en-US';\n if (!locale) {\n if (typeof navigator !== 'undefined') {\n locale = navigator.language;\n } else {\n locale = defaultLocale;\n }\n }\n\n return locale;\n}\nexport function formatDistance(timestamp: Date, localeParam?: string) {\n const locale = getLocale(localeParam);\n\n return intlFormatDistance(timestamp, new Date(), { locale, style: 'short' });\n}\n\nexport function formatDate(date: Date, localeParam?: string) {\n const locale = getLocale(localeParam);\n\n return date.toLocaleDateString(locale, {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n hour12: true,\n });\n}\n\nexport function formatChartTick(value: Date | string | undefined, locale = 'en-US'): string {\n if (typeof value === 'string') return value;\n if (!(value instanceof Date)) return '';\n\n return value.toLocaleDateString(locale, { month: 'short', day: 'numeric' });\n}\n\nexport function formatChartLabel(value: Date | string | undefined, locale = 'en-US'): string {\n if (typeof value === 'string') return value;\n if (!(value instanceof Date)) return '';\n\n return value.toLocaleDateString(locale, { month: 'long', day: 'numeric', year: 'numeric' });\n}\n","import { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport {\n secondsInDay,\n secondsInHour,\n secondsInMinute,\n secondsInMonth,\n secondsInQuarter,\n secondsInWeek,\n secondsInYear,\n} from \"./constants.js\";\nimport { differenceInCalendarDays } from \"./differenceInCalendarDays.js\";\nimport { differenceInCalendarMonths } from \"./differenceInCalendarMonths.js\";\nimport { differenceInCalendarQuarters } from \"./differenceInCalendarQuarters.js\";\nimport { differenceInCalendarWeeks } from \"./differenceInCalendarWeeks.js\";\nimport { differenceInCalendarYears } from \"./differenceInCalendarYears.js\";\nimport { differenceInHours } from \"./differenceInHours.js\";\nimport { differenceInMinutes } from \"./differenceInMinutes.js\";\nimport { differenceInSeconds } from \"./differenceInSeconds.js\";\n\n/**\n * The {@link intlFormatDistance} function options.\n */\n\n/**\n * The unit used to format the distance in {@link intlFormatDistance}.\n */\n\n/**\n * @name intlFormatDistance\n * @category Common Helpers\n * @summary Formats distance between two dates in a human-readable format\n * @description\n * The function calculates the difference between two dates and formats it as a human-readable string.\n *\n * The function will pick the most appropriate unit depending on the distance between dates. For example, if the distance is a few hours, it might return `x hours`. If the distance is a few months, it might return `x months`.\n *\n * You can also specify a unit to force using it regardless of the distance to get a result like `123456 hours`.\n *\n * See the table below for the unit picking logic:\n *\n * | Distance between dates | Result (past) | Result (future) |\n * | ---------------------- | -------------- | --------------- |\n * | 0 seconds | now | now |\n * | 1-59 seconds | X seconds ago | in X seconds |\n * | 1-59 minutes | X minutes ago | in X minutes |\n * | 1-23 hours | X hours ago | in X hours |\n * | 1 day | yesterday | tomorrow |\n * | 2-6 days | X days ago | in X days |\n * | 7 days | last week | next week |\n * | 8 days-1 month | X weeks ago | in X weeks |\n * | 1 month | last month | next month |\n * | 2-3 months | X months ago | in X months |\n * | 1 quarter | last quarter | next quarter |\n * | 2-3 quarters | X quarters ago | in X quarters |\n * | 1 year | last year | next year |\n * | 2+ years | X years ago | in X years |\n *\n * @param laterDate - The date\n * @param earlierDate - The date to compare with.\n * @param options - An object with options.\n * See MDN for details [Locale identification and negotiation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation)\n * The narrow one could be similar to the short one for some locales.\n *\n * @returns The distance in words according to language-sensitive relative time formatting.\n *\n * @throws `date` must not be Invalid Date\n * @throws `baseDate` must not be Invalid Date\n * @throws `options.unit` must not be invalid Unit\n * @throws `options.locale` must not be invalid locale\n * @throws `options.localeMatcher` must not be invalid localeMatcher\n * @throws `options.numeric` must not be invalid numeric\n * @throws `options.style` must not be invalid style\n *\n * @example\n * // What is the distance between the dates when the fist date is after the second?\n * intlFormatDistance(\n * new Date(1986, 3, 4, 11, 30, 0),\n * new Date(1986, 3, 4, 10, 30, 0)\n * )\n * //=> 'in 1 hour'\n *\n * // What is the distance between the dates when the fist date is before the second?\n * intlFormatDistance(\n * new Date(1986, 3, 4, 10, 30, 0),\n * new Date(1986, 3, 4, 11, 30, 0)\n * )\n * //=> '1 hour ago'\n *\n * @example\n * // Use the unit option to force the function to output the result in quarters. Without setting it, the example would return \"next year\"\n * intlFormatDistance(\n * new Date(1987, 6, 4, 10, 30, 0),\n * new Date(1986, 3, 4, 10, 30, 0),\n * { unit: 'quarter' }\n * )\n * //=> 'in 5 quarters'\n *\n * @example\n * // Use the locale option to get the result in Spanish. Without setting it, the example would return \"in 1 hour\".\n * intlFormatDistance(\n * new Date(1986, 3, 4, 11, 30, 0),\n * new Date(1986, 3, 4, 10, 30, 0),\n * { locale: 'es' }\n * )\n * //=> 'dentro de 1 hora'\n *\n * @example\n * // Use the numeric option to force the function to use numeric values. Without setting it, the example would return \"tomorrow\".\n * intlFormatDistance(\n * new Date(1986, 3, 5, 11, 30, 0),\n * new Date(1986, 3, 4, 11, 30, 0),\n * { numeric: 'always' }\n * )\n * //=> 'in 1 day'\n *\n * @example\n * // Use the style option to force the function to use short values. Without setting it, the example would return \"in 2 years\".\n * intlFormatDistance(\n * new Date(1988, 3, 4, 11, 30, 0),\n * new Date(1986, 3, 4, 11, 30, 0),\n * { style: 'short' }\n * )\n * //=> 'in 2 yr'\n */\nexport function intlFormatDistance(laterDate, earlierDate, options) {\n let value = 0;\n let unit;\n\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n\n if (!options?.unit) {\n // Get the unit based on diffInSeconds calculations if no unit is specified\n const diffInSeconds = differenceInSeconds(laterDate_, earlierDate_); // The smallest unit\n\n if (Math.abs(diffInSeconds) < secondsInMinute) {\n value = differenceInSeconds(laterDate_, earlierDate_);\n unit = \"second\";\n } else if (Math.abs(diffInSeconds) < secondsInHour) {\n value = differenceInMinutes(laterDate_, earlierDate_);\n unit = \"minute\";\n } else if (\n Math.abs(diffInSeconds) < secondsInDay &&\n Math.abs(differenceInCalendarDays(laterDate_, earlierDate_)) < 1\n ) {\n value = differenceInHours(laterDate_, earlierDate_);\n unit = \"hour\";\n } else if (\n Math.abs(diffInSeconds) < secondsInWeek &&\n (value = differenceInCalendarDays(laterDate_, earlierDate_)) &&\n Math.abs(value) < 7\n ) {\n unit = \"day\";\n } else if (Math.abs(diffInSeconds) < secondsInMonth) {\n value = differenceInCalendarWeeks(laterDate_, earlierDate_);\n unit = \"week\";\n } else if (Math.abs(diffInSeconds) < secondsInQuarter) {\n value = differenceInCalendarMonths(laterDate_, earlierDate_);\n unit = \"month\";\n } else if (Math.abs(diffInSeconds) < secondsInYear) {\n if (differenceInCalendarQuarters(laterDate_, earlierDate_) < 4) {\n // To filter out cases that are less than a year but match 4 quarters\n value = differenceInCalendarQuarters(laterDate_, earlierDate_);\n unit = \"quarter\";\n } else {\n value = differenceInCalendarYears(laterDate_, earlierDate_);\n unit = \"year\";\n }\n } else {\n value = differenceInCalendarYears(laterDate_, earlierDate_);\n unit = \"year\";\n }\n } else {\n // Get the value if unit is specified\n unit = options?.unit;\n if (unit === \"second\") {\n value = differenceInSeconds(laterDate_, earlierDate_);\n } else if (unit === \"minute\") {\n value = differenceInMinutes(laterDate_, earlierDate_);\n } else if (unit === \"hour\") {\n value = differenceInHours(laterDate_, earlierDate_);\n } else if (unit === \"day\") {\n value = differenceInCalendarDays(laterDate_, earlierDate_);\n } else if (unit === \"week\") {\n value = differenceInCalendarWeeks(laterDate_, earlierDate_);\n } else if (unit === \"month\") {\n value = differenceInCalendarMonths(laterDate_, earlierDate_);\n } else if (unit === \"quarter\") {\n value = differenceInCalendarQuarters(laterDate_, earlierDate_);\n } else if (unit === \"year\") {\n value = differenceInCalendarYears(laterDate_, earlierDate_);\n }\n }\n\n const rtf = new Intl.RelativeTimeFormat(options?.locale, {\n numeric: \"auto\",\n ...options,\n });\n\n return rtf.format(value, unit);\n}\n\n// Fallback for modularized imports:\nexport default intlFormatDistance;\n"],"names":["secondsInDay","secondsInHour","secondsInYear","secondsInMonth","constructFromSymbol","Symbol","for","constructFrom","date","value","Date","constructor","normalizeDates","context","dates","normalize","bind","find","map","toDate","argument","getTimezoneOffsetInMilliseconds","_date","utcDate","UTC","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","getMilliseconds","setUTCFullYear","startOfDay","options","setHours","differenceInCalendarDays","laterDate","earlierDate","laterDate_","earlierDate_","in","laterStartOfDay","earlierStartOfDay","laterTimestamp","earlierTimestamp","Math","round","differenceInCalendarMonths","getQuarter","trunc","differenceInCalendarQuarters","defaultOptions","getDefaultOptions","startOfWeek","weekStartsOn","locale","day","getDay","diff","setDate","differenceInCalendarWeeks","laterStartOfWeek","earlierStartOfWeek","differenceInCalendarYears","getRoundingMethod","method","number","result","differenceInHours","roundingMethod","differenceInMilliseconds","differenceInMinutes","dateLeft","dateRight","differenceInSeconds","getLocale","navigator","language","formatDistance","timestamp","localeParam","unit","diffInSeconds","abs","Intl","RelativeTimeFormat","numeric","format","intlFormatDistance","style","formatDate","toLocaleDateString","month","year","hour","minute","hour12","formatChartTick","formatChartLabel"],"mappings":"AAqCO,MAyIMA,EAAeC,MAcfC,EAAgBF,SAOhBG,EAAiBD,QAoBjBE,EAAsBC,OAAOC,IAAI,qBClLvC,SAASC,EAAcC,EAAMC,GAClC,MAAoB,mBAATD,EAA4BA,EAAKC,GAExCD,GAAwB,iBAATA,GAAqBJ,KAAuBI,EACtDA,EAAKJ,GAAqBK,GAE/BD,aAAgBE,KAAa,IAAIF,EAAKG,YAAYF,GAE/C,IAAIC,KAAKD,EAClB,CC5CO,SAASG,EAAeC,KAAYC,GACzC,MAAMC,EAAYR,EAAcS,KAC9B,KACAH,GAAWC,EAAMG,KAAMT,GAAyB,iBAATA,IAEzC,OAAOM,EAAMI,IAAIH,EACnB,CCgCO,SAASI,EAAOC,EAAUP,GAE/B,OAAON,EAAyBa,EAAUA,EAC5C,CC9BO,SAASC,EAAgCb,GAC9C,MAAMc,EAAQH,EAAOX,GACfe,EAAU,IAAIb,KAClBA,KAAKc,IACHF,EAAMG,cACNH,EAAMI,WACNJ,EAAMK,UACNL,EAAMM,WACNN,EAAMO,aACNP,EAAMQ,aACNR,EAAMS,oBAIV,OADAR,EAAQS,eAAeV,EAAMG,gBACrBjB,GAAQe,CAClB,CCAO,SAASU,EAAWzB,EAAM0B,GAC/B,MAAMZ,EAAQH,EAAOX,GAErB,OADAc,EAAMa,SAAS,EAAG,EAAG,EAAG,GACjBb,CACT,CCQO,SAASc,EAAyBC,EAAWC,EAAaJ,GA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GMsD,OAAO/E,EAAOyE,EAC3B,CD1LSO,CAAmBT,iBAAW,IAAItE,KAAQ,CAAE8C,SAAQkC,MAAO,SACpE,CAEO,SAASC,EAAWnF,EAAYyE,GACrC,MAAMzB,EAASoB,EAAUK,GAEzB,OAAOzE,EAAKoF,mBAAmBpC,EAAQ,CACrCqC,MAAO,QACPpC,IAAK,UACLqC,KAAM,UACNC,KAAM,UACNC,OAAQ,UACRC,QAAQ,GAEZ,CAEO,SAASC,EAAgBzF,EAAkC+C,EAAS,SACzE,MAAqB,iBAAV/C,EAA2BA,EAChCA,aAAiBC,KAEhBD,EAAMmF,mBAAmBpC,EAAQ,CAAEqC,MAAO,QAASpC,IAAK,YAF1B,EAGvC,CAEO,SAAS0C,EAAiB1F,EAAkC+C,EAAS,SAC1E,MAAqB,iBAAV/C,EAA2BA,EAChCA,aAAiBC,KAEhBD,EAAMmF,mBAAmBpC,EAAQ,CAAEqC,MAAO,OAAQpC,IAAK,UAAWqC,KAAM,YAF1C,EAGvC","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20]}
@@ -0,0 +1,2 @@
1
+ const t=(t,o={maximumFractionDigits:1,notation:"compact"})=>{const a=Intl.DateTimeFormat().resolvedOptions().locale;return Intl.NumberFormat(a,o).format(t)};export{t as f};
2
+ //# sourceMappingURL=formatNumber.DhVn228t.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"formatNumber.Bm2k8QrT.js","sources":["../../../src/lib/formatNumber.ts"],"sourcesContent":["export const formatNumber = (\n number: number,\n options: Intl.NumberFormatOptions = {\n maximumFractionDigits: 1,\n notation: 'compact',\n },\n) => {\n // get region from browser\n const region = Intl.DateTimeFormat().resolvedOptions().locale;\n\n return Intl.NumberFormat(region, options).format(number);\n};\n"],"names":[],"mappings":"AAAO,MAAM,YAAA,GAAe,CAC1B,MAAA,EACA,OAAA,GAAoC;AAAA,EAClC,qBAAA,EAAuB,CAAA;AAAA,EACvB,QAAA,EAAU;AACZ,CAAA,KACG;AAEH,EAAA,MAAM,MAAA,GAAS,IAAA,CAAK,cAAA,EAAe,CAAE,iBAAgB,CAAE,MAAA;AAEvD,EAAA,OAAO,KAAK,YAAA,CAAa,MAAA,EAAQ,OAAO,CAAA,CAAE,OAAO,MAAM,CAAA;AACzD;;;;"}
1
+ {"version":3,"file":"formatNumber.DhVn228t.js","sources":["../../../src/lib/formatNumber.ts"],"sourcesContent":["export const formatNumber = (\n number: number,\n options: Intl.NumberFormatOptions = {\n maximumFractionDigits: 1,\n notation: 'compact',\n },\n) => {\n // get region from browser\n const region = Intl.DateTimeFormat().resolvedOptions().locale;\n\n return Intl.NumberFormat(region, options).format(number);\n};\n"],"names":["formatNumber","number","options","maximumFractionDigits","notation","region","Intl","DateTimeFormat","resolvedOptions","locale","NumberFormat","format"],"mappings":"AAAO,MAAMA,EAAe,CAC1BC,EACAC,EAAoC,CAClCC,sBAAuB,EACvBC,SAAU,cAIZ,MAAMC,EAASC,KAAKC,iBAAiBC,kBAAkBC,OAEvD,OAAOH,KAAKI,aAAaL,EAAQH,GAASS,OAAOV"}
@@ -0,0 +1,7 @@
1
+ import e,{useState as t,useEffect as a,useId as r}from"react";import{cva as n}from"class-variance-authority";import{c as o}from"./utils.C6Qu-kwd.js";import{_ as s}from"./extends.DPdBf6DS.js";function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(f=function(){return!!e})()}function u(e){var t="function"==typeof Map?new Map:void 0;return u=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,a)}function a(){return function(e,t,a){if(f())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var n=new(e.bind.apply(e,r));return a&&l(n,a.prototype),n}(e,arguments,i(this).constructor)}return a.prototype=Object.create(e.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),l(a,e)},u(e)}var p={1:"Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n",2:"Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n",3:"Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",4:"Couldn't generate valid rgb string from %s, it returned %s.\n\n",5:"Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",6:"Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n",7:"Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n",8:"Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",9:"Please provide a number of steps to the modularScale helper.\n\n",10:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",11:'Invalid value passed as base to modularScale, expected number or em string but got "%s"\n\n',12:'Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.\n\n',13:'Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.\n\n',14:'Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',15:'Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',16:"You must provide a template to this method.\n\n",17:"You passed an unsupported selector state to this method.\n\n",18:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",19:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",20:"expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:"fontFace expects a name of a font-family.\n\n",24:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",25:"fontFace expects localFonts to be an array.\n\n",26:"fontFace expects fileFormats to be an array.\n\n",27:"radialGradient requries at least 2 color-stops to properly render.\n\n",28:"Please supply a filename to retinaImage() as the first argument.\n\n",29:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",32:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n",33:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",34:"borderRadius expects a radius value as a string or number as the second argument.\n\n",35:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',36:"Property must be a string value.\n\n",37:"Syntax Error at %s.\n\n",38:"Formula contains a function that needs parentheses at %s.\n\n",39:"Formula is missing closing parenthesis at %s.\n\n",40:"Formula has too many closing parentheses at %s.\n\n",41:"All values in a formula must have the same unit or be unitless.\n\n",42:"Please provide a number of steps to the modularScale helper.\n\n",43:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",44:"Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",45:"Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",46:"Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",47:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",48:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",49:"Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",50:"Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",51:"Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",52:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",53:"fontFace expects localFonts to be an array.\n\n",54:"fontFace expects fileFormats to be an array.\n\n",55:"fontFace expects a name of a font-family.\n\n",56:"linearGradient requries at least 2 color-stops to properly render.\n\n",57:"radialGradient requries at least 2 color-stops to properly render.\n\n",58:"Please supply a filename to retinaImage() as the first argument.\n\n",59:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:"Property must be a string value.\n\n",62:"borderRadius expects a radius value as a string or number as the second argument.\n\n",63:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',64:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",65:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n",66:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",67:"You must provide a template to this method.\n\n",68:"You passed an unsupported selector state to this method.\n\n",69:'Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.\n\n',70:'Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.\n\n',71:'Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.\n\n',72:'Passed invalid base value %s to %s(), please pass a value like "12px" or 12.\n\n',73:"Please provide a valid CSS variable.\n\n",74:"CSS variable not found and no default was provided.\n\n",75:"important requires a valid style object, got a %s instead.\n\n",76:"fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n",77:'remToPx expects a value in "rem" but you provided it in "%s".\n\n',78:'base must be set in "px" or "%" but you set it in "%s".\n'};function d(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];var r,n=t[0],o=[];for(r=1;r<t.length;r+=1)o.push(t[r]);return o.forEach(function(e){n=n.replace(/%[a-z]/,e)}),n}var c=/*#__PURE__*/function(e){var t,a;function r(t){var a;if("production"===process.env.NODE_ENV)a=e.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+t+" for more information.")||this;else{for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];a=e.call(this,d.apply(void 0,[p[t]].concat(n)))||this}return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(a)}return a=e,(t=r).prototype=Object.create(a.prototype),t.prototype.constructor=t,l(t,a),r}(/*#__PURE__*/u(Error)),m=/--[\S]*/g;function h(e,t){if(!e||!e.match(m))throw new c(73);var a;if("undefined"!=typeof document&&null!==document.documentElement&&(a=getComputedStyle(document.documentElement).getPropertyValue(e)),a)return a.trim();throw new c(74)}function b(e){return Math.round(255*e)}function g(e,t,a){return b(e)+","+b(t)+","+b(a)}function v(e,t,a,r){if(void 0===r&&(r=g),0===t)return r(a,a,a);var n=(e%360+360)%360/60,o=(1-Math.abs(2*a-1))*t,s=o*(1-Math.abs(n%2-1)),i=0,l=0,f=0;n>=0&&n<1?(i=o,l=s):n>=1&&n<2?(i=s,l=o):n>=2&&n<3?(l=o,f=s):n>=3&&n<4?(l=s,f=o):n>=4&&n<5?(i=s,f=o):n>=5&&n<6&&(i=o,f=s);var u=a-o/2;return r(i+u,l+u,f+u)}var y={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};var C=/^#[a-fA-F0-9]{6}$/,w=/^#[a-fA-F0-9]{8}$/,x=/^#[a-fA-F0-9]{3}$/,F=/^#[a-fA-F0-9]{4}$/,S=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,k=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,I=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,L=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;function P(e){if("string"!=typeof e)throw new c(3);var t=function(e){if("string"!=typeof e)return e;var t=e.toLowerCase();return y[t]?"#"+y[t]:e}(e);if(t.match(C))return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16)};if(t.match(w)){var a=parseFloat((parseInt(""+t[7]+t[8],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16),alpha:a}}if(t.match(x))return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16)};if(t.match(F)){var r=parseFloat((parseInt(""+t[4]+t[4],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16),alpha:r}}var n=S.exec(t);if(n)return{red:parseInt(""+n[1],10),green:parseInt(""+n[2],10),blue:parseInt(""+n[3],10)};var o=k.exec(t.substring(0,50));if(o)return{red:parseInt(""+o[1],10),green:parseInt(""+o[2],10),blue:parseInt(""+o[3],10),alpha:parseFloat(""+o[4])>1?parseFloat(""+o[4])/100:parseFloat(""+o[4])};var s=I.exec(t);if(s){var i="rgb("+v(parseInt(""+s[1],10),parseInt(""+s[2],10)/100,parseInt(""+s[3],10)/100)+")",l=S.exec(i);if(!l)throw new c(4,t,i);return{red:parseInt(""+l[1],10),green:parseInt(""+l[2],10),blue:parseInt(""+l[3],10)}}var f=L.exec(t.substring(0,50));if(f){var u="rgb("+v(parseInt(""+f[1],10),parseInt(""+f[2],10)/100,parseInt(""+f[3],10)/100)+")",p=S.exec(u);if(!p)throw new c(4,t,u);return{red:parseInt(""+p[1],10),green:parseInt(""+p[2],10),blue:parseInt(""+p[3],10),alpha:parseFloat(""+f[4])>1?parseFloat(""+f[4])/100:parseFloat(""+f[4])}}throw new c(5)}function j(e){return function(e){var t,a=e.red/255,r=e.green/255,n=e.blue/255,o=Math.max(a,r,n),s=Math.min(a,r,n),i=(o+s)/2;if(o===s)return void 0!==e.alpha?{hue:0,saturation:0,lightness:i,alpha:e.alpha}:{hue:0,saturation:0,lightness:i};var l=o-s,f=i>.5?l/(2-o-s):l/(o+s);switch(o){case a:t=(r-n)/l+(r<n?6:0);break;case r:t=(n-a)/l+2;break;default:t=(a-r)/l+4}return t*=60,void 0!==e.alpha?{hue:t,saturation:f,lightness:i,alpha:e.alpha}:{hue:t,saturation:f,lightness:i}}(P(e))}var E=function(e){return 7===e.length&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]?"#"+e[1]+e[3]+e[5]:e};function z(e){var t=e.toString(16);return 1===t.length?"0"+t:t}function M(e){return z(Math.round(255*e))}function O(e,t,a){return E("#"+M(e)+M(t)+M(a))}function H(e,t,a){return v(e,t,a,O)}function q(e,t,a){if("number"==typeof e&&"number"==typeof t&&"number"==typeof a)return E("#"+z(e)+z(t)+z(a));if("object"==typeof e&&void 0===t&&void 0===a)return E("#"+z(e.red)+z(e.green)+z(e.blue));throw new c(6)}function $(e,t,a,r){if("object"==typeof e&&void 0===t&&void 0===a&&void 0===r)return e.alpha>=1?q(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new c(7)}function T(e){if("object"!=typeof e)throw new c(8);if(function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&"number"==typeof e.alpha}(e))return $(e);if(function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&("number"!=typeof e.alpha||void 0===e.alpha)}(e))return q(e);if(function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&"number"==typeof e.alpha}(e))return function(e,t,a,r){if("object"==typeof e&&void 0===t&&void 0===a&&void 0===r)return e.alpha>=1?H(e.hue,e.saturation,e.lightness):"rgba("+v(e.hue,e.saturation,e.lightness)+","+e.alpha+")";throw new c(2)}(e);if(function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&("number"!=typeof e.alpha||void 0===e.alpha)}(e))return function(e,t,a){if("object"==typeof e&&void 0===t&&void 0===a)return H(e.hue,e.saturation,e.lightness);throw new c(1)}(e);throw new c(8)}function V(e,t,a){return function(){var r=a.concat(Array.prototype.slice.call(arguments));return r.length>=t?e.apply(this,r):V(e,t,r)}}function R(e){return V(e,e.length,[])}function _(e,t,a){return Math.max(e,Math.min(t,a))}R(function(e,t){if("transparent"===t)return t;var a=j(t);return T(s({},a,{hue:a.hue+parseFloat(e)}))}),R(function(e,t){if("transparent"===t)return t;var a=j(t);return T(s({},a,{lightness:_(0,1,a.lightness-parseFloat(e))}))}),R(function(e,t){if("transparent"===t)return t;var a=j(t);return T(s({},a,{saturation:_(0,1,a.saturation-parseFloat(e))}))}),R(function(e,t){if("transparent"===t)return t;var a=j(t);return T(s({},a,{lightness:_(0,1,a.lightness+parseFloat(e))}))});var A=R(function(e,t,a){if("transparent"===t)return a;if("transparent"===a)return t;if(0===e)return a;var r=P(t),n=s({},r,{alpha:"number"==typeof r.alpha?r.alpha:1}),o=P(a),i=s({},o,{alpha:"number"==typeof o.alpha?o.alpha:1}),l=n.alpha-i.alpha,f=2*parseFloat(e)-1,u=((f*l===-1?f:f+l)/(1+f*l)+1)/2,p=1-u;return $({red:Math.floor(n.red*u+i.red*p),green:Math.floor(n.green*u+i.green*p),blue:Math.floor(n.blue*u+i.blue*p),alpha:n.alpha*parseFloat(e)+i.alpha*(1-parseFloat(e))})});R(function(e,t){if("transparent"===t)return t;var a=P(t),r="number"==typeof a.alpha?a.alpha:1;return $(s({},a,{alpha:_(0,1,(100*r+100*parseFloat(e))/100)}))}),R(function(e,t){if("transparent"===t)return t;var a=j(t);return T(s({},a,{saturation:_(0,1,a.saturation+parseFloat(e))}))}),R(function(e,t){return"transparent"===t?t:T(s({},j(t),{hue:parseFloat(e)}))}),R(function(e,t){return"transparent"===t?t:T(s({},j(t),{lightness:parseFloat(e)}))}),R(function(e,t){return"transparent"===t?t:T(s({},j(t),{saturation:parseFloat(e)}))}),R(function(e,t){return"transparent"===t?t:A(parseFloat(e),"rgb(0, 0, 0)",t)}),R(function(e,t){return"transparent"===t?t:A(parseFloat(e),"rgb(255, 255, 255)",t)}),R(function(e,t){if("transparent"===t)return t;var a=P(t),r="number"==typeof a.alpha?a.alpha:1;return $(s({},a,{alpha:_(0,1,+(100*r-100*parseFloat(e)).toFixed(2)/100)}))});const N=(e,r)=>{const[n,o]=t(`var(${r})`),s=(()=>{const[e,r]=t(()=>document.documentElement.classList.contains("dark"));return a(()=>{const e=new MutationObserver(()=>{r(document.documentElement.classList.contains("dark"))});return e.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>e.disconnect()},[]),e})();return a(()=>{const t=h(e),a=h(r);if(t&&a){const a=function(e){if("transparent"===e)return 0;var t=P(e),a=Object.keys(t).map(function(e){var a=t[e]/255;return a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4)}),r=a[0],n=a[1],o=a[2];return parseFloat((.2126*r+.7152*n+.0722*o).toFixed(3))}(t.toString());o(a<=.5?s?"var(--bfc-ring)":`var(${e})`:s?`var(${e})`:`var(${r})`)}},[e,r,s]),n},G=n("min-w-5",{variants:{variant:{default:"size-6",gradient:"size-8",disabled:"size-8 grayscale"},loading:{true:"animate-spin"}},defaultVariants:{variant:"default"}}),Z="M16.0127 3.5C16.5221 3.50002 17.0197 3.65584 17.4375 3.94727C17.8553 4.23871 18.1736 4.65182 18.3496 5.12988L20.6445 11.3652L26.876 13.6689L27.0283 13.7246L27.0391 13.7402C27.4497 13.9244 27.8038 14.2171 28.0625 14.5879C28.3539 15.0057 28.5098 15.5032 28.5098 16.0127C28.5097 16.5221 28.3539 17.0197 28.0625 17.4375C27.7711 17.8552 27.3579 18.1737 26.8799 18.3496L20.6426 20.6445L18.334 26.8809C18.158 27.3587 17.8396 27.7712 17.4219 28.0625C17.0042 28.3538 16.5073 28.5097 15.998 28.5098C15.4886 28.5098 14.9911 28.3539 14.5732 28.0625C14.1554 27.771 13.8371 27.358 13.6611 26.8799L11.3652 20.6436L5.12891 18.334V18.333C4.65135 18.1569 4.23846 17.8394 3.94727 17.4219C3.65606 17.0042 3.5001 16.5072 3.5 15.998C3.5 15.4887 3.65596 14.991 3.94727 14.5732C4.2387 14.1554 4.65182 13.8371 5.12988 13.6611L11.3652 11.3652L13.6758 5.12891C13.8518 4.65116 14.1703 4.23855 14.5879 3.94727C15.0057 3.65585 15.5033 3.5 16.0127 3.5ZM13.9463 13.0498L13.9473 13.0508C13.8723 13.2565 13.7535 13.4438 13.5986 13.5986C13.4438 13.7535 13.2565 13.8723 13.0508 13.9473L13.0498 13.9463L7.46875 16.0049L13.0498 18.0625H13.0508C13.2564 18.1374 13.4438 18.2564 13.5986 18.4111C13.7529 18.5654 13.8713 18.7521 13.9463 18.957L16.0049 24.541L18.0684 18.9521L18.1328 18.8027C18.2049 18.6578 18.3001 18.5251 18.415 18.4102C18.5684 18.2568 18.7535 18.1385 18.957 18.0635L24.541 16.0049L18.9521 13.9414C18.7486 13.8664 18.5636 13.7481 18.4102 13.5947C18.2568 13.4413 18.1385 13.2563 18.0635 13.0527L16.0049 7.46875L13.9463 13.0498Z",D=[{offset:"0%",color:"rgba(232, 122, 249, 1)"},{offset:"14%",color:"rgba(251, 191, 37, 1)"},{offset:"33%",color:"rgba(251, 146, 61, 1)"},{offset:"51%",color:"rgba(244, 64, 94, 1)"},{offset:"68%",color:"rgba(140, 93, 246, 1)"},{offset:"83%",color:"rgba(60, 130, 246, 1)"},{offset:"100%",color:"rgba(232, 122, 249, 1)"}];function Y({loading:t,variant:a,className:n,...s}){const i=N("--bfc-primary","--bfc-border"),l="gradient"===a,f="disabled"===a,u=!l&&!f,p=r(),d=e=>l?e:f?"var(--bfc-v2-color-mono-600)":"var(--bfc-primary)";/* @__PURE__ */
2
+ return e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",className:o(G({variant:a}),n),...s},
3
+ /* @__PURE__ */e.createElement("path",{d:Z,fill:l?`url(#${p})`:f?"var(--bfc-v2-color-mono-600)":"var(--bfc-primary)"!==i?"var(--bfc-border)":"var(--bfc-primary)",className:o({"animate-spin [transform-box:fill-box]":t})}),
4
+ /* @__PURE__ */e.createElement("path",{stroke:"var(--bfc-v2-color-mono-100)",className:o({"animate-spin [transform-box:fill-box]":t}),d:Z}),u&&/* @__PURE__ */e.createElement("g",{className:"transform origin-center scale-125"},/* @__PURE__ */e.createElement("g",{className:o({"animate-spin [transform-box:fill-box]":t})},/* @__PURE__ */e.createElement("path",{fill:"var(--bfc-primary)",d:"M13.9463 13.0498L13.9473 13.0508C13.8723 13.2565 13.7535 13.4438 13.5986 13.5986C13.4438 13.7535 13.2565 13.8723 13.0508 13.9473L13.0498 13.9463L7.46875 16.0049L13.0498 18.0625H13.0508C13.2564 18.1374 13.4438 18.2564 13.5986 18.4111C13.7529 18.5654 13.8713 18.7521 13.9463 18.957L16.0049 24.541L18.0684 18.9521L18.1328 18.8027C18.2049 18.6578 18.3001 18.5251 18.415 18.4102C18.5684 18.2568 18.7535 18.1385 18.957 18.0635L24.541 16.0049L18.9521 13.9414C18.7486 13.8664 18.5636 13.7481 18.4102 13.5947C18.2568 13.4413 18.1385 13.2563 18.0635 13.0527L16.0049 7.46875L13.9463 13.0498Z"}))),
5
+ /* @__PURE__ */e.createElement("path",{fill:d("#3C82F6"),d:"M31.7071 9.70711C31.8946 9.51957 32 9.26522 32 9C32 8.73478 31.8946 8.48043 31.7071 8.29289C31.5196 8.10536 31.2652 8 31 8H30V7C30 6.73478 29.8946 6.48043 29.7071 6.29289C29.5196 6.10536 29.2652 6 29 6C28.7348 6 28.4804 6.10536 28.2929 6.29289C28.1054 6.48043 28 6.73478 28 7V8H27C26.7348 8 26.4804 8.10536 26.2929 8.29289C26.1054 8.48043 26 8.73478 26 9C26 9.26522 26.1054 9.51957 26.2929 9.70711C26.4804 9.89464 26.7348 10 27 10H28V11C28 11.2652 28.1054 11.5196 28.2929 11.7071C28.4804 11.8946 28.7348 12 29 12C29.2652 12 29.5196 11.8946 29.7071 11.7071C29.8946 11.5196 30 11.2652 30 11V10H31C31.2652 10 31.5196 9.89464 31.7071 9.70711Z"}),
6
+ /* @__PURE__ */e.createElement("path",{fill:d("#35D399"),d:"M19.2929 3.29289C19.1054 3.48043 19 3.73478 19 4C19 4.26522 19.1054 4.51957 19.2929 4.70711C19.4804 4.89464 19.7348 5 20 5H22V7C22 7.26522 22.1054 7.51957 22.2929 7.70711C22.4804 7.89464 22.7348 8 23 8C23.2652 8 23.5196 7.89464 23.7071 7.70711C23.8946 7.51957 24 7.26522 24 7V5H26C26.2652 5 26.5196 4.89464 26.7071 4.70711C26.8946 4.51957 27 4.26522 27 4C27 3.73478 26.8946 3.48043 26.7071 3.29289C26.5196 3.10536 26.2652 3 26 3H24V1C24 0.734784 23.8946 0.48043 23.7071 0.292893C23.5196 0.105357 23.2652 0 23 0C22.7348 0 22.4804 0.105357 22.2929 0.292893C22.1054 0.48043 22 0.734784 22 1V3H20C19.7348 3 19.4804 3.10536 19.2929 3.29289Z"}),l&&/* @__PURE__ */e.createElement("defs",null,/* @__PURE__ */e.createElement("linearGradient",{id:p,x1:"0%",y1:"0%",x2:"100%",y2:"100%"},D.map(t=>/* @__PURE__ */e.createElement("stop",{key:t.offset,offset:t.offset,stopColor:t.color})))))}export{Y as G,G as g};
7
+ //# sourceMappingURL=generating-star.BN9p_FDu.js.map