@purpur/library 9.2.2 → 9.3.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 (302) hide show
  1. package/CHANGELOG.json +42 -0
  2. package/CHANGELOG.md +21 -1
  3. package/dist/LICENSE.txt +1 -1
  4. package/dist/{RichText-Bi51HE6X.mjs → RichText-jZ-sHV-u.mjs} +2 -2
  5. package/dist/{RichText-Bi51HE6X.mjs.map → RichText-jZ-sHV-u.mjs.map} +1 -1
  6. package/dist/{RichText-DNroJJXv.js → RichText-yobCUjTD.js} +2 -2
  7. package/dist/{RichText-DNroJJXv.js.map → RichText-yobCUjTD.js.map} +1 -1
  8. package/dist/{ThemeProvider-bkyFCeo6.mjs → ThemeProvider-CkX-BNWN.mjs} +2 -2
  9. package/dist/ThemeProvider-CkX-BNWN.mjs.map +1 -0
  10. package/dist/{ThemeProvider-5r7lDX-h.js → ThemeProvider-Dy771oix.js} +2 -2
  11. package/dist/ThemeProvider-Dy771oix.js.map +1 -0
  12. package/dist/{accordion-OtFSShSB.mjs → accordion-CIU4U8-4.mjs} +3 -3
  13. package/dist/accordion-CIU4U8-4.mjs.map +1 -0
  14. package/dist/{accordion-OsA0HvdA.js → accordion-DyhOG54L.js} +2 -2
  15. package/dist/accordion-DyhOG54L.js.map +1 -0
  16. package/dist/accordion.cjs.js +1 -1
  17. package/dist/accordion.es.js +3 -3
  18. package/dist/{autocomplete-D9uCJzjY.js → autocomplete-3kV1btuI.js} +2 -2
  19. package/dist/{autocomplete-D9uCJzjY.js.map → autocomplete-3kV1btuI.js.map} +1 -1
  20. package/dist/{autocomplete-BipmyKf0.mjs → autocomplete-BEGRn-Wh.mjs} +2 -2
  21. package/dist/{autocomplete-BipmyKf0.mjs.map → autocomplete-BEGRn-Wh.mjs.map} +1 -1
  22. package/dist/autocomplete.cjs.js +1 -1
  23. package/dist/autocomplete.es.js +1 -1
  24. package/dist/{card-DR2hvxjZ.mjs → card-C2mdp-ur.mjs} +2 -2
  25. package/dist/{card-DR2hvxjZ.mjs.map → card-C2mdp-ur.mjs.map} +1 -1
  26. package/dist/{card-CRHXm5NR.js → card-DFdUs5RG.js} +2 -2
  27. package/dist/{card-CRHXm5NR.js.map → card-DFdUs5RG.js.map} +1 -1
  28. package/dist/card.cjs.js +1 -1
  29. package/dist/card.es.js +1 -1
  30. package/dist/{carousel-BkxojLwn.mjs → carousel-DLkTL9sj.mjs} +29 -29
  31. package/dist/{carousel-BkxojLwn.mjs.map → carousel-DLkTL9sj.mjs.map} +1 -1
  32. package/dist/{carousel-BCw-5u92.js → carousel-DXrtxRz5.js} +2 -2
  33. package/dist/{carousel-BCw-5u92.js.map → carousel-DXrtxRz5.js.map} +1 -1
  34. package/dist/carousel.cjs.js +1 -1
  35. package/dist/carousel.es.js +1 -1
  36. package/dist/checkbox-BHTx89JQ.mjs +236 -0
  37. package/dist/checkbox-BHTx89JQ.mjs.map +1 -0
  38. package/dist/checkbox-CDNcNv6d.js +2 -0
  39. package/dist/checkbox-CDNcNv6d.js.map +1 -0
  40. package/dist/checkbox.cjs.js +1 -1
  41. package/dist/checkbox.es.js +1 -1
  42. package/dist/{comparison-table-B8w65g43.js → comparison-table-CitEzX7h.js} +2 -2
  43. package/dist/comparison-table-CitEzX7h.js.map +1 -0
  44. package/dist/{comparison-table-D1zJpdLL.mjs → comparison-table-Dmbjsqyg.mjs} +52 -52
  45. package/dist/comparison-table-Dmbjsqyg.mjs.map +1 -0
  46. package/dist/comparison-table.cjs.js +1 -1
  47. package/dist/comparison-table.es.js +1 -1
  48. package/dist/components/accordion/src/accordion.d.ts +1 -1
  49. package/dist/components/accordion/src/accordion.d.ts.map +1 -1
  50. package/dist/components/checkbox/src/checkbox.d.ts +4 -0
  51. package/dist/components/checkbox/src/checkbox.d.ts.map +1 -1
  52. package/dist/components/comparison-table/src/comparison-table.d.ts +1 -1
  53. package/dist/components/comparison-table/src/comparison-table.d.ts.map +1 -1
  54. package/dist/components/dismissable-chip-group/src/dismissable-chip-group-item.d.ts.map +1 -1
  55. package/dist/components/dismissable-chip-group/src/dismissable-chip-group.d.ts +4 -2
  56. package/dist/components/dismissable-chip-group/src/dismissable-chip-group.d.ts.map +1 -1
  57. package/dist/components/drawer/src/drawer-header.d.ts.map +1 -1
  58. package/dist/components/dropdown/src/dropdown-combobox.d.ts.map +1 -1
  59. package/dist/components/dropdown/src/dropdown-select.d.ts.map +1 -1
  60. package/dist/components/dropdown/src/dropdown-shared.d.ts +3 -2
  61. package/dist/components/dropdown/src/dropdown-shared.d.ts.map +1 -1
  62. package/dist/components/dropdown/src/useDropdown.d.ts +2 -1
  63. package/dist/components/dropdown/src/useDropdown.d.ts.map +1 -1
  64. package/dist/components/listbox/src/listbox-item.d.ts +2 -2
  65. package/dist/components/listbox/src/listbox-item.d.ts.map +1 -1
  66. package/dist/components/listbox/src/listbox.d.ts +4 -1
  67. package/dist/components/listbox/src/listbox.d.ts.map +1 -1
  68. package/dist/components/modal/src/modal-content.d.ts.map +1 -1
  69. package/dist/components/toggle/src/toggle.d.ts +1 -0
  70. package/dist/components/toggle/src/toggle.d.ts.map +1 -1
  71. package/dist/components-metadata.js +4 -2
  72. package/dist/{content-block-Dm3L4g8w.mjs → content-block-CakKeJtN.mjs} +2 -2
  73. package/dist/{content-block-Dm3L4g8w.mjs.map → content-block-CakKeJtN.mjs.map} +1 -1
  74. package/dist/{content-block-CDRUH0pg.js → content-block-CrekbIfe.js} +2 -2
  75. package/dist/{content-block-CDRUH0pg.js.map → content-block-CrekbIfe.js.map} +1 -1
  76. package/dist/content-block.cjs.js +1 -1
  77. package/dist/content-block.es.js +1 -1
  78. package/dist/{countdown-DZ4IwkNy.mjs → countdown-BsLsEZBv.mjs} +2 -2
  79. package/dist/{countdown-DZ4IwkNy.mjs.map → countdown-BsLsEZBv.mjs.map} +1 -1
  80. package/dist/{countdown-CqYsZigV.js → countdown-hYrFLmRg.js} +2 -2
  81. package/dist/{countdown-CqYsZigV.js.map → countdown-hYrFLmRg.js.map} +1 -1
  82. package/dist/countdown.cjs.js +1 -1
  83. package/dist/countdown.es.js +1 -1
  84. package/dist/{date-picker-D3uJGCjl.js → date-picker-DVrcu2QU.js} +2 -2
  85. package/dist/{date-picker-D3uJGCjl.js.map → date-picker-DVrcu2QU.js.map} +1 -1
  86. package/dist/{date-picker-CpDZ0gK9.mjs → date-picker-DwFDRL5Z.mjs} +2 -2
  87. package/dist/{date-picker-CpDZ0gK9.mjs.map → date-picker-DwFDRL5Z.mjs.map} +1 -1
  88. package/dist/date-picker.cjs.js +1 -1
  89. package/dist/date-picker.es.js +1 -1
  90. package/dist/dismissable-chip-group-2updhyuR.js +2 -0
  91. package/dist/dismissable-chip-group-2updhyuR.js.map +1 -0
  92. package/dist/dismissable-chip-group-Cfs2s2BH.mjs +94 -0
  93. package/dist/dismissable-chip-group-Cfs2s2BH.mjs.map +1 -0
  94. package/dist/dismissable-chip-group.cjs.js +1 -1
  95. package/dist/dismissable-chip-group.es.js +6 -5
  96. package/dist/{drawer-BJ8xwriz.mjs → drawer-Db2Mujc6.mjs} +208 -205
  97. package/dist/drawer-Db2Mujc6.mjs.map +1 -0
  98. package/dist/drawer-DlwagnO4.js +2 -0
  99. package/dist/drawer-DlwagnO4.js.map +1 -0
  100. package/dist/drawer.cjs.js +1 -1
  101. package/dist/drawer.es.js +1 -1
  102. package/dist/dropdown-CMO_VD5e.mjs +916 -0
  103. package/dist/dropdown-CMO_VD5e.mjs.map +1 -0
  104. package/dist/dropdown-DJKNQnuo.js +2 -0
  105. package/dist/dropdown-DJKNQnuo.js.map +1 -0
  106. package/dist/dropdown.cjs.js +1 -1
  107. package/dist/dropdown.es.js +1 -1
  108. package/dist/{footer-BXs8uzTA.mjs → footer-BLPlXaZK.mjs} +4 -4
  109. package/dist/{footer-BXs8uzTA.mjs.map → footer-BLPlXaZK.mjs.map} +1 -1
  110. package/dist/{footer-DF9adlni.js → footer-D9AcPwlH.js} +2 -2
  111. package/dist/{footer-DF9adlni.js.map → footer-D9AcPwlH.js.map} +1 -1
  112. package/dist/footer.cjs.js +1 -1
  113. package/dist/footer.es.js +1 -1
  114. package/dist/{hero-banner-BfxclVFT.js → hero-banner-D1A-_qou.js} +2 -2
  115. package/dist/{hero-banner-BfxclVFT.js.map → hero-banner-D1A-_qou.js.map} +1 -1
  116. package/dist/{hero-banner-CxPvhXD2.mjs → hero-banner-DkC_BqM7.mjs} +3 -3
  117. package/dist/{hero-banner-CxPvhXD2.mjs.map → hero-banner-DkC_BqM7.mjs.map} +1 -1
  118. package/dist/hero-banner.cjs.js +1 -1
  119. package/dist/hero-banner.es.js +1 -1
  120. package/dist/libraries/theme/src/theme-props.d.ts +1 -0
  121. package/dist/libraries/theme/src/theme-props.d.ts.map +1 -1
  122. package/dist/libraries/tokens/dist/color/variables.d.ts +1 -0
  123. package/dist/libraries/tokens/dist/color/variables.dark.d.ts +1 -0
  124. package/dist/library.cjs.js +1 -1
  125. package/dist/library.es.js +593 -590
  126. package/dist/listbox-ATP4hOWF.js +2 -0
  127. package/dist/listbox-ATP4hOWF.js.map +1 -0
  128. package/dist/listbox-i6BQQ-NZ.mjs +73 -0
  129. package/dist/listbox-i6BQQ-NZ.mjs.map +1 -0
  130. package/dist/listbox.cjs.js +1 -1
  131. package/dist/listbox.es.js +3 -2
  132. package/dist/modal-Baisuc6m.js +2 -0
  133. package/dist/modal-Baisuc6m.js.map +1 -0
  134. package/dist/modal-COZ1POGG.mjs +211 -0
  135. package/dist/modal-COZ1POGG.mjs.map +1 -0
  136. package/dist/modal.cjs.js +1 -1
  137. package/dist/modal.es.js +1 -1
  138. package/dist/{notification-BqjaT4E7.js → notification-B5bNNq86.js} +2 -2
  139. package/dist/{notification-BqjaT4E7.js.map → notification-B5bNNq86.js.map} +1 -1
  140. package/dist/{notification-DdRS5BF2.mjs → notification-BbQCmsnY.mjs} +2 -2
  141. package/dist/{notification-DdRS5BF2.mjs.map → notification-BbQCmsnY.mjs.map} +1 -1
  142. package/dist/notification.cjs.js +1 -1
  143. package/dist/notification.es.js +1 -1
  144. package/dist/{pagination-CVYUacXN.mjs → pagination-Cc_4zCQA.mjs} +2 -2
  145. package/dist/{pagination-CVYUacXN.mjs.map → pagination-Cc_4zCQA.mjs.map} +1 -1
  146. package/dist/{pagination-Bwlkvqye.js → pagination-rFRdkHII.js} +2 -2
  147. package/dist/{pagination-Bwlkvqye.js.map → pagination-rFRdkHII.js.map} +1 -1
  148. package/dist/pagination.cjs.js +1 -1
  149. package/dist/pagination.es.js +1 -1
  150. package/dist/paragraph-By4jMjnH.js +2 -0
  151. package/dist/{paragraph-BsI53OR0.js.map → paragraph-By4jMjnH.js.map} +1 -1
  152. package/dist/{paragraph-Ci50OF1u.mjs → paragraph-DSxXmX_0.mjs} +23 -23
  153. package/dist/{paragraph-Ci50OF1u.mjs.map → paragraph-DSxXmX_0.mjs.map} +1 -1
  154. package/dist/paragraph.cjs.js +1 -1
  155. package/dist/paragraph.es.js +1 -1
  156. package/dist/{popover-XCUa2GfC.js → popover-B0XJZ5mj.js} +2 -2
  157. package/dist/{popover-XCUa2GfC.js.map → popover-B0XJZ5mj.js.map} +1 -1
  158. package/dist/{popover-Dwqs1wGH.mjs → popover-_xJATlhN.mjs} +2 -2
  159. package/dist/{popover-Dwqs1wGH.mjs.map → popover-_xJATlhN.mjs.map} +1 -1
  160. package/dist/popover.cjs.js +1 -1
  161. package/dist/popover.es.js +1 -1
  162. package/dist/{product-card-BfB82XpS.mjs → product-card-C3_N0t-R.mjs} +3 -3
  163. package/dist/{product-card-BfB82XpS.mjs.map → product-card-C3_N0t-R.mjs.map} +1 -1
  164. package/dist/{product-card-bVQ7JhHj.js → product-card-CoY1KggV.js} +2 -2
  165. package/dist/{product-card-bVQ7JhHj.js.map → product-card-CoY1KggV.js.map} +1 -1
  166. package/dist/product-card.cjs.js +1 -1
  167. package/dist/product-card.es.js +1 -1
  168. package/dist/{promotion-card-DqBBt2sz.js → promotion-card-Bag64gqP.js} +2 -2
  169. package/dist/{promotion-card-DqBBt2sz.js.map → promotion-card-Bag64gqP.js.map} +1 -1
  170. package/dist/{promotion-card-BhNw94sC.mjs → promotion-card-BiHnQvhn.mjs} +4 -4
  171. package/dist/{promotion-card-BhNw94sC.mjs.map → promotion-card-BiHnQvhn.mjs.map} +1 -1
  172. package/dist/promotion-card.cjs.js +1 -1
  173. package/dist/promotion-card.es.js +1 -1
  174. package/dist/purpur.css +1 -1
  175. package/dist/quantity-selector-CDSfcTb1.js +2 -0
  176. package/dist/{quantity-selector-8AkKNDik.js.map → quantity-selector-CDSfcTb1.js.map} +1 -1
  177. package/dist/{quantity-selector-C23kU1hF.mjs → quantity-selector-CvBvnMeB.mjs} +35 -35
  178. package/dist/{quantity-selector-C23kU1hF.mjs.map → quantity-selector-CvBvnMeB.mjs.map} +1 -1
  179. package/dist/quantity-selector.cjs.js +1 -1
  180. package/dist/quantity-selector.es.js +1 -1
  181. package/dist/{radio-card-group-BlRZBa-9.mjs → radio-card-group-CneOprGY.mjs} +2 -2
  182. package/dist/{radio-card-group-BlRZBa-9.mjs.map → radio-card-group-CneOprGY.mjs.map} +1 -1
  183. package/dist/{radio-card-group-sYcfDPJq.js → radio-card-group-Ctuvg61o.js} +2 -2
  184. package/dist/{radio-card-group-sYcfDPJq.js.map → radio-card-group-Ctuvg61o.js.map} +1 -1
  185. package/dist/radio-card-group.cjs.js +1 -1
  186. package/dist/radio-card-group.es.js +1 -1
  187. package/dist/rich-text.cjs.js +1 -1
  188. package/dist/rich-text.es.js +1 -1
  189. package/dist/{search-field-CMBDkydb.mjs → search-field-CpkHGIYi.mjs} +57 -57
  190. package/dist/{search-field-CMBDkydb.mjs.map → search-field-CpkHGIYi.mjs.map} +1 -1
  191. package/dist/search-field-Z0PqDARl.js +2 -0
  192. package/dist/{search-field-CU_tsmHb.js.map → search-field-Z0PqDARl.js.map} +1 -1
  193. package/dist/search-field.cjs.js +1 -1
  194. package/dist/search-field.es.js +1 -1
  195. package/dist/{stepper-uBfDdIju.mjs → stepper-CNnx_NiR.mjs} +2 -2
  196. package/dist/{stepper-uBfDdIju.mjs.map → stepper-CNnx_NiR.mjs.map} +1 -1
  197. package/dist/{stepper-w-raIwqJ.js → stepper-Df4X7DDR.js} +2 -2
  198. package/dist/{stepper-w-raIwqJ.js.map → stepper-Df4X7DDR.js.map} +1 -1
  199. package/dist/stepper.cjs.js +1 -1
  200. package/dist/stepper.es.js +1 -1
  201. package/dist/{table-BVSBvTYG.js → table-DRYW0yw4.js} +2 -2
  202. package/dist/{table-BVSBvTYG.js.map → table-DRYW0yw4.js.map} +1 -1
  203. package/dist/{table-CuV3Gda_.mjs → table-DUY8kQfE.mjs} +6 -6
  204. package/dist/{table-CuV3Gda_.mjs.map → table-DUY8kQfE.mjs.map} +1 -1
  205. package/dist/table.cjs.js +1 -1
  206. package/dist/table.es.js +1 -1
  207. package/dist/{text-area-DDZ_GQPW.mjs → text-area-kJvg6cFp.mjs} +3 -3
  208. package/dist/{text-area-DDZ_GQPW.mjs.map → text-area-kJvg6cFp.mjs.map} +1 -1
  209. package/dist/{text-area-C6W0fDiQ.js → text-area-peNKG7g4.js} +2 -2
  210. package/dist/{text-area-C6W0fDiQ.js.map → text-area-peNKG7g4.js.map} +1 -1
  211. package/dist/text-area.cjs.js +1 -1
  212. package/dist/text-area.es.js +1 -1
  213. package/dist/theme.cjs.js +1 -1
  214. package/dist/theme.es.js +2 -2
  215. package/dist/toggle-B8ZLUVar.js +2 -0
  216. package/dist/{toggle-C8IwTbX8.js.map → toggle-B8ZLUVar.js.map} +1 -1
  217. package/dist/toggle-CY3J8BRX.mjs +302 -0
  218. package/dist/{toggle-D23x1wWk.mjs.map → toggle-CY3J8BRX.mjs.map} +1 -1
  219. package/dist/toggle.cjs.js +1 -1
  220. package/dist/toggle.es.js +1 -1
  221. package/dist/tokens/color/variables.css +1 -0
  222. package/dist/tokens/color/variables.d.ts +1 -0
  223. package/dist/tokens/color/variables.dark.css +1 -0
  224. package/dist/tokens/color/variables.dark.d.ts +1 -0
  225. package/dist/tokens/color/variables.dark.js +1 -0
  226. package/dist/tokens/color/variables.dark.json +2 -1
  227. package/dist/tokens/color/variables.dark.scss +1 -0
  228. package/dist/tokens/color/variables.js +1 -0
  229. package/dist/tokens/color/variables.json +2 -1
  230. package/dist/tokens/color/variables.scss +1 -0
  231. package/dist/tokens.cjs.js +1 -1
  232. package/dist/tokens.es.js +76 -75
  233. package/dist/{tooltip-0pLBlDG3.js → tooltip-C8Zxnqdb.js} +2 -2
  234. package/dist/{tooltip-0pLBlDG3.js.map → tooltip-C8Zxnqdb.js.map} +1 -1
  235. package/dist/{tooltip-Kom0VfOC.mjs → tooltip-VlURN8H3.mjs} +2 -2
  236. package/dist/{tooltip-Kom0VfOC.mjs.map → tooltip-VlURN8H3.mjs.map} +1 -1
  237. package/dist/tooltip.cjs.js +1 -1
  238. package/dist/tooltip.es.js +1 -1
  239. package/dist/use-autocomplete.es-BwAzMcau.js +2 -0
  240. package/dist/use-autocomplete.es-BwAzMcau.js.map +1 -0
  241. package/dist/{use-autocomplete.es-CVv3z8t6.mjs → use-autocomplete.es-CKb0RHKG.mjs} +37 -35
  242. package/dist/use-autocomplete.es-CKb0RHKG.mjs.map +1 -0
  243. package/dist/useColorScheme-DNyjsWX9.js +2 -0
  244. package/dist/{useColorScheme-0GMDl2GF.js.map → useColorScheme-DNyjsWX9.js.map} +1 -1
  245. package/dist/{useColorScheme-Di_Q0JR4.mjs → useColorScheme-tAkY9LHt.mjs} +2 -2
  246. package/dist/{useColorScheme-Di_Q0JR4.mjs.map → useColorScheme-tAkY9LHt.mjs.map} +1 -1
  247. package/dist/{variables-CKp4o9Tn.mjs → variables-B5hbV0Uy.mjs} +128 -127
  248. package/dist/variables-B5hbV0Uy.mjs.map +1 -0
  249. package/dist/variables-DoI78zZc.js +2 -0
  250. package/dist/variables-DoI78zZc.js.map +1 -0
  251. package/package.json +11 -11
  252. package/tokens/color/variables.css +1 -0
  253. package/tokens/color/variables.d.ts +1 -0
  254. package/tokens/color/variables.dark.css +1 -0
  255. package/tokens/color/variables.dark.d.ts +1 -0
  256. package/tokens/color/variables.dark.js +1 -0
  257. package/tokens/color/variables.dark.json +2 -1
  258. package/tokens/color/variables.dark.scss +1 -0
  259. package/tokens/color/variables.js +1 -0
  260. package/tokens/color/variables.json +2 -1
  261. package/tokens/color/variables.scss +1 -0
  262. package/dist/ThemeProvider-5r7lDX-h.js.map +0 -1
  263. package/dist/ThemeProvider-bkyFCeo6.mjs.map +0 -1
  264. package/dist/accordion-OsA0HvdA.js.map +0 -1
  265. package/dist/accordion-OtFSShSB.mjs.map +0 -1
  266. package/dist/checkbox-D6qWgpWR.mjs +0 -231
  267. package/dist/checkbox-D6qWgpWR.mjs.map +0 -1
  268. package/dist/checkbox-Dk3bZkZ3.js +0 -2
  269. package/dist/checkbox-Dk3bZkZ3.js.map +0 -1
  270. package/dist/comparison-table-B8w65g43.js.map +0 -1
  271. package/dist/comparison-table-D1zJpdLL.mjs.map +0 -1
  272. package/dist/dismissable-chip-group-Cd23yjBa.js +0 -2
  273. package/dist/dismissable-chip-group-Cd23yjBa.js.map +0 -1
  274. package/dist/dismissable-chip-group-D-gD93ON.mjs +0 -89
  275. package/dist/dismissable-chip-group-D-gD93ON.mjs.map +0 -1
  276. package/dist/drawer-BJ8xwriz.mjs.map +0 -1
  277. package/dist/drawer-CNs9K8Ca.js +0 -2
  278. package/dist/drawer-CNs9K8Ca.js.map +0 -1
  279. package/dist/dropdown-BsqVnd7z.js +0 -2
  280. package/dist/dropdown-BsqVnd7z.js.map +0 -1
  281. package/dist/dropdown-TO3Mh0bk.mjs +0 -910
  282. package/dist/dropdown-TO3Mh0bk.mjs.map +0 -1
  283. package/dist/listbox-COBHLRtB.js +0 -2
  284. package/dist/listbox-COBHLRtB.js.map +0 -1
  285. package/dist/listbox-DG4KmQP_.mjs +0 -66
  286. package/dist/listbox-DG4KmQP_.mjs.map +0 -1
  287. package/dist/modal-DCfN6q8I.mjs +0 -201
  288. package/dist/modal-DCfN6q8I.mjs.map +0 -1
  289. package/dist/modal-DZIdw9xy.js +0 -2
  290. package/dist/modal-DZIdw9xy.js.map +0 -1
  291. package/dist/paragraph-BsI53OR0.js +0 -2
  292. package/dist/quantity-selector-8AkKNDik.js +0 -2
  293. package/dist/search-field-CU_tsmHb.js +0 -2
  294. package/dist/toggle-C8IwTbX8.js +0 -2
  295. package/dist/toggle-D23x1wWk.mjs +0 -287
  296. package/dist/use-autocomplete.es-BHDgQLae.js +0 -2
  297. package/dist/use-autocomplete.es-BHDgQLae.js.map +0 -1
  298. package/dist/use-autocomplete.es-CVv3z8t6.mjs.map +0 -1
  299. package/dist/useColorScheme-0GMDl2GF.js +0 -2
  300. package/dist/variables-CKp4o9Tn.mjs.map +0 -1
  301. package/dist/variables-DH61hVNE.js +0 -2
  302. package/dist/variables-DH61hVNE.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"content-block-Dm3L4g8w.mjs","sources":["../../../components/content-block/src/content-block-group.tsx","../../../components/content-block/src/content-block.tsx"],"sourcesContent":["import React, { createContext, type ReactNode } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./content-block-group.module.scss\";\n\nconst cx = c.bind(styles);\nconst rootClassName = \"purpur-content-block-group\";\n\nexport const ContentBlockGroupContext = createContext<{\n negative?: boolean;\n reverse?: boolean;\n} | null>(null);\n\nexport type ContentBlockGroupProps = Omit<BaseProps, \"children\"> & {\n children: ReactNode;\n negative?: boolean;\n mediaStartPosition?: \"left\" | \"right\";\n};\n\nexport const ContentBlockGroup = ({\n children,\n className,\n negative,\n mediaStartPosition = \"left\",\n ...props\n}: ContentBlockGroupProps) => {\n const classes = cx([\n rootClassName,\n {\n [`${rootClassName}--negative`]: negative,\n },\n className,\n ]);\n\n return (\n <div className={classes} {...props}>\n <ContentBlockGroupContext.Provider\n value={{ negative, reverse: mediaStartPosition === \"right\" }}\n >\n {children}\n </ContentBlockGroupContext.Provider>\n </div>\n );\n};\n\nContentBlockGroup.displayName = \"ContentBlockGroup\";\n","import React, { type ReactNode, useContext } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Heading, type HeadingTagType, type HeadingVariant } from \"@purpur/heading\";\nimport { IconCheckmark } from \"@purpur/icon/checkmark\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./content-block.module.scss\";\nimport { ContentBlockGroup, ContentBlockGroupContext } from \"./content-block-group\";\n\nconst cx = c.bind(styles);\nconst rootClassName = \"purpur-content-block\";\n\nexport type ContentBlockProps = BaseProps & {\n /**\n * @deprecated Set negative on ContentBlockGroup instead\n */\n negative?: boolean;\n image?: ReactNode;\n video?: ReactNode;\n /**\n * @deprecated Use beforeTitle instead\n */\n badge?: ReactNode;\n actions?: ReactNode;\n listItems?: string[];\n beforeTitle?: ReactNode;\n title?: string;\n headingTag?: HeadingTagType;\n headingVariant?: HeadingVariant;\n};\n\nexport const ContentBlock = ({\n className,\n negative,\n image,\n video,\n badge,\n beforeTitle,\n title,\n actions,\n listItems,\n headingTag = \"h2\",\n headingVariant = \"display-15\",\n children,\n ...props\n}: ContentBlockProps) => {\n const context = useContext(ContentBlockGroupContext);\n\n const classes = cx([\n rootClassName,\n {\n [`${rootClassName}--negative`]: context?.negative || negative,\n [`${rootClassName}--reverse`]: context?.reverse,\n },\n className,\n ]);\n\n return (\n <div className={classes} {...props}>\n <div className={cx(`${rootClassName}__section`)}>\n {video ? (\n <div className={cx(`${rootClassName}__video-wrapper`)}>{video}</div>\n ) : (\n <div className={cx(`${rootClassName}__image-wrapper`)}>{image}</div>\n )}\n </div>\n <div className={cx(`${rootClassName}__section`)}>\n <div className={cx(`${rootClassName}__content-wrapper`)}>\n {badge && <div className={cx(`${rootClassName}__badge-wrapper`)}>{badge}</div>}\n {beforeTitle}\n {title?.trim() && (\n <Heading variant={headingVariant} tag={headingTag} negative={negative}>\n {title}\n </Heading>\n )}\n <div className={cx(`${rootClassName}__content`)}>{children}</div>\n {!!listItems?.length && (\n <ul className={cx(`${rootClassName}__list`)}>\n {listItems.map(\n (item) =>\n item && (\n <li className={cx(`${rootClassName}__list-item`)} key={item}>\n <IconCheckmark size=\"xs\" className={cx(`${rootClassName}__list-item-icon`)} />\n <Paragraph negative={negative}>{item}</Paragraph>\n </li>\n )\n )}\n </ul>\n )}\n {actions && <div className={cx(`${rootClassName}__actions`)}>{actions}</div>}\n </div>\n </div>\n </div>\n );\n};\n\nContentBlock.Group = ContentBlockGroup;\nContentBlock.displayName = \"ContentBlock\";\n"],"names":["cx","c","styles","rootClassName","ContentBlockGroupContext","createContext","ContentBlockGroup","children","className","negative","mediaStartPosition","props","classes","jsx","ContentBlock","image","video","badge","beforeTitle","title","actions","listItems","headingTag","headingVariant","context","useContext","jsxs","Heading","item","IconCheckmark","Paragraph"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;GAMMA,IAAKC,EAAE,KAAKC,CAAM,GAClBC,IAAgB,8BAETC,IAA2BC,EAG9B,IAAI,GAQDC,IAAoB,CAAC;AAAA,EAChC,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,oBAAAC,IAAqB;AAAA,EACrB,GAAGC;AACL,MAA8B;AAC5B,QAAMC,IAAUZ,EAAG;AAAA,IACjBG;AAAAA,IACA;AAAA,MACE,CAAC,GAAGA,CAAa,YAAY,GAAGM;AAAA,IAAA;AAAA,IAElCD;AAAA,EAAA,CACD;AAED,SACE,gBAAAK,EAAC,OAAA,EAAI,WAAWD,GAAU,GAAGD,GAC3B,UAAA,gBAAAE;AAAA,IAACT,EAAyB;AAAA,IAAzB;AAAA,MACC,OAAO,EAAE,UAAAK,GAAU,SAASC,MAAuB,QAAA;AAAA,MAElD,UAAAH;AAAA,IAAA;AAAA,EAAA,GAEL;AAEJ;AAEAD,EAAkB,cAAc;ACpChC,MAAMN,IAAKC,EAAE,KAAKC,CAAM,GAClBC,IAAgB,wBAqBTW,IAAe,CAAC;AAAA,EAC3B,WAA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AAAN,EAAC,SAAI,WAAWb,EAAG,GAAGG,CAAa,WAAW,GAAI,UAAAI,GAAS;AAAA,MAC1D,CAAC,CAACc,GAAW,UACZ,gBAAAR,EAAC,MAAA,EAAG,WAAWb,EAAG,GAAGG,CAAa,QAAQ,GACvC,UAAAkB,EAAU;AAAA,QACT,CAACO,MACCA,KACE,gBAAAF,EAAC,MAAA,EAAG,WAAW1B,EAAG,GAAGG,CAAa,aAAa,GAC7C,UAAA;AAAA,UAAA,gBAAAU,EAACgB,GAAA,EAAc,MAAK,MAAK,WAAW7B,EAAG,GAAGG,CAAa,kBAAkB,EAAA,CAAG;AAAA,UAC5E,gBAAAU,EAACiB,GAAA,EAAU,UAAArB,GAAqB,UAAAmB,EAAA,CAAK;AAAA,QAAA,EAAA,GAFgBA,CAGvD;AAAA,MAAA,GAGR;AAAA,MAEDR,uBAAY,OAAA,EAAI,WAAWpB,EAAG,GAAGG,CAAa,WAAW,GAAI,UAAAiB,EAAA,CAAQ;AAAA,IAAA,EAAA,CACxE,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;AAEAN,EAAa,QAAQR;AACrBQ,EAAa,cAAc;"}
1
+ {"version":3,"file":"content-block-CakKeJtN.mjs","sources":["../../../components/content-block/src/content-block-group.tsx","../../../components/content-block/src/content-block.tsx"],"sourcesContent":["import React, { createContext, type ReactNode } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./content-block-group.module.scss\";\n\nconst cx = c.bind(styles);\nconst rootClassName = \"purpur-content-block-group\";\n\nexport const ContentBlockGroupContext = createContext<{\n negative?: boolean;\n reverse?: boolean;\n} | null>(null);\n\nexport type ContentBlockGroupProps = Omit<BaseProps, \"children\"> & {\n children: ReactNode;\n negative?: boolean;\n mediaStartPosition?: \"left\" | \"right\";\n};\n\nexport const ContentBlockGroup = ({\n children,\n className,\n negative,\n mediaStartPosition = \"left\",\n ...props\n}: ContentBlockGroupProps) => {\n const classes = cx([\n rootClassName,\n {\n [`${rootClassName}--negative`]: negative,\n },\n className,\n ]);\n\n return (\n <div className={classes} {...props}>\n <ContentBlockGroupContext.Provider\n value={{ negative, reverse: mediaStartPosition === \"right\" }}\n >\n {children}\n </ContentBlockGroupContext.Provider>\n </div>\n );\n};\n\nContentBlockGroup.displayName = \"ContentBlockGroup\";\n","import React, { type ReactNode, useContext } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Heading, type HeadingTagType, type HeadingVariant } from \"@purpur/heading\";\nimport { IconCheckmark } from \"@purpur/icon/checkmark\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./content-block.module.scss\";\nimport { ContentBlockGroup, ContentBlockGroupContext } from \"./content-block-group\";\n\nconst cx = c.bind(styles);\nconst rootClassName = \"purpur-content-block\";\n\nexport type ContentBlockProps = BaseProps & {\n /**\n * @deprecated Set negative on ContentBlockGroup instead\n */\n negative?: boolean;\n image?: ReactNode;\n video?: ReactNode;\n /**\n * @deprecated Use beforeTitle instead\n */\n badge?: ReactNode;\n actions?: ReactNode;\n listItems?: string[];\n beforeTitle?: ReactNode;\n title?: string;\n headingTag?: HeadingTagType;\n headingVariant?: HeadingVariant;\n};\n\nexport const ContentBlock = ({\n className,\n negative,\n image,\n video,\n badge,\n beforeTitle,\n title,\n actions,\n listItems,\n headingTag = \"h2\",\n headingVariant = \"display-15\",\n children,\n ...props\n}: ContentBlockProps) => {\n const context = useContext(ContentBlockGroupContext);\n\n const classes = cx([\n rootClassName,\n {\n [`${rootClassName}--negative`]: context?.negative || negative,\n [`${rootClassName}--reverse`]: context?.reverse,\n },\n className,\n ]);\n\n return (\n <div className={classes} {...props}>\n <div className={cx(`${rootClassName}__section`)}>\n {video ? (\n <div className={cx(`${rootClassName}__video-wrapper`)}>{video}</div>\n ) : (\n <div className={cx(`${rootClassName}__image-wrapper`)}>{image}</div>\n )}\n </div>\n <div className={cx(`${rootClassName}__section`)}>\n <div className={cx(`${rootClassName}__content-wrapper`)}>\n {badge && <div className={cx(`${rootClassName}__badge-wrapper`)}>{badge}</div>}\n {beforeTitle}\n {title?.trim() && (\n <Heading variant={headingVariant} tag={headingTag} negative={negative}>\n {title}\n </Heading>\n )}\n <div className={cx(`${rootClassName}__content`)}>{children}</div>\n {!!listItems?.length && (\n <ul className={cx(`${rootClassName}__list`)}>\n {listItems.map(\n (item) =>\n item && (\n <li className={cx(`${rootClassName}__list-item`)} key={item}>\n <IconCheckmark size=\"xs\" className={cx(`${rootClassName}__list-item-icon`)} />\n <Paragraph negative={negative}>{item}</Paragraph>\n </li>\n )\n )}\n </ul>\n )}\n {actions && <div className={cx(`${rootClassName}__actions`)}>{actions}</div>}\n </div>\n </div>\n </div>\n );\n};\n\nContentBlock.Group = ContentBlockGroup;\nContentBlock.displayName = \"ContentBlock\";\n"],"names":["cx","c","styles","rootClassName","ContentBlockGroupContext","createContext","ContentBlockGroup","children","className","negative","mediaStartPosition","props","classes","jsx","ContentBlock","image","video","badge","beforeTitle","title","actions","listItems","headingTag","headingVariant","context","useContext","jsxs","Heading","item","IconCheckmark","Paragraph"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;GAMMA,IAAKC,EAAE,KAAKC,CAAM,GAClBC,IAAgB,8BAETC,IAA2BC,EAG9B,IAAI,GAQDC,IAAoB,CAAC;AAAA,EAChC,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,oBAAAC,IAAqB;AAAA,EACrB,GAAGC;AACL,MAA8B;AAC5B,QAAMC,IAAUZ,EAAG;AAAA,IACjBG;AAAAA,IACA;AAAA,MACE,CAAC,GAAGA,CAAa,YAAY,GAAGM;AAAA,IAAA;AAAA,IAElCD;AAAA,EAAA,CACD;AAED,SACE,gBAAAK,EAAC,OAAA,EAAI,WAAWD,GAAU,GAAGD,GAC3B,UAAA,gBAAAE;AAAA,IAACT,EAAyB;AAAA,IAAzB;AAAA,MACC,OAAO,EAAE,UAAAK,GAAU,SAASC,MA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AAa,iBAAiB,GAAI,UAAAc,EAAA,CAAM;AAAA,MACvEC;AAAA,MACAC,GAAO,KAAA,KACN,gBAAAN,EAACc,GAAA,EAAQ,SAASJ,GAAgB,KAAKD,GAAY,UAAAb,GAChD,UAAAU,EAAA,CACH;AAAA,MAEF,gBAAAN,EAAC,SAAI,WAAWb,EAAG,GAAGG,CAAa,WAAW,GAAI,UAAAI,GAAS;AAAA,MAC1D,CAAC,CAACc,GAAW,UACZ,gBAAAR,EAAC,MAAA,EAAG,WAAWb,EAAG,GAAGG,CAAa,QAAQ,GACvC,UAAAkB,EAAU;AAAA,QACT,CAACO,MACCA,KACE,gBAAAF,EAAC,MAAA,EAAG,WAAW1B,EAAG,GAAGG,CAAa,aAAa,GAC7C,UAAA;AAAA,UAAA,gBAAAU,EAACgB,GAAA,EAAc,MAAK,MAAK,WAAW7B,EAAG,GAAGG,CAAa,kBAAkB,EAAA,CAAG;AAAA,UAC5E,gBAAAU,EAACiB,GAAA,EAAU,UAAArB,GAAqB,UAAAmB,EAAA,CAAK;AAAA,QAAA,EAAA,GAFgBA,CAGvD;AAAA,MAAA,GAGR;AAAA,MAEDR,uBAAY,OAAA,EAAI,WAAWpB,EAAG,GAAGG,CAAa,WAAW,GAAI,UAAAiB,EAAA,CAAQ;AAAA,IAAA,EAAA,CACxE,EAAA,CACF;AAAA,EAAA,GACF;AAEJ;AAEAN,EAAa,QAAQR;AACrBQ,EAAa,cAAc;"}
@@ -1,2 +1,2 @@
1
- "use strict";const e=require("react/jsx-runtime"),k=require("react"),w=require("./heading-drD5ugCC.js"),C=require("./checkmark.es-lYntWFA3.js"),y=require("./paragraph-BsI53OR0.js"),j=require("./bind-DeUYJ6m9.js"),B={"purpur-content-block":"_purpur-content-block_mjbqd_1","purpur-content-block--reverse":"_purpur-content-block--reverse_mjbqd_13","purpur-content-block__section":"_purpur-content-block__section_mjbqd_20","purpur-content-block__image-wrapper":"_purpur-content-block__image-wrapper_mjbqd_28","purpur-content-block__video-wrapper":"_purpur-content-block__video-wrapper_mjbqd_31","purpur-content-block__content-wrapper":"_purpur-content-block__content-wrapper_mjbqd_41","purpur-content-block__badge-wrapper":"_purpur-content-block__badge-wrapper_mjbqd_46","purpur-content-block__content":"_purpur-content-block__content_mjbqd_41","purpur-content-block__list":"_purpur-content-block__list_mjbqd_52","purpur-content-block__list-item":"_purpur-content-block__list-item_mjbqd_57","purpur-content-block__list-item-icon":"_purpur-content-block__list-item-icon_mjbqd_65","purpur-content-block__actions":"_purpur-content-block__actions_mjbqd_68","purpur-content-block--negative":"_purpur-content-block--negative_mjbqd_79","purpur-content-block__text-spacing":"_purpur-content-block__text-spacing_mjbqd_79"},G={"purpur-content-block-group":"_purpur-content-block-group_xzyy2_1"},z=j.c.bind(G),m="purpur-content-block-group",x=k.createContext(null),v=({children:s,className:n,negative:c,mediaStartPosition:o="left",..._})=>{const p=z([m,{[`${m}--negative`]:c},n]);return e.jsx("div",{className:p,..._,children:e.jsx(x.Provider,{value:{negative:c,reverse:o==="right"},children:s})})};v.displayName="ContentBlockGroup";const r=j.c.bind(B),t="purpur-content-block",u=({className:s,negative:n,image:c,video:o,badge:_,beforeTitle:p,title:a,actions:i,listItems:b,headingTag:h="h2",headingVariant:q="display-15",children:g,...N})=>{const d=k.useContext(x),$=r([t,{[`${t}--negative`]:d?.negative||n,[`${t}--reverse`]:d?.reverse},s]);return e.jsxs("div",{className:$,...N,children:[e.jsx("div",{className:r(`${t}__section`),children:o?e.jsx("div",{className:r(`${t}__video-wrapper`),children:o}):e.jsx("div",{className:r(`${t}__image-wrapper`),children:c})}),e.jsx("div",{className:r(`${t}__section`),children:e.jsxs("div",{className:r(`${t}__content-wrapper`),children:[_&&e.jsx("div",{className:r(`${t}__badge-wrapper`),children:_}),p,a?.trim()&&e.jsx(w.Heading,{variant:q,tag:h,negative:n,children:a}),e.jsx("div",{className:r(`${t}__content`),children:g}),!!b?.length&&e.jsx("ul",{className:r(`${t}__list`),children:b.map(l=>l&&e.jsxs("li",{className:r(`${t}__list-item`),children:[e.jsx(C.a,{size:"xs",className:r(`${t}__list-item-icon`)}),e.jsx(y.Paragraph,{negative:n,children:l})]},l))}),i&&e.jsx("div",{className:r(`${t}__actions`),children:i})]})})]})};u.Group=v;u.displayName="ContentBlock";exports.ContentBlock=u;
2
- //# sourceMappingURL=content-block-CDRUH0pg.js.map
1
+ "use strict";const e=require("react/jsx-runtime"),k=require("react"),w=require("./heading-drD5ugCC.js"),C=require("./checkmark.es-lYntWFA3.js"),y=require("./paragraph-By4jMjnH.js"),j=require("./bind-DeUYJ6m9.js"),B={"purpur-content-block":"_purpur-content-block_mjbqd_1","purpur-content-block--reverse":"_purpur-content-block--reverse_mjbqd_13","purpur-content-block__section":"_purpur-content-block__section_mjbqd_20","purpur-content-block__image-wrapper":"_purpur-content-block__image-wrapper_mjbqd_28","purpur-content-block__video-wrapper":"_purpur-content-block__video-wrapper_mjbqd_31","purpur-content-block__content-wrapper":"_purpur-content-block__content-wrapper_mjbqd_41","purpur-content-block__badge-wrapper":"_purpur-content-block__badge-wrapper_mjbqd_46","purpur-content-block__content":"_purpur-content-block__content_mjbqd_41","purpur-content-block__list":"_purpur-content-block__list_mjbqd_52","purpur-content-block__list-item":"_purpur-content-block__list-item_mjbqd_57","purpur-content-block__list-item-icon":"_purpur-content-block__list-item-icon_mjbqd_65","purpur-content-block__actions":"_purpur-content-block__actions_mjbqd_68","purpur-content-block--negative":"_purpur-content-block--negative_mjbqd_79","purpur-content-block__text-spacing":"_purpur-content-block__text-spacing_mjbqd_79"},G={"purpur-content-block-group":"_purpur-content-block-group_xzyy2_1"},z=j.c.bind(G),m="purpur-content-block-group",x=k.createContext(null),v=({children:s,className:n,negative:c,mediaStartPosition:o="left",..._})=>{const p=z([m,{[`${m}--negative`]:c},n]);return e.jsx("div",{className:p,..._,children:e.jsx(x.Provider,{value:{negative:c,reverse:o==="right"},children:s})})};v.displayName="ContentBlockGroup";const r=j.c.bind(B),t="purpur-content-block",u=({className:s,negative:n,image:c,video:o,badge:_,beforeTitle:p,title:a,actions:i,listItems:b,headingTag:h="h2",headingVariant:q="display-15",children:g,...N})=>{const d=k.useContext(x),$=r([t,{[`${t}--negative`]:d?.negative||n,[`${t}--reverse`]:d?.reverse},s]);return e.jsxs("div",{className:$,...N,children:[e.jsx("div",{className:r(`${t}__section`),children:o?e.jsx("div",{className:r(`${t}__video-wrapper`),children:o}):e.jsx("div",{className:r(`${t}__image-wrapper`),children:c})}),e.jsx("div",{className:r(`${t}__section`),children:e.jsxs("div",{className:r(`${t}__content-wrapper`),children:[_&&e.jsx("div",{className:r(`${t}__badge-wrapper`),children:_}),p,a?.trim()&&e.jsx(w.Heading,{variant:q,tag:h,negative:n,children:a}),e.jsx("div",{className:r(`${t}__content`),children:g}),!!b?.length&&e.jsx("ul",{className:r(`${t}__list`),children:b.map(l=>l&&e.jsxs("li",{className:r(`${t}__list-item`),children:[e.jsx(C.a,{size:"xs",className:r(`${t}__list-item-icon`)}),e.jsx(y.Paragraph,{negative:n,children:l})]},l))}),i&&e.jsx("div",{className:r(`${t}__actions`),children:i})]})})]})};u.Group=v;u.displayName="ContentBlock";exports.ContentBlock=u;
2
+ //# sourceMappingURL=content-block-CrekbIfe.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"content-block-CDRUH0pg.js","sources":["../../../components/content-block/src/content-block-group.tsx","../../../components/content-block/src/content-block.tsx"],"sourcesContent":["import React, { createContext, type ReactNode } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./content-block-group.module.scss\";\n\nconst cx = c.bind(styles);\nconst rootClassName = \"purpur-content-block-group\";\n\nexport const ContentBlockGroupContext = createContext<{\n negative?: boolean;\n reverse?: boolean;\n} | null>(null);\n\nexport type ContentBlockGroupProps = Omit<BaseProps, \"children\"> & {\n children: ReactNode;\n negative?: boolean;\n mediaStartPosition?: \"left\" | \"right\";\n};\n\nexport const ContentBlockGroup = ({\n children,\n className,\n negative,\n mediaStartPosition = \"left\",\n ...props\n}: ContentBlockGroupProps) => {\n const classes = cx([\n rootClassName,\n {\n [`${rootClassName}--negative`]: negative,\n },\n className,\n ]);\n\n return (\n <div className={classes} {...props}>\n <ContentBlockGroupContext.Provider\n value={{ negative, reverse: mediaStartPosition === \"right\" }}\n >\n {children}\n </ContentBlockGroupContext.Provider>\n </div>\n );\n};\n\nContentBlockGroup.displayName = \"ContentBlockGroup\";\n","import React, { type ReactNode, useContext } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Heading, type HeadingTagType, type HeadingVariant } from \"@purpur/heading\";\nimport { IconCheckmark } from \"@purpur/icon/checkmark\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./content-block.module.scss\";\nimport { ContentBlockGroup, ContentBlockGroupContext } from \"./content-block-group\";\n\nconst cx = c.bind(styles);\nconst rootClassName = \"purpur-content-block\";\n\nexport type ContentBlockProps = BaseProps & {\n /**\n * @deprecated Set negative on ContentBlockGroup instead\n */\n negative?: boolean;\n image?: ReactNode;\n video?: ReactNode;\n /**\n * @deprecated Use beforeTitle instead\n */\n badge?: ReactNode;\n actions?: ReactNode;\n listItems?: string[];\n beforeTitle?: ReactNode;\n title?: string;\n headingTag?: HeadingTagType;\n headingVariant?: HeadingVariant;\n};\n\nexport const ContentBlock = ({\n className,\n negative,\n image,\n video,\n badge,\n beforeTitle,\n title,\n actions,\n listItems,\n headingTag = \"h2\",\n headingVariant = \"display-15\",\n children,\n ...props\n}: ContentBlockProps) => {\n const context = useContext(ContentBlockGroupContext);\n\n const classes = cx([\n rootClassName,\n {\n [`${rootClassName}--negative`]: context?.negative || negative,\n [`${rootClassName}--reverse`]: context?.reverse,\n },\n className,\n ]);\n\n return (\n <div className={classes} {...props}>\n <div className={cx(`${rootClassName}__section`)}>\n {video ? (\n <div className={cx(`${rootClassName}__video-wrapper`)}>{video}</div>\n ) : (\n <div className={cx(`${rootClassName}__image-wrapper`)}>{image}</div>\n )}\n </div>\n <div className={cx(`${rootClassName}__section`)}>\n <div className={cx(`${rootClassName}__content-wrapper`)}>\n {badge && <div className={cx(`${rootClassName}__badge-wrapper`)}>{badge}</div>}\n {beforeTitle}\n {title?.trim() && (\n <Heading variant={headingVariant} tag={headingTag} negative={negative}>\n {title}\n </Heading>\n )}\n <div className={cx(`${rootClassName}__content`)}>{children}</div>\n {!!listItems?.length && (\n <ul className={cx(`${rootClassName}__list`)}>\n {listItems.map(\n (item) =>\n item && (\n <li className={cx(`${rootClassName}__list-item`)} key={item}>\n <IconCheckmark size=\"xs\" className={cx(`${rootClassName}__list-item-icon`)} />\n <Paragraph negative={negative}>{item}</Paragraph>\n </li>\n )\n )}\n </ul>\n )}\n {actions && <div className={cx(`${rootClassName}__actions`)}>{actions}</div>}\n </div>\n </div>\n </div>\n );\n};\n\nContentBlock.Group = ContentBlockGroup;\nContentBlock.displayName = \"ContentBlock\";\n"],"names":["cx","c","styles","rootClassName","ContentBlockGroupContext","createContext","ContentBlockGroup","children","className","negative","mediaStartPosition","props","classes","jsx","ContentBlock","image","video","badge","beforeTitle","title","actions","listItems","headingTag","headingVariant","context","useContext","jsxs","Heading","item","IconCheckmark","Paragraph"],"mappings":"q2CAMMA,EAAKC,EAAAA,EAAE,KAAKC,CAAM,EAClBC,EAAgB,6BAETC,EAA2BC,EAAAA,cAG9B,IAAI,EAQDC,EAAoB,CAAC,CAChC,SAAAC,EACA,UAAAC,EACA,SAAAC,EACA,mBAAAC,EAAqB,OACrB,GAAGC,CACL,IAA8B,CAC5B,MAAMC,EAAUZ,EAAG,CACjBG,EACA,CACE,CAAC,GAAGA,CAAa,YAAY,EAAGM,CAAA,EAElCD,CAAA,CACD,EAED,OACEK,EAAAA,IAAC,MAAA,CAAI,UAAWD,EAAU,GAAGD,EAC3B,SAAAE,EAAAA,IAACT,EAAyB,SAAzB,CACC,MAAO,CAAE,SAAAK,EAAU,QAASC,IAAuB,OAAA,EAElD,SAAAH,CAAA,CAAA,EAEL,CAEJ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W,EAAI,SAAAI,EAAS,EAC1D,CAAC,CAACc,GAAW,QACZR,EAAAA,IAAC,KAAA,CAAG,UAAWb,EAAG,GAAGG,CAAa,QAAQ,EACvC,SAAAkB,EAAU,IACRO,GACCA,GACEF,EAAAA,KAAC,KAAA,CAAG,UAAW1B,EAAG,GAAGG,CAAa,aAAa,EAC7C,SAAA,CAAAU,EAAAA,IAACgB,EAAAA,EAAA,CAAc,KAAK,KAAK,UAAW7B,EAAG,GAAGG,CAAa,kBAAkB,CAAA,CAAG,EAC5EU,EAAAA,IAACiB,EAAAA,UAAA,CAAU,SAAArB,EAAqB,SAAAmB,CAAA,CAAK,CAAA,CAAA,EAFgBA,CAGvD,CAAA,EAGR,EAEDR,SAAY,MAAA,CAAI,UAAWpB,EAAG,GAAGG,CAAa,WAAW,EAAI,SAAAiB,CAAA,CAAQ,CAAA,CAAA,CACxE,CAAA,CACF,CAAA,EACF,CAEJ,EAEAN,EAAa,MAAQR,EACrBQ,EAAa,YAAc"}
1
+ {"version":3,"file":"content-block-CrekbIfe.js","sources":["../../../components/content-block/src/content-block-group.tsx","../../../components/content-block/src/content-block.tsx"],"sourcesContent":["import React, { createContext, type ReactNode } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./content-block-group.module.scss\";\n\nconst cx = c.bind(styles);\nconst rootClassName = \"purpur-content-block-group\";\n\nexport const ContentBlockGroupContext = createContext<{\n negative?: boolean;\n reverse?: boolean;\n} | null>(null);\n\nexport type ContentBlockGroupProps = Omit<BaseProps, \"children\"> & {\n children: ReactNode;\n negative?: boolean;\n mediaStartPosition?: \"left\" | \"right\";\n};\n\nexport const ContentBlockGroup = ({\n children,\n className,\n negative,\n mediaStartPosition = \"left\",\n ...props\n}: ContentBlockGroupProps) => {\n const classes = cx([\n rootClassName,\n {\n [`${rootClassName}--negative`]: negative,\n },\n className,\n ]);\n\n return (\n <div className={classes} {...props}>\n <ContentBlockGroupContext.Provider\n value={{ negative, reverse: mediaStartPosition === \"right\" }}\n >\n {children}\n </ContentBlockGroupContext.Provider>\n </div>\n );\n};\n\nContentBlockGroup.displayName = \"ContentBlockGroup\";\n","import React, { type ReactNode, useContext } from \"react\";\nimport type { BaseProps } from \"@purpur/common-types\";\nimport { Heading, type HeadingTagType, type HeadingVariant } from \"@purpur/heading\";\nimport { IconCheckmark } from \"@purpur/icon/checkmark\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./content-block.module.scss\";\nimport { ContentBlockGroup, ContentBlockGroupContext } from \"./content-block-group\";\n\nconst cx = c.bind(styles);\nconst rootClassName = \"purpur-content-block\";\n\nexport type ContentBlockProps = BaseProps & {\n /**\n * @deprecated Set negative on ContentBlockGroup instead\n */\n negative?: boolean;\n image?: ReactNode;\n video?: ReactNode;\n /**\n * @deprecated Use beforeTitle instead\n */\n badge?: ReactNode;\n actions?: ReactNode;\n listItems?: string[];\n beforeTitle?: ReactNode;\n title?: string;\n headingTag?: HeadingTagType;\n headingVariant?: HeadingVariant;\n};\n\nexport const ContentBlock = ({\n className,\n negative,\n image,\n video,\n badge,\n beforeTitle,\n title,\n actions,\n listItems,\n headingTag = \"h2\",\n headingVariant = \"display-15\",\n children,\n ...props\n}: ContentBlockProps) => {\n const context = useContext(ContentBlockGroupContext);\n\n const classes = cx([\n rootClassName,\n {\n [`${rootClassName}--negative`]: context?.negative || negative,\n [`${rootClassName}--reverse`]: context?.reverse,\n },\n className,\n ]);\n\n return (\n <div className={classes} {...props}>\n <div className={cx(`${rootClassName}__section`)}>\n {video ? (\n <div className={cx(`${rootClassName}__video-wrapper`)}>{video}</div>\n ) : (\n <div className={cx(`${rootClassName}__image-wrapper`)}>{image}</div>\n )}\n </div>\n <div className={cx(`${rootClassName}__section`)}>\n <div className={cx(`${rootClassName}__content-wrapper`)}>\n {badge && <div className={cx(`${rootClassName}__badge-wrapper`)}>{badge}</div>}\n {beforeTitle}\n {title?.trim() && (\n <Heading variant={headingVariant} tag={headingTag} negative={negative}>\n {title}\n </Heading>\n )}\n <div className={cx(`${rootClassName}__content`)}>{children}</div>\n {!!listItems?.length && (\n <ul className={cx(`${rootClassName}__list`)}>\n {listItems.map(\n (item) =>\n item && (\n <li className={cx(`${rootClassName}__list-item`)} key={item}>\n <IconCheckmark size=\"xs\" className={cx(`${rootClassName}__list-item-icon`)} />\n <Paragraph negative={negative}>{item}</Paragraph>\n </li>\n )\n )}\n </ul>\n )}\n {actions && <div className={cx(`${rootClassName}__actions`)}>{actions}</div>}\n </div>\n </div>\n </div>\n );\n};\n\nContentBlock.Group = ContentBlockGroup;\nContentBlock.displayName = \"ContentBlock\";\n"],"names":["cx","c","styles","rootClassName","ContentBlockGroupContext","createContext","ContentBlockGroup","children","className","negative","mediaStartPosition","props","classes","jsx","ContentBlock","image","video","badge","beforeTitle","title","actions","listItems","headingTag","headingVariant","context","useContext","jsxs","Heading","item","IconCheckmark","Paragraph"],"mappings":"q2CAMMA,EAAKC,EAAAA,EAAE,KAAKC,CAAM,EAClBC,EAAgB,6BAETC,EAA2BC,EAAAA,cAG9B,IAAI,EAQDC,EAAoB,CAAC,CAChC,SAAAC,EACA,UAAAC,EACA,SAAAC,EACA,mBAAAC,EAAqB,OACrB,GAAGC,CACL,IAA8B,CAC5B,MAAMC,EAAUZ,EAAG,CACjBG,EACA,CACE,CAAC,GAAGA,CAAa,YAAY,EAAGM,CAAA,EAElCD,CAAA,CACD,EAED,OACEK,EAAAA,IAAC,MAAA,CAAI,UAAWD,EAAU,GAAGD,EAC3B,SAAAE,EAAAA,IAACT,EAAyB,SAAzB,CACC,MAAO,CAAE,SAAAK,EAAU,QAASC,IAAuB,OAAA,EAElD,SAAAH,CAAA,CAAA,EAEL,CAEJ,EAEAD,EAAkB,YAAc,oBCpChC,MAAMN,EAAKC,EAAAA,EAAE,KAAKC,CAAM,EAClBC,EAAgB,uBAqBTW,EAAe,CAAC,CAC3B,UAAAN,EACA,SAAAC,EACA,MAAAM,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EF,EAAAA,KAAC,KAAA,CAAG,UAAW1B,EAAG,GAAGG,CAAa,aAAa,EAC7C,SAAA,CAAAU,EAAAA,IAACgB,EAAAA,EAAA,CAAc,KAAK,KAAK,UAAW7B,EAAG,GAAGG,CAAa,kBAAkB,CAAA,CAAG,EAC5EU,EAAAA,IAACiB,EAAAA,UAAA,CAAU,SAAArB,EAAqB,SAAAmB,CAAA,CAAK,CAAA,CAAA,EAFgBA,CAGvD,CAAA,EAGR,EAEDR,SAAY,MAAA,CAAI,UAAWpB,EAAG,GAAGG,CAAa,WAAW,EAAI,SAAAiB,CAAA,CAAQ,CAAA,CAAA,CACxE,CAAA,CACF,CAAA,EACF,CAEJ,EAEAN,EAAa,MAAQR,EACrBQ,EAAa,YAAc"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./content-block-CDRUH0pg.js");exports.ContentBlock=t.ContentBlock;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./content-block-CrekbIfe.js");exports.ContentBlock=t.ContentBlock;
2
2
  //# sourceMappingURL=content-block.cjs.js.map
@@ -1,4 +1,4 @@
1
- import { C as e } from "./content-block-Dm3L4g8w.mjs";
1
+ import { C as e } from "./content-block-CakKeJtN.mjs";
2
2
  export {
3
3
  e as ContentBlock
4
4
  };
@@ -1,6 +1,6 @@
1
1
  import { jsxs as v, jsx as u, Fragment as T } from "react/jsx-runtime";
2
2
  import { forwardRef as k, useId as G, useState as J, useMemo as z, useEffect as K } from "react";
3
- import { P as M } from "./paragraph-Ci50OF1u.mjs";
3
+ import { P as M } from "./paragraph-DSxXmX_0.mjs";
4
4
  import { V as O } from "./visually-hidden-BYFkJEp1.mjs";
5
5
  import { c as A } from "./bind-CU-R61T-.mjs";
6
6
  const U = {
@@ -176,4 +176,4 @@ B.displayName = "Countdown";
176
176
  export {
177
177
  B as C
178
178
  };
179
- //# sourceMappingURL=countdown-DZ4IwkNy.mjs.map
179
+ //# sourceMappingURL=countdown-BsLsEZBv.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"countdown-DZ4IwkNy.mjs","sources":["../../../components/countdown/src/counter.tsx","../../../components/countdown/src/utils.ts","../../../components/countdown/src/countdown.tsx"],"sourcesContent":["import React from \"react\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport c from \"classnames/bind\";\n\nimport { type CounterLabels } from \"./countdown.types\";\nimport styles from \"./counter.module.scss\";\n\nconst cx = c.bind(styles);\n\nconst rootClassName = \"purpur-countdown-counter\";\n\ninterface CounterProps {\n numbers: string[];\n size: \"md\" | \"lg\";\n tag: \"days\" | \"hours\" | \"minutes\" | \"seconds\";\n counterLabels: CounterLabels;\n}\n\nexport const Counter = ({ tag, size, numbers, counterLabels }: CounterProps) => {\n const renderLabel = () => {\n const label = counterLabels[tag];\n const abbreviatedLabel = counterLabels[`${tag}Abbr`];\n\n return (\n <>\n {abbreviatedLabel && (\n <Paragraph className={cx(`${rootClassName}__label`, `${rootClassName}__label--abbr`)}>\n <abbr title={label}>{abbreviatedLabel}</abbr>\n </Paragraph>\n )}\n <Paragraph\n className={cx(`${rootClassName}__label`, {\n [`${rootClassName}__label--full`]: !!abbreviatedLabel,\n })}\n >\n {label}\n </Paragraph>\n </>\n );\n };\n\n return (\n <div\n className={cx(rootClassName, `${rootClassName}--size-${size}`)}\n role=\"group\"\n aria-hidden=\"true\"\n data-testid={`counter-${tag}`}\n >\n <div className={cx(`${rootClassName}__number-list-container`)}>\n {numbers.map((number, index) => {\n return (\n <ul\n key={index}\n className={cx(`${rootClassName}__number-list`)}\n style={\n {\n \"--offset\": number,\n } as React.CSSProperties\n }\n >\n {digits.map((d, i) => {\n const selected = d === number;\n\n return (\n <li\n key={i}\n className={cx(`${rootClassName}__number`, {\n [`${rootClassName}__number--selected`]: selected,\n })}\n >\n {d}\n </li>\n );\n })}\n </ul>\n );\n })}\n </div>\n\n {renderLabel()}\n </div>\n );\n};\n\nconst digits = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\"];\n","export function getDiffs(endtime: number) {\n const now = new Date().getTime();\n\n const totalSeconds = Math.max(0, endtime - now);\n\n const _days = Math.floor(totalSeconds / inMs.day);\n const _hours = Math.floor((totalSeconds % inMs.day) / inMs.hour);\n const _minutes = Math.floor((totalSeconds % inMs.hour) / inMs.minute);\n const _seconds = Math.floor((totalSeconds % inMs.minute) / inMs.second);\n\n const days = splitDigits(_days);\n const hours = splitDigits(_hours);\n const minutes = splitDigits(_minutes);\n const seconds = splitDigits(_seconds);\n\n return {\n seconds,\n minutes,\n hours,\n days,\n };\n}\n\nexport const inMs = {\n second: 1000,\n minute: 60 * 1000,\n hour: 60 * 60 * 1000,\n day: 24 * 60 * 60 * 1000,\n};\n\nexport function toDate(t: string | number | Date) {\n return t instanceof Date ? t : new Date(t);\n}\n\nexport function splitDigits(value: number) {\n const s = String(value).padStart(2, \"0\");\n return s.split(\"\");\n}\n","import React, { type ForwardedRef, forwardRef, useEffect, useId, useMemo, useState } from \"react\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport { VisuallyHidden } from \"@purpur/visually-hidden\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./countdown.module.scss\";\nimport { type CountdownProps } from \"./countdown.types\";\nimport { Counter } from \"./counter\";\nimport { getDiffs, toDate } from \"./utils\";\n\nconst cx = c.bind(styles);\n\nconst rootClassName = \"purpur-countdown\";\n\n/**\n * Countdown component to display a countdown timer.\n * @param props - CountdownProps\n * @returns A React component that displays a countdown timer.\n */\n\nexport const Countdown = forwardRef(\n (\n { renderAfterEnd, renderBeforeStart, ...props }: CountdownProps,\n ref: ForwardedRef<HTMLButtonElement>\n ) => {\n const nowInit = new Date();\n const id = useId();\n\n const {\n size = \"lg\",\n fullWidth = false,\n negative = false,\n showDays = true,\n variant = \"primary\",\n className,\n counterLabels,\n useMediaQueries = false,\n } = props;\n\n const [now, setNow] = useState<Date>(nowInit);\n\n const start = useMemo(() => toDate(props.starttime), [props.starttime]);\n const end = useMemo(() => toDate(props.endtime), [props.endtime]);\n const { days, hours, minutes, seconds } = useMemo(() => getDiffs(end.getTime()), [now]);\n\n useEffect(() => {\n if (now < start || now > end) return;\n const t = setInterval(() => setNow(new Date()), 1000);\n return () => clearInterval(t);\n }, [start, end, now]);\n\n const hasNotStarted = start > now;\n const hasEnded = end < now;\n\n // don't render if before start or after end\n if (hasNotStarted) return renderBeforeStart ? renderBeforeStart(props) : null;\n if (hasEnded) return renderAfterEnd ? renderAfterEnd(props) : null;\n\n const getCounters = () => {\n const counterProps = { size, counterLabels };\n\n return (\n <>\n {showDays && <Counter numbers={days} tag=\"days\" {...counterProps} />}\n <Counter numbers={hours} tag=\"hours\" {...counterProps} />\n <Counter numbers={minutes} tag=\"minutes\" {...counterProps} />\n <Counter numbers={seconds} tag=\"seconds\" {...counterProps} />\n </>\n );\n };\n\n // Create a single announcement of the current time (only once)\n\n const renderAnnouncer = () => {\n const getTimeAnnouncement = () => {\n const parts = [];\n\n if (showDays) parts.push(`${days.join(\"\")} ${counterLabels.days}`);\n parts.push(`${hours.join(\"\")} ${counterLabels.hours}`);\n parts.push(`${minutes.join(\"\")} ${counterLabels.minutes}`);\n parts.push(`${seconds.join(\"\")} ${counterLabels.seconds}`);\n\n return parts.join(\", \");\n };\n\n return (\n <VisuallyHidden\n data-testid=\"live-region\"\n aria-live=\"polite\"\n aria-label={props[\"aria-label\"]}\n >\n {getTimeAnnouncement()}\n </VisuallyHidden>\n );\n };\n\n const counters = getCounters();\n\n const classes = cx(\n rootClassName,\n `${rootClassName}--size-${size}`,\n `${rootClassName}--variant-${variant}`,\n {\n [`${rootClassName}--full-width`]: fullWidth,\n [`${rootClassName}--negative`]: negative,\n [`${rootClassName}--show-days`]: showDays,\n [`${rootClassName}--use-media-queries`]: useMediaQueries,\n [`${rootClassName}--use-container-queries`]: !useMediaQueries,\n },\n className\n );\n\n return (\n <section\n id={id}\n className={classes}\n ref={ref}\n role=\"timer\"\n data-testid={props[\"data-testid\"]}\n >\n {/* Visually hidden live region that announces time only once */}\n {renderAnnouncer()}\n {props.label && (\n <Paragraph className={cx(`${rootClassName}__label`)} variant=\"paragraph-100-medium\">\n {props.label}\n </Paragraph>\n )}\n <div className={cx(`${rootClassName}__counter-container`)}>{counters}</div>\n </section>\n );\n }\n);\n\nCountdown.displayName = \"Countdown\";\n"],"names":["cx","c","styles","rootClassName","Counter","tag","size","numbers","counterLabels","renderLabel","label","abbreviatedLabel","jsxs","Fragment","Paragraph","jsx","number","index","digits","d","i","selected","getDiffs","endtime","now","totalSeconds","_days","inMs","_hours","_minutes","_seconds","days","splitDigits","hours","minutes","toDate","value","Countdown","forwardRef","renderAfterEnd","renderBeforeStart","props","ref","nowInit","id","useId","fullWidth","negative","showDays","variant","className","useMediaQueries","setNow","useState","start","useMemo","end","seconds","useEffect","t","hasNotStarted","hasEnded","getCounters","counterProps","renderAnnouncer","getTimeAnnouncement","parts","VisuallyHidden","counters","classes"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAOMA,IAAKC,EAAE,KAAKC,CAAM,GAElBC,IAAgB,4BASTC,IAAU,CAAC,EAAE,KAAAC,GAAK,MAAAC,GAAM,SAAAC,GAAS,eAAAC,QAAkC;AAC9E,QAAMC,IAAc,MAAM;AACxB,UAAMC,IAAQF,EAAcH,CAAG,GACzBM,IAAmBH,EAAc,GAAGH,CAAG,MAAM;AAEnD,WACE,gBAAAO,EAAAC,GAAA,EACG,UAAA;AAAA,MAAAF,uBACEG,GAAA,EAAU,WAAWd,EAAG,GAAGG,CAAa,WAAW,GAAGA,CAAa,eAAe,GACjF,UAAA,gBAAAY,EAAC,QAAA,EAAK,OAAOL,GAAQ,aAAiB,GACxC;AAAA,MAEF,gBAAAK;AAAA,QAACD;AAAA,QAAA;AAAA,UACC,WAAWd,EAAG,GAAGG,CAAa,WAAW;AAAA,YACvC,CAAC,GAAGA,CAAa,eAAe,GAAG,CAAC,CAACQ;AAAA,UAA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EAAA,CAAS;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAG3E;AACF;AAEA/B,EAAU,cAAc;"}
1
+ {"version":3,"file":"countdown-BsLsEZBv.mjs","sources":["../../../components/countdown/src/counter.tsx","../../../components/countdown/src/utils.ts","../../../components/countdown/src/countdown.tsx"],"sourcesContent":["import React from \"react\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport c from \"classnames/bind\";\n\nimport { type CounterLabels } from \"./countdown.types\";\nimport styles from \"./counter.module.scss\";\n\nconst cx = c.bind(styles);\n\nconst rootClassName = \"purpur-countdown-counter\";\n\ninterface CounterProps {\n numbers: string[];\n size: \"md\" | \"lg\";\n tag: \"days\" | \"hours\" | \"minutes\" | \"seconds\";\n counterLabels: CounterLabels;\n}\n\nexport const Counter = ({ tag, size, numbers, counterLabels }: CounterProps) => {\n const renderLabel = () => {\n const label = counterLabels[tag];\n const abbreviatedLabel = counterLabels[`${tag}Abbr`];\n\n return (\n <>\n {abbreviatedLabel && (\n <Paragraph className={cx(`${rootClassName}__label`, `${rootClassName}__label--abbr`)}>\n <abbr title={label}>{abbreviatedLabel}</abbr>\n </Paragraph>\n )}\n <Paragraph\n className={cx(`${rootClassName}__label`, {\n [`${rootClassName}__label--full`]: !!abbreviatedLabel,\n })}\n >\n {label}\n </Paragraph>\n </>\n );\n };\n\n return (\n <div\n className={cx(rootClassName, `${rootClassName}--size-${size}`)}\n role=\"group\"\n aria-hidden=\"true\"\n data-testid={`counter-${tag}`}\n >\n <div className={cx(`${rootClassName}__number-list-container`)}>\n {numbers.map((number, index) => {\n return (\n <ul\n key={index}\n className={cx(`${rootClassName}__number-list`)}\n style={\n {\n \"--offset\": number,\n } as React.CSSProperties\n }\n >\n {digits.map((d, i) => {\n const selected = d === number;\n\n return (\n <li\n key={i}\n className={cx(`${rootClassName}__number`, {\n [`${rootClassName}__number--selected`]: selected,\n })}\n >\n {d}\n </li>\n );\n })}\n </ul>\n );\n })}\n </div>\n\n {renderLabel()}\n </div>\n );\n};\n\nconst digits = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\"];\n","export function getDiffs(endtime: number) {\n const now = new Date().getTime();\n\n const totalSeconds = Math.max(0, endtime - now);\n\n const _days = Math.floor(totalSeconds / inMs.day);\n const _hours = Math.floor((totalSeconds % inMs.day) / inMs.hour);\n const _minutes = Math.floor((totalSeconds % inMs.hour) / inMs.minute);\n const _seconds = Math.floor((totalSeconds % inMs.minute) / inMs.second);\n\n const days = splitDigits(_days);\n const hours = splitDigits(_hours);\n const minutes = splitDigits(_minutes);\n const seconds = splitDigits(_seconds);\n\n return {\n seconds,\n minutes,\n hours,\n days,\n };\n}\n\nexport const inMs = {\n second: 1000,\n minute: 60 * 1000,\n hour: 60 * 60 * 1000,\n day: 24 * 60 * 60 * 1000,\n};\n\nexport function toDate(t: string | number | Date) {\n return t instanceof Date ? t : new Date(t);\n}\n\nexport function splitDigits(value: number) {\n const s = String(value).padStart(2, \"0\");\n return s.split(\"\");\n}\n","import React, { type ForwardedRef, forwardRef, useEffect, useId, useMemo, useState } from \"react\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport { VisuallyHidden } from \"@purpur/visually-hidden\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./countdown.module.scss\";\nimport { type CountdownProps } from \"./countdown.types\";\nimport { Counter } from \"./counter\";\nimport { getDiffs, toDate } from \"./utils\";\n\nconst cx = c.bind(styles);\n\nconst rootClassName = \"purpur-countdown\";\n\n/**\n * Countdown component to display a countdown timer.\n * @param props - CountdownProps\n * @returns A React component that displays a countdown timer.\n */\n\nexport const Countdown = forwardRef(\n (\n { renderAfterEnd, renderBeforeStart, ...props }: CountdownProps,\n ref: ForwardedRef<HTMLButtonElement>\n ) => {\n const nowInit = new Date();\n const id = useId();\n\n const {\n size = \"lg\",\n fullWidth = false,\n negative = false,\n showDays = true,\n variant = \"primary\",\n className,\n counterLabels,\n useMediaQueries = false,\n } = props;\n\n const [now, setNow] = useState<Date>(nowInit);\n\n const start = useMemo(() => toDate(props.starttime), [props.starttime]);\n const end = useMemo(() => toDate(props.endtime), [props.endtime]);\n const { days, hours, minutes, seconds } = useMemo(() => getDiffs(end.getTime()), [now]);\n\n useEffect(() => {\n if (now < start || now > end) return;\n const t = setInterval(() => setNow(new Date()), 1000);\n return () => clearInterval(t);\n }, [start, end, now]);\n\n const hasNotStarted = start > now;\n const hasEnded = end < now;\n\n // don't render if before start or after end\n if (hasNotStarted) return renderBeforeStart ? renderBeforeStart(props) : null;\n if (hasEnded) return renderAfterEnd ? renderAfterEnd(props) : null;\n\n const getCounters = () => {\n const counterProps = { size, counterLabels };\n\n return (\n <>\n {showDays && <Counter numbers={days} tag=\"days\" {...counterProps} />}\n <Counter numbers={hours} tag=\"hours\" {...counterProps} />\n <Counter numbers={minutes} tag=\"minutes\" {...counterProps} />\n <Counter numbers={seconds} tag=\"seconds\" {...counterProps} />\n </>\n );\n };\n\n // Create a single announcement of the current time (only once)\n\n const renderAnnouncer = () => {\n const getTimeAnnouncement = () => {\n const parts = [];\n\n if (showDays) parts.push(`${days.join(\"\")} ${counterLabels.days}`);\n parts.push(`${hours.join(\"\")} ${counterLabels.hours}`);\n parts.push(`${minutes.join(\"\")} ${counterLabels.minutes}`);\n parts.push(`${seconds.join(\"\")} ${counterLabels.seconds}`);\n\n return parts.join(\", \");\n };\n\n return (\n <VisuallyHidden\n data-testid=\"live-region\"\n aria-live=\"polite\"\n aria-label={props[\"aria-label\"]}\n >\n {getTimeAnnouncement()}\n </VisuallyHidden>\n );\n };\n\n const counters = getCounters();\n\n const classes = cx(\n rootClassName,\n `${rootClassName}--size-${size}`,\n `${rootClassName}--variant-${variant}`,\n {\n [`${rootClassName}--full-width`]: fullWidth,\n [`${rootClassName}--negative`]: negative,\n [`${rootClassName}--show-days`]: showDays,\n [`${rootClassName}--use-media-queries`]: useMediaQueries,\n [`${rootClassName}--use-container-queries`]: !useMediaQueries,\n },\n className\n );\n\n return (\n <section\n id={id}\n className={classes}\n ref={ref}\n role=\"timer\"\n data-testid={props[\"data-testid\"]}\n >\n {/* Visually hidden live region that announces time only once */}\n {renderAnnouncer()}\n {props.label && (\n <Paragraph className={cx(`${rootClassName}__label`)} variant=\"paragraph-100-medium\">\n {props.label}\n </Paragraph>\n )}\n <div className={cx(`${rootClassName}__counter-container`)}>{counters}</div>\n </section>\n );\n }\n);\n\nCountdown.displayName = \"Countdown\";\n"],"names":["cx","c","styles","rootClassName","Counter","tag","size","numbers","counterLabels","renderLabel","label","abbreviatedLabel","jsxs","Fragment","Paragraph","jsx","number","index","digits","d","i","selected","getDiffs","endtime","now","totalSeconds","_days","inMs","_hours","_minutes","_seconds","days","splitDigits","hours","minutes","toDate","value","Countdown","forwardRef","renderAfterEnd","renderBeforeStart","props","ref","nowInit","id","useId","fullWidth","negative","showDays","variant","className","useMediaQueries","setNow","useState","start","useMemo","end","seconds","useEffect","t","hasNotStarted","hasEnded","getCounters","counterProps","renderAnnouncer","getTimeAnnouncement","parts","VisuallyHidden","counters","classes"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAOMA,IAAKC,EAAE,KAAKC,CAAM,GAElBC,IAAgB,4BASTC,IAAU,CAAC,EAAE,KAAAC,GAAK,MAAAC,GAAM,SAAAC,GAAS,eAAAC,QAAkC;AAC9E,QAAMC,IAAc,MAAM;AACxB,UAAMC,IAAQF,EAAcH,CAAG,GACzBM,IAAmBH,EAAc,GAAGH,CAAG,MAAM;AAEnD,WACE,gBAAAO,EAAAC,GAAA,EACG,UAAA;AAAA,MAAAF,uBACEG,GAAA,EAAU,WAAWd,EAAG,GAAGG,CAAa,WAAW,GAAGA,CAAa,eAAe,GACjF,UAAA,gBAAAY,EAAC,QAAA,EAAK,OAAOL,GAAQ,aAAiB,GACxC;AAAA,MAEF,gBAAAK;AAAA,QAACD;AAAA,QAAA;AAAA,UACC,WAAWd,EAAG,GAAGG,CAAa,WAAW;AAAA,YACvC,CAAC,GAAGA,CAAa,eA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GG,CAAa,qBAAqB,GAAI,UAAAiE,EAAA,CAAS;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAG3E;AACF;AAEA/B,EAAU,cAAc;"}
@@ -1,2 +1,2 @@
1
- "use strict";const n=require("react/jsx-runtime"),d=require("react"),N=require("./paragraph-BsI53OR0.js"),W=require("./visually-hidden-C2CKovZx.js"),S=require("./bind-DeUYJ6m9.js"),k={"purpur-countdown--size-md":"_purpur-countdown--size-md_ytnsp_1","purpur-countdown--size-lg":"_purpur-countdown--size-lg_ytnsp_5","purpur-countdown--use-container-queries":"_purpur-countdown--use-container-queries_ytnsp_10","purpur-countdown__counter-container":"_purpur-countdown__counter-container_ytnsp_10","purpur-countdown--full-width":"_purpur-countdown--full-width_ytnsp_15","purpur-countdown--use-media-queries":"_purpur-countdown--use-media-queries_ytnsp_25","purpur-countdown":"_purpur-countdown_ytnsp_1","purpur-countdown--variant-primary":"_purpur-countdown--variant-primary_ytnsp_40","purpur-countdown--variant-secondary":"_purpur-countdown--variant-secondary_ytnsp_43","purpur-countdown--negative":"_purpur-countdown--negative_ytnsp_46","purpur-countdown--show-days":"_purpur-countdown--show-days_ytnsp_56","purpur-countdown__label":"_purpur-countdown__label_ytnsp_72"},G={"purpur-countdown-counter":"_purpur-countdown-counter_23fbu_1","purpur-countdown-counter--size-lg":"_purpur-countdown-counter--size-lg_23fbu_10","purpur-countdown-counter__number":"_purpur-countdown-counter__number_23fbu_15","purpur-countdown-counter--size-md":"_purpur-countdown-counter--size-md_23fbu_21","purpur-countdown-counter__number-list-container":"_purpur-countdown-counter__number-list-container_23fbu_35","purpur-countdown-counter__number-list":"_purpur-countdown-counter__number-list_23fbu_35","purpur-countdown-counter__number--selected":"_purpur-countdown-counter__number--selected_23fbu_61","purpur-countdown-counter__label":"_purpur-countdown-counter__label_23fbu_64","purpur-countdown-counter__label--abbr":"_purpur-countdown-counter__label--abbr_23fbu_71","purpur-countdown-counter__label--full":"_purpur-countdown-counter__label--full_23fbu_74"},w=S.c.bind(G),r="purpur-countdown-counter",g=({tag:u,size:a,numbers:e,counterLabels:_})=>{const b=()=>{const s=_[u],t=_[`${u}Abbr`];return n.jsxs(n.Fragment,{children:[t&&n.jsx(N.Paragraph,{className:w(`${r}__label`,`${r}__label--abbr`),children:n.jsx("abbr",{title:s,children:t})}),n.jsx(N.Paragraph,{className:w(`${r}__label`,{[`${r}__label--full`]:!!t}),children:s})]})};return n.jsxs("div",{className:w(r,`${r}--size-${a}`),role:"group","aria-hidden":"true","data-testid":`counter-${u}`,children:[n.jsx("div",{className:w(`${r}__number-list-container`),children:e.map((s,t)=>n.jsx("ul",{className:w(`${r}__number-list`),style:{"--offset":s},children:J.map((p,h)=>{const i=p===s;return n.jsx("li",{className:w(`${r}__number`,{[`${r}__number--selected`]:i}),children:p},h)})},t))}),b()]})},J=["0","1","2","3","4","5","6","7","8","9"];function K(u){const a=new Date().getTime(),e=Math.max(0,u-a),_=Math.floor(e/l.day),b=Math.floor(e%l.day/l.hour),s=Math.floor(e%l.hour/l.minute),t=Math.floor(e%l.minute/l.second),p=j(_),h=j(b),i=j(s);return{seconds:j(t),minutes:i,hours:h,days:p}}const l={second:1e3,minute:60*1e3,hour:3600*1e3,day:1440*60*1e3};function P(u){return u instanceof Date?u:new Date(u)}function j(u){return String(u).padStart(2,"0").split("")}const v=S.c.bind(k),o="purpur-countdown",R=d.forwardRef(({renderAfterEnd:u,renderBeforeStart:a,...e},_)=>{const b=new Date,s=d.useId(),{size:t="lg",fullWidth:p=!1,negative:h=!1,showDays:i=!0,variant:q="primary",className:T,counterLabels:f,useMediaQueries:z=!1}=e,[m,A]=d.useState(b),x=d.useMemo(()=>P(e.starttime),[e.starttime]),$=d.useMemo(()=>P(e.endtime),[e.endtime]),{days:M,hours:D,minutes:C,seconds:I}=d.useMemo(()=>K($.getTime()),[m]);d.useEffect(()=>{if(m<x||m>$)return;const c=setInterval(()=>A(new Date),1e3);return()=>clearInterval(c)},[x,$,m]);const F=x>m,H=$<m;if(F)return a?a(e):null;if(H)return u?u(e):null;const L=()=>{const c={size:t,counterLabels:f};return n.jsxs(n.Fragment,{children:[i&&n.jsx(g,{numbers:M,tag:"days",...c}),n.jsx(g,{numbers:D,tag:"hours",...c}),n.jsx(g,{numbers:C,tag:"minutes",...c}),n.jsx(g,{numbers:I,tag:"seconds",...c})]})},E=()=>{const c=()=>{const y=[];return i&&y.push(`${M.join("")} ${f.days}`),y.push(`${D.join("")} ${f.hours}`),y.push(`${C.join("")} ${f.minutes}`),y.push(`${I.join("")} ${f.seconds}`),y.join(", ")};return n.jsx(W.VisuallyHidden,{"data-testid":"live-region","aria-live":"polite","aria-label":e["aria-label"],children:c()})},Q=L(),V=v(o,`${o}--size-${t}`,`${o}--variant-${q}`,{[`${o}--full-width`]:p,[`${o}--negative`]:h,[`${o}--show-days`]:i,[`${o}--use-media-queries`]:z,[`${o}--use-container-queries`]:!z},T);return n.jsxs("section",{id:s,className:V,ref:_,role:"timer","data-testid":e["data-testid"],children:[E(),e.label&&n.jsx(N.Paragraph,{className:v(`${o}__label`),variant:"paragraph-100-medium",children:e.label}),n.jsx("div",{className:v(`${o}__counter-container`),children:Q})]})});R.displayName="Countdown";exports.Countdown=R;
2
- //# sourceMappingURL=countdown-CqYsZigV.js.map
1
+ "use strict";const n=require("react/jsx-runtime"),d=require("react"),N=require("./paragraph-By4jMjnH.js"),W=require("./visually-hidden-C2CKovZx.js"),S=require("./bind-DeUYJ6m9.js"),k={"purpur-countdown--size-md":"_purpur-countdown--size-md_ytnsp_1","purpur-countdown--size-lg":"_purpur-countdown--size-lg_ytnsp_5","purpur-countdown--use-container-queries":"_purpur-countdown--use-container-queries_ytnsp_10","purpur-countdown__counter-container":"_purpur-countdown__counter-container_ytnsp_10","purpur-countdown--full-width":"_purpur-countdown--full-width_ytnsp_15","purpur-countdown--use-media-queries":"_purpur-countdown--use-media-queries_ytnsp_25","purpur-countdown":"_purpur-countdown_ytnsp_1","purpur-countdown--variant-primary":"_purpur-countdown--variant-primary_ytnsp_40","purpur-countdown--variant-secondary":"_purpur-countdown--variant-secondary_ytnsp_43","purpur-countdown--negative":"_purpur-countdown--negative_ytnsp_46","purpur-countdown--show-days":"_purpur-countdown--show-days_ytnsp_56","purpur-countdown__label":"_purpur-countdown__label_ytnsp_72"},G={"purpur-countdown-counter":"_purpur-countdown-counter_23fbu_1","purpur-countdown-counter--size-lg":"_purpur-countdown-counter--size-lg_23fbu_10","purpur-countdown-counter__number":"_purpur-countdown-counter__number_23fbu_15","purpur-countdown-counter--size-md":"_purpur-countdown-counter--size-md_23fbu_21","purpur-countdown-counter__number-list-container":"_purpur-countdown-counter__number-list-container_23fbu_35","purpur-countdown-counter__number-list":"_purpur-countdown-counter__number-list_23fbu_35","purpur-countdown-counter__number--selected":"_purpur-countdown-counter__number--selected_23fbu_61","purpur-countdown-counter__label":"_purpur-countdown-counter__label_23fbu_64","purpur-countdown-counter__label--abbr":"_purpur-countdown-counter__label--abbr_23fbu_71","purpur-countdown-counter__label--full":"_purpur-countdown-counter__label--full_23fbu_74"},w=S.c.bind(G),r="purpur-countdown-counter",g=({tag:u,size:a,numbers:e,counterLabels:_})=>{const b=()=>{const s=_[u],t=_[`${u}Abbr`];return n.jsxs(n.Fragment,{children:[t&&n.jsx(N.Paragraph,{className:w(`${r}__label`,`${r}__label--abbr`),children:n.jsx("abbr",{title:s,children:t})}),n.jsx(N.Paragraph,{className:w(`${r}__label`,{[`${r}__label--full`]:!!t}),children:s})]})};return n.jsxs("div",{className:w(r,`${r}--size-${a}`),role:"group","aria-hidden":"true","data-testid":`counter-${u}`,children:[n.jsx("div",{className:w(`${r}__number-list-container`),children:e.map((s,t)=>n.jsx("ul",{className:w(`${r}__number-list`),style:{"--offset":s},children:J.map((p,h)=>{const i=p===s;return n.jsx("li",{className:w(`${r}__number`,{[`${r}__number--selected`]:i}),children:p},h)})},t))}),b()]})},J=["0","1","2","3","4","5","6","7","8","9"];function K(u){const a=new Date().getTime(),e=Math.max(0,u-a),_=Math.floor(e/l.day),b=Math.floor(e%l.day/l.hour),s=Math.floor(e%l.hour/l.minute),t=Math.floor(e%l.minute/l.second),p=j(_),h=j(b),i=j(s);return{seconds:j(t),minutes:i,hours:h,days:p}}const l={second:1e3,minute:60*1e3,hour:3600*1e3,day:1440*60*1e3};function P(u){return u instanceof Date?u:new Date(u)}function j(u){return String(u).padStart(2,"0").split("")}const v=S.c.bind(k),o="purpur-countdown",R=d.forwardRef(({renderAfterEnd:u,renderBeforeStart:a,...e},_)=>{const b=new Date,s=d.useId(),{size:t="lg",fullWidth:p=!1,negative:h=!1,showDays:i=!0,variant:q="primary",className:T,counterLabels:f,useMediaQueries:z=!1}=e,[m,A]=d.useState(b),x=d.useMemo(()=>P(e.starttime),[e.starttime]),$=d.useMemo(()=>P(e.endtime),[e.endtime]),{days:M,hours:D,minutes:C,seconds:I}=d.useMemo(()=>K($.getTime()),[m]);d.useEffect(()=>{if(m<x||m>$)return;const c=setInterval(()=>A(new Date),1e3);return()=>clearInterval(c)},[x,$,m]);const F=x>m,H=$<m;if(F)return a?a(e):null;if(H)return u?u(e):null;const L=()=>{const c={size:t,counterLabels:f};return n.jsxs(n.Fragment,{children:[i&&n.jsx(g,{numbers:M,tag:"days",...c}),n.jsx(g,{numbers:D,tag:"hours",...c}),n.jsx(g,{numbers:C,tag:"minutes",...c}),n.jsx(g,{numbers:I,tag:"seconds",...c})]})},E=()=>{const c=()=>{const y=[];return i&&y.push(`${M.join("")} ${f.days}`),y.push(`${D.join("")} ${f.hours}`),y.push(`${C.join("")} ${f.minutes}`),y.push(`${I.join("")} ${f.seconds}`),y.join(", ")};return n.jsx(W.VisuallyHidden,{"data-testid":"live-region","aria-live":"polite","aria-label":e["aria-label"],children:c()})},Q=L(),V=v(o,`${o}--size-${t}`,`${o}--variant-${q}`,{[`${o}--full-width`]:p,[`${o}--negative`]:h,[`${o}--show-days`]:i,[`${o}--use-media-queries`]:z,[`${o}--use-container-queries`]:!z},T);return n.jsxs("section",{id:s,className:V,ref:_,role:"timer","data-testid":e["data-testid"],children:[E(),e.label&&n.jsx(N.Paragraph,{className:v(`${o}__label`),variant:"paragraph-100-medium",children:e.label}),n.jsx("div",{className:v(`${o}__counter-container`),children:Q})]})});R.displayName="Countdown";exports.Countdown=R;
2
+ //# sourceMappingURL=countdown-hYrFLmRg.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"countdown-CqYsZigV.js","sources":["../../../components/countdown/src/counter.tsx","../../../components/countdown/src/utils.ts","../../../components/countdown/src/countdown.tsx"],"sourcesContent":["import React from \"react\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport c from \"classnames/bind\";\n\nimport { type CounterLabels } from \"./countdown.types\";\nimport styles from \"./counter.module.scss\";\n\nconst cx = c.bind(styles);\n\nconst rootClassName = \"purpur-countdown-counter\";\n\ninterface CounterProps {\n numbers: string[];\n size: \"md\" | \"lg\";\n tag: \"days\" | \"hours\" | \"minutes\" | \"seconds\";\n counterLabels: CounterLabels;\n}\n\nexport const Counter = ({ tag, size, numbers, counterLabels }: CounterProps) => {\n const renderLabel = () => {\n const label = counterLabels[tag];\n const abbreviatedLabel = counterLabels[`${tag}Abbr`];\n\n return (\n <>\n {abbreviatedLabel && (\n <Paragraph className={cx(`${rootClassName}__label`, `${rootClassName}__label--abbr`)}>\n <abbr title={label}>{abbreviatedLabel}</abbr>\n </Paragraph>\n )}\n <Paragraph\n className={cx(`${rootClassName}__label`, {\n [`${rootClassName}__label--full`]: !!abbreviatedLabel,\n })}\n >\n {label}\n </Paragraph>\n </>\n );\n };\n\n return (\n <div\n className={cx(rootClassName, `${rootClassName}--size-${size}`)}\n role=\"group\"\n aria-hidden=\"true\"\n data-testid={`counter-${tag}`}\n >\n <div className={cx(`${rootClassName}__number-list-container`)}>\n {numbers.map((number, index) => {\n return (\n <ul\n key={index}\n className={cx(`${rootClassName}__number-list`)}\n style={\n {\n \"--offset\": number,\n } as React.CSSProperties\n }\n >\n {digits.map((d, i) => {\n const selected = d === number;\n\n return (\n <li\n key={i}\n className={cx(`${rootClassName}__number`, {\n [`${rootClassName}__number--selected`]: selected,\n })}\n >\n {d}\n </li>\n );\n })}\n </ul>\n );\n })}\n </div>\n\n {renderLabel()}\n </div>\n );\n};\n\nconst digits = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\"];\n","export function getDiffs(endtime: number) {\n const now = new Date().getTime();\n\n const totalSeconds = Math.max(0, endtime - now);\n\n const _days = Math.floor(totalSeconds / inMs.day);\n const _hours = Math.floor((totalSeconds % inMs.day) / inMs.hour);\n const _minutes = Math.floor((totalSeconds % inMs.hour) / inMs.minute);\n const _seconds = Math.floor((totalSeconds % inMs.minute) / inMs.second);\n\n const days = splitDigits(_days);\n const hours = splitDigits(_hours);\n const minutes = splitDigits(_minutes);\n const seconds = splitDigits(_seconds);\n\n return {\n seconds,\n minutes,\n hours,\n days,\n };\n}\n\nexport const inMs = {\n second: 1000,\n minute: 60 * 1000,\n hour: 60 * 60 * 1000,\n day: 24 * 60 * 60 * 1000,\n};\n\nexport function toDate(t: string | number | Date) {\n return t instanceof Date ? t : new Date(t);\n}\n\nexport function splitDigits(value: number) {\n const s = String(value).padStart(2, \"0\");\n return s.split(\"\");\n}\n","import React, { type ForwardedRef, forwardRef, useEffect, useId, useMemo, useState } from \"react\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport { VisuallyHidden } from \"@purpur/visually-hidden\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./countdown.module.scss\";\nimport { type CountdownProps } from \"./countdown.types\";\nimport { Counter } from \"./counter\";\nimport { getDiffs, toDate } from \"./utils\";\n\nconst cx = c.bind(styles);\n\nconst rootClassName = \"purpur-countdown\";\n\n/**\n * Countdown component to display a countdown timer.\n * @param props - CountdownProps\n * @returns A React component that displays a countdown timer.\n */\n\nexport const Countdown = forwardRef(\n (\n { renderAfterEnd, renderBeforeStart, ...props }: CountdownProps,\n ref: ForwardedRef<HTMLButtonElement>\n ) => {\n const nowInit = new Date();\n const id = useId();\n\n const {\n size = \"lg\",\n fullWidth = false,\n negative = false,\n showDays = true,\n variant = \"primary\",\n className,\n counterLabels,\n useMediaQueries = false,\n } = props;\n\n const [now, setNow] = useState<Date>(nowInit);\n\n const start = useMemo(() => toDate(props.starttime), [props.starttime]);\n const end = useMemo(() => toDate(props.endtime), [props.endtime]);\n const { days, hours, minutes, seconds } = useMemo(() => getDiffs(end.getTime()), [now]);\n\n useEffect(() => {\n if (now < start || now > end) return;\n const t = setInterval(() => setNow(new Date()), 1000);\n return () => clearInterval(t);\n }, [start, end, now]);\n\n const hasNotStarted = start > now;\n const hasEnded = end < now;\n\n // don't render if before start or after end\n if (hasNotStarted) return renderBeforeStart ? renderBeforeStart(props) : null;\n if (hasEnded) return renderAfterEnd ? renderAfterEnd(props) : null;\n\n const getCounters = () => {\n const counterProps = { size, counterLabels };\n\n return (\n <>\n {showDays && <Counter numbers={days} tag=\"days\" {...counterProps} />}\n <Counter numbers={hours} tag=\"hours\" {...counterProps} />\n <Counter numbers={minutes} tag=\"minutes\" {...counterProps} />\n <Counter numbers={seconds} tag=\"seconds\" {...counterProps} />\n </>\n );\n };\n\n // Create a single announcement of the current time (only once)\n\n const renderAnnouncer = () => {\n const getTimeAnnouncement = () => {\n const parts = [];\n\n if (showDays) parts.push(`${days.join(\"\")} ${counterLabels.days}`);\n parts.push(`${hours.join(\"\")} ${counterLabels.hours}`);\n parts.push(`${minutes.join(\"\")} ${counterLabels.minutes}`);\n parts.push(`${seconds.join(\"\")} ${counterLabels.seconds}`);\n\n return parts.join(\", \");\n };\n\n return (\n <VisuallyHidden\n data-testid=\"live-region\"\n aria-live=\"polite\"\n aria-label={props[\"aria-label\"]}\n >\n {getTimeAnnouncement()}\n </VisuallyHidden>\n );\n };\n\n const counters = getCounters();\n\n const classes = cx(\n rootClassName,\n `${rootClassName}--size-${size}`,\n `${rootClassName}--variant-${variant}`,\n {\n [`${rootClassName}--full-width`]: fullWidth,\n [`${rootClassName}--negative`]: negative,\n [`${rootClassName}--show-days`]: showDays,\n [`${rootClassName}--use-media-queries`]: useMediaQueries,\n [`${rootClassName}--use-container-queries`]: !useMediaQueries,\n },\n className\n );\n\n return (\n <section\n id={id}\n className={classes}\n ref={ref}\n role=\"timer\"\n data-testid={props[\"data-testid\"]}\n >\n {/* Visually hidden live region that announces time only once */}\n {renderAnnouncer()}\n {props.label && (\n <Paragraph className={cx(`${rootClassName}__label`)} variant=\"paragraph-100-medium\">\n {props.label}\n </Paragraph>\n )}\n <div className={cx(`${rootClassName}__counter-container`)}>{counters}</div>\n </section>\n );\n }\n);\n\nCountdown.displayName = \"Countdown\";\n"],"names":["cx","c","styles","rootClassName","Counter","tag","size","numbers","counterLabels","renderLabel","label","abbreviatedLabel","jsxs","Fragment","Paragraph","jsx","number","index","digits","d","i","selected","getDiffs","endtime","now","totalSeconds","_days","inMs","_hours","_minutes","_seconds","days","splitDigits","hours","minutes","toDate","t","value","Countdown","forwardRef","renderAfterEnd","renderBeforeStart","props","ref","nowInit","id","useId","fullWidth","negative","showDays","variant","className","useMediaQueries","setNow","useState","start","useMemo","end","seconds","useEffect","hasNotStarted","hasEnded","getCounters","counterProps","renderAnnouncer","getTimeAnnouncement","parts","VisuallyHidden","counters","classes"],"mappings":"i5DAOMA,EAAKC,EAAAA,EAAE,KAAKC,CAAM,EAElBC,EAAgB,2BASTC,EAAU,CAAC,CAAE,IAAAC,EAAK,KAAAC,EAAM,QAAAC,EAAS,cAAAC,KAAkC,CAC9E,MAAMC,EAAc,IAAM,CACxB,MAAMC,EAAQF,EAAcH,CAAG,EACzBM,EAAmBH,EAAc,GAAGH,CAAG,MAAM,EAEnD,OACEO,EAAAA,KAAAC,WAAA,CACG,SAAA,CAAAF,SACEG,EAAAA,UAAA,CAAU,UAAWd,EAAG,GAAGG,CAAa,UAAW,GAAGA,CAAa,eAAe,EACjF,SAAAY,EAAAA,IAAC,OAAA,CAAK,MAAOL,EAAQ,WAAiB,EACxC,EAEFK,EAAAA,IAACD,EA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oD,EAAAA,eAAA,CACC,cAAY,cACZ,YAAU,SACV,aAAYzB,EAAM,YAAY,EAE7B,SAAAuB,EAAA,CAAoB,CAAA,CAG3B,EAEMG,EAAWN,EAAA,EAEXO,EAAUrE,EACdG,EACA,GAAGA,CAAa,UAAUG,CAAI,GAC9B,GAAGH,CAAa,aAAa+C,CAAO,GACpC,CACE,CAAC,GAAG/C,CAAa,cAAc,EAAG4C,EAClC,CAAC,GAAG5C,CAAa,YAAY,EAAG6C,EAChC,CAAC,GAAG7C,CAAa,aAAa,EAAG8C,EACjC,CAAC,GAAG9C,CAAa,qBAAqB,EAAGiD,EACzC,CAAC,GAAGjD,CAAa,yBAAyB,EAAG,CAACiD,CAAA,EAEhDD,CAAA,EAGF,OACEvC,EAAAA,KAAC,UAAA,CACC,GAAAiC,EACA,UAAWwB,EACX,IAAA1B,EACA,KAAK,QACL,cAAaD,EAAM,aAAa,EAG/B,SAAA,CAAAsB,EAAA,EACAtB,EAAM,OACL3B,EAAAA,IAACD,EAAAA,UAAA,CAAU,UAAWd,EAAG,GAAGG,CAAa,SAAS,EAAG,QAAQ,uBAC1D,WAAM,MACT,EAEFY,EAAAA,IAAC,OAAI,UAAWf,EAAG,GAAGG,CAAa,qBAAqB,EAAI,SAAAiE,CAAA,CAAS,CAAA,CAAA,CAAA,CAG3E,CACF,EAEA9B,EAAU,YAAc"}
1
+ {"version":3,"file":"countdown-hYrFLmRg.js","sources":["../../../components/countdown/src/counter.tsx","../../../components/countdown/src/utils.ts","../../../components/countdown/src/countdown.tsx"],"sourcesContent":["import React from \"react\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport c from \"classnames/bind\";\n\nimport { type CounterLabels } from \"./countdown.types\";\nimport styles from \"./counter.module.scss\";\n\nconst cx = c.bind(styles);\n\nconst rootClassName = \"purpur-countdown-counter\";\n\ninterface CounterProps {\n numbers: string[];\n size: \"md\" | \"lg\";\n tag: \"days\" | \"hours\" | \"minutes\" | \"seconds\";\n counterLabels: CounterLabels;\n}\n\nexport const Counter = ({ tag, size, numbers, counterLabels }: CounterProps) => {\n const renderLabel = () => {\n const label = counterLabels[tag];\n const abbreviatedLabel = counterLabels[`${tag}Abbr`];\n\n return (\n <>\n {abbreviatedLabel && (\n <Paragraph className={cx(`${rootClassName}__label`, `${rootClassName}__label--abbr`)}>\n <abbr title={label}>{abbreviatedLabel}</abbr>\n </Paragraph>\n )}\n <Paragraph\n className={cx(`${rootClassName}__label`, {\n [`${rootClassName}__label--full`]: !!abbreviatedLabel,\n })}\n >\n {label}\n </Paragraph>\n </>\n );\n };\n\n return (\n <div\n className={cx(rootClassName, `${rootClassName}--size-${size}`)}\n role=\"group\"\n aria-hidden=\"true\"\n data-testid={`counter-${tag}`}\n >\n <div className={cx(`${rootClassName}__number-list-container`)}>\n {numbers.map((number, index) => {\n return (\n <ul\n key={index}\n className={cx(`${rootClassName}__number-list`)}\n style={\n {\n \"--offset\": number,\n } as React.CSSProperties\n }\n >\n {digits.map((d, i) => {\n const selected = d === number;\n\n return (\n <li\n key={i}\n className={cx(`${rootClassName}__number`, {\n [`${rootClassName}__number--selected`]: selected,\n })}\n >\n {d}\n </li>\n );\n })}\n </ul>\n );\n })}\n </div>\n\n {renderLabel()}\n </div>\n );\n};\n\nconst digits = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\"];\n","export function getDiffs(endtime: number) {\n const now = new Date().getTime();\n\n const totalSeconds = Math.max(0, endtime - now);\n\n const _days = Math.floor(totalSeconds / inMs.day);\n const _hours = Math.floor((totalSeconds % inMs.day) / inMs.hour);\n const _minutes = Math.floor((totalSeconds % inMs.hour) / inMs.minute);\n const _seconds = Math.floor((totalSeconds % inMs.minute) / inMs.second);\n\n const days = splitDigits(_days);\n const hours = splitDigits(_hours);\n const minutes = splitDigits(_minutes);\n const seconds = splitDigits(_seconds);\n\n return {\n seconds,\n minutes,\n hours,\n days,\n };\n}\n\nexport const inMs = {\n second: 1000,\n minute: 60 * 1000,\n hour: 60 * 60 * 1000,\n day: 24 * 60 * 60 * 1000,\n};\n\nexport function toDate(t: string | number | Date) {\n return t instanceof Date ? t : new Date(t);\n}\n\nexport function splitDigits(value: number) {\n const s = String(value).padStart(2, \"0\");\n return s.split(\"\");\n}\n","import React, { type ForwardedRef, forwardRef, useEffect, useId, useMemo, useState } from \"react\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport { VisuallyHidden } from \"@purpur/visually-hidden\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./countdown.module.scss\";\nimport { type CountdownProps } from \"./countdown.types\";\nimport { Counter } from \"./counter\";\nimport { getDiffs, toDate } from \"./utils\";\n\nconst cx = c.bind(styles);\n\nconst rootClassName = \"purpur-countdown\";\n\n/**\n * Countdown component to display a countdown timer.\n * @param props - CountdownProps\n * @returns A React component that displays a countdown timer.\n */\n\nexport const Countdown = forwardRef(\n (\n { renderAfterEnd, renderBeforeStart, ...props }: CountdownProps,\n ref: ForwardedRef<HTMLButtonElement>\n ) => {\n const nowInit = new Date();\n const id = useId();\n\n const {\n size = \"lg\",\n fullWidth = false,\n negative = false,\n showDays = true,\n variant = \"primary\",\n className,\n counterLabels,\n useMediaQueries = false,\n } = props;\n\n const [now, setNow] = useState<Date>(nowInit);\n\n const start = useMemo(() => toDate(props.starttime), [props.starttime]);\n const end = useMemo(() => toDate(props.endtime), [props.endtime]);\n const { days, hours, minutes, seconds } = useMemo(() => getDiffs(end.getTime()), [now]);\n\n useEffect(() => {\n if (now < start || now > end) return;\n const t = setInterval(() => setNow(new Date()), 1000);\n return () => clearInterval(t);\n }, [start, end, now]);\n\n const hasNotStarted = start > now;\n const hasEnded = end < now;\n\n // don't render if before start or after end\n if (hasNotStarted) return renderBeforeStart ? renderBeforeStart(props) : null;\n if (hasEnded) return renderAfterEnd ? renderAfterEnd(props) : null;\n\n const getCounters = () => {\n const counterProps = { size, counterLabels };\n\n return (\n <>\n {showDays && <Counter numbers={days} tag=\"days\" {...counterProps} />}\n <Counter numbers={hours} tag=\"hours\" {...counterProps} />\n <Counter numbers={minutes} tag=\"minutes\" {...counterProps} />\n <Counter numbers={seconds} tag=\"seconds\" {...counterProps} />\n </>\n );\n };\n\n // Create a single announcement of the current time (only once)\n\n const renderAnnouncer = () => {\n const getTimeAnnouncement = () => {\n const parts = [];\n\n if (showDays) parts.push(`${days.join(\"\")} ${counterLabels.days}`);\n parts.push(`${hours.join(\"\")} ${counterLabels.hours}`);\n parts.push(`${minutes.join(\"\")} ${counterLabels.minutes}`);\n parts.push(`${seconds.join(\"\")} ${counterLabels.seconds}`);\n\n return parts.join(\", \");\n };\n\n return (\n <VisuallyHidden\n data-testid=\"live-region\"\n aria-live=\"polite\"\n aria-label={props[\"aria-label\"]}\n >\n {getTimeAnnouncement()}\n </VisuallyHidden>\n );\n };\n\n const counters = getCounters();\n\n const classes = cx(\n rootClassName,\n `${rootClassName}--size-${size}`,\n `${rootClassName}--variant-${variant}`,\n {\n [`${rootClassName}--full-width`]: fullWidth,\n [`${rootClassName}--negative`]: negative,\n [`${rootClassName}--show-days`]: showDays,\n [`${rootClassName}--use-media-queries`]: useMediaQueries,\n [`${rootClassName}--use-container-queries`]: !useMediaQueries,\n },\n className\n );\n\n return (\n <section\n id={id}\n className={classes}\n ref={ref}\n role=\"timer\"\n data-testid={props[\"data-testid\"]}\n >\n {/* Visually hidden live region that announces time only once */}\n {renderAnnouncer()}\n {props.label && (\n <Paragraph className={cx(`${rootClassName}__label`)} variant=\"paragraph-100-medium\">\n {props.label}\n </Paragraph>\n )}\n <div className={cx(`${rootClassName}__counter-container`)}>{counters}</div>\n </section>\n );\n }\n);\n\nCountdown.displayName = \"Countdown\";\n"],"names":["cx","c","styles","rootClassName","Counter","tag","size","numbers","counterLabels","renderLabel","label","abbreviatedLabel","jsxs","Fragment","Paragraph","jsx","number","index","digits","d","i","selected","getDiffs","endtime","now","totalSeconds","_days","inMs","_hours","_minutes","_seconds","days","splitDigits","hours","minutes","toDate","t","value","Countdown","forwardRef","renderAfterEnd","renderBeforeStart","props","ref","nowInit","id","useId","fullWidth","negative","showDays","variant","className","useMediaQueries","setNow","useState","start","useMemo","end","seconds","useEffect","hasNotStarted","hasEnded","getCounters","counterProps","renderAnnouncer","getTimeAnnouncement","parts","VisuallyHidden","counters","classes"],"mappings":"i5DAOMA,EAAKC,EAAAA,EAAE,KAAKC,CAAM,EAElBC,EAAgB,2BASTC,EAAU,CAAC,CAAE,IAAAC,EAAK,KAAAC,EAAM,QAAAC,EAAS,cAAAC,KAAkC,CAC9E,MAAMC,EAAc,IAAM,CACxB,MAAMC,EAAQF,EAAcH,CAAG,EACzBM,EAAmBH,EAAc,GAAGH,CAAG,MAAM,EAEnD,OACEO,EAAAA,KAAAC,WAAA,CACG,SAAA,CAAAF,SACEG,EAAAA,UAAA,CAAU,UAAWd,EAAG,GAAGG,CAAa,UAAW,GAAGA,CAAa,eAAe,EACjF,SAAAY,EAAAA,IAAC,OAAA,CAAK,MAAOL,EAAQ,WAAiB,EACxC,EAEFK,EAAAA,IAACD,EAAAA,UAAA,CACC,UAAWd,EAAG,GAAGG,CAAa,UAAW,CACvC,CAAC,GAAGA,CAAa,eAAe,EAAG,CAAC,CAACQ,CAAA,CACtC,EAEA,SAAAD,CAAA,CAAA,CACH,EACF,CAEJ,EAEA,OACEE,EAAAA,KAAC,MAAA,CACC,UAAWZ,EAAGG,EAAe,GAAGA,CAAa,UAAUG,CAAI,EAAE,EAC7D,KAAK,QACL,cAAY,OACZ,cAAa,WAAWD,CAAG,GAE3B,SAAA,CAAAU,EAAAA,IAAC,MAAA,CAAI,UAAWf,EAAG,GAAGG,CAAa,yBAAyB,EACzD,SAAAI,EAAQ,IAAI,CAACS,EAAQC,IAElBF,EAAAA,IAAC,KAAA,CAEC,UAAWf,EAAG,GAAGG,CAAa,eAAe,EAC7C,MACE,CACE,WAAYa,CAAA,EAIf,SAAAE,EAAO,IAAI,CAACC,EAAGC,IAAM,CACpB,MAAMC,EAAWF,IAAMH,EAEvB,OACED,EAAAA,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AM,OACL3B,EAAAA,IAACD,EAAAA,UAAA,CAAU,UAAWd,EAAG,GAAGG,CAAa,SAAS,EAAG,QAAQ,uBAC1D,WAAM,MACT,EAEFY,EAAAA,IAAC,OAAI,UAAWf,EAAG,GAAGG,CAAa,qBAAqB,EAAI,SAAAiE,CAAA,CAAS,CAAA,CAAA,CAAA,CAG3E,CACF,EAEA9B,EAAU,YAAc"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./countdown-CqYsZigV.js");exports.Countdown=o.Countdown;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./countdown-hYrFLmRg.js");exports.Countdown=o.Countdown;
2
2
  //# sourceMappingURL=countdown.cjs.js.map
@@ -1,4 +1,4 @@
1
- import { C as r } from "./countdown-DZ4IwkNy.mjs";
1
+ import { C as r } from "./countdown-BsLsEZBv.mjs";
2
2
  export {
3
3
  r as Countdown
4
4
  };
@@ -1,2 +1,2 @@
1
- "use strict";const O=require("react/jsx-runtime"),Z=require("react"),y=require("./floating-ui.react-dom-Cc_YSprQ.js"),Lt=require("react-dom"),Ye=require("./calendar-CBBV8n3x.js"),ze=require("./date-field-BJaomFjs.js"),Me=require("./drawer-CNs9K8Ca.js"),_t=require("./icon-DNHpBTHs-faYHqTXU.js"),jt=require("./bind-DeUYJ6m9.js");function ht(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const c=ht(Z),Vt=ht(Lt);var Bt=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Se=Bt.join(","),Et=typeof Element>"u",ge=Et?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ce=!Et&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Ie=function(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",i=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Ie(t.parentNode));return i},Ht=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Rt=function(t,n,r){if(Ie(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Se));return n&&ge.call(t,Se)&&o.unshift(t),o=o.filter(r),o},Ae=function(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!Ie(i,!1))if(i.tagName==="SLOT"){var u=i.assignedElements(),d=u.length?u:i.children,a=Ae(d,!0,r);r.flatten?o.push.apply(o,a):o.push({scopeParent:i,candidates:a})}else{var v=ge.call(i,Se);v&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var R=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),A=!Ie(R,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(R&&A){var f=Ae(R===!0?i.children:R.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:i,candidates:f})}else s.unshift.apply(s,i.children)}}return o},yt=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},wt=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Ht(t))&&!yt(t)?0:t.tabIndex},$t=function(t,n){var r=wt(t);return r<0&&n&&!yt(t)?0:r},qt=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},xt=function(t){return t.tagName==="INPUT"},Kt=function(t){return xt(t)&&t.type==="hidden"},Wt=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},Ut=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},Gt=function(t){if(!t.name)return!0;var n=t.form||Ce(t),r=function(u){return n.querySelectorAll('input[type="radio"][name="'+u+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=Ut(o,t.form);return!s||s===t},Yt=function(t){return xt(t)&&t.type==="radio"},zt=function(t){return Yt(t)&&!Gt(t)},Zt=function(t){var n,r=t&&Ce(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,u,d;for(s=!!((i=o)!==null&&i!==void 0&&(u=i.ownerDocument)!==null&&u!==void 0&&u.contains(o)||t!=null&&(d=t.ownerDocument)!==null&&d!==void 0&&d.contains(t));!s&&o;){var a,v,R;r=Ce(o),o=(a=r)===null||a===void 0?void 0:a.host,s=!!((v=o)!==null&&v!==void 0&&(R=v.ownerDocument)!==null&&R!==void 0&&R.contains(o))}}return s},Ze=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},Xt=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=ge.call(t,"details>summary:first-of-type"),u=i?t.parentElement:t;if(ge.call(u,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var d=t;t;){var a=t.parentElement,v=Ce(t);if(a&&!a.shadowRoot&&o(a)===!0)return Ze(t);t.assignedSlot?t=t.assignedSlot:!a&&v!==t.ownerDocument?t=v.host:t=a}t=d}if(Zt(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Ze(t);return!1},Jt=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return ge.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},Ve=function(t,n){return!(n.disabled||Kt(n)||Xt(n,t)||Wt(n)||Jt(n))},Be=function(t,n){return!(zt(n)||wt(n)<0||!Ve(t,n))},Qt=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Tt=function(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,u=i?o.scopeParent:o,d=$t(u,i),a=i?Tt(o.candidates):u;d===0?i?n.push.apply(n,a):n.push(u):r.push({documentOrder:s,tabIndex:d,item:o,isScope:i,content:a})}),r.sort(qt).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},ke=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Ae([t],n.includeContainer,{filter:Be.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Qt}):r=Rt(t,n.includeContainer,Be.bind(null,n)),Tt(r)},en=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Ae([t],n.includeContainer,{filter:Ve.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=Rt(t,n.includeContainer,Ve.bind(null,n)),r},St=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return ge.call(t,Se)===!1?!1:Be(n,t)};function tn(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Ct(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function nn(){return/apple/i.test(navigator.vendor)}function He(){const e=/android/i;return e.test(tn())||e.test(Ct())}function rn(){return Ct().includes("jsdom/")}const Xe="data-floating-ui-focusable",on="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function ve(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function W(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&y.isShadowRoot(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function ue(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Pe(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function sn(e){return e.matches("html,body")}function X(e){return e?.ownerDocument||document}function It(e){return y.isHTMLElement(e)&&e.matches(on)}function Je(e){return e?e.getAttribute("role")==="combobox"&&It(e):!1}function Qe(e){return e?e.hasAttribute(Xe)?e:e.querySelector("["+Xe+"]")||e:null}function be(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var s;return o.parentId===t&&(!n||((s=o.context)==null?void 0:s.open))}).flatMap(o=>[o,...be(e,o.id,n)])}function et(e,t){var n;let r=[],o=(n=e.find(s=>s.id===t))==null?void 0:n.parentId;for(;o;){const s=e.find(i=>i.id===o);o=s?.parentId,s&&(r=r.concat(s))}return r}function Fe(e){e.preventDefault(),e.stopPropagation()}function an(e){return"nativeEvent"in e}function un(e){return e.mozInputSource===0&&e.isTrusted?!0:He()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function cn(e){return rn()?!1:!He()&&e.width===0&&e.height===0||He()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function tt(e,t){return["mouse","pen"].includes(e)}var ln=typeof document<"u",fn=function(){},Y=ln?Z.useLayoutEffect:fn;const dn={...c};function Le(e){const t=c.useRef(e);return Y(()=>{t.current=e}),t}const vn=dn.useInsertionEffect,bn=vn||(e=>e());function Q(e){const t=c.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return bn(()=>{t.current=e}),c.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const Re=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function At(e,t){const n=ke(e,Re()),r=n.length;if(r===0)return;const o=ve(X(e)),s=n.indexOf(o),i=s===-1?t===1?0:r-1:s+t;return n[i]}function Dt(e){return At(X(e).body,1)||e}function kt(e){return At(X(e).body,-1)||e}function he(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!W(n,r)}function mn(e){ke(e,Re()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function nt(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const gn="data-floating-ui-focusable",rt="active",ot="selected",pn={...c};let st=!1,hn=0;const it=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+hn++;function En(){const[e,t]=c.useState(()=>st?it():void 0);return Y(()=>{e==null&&t(it())},[]),c.useEffect(()=>{st=!0},[]),e}const Rn=pn.useId,Ot=Rn||En;let $e;process.env.NODE_ENV!=="production"&&($e=new Set);function yn(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=$e)!=null&&e.has(o))){var s;(s=$e)==null||s.add(o),console.error(o)}}function wn(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const xn=c.createContext(null),Tn=c.createContext(null),Sn=()=>{var e;return((e=c.useContext(xn))==null?void 0:e.id)||null},Ke=()=>c.useContext(Tn);function Ee(e){return"data-floating-ui-"+e}function Cn(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}let at=0;function de(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(at);const s=()=>e?.focus({preventScroll:n});o?s():at=requestAnimationFrame(s)}function In(e){return e?.ownerDocument||document}const me={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function ut(e){return e==="inert"?me.inert:e==="aria-hidden"?me["aria-hidden"]:me.none}let xe=new WeakSet,Te={},_e=0;const An=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype;function Nt(e){return e?y.isShadowRoot(e)?e.host:Nt(e.parentNode):null}const Dn=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Nt(n);return e.contains(r)?r:null}).filter(n=>n!=null);function kn(e,t,n,r){const o="data-floating-ui-inert",s=r?"inert":n?"aria-hidden":null,i=Dn(t,e),u=new Set,d=new Set(i),a=[];Te[o]||(Te[o]=new WeakMap);const v=Te[o];i.forEach(R),A(t),u.clear();function R(f){!f||u.has(f)||(u.add(f),f.parentNode&&R(f.parentNode))}function A(f){!f||d.has(f)||[].forEach.call(f.children,h=>{if(y.getNodeName(h)!=="script")if(u.has(h))A(h);else{const l=s?h.getAttribute(s):null,x=l!==null&&l!=="false",S=ut(s),g=(S.get(h)||0)+1,p=(v.get(h)||0)+1;S.set(h,g),v.set(h,p),a.push(h),g===1&&x&&xe.add(h),p===1&&h.setAttribute(o,""),!x&&s&&h.setAttribute(s,s==="inert"?"":"true")}})}return _e++,()=>{a.forEach(f=>{const h=ut(s),x=(h.get(f)||0)-1,S=(v.get(f)||0)-1;h.set(f,x),v.set(f,S),x||(!xe.has(f)&&s&&f.removeAttribute(s),xe.delete(f)),S||f.removeAttribute(o)}),_e--,_e||(me.inert=new WeakMap,me["aria-hidden"]=new WeakMap,me.none=new WeakMap,xe=new WeakSet,Te={})}}function ct(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=In(e[0]).body;return kn(e.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))),r,t,n)}const We={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},De=c.forwardRef(function(t,n){const[r,o]=c.useState();Y(()=>{nn()&&o("button")},[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Ee("focus-guard")]:"",style:We};return O.jsx("span",{...t,...s})}),On={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Mt=c.createContext(null),lt=Ee("portal");function Nn(e){e===void 0&&(e={});const{id:t,root:n}=e,r=Ot(),o=Pt(),[s,i]=c.useState(null),u=c.useRef(null);return Y(()=>()=>{s?.remove(),queueMicrotask(()=>{u.current=null})},[s]),Y(()=>{if(!r||u.current)return;const d=t?document.getElementById(t):null;if(!d)return;const a=document.createElement("div");a.id=r,a.setAttribute(lt,""),d.appendChild(a),u.current=a,i(a)},[t,r]),Y(()=>{if(n===null||!r||u.current)return;let d=n||o?.portalNode;d&&!y.isNode(d)&&(d=d.current),d=d||document.body;let a=null;t&&(a=document.createElement("div"),a.id=t,d.appendChild(a));const v=document.createElement("div");v.id=r,v.setAttribute(lt,""),d=a||d,d.appendChild(v),u.current=v,i(v)},[t,n,r,o]),s}function Mn(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,s=Nn({id:n,root:r}),[i,u]=c.useState(null),d=c.useRef(null),a=c.useRef(null),v=c.useRef(null),R=c.useRef(null),A=i?.modal,f=i?.open,h=!!i&&!i.modal&&i.open&&o&&!!(r||s);return c.useEffect(()=>{if(!s||!o||A)return;function l(x){s&&he(x)&&(x.type==="focusin"?nt:mn)(s)}return s.addEventListener("focusin",l,!0),s.addEventListener("focusout",l,!0),()=>{s.removeEventListener("focusin",l,!0),s.removeEventListener("focusout",l,!0)}},[s,o,A]),c.useEffect(()=>{s&&(f||nt(s))},[f,s]),O.jsxs(Mt.Provider,{value:c.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:d,afterOutsideRef:a,beforeInsideRef:v,afterInsideRef:R,portalNode:s,setFocusManagerState:u}),[o,s]),children:[h&&s&&O.jsx(De,{"data-type":"outside",ref:d,onFocus:l=>{if(he(l,s)){var x;(x=v.current)==null||x.focus()}else{const S=i?i.domReference:null,g=kt(S);g?.focus()}}}),h&&s&&O.jsx("span",{"aria-owns":s.id,style:On}),s&&Vt.createPortal(t,s),h&&s&&O.jsx(De,{"data-type":"outside",ref:a,onFocus:l=>{if(he(l,s)){var x;(x=R.current)==null||x.focus()}else{const S=i?i.domReference:null,g=Dt(S);g?.focus(),i?.closeOnFocusOut&&i?.onOpenChange(!1,l.nativeEvent,"focus-out")}}})]})}const Pt=()=>c.useContext(Mt);function ft(e){return c.useMemo(()=>t=>{e.forEach(n=>{n&&(n.current=t)})},e)}const dt=20;let ce=[];function Ue(){ce=ce.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function Pn(e){Ue(),e&&y.getNodeName(e)!=="body"&&(ce.push(new WeakRef(e)),ce.length>dt&&(ce=ce.slice(-dt)))}function vt(){Ue();const e=ce[ce.length-1];return e?.deref()}function Fn(e){const t=Re();return St(e,t)?e:ke(e,t)[0]||e}function bt(e,t){var n;if(!t.current.includes("floating")&&!((n=e.getAttribute("role"))!=null&&n.includes("dialog")))return;const r=Re(),s=en(e,r).filter(u=>{const d=u.getAttribute("data-tabindex")||"";return St(u,r)||u.hasAttribute("data-tabindex")&&!d.startsWith("-")}),i=e.getAttribute("tabindex");t.current.includes("floating")||s.length===0?i!=="0"&&e.setAttribute("tabindex","0"):(i!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const Ln=c.forwardRef(function(t,n){return O.jsx("button",{...t,type:"button",ref:n,tabIndex:-1,style:We})});function _n(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:s=!0,initialFocus:i=0,returnFocus:u=!0,restoreFocus:d=!1,modal:a=!0,visuallyHiddenDismiss:v=!1,closeOnFocusOut:R=!0,outsideElementsInert:A=!1,getInsideElements:f=()=>[]}=e,{open:h,onOpenChange:l,events:x,dataRef:S,elements:{domReference:g,floating:p}}=t,_=Q(()=>{var w;return(w=S.current.floatingContext)==null?void 0:w.nodeId}),$=Q(f),q=typeof i=="number"&&i<0,P=Je(g)&&q,H=An(),re=H?s:!0,ee=!re||H&&A,C=Le(o),pe=Le(i),oe=Le(u),m=Ke(),b=Pt(),B=c.useRef(null),j=c.useRef(null),E=c.useRef(!1),F=c.useRef(!1),V=c.useRef(-1),z=c.useRef(-1),fe=b!=null,I=Qe(p),J=Q(function(w){return w===void 0&&(w=I),w?ke(w,Re()):[]}),M=Q(w=>{const D=J(w);return C.current.map(T=>g&&T==="reference"?g:I&&T==="floating"?I:D).filter(Boolean).flat()});c.useEffect(()=>{if(r||!a)return;function w(T){if(T.key==="Tab"){W(I,ve(X(I)))&&J().length===0&&!P&&Fe(T);const N=M(),L=ue(T);C.current[0]==="reference"&&L===g&&(Fe(T),T.shiftKey?de(N[N.length-1]):de(N[1])),C.current[1]==="floating"&&L===I&&T.shiftKey&&(Fe(T),de(N[0]))}}const D=X(I);return D.addEventListener("keydown",w),()=>{D.removeEventListener("keydown",w)}},[r,g,I,a,C,P,J,M]),c.useEffect(()=>{if(r||!p)return;function w(D){const T=ue(D),L=J().indexOf(T);L!==-1&&(V.current=L)}return p.addEventListener("focusin",w),()=>{p.removeEventListener("focusin",w)}},[r,p,J]),c.useEffect(()=>{if(r||!R)return;function w(){F.current=!0,setTimeout(()=>{F.current=!1})}function D(L){const k=L.relatedTarget,te=L.currentTarget,G=ue(L);queueMicrotask(()=>{const K=_(),le=!(W(g,k)||W(p,k)||W(k,p)||W(b?.portalNode,k)||k!=null&&k.hasAttribute(Ee("focus-guard"))||m&&(be(m.nodesRef.current,K).find(ie=>{var ne,ae;return W((ne=ie.context)==null?void 0:ne.elements.floating,k)||W((ae=ie.context)==null?void 0:ae.elements.domReference,k)})||et(m.nodesRef.current,K).find(ie=>{var ne,ae,Ge;return[(ne=ie.context)==null?void 0:ne.elements.floating,Qe((ae=ie.context)==null?void 0:ae.elements.floating)].includes(k)||((Ge=ie.context)==null?void 0:Ge.elements.domReference)===k})));if(te===g&&I&&bt(I,C),d&&te!==g&&!(G!=null&&G.isConnected)&&ve(X(I))===X(I).body){y.isHTMLElement(I)&&I.focus();const ie=V.current,ne=J(),ae=ne[ie]||ne[ne.length-1]||I;y.isHTMLElement(ae)&&ae.focus()}if(S.current.insideReactTree){S.current.insideReactTree=!1;return}(P||!a)&&k&&le&&!F.current&&k!==vt()&&(E.current=!0,l(!1,L,"focus-out"))})}const T=!!(!m&&b);function N(){Cn(z),S.current.insideReactTree=!0,z.current=window.setTimeout(()=>{S.current.insideReactTree=!1})}if(p&&y.isHTMLElement(g))return g.addEventListener("focusout",D),g.addEventListener("pointerdown",w),p.addEventListener("focusout",D),T&&p.addEventListener("focusout",N,!0),()=>{g.removeEventListener("focusout",D),g.removeEventListener("pointerdown",w),p.removeEventListener("focusout",D),T&&p.removeEventListener("focusout",N,!0)}},[r,g,p,I,a,m,b,l,R,d,J,P,_,C,S]);const U=c.useRef(null),se=c.useRef(null),Oe=ft([U,b?.beforeInsideRef]),Ne=ft([se,b?.afterInsideRef]);c.useEffect(()=>{var w,D;if(r||!p)return;const T=Array.from((b==null||(w=b.portalNode)==null?void 0:w.querySelectorAll("["+Ee("portal")+"]"))||[]),L=(D=(m?et(m.nodesRef.current,_()):[]).find(G=>{var K;return Je(((K=G.context)==null?void 0:K.elements.domReference)||null)}))==null||(D=D.context)==null?void 0:D.elements.domReference,k=[p,L,...T,...$(),B.current,j.current,U.current,se.current,b?.beforeOutsideRef.current,b?.afterOutsideRef.current,C.current.includes("reference")||P?g:null].filter(G=>G!=null),te=a||P?ct(k,!ee,ee):ct(k);return()=>{te()}},[r,g,p,a,C,b,P,re,ee,m,_,$]),Y(()=>{if(r||!y.isHTMLElement(I))return;const w=X(I),D=ve(w);queueMicrotask(()=>{const T=M(I),N=pe.current,L=(typeof N=="number"?T[N]:N.current)||I,k=W(I,D);!q&&!k&&h&&de(L,{preventScroll:L===I})})},[r,h,I,q,M,pe]),Y(()=>{if(r||!I)return;const w=X(I),D=ve(w);Pn(D);function T(k){let{reason:te,event:G,nested:K}=k;if(["hover","safe-polygon"].includes(te)&&G.type==="mouseleave"&&(E.current=!0),te==="outside-press")if(K)E.current=!1;else if(un(G)||cn(G))E.current=!1;else{let le=!1;document.createElement("div").focus({get preventScroll(){return le=!0,!1}}),le?E.current=!1:E.current=!0}}x.on("openchange",T);const N=w.createElement("span");N.setAttribute("tabindex","-1"),N.setAttribute("aria-hidden","true"),Object.assign(N.style,We),fe&&g&&g.insertAdjacentElement("afterend",N);function L(){if(typeof oe.current=="boolean"){const k=g||vt();return k&&k.isConnected?k:N}return oe.current.current||N}return()=>{x.off("openchange",T);const k=ve(w),te=W(p,k)||m&&be(m.nodesRef.current,_(),!1).some(K=>{var le;return W((le=K.context)==null?void 0:le.elements.floating,k)}),G=L();queueMicrotask(()=>{const K=Fn(G);oe.current&&!E.current&&y.isHTMLElement(K)&&(!(K!==k&&k!==w.body)||te)&&K.focus({preventScroll:!0}),N.remove()})}},[r,p,I,oe,S,x,m,fe,g,_]),c.useEffect(()=>(queueMicrotask(()=>{E.current=!1}),()=>{queueMicrotask(Ue)}),[r]),Y(()=>{if(!r&&b)return b.setFocusManagerState({modal:a,closeOnFocusOut:R,open:h,onOpenChange:l,domReference:g}),()=>{b.setFocusManagerState(null)}},[r,b,a,h,l,R,g]),Y(()=>{r||I&&bt(I,C)},[r,I,C]);function ye(w){return r||!v||!a?null:O.jsx(Ln,{ref:w==="start"?B:j,onClick:D=>l(!1,D.nativeEvent),children:typeof v=="string"?v:"Dismiss"})}const we=!r&&re&&(a?!P:!0)&&(fe||a);return O.jsxs(O.Fragment,{children:[we&&O.jsx(De,{"data-type":"inside",ref:Oe,onFocus:w=>{if(a){const T=M();de(o[0]==="reference"?T[0]:T[T.length-1])}else if(b!=null&&b.preserveTabOrder&&b.portalNode)if(E.current=!1,he(w,b.portalNode)){const T=Dt(g);T?.focus()}else{var D;(D=b.beforeOutsideRef.current)==null||D.focus()}}}),!P&&ye("start"),n,ye("end"),we&&O.jsx(De,{"data-type":"inside",ref:Ne,onFocus:w=>{if(a)de(M()[0]);else if(b!=null&&b.preserveTabOrder&&b.portalNode)if(R&&(E.current=!0),he(w,b.portalNode)){const T=kt(g);T?.focus()}else{var D;(D=b.afterOutsideRef.current)==null||D.focus()}}})]})}function mt(e){return y.isHTMLElement(e.target)&&e.target.tagName==="BUTTON"}function jn(e){return y.isHTMLElement(e.target)&&e.target.tagName==="A"}function gt(e){return It(e)}function Vn(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:s}}=e,{enabled:i=!0,event:u="click",toggle:d=!0,ignoreMouse:a=!1,keyboardHandlers:v=!0,stickIfOpen:R=!0}=t,A=c.useRef(),f=c.useRef(!1),h=c.useMemo(()=>({onPointerDown(l){A.current=l.pointerType},onMouseDown(l){const x=A.current;l.button===0&&u!=="click"&&(tt(x)&&a||(n&&d&&(!(o.current.openEvent&&R)||o.current.openEvent.type==="mousedown")?r(!1,l.nativeEvent,"click"):(l.preventDefault(),r(!0,l.nativeEvent,"click"))))},onClick(l){const x=A.current;if(u==="mousedown"&&A.current){A.current=void 0;return}tt(x)&&a||(n&&d&&(!(o.current.openEvent&&R)||o.current.openEvent.type==="click")?r(!1,l.nativeEvent,"click"):r(!0,l.nativeEvent,"click"))},onKeyDown(l){A.current=void 0,!(l.defaultPrevented||!v||mt(l))&&(l.key===" "&&!gt(s)&&(l.preventDefault(),f.current=!0),!jn(l)&&l.key==="Enter"&&r(!(n&&d),l.nativeEvent,"click"))},onKeyUp(l){l.defaultPrevented||!v||mt(l)||gt(s)||l.key===" "&&f.current&&(f.current=!1,r(!(n&&d),l.nativeEvent,"click"))}}),[o,s,u,a,v,r,n,R,d]);return c.useMemo(()=>i?{reference:h}:{},[i,h])}const Bn={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Hn={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},pt=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function $n(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:s}=e,{enabled:i=!0,escapeKey:u=!0,outsidePress:d=!0,outsidePressEvent:a="pointerdown",referencePress:v=!1,referencePressEvent:R="pointerdown",ancestorScroll:A=!1,bubbles:f,capture:h}=t,l=Ke(),x=Q(typeof d=="function"?d:()=>!1),S=typeof d=="function"?x:d,g=c.useRef(!1),{escapeKey:p,outsidePress:_}=pt(f),{escapeKey:$,outsidePress:q}=pt(h),P=c.useRef(!1),H=Q(m=>{var b;if(!n||!i||!u||m.key!=="Escape"||P.current)return;const B=(b=s.current.floatingContext)==null?void 0:b.nodeId,j=l?be(l.nodesRef.current,B):[];if(!p&&(m.stopPropagation(),j.length>0)){let E=!0;if(j.forEach(F=>{var V;if((V=F.context)!=null&&V.open&&!F.context.dataRef.current.__escapeKeyBubbles){E=!1;return}}),!E)return}r(!1,an(m)?m.nativeEvent:m,"escape-key")}),re=Q(m=>{var b;const B=()=>{var j;H(m),(j=ue(m))==null||j.removeEventListener("keydown",B)};(b=ue(m))==null||b.addEventListener("keydown",B)}),ee=Q(m=>{var b;const B=s.current.insideReactTree;s.current.insideReactTree=!1;const j=g.current;if(g.current=!1,a==="click"&&j||B||typeof S=="function"&&!S(m))return;const E=ue(m),F="["+Ee("inert")+"]",V=X(o.floating).querySelectorAll(F);let z=y.isElement(E)?E:null;for(;z&&!y.isLastTraversableNode(z);){const M=y.getParentNode(z);if(y.isLastTraversableNode(M)||!y.isElement(M))break;z=M}if(V.length&&y.isElement(E)&&!sn(E)&&!W(E,o.floating)&&Array.from(V).every(M=>!W(z,M)))return;if(y.isHTMLElement(E)&&oe){const M=y.isLastTraversableNode(E),U=y.getComputedStyle(E),se=/auto|scroll/,Oe=M||se.test(U.overflowX),Ne=M||se.test(U.overflowY),ye=Oe&&E.clientWidth>0&&E.scrollWidth>E.clientWidth,we=Ne&&E.clientHeight>0&&E.scrollHeight>E.clientHeight,w=U.direction==="rtl",D=we&&(w?m.offsetX<=E.offsetWidth-E.clientWidth:m.offsetX>E.clientWidth),T=ye&&m.offsetY>E.clientHeight;if(D||T)return}const fe=(b=s.current.floatingContext)==null?void 0:b.nodeId,I=l&&be(l.nodesRef.current,fe).some(M=>{var U;return Pe(m,(U=M.context)==null?void 0:U.elements.floating)});if(Pe(m,o.floating)||Pe(m,o.domReference)||I)return;const J=l?be(l.nodesRef.current,fe):[];if(J.length>0){let M=!0;if(J.forEach(U=>{var se;if((se=U.context)!=null&&se.open&&!U.context.dataRef.current.__outsidePressBubbles){M=!1;return}}),!M)return}r(!1,m,"outside-press")}),C=Q(m=>{var b;const B=()=>{var j;ee(m),(j=ue(m))==null||j.removeEventListener(a,B)};(b=ue(m))==null||b.addEventListener(a,B)});c.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=p,s.current.__outsidePressBubbles=_;let m=-1;function b(V){r(!1,V,"ancestor-scroll")}function B(){window.clearTimeout(m),P.current=!0}function j(){m=window.setTimeout(()=>{P.current=!1},y.isWebKit()?5:0)}const E=X(o.floating);u&&(E.addEventListener("keydown",$?re:H,$),E.addEventListener("compositionstart",B),E.addEventListener("compositionend",j)),S&&E.addEventListener(a,q?C:ee,q);let F=[];return A&&(y.isElement(o.domReference)&&(F=y.getOverflowAncestors(o.domReference)),y.isElement(o.floating)&&(F=F.concat(y.getOverflowAncestors(o.floating))),!y.isElement(o.reference)&&o.reference&&o.reference.contextElement&&(F=F.concat(y.getOverflowAncestors(o.reference.contextElement)))),F=F.filter(V=>{var z;return V!==((z=E.defaultView)==null?void 0:z.visualViewport)}),F.forEach(V=>{V.addEventListener("scroll",b,{passive:!0})}),()=>{u&&(E.removeEventListener("keydown",$?re:H,$),E.removeEventListener("compositionstart",B),E.removeEventListener("compositionend",j)),S&&E.removeEventListener(a,q?C:ee,q),F.forEach(V=>{V.removeEventListener("scroll",b)}),window.clearTimeout(m)}},[s,o,u,S,a,n,r,A,i,p,_,H,$,re,ee,q,C]),c.useEffect(()=>{s.current.insideReactTree=!1},[s,S,a]);const pe=c.useMemo(()=>({onKeyDown:H,...v&&{[Bn[R]]:m=>{r(!1,m.nativeEvent,"reference-press")},...R!=="click"&&{onClick(m){r(!1,m.nativeEvent,"reference-press")}}}}),[H,r,v,R]),oe=c.useMemo(()=>{function m(b){b.button===0&&(g.current=!0)}return{onKeyDown:H,onMouseDown:m,onMouseUp:m,[Hn[a]]:()=>{s.current.insideReactTree=!0}}},[H,a,s]);return c.useMemo(()=>i?{reference:pe,floating:oe}:{},[i,pe,oe])}function qn(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Ot(),s=c.useRef({}),[i]=c.useState(()=>wn()),u=Sn()!=null;if(process.env.NODE_ENV!=="production"){const f=r.reference;f&&!y.isElement(f)&&yn("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[d,a]=c.useState(r.reference),v=Q((f,h,l)=>{s.current.openEvent=f?h:void 0,i.emit("openchange",{open:f,event:h,reason:l,nested:u}),n?.(f,h,l)}),R=c.useMemo(()=>({setPositionReference:a}),[]),A=c.useMemo(()=>({reference:d||r.reference||null,floating:r.floating||null,domReference:r.reference}),[d,r.reference,r.floating]);return c.useMemo(()=>({dataRef:s,open:t,onOpenChange:v,elements:A,events:i,floatingId:o,refs:R}),[t,v,A,i,o,R])}function Kn(e){e===void 0&&(e={});const{nodeId:t}=e,n=qn({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=c.useState(null),[u,d]=c.useState(null),v=o?.domReference||s,R=c.useRef(null),A=Ke();Y(()=>{v&&(R.current=v)},[v]);const f=y.useFloating({...e,elements:{...o,...u&&{reference:u}}}),h=c.useCallback(p=>{const _=y.isElement(p)?{getBoundingClientRect:()=>p.getBoundingClientRect(),getClientRects:()=>p.getClientRects(),contextElement:p}:p;d(_),f.refs.setReference(_)},[f.refs]),l=c.useCallback(p=>{(y.isElement(p)||p===null)&&(R.current=p,i(p)),(y.isElement(f.refs.reference.current)||f.refs.reference.current===null||p!==null&&!y.isElement(p))&&f.refs.setReference(p)},[f.refs]),x=c.useMemo(()=>({...f.refs,setReference:l,setPositionReference:h,domReference:R}),[f.refs,l,h]),S=c.useMemo(()=>({...f.elements,domReference:v}),[f.elements,v]),g=c.useMemo(()=>({...f,...r,refs:x,elements:S,nodeId:t}),[f,x,S,t,r]);return Y(()=>{r.dataRef.current.floatingContext=g;const p=A?.nodesRef.current.find(_=>_.id===t);p&&(p.context=g)}),c.useMemo(()=>({...f,context:g,refs:x,elements:S}),[f,x,S,g])}function je(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[rt]:i,[ot]:u,...d}=e;s=d}return{...n==="floating"&&{tabIndex:-1,[gn]:""},...s,...t.map(i=>{const u=i?i[n]:null;return typeof u=="function"?e?u(e):null:u}).concat(e).reduce((i,u)=>(u&&Object.entries(u).forEach(d=>{let[a,v]=d;if(!(o&&[rt,ot].includes(a)))if(a.indexOf("on")===0){if(r.has(a)||r.set(a,[]),typeof v=="function"){var R;(R=r.get(a))==null||R.push(v),i[a]=function(){for(var A,f=arguments.length,h=new Array(f),l=0;l<f;l++)h[l]=arguments[l];return(A=r.get(a))==null?void 0:A.map(x=>x(...h)).find(x=>x!==void 0)}}}else i[a]=v}),i),{})}}function Wn(e){e===void 0&&(e=[]);const t=e.map(u=>u?.reference),n=e.map(u=>u?.floating),r=e.map(u=>u?.item),o=c.useCallback(u=>je(u,e,"reference"),t),s=c.useCallback(u=>je(u,e,"floating"),n),i=c.useCallback(u=>je(u,e,"item"),r);return c.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}const Un={name:"calendar",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M8 1.6a.9.9 0 0 1 .9.9V7a.9.9 0 0 1-1.8 0V5.9H4a.1.1 0 0 0-.1.1v3.105A.91.91 0 0 1 4 9.1h16.1V6a.1.1 0 0 0-.1-.1h-3.1V7a.9.9 0 1 1-1.8 0V5.9h-3.6a.9.9 0 1 1 0-1.8h3.6V2.5a.9.9 0 1 1 1.8 0v1.6H20c1.05 0 1.9.85 1.9 1.9v14a1.9 1.9 0 0 1-1.9 1.9H4A1.9 1.9 0 0 1 2.1 20V6c0-1.05.85-1.9 1.9-1.9h3.1V2.5a.9.9 0 0 1 .9-.9Zm12.1 9.3H4a.917.917 0 0 1-.1-.005V20a.1.1 0 0 0 .1.1h16a.1.1 0 0 0 .1-.1v-9.1ZM5.6 13.5a.9.9 0 0 1 .9-.9h1a.9.9 0 1 1 0 1.8h-1a.9.9 0 0 1-.9-.9Zm5 0a.9.9 0 0 1 .9-.9h1a.9.9 0 1 1 0 1.8h-1a.9.9 0 0 1-.9-.9Zm5 0a.9.9 0 0 1 .9-.9h1a.9.9 0 1 1 0 1.8h-1a.9.9 0 0 1-.9-.9Zm-10 4a.9.9 0 0 1 .9-.9h1a.9.9 0 1 1 0 1.8h-1a.9.9 0 0 1-.9-.9Zm5 0a.9.9 0 0 1 .9-.9h1a.9.9 0 1 1 0 1.8h-1a.9.9 0 0 1-.9-.9Zm5 0a.9.9 0 0 1 .9-.9h1a.9.9 0 1 1 0 1.8h-1a.9.9 0 0 1-.9-.9Z" clip-rule="evenodd"/></svg>',keywords:["calendar"],category:"other"},qe=e=>O.jsx(_t.b,{...e,svg:Un});qe.displayName="IconCalendar";const Gn={"date-picker-calendar-container":"_date-picker-calendar-container_17f84_1"},Yn=jt.c.bind(Gn),Ft=Z.forwardRef(({calendarProps:e,drawerContentProps:t,value:n,onChange:r,overlayZIndex:o,...s},i)=>{const[u,d]=Z.useState(!1),[a,v]=Z.useState(!1),[R,A]=Z.useState(!1),f=Z.useRef(null),{context:h,refs:l,floatingStyles:x}=Kn({open:u,onOpenChange:C=>{s.readOnly||d(C)},placement:"bottom-start",middleware:[y.offset({mainAxis:10,crossAxis:-32}),y.flip()],whileElementsMounted:y.autoUpdate}),S=Vn(h),g=$n(h),{getFloatingProps:p,getReferenceProps:_}=Wn([S,g]),[$,q]=Z.useState(n);Z.useEffect(()=>{q(n)},[n]);const P=C=>{C?(q(C),r?.(C),(u||a)&&(d(!1),v(!1))):(q(void 0),r?.(void 0))},H=Z.useId();return Z.useLayoutEffect(()=>{const C=()=>{A(window.innerWidth<600)};return C(),window.addEventListener("resize",C),()=>{window.removeEventListener("resize",C)}},[]),R?O.jsxs(Me.Drawer,{open:a,onOpenChange:v,children:[O.jsx(Me.Drawer.Trigger,{children:O.jsx(ze.DateField,{...s,startAdornment:O.jsx(qe,{size:"sm"}),id:H,value:$,onChange:C=>P(C),"data-testid":s["data-testid"]})}),O.jsx(Me.Drawer.Content,{"data-testid":s["data-testid"]&&`${s["data-testid"]}-calendar`,fitToContent:!0,...t,zIndex:o,children:O.jsx(Ye.Calendar,{showOutsideDays:!0,...e,mode:"single",selected:$,onSelect:C=>P(C)})})]}):O.jsxs("div",{ref:i,children:[O.jsx(ze.DateField,{..._(s),ref:l.setReference,startAdornment:O.jsx(qe,{size:"sm"}),id:H,value:$,onChange:C=>P(C),"data-testid":s["data-testid"]}),u&&!s.readOnly&&O.jsx(Mn,{children:O.jsx(_n,{context:h,initialFocus:f,children:O.jsx("div",{"data-testid":s["data-testid"]&&`${s["data-testid"]}-calendar`,className:Yn("date-picker-calendar-container"),ref:l.setFloating,style:{...x,zIndex:o},...p(),children:O.jsx(Ye.Calendar,{showOutsideDays:!0,...e,mode:"single",selected:$,onSelect:C=>P(C),firstElementRef:f})})})})]})});Ft.displayName="DatePicker";exports.DatePicker=Ft;
2
- //# sourceMappingURL=date-picker-D3uJGCjl.js.map
1
+ "use strict";const O=require("react/jsx-runtime"),Z=require("react"),y=require("./floating-ui.react-dom-Cc_YSprQ.js"),Lt=require("react-dom"),Ye=require("./calendar-CBBV8n3x.js"),ze=require("./date-field-BJaomFjs.js"),Me=require("./drawer-DlwagnO4.js"),_t=require("./icon-DNHpBTHs-faYHqTXU.js"),jt=require("./bind-DeUYJ6m9.js");function ht(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const c=ht(Z),Vt=ht(Lt);var Bt=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Se=Bt.join(","),Et=typeof Element>"u",ge=Et?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ce=!Et&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Ie=function(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",i=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Ie(t.parentNode));return i},Ht=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Rt=function(t,n,r){if(Ie(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Se));return n&&ge.call(t,Se)&&o.unshift(t),o=o.filter(r),o},Ae=function(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!Ie(i,!1))if(i.tagName==="SLOT"){var u=i.assignedElements(),d=u.length?u:i.children,a=Ae(d,!0,r);r.flatten?o.push.apply(o,a):o.push({scopeParent:i,candidates:a})}else{var v=ge.call(i,Se);v&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var R=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),A=!Ie(R,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(R&&A){var f=Ae(R===!0?i.children:R.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:i,candidates:f})}else s.unshift.apply(s,i.children)}}return o},yt=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},wt=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Ht(t))&&!yt(t)?0:t.tabIndex},$t=function(t,n){var r=wt(t);return r<0&&n&&!yt(t)?0:r},qt=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},xt=function(t){return t.tagName==="INPUT"},Kt=function(t){return xt(t)&&t.type==="hidden"},Wt=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},Ut=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},Gt=function(t){if(!t.name)return!0;var n=t.form||Ce(t),r=function(u){return n.querySelectorAll('input[type="radio"][name="'+u+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=Ut(o,t.form);return!s||s===t},Yt=function(t){return xt(t)&&t.type==="radio"},zt=function(t){return Yt(t)&&!Gt(t)},Zt=function(t){var n,r=t&&Ce(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,u,d;for(s=!!((i=o)!==null&&i!==void 0&&(u=i.ownerDocument)!==null&&u!==void 0&&u.contains(o)||t!=null&&(d=t.ownerDocument)!==null&&d!==void 0&&d.contains(t));!s&&o;){var a,v,R;r=Ce(o),o=(a=r)===null||a===void 0?void 0:a.host,s=!!((v=o)!==null&&v!==void 0&&(R=v.ownerDocument)!==null&&R!==void 0&&R.contains(o))}}return s},Ze=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},Xt=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=ge.call(t,"details>summary:first-of-type"),u=i?t.parentElement:t;if(ge.call(u,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var d=t;t;){var a=t.parentElement,v=Ce(t);if(a&&!a.shadowRoot&&o(a)===!0)return Ze(t);t.assignedSlot?t=t.assignedSlot:!a&&v!==t.ownerDocument?t=v.host:t=a}t=d}if(Zt(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Ze(t);return!1},Jt=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return ge.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},Ve=function(t,n){return!(n.disabled||Kt(n)||Xt(n,t)||Wt(n)||Jt(n))},Be=function(t,n){return!(zt(n)||wt(n)<0||!Ve(t,n))},Qt=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Tt=function(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,u=i?o.scopeParent:o,d=$t(u,i),a=i?Tt(o.candidates):u;d===0?i?n.push.apply(n,a):n.push(u):r.push({documentOrder:s,tabIndex:d,item:o,isScope:i,content:a})}),r.sort(qt).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},ke=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Ae([t],n.includeContainer,{filter:Be.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Qt}):r=Rt(t,n.includeContainer,Be.bind(null,n)),Tt(r)},en=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Ae([t],n.includeContainer,{filter:Ve.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=Rt(t,n.includeContainer,Ve.bind(null,n)),r},St=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return ge.call(t,Se)===!1?!1:Be(n,t)};function tn(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Ct(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function nn(){return/apple/i.test(navigator.vendor)}function He(){const e=/android/i;return e.test(tn())||e.test(Ct())}function rn(){return Ct().includes("jsdom/")}const Xe="data-floating-ui-focusable",on="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function ve(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function W(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&y.isShadowRoot(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function ue(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Pe(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function sn(e){return e.matches("html,body")}function X(e){return e?.ownerDocument||document}function It(e){return y.isHTMLElement(e)&&e.matches(on)}function Je(e){return e?e.getAttribute("role")==="combobox"&&It(e):!1}function Qe(e){return e?e.hasAttribute(Xe)?e:e.querySelector("["+Xe+"]")||e:null}function be(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var s;return o.parentId===t&&(!n||((s=o.context)==null?void 0:s.open))}).flatMap(o=>[o,...be(e,o.id,n)])}function et(e,t){var n;let r=[],o=(n=e.find(s=>s.id===t))==null?void 0:n.parentId;for(;o;){const s=e.find(i=>i.id===o);o=s?.parentId,s&&(r=r.concat(s))}return r}function Fe(e){e.preventDefault(),e.stopPropagation()}function an(e){return"nativeEvent"in e}function un(e){return e.mozInputSource===0&&e.isTrusted?!0:He()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function cn(e){return rn()?!1:!He()&&e.width===0&&e.height===0||He()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function tt(e,t){return["mouse","pen"].includes(e)}var ln=typeof document<"u",fn=function(){},Y=ln?Z.useLayoutEffect:fn;const dn={...c};function Le(e){const t=c.useRef(e);return Y(()=>{t.current=e}),t}const vn=dn.useInsertionEffect,bn=vn||(e=>e());function Q(e){const t=c.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return bn(()=>{t.current=e}),c.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const Re=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function At(e,t){const n=ke(e,Re()),r=n.length;if(r===0)return;const o=ve(X(e)),s=n.indexOf(o),i=s===-1?t===1?0:r-1:s+t;return n[i]}function Dt(e){return At(X(e).body,1)||e}function kt(e){return At(X(e).body,-1)||e}function he(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!W(n,r)}function mn(e){ke(e,Re()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function nt(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const gn="data-floating-ui-focusable",rt="active",ot="selected",pn={...c};let st=!1,hn=0;const it=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+hn++;function En(){const[e,t]=c.useState(()=>st?it():void 0);return Y(()=>{e==null&&t(it())},[]),c.useEffect(()=>{st=!0},[]),e}const Rn=pn.useId,Ot=Rn||En;let $e;process.env.NODE_ENV!=="production"&&($e=new Set);function yn(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=$e)!=null&&e.has(o))){var s;(s=$e)==null||s.add(o),console.error(o)}}function wn(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const xn=c.createContext(null),Tn=c.createContext(null),Sn=()=>{var e;return((e=c.useContext(xn))==null?void 0:e.id)||null},Ke=()=>c.useContext(Tn);function Ee(e){return"data-floating-ui-"+e}function Cn(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}let at=0;function de(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(at);const s=()=>e?.focus({preventScroll:n});o?s():at=requestAnimationFrame(s)}function In(e){return e?.ownerDocument||document}const me={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function ut(e){return e==="inert"?me.inert:e==="aria-hidden"?me["aria-hidden"]:me.none}let xe=new WeakSet,Te={},_e=0;const An=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype;function Nt(e){return e?y.isShadowRoot(e)?e.host:Nt(e.parentNode):null}const Dn=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Nt(n);return e.contains(r)?r:null}).filter(n=>n!=null);function kn(e,t,n,r){const o="data-floating-ui-inert",s=r?"inert":n?"aria-hidden":null,i=Dn(t,e),u=new Set,d=new Set(i),a=[];Te[o]||(Te[o]=new WeakMap);const v=Te[o];i.forEach(R),A(t),u.clear();function R(f){!f||u.has(f)||(u.add(f),f.parentNode&&R(f.parentNode))}function A(f){!f||d.has(f)||[].forEach.call(f.children,h=>{if(y.getNodeName(h)!=="script")if(u.has(h))A(h);else{const l=s?h.getAttribute(s):null,x=l!==null&&l!=="false",S=ut(s),g=(S.get(h)||0)+1,p=(v.get(h)||0)+1;S.set(h,g),v.set(h,p),a.push(h),g===1&&x&&xe.add(h),p===1&&h.setAttribute(o,""),!x&&s&&h.setAttribute(s,s==="inert"?"":"true")}})}return _e++,()=>{a.forEach(f=>{const h=ut(s),x=(h.get(f)||0)-1,S=(v.get(f)||0)-1;h.set(f,x),v.set(f,S),x||(!xe.has(f)&&s&&f.removeAttribute(s),xe.delete(f)),S||f.removeAttribute(o)}),_e--,_e||(me.inert=new WeakMap,me["aria-hidden"]=new WeakMap,me.none=new WeakMap,xe=new WeakSet,Te={})}}function ct(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=In(e[0]).body;return kn(e.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))),r,t,n)}const We={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},De=c.forwardRef(function(t,n){const[r,o]=c.useState();Y(()=>{nn()&&o("button")},[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Ee("focus-guard")]:"",style:We};return O.jsx("span",{...t,...s})}),On={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Mt=c.createContext(null),lt=Ee("portal");function Nn(e){e===void 0&&(e={});const{id:t,root:n}=e,r=Ot(),o=Pt(),[s,i]=c.useState(null),u=c.useRef(null);return Y(()=>()=>{s?.remove(),queueMicrotask(()=>{u.current=null})},[s]),Y(()=>{if(!r||u.current)return;const d=t?document.getElementById(t):null;if(!d)return;const a=document.createElement("div");a.id=r,a.setAttribute(lt,""),d.appendChild(a),u.current=a,i(a)},[t,r]),Y(()=>{if(n===null||!r||u.current)return;let d=n||o?.portalNode;d&&!y.isNode(d)&&(d=d.current),d=d||document.body;let a=null;t&&(a=document.createElement("div"),a.id=t,d.appendChild(a));const v=document.createElement("div");v.id=r,v.setAttribute(lt,""),d=a||d,d.appendChild(v),u.current=v,i(v)},[t,n,r,o]),s}function Mn(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,s=Nn({id:n,root:r}),[i,u]=c.useState(null),d=c.useRef(null),a=c.useRef(null),v=c.useRef(null),R=c.useRef(null),A=i?.modal,f=i?.open,h=!!i&&!i.modal&&i.open&&o&&!!(r||s);return c.useEffect(()=>{if(!s||!o||A)return;function l(x){s&&he(x)&&(x.type==="focusin"?nt:mn)(s)}return s.addEventListener("focusin",l,!0),s.addEventListener("focusout",l,!0),()=>{s.removeEventListener("focusin",l,!0),s.removeEventListener("focusout",l,!0)}},[s,o,A]),c.useEffect(()=>{s&&(f||nt(s))},[f,s]),O.jsxs(Mt.Provider,{value:c.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:d,afterOutsideRef:a,beforeInsideRef:v,afterInsideRef:R,portalNode:s,setFocusManagerState:u}),[o,s]),children:[h&&s&&O.jsx(De,{"data-type":"outside",ref:d,onFocus:l=>{if(he(l,s)){var x;(x=v.current)==null||x.focus()}else{const S=i?i.domReference:null,g=kt(S);g?.focus()}}}),h&&s&&O.jsx("span",{"aria-owns":s.id,style:On}),s&&Vt.createPortal(t,s),h&&s&&O.jsx(De,{"data-type":"outside",ref:a,onFocus:l=>{if(he(l,s)){var x;(x=R.current)==null||x.focus()}else{const S=i?i.domReference:null,g=Dt(S);g?.focus(),i?.closeOnFocusOut&&i?.onOpenChange(!1,l.nativeEvent,"focus-out")}}})]})}const Pt=()=>c.useContext(Mt);function ft(e){return c.useMemo(()=>t=>{e.forEach(n=>{n&&(n.current=t)})},e)}const dt=20;let ce=[];function Ue(){ce=ce.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function Pn(e){Ue(),e&&y.getNodeName(e)!=="body"&&(ce.push(new WeakRef(e)),ce.length>dt&&(ce=ce.slice(-dt)))}function vt(){Ue();const e=ce[ce.length-1];return e?.deref()}function Fn(e){const t=Re();return St(e,t)?e:ke(e,t)[0]||e}function bt(e,t){var n;if(!t.current.includes("floating")&&!((n=e.getAttribute("role"))!=null&&n.includes("dialog")))return;const r=Re(),s=en(e,r).filter(u=>{const d=u.getAttribute("data-tabindex")||"";return St(u,r)||u.hasAttribute("data-tabindex")&&!d.startsWith("-")}),i=e.getAttribute("tabindex");t.current.includes("floating")||s.length===0?i!=="0"&&e.setAttribute("tabindex","0"):(i!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const Ln=c.forwardRef(function(t,n){return O.jsx("button",{...t,type:"button",ref:n,tabIndex:-1,style:We})});function _n(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:s=!0,initialFocus:i=0,returnFocus:u=!0,restoreFocus:d=!1,modal:a=!0,visuallyHiddenDismiss:v=!1,closeOnFocusOut:R=!0,outsideElementsInert:A=!1,getInsideElements:f=()=>[]}=e,{open:h,onOpenChange:l,events:x,dataRef:S,elements:{domReference:g,floating:p}}=t,_=Q(()=>{var w;return(w=S.current.floatingContext)==null?void 0:w.nodeId}),$=Q(f),q=typeof i=="number"&&i<0,P=Je(g)&&q,H=An(),re=H?s:!0,ee=!re||H&&A,C=Le(o),pe=Le(i),oe=Le(u),m=Ke(),b=Pt(),B=c.useRef(null),j=c.useRef(null),E=c.useRef(!1),F=c.useRef(!1),V=c.useRef(-1),z=c.useRef(-1),fe=b!=null,I=Qe(p),J=Q(function(w){return w===void 0&&(w=I),w?ke(w,Re()):[]}),M=Q(w=>{const D=J(w);return C.current.map(T=>g&&T==="reference"?g:I&&T==="floating"?I:D).filter(Boolean).flat()});c.useEffect(()=>{if(r||!a)return;function w(T){if(T.key==="Tab"){W(I,ve(X(I)))&&J().length===0&&!P&&Fe(T);const N=M(),L=ue(T);C.current[0]==="reference"&&L===g&&(Fe(T),T.shiftKey?de(N[N.length-1]):de(N[1])),C.current[1]==="floating"&&L===I&&T.shiftKey&&(Fe(T),de(N[0]))}}const D=X(I);return D.addEventListener("keydown",w),()=>{D.removeEventListener("keydown",w)}},[r,g,I,a,C,P,J,M]),c.useEffect(()=>{if(r||!p)return;function w(D){const T=ue(D),L=J().indexOf(T);L!==-1&&(V.current=L)}return p.addEventListener("focusin",w),()=>{p.removeEventListener("focusin",w)}},[r,p,J]),c.useEffect(()=>{if(r||!R)return;function w(){F.current=!0,setTimeout(()=>{F.current=!1})}function D(L){const k=L.relatedTarget,te=L.currentTarget,G=ue(L);queueMicrotask(()=>{const K=_(),le=!(W(g,k)||W(p,k)||W(k,p)||W(b?.portalNode,k)||k!=null&&k.hasAttribute(Ee("focus-guard"))||m&&(be(m.nodesRef.current,K).find(ie=>{var ne,ae;return W((ne=ie.context)==null?void 0:ne.elements.floating,k)||W((ae=ie.context)==null?void 0:ae.elements.domReference,k)})||et(m.nodesRef.current,K).find(ie=>{var ne,ae,Ge;return[(ne=ie.context)==null?void 0:ne.elements.floating,Qe((ae=ie.context)==null?void 0:ae.elements.floating)].includes(k)||((Ge=ie.context)==null?void 0:Ge.elements.domReference)===k})));if(te===g&&I&&bt(I,C),d&&te!==g&&!(G!=null&&G.isConnected)&&ve(X(I))===X(I).body){y.isHTMLElement(I)&&I.focus();const ie=V.current,ne=J(),ae=ne[ie]||ne[ne.length-1]||I;y.isHTMLElement(ae)&&ae.focus()}if(S.current.insideReactTree){S.current.insideReactTree=!1;return}(P||!a)&&k&&le&&!F.current&&k!==vt()&&(E.current=!0,l(!1,L,"focus-out"))})}const T=!!(!m&&b);function N(){Cn(z),S.current.insideReactTree=!0,z.current=window.setTimeout(()=>{S.current.insideReactTree=!1})}if(p&&y.isHTMLElement(g))return g.addEventListener("focusout",D),g.addEventListener("pointerdown",w),p.addEventListener("focusout",D),T&&p.addEventListener("focusout",N,!0),()=>{g.removeEventListener("focusout",D),g.removeEventListener("pointerdown",w),p.removeEventListener("focusout",D),T&&p.removeEventListener("focusout",N,!0)}},[r,g,p,I,a,m,b,l,R,d,J,P,_,C,S]);const U=c.useRef(null),se=c.useRef(null),Oe=ft([U,b?.beforeInsideRef]),Ne=ft([se,b?.afterInsideRef]);c.useEffect(()=>{var w,D;if(r||!p)return;const T=Array.from((b==null||(w=b.portalNode)==null?void 0:w.querySelectorAll("["+Ee("portal")+"]"))||[]),L=(D=(m?et(m.nodesRef.current,_()):[]).find(G=>{var K;return Je(((K=G.context)==null?void 0:K.elements.domReference)||null)}))==null||(D=D.context)==null?void 0:D.elements.domReference,k=[p,L,...T,...$(),B.current,j.current,U.current,se.current,b?.beforeOutsideRef.current,b?.afterOutsideRef.current,C.current.includes("reference")||P?g:null].filter(G=>G!=null),te=a||P?ct(k,!ee,ee):ct(k);return()=>{te()}},[r,g,p,a,C,b,P,re,ee,m,_,$]),Y(()=>{if(r||!y.isHTMLElement(I))return;const w=X(I),D=ve(w);queueMicrotask(()=>{const T=M(I),N=pe.current,L=(typeof N=="number"?T[N]:N.current)||I,k=W(I,D);!q&&!k&&h&&de(L,{preventScroll:L===I})})},[r,h,I,q,M,pe]),Y(()=>{if(r||!I)return;const w=X(I),D=ve(w);Pn(D);function T(k){let{reason:te,event:G,nested:K}=k;if(["hover","safe-polygon"].includes(te)&&G.type==="mouseleave"&&(E.current=!0),te==="outside-press")if(K)E.current=!1;else if(un(G)||cn(G))E.current=!1;else{let le=!1;document.createElement("div").focus({get preventScroll(){return le=!0,!1}}),le?E.current=!1:E.current=!0}}x.on("openchange",T);const N=w.createElement("span");N.setAttribute("tabindex","-1"),N.setAttribute("aria-hidden","true"),Object.assign(N.style,We),fe&&g&&g.insertAdjacentElement("afterend",N);function L(){if(typeof oe.current=="boolean"){const k=g||vt();return k&&k.isConnected?k:N}return oe.current.current||N}return()=>{x.off("openchange",T);const k=ve(w),te=W(p,k)||m&&be(m.nodesRef.current,_(),!1).some(K=>{var le;return W((le=K.context)==null?void 0:le.elements.floating,k)}),G=L();queueMicrotask(()=>{const K=Fn(G);oe.current&&!E.current&&y.isHTMLElement(K)&&(!(K!==k&&k!==w.body)||te)&&K.focus({preventScroll:!0}),N.remove()})}},[r,p,I,oe,S,x,m,fe,g,_]),c.useEffect(()=>(queueMicrotask(()=>{E.current=!1}),()=>{queueMicrotask(Ue)}),[r]),Y(()=>{if(!r&&b)return b.setFocusManagerState({modal:a,closeOnFocusOut:R,open:h,onOpenChange:l,domReference:g}),()=>{b.setFocusManagerState(null)}},[r,b,a,h,l,R,g]),Y(()=>{r||I&&bt(I,C)},[r,I,C]);function ye(w){return r||!v||!a?null:O.jsx(Ln,{ref:w==="start"?B:j,onClick:D=>l(!1,D.nativeEvent),children:typeof v=="string"?v:"Dismiss"})}const we=!r&&re&&(a?!P:!0)&&(fe||a);return O.jsxs(O.Fragment,{children:[we&&O.jsx(De,{"data-type":"inside",ref:Oe,onFocus:w=>{if(a){const T=M();de(o[0]==="reference"?T[0]:T[T.length-1])}else if(b!=null&&b.preserveTabOrder&&b.portalNode)if(E.current=!1,he(w,b.portalNode)){const T=Dt(g);T?.focus()}else{var D;(D=b.beforeOutsideRef.current)==null||D.focus()}}}),!P&&ye("start"),n,ye("end"),we&&O.jsx(De,{"data-type":"inside",ref:Ne,onFocus:w=>{if(a)de(M()[0]);else if(b!=null&&b.preserveTabOrder&&b.portalNode)if(R&&(E.current=!0),he(w,b.portalNode)){const T=kt(g);T?.focus()}else{var D;(D=b.afterOutsideRef.current)==null||D.focus()}}})]})}function mt(e){return y.isHTMLElement(e.target)&&e.target.tagName==="BUTTON"}function jn(e){return y.isHTMLElement(e.target)&&e.target.tagName==="A"}function gt(e){return It(e)}function Vn(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:s}}=e,{enabled:i=!0,event:u="click",toggle:d=!0,ignoreMouse:a=!1,keyboardHandlers:v=!0,stickIfOpen:R=!0}=t,A=c.useRef(),f=c.useRef(!1),h=c.useMemo(()=>({onPointerDown(l){A.current=l.pointerType},onMouseDown(l){const x=A.current;l.button===0&&u!=="click"&&(tt(x)&&a||(n&&d&&(!(o.current.openEvent&&R)||o.current.openEvent.type==="mousedown")?r(!1,l.nativeEvent,"click"):(l.preventDefault(),r(!0,l.nativeEvent,"click"))))},onClick(l){const x=A.current;if(u==="mousedown"&&A.current){A.current=void 0;return}tt(x)&&a||(n&&d&&(!(o.current.openEvent&&R)||o.current.openEvent.type==="click")?r(!1,l.nativeEvent,"click"):r(!0,l.nativeEvent,"click"))},onKeyDown(l){A.current=void 0,!(l.defaultPrevented||!v||mt(l))&&(l.key===" "&&!gt(s)&&(l.preventDefault(),f.current=!0),!jn(l)&&l.key==="Enter"&&r(!(n&&d),l.nativeEvent,"click"))},onKeyUp(l){l.defaultPrevented||!v||mt(l)||gt(s)||l.key===" "&&f.current&&(f.current=!1,r(!(n&&d),l.nativeEvent,"click"))}}),[o,s,u,a,v,r,n,R,d]);return c.useMemo(()=>i?{reference:h}:{},[i,h])}const Bn={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Hn={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},pt=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function $n(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:s}=e,{enabled:i=!0,escapeKey:u=!0,outsidePress:d=!0,outsidePressEvent:a="pointerdown",referencePress:v=!1,referencePressEvent:R="pointerdown",ancestorScroll:A=!1,bubbles:f,capture:h}=t,l=Ke(),x=Q(typeof d=="function"?d:()=>!1),S=typeof d=="function"?x:d,g=c.useRef(!1),{escapeKey:p,outsidePress:_}=pt(f),{escapeKey:$,outsidePress:q}=pt(h),P=c.useRef(!1),H=Q(m=>{var b;if(!n||!i||!u||m.key!=="Escape"||P.current)return;const B=(b=s.current.floatingContext)==null?void 0:b.nodeId,j=l?be(l.nodesRef.current,B):[];if(!p&&(m.stopPropagation(),j.length>0)){let E=!0;if(j.forEach(F=>{var V;if((V=F.context)!=null&&V.open&&!F.context.dataRef.current.__escapeKeyBubbles){E=!1;return}}),!E)return}r(!1,an(m)?m.nativeEvent:m,"escape-key")}),re=Q(m=>{var b;const B=()=>{var j;H(m),(j=ue(m))==null||j.removeEventListener("keydown",B)};(b=ue(m))==null||b.addEventListener("keydown",B)}),ee=Q(m=>{var b;const B=s.current.insideReactTree;s.current.insideReactTree=!1;const j=g.current;if(g.current=!1,a==="click"&&j||B||typeof S=="function"&&!S(m))return;const E=ue(m),F="["+Ee("inert")+"]",V=X(o.floating).querySelectorAll(F);let z=y.isElement(E)?E:null;for(;z&&!y.isLastTraversableNode(z);){const M=y.getParentNode(z);if(y.isLastTraversableNode(M)||!y.isElement(M))break;z=M}if(V.length&&y.isElement(E)&&!sn(E)&&!W(E,o.floating)&&Array.from(V).every(M=>!W(z,M)))return;if(y.isHTMLElement(E)&&oe){const M=y.isLastTraversableNode(E),U=y.getComputedStyle(E),se=/auto|scroll/,Oe=M||se.test(U.overflowX),Ne=M||se.test(U.overflowY),ye=Oe&&E.clientWidth>0&&E.scrollWidth>E.clientWidth,we=Ne&&E.clientHeight>0&&E.scrollHeight>E.clientHeight,w=U.direction==="rtl",D=we&&(w?m.offsetX<=E.offsetWidth-E.clientWidth:m.offsetX>E.clientWidth),T=ye&&m.offsetY>E.clientHeight;if(D||T)return}const fe=(b=s.current.floatingContext)==null?void 0:b.nodeId,I=l&&be(l.nodesRef.current,fe).some(M=>{var U;return Pe(m,(U=M.context)==null?void 0:U.elements.floating)});if(Pe(m,o.floating)||Pe(m,o.domReference)||I)return;const J=l?be(l.nodesRef.current,fe):[];if(J.length>0){let M=!0;if(J.forEach(U=>{var se;if((se=U.context)!=null&&se.open&&!U.context.dataRef.current.__outsidePressBubbles){M=!1;return}}),!M)return}r(!1,m,"outside-press")}),C=Q(m=>{var b;const B=()=>{var j;ee(m),(j=ue(m))==null||j.removeEventListener(a,B)};(b=ue(m))==null||b.addEventListener(a,B)});c.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=p,s.current.__outsidePressBubbles=_;let m=-1;function b(V){r(!1,V,"ancestor-scroll")}function B(){window.clearTimeout(m),P.current=!0}function j(){m=window.setTimeout(()=>{P.current=!1},y.isWebKit()?5:0)}const E=X(o.floating);u&&(E.addEventListener("keydown",$?re:H,$),E.addEventListener("compositionstart",B),E.addEventListener("compositionend",j)),S&&E.addEventListener(a,q?C:ee,q);let F=[];return A&&(y.isElement(o.domReference)&&(F=y.getOverflowAncestors(o.domReference)),y.isElement(o.floating)&&(F=F.concat(y.getOverflowAncestors(o.floating))),!y.isElement(o.reference)&&o.reference&&o.reference.contextElement&&(F=F.concat(y.getOverflowAncestors(o.reference.contextElement)))),F=F.filter(V=>{var z;return V!==((z=E.defaultView)==null?void 0:z.visualViewport)}),F.forEach(V=>{V.addEventListener("scroll",b,{passive:!0})}),()=>{u&&(E.removeEventListener("keydown",$?re:H,$),E.removeEventListener("compositionstart",B),E.removeEventListener("compositionend",j)),S&&E.removeEventListener(a,q?C:ee,q),F.forEach(V=>{V.removeEventListener("scroll",b)}),window.clearTimeout(m)}},[s,o,u,S,a,n,r,A,i,p,_,H,$,re,ee,q,C]),c.useEffect(()=>{s.current.insideReactTree=!1},[s,S,a]);const pe=c.useMemo(()=>({onKeyDown:H,...v&&{[Bn[R]]:m=>{r(!1,m.nativeEvent,"reference-press")},...R!=="click"&&{onClick(m){r(!1,m.nativeEvent,"reference-press")}}}}),[H,r,v,R]),oe=c.useMemo(()=>{function m(b){b.button===0&&(g.current=!0)}return{onKeyDown:H,onMouseDown:m,onMouseUp:m,[Hn[a]]:()=>{s.current.insideReactTree=!0}}},[H,a,s]);return c.useMemo(()=>i?{reference:pe,floating:oe}:{},[i,pe,oe])}function qn(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Ot(),s=c.useRef({}),[i]=c.useState(()=>wn()),u=Sn()!=null;if(process.env.NODE_ENV!=="production"){const f=r.reference;f&&!y.isElement(f)&&yn("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[d,a]=c.useState(r.reference),v=Q((f,h,l)=>{s.current.openEvent=f?h:void 0,i.emit("openchange",{open:f,event:h,reason:l,nested:u}),n?.(f,h,l)}),R=c.useMemo(()=>({setPositionReference:a}),[]),A=c.useMemo(()=>({reference:d||r.reference||null,floating:r.floating||null,domReference:r.reference}),[d,r.reference,r.floating]);return c.useMemo(()=>({dataRef:s,open:t,onOpenChange:v,elements:A,events:i,floatingId:o,refs:R}),[t,v,A,i,o,R])}function Kn(e){e===void 0&&(e={});const{nodeId:t}=e,n=qn({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=c.useState(null),[u,d]=c.useState(null),v=o?.domReference||s,R=c.useRef(null),A=Ke();Y(()=>{v&&(R.current=v)},[v]);const f=y.useFloating({...e,elements:{...o,...u&&{reference:u}}}),h=c.useCallback(p=>{const _=y.isElement(p)?{getBoundingClientRect:()=>p.getBoundingClientRect(),getClientRects:()=>p.getClientRects(),contextElement:p}:p;d(_),f.refs.setReference(_)},[f.refs]),l=c.useCallback(p=>{(y.isElement(p)||p===null)&&(R.current=p,i(p)),(y.isElement(f.refs.reference.current)||f.refs.reference.current===null||p!==null&&!y.isElement(p))&&f.refs.setReference(p)},[f.refs]),x=c.useMemo(()=>({...f.refs,setReference:l,setPositionReference:h,domReference:R}),[f.refs,l,h]),S=c.useMemo(()=>({...f.elements,domReference:v}),[f.elements,v]),g=c.useMemo(()=>({...f,...r,refs:x,elements:S,nodeId:t}),[f,x,S,t,r]);return Y(()=>{r.dataRef.current.floatingContext=g;const p=A?.nodesRef.current.find(_=>_.id===t);p&&(p.context=g)}),c.useMemo(()=>({...f,context:g,refs:x,elements:S}),[f,x,S,g])}function je(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[rt]:i,[ot]:u,...d}=e;s=d}return{...n==="floating"&&{tabIndex:-1,[gn]:""},...s,...t.map(i=>{const u=i?i[n]:null;return typeof u=="function"?e?u(e):null:u}).concat(e).reduce((i,u)=>(u&&Object.entries(u).forEach(d=>{let[a,v]=d;if(!(o&&[rt,ot].includes(a)))if(a.indexOf("on")===0){if(r.has(a)||r.set(a,[]),typeof v=="function"){var R;(R=r.get(a))==null||R.push(v),i[a]=function(){for(var A,f=arguments.length,h=new Array(f),l=0;l<f;l++)h[l]=arguments[l];return(A=r.get(a))==null?void 0:A.map(x=>x(...h)).find(x=>x!==void 0)}}}else i[a]=v}),i),{})}}function Wn(e){e===void 0&&(e=[]);const t=e.map(u=>u?.reference),n=e.map(u=>u?.floating),r=e.map(u=>u?.item),o=c.useCallback(u=>je(u,e,"reference"),t),s=c.useCallback(u=>je(u,e,"floating"),n),i=c.useCallback(u=>je(u,e,"item"),r);return c.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}const Un={name:"calendar",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M8 1.6a.9.9 0 0 1 .9.9V7a.9.9 0 0 1-1.8 0V5.9H4a.1.1 0 0 0-.1.1v3.105A.91.91 0 0 1 4 9.1h16.1V6a.1.1 0 0 0-.1-.1h-3.1V7a.9.9 0 1 1-1.8 0V5.9h-3.6a.9.9 0 1 1 0-1.8h3.6V2.5a.9.9 0 1 1 1.8 0v1.6H20c1.05 0 1.9.85 1.9 1.9v14a1.9 1.9 0 0 1-1.9 1.9H4A1.9 1.9 0 0 1 2.1 20V6c0-1.05.85-1.9 1.9-1.9h3.1V2.5a.9.9 0 0 1 .9-.9Zm12.1 9.3H4a.917.917 0 0 1-.1-.005V20a.1.1 0 0 0 .1.1h16a.1.1 0 0 0 .1-.1v-9.1ZM5.6 13.5a.9.9 0 0 1 .9-.9h1a.9.9 0 1 1 0 1.8h-1a.9.9 0 0 1-.9-.9Zm5 0a.9.9 0 0 1 .9-.9h1a.9.9 0 1 1 0 1.8h-1a.9.9 0 0 1-.9-.9Zm5 0a.9.9 0 0 1 .9-.9h1a.9.9 0 1 1 0 1.8h-1a.9.9 0 0 1-.9-.9Zm-10 4a.9.9 0 0 1 .9-.9h1a.9.9 0 1 1 0 1.8h-1a.9.9 0 0 1-.9-.9Zm5 0a.9.9 0 0 1 .9-.9h1a.9.9 0 1 1 0 1.8h-1a.9.9 0 0 1-.9-.9Zm5 0a.9.9 0 0 1 .9-.9h1a.9.9 0 1 1 0 1.8h-1a.9.9 0 0 1-.9-.9Z" clip-rule="evenodd"/></svg>',keywords:["calendar"],category:"other"},qe=e=>O.jsx(_t.b,{...e,svg:Un});qe.displayName="IconCalendar";const Gn={"date-picker-calendar-container":"_date-picker-calendar-container_17f84_1"},Yn=jt.c.bind(Gn),Ft=Z.forwardRef(({calendarProps:e,drawerContentProps:t,value:n,onChange:r,overlayZIndex:o,...s},i)=>{const[u,d]=Z.useState(!1),[a,v]=Z.useState(!1),[R,A]=Z.useState(!1),f=Z.useRef(null),{context:h,refs:l,floatingStyles:x}=Kn({open:u,onOpenChange:C=>{s.readOnly||d(C)},placement:"bottom-start",middleware:[y.offset({mainAxis:10,crossAxis:-32}),y.flip()],whileElementsMounted:y.autoUpdate}),S=Vn(h),g=$n(h),{getFloatingProps:p,getReferenceProps:_}=Wn([S,g]),[$,q]=Z.useState(n);Z.useEffect(()=>{q(n)},[n]);const P=C=>{C?(q(C),r?.(C),(u||a)&&(d(!1),v(!1))):(q(void 0),r?.(void 0))},H=Z.useId();return Z.useLayoutEffect(()=>{const C=()=>{A(window.innerWidth<600)};return C(),window.addEventListener("resize",C),()=>{window.removeEventListener("resize",C)}},[]),R?O.jsxs(Me.Drawer,{open:a,onOpenChange:v,children:[O.jsx(Me.Drawer.Trigger,{children:O.jsx(ze.DateField,{...s,startAdornment:O.jsx(qe,{size:"sm"}),id:H,value:$,onChange:C=>P(C),"data-testid":s["data-testid"]})}),O.jsx(Me.Drawer.Content,{"data-testid":s["data-testid"]&&`${s["data-testid"]}-calendar`,fitToContent:!0,...t,zIndex:o,children:O.jsx(Ye.Calendar,{showOutsideDays:!0,...e,mode:"single",selected:$,onSelect:C=>P(C)})})]}):O.jsxs("div",{ref:i,children:[O.jsx(ze.DateField,{..._(s),ref:l.setReference,startAdornment:O.jsx(qe,{size:"sm"}),id:H,value:$,onChange:C=>P(C),"data-testid":s["data-testid"]}),u&&!s.readOnly&&O.jsx(Mn,{children:O.jsx(_n,{context:h,initialFocus:f,children:O.jsx("div",{"data-testid":s["data-testid"]&&`${s["data-testid"]}-calendar`,className:Yn("date-picker-calendar-container"),ref:l.setFloating,style:{...x,zIndex:o},...p(),children:O.jsx(Ye.Calendar,{showOutsideDays:!0,...e,mode:"single",selected:$,onSelect:C=>P(C),firstElementRef:f})})})})]})});Ft.displayName="DatePicker";exports.DatePicker=Ft;
2
+ //# sourceMappingURL=date-picker-DVrcu2QU.js.map