@helpwave/hightide 0.1.26 → 0.1.28

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 (336) hide show
  1. package/dist/coloring/index.d.mts +2 -0
  2. package/dist/coloring/index.d.ts +2 -0
  3. package/dist/coloring/index.js +85 -0
  4. package/dist/coloring/index.js.map +1 -0
  5. package/dist/coloring/index.mjs +48 -0
  6. package/dist/coloring/index.mjs.map +1 -0
  7. package/dist/components/branding/index.d.mts +3 -0
  8. package/dist/components/branding/index.d.ts +3 -0
  9. package/dist/components/branding/index.js +140 -0
  10. package/dist/components/branding/index.js.map +1 -0
  11. package/dist/components/branding/index.mjs +104 -0
  12. package/dist/components/branding/index.mjs.map +1 -0
  13. package/dist/components/date/DatePicker.js +1 -1
  14. package/dist/components/date/DatePicker.js.map +1 -1
  15. package/dist/components/date/DatePicker.mjs +1 -1
  16. package/dist/components/date/DatePicker.mjs.map +1 -1
  17. package/dist/components/date/YearMonthPicker.js +1 -1
  18. package/dist/components/date/YearMonthPicker.js.map +1 -1
  19. package/dist/components/date/YearMonthPicker.mjs +1 -1
  20. package/dist/components/date/YearMonthPicker.mjs.map +1 -1
  21. package/dist/components/date/index.d.mts +10 -0
  22. package/dist/components/date/index.d.ts +10 -0
  23. package/dist/components/date/index.js +1168 -0
  24. package/dist/components/date/index.js.map +1 -0
  25. package/dist/components/date/index.mjs +1124 -0
  26. package/dist/components/date/index.mjs.map +1 -0
  27. package/dist/components/dialog/ConfirmDialog.d.mts +1 -1
  28. package/dist/components/dialog/ConfirmDialog.d.ts +1 -1
  29. package/dist/components/dialog/ConfirmDialog.js +2 -2
  30. package/dist/components/dialog/ConfirmDialog.js.map +1 -1
  31. package/dist/components/dialog/ConfirmDialog.mjs +2 -2
  32. package/dist/components/dialog/ConfirmDialog.mjs.map +1 -1
  33. package/dist/components/dialog/Dialog.d.mts +1 -1
  34. package/dist/components/dialog/Dialog.d.ts +1 -1
  35. package/dist/components/dialog/Dialog.js +2 -2
  36. package/dist/components/dialog/Dialog.js.map +1 -1
  37. package/dist/components/dialog/Dialog.mjs +2 -2
  38. package/dist/components/dialog/Dialog.mjs.map +1 -1
  39. package/dist/components/dialog/DiscardChangesDialog.d.mts +1 -1
  40. package/dist/components/dialog/DiscardChangesDialog.d.ts +1 -1
  41. package/dist/components/dialog/DiscardChangesDialog.js +2 -2
  42. package/dist/components/dialog/DiscardChangesDialog.js.map +1 -1
  43. package/dist/components/dialog/DiscardChangesDialog.mjs +2 -2
  44. package/dist/components/dialog/DiscardChangesDialog.mjs.map +1 -1
  45. package/dist/components/dialog/InputDialog.d.mts +1 -1
  46. package/dist/components/dialog/InputDialog.d.ts +1 -1
  47. package/dist/components/dialog/InputDialog.js +2 -2
  48. package/dist/components/dialog/InputDialog.js.map +1 -1
  49. package/dist/components/dialog/InputDialog.mjs +2 -2
  50. package/dist/components/dialog/InputDialog.mjs.map +1 -1
  51. package/dist/components/dialog/LanguageDialog.d.mts +1 -1
  52. package/dist/components/dialog/LanguageDialog.d.ts +1 -1
  53. package/dist/components/dialog/LanguageDialog.js +28 -15
  54. package/dist/components/dialog/LanguageDialog.js.map +1 -1
  55. package/dist/components/dialog/LanguageDialog.mjs +28 -15
  56. package/dist/components/dialog/LanguageDialog.mjs.map +1 -1
  57. package/dist/components/dialog/ThemeDialog.d.mts +1 -1
  58. package/dist/components/dialog/ThemeDialog.d.ts +1 -1
  59. package/dist/components/dialog/ThemeDialog.js +69 -33
  60. package/dist/components/dialog/ThemeDialog.js.map +1 -1
  61. package/dist/components/dialog/ThemeDialog.mjs +60 -24
  62. package/dist/components/dialog/ThemeDialog.mjs.map +1 -1
  63. package/dist/components/dialog/index.d.mts +1 -1
  64. package/dist/components/dialog/index.d.ts +1 -1
  65. package/dist/components/dialog/index.js +61 -25
  66. package/dist/components/dialog/index.js.map +1 -1
  67. package/dist/components/dialog/index.mjs +61 -25
  68. package/dist/components/dialog/index.mjs.map +1 -1
  69. package/dist/components/form/index.d.mts +5 -0
  70. package/dist/components/form/index.d.ts +5 -0
  71. package/dist/components/form/index.js +100 -0
  72. package/dist/components/form/index.js.map +1 -0
  73. package/dist/components/form/index.mjs +64 -0
  74. package/dist/components/form/index.mjs.map +1 -0
  75. package/dist/components/icons-and-geometry/index.d.mts +7 -0
  76. package/dist/components/icons-and-geometry/index.d.ts +7 -0
  77. package/dist/components/icons-and-geometry/index.js +3955 -0
  78. package/dist/components/icons-and-geometry/index.js.map +1 -0
  79. package/dist/components/icons-and-geometry/index.mjs +3939 -0
  80. package/dist/components/icons-and-geometry/index.mjs.map +1 -0
  81. package/dist/components/index.d.mts +83 -0
  82. package/dist/components/index.d.ts +83 -0
  83. package/dist/components/index.js +15471 -0
  84. package/dist/components/index.js.map +1 -0
  85. package/dist/components/index.mjs +15377 -0
  86. package/dist/components/index.mjs.map +1 -0
  87. package/dist/components/layout/Carousel.d.mts +33 -0
  88. package/dist/components/layout/Carousel.d.ts +33 -0
  89. package/dist/components/layout/Carousel.js +684 -0
  90. package/dist/components/layout/Carousel.js.map +1 -0
  91. package/dist/components/layout/Carousel.mjs +659 -0
  92. package/dist/components/layout/Carousel.mjs.map +1 -0
  93. package/dist/components/{layout-and-navigation → layout}/Chip.js +1 -1
  94. package/dist/components/layout/Chip.js.map +1 -0
  95. package/dist/components/{layout-and-navigation → layout}/Chip.mjs +1 -1
  96. package/dist/components/layout/Chip.mjs.map +1 -0
  97. package/dist/components/{layout-and-navigation → layout}/DividerInserter.js +1 -1
  98. package/dist/components/layout/DividerInserter.js.map +1 -0
  99. package/dist/components/{layout-and-navigation → layout}/DividerInserter.mjs +1 -1
  100. package/dist/components/layout/DividerInserter.mjs.map +1 -0
  101. package/dist/components/{layout-and-navigation → layout}/Expandable.js +2 -2
  102. package/dist/components/layout/Expandable.js.map +1 -0
  103. package/dist/components/{layout-and-navigation → layout}/Expandable.mjs +2 -2
  104. package/dist/components/layout/Expandable.mjs.map +1 -0
  105. package/dist/components/{layout-and-navigation → layout}/FAQSection.js +5 -5
  106. package/dist/components/layout/FAQSection.js.map +1 -0
  107. package/dist/components/{layout-and-navigation → layout}/FAQSection.mjs +5 -5
  108. package/dist/components/layout/FAQSection.mjs.map +1 -0
  109. package/dist/components/{layout-and-navigation → layout}/FloatingContainer.js +2 -2
  110. package/dist/components/layout/FloatingContainer.js.map +1 -0
  111. package/dist/components/{layout-and-navigation → layout}/FloatingContainer.mjs +2 -2
  112. package/dist/components/layout/FloatingContainer.mjs.map +1 -0
  113. package/dist/components/{layout-and-navigation → layout}/ListBox.js +2 -2
  114. package/dist/components/layout/ListBox.js.map +1 -0
  115. package/dist/components/{layout-and-navigation → layout}/ListBox.mjs +2 -2
  116. package/dist/components/layout/ListBox.mjs.map +1 -0
  117. package/dist/components/{layout-and-navigation → layout}/MarkdownInterpreter.js +1 -1
  118. package/dist/components/layout/MarkdownInterpreter.js.map +1 -0
  119. package/dist/components/{layout-and-navigation → layout}/MarkdownInterpreter.mjs +1 -1
  120. package/dist/components/layout/MarkdownInterpreter.mjs.map +1 -0
  121. package/dist/components/{layout-and-navigation → layout}/ScrollArea.js +2 -2
  122. package/dist/components/layout/ScrollArea.js.map +1 -0
  123. package/dist/components/{layout-and-navigation → layout}/ScrollArea.mjs +1 -1
  124. package/dist/components/layout/ScrollArea.mjs.map +1 -0
  125. package/dist/components/{layout-and-navigation → layout}/TextImage.js +3 -3
  126. package/dist/components/layout/TextImage.js.map +1 -0
  127. package/dist/components/{layout-and-navigation → layout}/TextImage.mjs +2 -2
  128. package/dist/components/layout/TextImage.mjs.map +1 -0
  129. package/dist/components/{layout-and-navigation → layout}/VerticalDivider.js +1 -1
  130. package/dist/components/layout/VerticalDivider.js.map +1 -0
  131. package/dist/components/{layout-and-navigation → layout}/VerticalDivider.mjs +1 -1
  132. package/dist/components/layout/VerticalDivider.mjs.map +1 -0
  133. package/dist/components/layout/index.d.mts +18 -0
  134. package/dist/components/layout/index.d.ts +18 -0
  135. package/dist/components/layout/index.js +3111 -0
  136. package/dist/components/layout/index.js.map +1 -0
  137. package/dist/components/layout/index.mjs +3064 -0
  138. package/dist/components/layout/index.mjs.map +1 -0
  139. package/dist/components/loading-states/index.d.mts +12 -0
  140. package/dist/components/loading-states/index.d.ts +12 -0
  141. package/dist/components/loading-states/index.js +614 -0
  142. package/dist/components/loading-states/index.js.map +1 -0
  143. package/dist/components/loading-states/index.mjs +573 -0
  144. package/dist/components/loading-states/index.mjs.map +1 -0
  145. package/dist/components/{layout-and-navigation → navigation}/BreadCrumb.js +1 -1
  146. package/dist/components/navigation/BreadCrumb.js.map +1 -0
  147. package/dist/components/{layout-and-navigation → navigation}/BreadCrumb.mjs +1 -1
  148. package/dist/components/navigation/BreadCrumb.mjs.map +1 -0
  149. package/dist/components/navigation/Navigation.d.mts +21 -0
  150. package/dist/components/navigation/Navigation.d.ts +21 -0
  151. package/dist/components/navigation/Navigation.js +4018 -0
  152. package/dist/components/navigation/Navigation.js.map +1 -0
  153. package/dist/components/navigation/Navigation.mjs +4012 -0
  154. package/dist/components/navigation/Navigation.mjs.map +1 -0
  155. package/dist/components/{layout-and-navigation → navigation}/Pagination.js +3 -3
  156. package/dist/components/navigation/Pagination.js.map +1 -0
  157. package/dist/components/{layout-and-navigation → navigation}/Pagination.mjs +3 -3
  158. package/dist/components/navigation/Pagination.mjs.map +1 -0
  159. package/dist/components/{layout-and-navigation → navigation}/StepperBar.js +3 -3
  160. package/dist/components/navigation/StepperBar.js.map +1 -0
  161. package/dist/components/{layout-and-navigation → navigation}/StepperBar.mjs +3 -3
  162. package/dist/components/navigation/StepperBar.mjs.map +1 -0
  163. package/dist/components/navigation/index.d.mts +9 -0
  164. package/dist/components/navigation/index.d.ts +9 -0
  165. package/dist/components/navigation/index.js +4660 -0
  166. package/dist/components/navigation/index.js.map +1 -0
  167. package/dist/components/navigation/index.mjs +4648 -0
  168. package/dist/components/navigation/index.mjs.map +1 -0
  169. package/dist/components/properties/MultiSelectProperty.js +27 -14
  170. package/dist/components/properties/MultiSelectProperty.js.map +1 -1
  171. package/dist/components/properties/MultiSelectProperty.mjs +27 -14
  172. package/dist/components/properties/MultiSelectProperty.mjs.map +1 -1
  173. package/dist/components/properties/SelectProperty.js +27 -14
  174. package/dist/components/properties/SelectProperty.js.map +1 -1
  175. package/dist/components/properties/SelectProperty.mjs +27 -14
  176. package/dist/components/properties/SelectProperty.mjs.map +1 -1
  177. package/dist/components/properties/index.d.mts +12 -0
  178. package/dist/components/properties/index.d.ts +12 -0
  179. package/dist/components/properties/index.js +2983 -0
  180. package/dist/components/properties/index.js.map +1 -0
  181. package/dist/components/properties/index.mjs +2951 -0
  182. package/dist/components/properties/index.mjs.map +1 -0
  183. package/dist/components/table/Table.js +1 -1
  184. package/dist/components/table/Table.js.map +1 -1
  185. package/dist/components/table/Table.mjs +1 -1
  186. package/dist/components/table/Table.mjs.map +1 -1
  187. package/dist/components/table/index.d.mts +10 -0
  188. package/dist/components/table/index.d.ts +10 -0
  189. package/dist/components/table/index.js +2329 -0
  190. package/dist/components/table/index.js.map +1 -0
  191. package/dist/components/table/index.mjs +2293 -0
  192. package/dist/components/table/index.mjs.map +1 -0
  193. package/dist/components/user-action/DateAndTimePicker.js +1 -1
  194. package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
  195. package/dist/components/user-action/DateAndTimePicker.mjs +1 -1
  196. package/dist/components/user-action/DateAndTimePicker.mjs.map +1 -1
  197. package/dist/components/user-action/index.d.mts +30 -0
  198. package/dist/components/user-action/index.d.ts +30 -0
  199. package/dist/components/user-action/index.js +4257 -0
  200. package/dist/components/user-action/index.js.map +1 -0
  201. package/dist/components/user-action/index.mjs +4195 -0
  202. package/dist/components/user-action/index.mjs.map +1 -0
  203. package/dist/components/user-action/input/index.d.mts +6 -0
  204. package/dist/components/user-action/input/index.d.ts +6 -0
  205. package/dist/components/user-action/input/index.js +398 -0
  206. package/dist/components/user-action/input/index.js.map +1 -0
  207. package/dist/components/user-action/input/index.mjs +357 -0
  208. package/dist/components/user-action/input/index.mjs.map +1 -0
  209. package/dist/components/user-action/select/Select.d.mts +5 -1
  210. package/dist/components/user-action/select/Select.d.ts +5 -1
  211. package/dist/components/user-action/select/Select.js +27 -14
  212. package/dist/components/user-action/select/Select.js.map +1 -1
  213. package/dist/components/user-action/select/Select.mjs +27 -14
  214. package/dist/components/user-action/select/Select.mjs.map +1 -1
  215. package/dist/components/user-action/select/index.d.mts +4 -0
  216. package/dist/components/user-action/select/index.d.ts +4 -0
  217. package/dist/components/user-action/select/index.js +1369 -0
  218. package/dist/components/user-action/select/index.js.map +1 -0
  219. package/dist/components/user-action/select/index.mjs +1333 -0
  220. package/dist/components/user-action/select/index.mjs.map +1 -0
  221. package/dist/components/utils/index.d.mts +4 -0
  222. package/dist/components/utils/index.d.ts +4 -0
  223. package/dist/components/utils/index.js +302 -0
  224. package/dist/components/utils/index.js.map +1 -0
  225. package/dist/components/utils/index.mjs +275 -0
  226. package/dist/components/utils/index.mjs.map +1 -0
  227. package/dist/hooks/focus/index.d.mts +6 -0
  228. package/dist/hooks/focus/index.d.ts +6 -0
  229. package/dist/hooks/focus/index.js +379 -0
  230. package/dist/hooks/focus/index.js.map +1 -0
  231. package/dist/hooks/focus/index.mjs +339 -0
  232. package/dist/hooks/focus/index.mjs.map +1 -0
  233. package/dist/hooks/index.d.mts +16 -0
  234. package/dist/hooks/index.d.ts +16 -0
  235. package/dist/hooks/index.js +844 -0
  236. package/dist/hooks/index.js.map +1 -0
  237. package/dist/hooks/index.mjs +794 -0
  238. package/dist/hooks/index.mjs.map +1 -0
  239. package/dist/index.d.mts +110 -0
  240. package/dist/index.d.ts +110 -0
  241. package/dist/index.js +16101 -0
  242. package/dist/index.js.map +1 -0
  243. package/dist/index.mjs +15941 -0
  244. package/dist/index.mjs.map +1 -0
  245. package/dist/localization/defaults/index.d.mts +4 -0
  246. package/dist/localization/defaults/index.d.ts +4 -0
  247. package/dist/localization/defaults/index.js +223 -0
  248. package/dist/localization/defaults/index.js.map +1 -0
  249. package/dist/localization/defaults/index.mjs +195 -0
  250. package/dist/localization/defaults/index.mjs.map +1 -0
  251. package/dist/localization/index.d.mts +7 -0
  252. package/dist/localization/index.d.ts +7 -0
  253. package/dist/localization/index.js +415 -0
  254. package/dist/localization/index.js.map +1 -0
  255. package/dist/localization/index.mjs +380 -0
  256. package/dist/localization/index.mjs.map +1 -0
  257. package/dist/style/globals.css +63 -10
  258. package/dist/style/uncompiled/globals.css +5 -4
  259. package/dist/style/uncompiled/utitlity/shadow.css +4 -0
  260. package/dist/theming/index.d.mts +5 -0
  261. package/dist/theming/index.d.ts +5 -0
  262. package/dist/theming/index.js +174 -0
  263. package/dist/theming/index.js.map +1 -0
  264. package/dist/theming/index.mjs +145 -0
  265. package/dist/theming/index.mjs.map +1 -0
  266. package/dist/theming/useTheme.d.mts +3 -1
  267. package/dist/theming/useTheme.d.ts +3 -1
  268. package/dist/theming/useTheme.js +40 -17
  269. package/dist/theming/useTheme.js.map +1 -1
  270. package/dist/theming/useTheme.mjs +38 -15
  271. package/dist/theming/useTheme.mjs.map +1 -1
  272. package/dist/utils/index.d.mts +15 -0
  273. package/dist/utils/index.d.ts +15 -0
  274. package/dist/utils/index.js +553 -0
  275. package/dist/utils/index.js.map +1 -0
  276. package/dist/utils/index.mjs +493 -0
  277. package/dist/utils/index.mjs.map +1 -0
  278. package/package.json +25 -24
  279. package/dist/components/layout-and-navigation/BreadCrumb.js.map +0 -1
  280. package/dist/components/layout-and-navigation/BreadCrumb.mjs.map +0 -1
  281. package/dist/components/layout-and-navigation/Carousel.d.mts +0 -25
  282. package/dist/components/layout-and-navigation/Carousel.d.ts +0 -25
  283. package/dist/components/layout-and-navigation/Carousel.js +0 -643
  284. package/dist/components/layout-and-navigation/Carousel.js.map +0 -1
  285. package/dist/components/layout-and-navigation/Carousel.mjs +0 -609
  286. package/dist/components/layout-and-navigation/Carousel.mjs.map +0 -1
  287. package/dist/components/layout-and-navigation/Chip.js.map +0 -1
  288. package/dist/components/layout-and-navigation/Chip.mjs.map +0 -1
  289. package/dist/components/layout-and-navigation/DividerInserter.js.map +0 -1
  290. package/dist/components/layout-and-navigation/DividerInserter.mjs.map +0 -1
  291. package/dist/components/layout-and-navigation/Expandable.js.map +0 -1
  292. package/dist/components/layout-and-navigation/Expandable.mjs.map +0 -1
  293. package/dist/components/layout-and-navigation/FAQSection.js.map +0 -1
  294. package/dist/components/layout-and-navigation/FAQSection.mjs.map +0 -1
  295. package/dist/components/layout-and-navigation/FloatingContainer.js.map +0 -1
  296. package/dist/components/layout-and-navigation/FloatingContainer.mjs.map +0 -1
  297. package/dist/components/layout-and-navigation/ListBox.js.map +0 -1
  298. package/dist/components/layout-and-navigation/ListBox.mjs.map +0 -1
  299. package/dist/components/layout-and-navigation/MarkdownInterpreter.js.map +0 -1
  300. package/dist/components/layout-and-navigation/MarkdownInterpreter.mjs.map +0 -1
  301. package/dist/components/layout-and-navigation/Pagination.js.map +0 -1
  302. package/dist/components/layout-and-navigation/Pagination.mjs.map +0 -1
  303. package/dist/components/layout-and-navigation/ScrollArea.js.map +0 -1
  304. package/dist/components/layout-and-navigation/ScrollArea.mjs.map +0 -1
  305. package/dist/components/layout-and-navigation/StepperBar.js.map +0 -1
  306. package/dist/components/layout-and-navigation/StepperBar.mjs.map +0 -1
  307. package/dist/components/layout-and-navigation/TextImage.js.map +0 -1
  308. package/dist/components/layout-and-navigation/TextImage.mjs.map +0 -1
  309. package/dist/components/layout-and-navigation/VerticalDivider.js.map +0 -1
  310. package/dist/components/layout-and-navigation/VerticalDivider.mjs.map +0 -1
  311. /package/dist/components/{layout-and-navigation → layout}/Chip.d.mts +0 -0
  312. /package/dist/components/{layout-and-navigation → layout}/Chip.d.ts +0 -0
  313. /package/dist/components/{layout-and-navigation → layout}/DividerInserter.d.mts +0 -0
  314. /package/dist/components/{layout-and-navigation → layout}/DividerInserter.d.ts +0 -0
  315. /package/dist/components/{layout-and-navigation → layout}/Expandable.d.mts +0 -0
  316. /package/dist/components/{layout-and-navigation → layout}/Expandable.d.ts +0 -0
  317. /package/dist/components/{layout-and-navigation → layout}/FAQSection.d.mts +0 -0
  318. /package/dist/components/{layout-and-navigation → layout}/FAQSection.d.ts +0 -0
  319. /package/dist/components/{layout-and-navigation → layout}/FloatingContainer.d.mts +0 -0
  320. /package/dist/components/{layout-and-navigation → layout}/FloatingContainer.d.ts +0 -0
  321. /package/dist/components/{layout-and-navigation → layout}/ListBox.d.mts +0 -0
  322. /package/dist/components/{layout-and-navigation → layout}/ListBox.d.ts +0 -0
  323. /package/dist/components/{layout-and-navigation → layout}/MarkdownInterpreter.d.mts +0 -0
  324. /package/dist/components/{layout-and-navigation → layout}/MarkdownInterpreter.d.ts +0 -0
  325. /package/dist/components/{layout-and-navigation → layout}/ScrollArea.d.mts +0 -0
  326. /package/dist/components/{layout-and-navigation → layout}/ScrollArea.d.ts +0 -0
  327. /package/dist/components/{layout-and-navigation → layout}/TextImage.d.mts +0 -0
  328. /package/dist/components/{layout-and-navigation → layout}/TextImage.d.ts +0 -0
  329. /package/dist/components/{layout-and-navigation → layout}/VerticalDivider.d.mts +0 -0
  330. /package/dist/components/{layout-and-navigation → layout}/VerticalDivider.d.ts +0 -0
  331. /package/dist/components/{layout-and-navigation → navigation}/BreadCrumb.d.mts +0 -0
  332. /package/dist/components/{layout-and-navigation → navigation}/BreadCrumb.d.ts +0 -0
  333. /package/dist/components/{layout-and-navigation → navigation}/Pagination.d.mts +0 -0
  334. /package/dist/components/{layout-and-navigation → navigation}/Pagination.d.ts +0 -0
  335. /package/dist/components/{layout-and-navigation → navigation}/StepperBar.d.mts +0 -0
  336. /package/dist/components/{layout-and-navigation → navigation}/StepperBar.d.ts +0 -0
@@ -0,0 +1,3111 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/components/layout/index.ts
30
+ var layout_exports = {};
31
+ __export(layout_exports, {
32
+ ASTNodeInterpreter: () => ASTNodeInterpreter,
33
+ Carousel: () => Carousel,
34
+ CarouselSlide: () => CarouselSlide,
35
+ Chip: () => Chip,
36
+ ChipList: () => ChipList,
37
+ ChipUtil: () => ChipUtil,
38
+ DividerInserter: () => DividerInserter,
39
+ Expandable: () => Expandable,
40
+ ExpandableUncontrolled: () => ExpandableUncontrolled,
41
+ ExpansionIcon: () => ExpansionIcon,
42
+ FAQSection: () => FAQSection,
43
+ FloatingContainer: () => FloatingContainer,
44
+ ListBox: () => ListBox,
45
+ ListBoxItem: () => ListBoxItem,
46
+ ListBoxMultiple: () => ListBoxMultiple,
47
+ ListBoxMultipleUncontrolled: () => ListBoxMultipleUncontrolled,
48
+ ListBoxPrimitive: () => ListBoxPrimitive,
49
+ ListBoxUncontrolled: () => ListBoxUncontrolled,
50
+ MarkdownInterpreter: () => MarkdownInterpreter,
51
+ ScrollArea: () => ScrollArea2,
52
+ TextImage: () => TextImage,
53
+ VerticalDivider: () => VerticalDivider
54
+ });
55
+ module.exports = __toCommonJS(layout_exports);
56
+
57
+ // src/components/layout/Carousel.tsx
58
+ var import_react4 = require("react");
59
+ var import_clsx2 = __toESM(require("clsx"));
60
+ var import_lucide_react = require("lucide-react");
61
+
62
+ // src/utils/array.ts
63
+ var defaultRangeOptions = {
64
+ allowEmptyRange: false,
65
+ stepSize: 1,
66
+ exclusiveStart: false,
67
+ exclusiveEnd: true
68
+ };
69
+ var range = (endOrRange, options) => {
70
+ const { allowEmptyRange, stepSize, exclusiveStart, exclusiveEnd } = { ...defaultRangeOptions, ...options };
71
+ let start = 0;
72
+ let end;
73
+ if (typeof endOrRange === "number") {
74
+ end = endOrRange;
75
+ } else {
76
+ start = endOrRange[0];
77
+ end = endOrRange[1];
78
+ }
79
+ if (!exclusiveEnd) {
80
+ end -= 1;
81
+ }
82
+ if (exclusiveStart) {
83
+ start += 1;
84
+ }
85
+ if (end - 1 < start) {
86
+ if (!allowEmptyRange) {
87
+ console.warn(`range: end (${end}) < start (${start}) should be allowed explicitly, set options.allowEmptyRange to true`);
88
+ }
89
+ return [];
90
+ }
91
+ return Array.from({ length: end - start }, (_, index) => index * stepSize + start);
92
+ };
93
+ var createLoopingListWithIndex = (list, startIndex = 0, length = 0, forwards = true) => {
94
+ if (length < 0) {
95
+ console.warn(`createLoopingList: length must be >= 0, given ${length}`);
96
+ } else if (length === 0) {
97
+ length = list.length;
98
+ }
99
+ const returnList = [];
100
+ if (forwards) {
101
+ for (let i = startIndex; returnList.length < length; i = (i + 1) % list.length) {
102
+ returnList.push([i, list[i]]);
103
+ }
104
+ } else {
105
+ for (let i = startIndex; returnList.length < length; i = i === 0 ? i = list.length - 1 : i - 1) {
106
+ returnList.push([i, list[i]]);
107
+ }
108
+ }
109
+ return returnList;
110
+ };
111
+
112
+ // src/components/user-action/Button.tsx
113
+ var import_react = require("react");
114
+ var import_clsx = __toESM(require("clsx"));
115
+ var import_jsx_runtime = require("react/jsx-runtime");
116
+ var ButtonColorUtil = {
117
+ solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
118
+ text: ["primary", "negative", "neutral"],
119
+ outline: ["primary"]
120
+ };
121
+ var IconButtonUtil = {
122
+ icon: [...ButtonColorUtil.solid, "transparent"]
123
+ };
124
+ var paddingMapping = {
125
+ small: "btn-sm",
126
+ medium: "btn-md",
127
+ large: "btn-lg"
128
+ };
129
+ var iconPaddingMapping = {
130
+ tiny: "icon-btn-xs",
131
+ small: "icon-btn-sm",
132
+ medium: "icon-btn-md",
133
+ large: "icon-btn-lg"
134
+ };
135
+ var ButtonUtil = {
136
+ paddingMapping,
137
+ iconPaddingMapping
138
+ };
139
+ var SolidButton = (0, import_react.forwardRef)(function SolidButton2({
140
+ children,
141
+ color = "primary",
142
+ size = "medium",
143
+ startIcon,
144
+ endIcon,
145
+ onClick,
146
+ className,
147
+ ...restProps
148
+ }, ref) {
149
+ const colorClasses = {
150
+ primary: "not-disabled:bg-button-solid-primary-background not-disabled:text-button-solid-primary-text",
151
+ secondary: "not-disabled:bg-button-solid-secondary-background not-disabled:text-button-solid-secondary-text",
152
+ tertiary: "not-disabled:bg-button-solid-tertiary-background not-disabled:text-button-solid-tertiary-text",
153
+ positive: "not-disabled:bg-button-solid-positive-background not-disabled:text-button-solid-positive-text",
154
+ warning: "not-disabled:bg-button-solid-warning-background not-disabled:text-button-solid-warning-text",
155
+ negative: "not-disabled:bg-button-solid-negative-background not-disabled:text-button-solid-negative-text",
156
+ neutral: "not-disabled:bg-button-solid-neutral-background not-disabled:text-button-solid-neutral-text"
157
+ }[color];
158
+ const iconColorClasses = {
159
+ primary: "not-group-disabled:text-button-solid-primary-icon",
160
+ secondary: "not-group-disabled:text-button-solid-secondary-icon",
161
+ tertiary: "not-group-disabled:text-button-solid-tertiary-icon",
162
+ positive: "not-group-disabled:text-button-solid-positive-icon",
163
+ warning: "not-group-disabled:text-button-solid-warning-icon",
164
+ negative: "not-group-disabled:text-button-solid-negative-icon",
165
+ neutral: "not-group-disabled:text-button-solid-neutral-icon"
166
+ }[color];
167
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
168
+ "button",
169
+ {
170
+ ref,
171
+ onClick,
172
+ className: (0, import_clsx.default)(
173
+ "group font-semibold",
174
+ colorClasses,
175
+ "not-disabled:hover:brightness-90",
176
+ "disabled:text-disabled-text disabled:bg-disabled-background",
177
+ ButtonUtil.paddingMapping[size],
178
+ className
179
+ ),
180
+ ...restProps,
181
+ children: [
182
+ startIcon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
183
+ "span",
184
+ {
185
+ className: (0, import_clsx.default)(
186
+ iconColorClasses,
187
+ "group-disabled:text-disabled-icon"
188
+ ),
189
+ children: startIcon
190
+ }
191
+ ),
192
+ children,
193
+ endIcon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
194
+ "span",
195
+ {
196
+ className: (0, import_clsx.default)(
197
+ iconColorClasses,
198
+ "group-disabled:text-disabled-icon"
199
+ ),
200
+ children: endIcon
201
+ }
202
+ )
203
+ ]
204
+ }
205
+ );
206
+ });
207
+ var IconButton = (0, import_react.forwardRef)(function IconButton2({
208
+ children,
209
+ color = "primary",
210
+ size = "medium",
211
+ className,
212
+ ...restProps
213
+ }, ref) {
214
+ const colorClasses = {
215
+ primary: "not-disabled:bg-button-solid-primary-background not-disabled:text-button-solid-primary-text",
216
+ secondary: "not-disabled:bg-button-solid-secondary-background not-disabled:text-button-solid-secondary-text",
217
+ tertiary: "not-disabled:bg-button-solid-tertiary-background not-disabled:text-button-solid-tertiary-text",
218
+ positive: "not-disabled:bg-button-solid-positive-background not-disabled:text-button-solid-positive-text",
219
+ warning: "not-disabled:bg-button-solid-warning-background not-disabled:text-button-solid-warning-text",
220
+ negative: "not-disabled:bg-button-solid-negative-background not-disabled:text-button-solid-negative-text",
221
+ neutral: "not-disabled:bg-button-solid-neutral-background not-disabled:text-button-solid-neutral-text",
222
+ transparent: "not-disabled:bg-transparent"
223
+ }[color];
224
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
225
+ "button",
226
+ {
227
+ ref,
228
+ className: (0, import_clsx.default)(
229
+ colorClasses,
230
+ "not-disabled:hover:brightness-90",
231
+ "disabled:text-disabled-text",
232
+ {
233
+ "disabled:bg-disabled-background": color !== "transparent",
234
+ "disabled:opacity-70": color === "transparent",
235
+ "not-disabled:hover:bg-button-text-hover-background": color === "transparent"
236
+ },
237
+ ButtonUtil.iconPaddingMapping[size],
238
+ className
239
+ ),
240
+ ...restProps,
241
+ children
242
+ }
243
+ );
244
+ });
245
+
246
+ // src/localization/LanguageProvider.tsx
247
+ var import_react3 = require("react");
248
+
249
+ // src/hooks/useLocalStorage.ts
250
+ var import_react2 = require("react");
251
+
252
+ // src/localization/util.ts
253
+ var languages = ["en", "de"];
254
+ var languagesLocalNames = {
255
+ en: "English",
256
+ de: "Deutsch"
257
+ };
258
+ var DEFAULT_LANGUAGE = "en";
259
+ var LanguageUtil = {
260
+ languages,
261
+ DEFAULT_LANGUAGE,
262
+ languagesLocalNames
263
+ };
264
+
265
+ // src/localization/LanguageProvider.tsx
266
+ var import_jsx_runtime2 = require("react/jsx-runtime");
267
+ var LanguageContext = (0, import_react3.createContext)({
268
+ language: LanguageUtil.DEFAULT_LANGUAGE,
269
+ setLanguage: (v) => v
270
+ });
271
+ var useLanguage = () => (0, import_react3.useContext)(LanguageContext);
272
+
273
+ // src/localization/useTranslation.ts
274
+ var TranslationPluralCount = {
275
+ zero: 0,
276
+ one: 1,
277
+ two: 2,
278
+ few: 3,
279
+ many: 11,
280
+ other: -1
281
+ };
282
+ var useTranslation = (translations, overwriteTranslation = {}) => {
283
+ const { language: languageProp, translation: overwrite } = overwriteTranslation;
284
+ const { language: inferredLanguage } = useLanguage();
285
+ const usedLanguage = languageProp ?? inferredLanguage;
286
+ const usedTranslations = [...translations];
287
+ if (overwrite) {
288
+ usedTranslations.push(overwrite);
289
+ }
290
+ return (key, options) => {
291
+ const { count, replacements } = { ...{ count: 0, replacements: {} }, ...options };
292
+ try {
293
+ for (let i = translations.length - 1; i >= 0; i--) {
294
+ const translation = translations[i];
295
+ const localizedTranslation = translation[usedLanguage];
296
+ if (!localizedTranslation) {
297
+ continue;
298
+ }
299
+ const value = localizedTranslation[key];
300
+ if (!value) {
301
+ continue;
302
+ }
303
+ let forProcessing;
304
+ if (typeof value !== "string") {
305
+ if (count === TranslationPluralCount.zero && value?.zero) {
306
+ forProcessing = value.zero;
307
+ } else if (count === TranslationPluralCount.one && value?.one) {
308
+ forProcessing = value.one;
309
+ } else if (count === TranslationPluralCount.two && value?.two) {
310
+ forProcessing = value.two;
311
+ } else if (TranslationPluralCount.few <= count && count < TranslationPluralCount.many && value?.few) {
312
+ forProcessing = value.few;
313
+ } else if (count > TranslationPluralCount.many && value?.many) {
314
+ forProcessing = value.many;
315
+ } else {
316
+ forProcessing = value.other;
317
+ }
318
+ } else {
319
+ forProcessing = value;
320
+ }
321
+ forProcessing = forProcessing.replace(/\{\{(\w+)}}/g, (_, placeholder) => {
322
+ return replacements[placeholder] ?? `{{key:${placeholder}}}`;
323
+ });
324
+ return forProcessing;
325
+ }
326
+ } catch (e) {
327
+ console.error(e);
328
+ }
329
+ return `{{${usedLanguage}:${key}}}`;
330
+ };
331
+ };
332
+
333
+ // src/components/layout/Carousel.tsx
334
+ var import_jsx_runtime3 = require("react/jsx-runtime");
335
+ var CarouselContext = (0, import_react4.createContext)(null);
336
+ var useCarouselContext = () => {
337
+ const context = (0, import_react4.useContext)(CarouselContext);
338
+ if (!context) {
339
+ console.error("useCarouselContext must be used within CarouselContext");
340
+ }
341
+ return context;
342
+ };
343
+ var defaultCarouselTabTranslationType = {
344
+ en: {
345
+ showSlide: `Show Slide {{index}}`,
346
+ slideNavigation: "Slide navigation"
347
+ },
348
+ de: {
349
+ showSlide: "Zeige Slide {{index}}",
350
+ slideNavigation: "Slide Navigation"
351
+ }
352
+ };
353
+ function CarouselTabs({
354
+ onChange
355
+ }) {
356
+ const translation = useTranslation([
357
+ defaultCarouselTabTranslationType
358
+ ]);
359
+ const { id, slideCount, currentIndex, isLooping } = useCarouselContext();
360
+ const tabRefs = (0, import_react4.useRef)([]);
361
+ const handleKeyDown = (event, index) => {
362
+ let newIndex = index;
363
+ if (event.key === "ArrowRight") {
364
+ newIndex = isLooping ? (index + 1) % slideCount : Math.max(index + 1, slideCount - 1);
365
+ } else if (event.key === "ArrowLeft") {
366
+ newIndex = isLooping ? (index - 1 + slideCount) % slideCount : Math.max(index - 1, 0);
367
+ } else {
368
+ return;
369
+ }
370
+ event.preventDefault();
371
+ onChange(newIndex);
372
+ tabRefs.current[newIndex]?.focus();
373
+ };
374
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
375
+ "div",
376
+ {
377
+ className: "flex-row-1 items-center justify-center w-full my-2",
378
+ role: "tablist",
379
+ "aria-label": translation("slideNavigation"),
380
+ id: `${id}-tablist`,
381
+ children: range(slideCount).map((index) => {
382
+ const isSelected = currentIndex === index;
383
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
384
+ "button",
385
+ {
386
+ id: `${id}-tab-${index}`,
387
+ ref: (el) => tabRefs.current[index] = el,
388
+ onClick: () => onChange(index),
389
+ onKeyDown: (e) => handleKeyDown(e, index),
390
+ className: (0, import_clsx2.default)(
391
+ "w-8 min-w-8 h-3 min-h-3 first:rounded-l-md last:rounded-r-md",
392
+ {
393
+ "bg-carousel-dot-disabled hover:bg-carousel-dot-active": currentIndex !== index,
394
+ "bg-carousel-dot-active hover:brightness-90": currentIndex === index
395
+ }
396
+ ),
397
+ role: "tab",
398
+ tabIndex: isSelected ? 0 : -1,
399
+ "aria-label": translation("showSlide", { replacements: { index: (index + 1).toString() } }),
400
+ "aria-selected": isSelected,
401
+ "aria-controls": `slide-${index}`,
402
+ "aria-disabled": isSelected
403
+ },
404
+ index
405
+ );
406
+ })
407
+ }
408
+ );
409
+ }
410
+ var defaultCarouselSlideTranslationType = {
411
+ en: {
412
+ slide: "Slide",
413
+ slideOf: `Slide {{index}} of {{length}} slides`
414
+ },
415
+ de: {
416
+ slide: "Slide",
417
+ slideOf: `Slide {{index}} von {{length}} slides`
418
+ }
419
+ };
420
+ var CarouselSlide = (0, import_react4.forwardRef)(
421
+ function CarouselSlide2({
422
+ index,
423
+ ...props
424
+ }, ref) {
425
+ const translation = useTranslation([defaultCarouselSlideTranslationType]);
426
+ const { id, currentIndex, slideCount } = useCarouselContext();
427
+ const isSelected = currentIndex === index;
428
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
429
+ "div",
430
+ {
431
+ ...props,
432
+ ref,
433
+ id: `${id}-slide-${index}`,
434
+ className: (0, import_clsx2.default)("focus-style-none group/slide", props.className),
435
+ tabIndex: isSelected ? 0 : void 0,
436
+ role: "group",
437
+ "aria-roledescription": translation("slide"),
438
+ "aria-label": translation("slideOf", {
439
+ replacements: {
440
+ index: (index + 1).toString(),
441
+ length: slideCount.toString()
442
+ }
443
+ }),
444
+ "aria-hidden": isSelected ? void 0 : true
445
+ }
446
+ );
447
+ }
448
+ );
449
+ var defaultCarouselTranslationType = {
450
+ en: {
451
+ slide: "Slide",
452
+ carousel: "Carousel",
453
+ slideOf: `Slide {{index}} of {{length}} slides`,
454
+ chooseSlide: "Choose slide to display"
455
+ },
456
+ de: {
457
+ slide: "Slide",
458
+ carousel: "Karussell",
459
+ slideOf: `Slide {{index}} von {{length}} slides`,
460
+ chooseSlide: "W\xE4hle die angezeigte Slide aus"
461
+ }
462
+ };
463
+ var Carousel = ({
464
+ children,
465
+ animationTime = 200,
466
+ isLooping = false,
467
+ isAutoPlaying = false,
468
+ autoLoopingTimeOut = 5e3,
469
+ autoLoopAnimationTime = 1e3,
470
+ hintNext = false,
471
+ arrows = false,
472
+ dots = true,
473
+ blurColor = "from-background",
474
+ heightClassName = "h-96",
475
+ widthClassName = "w-[70%] desktop:w-1/2",
476
+ slideContainerProps,
477
+ ...props
478
+ }) => {
479
+ const translation = useTranslation([defaultCarouselTranslationType]);
480
+ const slideRefs = (0, import_react4.useRef)([]);
481
+ const [currentIndex, setCurrentIndex] = (0, import_react4.useState)(0);
482
+ const [hasFocus, setHasFocus] = (0, import_react4.useState)(false);
483
+ const [dragState, setDragState] = (0, import_react4.useState)();
484
+ const isPaused = hasFocus;
485
+ const carouselContainerRef = (0, import_react4.useRef)(null);
486
+ const [disableClick, setDisableClick] = (0, import_react4.useState)(false);
487
+ const timeOut = (0, import_react4.useRef)(void 0);
488
+ const length = (0, import_react4.useMemo)(() => children.length, [children]);
489
+ const paddingItemCount = 3;
490
+ const generatedId = "carousel" + (0, import_react4.useId)();
491
+ const id = props.id ?? generatedId;
492
+ if (isAutoPlaying && !isLooping) {
493
+ console.error("When isAutoLooping is true, isLooping should also be true");
494
+ isLooping = true;
495
+ }
496
+ autoLoopingTimeOut = Math.max(0, autoLoopingTimeOut);
497
+ animationTime = Math.max(100, animationTime);
498
+ autoLoopAnimationTime = Math.max(200, autoLoopAnimationTime);
499
+ (0, import_react4.useEffect)(() => {
500
+ const carousel = carouselContainerRef.current;
501
+ if (carousel) {
502
+ let onFocus = function() {
503
+ setHasFocus(true);
504
+ }, onBlur = function() {
505
+ setHasFocus(false);
506
+ };
507
+ carousel?.addEventListener("focusin", onFocus);
508
+ carousel?.addEventListener("focusout", onBlur);
509
+ return () => {
510
+ carousel?.removeEventListener("focusin", onFocus);
511
+ carousel?.removeEventListener("focusin", onFocus);
512
+ };
513
+ }
514
+ }, []);
515
+ const getStyleOffset = (index) => {
516
+ const baseOffset = -50 + (index - currentIndex) * 100;
517
+ return `${baseOffset}%`;
518
+ };
519
+ const canGoLeft = () => {
520
+ return isLooping || currentIndex !== 0;
521
+ };
522
+ const canGoRight = (0, import_react4.useCallback)(() => {
523
+ return isLooping || currentIndex !== length - 1;
524
+ }, [currentIndex, isLooping, length]);
525
+ const left = () => {
526
+ if (canGoLeft()) {
527
+ setCurrentIndex(currentIndex - 1);
528
+ }
529
+ };
530
+ const right = (0, import_react4.useCallback)(() => {
531
+ if (canGoRight()) {
532
+ setCurrentIndex((currentIndex + length + 1) % length);
533
+ }
534
+ }, [canGoRight, currentIndex, length]);
535
+ (0, import_react4.useEffect)(() => {
536
+ if (!timeOut.current && !isPaused) {
537
+ if (autoLoopingTimeOut > 0) {
538
+ timeOut.current = setTimeout(() => {
539
+ right();
540
+ timeOut.current = void 0;
541
+ }, autoLoopingTimeOut);
542
+ } else {
543
+ right();
544
+ }
545
+ }
546
+ if ((isPaused || !!dragState) && timeOut.current) {
547
+ clearTimeout(timeOut.current);
548
+ timeOut.current = void 0;
549
+ }
550
+ }, [right, isPaused, autoLoopingTimeOut, dragState]);
551
+ let items = children.map((item, index) => ({
552
+ index,
553
+ item
554
+ }));
555
+ let before = [];
556
+ let after = [];
557
+ if (isLooping) {
558
+ before = createLoopingListWithIndex(children, length - 1, paddingItemCount, false).reverse().map(([index, item]) => ({
559
+ index,
560
+ item
561
+ }));
562
+ after = createLoopingListWithIndex(children, 0, paddingItemCount).map(([index, item]) => ({
563
+ index,
564
+ item
565
+ }));
566
+ items = [...before, ...items, ...after];
567
+ }
568
+ const handlePointerDown = (e) => {
569
+ setDragState({
570
+ dragOffsetX: 0,
571
+ dragStartX: e.clientX
572
+ });
573
+ };
574
+ const handlePointerMove = (e) => {
575
+ if (!dragState) return;
576
+ setDragState((prevState) => ({ dragStartX: prevState.dragStartX, dragOffsetX: e.clientX - prevState.dragStartX }));
577
+ };
578
+ const handlePointerUp = () => {
579
+ if (!dragState) return;
580
+ if (dragState.dragOffsetX > 50) {
581
+ left();
582
+ } else if (dragState.dragOffsetX < -50) {
583
+ right();
584
+ }
585
+ setDragState(void 0);
586
+ };
587
+ (0, import_react4.useEffect)(() => {
588
+ setDisableClick(!dragState);
589
+ }, [dragState]);
590
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(CarouselContext.Provider, { value: { id, currentIndex, slideCount: length, isLooping }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
591
+ "div",
592
+ {
593
+ ref: carouselContainerRef,
594
+ ...props,
595
+ className: (0, import_clsx2.default)("flex-col-2 items-center w-full", props.className),
596
+ id,
597
+ role: "region",
598
+ "aria-roledescription": translation("slide"),
599
+ children: [
600
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
601
+ "div",
602
+ {
603
+ ...slideContainerProps,
604
+ className: (0, import_clsx2.default)(`relative w-full overflow-hidden`, heightClassName, slideContainerProps?.className),
605
+ children: [
606
+ hintNext ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
607
+ "div",
608
+ {
609
+ onPointerDown: handlePointerDown,
610
+ onPointerMove: handlePointerMove,
611
+ onPointerUp: handlePointerUp,
612
+ onPointerLeave: handlePointerUp,
613
+ className: (0, import_clsx2.default)(`flex-row-2 relative h-full`, heightClassName),
614
+ children: [
615
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "flex-row-2 relative h-full w-full px-2 overflow-hidden", children: items.map(({
616
+ item,
617
+ index
618
+ }, listIndex) => {
619
+ const isInItems = before.length <= listIndex && listIndex < items.length - after.length;
620
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
621
+ CarouselSlide,
622
+ {
623
+ ref: isInItems ? slideRefs[index] : void 0,
624
+ index,
625
+ className: (0, import_clsx2.default)(
626
+ `absolute left-[50%] h-full overflow-hidden transition-transform ease-in-out`,
627
+ widthClassName
628
+ ),
629
+ onClick: () => !disableClick && setCurrentIndex(index),
630
+ style: {
631
+ translate: `calc(${getStyleOffset(listIndex - (isLooping ? paddingItemCount : 0))} + ${dragState ? dragState.dragOffsetX : 0}px)`,
632
+ transitionDuration: dragState ? "0ms" : (isAutoPlaying && !isPaused ? autoLoopAnimationTime : animationTime) + "ms"
633
+ },
634
+ children: item
635
+ },
636
+ listIndex
637
+ );
638
+ }) }),
639
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
640
+ "div",
641
+ {
642
+ className: (0, import_clsx2.default)(`hidden desktop:block pointer-events-none absolute left-0 h-full w-[20%] bg-gradient-to-r to-transparent`, blurColor)
643
+ }
644
+ ),
645
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
646
+ "div",
647
+ {
648
+ className: (0, import_clsx2.default)(`hidden desktop:block pointer-events-none absolute right-0 h-full w-[20%] bg-gradient-to-l to-transparent`, blurColor)
649
+ }
650
+ )
651
+ ]
652
+ }
653
+ ) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
654
+ "div",
655
+ {
656
+ ref: slideRefs[currentIndex],
657
+ className: (0, import_clsx2.default)("px-16 h-full"),
658
+ tabIndex: 0,
659
+ role: "group",
660
+ "aria-roledescription": translation("slide"),
661
+ "aria-label": translation("slideOf", {
662
+ replacements: {
663
+ index: (currentIndex + 1).toString(),
664
+ length: items.length.toString()
665
+ }
666
+ }),
667
+ children: children[currentIndex]
668
+ }
669
+ ),
670
+ arrows && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
671
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
672
+ IconButton,
673
+ {
674
+ color: "neutral",
675
+ className: (0, import_clsx2.default)("absolute z-10 left-2 top-1/2 -translate-y-1/2 shadow-md", { hidden: !canGoLeft() }),
676
+ disabled: !canGoLeft(),
677
+ onClick: () => left(),
678
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.ChevronLeft, { size: 24 })
679
+ }
680
+ ),
681
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
682
+ IconButton,
683
+ {
684
+ color: "neutral",
685
+ className: (0, import_clsx2.default)("absolute z-10 right-2 top-1/2 -translate-y-1/2 shadow-md", { hidden: !canGoRight() }),
686
+ disabled: !canGoRight(),
687
+ onClick: () => right(),
688
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.ChevronRight, { size: 24 })
689
+ }
690
+ )
691
+ ] })
692
+ ]
693
+ }
694
+ ),
695
+ dots && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(CarouselTabs, { onChange: setCurrentIndex })
696
+ ]
697
+ }
698
+ ) });
699
+ };
700
+
701
+ // src/components/layout/Chip.tsx
702
+ var import_clsx3 = __toESM(require("clsx"));
703
+ var import_jsx_runtime4 = require("react/jsx-runtime");
704
+ var chipColors = ["default", "dark", "red", "yellow", "green", "blue", "pink", "orange"];
705
+ var ChipUtil = {
706
+ colors: chipColors
707
+ };
708
+ var Chip = ({
709
+ children,
710
+ trailingIcon,
711
+ color = "default",
712
+ size = "md",
713
+ icon = false,
714
+ variant = "normal",
715
+ className = "",
716
+ ...restProps
717
+ }) => {
718
+ const colorMapping = {
719
+ default: "text-tag-default-text bg-tag-default-background",
720
+ dark: "text-tag-dark-text bg-tag-dark-background",
721
+ red: "text-tag-red-text bg-tag-red-background",
722
+ yellow: "text-tag-yellow-text bg-tag-yellow-background",
723
+ green: "text-tag-green-text bg-tag-green-background",
724
+ blue: "text-tag-blue-text bg-tag-blue-background",
725
+ pink: "text-tag-pink-text bg-tag-pink-background",
726
+ orange: "text-tag-orange-text bg-tag-orange-background"
727
+ }[color];
728
+ const colorMappingIcon = {
729
+ default: "text-tag-default-icon",
730
+ dark: "text-tag-dark-icon",
731
+ red: "text-tag-red-icon",
732
+ yellow: "text-tag-yellow-icon",
733
+ green: "text-tag-green-icon",
734
+ blue: "text-tag-blue-icon",
735
+ pink: "text-tag-pink-icon",
736
+ orange: "text-tag-orange-icon"
737
+ }[color];
738
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
739
+ "div",
740
+ {
741
+ ...restProps,
742
+ className: (0, import_clsx3.default)(
743
+ `flex-row-0 w-fit font-semibold`,
744
+ colorMapping,
745
+ !icon ? {
746
+ "px-1 py-0.5": size === "sm",
747
+ "px-2 py-1": size === "md",
748
+ "px-4 py-2": size === "lg"
749
+ } : {
750
+ "p-0.5": size === "sm",
751
+ "p-1": size === "md",
752
+ "p-2": size === "lg"
753
+ },
754
+ {
755
+ "rounded-md": variant === "normal",
756
+ "rounded-full": variant === "fullyRounded"
757
+ },
758
+ className
759
+ ),
760
+ children: [
761
+ children,
762
+ trailingIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: colorMappingIcon, children: trailingIcon })
763
+ ]
764
+ }
765
+ );
766
+ };
767
+ var ChipList = ({
768
+ list,
769
+ className = ""
770
+ }) => {
771
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: (0, import_clsx3.default)("flex flex-wrap gap-x-2 gap-y-2", className), children: list.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
772
+ Chip,
773
+ {
774
+ ...value,
775
+ color: value.color ?? "default",
776
+ variant: value.variant ?? "normal",
777
+ children: value.children
778
+ },
779
+ index
780
+ )) });
781
+ };
782
+
783
+ // src/components/layout/DividerInserter.tsx
784
+ var import_clsx4 = __toESM(require("clsx"));
785
+ var import_jsx_runtime5 = require("react/jsx-runtime");
786
+ var DividerInserter = ({
787
+ children,
788
+ divider,
789
+ className,
790
+ ...restProps
791
+ }) => {
792
+ const nodes = [];
793
+ for (let index = 0; index < children.length; index++) {
794
+ const element = children[index];
795
+ if (element !== void 0) {
796
+ nodes.push(element);
797
+ if (index < children.length - 1) {
798
+ nodes.push(divider(index));
799
+ }
800
+ }
801
+ }
802
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: (0, import_clsx4.default)(className), ...restProps, children: nodes });
803
+ };
804
+
805
+ // src/components/layout/Expandable.tsx
806
+ var import_react5 = require("react");
807
+ var import_lucide_react2 = require("lucide-react");
808
+ var import_clsx5 = __toESM(require("clsx"));
809
+
810
+ // src/utils/noop.ts
811
+ var noop = () => void 0;
812
+
813
+ // src/components/layout/Expandable.tsx
814
+ var import_jsx_runtime6 = require("react/jsx-runtime");
815
+ var ExpansionIcon = ({ isExpanded, className }) => {
816
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
817
+ import_lucide_react2.ChevronDown,
818
+ {
819
+ "aria-hidden": true,
820
+ className: (0, import_clsx5.default)(
821
+ "min-w-6 w-6 min-h-6 h-6 transition-transform motion-safe:duration-200 motion-reduce:duration-0 ease-in-out",
822
+ { "rotate-180": isExpanded },
823
+ className
824
+ )
825
+ }
826
+ );
827
+ };
828
+ var Expandable = (0, import_react5.forwardRef)(function Expandable2({
829
+ children,
830
+ id: providedId,
831
+ label,
832
+ icon,
833
+ isExpanded = false,
834
+ onChange = noop,
835
+ clickOnlyOnHeader = true,
836
+ disabled = false,
837
+ className,
838
+ headerClassName,
839
+ contentClassName,
840
+ contentExpandedClassName
841
+ }, ref) {
842
+ const defaultIcon = (0, import_react5.useCallback)((expanded) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ExpansionIcon, { isExpanded: expanded }), []);
843
+ icon ??= defaultIcon;
844
+ const generatedId = (0, import_react5.useId)();
845
+ const id = providedId ?? generatedId;
846
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
847
+ "div",
848
+ {
849
+ ref,
850
+ onClick: () => !clickOnlyOnHeader && !disabled && onChange(!isExpanded),
851
+ className: (0, import_clsx5.default)(
852
+ "flex-col-0 bg-surface text-on-surface group rounded-lg shadow-sm",
853
+ { "cursor-pointer": !clickOnlyOnHeader && !disabled },
854
+ className
855
+ ),
856
+ children: [
857
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
858
+ "button",
859
+ {
860
+ onClick: () => clickOnlyOnHeader && !disabled && onChange(!isExpanded),
861
+ className: (0, import_clsx5.default)(
862
+ "flex-row-2 py-2 px-4 rounded-lg justify-between items-center bg-surface text-on-surface select-none",
863
+ {
864
+ "group-hover:brightness-97": !isExpanded,
865
+ "hover:brightness-97": isExpanded && !disabled,
866
+ "cursor-pointer": clickOnlyOnHeader && !disabled
867
+ },
868
+ headerClassName
869
+ ),
870
+ "aria-expanded": isExpanded,
871
+ "aria-controls": `${id}-content`,
872
+ "aria-disabled": disabled ?? void 0,
873
+ children: [
874
+ label,
875
+ icon(isExpanded)
876
+ ]
877
+ }
878
+ ),
879
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
880
+ "div",
881
+ {
882
+ id: `${id}-content`,
883
+ className: (0, import_clsx5.default)(
884
+ "flex-col-2 px-4 transition-all duration-300 ease-in-out",
885
+ {
886
+ [(0, import_clsx5.default)("max-h-96 opacity-100 pb-2 overflow-y-auto", contentExpandedClassName)]: isExpanded,
887
+ "max-h-0 opacity-0 overflow-hidden": !isExpanded
888
+ },
889
+ contentClassName
890
+ ),
891
+ role: "region",
892
+ children
893
+ }
894
+ )
895
+ ]
896
+ }
897
+ );
898
+ });
899
+ var ExpandableUncontrolled = (0, import_react5.forwardRef)(function ExpandableUncontrolled2({
900
+ isExpanded,
901
+ onChange = noop,
902
+ ...props
903
+ }, ref) {
904
+ const [usedIsExpanded, setUsedIsExpanded] = (0, import_react5.useState)(isExpanded);
905
+ (0, import_react5.useEffect)(() => {
906
+ setUsedIsExpanded(isExpanded);
907
+ }, [isExpanded]);
908
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
909
+ Expandable,
910
+ {
911
+ ...props,
912
+ ref,
913
+ isExpanded: usedIsExpanded,
914
+ onChange: (value) => {
915
+ onChange(value);
916
+ setUsedIsExpanded(value);
917
+ }
918
+ }
919
+ );
920
+ });
921
+
922
+ // src/components/layout/FAQSection.tsx
923
+ var import_clsx6 = __toESM(require("clsx"));
924
+
925
+ // src/components/layout/MarkdownInterpreter.tsx
926
+ var import_jsx_runtime7 = require("react/jsx-runtime");
927
+ var astNodeInserterType = ["helpwave", "newline"];
928
+ var ASTNodeInterpreter = ({
929
+ node,
930
+ isRoot = false,
931
+ className = ""
932
+ }) => {
933
+ switch (node.type) {
934
+ case "newline":
935
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("br", {});
936
+ case "text":
937
+ return isRoot ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className, children: node.text }) : node.text;
938
+ case "helpwave":
939
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "font-bold font-space no-underline", children: "helpwave" });
940
+ case "none":
941
+ return isRoot ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className, children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
942
+ ASTNodeInterpreter,
943
+ {
944
+ node: value
945
+ },
946
+ index
947
+ )) }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ASTNodeInterpreter, { node: value }, index)) });
948
+ case "bold":
949
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("b", { children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ASTNodeInterpreter, { node: value }, index)) });
950
+ case "italic":
951
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("i", { children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ASTNodeInterpreter, { node: value }, index)) });
952
+ case "underline":
953
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("u", { children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ASTNodeInterpreter, { node: value }, index)) });
954
+ case "font-space":
955
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "font-space", children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
956
+ ASTNodeInterpreter,
957
+ {
958
+ node: value
959
+ },
960
+ index
961
+ )) });
962
+ case "primary":
963
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-primary", children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
964
+ ASTNodeInterpreter,
965
+ {
966
+ node: value
967
+ },
968
+ index
969
+ )) });
970
+ case "secondary":
971
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-secondary", children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
972
+ ASTNodeInterpreter,
973
+ {
974
+ node: value
975
+ },
976
+ index
977
+ )) });
978
+ case "warn":
979
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-warning", children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
980
+ ASTNodeInterpreter,
981
+ {
982
+ node: value
983
+ },
984
+ index
985
+ )) });
986
+ case "positive":
987
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-positive", children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
988
+ ASTNodeInterpreter,
989
+ {
990
+ node: value
991
+ },
992
+ index
993
+ )) });
994
+ case "negative":
995
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-negative", children: node.children.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
996
+ ASTNodeInterpreter,
997
+ {
998
+ node: value
999
+ },
1000
+ index
1001
+ )) });
1002
+ default:
1003
+ return null;
1004
+ }
1005
+ };
1006
+ var modifierIdentifierMapping = [
1007
+ { id: "i", name: "italic" },
1008
+ { id: "b", name: "bold" },
1009
+ { id: "u", name: "underline" },
1010
+ { id: "space", name: "font-space" },
1011
+ { id: "primary", name: "primary" },
1012
+ { id: "secondary", name: "secondary" },
1013
+ { id: "warn", name: "warn" },
1014
+ { id: "positive", name: "positive" },
1015
+ { id: "negative", name: "negative" }
1016
+ ];
1017
+ var inserterIdentifierMapping = [
1018
+ { id: "helpwave", name: "helpwave" },
1019
+ { id: "newline", name: "newline" }
1020
+ ];
1021
+ var parseMarkdown = (text, commandStart = "\\", open = "{", close = "}") => {
1022
+ let start = text.indexOf(commandStart);
1023
+ const children = [];
1024
+ while (text !== "") {
1025
+ if (start === -1) {
1026
+ children.push({
1027
+ type: "text",
1028
+ text
1029
+ });
1030
+ break;
1031
+ }
1032
+ children.push(parseMarkdown(text.substring(0, start)));
1033
+ text = text.substring(start);
1034
+ if (text.length <= 1) {
1035
+ children.push({
1036
+ type: "text",
1037
+ text
1038
+ });
1039
+ text = "";
1040
+ continue;
1041
+ }
1042
+ const simpleReplace = [commandStart, open, close];
1043
+ if (simpleReplace.some((value) => text[1] === value)) {
1044
+ children.push({
1045
+ type: "text",
1046
+ text: simpleReplace.find((value) => text[1] === value)
1047
+ });
1048
+ text = text.substring(2);
1049
+ start = text.indexOf(commandStart);
1050
+ continue;
1051
+ }
1052
+ const inserter = inserterIdentifierMapping.find((value) => text.substring(1).startsWith(value.id));
1053
+ if (inserter) {
1054
+ children.push({
1055
+ type: inserter.name
1056
+ });
1057
+ text = text.substring(inserter.id.length + 1);
1058
+ start = text.indexOf(commandStart);
1059
+ continue;
1060
+ }
1061
+ const modifier = modifierIdentifierMapping.find((value) => text.substring(1).startsWith(value.id));
1062
+ if (modifier) {
1063
+ if (text[modifier.id.length + 1] !== open) {
1064
+ children.push({
1065
+ type: "text",
1066
+ text: text.substring(0, modifier.id.length + 1)
1067
+ });
1068
+ text = text.substring(modifier.id.length + 2);
1069
+ start = text.indexOf(commandStart);
1070
+ continue;
1071
+ }
1072
+ let closing = -1;
1073
+ let index = modifier.id.length + 2;
1074
+ let counter = 1;
1075
+ let escaping = false;
1076
+ while (index < text.length) {
1077
+ if (text[index] === open && !escaping) {
1078
+ counter++;
1079
+ }
1080
+ if (text[index] === close && !escaping) {
1081
+ counter--;
1082
+ if (counter === 0) {
1083
+ closing = index;
1084
+ break;
1085
+ }
1086
+ }
1087
+ escaping = text[index] === commandStart;
1088
+ index++;
1089
+ }
1090
+ if (closing !== -1) {
1091
+ children.push({
1092
+ type: modifier.name,
1093
+ children: [parseMarkdown(text.substring(modifier.id.length + 2, closing))]
1094
+ });
1095
+ text = text.substring(closing + 1);
1096
+ start = text.indexOf(commandStart);
1097
+ continue;
1098
+ }
1099
+ }
1100
+ children.push({
1101
+ type: "text",
1102
+ text: text[0]
1103
+ });
1104
+ text = text.substring(1);
1105
+ start = text.indexOf(commandStart);
1106
+ }
1107
+ return {
1108
+ type: "none",
1109
+ children
1110
+ };
1111
+ };
1112
+ var optimizeTree = (node) => {
1113
+ if (node.type === "text") {
1114
+ return !node.text ? void 0 : node;
1115
+ }
1116
+ if (astNodeInserterType.some((value) => value === node.type)) {
1117
+ return node;
1118
+ }
1119
+ const currentNode = node;
1120
+ if (currentNode.children.length === 0) {
1121
+ return void 0;
1122
+ }
1123
+ let children = [];
1124
+ for (let i = 0; i < currentNode.children.length; i++) {
1125
+ const child = optimizeTree(currentNode.children[i]);
1126
+ if (!child) {
1127
+ continue;
1128
+ }
1129
+ if (child.type === "none") {
1130
+ children.push(...child.children);
1131
+ } else {
1132
+ children.push(child);
1133
+ }
1134
+ }
1135
+ currentNode.children = children;
1136
+ children = [];
1137
+ for (let i = 0; i < currentNode.children.length; i++) {
1138
+ const child = currentNode.children[i];
1139
+ if (child) {
1140
+ if (child.type === "text" && children[children.length - 1]?.type === "text") {
1141
+ children[children.length - 1].text += child.text;
1142
+ } else {
1143
+ children.push(child);
1144
+ }
1145
+ }
1146
+ }
1147
+ currentNode.children = children;
1148
+ return currentNode;
1149
+ };
1150
+ var MarkdownInterpreter = ({ text, className }) => {
1151
+ const tree = parseMarkdown(text);
1152
+ const optimizedTree = optimizeTree(tree);
1153
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ASTNodeInterpreter, { node: optimizedTree, isRoot: true, className });
1154
+ };
1155
+
1156
+ // src/components/layout/FAQSection.tsx
1157
+ var import_jsx_runtime8 = require("react/jsx-runtime");
1158
+ var FAQSection = ({
1159
+ entries,
1160
+ expandableClassName
1161
+ }) => {
1162
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("ul", { className: "flex-col-4", children: entries.map(({ id, title, content, ...restProps }) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1163
+ ExpandableUncontrolled,
1164
+ {
1165
+ ...restProps,
1166
+ label: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h3", { id, className: "typography-title-md-semibold", children: title }),
1167
+ clickOnlyOnHeader: false,
1168
+ icon: (expanded) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ExpansionIcon, { isExpanded: expanded, className: "text-primary" }),
1169
+ className: (0, import_clsx6.default)("rounded-xl", expandableClassName),
1170
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "mt-2", children: content.type === "markdown" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(MarkdownInterpreter, { text: content.value }) : content.value })
1171
+ },
1172
+ id
1173
+ ) }, id)) });
1174
+ };
1175
+
1176
+ // src/components/layout/FloatingContainer.tsx
1177
+ var import_react8 = require("react");
1178
+ var import_react_dom = require("react-dom");
1179
+ var import_clsx7 = require("clsx");
1180
+
1181
+ // src/hooks/useFloatingElement.ts
1182
+ var import_react7 = require("react");
1183
+
1184
+ // src/utils/math.ts
1185
+ var clamp = (value, range2 = [0, 1]) => {
1186
+ const [min, max] = range2;
1187
+ return Math.min(Math.max(value, min), max);
1188
+ };
1189
+
1190
+ // src/hooks/focus/useIsMounted.ts
1191
+ var import_react6 = require("react");
1192
+ var isClient = typeof window !== "undefined" && typeof document !== "undefined";
1193
+ var useIsomorphicEffect = isClient ? import_react6.useLayoutEffect : import_react6.useEffect;
1194
+ var useIsMounted = () => {
1195
+ const [isMounted, setIsMounted] = (0, import_react6.useState)(false);
1196
+ useIsomorphicEffect(() => {
1197
+ setIsMounted(true);
1198
+ return () => {
1199
+ setIsMounted(false);
1200
+ };
1201
+ }, []);
1202
+ return isMounted;
1203
+ };
1204
+
1205
+ // src/hooks/useFloatingElement.ts
1206
+ function calculatePosition({
1207
+ windowRect,
1208
+ containerRect,
1209
+ anchorRect,
1210
+ options
1211
+ }) {
1212
+ const { verticalAlignment, horizontalAlignment, gap, screenPadding } = options;
1213
+ const windowWidth = windowRect.width;
1214
+ const windowHeight = windowRect.height;
1215
+ const maxWidth = windowWidth - 2 * screenPadding;
1216
+ const maxHeight = windowHeight - 2 * screenPadding;
1217
+ const width = Math.min(containerRect.width, maxWidth);
1218
+ const height = Math.min(containerRect.height, maxHeight);
1219
+ const leftSuggestion = {
1220
+ beforeStart: anchorRect.left - width - gap,
1221
+ afterStart: anchorRect.left,
1222
+ center: anchorRect.left + anchorRect.width / 2 - width / 2,
1223
+ beforeEnd: anchorRect.right - width,
1224
+ afterEnd: anchorRect.right + gap
1225
+ }[horizontalAlignment];
1226
+ const topSuggestion = {
1227
+ beforeStart: anchorRect.top - height - gap,
1228
+ afterStart: anchorRect.top,
1229
+ center: anchorRect.top + anchorRect.height / 2 - height / 2,
1230
+ beforeEnd: anchorRect.bottom - height,
1231
+ afterEnd: anchorRect.bottom + gap
1232
+ }[verticalAlignment];
1233
+ const left = clamp(leftSuggestion, [
1234
+ screenPadding,
1235
+ windowWidth - screenPadding - width
1236
+ ]);
1237
+ const top = clamp(topSuggestion, [
1238
+ screenPadding,
1239
+ windowHeight - screenPadding - height
1240
+ ]);
1241
+ return {
1242
+ left,
1243
+ top,
1244
+ maxWidth,
1245
+ maxHeight
1246
+ };
1247
+ }
1248
+ function useFloatingElement({
1249
+ active = true,
1250
+ windowRef,
1251
+ anchorRef,
1252
+ containerRef,
1253
+ isPolling = false,
1254
+ pollingInterval = 100,
1255
+ verticalAlignment = "afterEnd",
1256
+ horizontalAlignment = "afterStart",
1257
+ screenPadding = 16,
1258
+ gap = 4
1259
+ }) {
1260
+ const [style, setStyle] = (0, import_react7.useState)();
1261
+ const isMounted = useIsMounted();
1262
+ const calculate = (0, import_react7.useCallback)(() => {
1263
+ const containerRect = containerRef.current.getBoundingClientRect();
1264
+ const windowRect = windowRef?.current.getBoundingClientRect() ?? {
1265
+ top: 0,
1266
+ bottom: window.innerHeight,
1267
+ left: 0,
1268
+ right: window.innerWidth,
1269
+ width: window.innerWidth,
1270
+ height: window.innerHeight
1271
+ };
1272
+ const anchorElement = anchorRef?.current;
1273
+ if (anchorRef && !anchorElement) {
1274
+ console.warn("FloatingContainer anchor provided, but its value is undefined");
1275
+ }
1276
+ const anchorRect = anchorElement?.getBoundingClientRect() ?? windowRect;
1277
+ const calculateProps = {
1278
+ windowRect,
1279
+ anchorRect,
1280
+ containerRect,
1281
+ options: {
1282
+ horizontalAlignment,
1283
+ verticalAlignment,
1284
+ screenPadding,
1285
+ gap
1286
+ }
1287
+ };
1288
+ setStyle(calculatePosition(calculateProps));
1289
+ }, [anchorRef, containerRef, gap, horizontalAlignment, screenPadding, verticalAlignment, windowRef]);
1290
+ const height = containerRef.current?.getBoundingClientRect().height;
1291
+ const width = containerRef.current?.getBoundingClientRect().width;
1292
+ (0, import_react7.useEffect)(() => {
1293
+ if (active && isMounted) {
1294
+ calculate();
1295
+ } else {
1296
+ setStyle(void 0);
1297
+ }
1298
+ }, [calculate, active, isMounted, height, width]);
1299
+ (0, import_react7.useEffect)(() => {
1300
+ window.addEventListener("resize", calculate);
1301
+ let timeout;
1302
+ if (isPolling) {
1303
+ timeout = setInterval(calculate, pollingInterval);
1304
+ }
1305
+ return () => {
1306
+ window.removeEventListener("resize", calculate);
1307
+ if (timeout) {
1308
+ clearInterval(timeout);
1309
+ }
1310
+ };
1311
+ }, [calculate, isPolling, pollingInterval]);
1312
+ return style;
1313
+ }
1314
+
1315
+ // src/components/layout/FloatingContainer.tsx
1316
+ var import_jsx_runtime9 = require("react/jsx-runtime");
1317
+ var FloatingContainer = (0, import_react8.forwardRef)(function FloatingContainer2({
1318
+ children,
1319
+ backgroundOverlay,
1320
+ anchor,
1321
+ isPolling = false,
1322
+ pollingInterval = 100,
1323
+ verticalAlignment = "afterEnd",
1324
+ horizontalAlignment = "afterStart",
1325
+ screenPadding = 16,
1326
+ gap = 4,
1327
+ ...props
1328
+ }, forwardRef9) {
1329
+ const innerRef = (0, import_react8.useRef)(null);
1330
+ (0, import_react8.useImperativeHandle)(forwardRef9, () => innerRef.current);
1331
+ const position = useFloatingElement({
1332
+ active: !props.hidden,
1333
+ containerRef: innerRef,
1334
+ anchorRef: anchor,
1335
+ isPolling,
1336
+ pollingInterval,
1337
+ verticalAlignment,
1338
+ horizontalAlignment,
1339
+ gap,
1340
+ screenPadding
1341
+ });
1342
+ return (0, import_react_dom.createPortal)(
1343
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
1344
+ backgroundOverlay,
1345
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1346
+ "div",
1347
+ {
1348
+ ...props,
1349
+ ref: innerRef,
1350
+ style: {
1351
+ position: "fixed",
1352
+ overflow: "hidden",
1353
+ opacity: position ? void 0 : 0,
1354
+ // hide when position calculation isn't done yet
1355
+ transition: position ? `top ${pollingInterval}ms linear, left ${pollingInterval}ms linear` : void 0,
1356
+ ...position,
1357
+ ...props.style
1358
+ },
1359
+ className: (0, import_clsx7.clsx)("motion-safe:duration-100 motion-reduce:duration-0", props.className),
1360
+ children
1361
+ }
1362
+ )
1363
+ ] }),
1364
+ document.body
1365
+ );
1366
+ });
1367
+
1368
+ // src/components/layout/ListBox.tsx
1369
+ var import_react9 = __toESM(require("react"));
1370
+ var import_clsx8 = require("clsx");
1371
+
1372
+ // src/utils/match.ts
1373
+ var match = (key, values) => {
1374
+ return values[key];
1375
+ };
1376
+
1377
+ // src/components/layout/ListBox.tsx
1378
+ var import_jsx_runtime10 = require("react/jsx-runtime");
1379
+ var ListBoxContext = (0, import_react9.createContext)(null);
1380
+ function useListBoxContext() {
1381
+ const ctx = (0, import_react9.useContext)(ListBoxContext);
1382
+ if (!ctx) {
1383
+ throw new Error("ListBoxItem must be used within a ListBoxPrimitive");
1384
+ }
1385
+ return ctx;
1386
+ }
1387
+ var ListBoxItem = (0, import_react9.forwardRef)(
1388
+ function ListBoxItem2({ value, disabled = false, children, className, ...rest }, ref) {
1389
+ const {
1390
+ registerItem,
1391
+ unregisterItem,
1392
+ highlightedId,
1393
+ setHighlightedId,
1394
+ onItemClick,
1395
+ isSelected
1396
+ } = useListBoxContext();
1397
+ const itemRef = (0, import_react9.useRef)(null);
1398
+ const id = import_react9.default.useId();
1399
+ (0, import_react9.useEffect)(() => {
1400
+ registerItem({ id, value, disabled, ref: itemRef });
1401
+ return () => unregisterItem(id);
1402
+ }, [id, value, disabled, registerItem, unregisterItem]);
1403
+ const isHighlighted = highlightedId === id;
1404
+ const selected = isSelected(value);
1405
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1406
+ "li",
1407
+ {
1408
+ ref: (node) => {
1409
+ itemRef.current = node;
1410
+ if (typeof ref === "function") ref(node);
1411
+ else if (ref) ref.current = node;
1412
+ },
1413
+ id,
1414
+ role: "option",
1415
+ "aria-disabled": disabled,
1416
+ "aria-selected": selected,
1417
+ "data-highlighted": isHighlighted ? "" : void 0,
1418
+ "data-selected": selected ? "" : void 0,
1419
+ "data-disabled": disabled ? "" : void 0,
1420
+ className: (0, import_clsx8.clsx)(
1421
+ "flex-row-1 items-center px-2 py-1 rounded-md",
1422
+ "data-highlighted:bg-primary/20",
1423
+ "data-disabled:text-disabled data-disabled:cursor-not-allowed",
1424
+ "not-data-disabled:cursor-pointer",
1425
+ className
1426
+ ),
1427
+ onClick: () => {
1428
+ if (!disabled) onItemClick(id);
1429
+ },
1430
+ onMouseEnter: () => {
1431
+ if (!disabled) {
1432
+ setHighlightedId(id);
1433
+ }
1434
+ },
1435
+ ...rest,
1436
+ children: children ?? value
1437
+ }
1438
+ );
1439
+ }
1440
+ );
1441
+ var ListBoxPrimitive = (0, import_react9.forwardRef)(
1442
+ function ListBoxPrimitive2({
1443
+ value,
1444
+ onSelectionChanged,
1445
+ onItemClicked,
1446
+ isSelection = false,
1447
+ isMultiple = false,
1448
+ orientation = "vertical",
1449
+ ...props
1450
+ }, ref) {
1451
+ const itemsRef = (0, import_react9.useRef)([]);
1452
+ const [highlightedIndex, setHighlightedIndex] = (0, import_react9.useState)(void 0);
1453
+ const registerItem = (0, import_react9.useCallback)((item) => {
1454
+ itemsRef.current.push(item);
1455
+ itemsRef.current.sort((a, b) => {
1456
+ const aEl = a.ref.current;
1457
+ const bEl = b.ref.current;
1458
+ if (!aEl || !bEl) return 0;
1459
+ return aEl.compareDocumentPosition(bEl) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
1460
+ });
1461
+ }, []);
1462
+ const unregisterItem = (0, import_react9.useCallback)((id) => {
1463
+ itemsRef.current = itemsRef.current.filter((i) => i.id !== id);
1464
+ }, []);
1465
+ const isSelected = (0, import_react9.useCallback)(
1466
+ (val) => (value ?? []).includes(val),
1467
+ [value]
1468
+ );
1469
+ const onItemClickedHandler = (0, import_react9.useCallback)(
1470
+ (id) => {
1471
+ const index = itemsRef.current.findIndex((i) => i.id === id);
1472
+ if (index === -1) {
1473
+ console.error("ListBoxItem provided an invalid id");
1474
+ return;
1475
+ }
1476
+ const item = itemsRef.current[index];
1477
+ const val = item.value;
1478
+ onItemClicked?.(val);
1479
+ setHighlightedIndex(index);
1480
+ if (!isSelection) return;
1481
+ if (!isMultiple) {
1482
+ onSelectionChanged?.([val]);
1483
+ } else {
1484
+ if (isSelected(val)) {
1485
+ onSelectionChanged?.((value ?? []).filter((v) => v !== val));
1486
+ } else {
1487
+ onSelectionChanged?.([...value ?? [], val]);
1488
+ }
1489
+ }
1490
+ },
1491
+ [onItemClicked, isSelection, isMultiple, onSelectionChanged, isSelected, value]
1492
+ );
1493
+ const setHighlightedId = (0, import_react9.useCallback)((id) => {
1494
+ const index = itemsRef.current.findIndex((i) => i.id === id);
1495
+ if (index !== -1) {
1496
+ setHighlightedIndex(index);
1497
+ }
1498
+ }, []);
1499
+ (0, import_react9.useEffect)(() => {
1500
+ if (highlightedIndex !== void 0) {
1501
+ itemsRef.current[highlightedIndex]?.ref.current?.scrollIntoView({ block: "nearest", behavior: "auto" });
1502
+ }
1503
+ }, [highlightedIndex]);
1504
+ const highlightedItem = itemsRef.current[highlightedIndex];
1505
+ const ctxValue = {
1506
+ registerItem,
1507
+ unregisterItem,
1508
+ highlightedId: highlightedItem?.id,
1509
+ setHighlightedId,
1510
+ onItemClick: onItemClickedHandler,
1511
+ isSelected
1512
+ };
1513
+ const moveHighlight = (delta) => {
1514
+ if (itemsRef.current.length === 0) return;
1515
+ let nextIndex = highlightedIndex ?? -1;
1516
+ for (let i = 0; i < itemsRef.current.length; i++) {
1517
+ nextIndex = (nextIndex + delta + itemsRef.current.length) % itemsRef.current.length;
1518
+ if (!itemsRef.current[nextIndex].disabled) break;
1519
+ }
1520
+ setHighlightedIndex(nextIndex);
1521
+ };
1522
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ListBoxContext.Provider, { value: ctxValue, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1523
+ "ul",
1524
+ {
1525
+ ref,
1526
+ ...props,
1527
+ onFocus: (event) => {
1528
+ if (highlightedIndex === void 0) {
1529
+ const firstEnabled = itemsRef.current.findIndex((i) => !i.disabled);
1530
+ setHighlightedIndex(firstEnabled !== -1 ? firstEnabled : void 0);
1531
+ }
1532
+ props.onFocus?.(event);
1533
+ },
1534
+ onBlur: (event) => {
1535
+ setHighlightedIndex(void 0);
1536
+ props.onBlur?.(event);
1537
+ },
1538
+ onKeyDown: (event) => {
1539
+ switch (event.key) {
1540
+ case match(orientation, {
1541
+ vertical: "ArrowDown",
1542
+ horizontal: "ArrowUp"
1543
+ }):
1544
+ moveHighlight(1);
1545
+ event.preventDefault();
1546
+ break;
1547
+ case match(orientation, {
1548
+ vertical: "ArrowUp",
1549
+ horizontal: "ArrowDown"
1550
+ }):
1551
+ moveHighlight(-1);
1552
+ event.preventDefault();
1553
+ break;
1554
+ case "Home":
1555
+ setHighlightedIndex(itemsRef.current.findIndex((i) => !i.disabled));
1556
+ event.preventDefault();
1557
+ break;
1558
+ case "End":
1559
+ for (let i = itemsRef.current.length - 1; i >= 0; i--) {
1560
+ if (!itemsRef.current[i].disabled) {
1561
+ setHighlightedIndex(i);
1562
+ break;
1563
+ }
1564
+ }
1565
+ event.preventDefault();
1566
+ break;
1567
+ case "Enter":
1568
+ case " ":
1569
+ if (highlightedIndex !== void 0) {
1570
+ event.preventDefault();
1571
+ onItemClickedHandler(itemsRef.current[highlightedIndex].id);
1572
+ }
1573
+ break;
1574
+ }
1575
+ props.onKeyDown?.(event);
1576
+ },
1577
+ role: "listbox",
1578
+ "aria-multiselectable": isSelection ? isMultiple : void 0,
1579
+ "aria-orientation": orientation,
1580
+ tabIndex: 0,
1581
+ children: props.children
1582
+ }
1583
+ ) });
1584
+ }
1585
+ );
1586
+ var ListBoxMultiple = ({ ...props }) => {
1587
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ListBoxPrimitive, { ...props });
1588
+ };
1589
+ var ListBoxMultipleUncontrolled = ({
1590
+ value: initialValue,
1591
+ onSelectionChanged,
1592
+ ...props
1593
+ }) => {
1594
+ const [value, setValue] = (0, import_react9.useState)(initialValue);
1595
+ (0, import_react9.useEffect)(() => {
1596
+ setValue(initialValue);
1597
+ }, [initialValue]);
1598
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1599
+ ListBoxMultiple,
1600
+ {
1601
+ ...props,
1602
+ value,
1603
+ onSelectionChanged: (newValue) => {
1604
+ setValue(newValue);
1605
+ onSelectionChanged?.(newValue);
1606
+ }
1607
+ }
1608
+ );
1609
+ };
1610
+ var ListBox = (0, import_react9.forwardRef)(function ListBox2({
1611
+ value,
1612
+ onSelectionChanged,
1613
+ ...props
1614
+ }, ref) {
1615
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1616
+ ListBoxPrimitive,
1617
+ {
1618
+ ref,
1619
+ value: value !== void 0 ? [value] : void 0,
1620
+ onSelectionChanged: (newValue) => {
1621
+ onSelectionChanged(newValue[0] ?? value);
1622
+ },
1623
+ isMultiple: false,
1624
+ ...props
1625
+ }
1626
+ );
1627
+ });
1628
+ var ListBoxUncontrolled = ({
1629
+ value: initialValue,
1630
+ onSelectionChanged,
1631
+ ...props
1632
+ }) => {
1633
+ const [value, setValue] = (0, import_react9.useState)(initialValue);
1634
+ (0, import_react9.useEffect)(() => {
1635
+ setValue(initialValue);
1636
+ }, [initialValue]);
1637
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1638
+ ListBox,
1639
+ {
1640
+ ...props,
1641
+ value,
1642
+ onSelectionChanged: (newValue) => {
1643
+ setValue(newValue);
1644
+ onSelectionChanged?.(newValue);
1645
+ }
1646
+ }
1647
+ );
1648
+ };
1649
+
1650
+ // node_modules/@radix-ui/react-scroll-area/dist/index.mjs
1651
+ var React23 = __toESM(require("react"), 1);
1652
+
1653
+ // node_modules/@radix-ui/react-primitive/dist/index.mjs
1654
+ var React5 = __toESM(require("react"), 1);
1655
+ var ReactDOM = __toESM(require("react-dom"), 1);
1656
+
1657
+ // node_modules/@radix-ui/react-slot/dist/index.mjs
1658
+ var React4 = __toESM(require("react"), 1);
1659
+
1660
+ // node_modules/@radix-ui/react-compose-refs/dist/index.mjs
1661
+ var React3 = __toESM(require("react"), 1);
1662
+ function setRef(ref, value) {
1663
+ if (typeof ref === "function") {
1664
+ return ref(value);
1665
+ } else if (ref !== null && ref !== void 0) {
1666
+ ref.current = value;
1667
+ }
1668
+ }
1669
+ function composeRefs(...refs) {
1670
+ return (node) => {
1671
+ let hasCleanup = false;
1672
+ const cleanups = refs.map((ref) => {
1673
+ const cleanup = setRef(ref, node);
1674
+ if (!hasCleanup && typeof cleanup == "function") {
1675
+ hasCleanup = true;
1676
+ }
1677
+ return cleanup;
1678
+ });
1679
+ if (hasCleanup) {
1680
+ return () => {
1681
+ for (let i = 0; i < cleanups.length; i++) {
1682
+ const cleanup = cleanups[i];
1683
+ if (typeof cleanup == "function") {
1684
+ cleanup();
1685
+ } else {
1686
+ setRef(refs[i], null);
1687
+ }
1688
+ }
1689
+ };
1690
+ }
1691
+ };
1692
+ }
1693
+ function useComposedRefs(...refs) {
1694
+ return React3.useCallback(composeRefs(...refs), refs);
1695
+ }
1696
+
1697
+ // node_modules/@radix-ui/react-slot/dist/index.mjs
1698
+ var import_jsx_runtime11 = require("react/jsx-runtime");
1699
+ // @__NO_SIDE_EFFECTS__
1700
+ function createSlot(ownerName) {
1701
+ const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
1702
+ const Slot2 = React4.forwardRef((props, forwardedRef) => {
1703
+ const { children, ...slotProps } = props;
1704
+ const childrenArray = React4.Children.toArray(children);
1705
+ const slottable = childrenArray.find(isSlottable);
1706
+ if (slottable) {
1707
+ const newElement = slottable.props.children;
1708
+ const newChildren = childrenArray.map((child) => {
1709
+ if (child === slottable) {
1710
+ if (React4.Children.count(newElement) > 1) return React4.Children.only(null);
1711
+ return React4.isValidElement(newElement) ? newElement.props.children : null;
1712
+ } else {
1713
+ return child;
1714
+ }
1715
+ });
1716
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children: React4.isValidElement(newElement) ? React4.cloneElement(newElement, void 0, newChildren) : null });
1717
+ }
1718
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SlotClone, { ...slotProps, ref: forwardedRef, children });
1719
+ });
1720
+ Slot2.displayName = `${ownerName}.Slot`;
1721
+ return Slot2;
1722
+ }
1723
+ // @__NO_SIDE_EFFECTS__
1724
+ function createSlotClone(ownerName) {
1725
+ const SlotClone = React4.forwardRef((props, forwardedRef) => {
1726
+ const { children, ...slotProps } = props;
1727
+ if (React4.isValidElement(children)) {
1728
+ const childrenRef = getElementRef(children);
1729
+ const props2 = mergeProps(slotProps, children.props);
1730
+ if (children.type !== React4.Fragment) {
1731
+ props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
1732
+ }
1733
+ return React4.cloneElement(children, props2);
1734
+ }
1735
+ return React4.Children.count(children) > 1 ? React4.Children.only(null) : null;
1736
+ });
1737
+ SlotClone.displayName = `${ownerName}.SlotClone`;
1738
+ return SlotClone;
1739
+ }
1740
+ var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
1741
+ function isSlottable(child) {
1742
+ return React4.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
1743
+ }
1744
+ function mergeProps(slotProps, childProps) {
1745
+ const overrideProps = { ...childProps };
1746
+ for (const propName in childProps) {
1747
+ const slotPropValue = slotProps[propName];
1748
+ const childPropValue = childProps[propName];
1749
+ const isHandler = /^on[A-Z]/.test(propName);
1750
+ if (isHandler) {
1751
+ if (slotPropValue && childPropValue) {
1752
+ overrideProps[propName] = (...args) => {
1753
+ const result = childPropValue(...args);
1754
+ slotPropValue(...args);
1755
+ return result;
1756
+ };
1757
+ } else if (slotPropValue) {
1758
+ overrideProps[propName] = slotPropValue;
1759
+ }
1760
+ } else if (propName === "style") {
1761
+ overrideProps[propName] = { ...slotPropValue, ...childPropValue };
1762
+ } else if (propName === "className") {
1763
+ overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
1764
+ }
1765
+ }
1766
+ return { ...slotProps, ...overrideProps };
1767
+ }
1768
+ function getElementRef(element) {
1769
+ let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
1770
+ let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
1771
+ if (mayWarn) {
1772
+ return element.ref;
1773
+ }
1774
+ getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
1775
+ mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
1776
+ if (mayWarn) {
1777
+ return element.props.ref;
1778
+ }
1779
+ return element.props.ref || element.ref;
1780
+ }
1781
+
1782
+ // node_modules/@radix-ui/react-primitive/dist/index.mjs
1783
+ var import_jsx_runtime12 = require("react/jsx-runtime");
1784
+ var NODES = [
1785
+ "a",
1786
+ "button",
1787
+ "div",
1788
+ "form",
1789
+ "h2",
1790
+ "h3",
1791
+ "img",
1792
+ "input",
1793
+ "label",
1794
+ "li",
1795
+ "nav",
1796
+ "ol",
1797
+ "p",
1798
+ "select",
1799
+ "span",
1800
+ "svg",
1801
+ "ul"
1802
+ ];
1803
+ var Primitive = NODES.reduce((primitive, node) => {
1804
+ const Slot = createSlot(`Primitive.${node}`);
1805
+ const Node2 = React5.forwardRef((props, forwardedRef) => {
1806
+ const { asChild, ...primitiveProps } = props;
1807
+ const Comp = asChild ? Slot : node;
1808
+ if (typeof window !== "undefined") {
1809
+ window[Symbol.for("radix-ui")] = true;
1810
+ }
1811
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Comp, { ...primitiveProps, ref: forwardedRef });
1812
+ });
1813
+ Node2.displayName = `Primitive.${node}`;
1814
+ return { ...primitive, [node]: Node2 };
1815
+ }, {});
1816
+
1817
+ // node_modules/@radix-ui/react-presence/dist/index.mjs
1818
+ var React22 = __toESM(require("react"), 1);
1819
+
1820
+ // node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
1821
+ var React6 = __toESM(require("react"), 1);
1822
+ var useLayoutEffect22 = globalThis?.document ? React6.useLayoutEffect : () => {
1823
+ };
1824
+
1825
+ // node_modules/@radix-ui/react-presence/dist/index.mjs
1826
+ var React7 = __toESM(require("react"), 1);
1827
+ function useStateMachine(initialState, machine) {
1828
+ return React7.useReducer((state, event) => {
1829
+ const nextState = machine[state][event];
1830
+ return nextState ?? state;
1831
+ }, initialState);
1832
+ }
1833
+ var Presence = (props) => {
1834
+ const { present, children } = props;
1835
+ const presence = usePresence(present);
1836
+ const child = typeof children === "function" ? children({ present: presence.isPresent }) : React22.Children.only(children);
1837
+ const ref = useComposedRefs(presence.ref, getElementRef2(child));
1838
+ const forceMount = typeof children === "function";
1839
+ return forceMount || presence.isPresent ? React22.cloneElement(child, { ref }) : null;
1840
+ };
1841
+ Presence.displayName = "Presence";
1842
+ function usePresence(present) {
1843
+ const [node, setNode] = React22.useState();
1844
+ const stylesRef = React22.useRef(null);
1845
+ const prevPresentRef = React22.useRef(present);
1846
+ const prevAnimationNameRef = React22.useRef("none");
1847
+ const initialState = present ? "mounted" : "unmounted";
1848
+ const [state, send] = useStateMachine(initialState, {
1849
+ mounted: {
1850
+ UNMOUNT: "unmounted",
1851
+ ANIMATION_OUT: "unmountSuspended"
1852
+ },
1853
+ unmountSuspended: {
1854
+ MOUNT: "mounted",
1855
+ ANIMATION_END: "unmounted"
1856
+ },
1857
+ unmounted: {
1858
+ MOUNT: "mounted"
1859
+ }
1860
+ });
1861
+ React22.useEffect(() => {
1862
+ const currentAnimationName = getAnimationName(stylesRef.current);
1863
+ prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
1864
+ }, [state]);
1865
+ useLayoutEffect22(() => {
1866
+ const styles = stylesRef.current;
1867
+ const wasPresent = prevPresentRef.current;
1868
+ const hasPresentChanged = wasPresent !== present;
1869
+ if (hasPresentChanged) {
1870
+ const prevAnimationName = prevAnimationNameRef.current;
1871
+ const currentAnimationName = getAnimationName(styles);
1872
+ if (present) {
1873
+ send("MOUNT");
1874
+ } else if (currentAnimationName === "none" || styles?.display === "none") {
1875
+ send("UNMOUNT");
1876
+ } else {
1877
+ const isAnimating = prevAnimationName !== currentAnimationName;
1878
+ if (wasPresent && isAnimating) {
1879
+ send("ANIMATION_OUT");
1880
+ } else {
1881
+ send("UNMOUNT");
1882
+ }
1883
+ }
1884
+ prevPresentRef.current = present;
1885
+ }
1886
+ }, [present, send]);
1887
+ useLayoutEffect22(() => {
1888
+ if (node) {
1889
+ let timeoutId;
1890
+ const ownerWindow = node.ownerDocument.defaultView ?? window;
1891
+ const handleAnimationEnd = (event) => {
1892
+ const currentAnimationName = getAnimationName(stylesRef.current);
1893
+ const isCurrentAnimation = currentAnimationName.includes(event.animationName);
1894
+ if (event.target === node && isCurrentAnimation) {
1895
+ send("ANIMATION_END");
1896
+ if (!prevPresentRef.current) {
1897
+ const currentFillMode = node.style.animationFillMode;
1898
+ node.style.animationFillMode = "forwards";
1899
+ timeoutId = ownerWindow.setTimeout(() => {
1900
+ if (node.style.animationFillMode === "forwards") {
1901
+ node.style.animationFillMode = currentFillMode;
1902
+ }
1903
+ });
1904
+ }
1905
+ }
1906
+ };
1907
+ const handleAnimationStart = (event) => {
1908
+ if (event.target === node) {
1909
+ prevAnimationNameRef.current = getAnimationName(stylesRef.current);
1910
+ }
1911
+ };
1912
+ node.addEventListener("animationstart", handleAnimationStart);
1913
+ node.addEventListener("animationcancel", handleAnimationEnd);
1914
+ node.addEventListener("animationend", handleAnimationEnd);
1915
+ return () => {
1916
+ ownerWindow.clearTimeout(timeoutId);
1917
+ node.removeEventListener("animationstart", handleAnimationStart);
1918
+ node.removeEventListener("animationcancel", handleAnimationEnd);
1919
+ node.removeEventListener("animationend", handleAnimationEnd);
1920
+ };
1921
+ } else {
1922
+ send("ANIMATION_END");
1923
+ }
1924
+ }, [node, send]);
1925
+ return {
1926
+ isPresent: ["mounted", "unmountSuspended"].includes(state),
1927
+ ref: React22.useCallback((node2) => {
1928
+ stylesRef.current = node2 ? getComputedStyle(node2) : null;
1929
+ setNode(node2);
1930
+ }, [])
1931
+ };
1932
+ }
1933
+ function getAnimationName(styles) {
1934
+ return styles?.animationName || "none";
1935
+ }
1936
+ function getElementRef2(element) {
1937
+ let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
1938
+ let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
1939
+ if (mayWarn) {
1940
+ return element.ref;
1941
+ }
1942
+ getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
1943
+ mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
1944
+ if (mayWarn) {
1945
+ return element.props.ref;
1946
+ }
1947
+ return element.props.ref || element.ref;
1948
+ }
1949
+
1950
+ // node_modules/@radix-ui/react-context/dist/index.mjs
1951
+ var React8 = __toESM(require("react"), 1);
1952
+ var import_jsx_runtime13 = require("react/jsx-runtime");
1953
+ function createContextScope(scopeName, createContextScopeDeps = []) {
1954
+ let defaultContexts = [];
1955
+ function createContext32(rootComponentName, defaultContext) {
1956
+ const BaseContext = React8.createContext(defaultContext);
1957
+ const index = defaultContexts.length;
1958
+ defaultContexts = [...defaultContexts, defaultContext];
1959
+ const Provider = (props) => {
1960
+ const { scope, children, ...context } = props;
1961
+ const Context = scope?.[scopeName]?.[index] || BaseContext;
1962
+ const value = React8.useMemo(() => context, Object.values(context));
1963
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Context.Provider, { value, children });
1964
+ };
1965
+ Provider.displayName = rootComponentName + "Provider";
1966
+ function useContext22(consumerName, scope) {
1967
+ const Context = scope?.[scopeName]?.[index] || BaseContext;
1968
+ const context = React8.useContext(Context);
1969
+ if (context) return context;
1970
+ if (defaultContext !== void 0) return defaultContext;
1971
+ throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
1972
+ }
1973
+ return [Provider, useContext22];
1974
+ }
1975
+ const createScope = () => {
1976
+ const scopeContexts = defaultContexts.map((defaultContext) => {
1977
+ return React8.createContext(defaultContext);
1978
+ });
1979
+ return function useScope(scope) {
1980
+ const contexts = scope?.[scopeName] || scopeContexts;
1981
+ return React8.useMemo(
1982
+ () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
1983
+ [scope, contexts]
1984
+ );
1985
+ };
1986
+ };
1987
+ createScope.scopeName = scopeName;
1988
+ return [createContext32, composeContextScopes(createScope, ...createContextScopeDeps)];
1989
+ }
1990
+ function composeContextScopes(...scopes) {
1991
+ const baseScope = scopes[0];
1992
+ if (scopes.length === 1) return baseScope;
1993
+ const createScope = () => {
1994
+ const scopeHooks = scopes.map((createScope2) => ({
1995
+ useScope: createScope2(),
1996
+ scopeName: createScope2.scopeName
1997
+ }));
1998
+ return function useComposedScopes(overrideScopes) {
1999
+ const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
2000
+ const scopeProps = useScope(overrideScopes);
2001
+ const currentScope = scopeProps[`__scope${scopeName}`];
2002
+ return { ...nextScopes2, ...currentScope };
2003
+ }, {});
2004
+ return React8.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
2005
+ };
2006
+ };
2007
+ createScope.scopeName = baseScope.scopeName;
2008
+ return createScope;
2009
+ }
2010
+
2011
+ // node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
2012
+ var React9 = __toESM(require("react"), 1);
2013
+ function useCallbackRef(callback) {
2014
+ const callbackRef = React9.useRef(callback);
2015
+ React9.useEffect(() => {
2016
+ callbackRef.current = callback;
2017
+ });
2018
+ return React9.useMemo(() => (...args) => callbackRef.current?.(...args), []);
2019
+ }
2020
+
2021
+ // node_modules/@radix-ui/react-direction/dist/index.mjs
2022
+ var React10 = __toESM(require("react"), 1);
2023
+ var import_jsx_runtime14 = require("react/jsx-runtime");
2024
+ var DirectionContext = React10.createContext(void 0);
2025
+ function useDirection(localDir) {
2026
+ const globalDir = React10.useContext(DirectionContext);
2027
+ return localDir || globalDir || "ltr";
2028
+ }
2029
+
2030
+ // node_modules/@radix-ui/number/dist/index.mjs
2031
+ function clamp2(value, [min, max]) {
2032
+ return Math.min(max, Math.max(min, value));
2033
+ }
2034
+
2035
+ // node_modules/@radix-ui/primitive/dist/index.mjs
2036
+ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
2037
+ return function handleEvent(event) {
2038
+ originalEventHandler?.(event);
2039
+ if (checkForDefaultPrevented === false || !event.defaultPrevented) {
2040
+ return ourEventHandler?.(event);
2041
+ }
2042
+ };
2043
+ }
2044
+
2045
+ // node_modules/@radix-ui/react-scroll-area/dist/index.mjs
2046
+ var React11 = __toESM(require("react"), 1);
2047
+ var import_jsx_runtime15 = require("react/jsx-runtime");
2048
+ function useStateMachine2(initialState, machine) {
2049
+ return React11.useReducer((state, event) => {
2050
+ const nextState = machine[state][event];
2051
+ return nextState ?? state;
2052
+ }, initialState);
2053
+ }
2054
+ var SCROLL_AREA_NAME = "ScrollArea";
2055
+ var [createScrollAreaContext, createScrollAreaScope] = createContextScope(SCROLL_AREA_NAME);
2056
+ var [ScrollAreaProvider, useScrollAreaContext] = createScrollAreaContext(SCROLL_AREA_NAME);
2057
+ var ScrollArea = React23.forwardRef(
2058
+ (props, forwardedRef) => {
2059
+ const {
2060
+ __scopeScrollArea,
2061
+ type = "hover",
2062
+ dir,
2063
+ scrollHideDelay = 600,
2064
+ ...scrollAreaProps
2065
+ } = props;
2066
+ const [scrollArea, setScrollArea] = React23.useState(null);
2067
+ const [viewport, setViewport] = React23.useState(null);
2068
+ const [content, setContent] = React23.useState(null);
2069
+ const [scrollbarX, setScrollbarX] = React23.useState(null);
2070
+ const [scrollbarY, setScrollbarY] = React23.useState(null);
2071
+ const [cornerWidth, setCornerWidth] = React23.useState(0);
2072
+ const [cornerHeight, setCornerHeight] = React23.useState(0);
2073
+ const [scrollbarXEnabled, setScrollbarXEnabled] = React23.useState(false);
2074
+ const [scrollbarYEnabled, setScrollbarYEnabled] = React23.useState(false);
2075
+ const composedRefs = useComposedRefs(forwardedRef, (node) => setScrollArea(node));
2076
+ const direction = useDirection(dir);
2077
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2078
+ ScrollAreaProvider,
2079
+ {
2080
+ scope: __scopeScrollArea,
2081
+ type,
2082
+ dir: direction,
2083
+ scrollHideDelay,
2084
+ scrollArea,
2085
+ viewport,
2086
+ onViewportChange: setViewport,
2087
+ content,
2088
+ onContentChange: setContent,
2089
+ scrollbarX,
2090
+ onScrollbarXChange: setScrollbarX,
2091
+ scrollbarXEnabled,
2092
+ onScrollbarXEnabledChange: setScrollbarXEnabled,
2093
+ scrollbarY,
2094
+ onScrollbarYChange: setScrollbarY,
2095
+ scrollbarYEnabled,
2096
+ onScrollbarYEnabledChange: setScrollbarYEnabled,
2097
+ onCornerWidthChange: setCornerWidth,
2098
+ onCornerHeightChange: setCornerHeight,
2099
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2100
+ Primitive.div,
2101
+ {
2102
+ dir: direction,
2103
+ ...scrollAreaProps,
2104
+ ref: composedRefs,
2105
+ style: {
2106
+ position: "relative",
2107
+ // Pass corner sizes as CSS vars to reduce re-renders of context consumers
2108
+ ["--radix-scroll-area-corner-width"]: cornerWidth + "px",
2109
+ ["--radix-scroll-area-corner-height"]: cornerHeight + "px",
2110
+ ...props.style
2111
+ }
2112
+ }
2113
+ )
2114
+ }
2115
+ );
2116
+ }
2117
+ );
2118
+ ScrollArea.displayName = SCROLL_AREA_NAME;
2119
+ var VIEWPORT_NAME = "ScrollAreaViewport";
2120
+ var ScrollAreaViewport = React23.forwardRef(
2121
+ (props, forwardedRef) => {
2122
+ const { __scopeScrollArea, children, nonce, ...viewportProps } = props;
2123
+ const context = useScrollAreaContext(VIEWPORT_NAME, __scopeScrollArea);
2124
+ const ref = React23.useRef(null);
2125
+ const composedRefs = useComposedRefs(forwardedRef, ref, context.onViewportChange);
2126
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
2127
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2128
+ "style",
2129
+ {
2130
+ dangerouslySetInnerHTML: {
2131
+ __html: `[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`
2132
+ },
2133
+ nonce
2134
+ }
2135
+ ),
2136
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2137
+ Primitive.div,
2138
+ {
2139
+ "data-radix-scroll-area-viewport": "",
2140
+ ...viewportProps,
2141
+ ref: composedRefs,
2142
+ style: {
2143
+ /**
2144
+ * We don't support `visible` because the intention is to have at least one scrollbar
2145
+ * if this component is used and `visible` will behave like `auto` in that case
2146
+ * https://developer.mozilla.org/en-US/docs/Web/CSS/overflow#description
2147
+ *
2148
+ * We don't handle `auto` because the intention is for the native implementation
2149
+ * to be hidden if using this component. We just want to ensure the node is scrollable
2150
+ * so could have used either `scroll` or `auto` here. We picked `scroll` to prevent
2151
+ * the browser from having to work out whether to render native scrollbars or not,
2152
+ * we tell it to with the intention of hiding them in CSS.
2153
+ */
2154
+ overflowX: context.scrollbarXEnabled ? "scroll" : "hidden",
2155
+ overflowY: context.scrollbarYEnabled ? "scroll" : "hidden",
2156
+ ...props.style
2157
+ },
2158
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { ref: context.onContentChange, style: { minWidth: "100%", display: "table" }, children })
2159
+ }
2160
+ )
2161
+ ] });
2162
+ }
2163
+ );
2164
+ ScrollAreaViewport.displayName = VIEWPORT_NAME;
2165
+ var SCROLLBAR_NAME = "ScrollAreaScrollbar";
2166
+ var ScrollAreaScrollbar = React23.forwardRef(
2167
+ (props, forwardedRef) => {
2168
+ const { forceMount, ...scrollbarProps } = props;
2169
+ const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
2170
+ const { onScrollbarXEnabledChange, onScrollbarYEnabledChange } = context;
2171
+ const isHorizontal = props.orientation === "horizontal";
2172
+ React23.useEffect(() => {
2173
+ isHorizontal ? onScrollbarXEnabledChange(true) : onScrollbarYEnabledChange(true);
2174
+ return () => {
2175
+ isHorizontal ? onScrollbarXEnabledChange(false) : onScrollbarYEnabledChange(false);
2176
+ };
2177
+ }, [isHorizontal, onScrollbarXEnabledChange, onScrollbarYEnabledChange]);
2178
+ return context.type === "hover" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ScrollAreaScrollbarHover, { ...scrollbarProps, ref: forwardedRef, forceMount }) : context.type === "scroll" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ScrollAreaScrollbarScroll, { ...scrollbarProps, ref: forwardedRef, forceMount }) : context.type === "auto" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ScrollAreaScrollbarAuto, { ...scrollbarProps, ref: forwardedRef, forceMount }) : context.type === "always" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ScrollAreaScrollbarVisible, { ...scrollbarProps, ref: forwardedRef }) : null;
2179
+ }
2180
+ );
2181
+ ScrollAreaScrollbar.displayName = SCROLLBAR_NAME;
2182
+ var ScrollAreaScrollbarHover = React23.forwardRef((props, forwardedRef) => {
2183
+ const { forceMount, ...scrollbarProps } = props;
2184
+ const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
2185
+ const [visible, setVisible] = React23.useState(false);
2186
+ React23.useEffect(() => {
2187
+ const scrollArea = context.scrollArea;
2188
+ let hideTimer = 0;
2189
+ if (scrollArea) {
2190
+ const handlePointerEnter = () => {
2191
+ window.clearTimeout(hideTimer);
2192
+ setVisible(true);
2193
+ };
2194
+ const handlePointerLeave = () => {
2195
+ hideTimer = window.setTimeout(() => setVisible(false), context.scrollHideDelay);
2196
+ };
2197
+ scrollArea.addEventListener("pointerenter", handlePointerEnter);
2198
+ scrollArea.addEventListener("pointerleave", handlePointerLeave);
2199
+ return () => {
2200
+ window.clearTimeout(hideTimer);
2201
+ scrollArea.removeEventListener("pointerenter", handlePointerEnter);
2202
+ scrollArea.removeEventListener("pointerleave", handlePointerLeave);
2203
+ };
2204
+ }
2205
+ }, [context.scrollArea, context.scrollHideDelay]);
2206
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Presence, { present: forceMount || visible, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2207
+ ScrollAreaScrollbarAuto,
2208
+ {
2209
+ "data-state": visible ? "visible" : "hidden",
2210
+ ...scrollbarProps,
2211
+ ref: forwardedRef
2212
+ }
2213
+ ) });
2214
+ });
2215
+ var ScrollAreaScrollbarScroll = React23.forwardRef((props, forwardedRef) => {
2216
+ const { forceMount, ...scrollbarProps } = props;
2217
+ const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
2218
+ const isHorizontal = props.orientation === "horizontal";
2219
+ const debounceScrollEnd = useDebounceCallback(() => send("SCROLL_END"), 100);
2220
+ const [state, send] = useStateMachine2("hidden", {
2221
+ hidden: {
2222
+ SCROLL: "scrolling"
2223
+ },
2224
+ scrolling: {
2225
+ SCROLL_END: "idle",
2226
+ POINTER_ENTER: "interacting"
2227
+ },
2228
+ interacting: {
2229
+ SCROLL: "interacting",
2230
+ POINTER_LEAVE: "idle"
2231
+ },
2232
+ idle: {
2233
+ HIDE: "hidden",
2234
+ SCROLL: "scrolling",
2235
+ POINTER_ENTER: "interacting"
2236
+ }
2237
+ });
2238
+ React23.useEffect(() => {
2239
+ if (state === "idle") {
2240
+ const hideTimer = window.setTimeout(() => send("HIDE"), context.scrollHideDelay);
2241
+ return () => window.clearTimeout(hideTimer);
2242
+ }
2243
+ }, [state, context.scrollHideDelay, send]);
2244
+ React23.useEffect(() => {
2245
+ const viewport = context.viewport;
2246
+ const scrollDirection = isHorizontal ? "scrollLeft" : "scrollTop";
2247
+ if (viewport) {
2248
+ let prevScrollPos = viewport[scrollDirection];
2249
+ const handleScroll = () => {
2250
+ const scrollPos = viewport[scrollDirection];
2251
+ const hasScrollInDirectionChanged = prevScrollPos !== scrollPos;
2252
+ if (hasScrollInDirectionChanged) {
2253
+ send("SCROLL");
2254
+ debounceScrollEnd();
2255
+ }
2256
+ prevScrollPos = scrollPos;
2257
+ };
2258
+ viewport.addEventListener("scroll", handleScroll);
2259
+ return () => viewport.removeEventListener("scroll", handleScroll);
2260
+ }
2261
+ }, [context.viewport, isHorizontal, send, debounceScrollEnd]);
2262
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Presence, { present: forceMount || state !== "hidden", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2263
+ ScrollAreaScrollbarVisible,
2264
+ {
2265
+ "data-state": state === "hidden" ? "hidden" : "visible",
2266
+ ...scrollbarProps,
2267
+ ref: forwardedRef,
2268
+ onPointerEnter: composeEventHandlers(props.onPointerEnter, () => send("POINTER_ENTER")),
2269
+ onPointerLeave: composeEventHandlers(props.onPointerLeave, () => send("POINTER_LEAVE"))
2270
+ }
2271
+ ) });
2272
+ });
2273
+ var ScrollAreaScrollbarAuto = React23.forwardRef((props, forwardedRef) => {
2274
+ const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
2275
+ const { forceMount, ...scrollbarProps } = props;
2276
+ const [visible, setVisible] = React23.useState(false);
2277
+ const isHorizontal = props.orientation === "horizontal";
2278
+ const handleResize = useDebounceCallback(() => {
2279
+ if (context.viewport) {
2280
+ const isOverflowX = context.viewport.offsetWidth < context.viewport.scrollWidth;
2281
+ const isOverflowY = context.viewport.offsetHeight < context.viewport.scrollHeight;
2282
+ setVisible(isHorizontal ? isOverflowX : isOverflowY);
2283
+ }
2284
+ }, 10);
2285
+ useResizeObserver(context.viewport, handleResize);
2286
+ useResizeObserver(context.content, handleResize);
2287
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Presence, { present: forceMount || visible, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2288
+ ScrollAreaScrollbarVisible,
2289
+ {
2290
+ "data-state": visible ? "visible" : "hidden",
2291
+ ...scrollbarProps,
2292
+ ref: forwardedRef
2293
+ }
2294
+ ) });
2295
+ });
2296
+ var ScrollAreaScrollbarVisible = React23.forwardRef((props, forwardedRef) => {
2297
+ const { orientation = "vertical", ...scrollbarProps } = props;
2298
+ const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
2299
+ const thumbRef = React23.useRef(null);
2300
+ const pointerOffsetRef = React23.useRef(0);
2301
+ const [sizes, setSizes] = React23.useState({
2302
+ content: 0,
2303
+ viewport: 0,
2304
+ scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 }
2305
+ });
2306
+ const thumbRatio = getThumbRatio(sizes.viewport, sizes.content);
2307
+ const commonProps = {
2308
+ ...scrollbarProps,
2309
+ sizes,
2310
+ onSizesChange: setSizes,
2311
+ hasThumb: Boolean(thumbRatio > 0 && thumbRatio < 1),
2312
+ onThumbChange: (thumb) => thumbRef.current = thumb,
2313
+ onThumbPointerUp: () => pointerOffsetRef.current = 0,
2314
+ onThumbPointerDown: (pointerPos) => pointerOffsetRef.current = pointerPos
2315
+ };
2316
+ function getScrollPosition(pointerPos, dir) {
2317
+ return getScrollPositionFromPointer(pointerPos, pointerOffsetRef.current, sizes, dir);
2318
+ }
2319
+ if (orientation === "horizontal") {
2320
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2321
+ ScrollAreaScrollbarX,
2322
+ {
2323
+ ...commonProps,
2324
+ ref: forwardedRef,
2325
+ onThumbPositionChange: () => {
2326
+ if (context.viewport && thumbRef.current) {
2327
+ const scrollPos = context.viewport.scrollLeft;
2328
+ const offset = getThumbOffsetFromScroll(scrollPos, sizes, context.dir);
2329
+ thumbRef.current.style.transform = `translate3d(${offset}px, 0, 0)`;
2330
+ }
2331
+ },
2332
+ onWheelScroll: (scrollPos) => {
2333
+ if (context.viewport) context.viewport.scrollLeft = scrollPos;
2334
+ },
2335
+ onDragScroll: (pointerPos) => {
2336
+ if (context.viewport) {
2337
+ context.viewport.scrollLeft = getScrollPosition(pointerPos, context.dir);
2338
+ }
2339
+ }
2340
+ }
2341
+ );
2342
+ }
2343
+ if (orientation === "vertical") {
2344
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2345
+ ScrollAreaScrollbarY,
2346
+ {
2347
+ ...commonProps,
2348
+ ref: forwardedRef,
2349
+ onThumbPositionChange: () => {
2350
+ if (context.viewport && thumbRef.current) {
2351
+ const scrollPos = context.viewport.scrollTop;
2352
+ const offset = getThumbOffsetFromScroll(scrollPos, sizes);
2353
+ thumbRef.current.style.transform = `translate3d(0, ${offset}px, 0)`;
2354
+ }
2355
+ },
2356
+ onWheelScroll: (scrollPos) => {
2357
+ if (context.viewport) context.viewport.scrollTop = scrollPos;
2358
+ },
2359
+ onDragScroll: (pointerPos) => {
2360
+ if (context.viewport) context.viewport.scrollTop = getScrollPosition(pointerPos);
2361
+ }
2362
+ }
2363
+ );
2364
+ }
2365
+ return null;
2366
+ });
2367
+ var ScrollAreaScrollbarX = React23.forwardRef((props, forwardedRef) => {
2368
+ const { sizes, onSizesChange, ...scrollbarProps } = props;
2369
+ const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
2370
+ const [computedStyle, setComputedStyle] = React23.useState();
2371
+ const ref = React23.useRef(null);
2372
+ const composeRefs2 = useComposedRefs(forwardedRef, ref, context.onScrollbarXChange);
2373
+ React23.useEffect(() => {
2374
+ if (ref.current) setComputedStyle(getComputedStyle(ref.current));
2375
+ }, [ref]);
2376
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2377
+ ScrollAreaScrollbarImpl,
2378
+ {
2379
+ "data-orientation": "horizontal",
2380
+ ...scrollbarProps,
2381
+ ref: composeRefs2,
2382
+ sizes,
2383
+ style: {
2384
+ bottom: 0,
2385
+ left: context.dir === "rtl" ? "var(--radix-scroll-area-corner-width)" : 0,
2386
+ right: context.dir === "ltr" ? "var(--radix-scroll-area-corner-width)" : 0,
2387
+ ["--radix-scroll-area-thumb-width"]: getThumbSize(sizes) + "px",
2388
+ ...props.style
2389
+ },
2390
+ onThumbPointerDown: (pointerPos) => props.onThumbPointerDown(pointerPos.x),
2391
+ onDragScroll: (pointerPos) => props.onDragScroll(pointerPos.x),
2392
+ onWheelScroll: (event, maxScrollPos) => {
2393
+ if (context.viewport) {
2394
+ const scrollPos = context.viewport.scrollLeft + event.deltaX;
2395
+ props.onWheelScroll(scrollPos);
2396
+ if (isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos)) {
2397
+ event.preventDefault();
2398
+ }
2399
+ }
2400
+ },
2401
+ onResize: () => {
2402
+ if (ref.current && context.viewport && computedStyle) {
2403
+ onSizesChange({
2404
+ content: context.viewport.scrollWidth,
2405
+ viewport: context.viewport.offsetWidth,
2406
+ scrollbar: {
2407
+ size: ref.current.clientWidth,
2408
+ paddingStart: toInt(computedStyle.paddingLeft),
2409
+ paddingEnd: toInt(computedStyle.paddingRight)
2410
+ }
2411
+ });
2412
+ }
2413
+ }
2414
+ }
2415
+ );
2416
+ });
2417
+ var ScrollAreaScrollbarY = React23.forwardRef((props, forwardedRef) => {
2418
+ const { sizes, onSizesChange, ...scrollbarProps } = props;
2419
+ const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
2420
+ const [computedStyle, setComputedStyle] = React23.useState();
2421
+ const ref = React23.useRef(null);
2422
+ const composeRefs2 = useComposedRefs(forwardedRef, ref, context.onScrollbarYChange);
2423
+ React23.useEffect(() => {
2424
+ if (ref.current) setComputedStyle(getComputedStyle(ref.current));
2425
+ }, [ref]);
2426
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2427
+ ScrollAreaScrollbarImpl,
2428
+ {
2429
+ "data-orientation": "vertical",
2430
+ ...scrollbarProps,
2431
+ ref: composeRefs2,
2432
+ sizes,
2433
+ style: {
2434
+ top: 0,
2435
+ right: context.dir === "ltr" ? 0 : void 0,
2436
+ left: context.dir === "rtl" ? 0 : void 0,
2437
+ bottom: "var(--radix-scroll-area-corner-height)",
2438
+ ["--radix-scroll-area-thumb-height"]: getThumbSize(sizes) + "px",
2439
+ ...props.style
2440
+ },
2441
+ onThumbPointerDown: (pointerPos) => props.onThumbPointerDown(pointerPos.y),
2442
+ onDragScroll: (pointerPos) => props.onDragScroll(pointerPos.y),
2443
+ onWheelScroll: (event, maxScrollPos) => {
2444
+ if (context.viewport) {
2445
+ const scrollPos = context.viewport.scrollTop + event.deltaY;
2446
+ props.onWheelScroll(scrollPos);
2447
+ if (isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos)) {
2448
+ event.preventDefault();
2449
+ }
2450
+ }
2451
+ },
2452
+ onResize: () => {
2453
+ if (ref.current && context.viewport && computedStyle) {
2454
+ onSizesChange({
2455
+ content: context.viewport.scrollHeight,
2456
+ viewport: context.viewport.offsetHeight,
2457
+ scrollbar: {
2458
+ size: ref.current.clientHeight,
2459
+ paddingStart: toInt(computedStyle.paddingTop),
2460
+ paddingEnd: toInt(computedStyle.paddingBottom)
2461
+ }
2462
+ });
2463
+ }
2464
+ }
2465
+ }
2466
+ );
2467
+ });
2468
+ var [ScrollbarProvider, useScrollbarContext] = createScrollAreaContext(SCROLLBAR_NAME);
2469
+ var ScrollAreaScrollbarImpl = React23.forwardRef((props, forwardedRef) => {
2470
+ const {
2471
+ __scopeScrollArea,
2472
+ sizes,
2473
+ hasThumb,
2474
+ onThumbChange,
2475
+ onThumbPointerUp,
2476
+ onThumbPointerDown,
2477
+ onThumbPositionChange,
2478
+ onDragScroll,
2479
+ onWheelScroll,
2480
+ onResize,
2481
+ ...scrollbarProps
2482
+ } = props;
2483
+ const context = useScrollAreaContext(SCROLLBAR_NAME, __scopeScrollArea);
2484
+ const [scrollbar, setScrollbar] = React23.useState(null);
2485
+ const composeRefs2 = useComposedRefs(forwardedRef, (node) => setScrollbar(node));
2486
+ const rectRef = React23.useRef(null);
2487
+ const prevWebkitUserSelectRef = React23.useRef("");
2488
+ const viewport = context.viewport;
2489
+ const maxScrollPos = sizes.content - sizes.viewport;
2490
+ const handleWheelScroll = useCallbackRef(onWheelScroll);
2491
+ const handleThumbPositionChange = useCallbackRef(onThumbPositionChange);
2492
+ const handleResize = useDebounceCallback(onResize, 10);
2493
+ function handleDragScroll(event) {
2494
+ if (rectRef.current) {
2495
+ const x = event.clientX - rectRef.current.left;
2496
+ const y = event.clientY - rectRef.current.top;
2497
+ onDragScroll({ x, y });
2498
+ }
2499
+ }
2500
+ React23.useEffect(() => {
2501
+ const handleWheel = (event) => {
2502
+ const element = event.target;
2503
+ const isScrollbarWheel = scrollbar?.contains(element);
2504
+ if (isScrollbarWheel) handleWheelScroll(event, maxScrollPos);
2505
+ };
2506
+ document.addEventListener("wheel", handleWheel, { passive: false });
2507
+ return () => document.removeEventListener("wheel", handleWheel, { passive: false });
2508
+ }, [viewport, scrollbar, maxScrollPos, handleWheelScroll]);
2509
+ React23.useEffect(handleThumbPositionChange, [sizes, handleThumbPositionChange]);
2510
+ useResizeObserver(scrollbar, handleResize);
2511
+ useResizeObserver(context.content, handleResize);
2512
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2513
+ ScrollbarProvider,
2514
+ {
2515
+ scope: __scopeScrollArea,
2516
+ scrollbar,
2517
+ hasThumb,
2518
+ onThumbChange: useCallbackRef(onThumbChange),
2519
+ onThumbPointerUp: useCallbackRef(onThumbPointerUp),
2520
+ onThumbPositionChange: handleThumbPositionChange,
2521
+ onThumbPointerDown: useCallbackRef(onThumbPointerDown),
2522
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2523
+ Primitive.div,
2524
+ {
2525
+ ...scrollbarProps,
2526
+ ref: composeRefs2,
2527
+ style: { position: "absolute", ...scrollbarProps.style },
2528
+ onPointerDown: composeEventHandlers(props.onPointerDown, (event) => {
2529
+ const mainPointer = 0;
2530
+ if (event.button === mainPointer) {
2531
+ const element = event.target;
2532
+ element.setPointerCapture(event.pointerId);
2533
+ rectRef.current = scrollbar.getBoundingClientRect();
2534
+ prevWebkitUserSelectRef.current = document.body.style.webkitUserSelect;
2535
+ document.body.style.webkitUserSelect = "none";
2536
+ if (context.viewport) context.viewport.style.scrollBehavior = "auto";
2537
+ handleDragScroll(event);
2538
+ }
2539
+ }),
2540
+ onPointerMove: composeEventHandlers(props.onPointerMove, handleDragScroll),
2541
+ onPointerUp: composeEventHandlers(props.onPointerUp, (event) => {
2542
+ const element = event.target;
2543
+ if (element.hasPointerCapture(event.pointerId)) {
2544
+ element.releasePointerCapture(event.pointerId);
2545
+ }
2546
+ document.body.style.webkitUserSelect = prevWebkitUserSelectRef.current;
2547
+ if (context.viewport) context.viewport.style.scrollBehavior = "";
2548
+ rectRef.current = null;
2549
+ })
2550
+ }
2551
+ )
2552
+ }
2553
+ );
2554
+ });
2555
+ var THUMB_NAME = "ScrollAreaThumb";
2556
+ var ScrollAreaThumb = React23.forwardRef(
2557
+ (props, forwardedRef) => {
2558
+ const { forceMount, ...thumbProps } = props;
2559
+ const scrollbarContext = useScrollbarContext(THUMB_NAME, props.__scopeScrollArea);
2560
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Presence, { present: forceMount || scrollbarContext.hasThumb, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ScrollAreaThumbImpl, { ref: forwardedRef, ...thumbProps }) });
2561
+ }
2562
+ );
2563
+ var ScrollAreaThumbImpl = React23.forwardRef(
2564
+ (props, forwardedRef) => {
2565
+ const { __scopeScrollArea, style, ...thumbProps } = props;
2566
+ const scrollAreaContext = useScrollAreaContext(THUMB_NAME, __scopeScrollArea);
2567
+ const scrollbarContext = useScrollbarContext(THUMB_NAME, __scopeScrollArea);
2568
+ const { onThumbPositionChange } = scrollbarContext;
2569
+ const composedRef = useComposedRefs(
2570
+ forwardedRef,
2571
+ (node) => scrollbarContext.onThumbChange(node)
2572
+ );
2573
+ const removeUnlinkedScrollListenerRef = React23.useRef(void 0);
2574
+ const debounceScrollEnd = useDebounceCallback(() => {
2575
+ if (removeUnlinkedScrollListenerRef.current) {
2576
+ removeUnlinkedScrollListenerRef.current();
2577
+ removeUnlinkedScrollListenerRef.current = void 0;
2578
+ }
2579
+ }, 100);
2580
+ React23.useEffect(() => {
2581
+ const viewport = scrollAreaContext.viewport;
2582
+ if (viewport) {
2583
+ const handleScroll = () => {
2584
+ debounceScrollEnd();
2585
+ if (!removeUnlinkedScrollListenerRef.current) {
2586
+ const listener = addUnlinkedScrollListener(viewport, onThumbPositionChange);
2587
+ removeUnlinkedScrollListenerRef.current = listener;
2588
+ onThumbPositionChange();
2589
+ }
2590
+ };
2591
+ onThumbPositionChange();
2592
+ viewport.addEventListener("scroll", handleScroll);
2593
+ return () => viewport.removeEventListener("scroll", handleScroll);
2594
+ }
2595
+ }, [scrollAreaContext.viewport, debounceScrollEnd, onThumbPositionChange]);
2596
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2597
+ Primitive.div,
2598
+ {
2599
+ "data-state": scrollbarContext.hasThumb ? "visible" : "hidden",
2600
+ ...thumbProps,
2601
+ ref: composedRef,
2602
+ style: {
2603
+ width: "var(--radix-scroll-area-thumb-width)",
2604
+ height: "var(--radix-scroll-area-thumb-height)",
2605
+ ...style
2606
+ },
2607
+ onPointerDownCapture: composeEventHandlers(props.onPointerDownCapture, (event) => {
2608
+ const thumb = event.target;
2609
+ const thumbRect = thumb.getBoundingClientRect();
2610
+ const x = event.clientX - thumbRect.left;
2611
+ const y = event.clientY - thumbRect.top;
2612
+ scrollbarContext.onThumbPointerDown({ x, y });
2613
+ }),
2614
+ onPointerUp: composeEventHandlers(props.onPointerUp, scrollbarContext.onThumbPointerUp)
2615
+ }
2616
+ );
2617
+ }
2618
+ );
2619
+ ScrollAreaThumb.displayName = THUMB_NAME;
2620
+ var CORNER_NAME = "ScrollAreaCorner";
2621
+ var ScrollAreaCorner = React23.forwardRef(
2622
+ (props, forwardedRef) => {
2623
+ const context = useScrollAreaContext(CORNER_NAME, props.__scopeScrollArea);
2624
+ const hasBothScrollbarsVisible = Boolean(context.scrollbarX && context.scrollbarY);
2625
+ const hasCorner = context.type !== "scroll" && hasBothScrollbarsVisible;
2626
+ return hasCorner ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ScrollAreaCornerImpl, { ...props, ref: forwardedRef }) : null;
2627
+ }
2628
+ );
2629
+ ScrollAreaCorner.displayName = CORNER_NAME;
2630
+ var ScrollAreaCornerImpl = React23.forwardRef((props, forwardedRef) => {
2631
+ const { __scopeScrollArea, ...cornerProps } = props;
2632
+ const context = useScrollAreaContext(CORNER_NAME, __scopeScrollArea);
2633
+ const [width, setWidth] = React23.useState(0);
2634
+ const [height, setHeight] = React23.useState(0);
2635
+ const hasSize = Boolean(width && height);
2636
+ useResizeObserver(context.scrollbarX, () => {
2637
+ const height2 = context.scrollbarX?.offsetHeight || 0;
2638
+ context.onCornerHeightChange(height2);
2639
+ setHeight(height2);
2640
+ });
2641
+ useResizeObserver(context.scrollbarY, () => {
2642
+ const width2 = context.scrollbarY?.offsetWidth || 0;
2643
+ context.onCornerWidthChange(width2);
2644
+ setWidth(width2);
2645
+ });
2646
+ return hasSize ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2647
+ Primitive.div,
2648
+ {
2649
+ ...cornerProps,
2650
+ ref: forwardedRef,
2651
+ style: {
2652
+ width,
2653
+ height,
2654
+ position: "absolute",
2655
+ right: context.dir === "ltr" ? 0 : void 0,
2656
+ left: context.dir === "rtl" ? 0 : void 0,
2657
+ bottom: 0,
2658
+ ...props.style
2659
+ }
2660
+ }
2661
+ ) : null;
2662
+ });
2663
+ function toInt(value) {
2664
+ return value ? parseInt(value, 10) : 0;
2665
+ }
2666
+ function getThumbRatio(viewportSize, contentSize) {
2667
+ const ratio = viewportSize / contentSize;
2668
+ return isNaN(ratio) ? 0 : ratio;
2669
+ }
2670
+ function getThumbSize(sizes) {
2671
+ const ratio = getThumbRatio(sizes.viewport, sizes.content);
2672
+ const scrollbarPadding = sizes.scrollbar.paddingStart + sizes.scrollbar.paddingEnd;
2673
+ const thumbSize = (sizes.scrollbar.size - scrollbarPadding) * ratio;
2674
+ return Math.max(thumbSize, 18);
2675
+ }
2676
+ function getScrollPositionFromPointer(pointerPos, pointerOffset, sizes, dir = "ltr") {
2677
+ const thumbSizePx = getThumbSize(sizes);
2678
+ const thumbCenter = thumbSizePx / 2;
2679
+ const offset = pointerOffset || thumbCenter;
2680
+ const thumbOffsetFromEnd = thumbSizePx - offset;
2681
+ const minPointerPos = sizes.scrollbar.paddingStart + offset;
2682
+ const maxPointerPos = sizes.scrollbar.size - sizes.scrollbar.paddingEnd - thumbOffsetFromEnd;
2683
+ const maxScrollPos = sizes.content - sizes.viewport;
2684
+ const scrollRange = dir === "ltr" ? [0, maxScrollPos] : [maxScrollPos * -1, 0];
2685
+ const interpolate = linearScale([minPointerPos, maxPointerPos], scrollRange);
2686
+ return interpolate(pointerPos);
2687
+ }
2688
+ function getThumbOffsetFromScroll(scrollPos, sizes, dir = "ltr") {
2689
+ const thumbSizePx = getThumbSize(sizes);
2690
+ const scrollbarPadding = sizes.scrollbar.paddingStart + sizes.scrollbar.paddingEnd;
2691
+ const scrollbar = sizes.scrollbar.size - scrollbarPadding;
2692
+ const maxScrollPos = sizes.content - sizes.viewport;
2693
+ const maxThumbPos = scrollbar - thumbSizePx;
2694
+ const scrollClampRange = dir === "ltr" ? [0, maxScrollPos] : [maxScrollPos * -1, 0];
2695
+ const scrollWithoutMomentum = clamp2(scrollPos, scrollClampRange);
2696
+ const interpolate = linearScale([0, maxScrollPos], [0, maxThumbPos]);
2697
+ return interpolate(scrollWithoutMomentum);
2698
+ }
2699
+ function linearScale(input, output) {
2700
+ return (value) => {
2701
+ if (input[0] === input[1] || output[0] === output[1]) return output[0];
2702
+ const ratio = (output[1] - output[0]) / (input[1] - input[0]);
2703
+ return output[0] + ratio * (value - input[0]);
2704
+ };
2705
+ }
2706
+ function isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos) {
2707
+ return scrollPos > 0 && scrollPos < maxScrollPos;
2708
+ }
2709
+ var addUnlinkedScrollListener = (node, handler = () => {
2710
+ }) => {
2711
+ let prevPosition = { left: node.scrollLeft, top: node.scrollTop };
2712
+ let rAF = 0;
2713
+ (function loop() {
2714
+ const position = { left: node.scrollLeft, top: node.scrollTop };
2715
+ const isHorizontalScroll = prevPosition.left !== position.left;
2716
+ const isVerticalScroll = prevPosition.top !== position.top;
2717
+ if (isHorizontalScroll || isVerticalScroll) handler();
2718
+ prevPosition = position;
2719
+ rAF = window.requestAnimationFrame(loop);
2720
+ })();
2721
+ return () => window.cancelAnimationFrame(rAF);
2722
+ };
2723
+ function useDebounceCallback(callback, delay) {
2724
+ const handleCallback = useCallbackRef(callback);
2725
+ const debounceTimerRef = React23.useRef(0);
2726
+ React23.useEffect(() => () => window.clearTimeout(debounceTimerRef.current), []);
2727
+ return React23.useCallback(() => {
2728
+ window.clearTimeout(debounceTimerRef.current);
2729
+ debounceTimerRef.current = window.setTimeout(handleCallback, delay);
2730
+ }, [handleCallback, delay]);
2731
+ }
2732
+ function useResizeObserver(element, onResize) {
2733
+ const handleResize = useCallbackRef(onResize);
2734
+ useLayoutEffect22(() => {
2735
+ let rAF = 0;
2736
+ if (element) {
2737
+ const resizeObserver = new ResizeObserver(() => {
2738
+ cancelAnimationFrame(rAF);
2739
+ rAF = window.requestAnimationFrame(handleResize);
2740
+ });
2741
+ resizeObserver.observe(element);
2742
+ return () => {
2743
+ window.cancelAnimationFrame(rAF);
2744
+ resizeObserver.unobserve(element);
2745
+ };
2746
+ }
2747
+ }, [element, handleResize]);
2748
+ }
2749
+ var Root = ScrollArea;
2750
+ var Viewport = ScrollAreaViewport;
2751
+ var Scrollbar = ScrollAreaScrollbar;
2752
+ var Thumb = ScrollAreaThumb;
2753
+ var Corner = ScrollAreaCorner;
2754
+
2755
+ // src/components/layout/ScrollArea.tsx
2756
+ var import_clsx9 = require("clsx");
2757
+ var import_jsx_runtime16 = require("react/jsx-runtime");
2758
+ var ScrollArea2 = ({
2759
+ children,
2760
+ scrollbarSize = "md",
2761
+ scrollbarType = "auto",
2762
+ scrollbarAxis = "both",
2763
+ className,
2764
+ ...props
2765
+ }) => {
2766
+ const scrollbarStyle = {
2767
+ sm: { "--scrollbar-size": "calc(4px + var(--spacing))" },
2768
+ md: { "--scrollbar-size": "calc(6px + var(--spacing))" }
2769
+ }[scrollbarSize];
2770
+ const hasHorizontalScrollBar = scrollbarAxis === "horizontal" || scrollbarAxis === "both";
2771
+ const hasVerticalScrollBar = scrollbarAxis === "vertical" || scrollbarAxis === "both";
2772
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
2773
+ Root,
2774
+ {
2775
+ ...props,
2776
+ className: (0, import_clsx9.clsx)(
2777
+ "overflow-hidden",
2778
+ className
2779
+ ),
2780
+ style: {
2781
+ ...scrollbarStyle,
2782
+ ...props.style
2783
+ },
2784
+ type: scrollbarType,
2785
+ children: [
2786
+ hasHorizontalScrollBar && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2787
+ Scrollbar,
2788
+ {
2789
+ orientation: "horizontal",
2790
+ className: (0, import_clsx9.clsx)(
2791
+ "peer/horizontal group/scrollbar flex-col-0 rounded-full select-none touch-none bg-scrollbar-track/50 hover:bg-scrollbar-track",
2792
+ {
2793
+ "h-[var(--scrollbar-size)]": scrollbarType === "always",
2794
+ "data-[state=visible]:h-[var(--scrollbar-size)]": scrollbarType !== "always"
2795
+ }
2796
+ ),
2797
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2798
+ Thumb,
2799
+ {
2800
+ className: (0, import_clsx9.clsx)(
2801
+ "flex relative rounded-full bg-scrollbar-thumb group-hover/scrollbar:bg-primary",
2802
+ {
2803
+ "min-h-[var(--scrollbar-size)]": scrollbarType === "always",
2804
+ "data-[state=visible]:min-h-[var(--scrollbar-size)]": scrollbarType !== "always"
2805
+ }
2806
+ )
2807
+ }
2808
+ )
2809
+ }
2810
+ ),
2811
+ hasVerticalScrollBar && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2812
+ Scrollbar,
2813
+ {
2814
+ orientation: "vertical",
2815
+ className: (0, import_clsx9.clsx)(
2816
+ "peer/vertical group/scrollbar flex-col-0 rounded-full select-none touch-none bg-scrollbar-track/50 hover:bg-scrollbar-track",
2817
+ {
2818
+ "w-[var(--scrollbar-size)]": scrollbarType === "always",
2819
+ "data-[state=visible]:w-[var(--scrollbar-size)]": scrollbarType !== "always"
2820
+ }
2821
+ ),
2822
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2823
+ Thumb,
2824
+ {
2825
+ className: (0, import_clsx9.clsx)(
2826
+ "flex relative rounded-full bg-scrollbar-thumb group-hover/scrollbar:bg-primary",
2827
+ {
2828
+ "min-w-[var(--scrollbar-size)]": scrollbarType === "always",
2829
+ "data-[state=visible]:min-w-[var(--scrollbar-size)]": scrollbarType !== "always"
2830
+ }
2831
+ )
2832
+ }
2833
+ )
2834
+ }
2835
+ ),
2836
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2837
+ Viewport,
2838
+ {
2839
+ className: (0, import_clsx9.clsx)(
2840
+ "border-inherit",
2841
+ {
2842
+ "w-[calc(100%_-_var(--scrollbar-size))] h-[calc(100%_-_var(--scrollbar-size))]": scrollbarType === "always",
2843
+ "w-full h-full": scrollbarType === "scroll" || scrollbarType === "hover" || scrollbarType === "auto",
2844
+ "peer-[&:where([data-state=visible])]/horizontal:h-[calc(100%_-_var(--scrollbar-size))] peer-[&:where([data-state=visible])]/vertical:w-[calc(100%_-_var(--scrollbar-size))]": scrollbarType === "auto"
2845
+ }
2846
+ ),
2847
+ children
2848
+ }
2849
+ ),
2850
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2851
+ Corner,
2852
+ {
2853
+ className: (0, import_clsx9.clsx)(
2854
+ "bg-scrollbar-track rounded-full"
2855
+ )
2856
+ }
2857
+ )
2858
+ ]
2859
+ }
2860
+ );
2861
+ };
2862
+
2863
+ // src/components/layout/TextImage.tsx
2864
+ var import_clsx10 = __toESM(require("clsx"));
2865
+
2866
+ // src/localization/defaults/form.ts
2867
+ var formTranslation = {
2868
+ en: {
2869
+ add: "Add",
2870
+ all: "All",
2871
+ apply: "Apply",
2872
+ back: "Back",
2873
+ cancel: "Cancel",
2874
+ change: "Change",
2875
+ clear: "Clear",
2876
+ click: "Click",
2877
+ clickToCopy: "Click to Copy",
2878
+ close: "Close",
2879
+ confirm: "Confirm",
2880
+ copy: "Copy",
2881
+ copied: "Copied",
2882
+ create: "Create",
2883
+ decline: "Decline",
2884
+ delete: "Delete",
2885
+ discard: "Discard",
2886
+ discardChanges: "Discard Changes",
2887
+ done: "Done",
2888
+ edit: "Edit",
2889
+ enterText: "Enter text here",
2890
+ error: "Error",
2891
+ exit: "Exit",
2892
+ fieldRequiredError: "This field is required.",
2893
+ invalidEmailError: "Please enter a valid email address.",
2894
+ less: "Less",
2895
+ loading: "Loading",
2896
+ maxLengthError: "Maximum length exceeded.",
2897
+ minLengthError: "Minimum length not met.",
2898
+ more: "More",
2899
+ next: "Next",
2900
+ no: "No",
2901
+ none: "None",
2902
+ nothingFound: "Nothing found",
2903
+ of: "of",
2904
+ optional: "Optional",
2905
+ pleaseWait: "Please wait...",
2906
+ previous: "Previous",
2907
+ remove: "Remove",
2908
+ required: "Required",
2909
+ reset: "Reset",
2910
+ save: "Save",
2911
+ saved: "Saved",
2912
+ search: "Search",
2913
+ select: "Select",
2914
+ selectOption: "Select an option",
2915
+ show: "Show",
2916
+ showMore: "Show more",
2917
+ showLess: "Show less",
2918
+ submit: "Submit",
2919
+ success: "Success",
2920
+ update: "Update",
2921
+ unsavedChanges: "Unsaved Changes",
2922
+ unsavedChangesSaveQuestion: "Do you want to save your changes?",
2923
+ yes: "Yes"
2924
+ },
2925
+ de: {
2926
+ add: "Hinzuf\xFCgen",
2927
+ all: "Alle",
2928
+ apply: "Anwenden",
2929
+ back: "Zur\xFCck",
2930
+ cancel: "Abbrechen",
2931
+ change: "\xC4ndern",
2932
+ clear: "L\xF6schen",
2933
+ click: "Klicken",
2934
+ clickToCopy: "Zum kopieren klicken",
2935
+ close: "Schlie\xDFen",
2936
+ confirm: "Best\xE4tigen",
2937
+ copy: "Kopieren",
2938
+ copied: "Kopiert",
2939
+ create: "Erstellen",
2940
+ decline: "Ablehnen",
2941
+ delete: "L\xF6schen",
2942
+ discard: "Verwerfen",
2943
+ discardChanges: "\xC4nderungen Verwerfen",
2944
+ done: "Fertig",
2945
+ edit: "Bearbeiten",
2946
+ enterText: "Text hier eingeben",
2947
+ error: "Fehler",
2948
+ exit: "Beenden",
2949
+ fieldRequiredError: "Dieses Feld ist erforderlich.",
2950
+ invalidEmailError: "Bitte geben Sie eine g\xFCltige E-Mail-Adresse ein.",
2951
+ less: "Weniger",
2952
+ loading: "L\xE4dt",
2953
+ maxLengthError: "Maximale L\xE4nge \xFCberschritten.",
2954
+ minLengthError: "Mindestl\xE4nge nicht erreicht.",
2955
+ more: "Mehr",
2956
+ next: "Weiter",
2957
+ no: "Nein",
2958
+ none: "Nichts",
2959
+ nothingFound: "Nichts gefunden",
2960
+ of: "von",
2961
+ optional: "Optional",
2962
+ pleaseWait: "Bitte warten...",
2963
+ previous: "Vorherige",
2964
+ remove: "Entfernen",
2965
+ required: "Erforderlich",
2966
+ reset: "Zur\xFCcksetzen",
2967
+ save: "Speichern",
2968
+ saved: "Gespeichert",
2969
+ search: "Suche",
2970
+ select: "Select",
2971
+ selectOption: "Option ausw\xE4hlen",
2972
+ show: "Anzeigen",
2973
+ showMore: "Mehr anzeigen",
2974
+ showLess: "Weniger anzeigen",
2975
+ submit: "Abschicken",
2976
+ success: "Erfolg",
2977
+ update: "Update",
2978
+ unsavedChanges: "Ungespeicherte \xC4nderungen",
2979
+ unsavedChangesSaveQuestion: "M\xF6chtest du die \xC4nderungen speichern?",
2980
+ yes: "Ja"
2981
+ }
2982
+ };
2983
+
2984
+ // src/components/layout/TextImage.tsx
2985
+ var import_jsx_runtime17 = require("react/jsx-runtime");
2986
+ var TextImage = ({
2987
+ overwriteTranslation,
2988
+ title,
2989
+ description,
2990
+ imageUrl,
2991
+ onShowMoreClicked,
2992
+ color = "primary",
2993
+ badge,
2994
+ contentClassName = "",
2995
+ className = ""
2996
+ }) => {
2997
+ const translation = useTranslation([formTranslation], overwriteTranslation);
2998
+ const chipColorMapping = {
2999
+ primary: "text-text-image-primary-background bg-text-image-primary-text",
3000
+ secondary: "text-text-image-secondary-background bg-text-image-secondary-text",
3001
+ dark: "text-text-image-dark-background bg-text-image-dark-text"
3002
+ };
3003
+ const colorMapping = {
3004
+ primary: "text-text-image-primary-text bg-linear-to-r from-30% from-text-image-primary-background to-text-image-primary-background/55",
3005
+ secondary: "text-text-image-secondary-text bg-linear-to-r from-30% from-text-image-secondary-background to-text-image-secondary-background/55",
3006
+ dark: "text-text-image-dark-text bg-linear-to-r from-30% from-text-image-dark-background to-text-image-dark-background/55"
3007
+ };
3008
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
3009
+ "div",
3010
+ {
3011
+ className: (0, import_clsx10.default)("rounded-2xl w-full", className),
3012
+ style: {
3013
+ backgroundImage: `url(${imageUrl})`,
3014
+ backgroundSize: "cover"
3015
+ },
3016
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
3017
+ "div",
3018
+ {
3019
+ className: (0, import_clsx10.default)(`flex-col-2 px-6 py-12 rounded-2xl h-full`, colorMapping[color], contentClassName),
3020
+ children: [
3021
+ badge && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: (0, import_clsx10.default)(`chip-full mb-2 py-2 px-4 w-fit`, chipColorMapping[color]), children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-lg font-bold", children: badge }) }),
3022
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex-col-1 overflow-hidden", children: [
3023
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "typography-title-lg-semibold", children: title }),
3024
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-ellipsis overflow-hidden", children: description })
3025
+ ] }),
3026
+ onShowMoreClicked && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex-row-2 mt-2 underline", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { onClick: onShowMoreClicked, children: translation("showMore") }) })
3027
+ ]
3028
+ }
3029
+ )
3030
+ }
3031
+ );
3032
+ };
3033
+
3034
+ // src/components/layout/VerticalDivider.tsx
3035
+ var import_jsx_runtime18 = require("react/jsx-runtime");
3036
+ var VerticalDivider = ({
3037
+ width = 1,
3038
+ height = 100,
3039
+ strokeWidth = 4,
3040
+ dashGap = 4,
3041
+ dashLength = 4
3042
+ }) => {
3043
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { width: width + "px", height: height + "px" }, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
3044
+ "svg",
3045
+ {
3046
+ width,
3047
+ height,
3048
+ viewBox: `0 0 ${width} ${height}`,
3049
+ fill: "none",
3050
+ xmlns: "http://www.w3.org/2000/svg",
3051
+ children: [
3052
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3053
+ "line",
3054
+ {
3055
+ opacity: "0.5",
3056
+ x1: width / 2,
3057
+ y1: height,
3058
+ x2: width / 2,
3059
+ y2: "0",
3060
+ stroke: "url(#paint_linear)",
3061
+ strokeWidth,
3062
+ strokeDasharray: `${dashLength} ${dashLength + dashGap}`,
3063
+ strokeLinecap: "round"
3064
+ }
3065
+ ),
3066
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
3067
+ "linearGradient",
3068
+ {
3069
+ id: "paint_linear",
3070
+ x1: width / 2,
3071
+ y1: "0",
3072
+ x2: width / 2,
3073
+ y2: height,
3074
+ gradientUnits: "userSpaceOnUse",
3075
+ children: [
3076
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("stop", { stopOpacity: "0", stopColor: "currentColor" }),
3077
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("stop", { offset: "0.5", stopColor: "currentColor" }),
3078
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("stop", { offset: "1", stopColor: "currentColor", stopOpacity: "0" })
3079
+ ]
3080
+ }
3081
+ ) })
3082
+ ]
3083
+ }
3084
+ ) });
3085
+ };
3086
+ // Annotate the CommonJS export names for ESM import in node:
3087
+ 0 && (module.exports = {
3088
+ ASTNodeInterpreter,
3089
+ Carousel,
3090
+ CarouselSlide,
3091
+ Chip,
3092
+ ChipList,
3093
+ ChipUtil,
3094
+ DividerInserter,
3095
+ Expandable,
3096
+ ExpandableUncontrolled,
3097
+ ExpansionIcon,
3098
+ FAQSection,
3099
+ FloatingContainer,
3100
+ ListBox,
3101
+ ListBoxItem,
3102
+ ListBoxMultiple,
3103
+ ListBoxMultipleUncontrolled,
3104
+ ListBoxPrimitive,
3105
+ ListBoxUncontrolled,
3106
+ MarkdownInterpreter,
3107
+ ScrollArea,
3108
+ TextImage,
3109
+ VerticalDivider
3110
+ });
3111
+ //# sourceMappingURL=index.js.map