tekivex-ui 2.5.15 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (395) hide show
  1. package/dist/charts.cjs +1 -1
  2. package/dist/charts.js +22 -553
  3. package/dist/chunk-B3ph66Zb.js +1 -0
  4. package/dist/chunk-Bc16rJT-.js +1 -0
  5. package/dist/chunk-Dike2DLU.js +3 -0
  6. package/dist/chunk-DjxOP8W4.js +1 -0
  7. package/dist/chunk-DkoFTL1O.js +1 -0
  8. package/dist/chunk-DmRB1Blb.js +1 -0
  9. package/dist/chunk-DnCXUUx5.js +1 -0
  10. package/dist/chunk-LWkKqC8d.js +1 -0
  11. package/dist/chunk-PJ50l0JC.js +1 -0
  12. package/dist/headless.cjs +1 -1
  13. package/dist/headless.js +1 -442
  14. package/dist/i18n.cjs +1 -1
  15. package/dist/i18n.js +1 -733
  16. package/dist/index.cjs +1 -152
  17. package/dist/index.d.ts +4 -2
  18. package/dist/index.js +429 -16786
  19. package/dist/quantum.cjs +1 -89
  20. package/dist/quantum.js +74 -2551
  21. package/dist/realtime.cjs +1 -23
  22. package/dist/realtime.js +1 -804
  23. package/dist/src/a11y/index.d.ts +0 -1
  24. package/dist/src/charts/TkxAreaChart.d.ts +0 -5
  25. package/dist/src/charts/TkxBarChart.d.ts +0 -3
  26. package/dist/src/charts/TkxDonutChart.d.ts +0 -5
  27. package/dist/src/charts/TkxLineChart.d.ts +0 -1
  28. package/dist/src/charts/TkxPieChart.d.ts +0 -3
  29. package/dist/src/charts/TkxRadarChart.d.ts +0 -3
  30. package/dist/src/charts/TkxScatterChart.d.ts +0 -2
  31. package/dist/src/charts/index.d.ts +0 -1
  32. package/dist/src/charts/shared.d.ts +0 -3
  33. package/dist/src/components/TkxAIChatBubble.d.ts +0 -9
  34. package/dist/src/components/TkxAIConfidenceBar.d.ts +0 -6
  35. package/dist/src/components/TkxAIThinking.d.ts +0 -6
  36. package/dist/src/components/TkxAccordion.d.ts +0 -1
  37. package/dist/src/components/TkxAffix.d.ts +0 -1
  38. package/dist/src/components/TkxAlert.d.ts +0 -1
  39. package/dist/src/components/TkxAnchor.d.ts +0 -1
  40. package/dist/src/components/TkxAppBar.d.ts +0 -1
  41. package/dist/src/components/TkxAutocomplete.d.ts +0 -1
  42. package/dist/src/components/TkxAvatar.d.ts +0 -1
  43. package/dist/src/components/TkxBadge.d.ts +0 -1
  44. package/dist/src/components/TkxBottomNav.d.ts +0 -1
  45. package/dist/src/components/TkxBreadcrumb.d.ts +0 -1
  46. package/dist/src/components/TkxButton.d.ts +0 -1
  47. package/dist/src/components/TkxCard.d.ts +0 -1
  48. package/dist/src/components/TkxCarousel.d.ts +0 -1
  49. package/dist/src/components/TkxCascader.d.ts +0 -1
  50. package/dist/src/components/TkxChat.d.ts +0 -1
  51. package/dist/src/components/TkxCheckbox.d.ts +0 -1
  52. package/dist/src/components/TkxClock.d.ts +0 -1
  53. package/dist/src/components/TkxColorPicker.d.ts +0 -1
  54. package/dist/src/components/TkxCommand.d.ts +0 -1
  55. package/dist/src/components/TkxConfigProvider.d.ts +0 -30
  56. package/dist/src/components/TkxDataGrid.d.ts +0 -15
  57. package/dist/src/components/TkxDatePicker.d.ts +0 -1
  58. package/dist/src/components/TkxDivider.d.ts +0 -1
  59. package/dist/src/components/TkxDrawer.d.ts +0 -1
  60. package/dist/src/components/TkxDropdown.d.ts +0 -1
  61. package/dist/src/components/TkxEmpty.d.ts +0 -1
  62. package/dist/src/components/TkxFileUpload.d.ts +0 -1
  63. package/dist/src/components/TkxForm.d.ts +0 -35
  64. package/dist/src/components/TkxIcon.d.ts +0 -1
  65. package/dist/src/components/TkxImage.d.ts +0 -1
  66. package/dist/src/components/TkxInput.d.ts +1 -1
  67. package/dist/src/components/TkxLayout.d.ts +0 -22
  68. package/dist/src/components/TkxList.d.ts +0 -1
  69. package/dist/src/components/TkxLiveFeed.d.ts +0 -1
  70. package/dist/src/components/TkxLiveLog.d.ts +0 -1
  71. package/dist/src/components/TkxLiveMetrics.d.ts +0 -1
  72. package/dist/src/components/TkxLogo.d.ts +0 -1
  73. package/dist/src/components/TkxMarkdown.d.ts +0 -10
  74. package/dist/src/components/TkxMasonry.d.ts +0 -1
  75. package/dist/src/components/TkxMentions.d.ts +0 -1
  76. package/dist/src/components/TkxMenu.d.ts +0 -1
  77. package/dist/src/components/TkxModal.d.ts +0 -1
  78. package/dist/src/components/TkxNumberInput.d.ts +0 -1
  79. package/dist/src/components/TkxOTP.d.ts +0 -1
  80. package/dist/src/components/TkxOrgChart.d.ts +32 -0
  81. package/dist/src/components/TkxPagination.d.ts +0 -1
  82. package/dist/src/components/TkxPlayground.d.ts +0 -13
  83. package/dist/src/components/TkxPopover.d.ts +0 -1
  84. package/dist/src/components/TkxProgress.d.ts +0 -1
  85. package/dist/src/components/TkxQRCode.d.ts +0 -1
  86. package/dist/src/components/TkxQuantumForm.d.ts +0 -1
  87. package/dist/src/components/TkxRadio.d.ts +0 -1
  88. package/dist/src/components/TkxRating.d.ts +0 -1
  89. package/dist/src/components/TkxRealTimeChart.d.ts +0 -1
  90. package/dist/src/components/TkxResult.d.ts +0 -1
  91. package/dist/src/components/TkxRichTextDisplay.d.ts +0 -1
  92. package/dist/src/components/TkxSegmented.d.ts +0 -1
  93. package/dist/src/components/TkxSelect.d.ts +0 -3
  94. package/dist/src/components/TkxSkeleton.d.ts +0 -1
  95. package/dist/src/components/TkxSlider.d.ts +0 -1
  96. package/dist/src/components/TkxSnackbar.d.ts +0 -1
  97. package/dist/src/components/TkxSpeedDial.d.ts +0 -1
  98. package/dist/src/components/TkxSpin.d.ts +0 -1
  99. package/dist/src/components/TkxStatistic.d.ts +0 -1
  100. package/dist/src/components/TkxStepper.d.ts +0 -1
  101. package/dist/src/components/TkxTable.d.ts +0 -1
  102. package/dist/src/components/TkxTabs.d.ts +0 -1
  103. package/dist/src/components/TkxTag.d.ts +0 -1
  104. package/dist/src/components/TkxThemeBuilder.d.ts +0 -1
  105. package/dist/src/components/TkxTimeline.d.ts +0 -1
  106. package/dist/src/components/TkxToast.d.ts +0 -1
  107. package/dist/src/components/TkxToggle.d.ts +0 -1
  108. package/dist/src/components/TkxToolbar.d.ts +0 -1
  109. package/dist/src/components/TkxTooltip.d.ts +0 -1
  110. package/dist/src/components/TkxTour.d.ts +0 -1
  111. package/dist/src/components/TkxTransferList.d.ts +0 -1
  112. package/dist/src/components/TkxTreeView.d.ts +0 -1
  113. package/dist/src/components/TkxTypography.d.ts +0 -1
  114. package/dist/src/components/TkxVideoPlayer.d.ts +0 -1
  115. package/dist/src/components/TkxWatermark.d.ts +0 -1
  116. package/dist/src/components/index.d.ts +1 -1
  117. package/dist/src/engine/css.d.ts +0 -1
  118. package/dist/src/engine/index.d.ts +0 -1
  119. package/dist/src/engine/quantum-ai.d.ts +0 -73
  120. package/dist/src/engine/quantum.d.ts +0 -1
  121. package/dist/src/engine/security.d.ts +45 -9
  122. package/dist/src/engine/tkx.d.ts +0 -53
  123. package/dist/src/engine/wcag.d.ts +0 -1
  124. package/dist/src/headless/index.d.ts +0 -1
  125. package/dist/src/headless/useControllable.d.ts +0 -15
  126. package/dist/src/headless/useDebounce.d.ts +0 -12
  127. package/dist/src/headless/useDisclosure.d.ts +0 -13
  128. package/dist/src/headless/useFormState.d.ts +0 -13
  129. package/dist/src/headless/useInfiniteQuery.d.ts +0 -11
  130. package/dist/src/headless/useIntersectionObserver.d.ts +0 -10
  131. package/dist/src/headless/useListSelection.d.ts +0 -9
  132. package/dist/src/headless/useLocalStorage.d.ts +0 -8
  133. package/dist/src/headless/useMediaQuery.d.ts +0 -10
  134. package/dist/src/headless/useRovingTabIndex.d.ts +0 -15
  135. package/dist/src/headless/useSSE.d.ts +0 -9
  136. package/dist/src/headless/useThrottle.d.ts +0 -7
  137. package/dist/src/headless/useWebSocket.d.ts +0 -9
  138. package/dist/src/hooks/index.d.ts +0 -1
  139. package/dist/src/i18n/I18nProvider.d.ts +0 -1
  140. package/dist/src/i18n/index.d.ts +0 -1
  141. package/dist/src/quantum/index.d.ts +0 -1
  142. package/dist/src/realtime/index.d.ts +0 -1
  143. package/dist/src/themes/index.d.ts +0 -1
  144. package/package.json +5 -3
  145. package/dist/TkxForm-BaO4wvXt.js +0 -320
  146. package/dist/TkxForm-M6ttomry.cjs +0 -12
  147. package/dist/chunk-Bmb41Sf3.cjs +0 -1
  148. package/dist/hooks-6pRsPOyG.js +0 -58
  149. package/dist/hooks-mivgRljH.cjs +0 -1
  150. package/dist/index.d.ts.map +0 -1
  151. package/dist/src/a11y/index.d.ts.map +0 -1
  152. package/dist/src/charts/TkxAreaChart.d.ts.map +0 -1
  153. package/dist/src/charts/TkxBarChart.d.ts.map +0 -1
  154. package/dist/src/charts/TkxDonutChart.d.ts.map +0 -1
  155. package/dist/src/charts/TkxLineChart.d.ts.map +0 -1
  156. package/dist/src/charts/TkxPieChart.d.ts.map +0 -1
  157. package/dist/src/charts/TkxRadarChart.d.ts.map +0 -1
  158. package/dist/src/charts/TkxScatterChart.d.ts.map +0 -1
  159. package/dist/src/charts/index.d.ts.map +0 -1
  160. package/dist/src/charts/shared.d.ts.map +0 -1
  161. package/dist/src/components/TkxAIChatBubble.d.ts.map +0 -1
  162. package/dist/src/components/TkxAIConfidenceBar.d.ts.map +0 -1
  163. package/dist/src/components/TkxAIThinking.d.ts.map +0 -1
  164. package/dist/src/components/TkxAccordion.d.ts.map +0 -1
  165. package/dist/src/components/TkxAffix.d.ts.map +0 -1
  166. package/dist/src/components/TkxAlert.d.ts.map +0 -1
  167. package/dist/src/components/TkxAnchor.d.ts.map +0 -1
  168. package/dist/src/components/TkxAppBar.d.ts.map +0 -1
  169. package/dist/src/components/TkxAutocomplete.d.ts.map +0 -1
  170. package/dist/src/components/TkxAvatar.d.ts.map +0 -1
  171. package/dist/src/components/TkxBadge.d.ts.map +0 -1
  172. package/dist/src/components/TkxBottomNav.d.ts.map +0 -1
  173. package/dist/src/components/TkxBreadcrumb.d.ts.map +0 -1
  174. package/dist/src/components/TkxButton.d.ts.map +0 -1
  175. package/dist/src/components/TkxCard.d.ts.map +0 -1
  176. package/dist/src/components/TkxCarousel.d.ts.map +0 -1
  177. package/dist/src/components/TkxCascader.d.ts.map +0 -1
  178. package/dist/src/components/TkxChat.d.ts.map +0 -1
  179. package/dist/src/components/TkxCheckbox.d.ts.map +0 -1
  180. package/dist/src/components/TkxClock.d.ts.map +0 -1
  181. package/dist/src/components/TkxColorPicker.d.ts.map +0 -1
  182. package/dist/src/components/TkxCommand.d.ts.map +0 -1
  183. package/dist/src/components/TkxConfigProvider.d.ts.map +0 -1
  184. package/dist/src/components/TkxDataGrid.d.ts.map +0 -1
  185. package/dist/src/components/TkxDatePicker.d.ts.map +0 -1
  186. package/dist/src/components/TkxDivider.d.ts.map +0 -1
  187. package/dist/src/components/TkxDrawer.d.ts.map +0 -1
  188. package/dist/src/components/TkxDropdown.d.ts.map +0 -1
  189. package/dist/src/components/TkxEmpty.d.ts.map +0 -1
  190. package/dist/src/components/TkxFileUpload.d.ts.map +0 -1
  191. package/dist/src/components/TkxForm.d.ts.map +0 -1
  192. package/dist/src/components/TkxIcon.d.ts.map +0 -1
  193. package/dist/src/components/TkxImage.d.ts.map +0 -1
  194. package/dist/src/components/TkxInput.d.ts.map +0 -1
  195. package/dist/src/components/TkxLayout.d.ts.map +0 -1
  196. package/dist/src/components/TkxList.d.ts.map +0 -1
  197. package/dist/src/components/TkxLiveFeed.d.ts.map +0 -1
  198. package/dist/src/components/TkxLiveLog.d.ts.map +0 -1
  199. package/dist/src/components/TkxLiveMetrics.d.ts.map +0 -1
  200. package/dist/src/components/TkxLogo.d.ts.map +0 -1
  201. package/dist/src/components/TkxMarkdown.d.ts.map +0 -1
  202. package/dist/src/components/TkxMasonry.d.ts.map +0 -1
  203. package/dist/src/components/TkxMentions.d.ts.map +0 -1
  204. package/dist/src/components/TkxMenu.d.ts.map +0 -1
  205. package/dist/src/components/TkxModal.d.ts.map +0 -1
  206. package/dist/src/components/TkxNumberInput.d.ts.map +0 -1
  207. package/dist/src/components/TkxOTP.d.ts.map +0 -1
  208. package/dist/src/components/TkxPagination.d.ts.map +0 -1
  209. package/dist/src/components/TkxPlayground.d.ts.map +0 -1
  210. package/dist/src/components/TkxPopover.d.ts.map +0 -1
  211. package/dist/src/components/TkxProgress.d.ts.map +0 -1
  212. package/dist/src/components/TkxQRCode.d.ts.map +0 -1
  213. package/dist/src/components/TkxQuantumForm.d.ts.map +0 -1
  214. package/dist/src/components/TkxRadio.d.ts.map +0 -1
  215. package/dist/src/components/TkxRating.d.ts.map +0 -1
  216. package/dist/src/components/TkxRealTimeChart.d.ts.map +0 -1
  217. package/dist/src/components/TkxResult.d.ts.map +0 -1
  218. package/dist/src/components/TkxRichTextDisplay.d.ts.map +0 -1
  219. package/dist/src/components/TkxSegmented.d.ts.map +0 -1
  220. package/dist/src/components/TkxSelect.d.ts.map +0 -1
  221. package/dist/src/components/TkxSkeleton.d.ts.map +0 -1
  222. package/dist/src/components/TkxSlider.d.ts.map +0 -1
  223. package/dist/src/components/TkxSnackbar.d.ts.map +0 -1
  224. package/dist/src/components/TkxSpeedDial.d.ts.map +0 -1
  225. package/dist/src/components/TkxSpin.d.ts.map +0 -1
  226. package/dist/src/components/TkxStatistic.d.ts.map +0 -1
  227. package/dist/src/components/TkxStepper.d.ts.map +0 -1
  228. package/dist/src/components/TkxTable.d.ts.map +0 -1
  229. package/dist/src/components/TkxTabs.d.ts.map +0 -1
  230. package/dist/src/components/TkxTag.d.ts.map +0 -1
  231. package/dist/src/components/TkxThemeBuilder.d.ts.map +0 -1
  232. package/dist/src/components/TkxTimeline.d.ts.map +0 -1
  233. package/dist/src/components/TkxToast.d.ts.map +0 -1
  234. package/dist/src/components/TkxToggle.d.ts.map +0 -1
  235. package/dist/src/components/TkxToolbar.d.ts.map +0 -1
  236. package/dist/src/components/TkxTooltip.d.ts.map +0 -1
  237. package/dist/src/components/TkxTour.d.ts.map +0 -1
  238. package/dist/src/components/TkxTransferList.d.ts.map +0 -1
  239. package/dist/src/components/TkxTreeView.d.ts.map +0 -1
  240. package/dist/src/components/TkxTypography.d.ts.map +0 -1
  241. package/dist/src/components/TkxVideoPlayer.d.ts.map +0 -1
  242. package/dist/src/components/TkxWatermark.d.ts.map +0 -1
  243. package/dist/src/components/index.d.ts.map +0 -1
  244. package/dist/src/engine/css.d.ts.map +0 -1
  245. package/dist/src/engine/index.d.ts.map +0 -1
  246. package/dist/src/engine/quantum-ai.d.ts.map +0 -1
  247. package/dist/src/engine/quantum.d.ts.map +0 -1
  248. package/dist/src/engine/security.d.ts.map +0 -1
  249. package/dist/src/engine/tkx.d.ts.map +0 -1
  250. package/dist/src/engine/wcag.d.ts.map +0 -1
  251. package/dist/src/headless/index.d.ts.map +0 -1
  252. package/dist/src/headless/useControllable.d.ts.map +0 -1
  253. package/dist/src/headless/useDebounce.d.ts.map +0 -1
  254. package/dist/src/headless/useDisclosure.d.ts.map +0 -1
  255. package/dist/src/headless/useFormState.d.ts.map +0 -1
  256. package/dist/src/headless/useInfiniteQuery.d.ts.map +0 -1
  257. package/dist/src/headless/useIntersectionObserver.d.ts.map +0 -1
  258. package/dist/src/headless/useListSelection.d.ts.map +0 -1
  259. package/dist/src/headless/useLocalStorage.d.ts.map +0 -1
  260. package/dist/src/headless/useMediaQuery.d.ts.map +0 -1
  261. package/dist/src/headless/useRovingTabIndex.d.ts.map +0 -1
  262. package/dist/src/headless/useSSE.d.ts.map +0 -1
  263. package/dist/src/headless/useThrottle.d.ts.map +0 -1
  264. package/dist/src/headless/useWebSocket.d.ts.map +0 -1
  265. package/dist/src/hooks/index.d.ts.map +0 -1
  266. package/dist/src/i18n/I18nProvider.d.ts.map +0 -1
  267. package/dist/src/i18n/index.d.ts.map +0 -1
  268. package/dist/src/quantum/index.d.ts.map +0 -1
  269. package/dist/src/realtime/index.d.ts.map +0 -1
  270. package/dist/src/themes/index.d.ts.map +0 -1
  271. package/dist/themes-BbJanqiC.js +0 -498
  272. package/dist/themes-CMq2vWXj.cjs +0 -2
  273. package/dist/tkx-BoP5V5zy.cjs +0 -4
  274. package/dist/tkx-mOKMzvUK.js +0 -1174
  275. package/src/a11y/index.tsx +0 -87
  276. package/src/charts/TkxAreaChart.tsx +0 -121
  277. package/src/charts/TkxBarChart.tsx +0 -117
  278. package/src/charts/TkxDonutChart.tsx +0 -164
  279. package/src/charts/TkxLineChart.tsx +0 -137
  280. package/src/charts/TkxPieChart.tsx +0 -103
  281. package/src/charts/TkxRadarChart.tsx +0 -92
  282. package/src/charts/TkxScatterChart.tsx +0 -104
  283. package/src/charts/index.ts +0 -22
  284. package/src/charts/shared.ts +0 -47
  285. package/src/components/TkxAIChatBubble.tsx +0 -256
  286. package/src/components/TkxAIConfidenceBar.tsx +0 -133
  287. package/src/components/TkxAIThinking.tsx +0 -193
  288. package/src/components/TkxAccordion.tsx +0 -590
  289. package/src/components/TkxAffix.tsx +0 -140
  290. package/src/components/TkxAlert.tsx +0 -94
  291. package/src/components/TkxAnchor.tsx +0 -195
  292. package/src/components/TkxAppBar.tsx +0 -262
  293. package/src/components/TkxAutocomplete.tsx +0 -455
  294. package/src/components/TkxAvatar.tsx +0 -103
  295. package/src/components/TkxBadge.tsx +0 -75
  296. package/src/components/TkxBottomNav.tsx +0 -241
  297. package/src/components/TkxBreadcrumb.tsx +0 -324
  298. package/src/components/TkxButton.tsx +0 -155
  299. package/src/components/TkxCard.tsx +0 -96
  300. package/src/components/TkxCarousel.tsx +0 -554
  301. package/src/components/TkxCascader.tsx +0 -278
  302. package/src/components/TkxChat.tsx +0 -356
  303. package/src/components/TkxCheckbox.tsx +0 -220
  304. package/src/components/TkxClock.tsx +0 -603
  305. package/src/components/TkxColorPicker.tsx +0 -635
  306. package/src/components/TkxCommand.tsx +0 -646
  307. package/src/components/TkxConfigProvider.tsx +0 -460
  308. package/src/components/TkxDataGrid.tsx +0 -941
  309. package/src/components/TkxDatePicker.tsx +0 -1625
  310. package/src/components/TkxDivider.tsx +0 -51
  311. package/src/components/TkxDrawer.tsx +0 -236
  312. package/src/components/TkxDropdown.tsx +0 -804
  313. package/src/components/TkxEmpty.tsx +0 -221
  314. package/src/components/TkxFileUpload.tsx +0 -373
  315. package/src/components/TkxForm.tsx +0 -683
  316. package/src/components/TkxIcon.tsx +0 -685
  317. package/src/components/TkxImage.tsx +0 -279
  318. package/src/components/TkxInput.tsx +0 -103
  319. package/src/components/TkxLayout.tsx +0 -649
  320. package/src/components/TkxList.tsx +0 -244
  321. package/src/components/TkxLiveFeed.tsx +0 -331
  322. package/src/components/TkxLiveLog.tsx +0 -472
  323. package/src/components/TkxLiveMetrics.tsx +0 -315
  324. package/src/components/TkxLogo.tsx +0 -299
  325. package/src/components/TkxMarkdown.tsx +0 -855
  326. package/src/components/TkxMasonry.tsx +0 -178
  327. package/src/components/TkxMentions.tsx +0 -212
  328. package/src/components/TkxMenu.tsx +0 -1044
  329. package/src/components/TkxModal.tsx +0 -122
  330. package/src/components/TkxNumberInput.tsx +0 -410
  331. package/src/components/TkxOTP.tsx +0 -297
  332. package/src/components/TkxPagination.tsx +0 -390
  333. package/src/components/TkxPlayground.tsx +0 -845
  334. package/src/components/TkxPopover.tsx +0 -297
  335. package/src/components/TkxProgress.tsx +0 -114
  336. package/src/components/TkxQRCode.tsx +0 -176
  337. package/src/components/TkxQuantumForm.tsx +0 -594
  338. package/src/components/TkxRadio.tsx +0 -286
  339. package/src/components/TkxRating.tsx +0 -288
  340. package/src/components/TkxRealTimeChart.tsx +0 -383
  341. package/src/components/TkxResult.tsx +0 -130
  342. package/src/components/TkxRichTextDisplay.tsx +0 -396
  343. package/src/components/TkxSegmented.tsx +0 -171
  344. package/src/components/TkxSelect.tsx +0 -1130
  345. package/src/components/TkxSkeleton.tsx +0 -107
  346. package/src/components/TkxSlider.tsx +0 -495
  347. package/src/components/TkxSnackbar.tsx +0 -316
  348. package/src/components/TkxSpeedDial.tsx +0 -397
  349. package/src/components/TkxSpin.tsx +0 -263
  350. package/src/components/TkxStatistic.tsx +0 -263
  351. package/src/components/TkxStepper.tsx +0 -487
  352. package/src/components/TkxTable.tsx +0 -424
  353. package/src/components/TkxTabs.tsx +0 -126
  354. package/src/components/TkxTag.tsx +0 -321
  355. package/src/components/TkxThemeBuilder.tsx +0 -687
  356. package/src/components/TkxTimeline.tsx +0 -305
  357. package/src/components/TkxToast.tsx +0 -287
  358. package/src/components/TkxToggle.tsx +0 -95
  359. package/src/components/TkxToolbar.tsx +0 -262
  360. package/src/components/TkxTooltip.tsx +0 -85
  361. package/src/components/TkxTour.tsx +0 -241
  362. package/src/components/TkxTransferList.tsx +0 -489
  363. package/src/components/TkxTreeView.tsx +0 -423
  364. package/src/components/TkxTypography.tsx +0 -267
  365. package/src/components/TkxVideoPlayer.tsx +0 -1015
  366. package/src/components/TkxWatermark.tsx +0 -145
  367. package/src/components/index.ts +0 -80
  368. package/src/engine/css.ts +0 -126
  369. package/src/engine/index.ts +0 -12
  370. package/src/engine/quantum-ai.ts +0 -1045
  371. package/src/engine/quantum.ts +0 -207
  372. package/src/engine/security.ts +0 -232
  373. package/src/engine/tkx.ts +0 -1084
  374. package/src/engine/wcag.ts +0 -276
  375. package/src/headless/index.ts +0 -52
  376. package/src/headless/useControllable.ts +0 -42
  377. package/src/headless/useDebounce.ts +0 -37
  378. package/src/headless/useDisclosure.ts +0 -30
  379. package/src/headless/useFormState.ts +0 -113
  380. package/src/headless/useInfiniteQuery.ts +0 -155
  381. package/src/headless/useIntersectionObserver.ts +0 -53
  382. package/src/headless/useListSelection.ts +0 -103
  383. package/src/headless/useLocalStorage.ts +0 -48
  384. package/src/headless/useMediaQuery.ts +0 -39
  385. package/src/headless/useRovingTabIndex.ts +0 -86
  386. package/src/headless/useSSE.ts +0 -167
  387. package/src/headless/useThrottle.ts +0 -48
  388. package/src/headless/useWebSocket.ts +0 -231
  389. package/src/hooks/index.ts +0 -122
  390. package/src/i18n/I18nProvider.tsx +0 -36
  391. package/src/i18n/index.ts +0 -877
  392. package/src/quantum/index.ts +0 -39
  393. package/src/realtime/index.ts +0 -21
  394. package/src/styles/global.css +0 -167
  395. package/src/themes/index.ts +0 -294
package/dist/index.cjs CHANGED
@@ -1,152 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./chunk-Bmb41Sf3.cjs`),t=require(`./themes-CMq2vWXj.cjs`),n=require(`./tkx-BoP5V5zy.cjs`),r=require(`./hooks-mivgRljH.cjs`),i=require(`./TkxForm-M6ttomry.cjs`),a=require(`./i18n.cjs`);let o=require(`react`);o=e.t(o,1);let s=require(`react/jsx-runtime`),c=require(`react-dom`);var l={sm:`text-xs font-semibold`,md:`text-sm font-semibold`,lg:`text-base font-semibold`,xl:`text-lg font-semibold`},u={sm:`py-1.5 px-3`,md:`py-2 px-4`,lg:`py-2.5 px-5`,xl:`py-3 px-6`},d={sm:`min-h-[32px]`,md:`min-h-[40px]`,lg:`min-h-[48px]`,xl:`min-h-[56px]`},f={sm:14,md:16,lg:18,xl:20};function p({size:e}){let t=f[e];return(0,s.jsxs)(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":`true`,className:n.a(`animate-spin shrink-0`),children:[(0,s.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`3`,strokeOpacity:`0.25`}),(0,s.jsx)(`path`,{d:`M12 2a10 10 0 0 1 10 10`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`})]})}var m=(0,o.forwardRef)(({variant:e=`solid`,size:i=`md`,colorScheme:a=`primary`,isLoading:o=!1,loadingText:c,leftIcon:f,rightIcon:m,isFullWidth:h=!1,glow:g=!1,disabled:_,children:v,className:y,style:b,...x},S)=>{let C=t.f(),w=r.o(),T=_||o,E={primary:C.primary,secondary:C.secondary,danger:C.danger,warning:C.warning,success:C.success}[a],D=t.v(E,[`#ffffff`,`#000000`,C.bg]),O=typeof v==`string`?n.m(v):v,k=c?n.m(c):void 0,A=e===`solid`?{backgroundColor:E,color:D,border:`none`,boxShadow:g&&!w?`0 0 20px ${E}55`:void 0}:e===`outline`?{backgroundColor:`transparent`,color:E,border:`2px solid ${E}`}:e===`ghost`?{backgroundColor:`transparent`,color:E,border:`none`}:{backgroundColor:`transparent`,color:E,border:`none`,textDecoration:`underline`};return(0,s.jsx)(`button`,{ref:S,"aria-busy":o,"aria-disabled":T,disabled:T,className:n.t(n.a(`inline-flex items-center justify-center gap-2`,`rounded-lg font-sans font-semibold`,`select-none relative overflow-hidden`,l[i],u[i],d[i],e!==`link`&&d[i],h&&`w-full`,T?`cursor-not-allowed opacity-60`:`cursor-pointer`,!w&&`transition-all duration-200`,`focus-visible:focus-ring`),y),style:{...A,...b},...x,children:o?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(p,{size:i}),k??O]}):(0,s.jsxs)(s.Fragment,{children:[f&&(0,s.jsx)(`span`,{"aria-hidden":`true`,children:f}),O,m&&(0,s.jsx)(`span`,{"aria-hidden":`true`,children:m})]})})});m.displayName=`TkxButton`;var h={none:``,sm:`p-3`,md:`p-5`,lg:`p-7`},g=(0,o.forwardRef)(({variant:e=`default`,isHoverable:i,isClickable:a,padding:o=`md`,as:c,children:l,className:u,style:d,...f},p)=>{let m=t.f(),g=r.o(),_=c??(a?`button`:`div`),v={default:{backgroundColor:m.surface,border:`1px solid ${m.border}`},glass:{backgroundColor:`${m.surface}cc`,backdropFilter:`blur(12px)`,border:`1px solid ${m.border}55`,boxShadow:`0 4px 24px ${m.bg}40`},quantum:{backgroundColor:m.surfaceAlt,border:`1px solid ${m.primary}33`,boxShadow:`0 0 24px ${m.primary}18`},elevated:{backgroundColor:m.surface,boxShadow:`0 4px 20px ${m.bg}60`},outlined:{backgroundColor:`transparent`,border:`2px solid ${m.border}`}}[e];return(0,s.jsx)(_,{ref:p,className:n.t(`tkx-card`,n.a(`rounded-xl w-full text-left block font-sans focus-visible:focus-ring`,h[o],(i||a)&&!g&&`transition-transform duration-150 hover:scale-[1.01]`,a?`cursor-pointer`:`cursor-default`),u),style:{color:m.text,...v,...d},...f,children:l})});g.displayName=`TkxCard`;function _({title:e,subtitle:r,action:i,children:a,className:o,...c}){let l=t.f();return(0,s.jsxs)(`div`,{className:n.t(n.a(`flex justify-between items-start mb-4`),o),...c,children:[(0,s.jsxs)(`div`,{className:n.a(`flex-1 min-w-0`),children:[e&&(0,s.jsx)(`h3`,{className:n.a(`text-base font-semibold m-0`),style:{color:l.text},children:e}),r&&(0,s.jsx)(`p`,{className:n.a(`text-sm mt-1 mb-0`),style:{color:l.textMuted},children:r}),a]}),i&&(0,s.jsx)(`div`,{className:n.a(`ml-3 shrink-0`),children:i})]})}function v({children:e,className:t,...r}){return(0,s.jsx)(`div`,{className:n.t(n.a(``),t),...r,children:e})}function y({children:e,className:r,style:i,...a}){let o=t.f();return(0,s.jsx)(`div`,{className:n.t(n.a(`flex items-center justify-end gap-2 mt-4 pt-4`),r),style:{borderTop:`1px solid ${o.border}`,...i},...a,children:e})}var b=(0,o.forwardRef)(({label:e,id:r,error:i,hint:a,leftAddon:c,rightAddon:l,isInvalid:u,isRequired:d,disabled:f,className:p,style:m,...h},g)=>{let _=t.f(),v=(0,o.useId)(),y=r??v,b=`${y}-hint`,x=`${y}-error`,S=u||!!i,C=[a&&b,S&&x].filter(Boolean).join(` `)||void 0,w=n.m(e),T=i?n.m(i):void 0,E=a?n.m(a):void 0,D=S?_.danger:_.border;return(0,s.jsxs)(`div`,{className:n.t(n.a(`flex flex-col gap-1 w-full`),p),style:m,children:[(0,s.jsxs)(`label`,{htmlFor:y,className:n.a(`text-sm font-medium font-sans`),style:{color:_.text},children:[w,d&&(0,s.jsx)(`span`,{"aria-hidden":`true`,className:n.a(`ml-1`),style:{color:_.danger},children:`*`})]}),(0,s.jsxs)(`div`,{className:n.a(`flex items-center rounded-lg overflow-hidden`,`transition-colors duration-150`,f?`opacity-60`:``),style:{border:`1.5px solid ${D}`,backgroundColor:_.surface},children:[c&&(0,s.jsx)(`div`,{className:n.a(`px-2.5 self-stretch flex items-center text-sm shrink-0`),style:{backgroundColor:_.surfaceAlt,color:_.textMuted,borderRight:`1px solid ${_.border}`},children:c}),(0,s.jsx)(`input`,{ref:g,id:y,"aria-invalid":S,"aria-required":d,"aria-describedby":C,disabled:f,className:n.t(n.a(`flex-1 border-none bg-transparent text-sm font-sans py-2.5 px-3 outline-none min-w-0 focus-visible:focus-ring`)),style:{color:_.text},...h}),l&&(0,s.jsx)(`div`,{className:n.a(`px-2.5 self-stretch flex items-center text-sm shrink-0`),style:{backgroundColor:_.surfaceAlt,color:_.textMuted,borderLeft:`1px solid ${_.border}`},children:l})]}),E&&!T&&(0,s.jsx)(`span`,{id:b,className:n.a(`text-xs`),style:{color:_.textMuted},children:E}),T&&(0,s.jsxs)(`span`,{id:x,role:`alert`,className:n.a(`text-xs flex items-center gap-1`),style:{color:_.danger},children:[(0,s.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z`})}),T]})]})});b.displayName=`TkxInput`;var x={sm:`text-xs px-1.5 py-[2px] min-h-[16px]`,md:`text-xs px-2 py-[3px] min-h-[20px]`,lg:`text-sm px-3 py-1 min-h-[24px]`},S={sm:`size-[6px]`,md:`size-2`,lg:`size-2.5`},C=(0,o.forwardRef)(({variant:e=`default`,size:r=`md`,dot:i=!1,pulse:a=!1,outlined:o=!1,children:c,className:l,style:u,...d},f)=>{let p=t.f(),m={default:p.border,primary:p.primary,secondary:p.secondary,danger:p.danger,warning:p.warning,success:p.success,info:p.info}[e]||`#666666`,h=t.v(m,[`#ffffff`,`#000000`,p.bg||`#000000`]),g=typeof c==`string`?n.m(c):c;return i?(0,s.jsx)(`span`,{ref:f,"aria-label":typeof c==`string`?n.m(c):void 0,className:n.t(n.a(`inline-block rounded-full`,S[r],a&&`animate-pulse`),l),style:{backgroundColor:m,...u},...d}):(0,s.jsx)(`span`,{ref:f,className:n.t(n.a(`inline-flex items-center justify-center rounded-full font-semibold font-sans tracking-wide`,x[r],a&&`animate-pulse`),l),style:{backgroundColor:o?`transparent`:m,color:o?m:h,border:o?`1px solid ${m}`:`none`,...u},...d,children:g})});C.displayName=`TkxBadge`;var w={sm:`4px`,md:`8px`,lg:`12px`},T={sm:32,md:48,lg:64},E=(0,o.forwardRef)(({value:e,variant:i=`linear`,size:a=`md`,label:o,showValue:c,color:l,className:u,style:d,...f},p)=>{let m=t.f(),h=r.o(),g=l??m.primary,_=e===void 0,v=e===void 0?0:Math.min(100,Math.max(0,e));if(e!==void 0){let{errors:t}=n.h({value:e},{value:{type:`number`,min:0,max:100}});t.length>0&&console.warn(`[TkxProgress]`,t.join(`, `))}if(i===`circular`){let e=T[a],t=a===`sm`?3:a===`md`?4:5,r=(e-t*2)/2,i=2*Math.PI*r,l=_?0:i-v/100*i;return(0,s.jsxs)(`div`,{ref:p,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":_?void 0:v,"aria-label":o??(_?`Loading`:`${v}%`),className:n.t(n.a(`inline-flex flex-col items-center gap-1`),u),style:d,children:[(0,s.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 ${e} ${e}`,"aria-hidden":`true`,children:[(0,s.jsx)(`circle`,{cx:e/2,cy:e/2,r,fill:`none`,stroke:m.border,strokeWidth:t}),(0,s.jsx)(`circle`,{cx:e/2,cy:e/2,r,fill:`none`,stroke:g,strokeWidth:t,strokeLinecap:`round`,strokeDasharray:i,strokeDashoffset:l,transform:`rotate(-90 ${e/2} ${e/2})`,style:{transition:h?`none`:`stroke-dashoffset 300ms ease`,animation:_&&!h?`tkx-spin 1s linear infinite`:void 0}})]}),c&&!_&&(0,s.jsxs)(`span`,{className:n.a(`text-xs`),style:{color:m.textMuted},children:[v,`%`]})]})}let y=w[a];return(0,s.jsxs)(`div`,{ref:p,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":_?void 0:v,"aria-label":o??(_?`Loading`:`${v}%`),className:n.t(n.a(`flex flex-col gap-1 w-full`),u),style:d,children:[o&&(0,s.jsxs)(`div`,{className:n.a(`flex justify-between text-sm`),style:{color:m.text},children:[(0,s.jsx)(`span`,{children:o}),c&&!_&&(0,s.jsxs)(`span`,{children:[v,`%`]})]}),(0,s.jsx)(`div`,{className:n.a(`w-full overflow-hidden`),style:{height:y,borderRadius:y,backgroundColor:m.border},children:(0,s.jsx)(`div`,{style:{height:`100%`,borderRadius:y,backgroundColor:g,width:_?`40%`:`${v}%`,transition:h?`none`:`width 300ms ease`,animation:_&&!h?`tkx-shimmer 1.5s ease-in-out infinite`:void 0}})})]})});E.displayName=`TkxProgress`;var D={sm:{tw:28,th:16,td:10,gap:3},md:{tw:40,th:22,td:14,gap:4},lg:{tw:52,th:28,td:18,gap:5}},O=(0,o.forwardRef)(({checked:e,onChange:i,label:a,size:c=`md`,hideLabel:l,disabled:u,className:d,style:f,...p},m)=>{let h=t.f(),g=r.o(),_=(0,o.useId)();n.h({label:a,checked:e},{label:{type:`string`,required:!0},checked:{type:`boolean`,required:!0}});let{tw:v,th:y,td:b,gap:x}=D[c],S=e?v-b-x:x,C=e?h.primary:h.border;return(0,s.jsxs)(`div`,{className:n.t(n.a(`inline-flex items-center gap-2`,u?`opacity-50`:``),d),style:f,children:[!l&&(0,s.jsx)(`label`,{htmlFor:_,className:n.a(`text-sm font-sans`,u?`cursor-not-allowed`:`cursor-pointer`,`select-none`),style:{color:h.text},children:a}),(0,s.jsx)(`button`,{ref:m,id:_,role:`switch`,"aria-checked":e,"aria-label":l?a:void 0,disabled:u,onClick:()=>!u&&i(!e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&!u&&(t.preventDefault(),i(!e))},className:n.t(n.a(`relative border-none p-0 outline-none shrink-0 focus-visible:focus-ring`,u?`cursor-not-allowed`:`cursor-pointer`,!g&&`transition-colors duration-200`)),style:{width:v,height:y,borderRadius:y,backgroundColor:C},...p,children:(0,s.jsx)(`span`,{"aria-hidden":`true`,className:n.a(`absolute rounded-full`),style:{top:`50%`,left:S,width:b,height:b,transform:`translateY(-50%)`,backgroundColor:`#ffffff`,boxShadow:`0 1px 3px rgba(0,0,0,0.3)`,transition:g?`none`:`left 200ms ease`}})})]})});O.displayName=`TkxToggle`;var k={info:(0,s.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z`})}),success:(0,s.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm-2 14.5l-4-4 1.41-1.41L10 13.67l6.59-6.59L18 8.5l-8 8z`})}),warning:(0,s.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z`})}),danger:(0,s.jsx)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z`})})};function A({variant:e,title:i,children:a,dismissible:c,onDismiss:l,icon:u,style:d,className:f}){let p=t.f(),m=r.t(),h=i?n.m(i):void 0;(0,o.useEffect)(()=>{h&&m(h,e===`danger`||e===`warning`?`assertive`:`polite`)},[h,e]);let g={info:p.info,success:p.success,warning:p.warning,danger:p.danger}[e];return(0,s.jsxs)(`div`,{role:e===`danger`||e===`warning`?`alert`:`status`,className:n.a(`flex items-start gap-3 px-4 py-3 rounded-lg border animate-fade-in font-sans`,f??``),style:{backgroundColor:`${g}18`,borderColor:g,color:p.text,...d},children:[(0,s.jsx)(`span`,{className:n.a(`shrink-0 mt-[1px]`),style:{color:g},children:u??k[e]}),(0,s.jsxs)(`div`,{className:n.a(`flex-1 min-w-0`),children:[h&&(0,s.jsx)(`p`,{className:n.a(`m-0 font-semibold text-sm mb-1`),children:h}),(0,s.jsx)(`div`,{className:n.a(`text-sm leading-relaxed`),children:a})]}),c&&l&&(0,s.jsx)(`button`,{"aria-label":`Dismiss alert`,onClick:l,className:n.a(`bg-transparent border-none cursor-pointer rounded p-[2px] shrink-0 flex items-center justify-center focus-visible:focus-ring`),style:{color:p.textMuted},children:(0,s.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,"aria-hidden":`true`,children:[(0,s.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,s.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]})}var j={sm:`400px`,md:`560px`,lg:`720px`,full:`100vw`},M=0;function N(){++M===1&&(document.body.style.overflow=`hidden`)}function P(){--M<=0&&(M=0,document.body.style.overflow=``)}function F({isOpen:e,onClose:i,title:a,size:l=`md`,closeOnOverlayClick:u=!0,closeOnEscape:d=!0,children:f,footer:p}){let m=t.f(),h=(0,o.useId)(),g=r.i(e),_=r.o(),v=r.t(),y=n.m(a),b=l===`full`;return r.r(i,d&&e),(0,o.useEffect)(()=>(e?(N(),v(y,`polite`)):P(),()=>{e&&P()}),[e,y,v]),!e||typeof document>`u`?null:(0,c.createPortal)((0,s.jsxs)(`div`,{role:`presentation`,className:n.a(`fixed inset-0 z-[9000] flex`,b?`items-stretch`:`items-center justify-center`,b?``:`p-4`),children:[(0,s.jsx)(`div`,{"aria-hidden":`true`,onClick:u?i:void 0,className:n.a(`absolute inset-0`,!_&&`animate-fade-in`),style:{backgroundColor:`rgba(0,0,0,0.6)`,backdropFilter:`blur(4px)`}}),(0,s.jsxs)(`div`,{ref:g,role:`dialog`,"aria-modal":`true`,"aria-labelledby":h,className:n.a(`relative z-10 flex flex-col overflow-hidden`,!_&&`animate-slide-up`,b?``:`rounded-xl`),style:{backgroundColor:m.surface,border:`1px solid ${m.border}`,width:j[l],maxWidth:`100%`,maxHeight:b?`100vh`:`90vh`,boxShadow:`0 20px 60px ${m.bg}80`},children:[(0,s.jsxs)(`div`,{className:n.a(`flex items-center justify-between px-6 py-5 shrink-0`),style:{borderBottom:`1px solid ${m.border}`},children:[(0,s.jsx)(`h2`,{id:h,className:n.a(`m-0 text-lg font-semibold font-sans`),style:{color:m.text},children:y}),(0,s.jsx)(`button`,{onClick:i,"aria-label":`Close dialog`,className:n.a(`bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring`),style:{color:m.textMuted},children:(0,s.jsxs)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,"aria-hidden":`true`,children:[(0,s.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,s.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]}),(0,s.jsx)(`div`,{className:n.a(`flex-1 overflow-y-auto px-6 py-6 font-sans`),style:{color:m.text},children:f}),p&&(0,s.jsx)(`div`,{className:n.a(`flex justify-end gap-2 px-6 py-4 shrink-0`),style:{borderTop:`1px solid ${m.border}`},children:p})]})]}),document.body)}var I=(0,o.createContext)(null);function L(){let e=(0,o.useContext)(I);if(!e)throw Error(`TkxTab must be used inside TkxTabs`);return e}function R({defaultIndex:e=0,activeIndex:t,onChange:n,children:r,tabCount:i=0,style:a,className:c}){let[l,u]=(0,o.useState)(e),d=(0,o.useId)(),f=t===void 0?l:t;return(0,s.jsx)(I.Provider,{value:{activeIndex:f,setActiveIndex:e=>{t===void 0&&u(e),n?.(e)},baseId:d,tabCount:i},children:(0,s.jsx)(`div`,{className:c,style:a,children:r})})}function z({children:e,className:r,style:i,...a}){let o=t.f();return(0,s.jsx)(`div`,{role:`tablist`,className:n.t(n.a(`flex gap-1`),r),style:{borderBottom:`2px solid ${o.border}`,...i},...a,children:e})}function B({index:e,children:r,disabled:i=!1,className:a,style:c}){let l=t.f(),{activeIndex:u,setActiveIndex:d,baseId:f,tabCount:p}=L(),m=(0,o.useRef)(null),h=u===e;return(0,s.jsx)(`button`,{ref:m,role:`tab`,id:`${f}-tab-${e}`,"aria-controls":`${f}-panel-${e}`,"aria-selected":h,tabIndex:h?0:-1,disabled:i,className:n.t(n.a(`border-none bg-transparent font-sans text-sm rounded-t cursor-pointer select-none`,`py-2.5 px-4 transition-colors duration-150 focus-visible:focus-ring`,i?`opacity-50 cursor-not-allowed`:``),a),style:{color:h?l.primary:l.textMuted,fontWeight:h?600:400,borderBottom:h?`2px solid ${l.primary}`:`2px solid transparent`,marginBottom:`-2px`,...c},onClick:()=>!i&&d(e),onKeyDown:n=>t.y(n,e,p,e=>{d(e),document.getElementById(`${f}-tab-${e}`)?.focus()}),children:r})}function V({children:e,className:t,...n}){return(0,s.jsx)(`div`,{className:t,...n,children:e})}function H({index:e,children:t,style:r,className:i}){let{activeIndex:a,baseId:o}=L();return a===e?(0,s.jsx)(`div`,{role:`tabpanel`,id:`${o}-panel-${e}`,"aria-labelledby":`${o}-tab-${e}`,tabIndex:0,className:n.t(n.a(`pt-4`),i),style:r,children:t}):null}var U={top:{bottom:`100%`,left:`50%`,transform:`translateX(-50%)`,marginBottom:6},bottom:{top:`100%`,left:`50%`,transform:`translateX(-50%)`,marginTop:6},left:{right:`100%`,top:`50%`,transform:`translateY(-50%)`,marginRight:6},right:{left:`100%`,top:`50%`,transform:`translateY(-50%)`,marginLeft:6}};function W({content:e,children:i,placement:a=`top`,delay:c=300}){let l=t.f(),[u,d]=(0,o.useState)(!1),f=(0,o.useRef)(null),p=(0,o.useId)(),m=(0,o.useRef)(null),h=r.o(),g=n.m(e),_=t.v(l.surfaceAlt,[l.text,`#ffffff`,`#000000`]);function v(){m.current=setTimeout(()=>d(!0),c)}function y(){m.current&&clearTimeout(m.current),d(!1)}r.r(y,u),r.n(f,y),(0,o.useEffect)(()=>()=>{m.current&&=(clearTimeout(m.current),null)},[]);let b=i,x=(0,o.cloneElement)(b,{"aria-describedby":u?p:void 0,onMouseEnter:e=>{b.props.onMouseEnter?.(e),v()},onMouseLeave:e=>{b.props.onMouseLeave?.(e),y()},onFocus:e=>{b.props.onFocus?.(e),v()},onBlur:e=>{b.props.onBlur?.(e),y()}});return(0,s.jsxs)(`span`,{ref:f,className:n.a(`relative inline-flex`),children:[x,u&&(0,s.jsx)(`span`,{id:p,role:`tooltip`,className:n.a(`absolute z-[9000] text-xs font-sans py-1.5 px-2.5 rounded-md whitespace-nowrap pointer-events-none`,!h&&`animate-fade-in`),style:{backgroundColor:l.surfaceAlt,color:_,border:`1px solid ${l.border}`,boxShadow:`0 4px 12px ${l.bg}40`,maxWidth:280,...U[a]},children:g})]})}function G({variant:e,width:t,height:r,animation:i,bgColor:a,accentColor:o}){let c=t===void 0?`100%`:typeof t==`number`?`${t}px`:t,l=r===void 0?{text:`1em`,circular:c,rectangular:`80px`}[e]:typeof r==`number`?`${r}px`:r,u=n.a(e===`circular`?`rounded-full`:e===`text`?`rounded`:`rounded-lg`),d=i===`pulse`?n.a(`animate-pulse`):i===`wave`?n.a(`animate-shimmer`):``,f=i===`wave`?{background:`linear-gradient(90deg,${a} 25%,${o} 50%,${a} 75%)`,backgroundSize:`200% 100%`}:{backgroundColor:a};return(0,s.jsx)(`div`,{className:n.t(u,d),style:{width:c,height:l,...f}})}var K=(0,o.forwardRef)(({variant:e=`rectangular`,width:i,height:a,lines:o,animation:c=`pulse`,className:l,style:u,...d},f)=>{let p=t.f(),m=r.o()?!1:c;return e===`text`&&o&&o>1?(0,s.jsx)(`div`,{ref:f,role:`progressbar`,"aria-busy":`true`,"aria-label":`Loading...`,className:n.t(n.a(`flex flex-col gap-2`),l),style:u,...d,children:Array.from({length:o},(e,t)=>(0,s.jsx)(G,{variant:`text`,width:t===o-1?`75%`:i,height:a,animation:m,bgColor:p.surfaceAlt,accentColor:p.border},t))}):(0,s.jsx)(`div`,{ref:f,role:`progressbar`,"aria-busy":`true`,"aria-label":`Loading...`,className:l,style:u,...d,children:(0,s.jsx)(G,{variant:e,width:i,height:a,animation:m,bgColor:p.surfaceAlt,accentColor:p.border})})});K.displayName=`TkxSkeleton`;var q={xs:24,sm:32,md:40,lg:56,xl:72},J={online:`#06d6a0`,offline:`#8888aa`,away:`#ffbe0b`,busy:`#f72585`},Y=(0,o.forwardRef)(({src:e,alt:r,initials:i,size:a=`md`,shape:c=`circle`,status:l,className:u,style:d,...f},p)=>{let m=t.f(),[h,g]=(0,o.useState)(!1),_=q[a],v=c===`circle`,y=m.surfaceAlt,b=t.v(y,[m.text,m.textMuted]),x=e&&!h,S=!x&&i,C=Math.max(8,_*.22),w=n.a(`relative inline-flex shrink-0`,v?`rounded-full`:`rounded-lg`),T=n.a(`block object-cover`,v?`rounded-full`:`rounded-lg`),E=n.a(`flex items-center justify-center font-semibold font-sans select-none`,v?`rounded-full`:`rounded-lg`);return(0,s.jsxs)(`div`,{ref:p,className:n.t(w,u),style:{width:_,height:_,...d},...f,children:[x?(0,s.jsx)(`img`,{src:n.m(e),alt:n.m(r),onError:()=>g(!0),className:T,style:{width:_,height:_}}):(0,s.jsx)(`div`,{role:`img`,"aria-label":n.m(r),className:E,style:{width:_,height:_,backgroundColor:y,color:b,fontSize:_*.38},children:S?n.m(i).slice(0,2).toUpperCase():(0,s.jsxs)(`svg`,{width:_*.5,height:_*.5,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,"aria-hidden":`true`,children:[(0,s.jsx)(`path`,{d:`M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2`}),(0,s.jsx)(`circle`,{cx:`12`,cy:`7`,r:`4`})]})}),l&&(0,s.jsx)(`span`,{"aria-label":`Status: ${l}`,className:n.a(`absolute bottom-0 right-0 rounded-full`),style:{width:C,height:C,backgroundColor:J[l],border:`2px solid ${m.bg}`}})]})});Y.displayName=`TkxAvatar`;function ee({dir:e}){return(0,s.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,className:n.a(`shrink-0`),children:e===`asc`?(0,s.jsx)(`path`,{d:`M7 14l5-5 5 5H7z`}):e===`desc`?(0,s.jsx)(`path`,{d:`M7 10l5 5 5-5H7z`}):(0,s.jsx)(`path`,{d:`M7 10l5 5 5-5H7zM7 14l5-5 5 5H7z`,opacity:`0.4`})})}function X({columns:e,data:r,caption:i,sortable:a,stickyHeader:c,isLoading:l,emptyState:u,style:d,className:f,striped:p,maxHeight:m,rowHeight:h=44,virtualScroll:g,onLoadMore:_,hasMore:v,loadingMore:y=!1,onRowClick:b,selectedRows:x,bordered:S,compact:C}){let w=t.f(),[T,E]=(0,o.useState)(null),[D,O]=(0,o.useState)(`asc`),k=(0,o.useMemo)(()=>!T||!a?r:[...r].sort((e,t)=>{let n=e[T],r=t[T],i=0;return typeof n==`string`&&typeof r==`string`?i=n.localeCompare(r):typeof n==`number`&&typeof r==`number`&&(i=n-r),D===`asc`?i:-i}),[r,T,D,a]),A=(0,o.useCallback)(e=>{T===e?O(e=>e===`asc`?`desc`:`asc`):(E(e),O(`asc`))},[T]);function j(e){return T===e?D:`none`}let M=g===void 0?m!==void 0&&k.length>=50:g,N=(0,o.useRef)(null),[P,F]=(0,o.useState)(0),[I,L]=(0,o.useState)(400),R=(0,o.useCallback)(()=>{N.current&&F(N.current.scrollTop)},[]);(0,o.useEffect)(()=>{if(!M||!N.current)return;let e=N.current;L(e.clientHeight);let t=new ResizeObserver(()=>L(e.clientHeight));return t.observe(e),()=>t.disconnect()},[M]);let z=M?Math.max(0,Math.floor(P/h)-5):0,B=M?Math.min(k.length,Math.ceil((P+I)/h)+5):k.length,V=M?k.slice(z,B):k,H=(0,o.useRef)(null),U=(0,o.useRef)(!1);(0,o.useEffect)(()=>{U.current=!1},[r.length]),(0,o.useEffect)(()=>{if(!_)return;let e=H.current;if(!e)return;let t=new IntersectionObserver(e=>{e[0].isIntersecting&&!U.current&&v!==!1&&(U.current=!0,_())},{root:N.current,rootMargin:`0px 0px 200px 0px`,threshold:0});return t.observe(e),()=>t.disconnect()},[_,v]);let W=C?`4px`:`12px`,G=C?`8px`:`16px`,q=S?`1px solid ${w.border}`:`none`,J=(0,o.useMemo)(()=>new Set(x??[]),[x]);return(0,s.jsx)(`div`,{className:n.a(`w-full rounded-lg`,f??``),style:{border:`1px solid ${w.border}`,overflow:`hidden`,...d},children:(0,s.jsxs)(`div`,{ref:N,onScroll:M?R:void 0,style:{overflowX:`auto`,overflowY:m?`auto`:`visible`,maxHeight:m??`none`},children:[(0,s.jsxs)(`table`,{className:n.a(`w-full font-sans text-sm`),style:{borderCollapse:`collapse`,color:w.text},children:[i&&(0,s.jsx)(`caption`,{className:n.a(`text-sm text-left p-2`),style:{color:w.textMuted},children:n.m(i)}),(0,s.jsx)(`thead`,{style:c?{position:`sticky`,top:0,backgroundColor:w.surfaceAlt,zIndex:1}:{backgroundColor:w.surfaceAlt},children:(0,s.jsx)(`tr`,{children:e.map(e=>{let t=a&&e.sortable!==!1,r=j(e.key);return(0,s.jsx)(`th`,{scope:`col`,"aria-sort":t?r===`none`?`none`:r===`asc`?`ascending`:`descending`:void 0,className:n.a(`text-left font-semibold whitespace-nowrap`,t?`cursor-pointer select-none`:``),style:{padding:`${W} ${G}`,color:w.textMuted,borderBottom:`2px solid ${w.border}`,borderRight:q,width:e.width},onClick:()=>t&&A(e.key),onKeyDown:n=>{t&&(n.key===`Enter`||n.key===` `)&&(n.preventDefault(),A(e.key))},tabIndex:t?0:void 0,children:(0,s.jsxs)(`span`,{className:n.a(`inline-flex items-center gap-1.5`),children:[n.m(e.header),t&&(0,s.jsx)(ee,{dir:r})]})},String(e.key))})})}),(0,s.jsx)(`tbody`,{children:l?Array.from({length:5},(t,n)=>(0,s.jsx)(`tr`,{children:e.map(e=>(0,s.jsx)(`td`,{style:{padding:`${W} ${G}`},children:(0,s.jsx)(K,{variant:`text`,height:`16px`})},String(e.key)))},n)):k.length===0?(0,s.jsx)(`tr`,{children:(0,s.jsx)(`td`,{colSpan:e.length,className:n.a(`text-center`),style:{padding:`32px 16px`,color:w.textMuted},children:u??`No data available`})}):(0,s.jsxs)(s.Fragment,{children:[M&&z>0&&(0,s.jsx)(`tr`,{"aria-hidden":`true`,style:{height:z*h},children:(0,s.jsx)(`td`,{colSpan:e.length,style:{padding:0,border:`none`}})}),V.map((t,r)=>{let i=z+r,a=J.has(i);return(0,s.jsx)(`tr`,{"aria-rowindex":i+1,"aria-selected":a||void 0,onClick:b?()=>b(t,i):void 0,onKeyDown:b?e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),b(t,i))}:void 0,tabIndex:b?0:void 0,className:n.a(b?`cursor-pointer`:``),style:{backgroundColor:a?`${w.primary}22`:p&&i%2==1?w.surfaceAlt:`transparent`,borderBottom:`1px solid ${w.border}`,...M?{height:h,boxSizing:`border-box`}:{}},children:e.map(e=>{let r=t[e.key],i=e.render?e.render(r,t):typeof r==`string`?n.m(r):String(r??``);return(0,s.jsx)(`td`,{style:{padding:`${W} ${G}`,color:w.text,borderRight:q},children:i},String(e.key))})},i)}),M&&B<k.length&&(0,s.jsx)(`tr`,{"aria-hidden":`true`,style:{height:(k.length-B)*h},children:(0,s.jsx)(`td`,{colSpan:e.length,style:{padding:0,border:`none`}})})]})})]}),(v||y)&&(0,s.jsx)(`div`,{ref:H,style:{height:1,width:`100%`},children:y&&(0,s.jsx)(`table`,{style:{width:`100%`,borderCollapse:`collapse`},children:(0,s.jsx)(`tbody`,{children:Array.from({length:3},(t,n)=>(0,s.jsx)(`tr`,{children:e.map(e=>(0,s.jsx)(`td`,{style:{padding:`10px 16px`},children:(0,s.jsx)(K,{variant:`text`,height:`16px`})},String(e.key)))},n))})})}),!v&&_&&(0,s.jsx)(`div`,{style:{padding:`16px`,textAlign:`center`,fontSize:13,color:w.textMuted},children:`✓ All rows loaded`})]})})}var Z=(0,o.forwardRef)(({orientation:e=`horizontal`,label:r,variant:i=`solid`,className:a,style:o,...c},l)=>{let u=t.f(),d=r?n.m(r):void 0,f=e===`vertical`,p=f?`borderLeft`:`borderTop`,m=`1px ${i} ${u.border}`;return d?(0,s.jsxs)(`div`,{role:`separator`,"aria-orientation":e,className:n.t(n.a(`flex items-center gap-3 text-xs`),a),style:{color:u.textMuted,...o},...c,children:[(0,s.jsx)(`hr`,{className:n.a(`flex-1 m-0 border-none`),style:{[p]:m}}),(0,s.jsx)(`span`,{children:d}),(0,s.jsx)(`hr`,{className:n.a(`flex-1 m-0 border-none`),style:{[p]:m}})]}):(0,s.jsx)(`hr`,{ref:l,role:`separator`,"aria-orientation":e,className:n.t(n.a(f?`inline-block self-stretch border-none w-0 h-full`:`w-full border-none m-0`),a),style:{[p]:m,...o},...c})});Z.displayName=`TkxDivider`;var te={sm:{py:`6px`,px:`10px`,fontSize:`13px`,iconSize:14,tagPy:`1px`,tagPx:`6px`},md:{py:`9px`,px:`12px`,fontSize:`14px`,iconSize:16,tagPy:`2px`,tagPx:`8px`},lg:{py:`12px`,px:`14px`,fontSize:`15px`,iconSize:18,tagPy:`3px`,tagPx:`10px`}};function ne(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function re(e,t){let n=e.getBoundingClientRect(),r=window.innerHeight-n.bottom-6,i=n.top-6,a=r>=Math.min(t,200)||r>=i?`below`:`above`;return{top:a===`below`?n.bottom+window.scrollY+6:n.top+window.scrollY-6-Math.min(t,280),left:n.left+window.scrollX,width:n.width,placement:a}}function ie({size:e,color:t}){return(0,s.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,stroke:t,strokeWidth:`2.5`,strokeLinecap:`round`,"aria-hidden":`true`,style:{animation:`tkx-spin 0.7s linear infinite`},children:[(0,s.jsx)(`style`,{children:`@keyframes tkx-spin{to{transform:rotate(360deg)}}`}),(0,s.jsx)(`path`,{d:`M12 2a10 10 0 0 1 10 10`})]})}function ae({options:e,value:r,defaultValue:i,placeholder:a=`Select an option…`,size:l=`md`,isDisabled:u=!1,isInvalid:d=!1,label:f,hint:p,errorMessage:m,multiple:h=!1,searchable:g=!1,clearable:_=!1,isLoading:v=!1,onChange:y,renderOption:b,maxMenuHeight:x=280,virtualScroll:S,optionHeight:C=36,id:w,className:T,style:E}){let D=t.f(),O=(0,o.useId)(),k=w??O,A=`${k}-listbox`,j=`${k}-hint`,M=`${k}-error`,N=r!==void 0,[P,F]=(0,o.useState)(ne(i)),I=N?ne(r):P,[L,R]=(0,o.useState)(!1),[z,B]=(0,o.useState)(``),[V,H]=(0,o.useState)(-1),[U,W]=(0,o.useState)(null),[G,K]=(0,o.useState)(``),q=(0,o.useRef)(null),J=(0,o.useRef)(null),Y=(0,o.useRef)(null),ee=(0,o.useRef)(null),X=(0,o.useRef)(null),Z=te[l],ae=d||!!m,Q=(0,o.useRef)(null),[oe,se]=(0,o.useState)(0),[ce,le]=(0,o.useState)(0),ue=(0,o.useCallback)(()=>{Q.current&&se(Q.current.scrollTop)},[]);(0,o.useEffect)(()=>{if(!L){se(0);return}let e=Q.current;if(!e)return;le(e.clientHeight);let t=new ResizeObserver(()=>{le(e.clientHeight)});return t.observe(e),()=>t.disconnect()},[L]);let de=g&&z?e.filter(e=>e.label.toLowerCase().includes(z.toLowerCase())):e,fe=de.filter(e=>!e.disabled),pe=de.some(e=>!!e.group),$=(S===void 0?de.length>=100:S)&&!pe,me=de.length*C,he=$?Math.max(0,Math.floor(oe/C)-8):0,ge=$?Math.min(de.length,Math.ceil((oe+ce)/C)+8):de.length,_e=$?de.slice(he,ge):de,ve=he*C,ye=de.reduce((e,t)=>{let n=t.group??``;return e[n]||(e[n]=[]),e[n].push(t),e},{}),be=(0,o.useCallback)(e=>{let t;t=h?I.includes(e)?I.filter(t=>t!==e):[...I,e]:[e],N||F(t),y?.(h?t:t[0]??``),h||(R(!1),B(``),H(-1),J.current?.focus())},[N,h,y,I]),xe=(0,o.useCallback)((e,t)=>{t.stopPropagation();let n=I.filter(t=>t!==e);N||F(n),y?.(h?n:n[0]??``)},[N,h,y,I]),Se=(0,o.useCallback)(e=>{e.stopPropagation(),N||F([]),y?.(h?[]:``)},[N,h,y]),Ce=(0,o.useCallback)(()=>{!J.current||!L||W(re(J.current,x))},[L,x]);(0,o.useEffect)(()=>{if(L)return Ce(),window.addEventListener(`scroll`,Ce,!0),window.addEventListener(`resize`,Ce),()=>{window.removeEventListener(`scroll`,Ce,!0),window.removeEventListener(`resize`,Ce)}},[L,Ce]),(0,o.useEffect)(()=>{if(!L)return;let e=e=>{let t=e.target;J.current?.contains(t)||ee.current?.contains(t)||(R(!1),B(``))};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[L]),(0,o.useEffect)(()=>{L&&g&&setTimeout(()=>Y.current?.focus(),0)},[L,g]),(0,o.useEffect)(()=>{if(!(!L||V<0))if($&&Q.current){let e=V*C,t=e+C,n=Q.current;e<n.scrollTop?n.scrollTop=e:t>n.scrollTop+n.clientHeight&&(n.scrollTop=t-n.clientHeight)}else (X.current?.querySelector(`[data-idx="${V}"]`))?.scrollIntoView({block:`nearest`})},[V,L,$,C]);let we=e=>{switch(e.key){case`Enter`:case` `:e.preventDefault(),L?V>=0&&fe[V]&&be(fe[V].value):De();break;case`Escape`:e.preventDefault(),R(!1),B(``);break;case`ArrowDown`:e.preventDefault(),L?H(e=>Math.min(e+1,fe.length-1)):De();break;case`ArrowUp`:e.preventDefault(),L?H(e=>Math.max(e-1,0)):De();break;case`Home`:e.preventDefault(),L&&H(0);break;case`End`:e.preventDefault(),L&&H(fe.length-1);break;default:e.key.length===1&&!e.ctrlKey&&!e.metaKey&&(L||De(),Ee(e.key))}},Te=e=>{switch(e.key){case`Escape`:e.preventDefault(),R(!1),B(``),J.current?.focus();break;case`ArrowDown`:e.preventDefault(),H(e=>Math.min(e+1,fe.length-1));break;case`ArrowUp`:e.preventDefault(),H(e=>Math.max(e-1,0));break;case`Home`:e.preventDefault(),H(0);break;case`End`:e.preventDefault(),H(fe.length-1);break;case`Enter`:e.preventDefault(),V>=0&&fe[V]&&be(fe[V].value);break}};function Ee(e){q.current&&clearTimeout(q.current);let t=G+e.toLowerCase();K(t);let n=fe.findIndex(e=>e.label.toLowerCase().startsWith(t));n>=0&&H(n),q.current=setTimeout(()=>K(``),800)}function De(){if(u||v)return;R(!0);let e=fe.findIndex(e=>I.includes(e.value));H(e>=0?e:0)}let Oe=ae?D.danger:L?D.primary:D.border,ke=V>=0&&fe[V]?`${k}-opt-${fe[V].value}`:void 0,Ae=[p&&j,ae&&M].filter(Boolean).join(` `)||void 0,je=I.map(t=>e.find(e=>e.value===t)).filter(Boolean),Me=L&&U?(0,c.createPortal)((0,s.jsxs)(`div`,{ref:ee,role:`listbox`,id:A,"aria-label":f?n.m(f):`Options`,"aria-multiselectable":h,style:{position:`absolute`,top:U.top,left:U.left,width:U.width,zIndex:9999,backgroundColor:D.surface,border:`1.5px solid ${D.border}`,borderRadius:10,boxShadow:`0 8px 32px rgba(0,0,0,0.28), 0 2px 8px rgba(0,0,0,0.14)`,overflow:`hidden`,minWidth:U.width,maxHeight:x,display:`flex`,flexDirection:`column`},children:[g&&(0,s.jsxs)(`div`,{style:{padding:`8px 10px`,borderBottom:`1px solid ${D.border}`,flexShrink:0,display:`flex`,alignItems:`center`,gap:6},children:[(0,s.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:D.textMuted,strokeWidth:`2`,"aria-hidden":`true`,style:{flexShrink:0},children:[(0,s.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,s.jsx)(`path`,{d:`M21 21l-4.35-4.35`})]}),(0,s.jsx)(`input`,{ref:Y,type:`text`,value:z,onChange:e=>{B(e.target.value),H(0)},onKeyDown:Te,placeholder:`Search…`,"aria-label":`Search options`,style:{border:`none`,outline:`none`,background:`transparent`,color:D.text,fontSize:Z.fontSize,fontFamily:`inherit`,width:`100%`}})]}),(0,s.jsx)(`div`,{ref:e=>{X.current=e,Q.current=e},onScroll:$?ue:void 0,style:{overflowY:`auto`,flexGrow:1,maxHeight:x-(g?48:0)},children:$?(0,s.jsxs)(`div`,{style:{height:me,position:`relative`},children:[(0,s.jsx)(`div`,{style:{position:`absolute`,top:ve,left:0,right:0},children:_e.map(e=>{let t=fe.indexOf(e),r=t===V,i=I.includes(e.value),a=b?b(e,i):(0,s.jsxs)(`span`,{style:{display:`flex`,flexDirection:`column`,flex:1,minWidth:0},children:[(0,s.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[e.icon&&(0,s.jsx)(`span`,{style:{flexShrink:0,display:`flex`},children:e.icon}),(0,s.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:n.m(e.label)})]}),e.description&&(0,s.jsx)(`span`,{style:{fontSize:`12px`,color:D.textMuted,marginTop:1,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:n.m(e.description)})]});return(0,s.jsxs)(`div`,{id:`${k}-opt-${e.value}`,"data-idx":t>=0?t:void 0,role:`option`,"aria-selected":i,"aria-disabled":e.disabled||void 0,onClick:()=>!e.disabled&&be(e.value),onMouseEnter:()=>!e.disabled&&t>=0&&H(t),style:{height:C,boxSizing:`border-box`,padding:`0 ${Z.px}`,fontSize:Z.fontSize,fontFamily:`inherit`,color:e.disabled?D.textMuted:D.text,backgroundColor:r?`${D.primary}22`:i?`${D.primary}12`:`transparent`,cursor:e.disabled?`not-allowed`:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:8,transition:`background-color 80ms`,opacity:e.disabled?.5:1,userSelect:`none`,touchAction:`manipulation`},children:[a,i&&!b&&(0,s.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:D.primary,strokeWidth:`2.5`,"aria-hidden":`true`,style:{flexShrink:0},children:(0,s.jsx)(`path`,{d:`M20 6L9 17l-5-5`})})]},e.value)})}),de.length===0&&(0,s.jsx)(`div`,{style:{padding:`${Z.py} ${Z.px}`,fontSize:Z.fontSize,fontFamily:`inherit`,color:D.textMuted,textAlign:`center`,position:`absolute`,top:0,left:0,right:0},children:v?`Loading…`:`No options found`})]}):(0,s.jsxs)(s.Fragment,{children:[Object.entries(ye).map(([e,t])=>(0,s.jsxs)(`div`,{children:[e&&(0,s.jsx)(`div`,{"aria-hidden":`true`,style:{padding:`8px 12px 4px`,fontSize:`11px`,fontWeight:700,letterSpacing:`0.08em`,textTransform:`uppercase`,color:D.textMuted,fontFamily:`inherit`,position:`sticky`,top:0,backgroundColor:D.surface,zIndex:1,borderBottom:`1px solid ${D.border}`},children:n.m(e)}),t.map(e=>{let t=fe.indexOf(e),r=t===V,i=I.includes(e.value),a=b?b(e,i):(0,s.jsxs)(`span`,{style:{display:`flex`,flexDirection:`column`,flex:1,minWidth:0},children:[(0,s.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[e.icon&&(0,s.jsx)(`span`,{style:{flexShrink:0,display:`flex`},children:e.icon}),(0,s.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:n.m(e.label)})]}),e.description&&(0,s.jsx)(`span`,{style:{fontSize:`12px`,color:D.textMuted,marginTop:1,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:n.m(e.description)})]});return(0,s.jsxs)(`div`,{id:`${k}-opt-${e.value}`,"data-idx":t>=0?t:void 0,role:`option`,"aria-selected":i,"aria-disabled":e.disabled||void 0,onClick:()=>!e.disabled&&be(e.value),onMouseEnter:()=>!e.disabled&&t>=0&&H(t),style:{padding:`${Z.py} ${Z.px}`,fontSize:Z.fontSize,fontFamily:`inherit`,color:e.disabled?D.textMuted:D.text,backgroundColor:r?`${D.primary}22`:i?`${D.primary}12`:`transparent`,cursor:e.disabled?`not-allowed`:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:8,transition:`background-color 80ms`,opacity:e.disabled?.5:1,userSelect:`none`,touchAction:`manipulation`},children:[a,i&&!b&&(0,s.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:D.primary,strokeWidth:`2.5`,"aria-hidden":`true`,style:{flexShrink:0},children:(0,s.jsx)(`path`,{d:`M20 6L9 17l-5-5`})})]},e.value)})]},e)),de.length===0&&(0,s.jsx)(`div`,{style:{padding:`${Z.py} ${Z.px}`,fontSize:Z.fontSize,fontFamily:`inherit`,color:D.textMuted,textAlign:`center`},children:v?`Loading…`:`No options found`})]})})]}),document.body):null,Ne=_&&I.length>0&&!u&&!v;return(0,s.jsxs)(`div`,{className:n.t(n.a(`flex flex-col gap-1 w-full`),T),style:E,children:[f&&(0,s.jsx)(`label`,{htmlFor:k,style:{fontSize:`14px`,fontWeight:500,fontFamily:`inherit`,color:D.text,userSelect:`none`},children:n.m(f)}),(0,s.jsx)(`div`,{style:{position:`relative`,width:`100%`,opacity:u?.55:1},children:(0,s.jsxs)(`button`,{ref:J,id:k,type:`button`,role:`combobox`,"aria-haspopup":`listbox`,"aria-expanded":L,"aria-controls":A,"aria-activedescendant":ke,"aria-invalid":ae||void 0,"aria-describedby":Ae,"aria-multiselectable":h,disabled:u,onClick:()=>L?R(!1):De(),onKeyDown:we,style:{width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:8,padding:h&&I.length>0?`4px ${Z.px}`:`${Z.py} ${Z.px}`,fontSize:Z.fontSize,fontFamily:`inherit`,backgroundColor:D.surface,color:I.length>0?D.text:D.textMuted,border:`1.5px solid ${Oe}`,borderRadius:8,boxSizing:`border-box`,transition:`border-color 150ms`,textAlign:`left`,cursor:u?`not-allowed`:`pointer`,outline:`none`,minHeight:l===`sm`?34:l===`lg`?50:42,flexWrap:`wrap`,touchAction:`manipulation`},children:[(0,s.jsx)(`span`,{style:{display:`flex`,alignItems:`center`,flexWrap:`wrap`,gap:4,flex:1,minWidth:0},children:h&&je.length>0?je.map(e=>(0,s.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,gap:4,padding:`${Z.tagPy} ${Z.tagPx}`,fontSize:`calc(${Z.fontSize} - 1px)`,fontFamily:`inherit`,backgroundColor:`${D.primary}22`,color:D.primary,borderRadius:6,border:`1px solid ${D.primary}44`,lineHeight:1.4,maxWidth:150,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:[(0,s.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,maxWidth:110},children:n.m(e.label)}),(0,s.jsx)(`span`,{role:`button`,"aria-label":`Remove ${n.m(e.label)}`,tabIndex:-1,onClick:t=>xe(e.value,t),style:{cursor:`pointer`,flexShrink:0,display:`flex`,alignItems:`center`,opacity:.8},children:(0,s.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M18 6L6 18M6 6l12 12`})})})]},e.value)):!h&&I.length>0?(()=>{let t=e.find(e=>e.value===I[0]);return(0,s.jsxs)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,display:`flex`,alignItems:`center`,gap:6},children:[t?.icon&&(0,s.jsx)(`span`,{style:{flexShrink:0,display:`flex`},children:t.icon}),t?n.m(t.label):``]})})():(0,s.jsx)(`span`,{style:{opacity:.6},children:n.m(a)})}),(0,s.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:4,flexShrink:0,color:D.textMuted},children:[v&&(0,s.jsx)(ie,{size:Z.iconSize,color:D.primary}),Ne&&!v&&(0,s.jsx)(`span`,{role:`button`,"aria-label":`Clear selection`,tabIndex:-1,onClick:Se,style:{cursor:`pointer`,display:`flex`,alignItems:`center`,lineHeight:1,opacity:.7,transition:`opacity 120ms`},onMouseEnter:e=>e.currentTarget.style.opacity=`1`,onMouseLeave:e=>e.currentTarget.style.opacity=`0.7`,children:(0,s.jsx)(`svg`,{width:Z.iconSize,height:Z.iconSize,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M18 6L6 18M6 6l12 12`})})}),(0,s.jsx)(`svg`,{width:Z.iconSize,height:Z.iconSize,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,"aria-hidden":`true`,style:{transform:L?`rotate(180deg)`:`rotate(0deg)`,transition:`transform 150ms`,flexShrink:0},children:(0,s.jsx)(`path`,{d:`M6 9l6 6 6-6`})})]})]})}),p&&!ae&&(0,s.jsx)(`span`,{id:j,style:{fontSize:`12px`,color:D.textMuted,fontFamily:`inherit`},children:n.m(p)}),ae&&m&&(0,s.jsxs)(`span`,{id:M,role:`alert`,style:{fontSize:`12px`,color:D.danger,display:`flex`,alignItems:`center`,gap:4,fontFamily:`inherit`},children:[(0,s.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z`})}),n.m(m)]}),Me]})}ae.displayName=`TkxSelect`;var Q={sm:{box:16,fontSize:`13px`,iconStroke:2.5},md:{box:20,fontSize:`14px`,iconStroke:2.5},lg:{box:24,fontSize:`15px`,iconStroke:2}},oe=(0,o.forwardRef)(({label:e,hint:i,isInvalid:a,errorMessage:c,isIndeterminate:l=!1,size:u=`md`,colorScheme:d=`primary`,checked:f,defaultChecked:p,onChange:m,disabled:h,className:g,style:_,id:v,...y},b)=>{let x=t.f(),S=r.o(),C=(0,o.useId)(),w=v??C,T=`${w}-hint`,E=`${w}-error`,D=(0,o.useRef)(null),[O,k]=(0,o.useState)(!1),A=Q[u],j=a||!!c,M={primary:x.primary,success:x.success,danger:x.danger,warning:x.warning}[d]??x.primary,N=f===void 0?void 0:f;(0,o.useEffect)(()=>{let e=b?.current??D.current;e&&(e.indeterminate=l)},[l,b]);let P=l||(N??!1),F=P?M:x.surface,I=j?x.danger:P?M:x.border,L=t.v(M),R=O?{outline:`2px solid ${M}`,outlineOffset:`2px`}:{},z=[i&&T,j&&E].filter(Boolean).join(` `)||void 0,B=!S&&P?{animation:`tkx-check-scale-in 120ms ease forwards`}:{};return(0,s.jsxs)(`div`,{className:n.t(n.a(`flex flex-col gap-1`),g),style:{opacity:h?.5:1,..._},children:[(0,s.jsx)(`style`,{children:`
2
- @keyframes tkx-check-scale-in {
3
- from { transform: scale(0.4); opacity: 0; }
4
- to { transform: scale(1); opacity: 1; }
5
- }
6
- `}),(0,s.jsxs)(`label`,{htmlFor:w,className:n.a(`flex items-center gap-2 select-none`),style:{cursor:h?`not-allowed`:`pointer`,fontFamily:`inherit`},children:[(0,s.jsx)(`input`,{ref:e=>{D.current=e,typeof b==`function`?b(e):b&&(b.current=e)},id:w,type:`checkbox`,checked:f,defaultChecked:p,onChange:m,disabled:h,"aria-invalid":j,"aria-describedby":z,onFocus:e=>{e.target.matches(`:focus-visible`)&&k(!0)},onBlur:()=>k(!1),className:n.a(`sr-only`),...y}),(0,s.jsx)(`span`,{"aria-hidden":`true`,style:{width:A.box,height:A.box,minWidth:A.box,borderRadius:`4px`,border:`2px solid ${I}`,backgroundColor:F,display:`flex`,alignItems:`center`,justifyContent:`center`,transition:S?`none`:`background-color 120ms, border-color 120ms`,boxSizing:`border-box`,...R},children:l?(0,s.jsx)(`span`,{"aria-hidden":`true`,style:{display:`block`,width:A.box*.5,height:2,backgroundColor:L,borderRadius:`1px`,...B}}):P?(0,s.jsx)(`svg`,{width:A.box*.6,height:A.box*.6,viewBox:`0 0 24 24`,fill:`none`,stroke:L,strokeWidth:A.iconStroke,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,style:B,children:(0,s.jsx)(`path`,{d:`M20 6L9 17l-5-5`})}):null}),e&&(0,s.jsx)(`span`,{style:{fontSize:A.fontSize,color:x.text,lineHeight:1.4},children:typeof e==`string`?n.m(e):e})]}),i&&!j&&(0,s.jsx)(`span`,{id:T,className:n.a(`text-xs ml-7`),style:{color:x.textMuted,marginLeft:A.box+8},children:n.m(i)}),j&&c&&(0,s.jsxs)(`span`,{id:E,role:`alert`,className:n.a(`text-xs flex items-center gap-1`),style:{color:x.danger,marginLeft:A.box+8},children:[(0,s.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z`})}),n.m(c)]})]})});oe.displayName=`TkxCheckbox`;var se=(0,o.createContext)(null);function ce(){return(0,o.useContext)(se)}var le={sm:{outer:16,inner:7,fontSize:`13px`},md:{outer:20,inner:9,fontSize:`14px`},lg:{outer:24,inner:11,fontSize:`15px`}},ue=(0,o.forwardRef)(({label:e,hint:i,size:a=`md`,colorScheme:c=`primary`,value:l,checked:u,onChange:d,disabled:f,name:p,className:m,style:h,id:g,..._},v)=>{let y=t.f(),b=r.o(),x=(0,o.useId)(),S=g??x,C=ce(),w=C?C.value===String(l??``):u??!1,T=f??C?.isDisabled??!1,E=p??C?.name??``,D=()=>{T||(C?C.onChange(String(l??``)):d?.({target:{value:String(l??``)}}))},O=le[a],k={primary:y.primary,success:y.success,danger:y.danger}[c]??y.primary;t.v(k);let A=w?k:y.border,j=y.surface;return(0,s.jsxs)(`div`,{className:n.t(n.a(`flex flex-col gap-0.5`),m),style:{opacity:T?.5:1,...h},children:[(0,s.jsx)(`style`,{children:`
7
- @keyframes tkx-radio-dot-in {
8
- from { transform: scale(0) translate(-50%, -50%); opacity: 0; }
9
- to { transform: scale(1) translate(-50%, -50%); opacity: 1; }
10
- }
11
- `}),(0,s.jsxs)(`label`,{htmlFor:S,className:n.a(`flex items-center gap-2 select-none`),style:{cursor:T?`not-allowed`:`pointer`,fontFamily:`inherit`},children:[(0,s.jsx)(`input`,{ref:v,id:S,type:`radio`,name:E,value:l,checked:w,onChange:D,disabled:T,"aria-invalid":C?.isInvalid,className:n.a(`sr-only`),..._}),(0,s.jsx)(`span`,{"aria-hidden":`true`,style:{position:`relative`,width:O.outer,height:O.outer,minWidth:O.outer,borderRadius:`50%`,border:`2px solid ${A}`,backgroundColor:j,display:`inline-block`,boxSizing:`border-box`,transition:b?`none`:`border-color 120ms`},children:w&&(0,s.jsx)(`span`,{"aria-hidden":`true`,style:{position:`absolute`,top:`50%`,left:`50%`,width:O.inner,height:O.inner,borderRadius:`50%`,backgroundColor:k,transform:`translate(-50%, -50%)`,transformOrigin:`center`,...b?{}:{animation:`tkx-radio-dot-in 130ms ease forwards`}}})}),e&&(0,s.jsx)(`span`,{style:{fontSize:O.fontSize,color:y.text,lineHeight:1.4},children:typeof e==`string`?n.m(e):e})]}),i&&(0,s.jsx)(`span`,{className:n.a(`text-xs`),style:{color:y.textMuted,marginLeft:O.outer+8},children:n.m(i)})]})});ue.displayName=`TkxRadio`;function de({name:e,value:r,defaultValue:i=``,onChange:a,label:c,orientation:l=`vertical`,isDisabled:u=!1,isInvalid:d=!1,errorMessage:f,children:p}){let m=t.f(),h=`${(0,o.useId)()}-error`,[g,_]=(0,o.useState)(i),v=r!==void 0,y=v?r:g,b=e=>{v||_(e),a?.(e)},x=d||!!f;return(0,s.jsx)(se.Provider,{value:{name:e,value:y,onChange:b,isDisabled:u,isInvalid:d},children:(0,s.jsxs)(`div`,{role:`radiogroup`,"aria-label":c?n.m(c):void 0,"aria-describedby":x?h:void 0,"aria-invalid":x,children:[c&&(0,s.jsx)(`div`,{className:n.a(`text-sm font-medium font-sans mb-2`),style:{color:m.text},children:n.m(c)}),(0,s.jsx)(`div`,{className:n.a(l===`horizontal`?`flex flex-row flex-wrap gap-4`:`flex flex-col gap-2`),children:p}),x&&f&&(0,s.jsxs)(`span`,{id:h,role:`alert`,className:n.a(`text-xs flex items-center gap-1 mt-1`),style:{color:m.danger},children:[(0,s.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z`})}),n.m(f)]})]})})}var fe=5,pe=[],$=[],me=new Set,he=new Map;function ge(){let e=[...$];me.forEach(t=>t(e))}function _e(e,t){t!==0&&he.set(e,setTimeout(()=>ve(e),t))}function ve(e){clearTimeout(he.get(e)),he.delete(e);let t=$.some(t=>t.id===e);if($=$.filter(t=>t.id!==e),pe=pe.filter(t=>t.id!==e),t&&pe.length>0&&$.length<fe){let e=pe.shift();$=[...$,e],_e(e.id,e.duration??4e3)}ge()}function ye(e){let t=`tkx-toast-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,n={...e,id:t,duration:e.duration??4e3};return $.length<fe?($=[...$,n],_e(t,n.duration)):pe=[...pe,n],ge(),t}function be(){he.forEach(e=>clearTimeout(e)),he.clear(),$=[],pe=[],ge()}function xe(){return{toast:(0,o.useCallback)(e=>ye(e),[]),dismiss:(0,o.useCallback)(e=>ve(e),[]),dismissAll:(0,o.useCallback)(()=>be(),[])}}var Se={default:(0,s.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z`})}),success:(0,s.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm-2 14.5l-4-4 1.41-1.41L10 13.67l6.59-6.59L18 8.5l-8 8z`})}),danger:(0,s.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z`})}),warning:(0,s.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z`})}),info:(0,s.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z`})})},Ce={"top-right":{top:16,right:16,alignItems:`flex-end`},"top-left":{top:16,left:16,alignItems:`flex-start`},"top-center":{top:16,left:`50%`,transform:`translateX(-50%)`,alignItems:`center`},"bottom-right":{bottom:16,right:16,alignItems:`flex-end`},"bottom-left":{bottom:16,left:16,alignItems:`flex-start`},"bottom-center":{bottom:16,left:`50%`,transform:`translateX(-50%)`,alignItems:`center`}};function we(e,t){return t?{}:{animation:`tkx-toast-slide-${e.startsWith(`top`)?`down`:`up`} 220ms cubic-bezier(0.16,1,0.3,1) both`}}function Te({toast:e,position:r,onDismiss:i,reduced:a}){let c=t.f(),l=(0,o.useId)(),u={default:c.textMuted,success:c.success,danger:c.danger,warning:c.warning,info:c.info},d=e.variant??`default`,f=u[d],p=d===`danger`,m=e.title?n.m(e.title):void 0,h=e.description?n.m(e.description):void 0;return(0,s.jsxs)(`div`,{role:p?`alert`:`status`,"aria-live":p?`assertive`:`polite`,"aria-atomic":`true`,"aria-labelledby":m?l:void 0,className:n.a(`flex items-start gap-3 px-4 py-3 rounded-lg shadow-lg font-sans min-w-[280px] max-w-[380px]`),style:{backgroundColor:c.surface,border:`1px solid ${f}55`,boxShadow:`0 8px 24px ${c.bg}cc`,color:c.text,...we(r,a)},children:[(0,s.jsx)(`span`,{className:n.a(`shrink-0 mt-[2px]`),style:{color:f},children:Se[d]}),(0,s.jsxs)(`div`,{className:n.a(`flex-1 min-w-0`),children:[m&&(0,s.jsx)(`p`,{id:l,className:n.a(`m-0 font-semibold text-sm leading-snug`),children:m}),h&&(0,s.jsx)(`p`,{className:n.a(`m-0 text-xs mt-[2px] leading-relaxed`),style:{color:c.textMuted},children:h}),e.action&&(0,s.jsx)(`button`,{onClick:()=>{e.action.onClick(),i(e.id)},className:n.a(`border-none bg-transparent cursor-pointer p-0 mt-2 text-xs font-semibold focus-visible:focus-ring`),style:{color:f},children:n.m(e.action.label)})]}),(0,s.jsx)(`button`,{"aria-label":`Dismiss notification`,onClick:()=>i(e.id),className:n.a(`bg-transparent border-none cursor-pointer rounded p-[2px] shrink-0 flex items-center justify-center focus-visible:focus-ring`),style:{color:c.textMuted},children:(0,s.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2.5,"aria-hidden":`true`,children:[(0,s.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,s.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]})}function Ee({position:e=`top-right`,children:t}){let[i,a]=(0,o.useState)([...$]),l=r.o();(0,o.useEffect)(()=>{a([...$]);let e=e=>a([...e]);return me.add(e),()=>{me.delete(e)}},[]);let u=e.startsWith(`bottom`),d=Ce[e],f=(0,o.useRef)(!1);if((0,o.useEffect)(()=>{if(!(f.current||typeof document>`u`)&&(f.current=!0,!document.getElementById(`tkx-toast-kf`))){let e=document.createElement(`style`);e.id=`tkx-toast-kf`,e.textContent=`
12
- @keyframes tkx-toast-slide-down {
13
- from { opacity: 0; transform: translateY(-16px); }
14
- to { opacity: 1; transform: translateY(0); }
15
- }
16
- @keyframes tkx-toast-slide-up {
17
- from { opacity: 0; transform: translateY(16px); }
18
- to { opacity: 1; transform: translateY(0); }
19
- }
20
- `,document.head.appendChild(e)}},[]),typeof document>`u`)return(0,s.jsx)(s.Fragment,{children:t});let p=u?[...i].reverse():i;return(0,s.jsxs)(s.Fragment,{children:[t,(0,c.createPortal)((0,s.jsx)(`div`,{"aria-label":`Notifications`,className:n.a(`fixed z-[9999] flex flex-col gap-2 pointer-events-none`),style:d,children:p.map(t=>(0,s.jsx)(`div`,{className:n.a(`pointer-events-auto`),children:(0,s.jsx)(Te,{toast:t,position:e,onDismiss:ve,reduced:l})},t.id))}),document.body)]})}var De={sm:{triggerPadding:`10px 12px`,contentPadding:`0 12px 10px 12px`,fontSize:`13px`,subtitleSize:`11px`,iconSize:14},md:{triggerPadding:`14px 16px`,contentPadding:`0 16px 14px 16px`,fontSize:`14px`,subtitleSize:`12px`,iconSize:16},lg:{triggerPadding:`18px 20px`,contentPadding:`0 20px 18px 20px`,fontSize:`16px`,subtitleSize:`13px`,iconSize:18}};function Oe({open:e,reduced:t,iconStyle:n,size:r,color:i}){let a=t?`none`:`transform 240ms cubic-bezier(0.4, 0, 0.2, 1)`;return n===`chevron`?(0,s.jsx)(`svg`,{width:r,height:r,viewBox:`0 0 24 24`,fill:`none`,stroke:i,strokeWidth:2.5,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,style:{transform:e?`rotate(180deg)`:`rotate(0deg)`,transition:a,flexShrink:0},children:(0,s.jsx)(`polyline`,{points:`6 9 12 15 18 9`})}):n===`plus`?(0,s.jsxs)(`svg`,{width:r,height:r,viewBox:`0 0 24 24`,fill:`none`,stroke:i,strokeWidth:2.5,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,style:{transform:e?`rotate(45deg)`:`rotate(0deg)`,transition:a,flexShrink:0},children:[(0,s.jsx)(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`}),(0,s.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`})]}):(0,s.jsxs)(`svg`,{width:r,height:r,viewBox:`0 0 24 24`,fill:`none`,stroke:i,strokeWidth:2.5,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,style:{transform:e?`rotate(90deg)`:`rotate(0deg)`,transition:a,flexShrink:0},children:[(0,s.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`}),(0,s.jsx)(`polyline`,{points:`12 5 19 12 12 19`})]})}function ke({isOpen:e,reduced:t,children:n,id:r,triggerId:i}){let a=(0,o.useRef)(null),c=(0,o.useRef)(null),l=(0,o.useRef)(e),u=(0,o.useRef)(!1);return(0,o.useEffect)(()=>{let t=a.current;t&&(e?(t.style.height=`auto`,t.style.overflow=`visible`):(t.style.height=`0px`,t.style.overflow=`hidden`))},[]),(0,o.useEffect)(()=>{if(l.current===e)return;l.current=e;let n=a.current,r=c.current;if(!(!n||!r)){if(t){n.style.height=e?`auto`:`0px`,n.style.overflow=e?`visible`:`hidden`;return}if(u.current){let e=n.getBoundingClientRect().height;n.style.transition=`none`,n.style.height=`${e}px`,n.offsetHeight}u.current=!0,n.style.overflow=`hidden`,e?(n.style.height=`0px`,n.style.transition=`height 280ms cubic-bezier(0.4, 0, 0.2, 1)`,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n.style.height=`${r.scrollHeight}px`})})):(n.style.height=`${r.scrollHeight}px`,n.style.transition=`height 280ms cubic-bezier(0.4, 0, 0.2, 1)`,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n.style.height=`0px`})}))}},[e,t]),(0,s.jsx)(`div`,{ref:a,id:r,role:`region`,"aria-labelledby":i,onTransitionEnd:t=>{if(t.propertyName!==`height`)return;u.current=!1;let n=a.current;n&&(e?(n.style.height=`auto`,n.style.overflow=`visible`):n.style.overflow=`hidden`)},style:{willChange:`height`},children:(0,s.jsx)(`div`,{ref:c,children:n})})}function Ae({items:e,multiple:i=!1,defaultOpen:a,value:c,onChange:l,variant:u=`default`,size:d=`md`,iconPosition:f=`right`,iconStyle:p=`chevron`,flush:m=!1,className:h,style:g}){let _=t.f(),v=r.o(),y=(0,o.useId)(),b=c!==void 0,x=e=>e?Array.isArray(e)?new Set(e):new Set([e]):new Set,[S,C]=(0,o.useState)(()=>x(a)),w=b?x(c):S,T=(0,o.useCallback)((e,t)=>{if(t)return;let n;if(b){let t=x(c);n=new Set(t),n.has(e)?n.delete(e):(i||n.clear(),n.add(e))}else{C(t=>{n=new Set(t),n.has(e)?n.delete(e):(i||n.clear(),n.add(e));let r=[...n];return l?.(i?r:r[0]??``),n});return}let r=[...n];l?.(i?r:r[0]??``)},[i,l,b,c]),E=De[d],D=()=>{if(m)return{};switch(u){case`bordered`:return{border:`1px solid ${_.border}`,borderRadius:`10px`,overflow:`hidden`};case`separated`:return{};case`ghost`:case`flush`:return{};default:return{}}},O=(e,t,n)=>{if(m)return{};switch(u){case`default`:return{borderBottom:n?`none`:`1px solid ${_.border}`};case`bordered`:return{borderBottom:n?`none`:`1px solid ${_.border}`};case`separated`:return{border:`1px solid ${_.border}`,borderRadius:`10px`,overflow:`hidden`,boxShadow:`0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04)`};case`ghost`:return{};default:return{}}},k=e=>u===`ghost`||u===`flush`?e?`${_.primary}10`:`${_.surfaceAlt}80`:e?`${_.primary}0d`:`${_.surfaceAlt}60`,A=u===`separated`;return(0,s.jsx)(`div`,{className:n.a(h??``),style:{...D(),display:A?`flex`:void 0,flexDirection:A?`column`:void 0,gap:A?`8px`:void 0,...g},children:e.map((t,n)=>{let r=w.has(t.id),i=n===e.length-1,a=`${y}-trigger-${t.id}`,o=`${y}-panel-${t.id}`;return(0,s.jsxs)(`div`,{className:t.className,style:O(n,r,i),children:[(0,s.jsxs)(`button`,{id:a,type:`button`,role:`button`,"aria-expanded":r,"aria-controls":o,disabled:t.disabled,onClick:()=>T(t.id,t.disabled),style:{width:`100%`,display:`flex`,alignItems:t.subtitle?`flex-start`:`center`,gap:`8px`,padding:E.triggerPadding,border:`none`,background:`transparent`,cursor:t.disabled?`not-allowed`:`pointer`,textAlign:`left`,fontFamily:`inherit`,fontSize:E.fontSize,fontWeight:500,color:t.disabled?_.textMuted:_.text,opacity:t.disabled?.5:1,transition:v?`none`:`background-color 160ms ease`,outline:`none`},onMouseEnter:e=>{t.disabled||(e.currentTarget.style.backgroundColor=k(r))},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=r?`${_.primary}0d`:`transparent`},onFocus:e=>{t.disabled||(e.currentTarget.style.outline=`2px solid ${_.primary}`,e.currentTarget.style.outlineOffset=`2px`)},onBlur:e=>{e.currentTarget.style.outline=`none`},children:[t.icon&&(0,s.jsx)(`span`,{"aria-hidden":`true`,style:{display:`flex`,alignItems:`center`,flexShrink:0,color:_.primary,marginTop:t.subtitle?`1px`:void 0},children:t.icon}),f===`left`&&(0,s.jsx)(`span`,{"aria-hidden":`true`,style:{display:`flex`,alignItems:`center`,flexShrink:0,color:r?_.primary:_.textMuted,marginTop:t.subtitle?`1px`:void 0},children:(0,s.jsx)(Oe,{open:r,reduced:v,iconStyle:p,size:E.iconSize,color:r?_.primary:_.textMuted})}),(0,s.jsxs)(`span`,{style:{flex:1,minWidth:0},children:[(0,s.jsx)(`span`,{style:{display:`block`,lineHeight:1.4},children:t.title}),t.subtitle&&(0,s.jsx)(`span`,{style:{display:`block`,fontSize:E.subtitleSize,color:_.textMuted,fontWeight:400,marginTop:`2px`,lineHeight:1.3},children:t.subtitle})]}),t.badge&&(0,s.jsx)(`span`,{"aria-hidden":`true`,style:{display:`flex`,alignItems:`center`,flexShrink:0},children:t.badge}),f===`right`&&(0,s.jsx)(`span`,{"aria-hidden":`true`,style:{display:`flex`,alignItems:`center`,flexShrink:0,color:r?_.primary:_.textMuted,marginTop:t.subtitle?`1px`:void 0},children:(0,s.jsx)(Oe,{open:r,reduced:v,iconStyle:p,size:E.iconSize,color:r?_.primary:_.textMuted})})]}),(0,s.jsx)(ke,{isOpen:r,reduced:v,id:o,triggerId:a,children:(0,s.jsx)(`div`,{style:{padding:E.contentPadding,fontSize:E.fontSize,lineHeight:1.6,color:_.textMuted,fontFamily:`inherit`},children:t.content})})]},t.id)})})}Ae.displayName=`TkxAccordion`;var je={sm:`280px`,md:`380px`,lg:`480px`,xl:`600px`,full:`100%`},Me=0;function Ne(){++Me===1&&(document.body.style.overflow=`hidden`)}function Pe(){--Me<=0&&(Me=0,document.body.style.overflow=``)}function Fe(e){switch(e){case`left`:return`translateX(-100%)`;case`right`:return`translateX(100%)`;case`top`:return`translateY(-100%)`;case`bottom`:return`translateY(100%)`}}function Ie(e,t){let n=je[t],r=e===`left`||e===`right`,i={position:`absolute`};return r?{...i,top:0,bottom:0,[e]:0,width:n,maxWidth:`100vw`,height:`100%`}:{...i,left:0,right:0,[e]:0,height:n,maxHeight:`100vh`,width:`100%`}}function Le(){return(0,s.jsxs)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,"aria-hidden":`true`,children:[(0,s.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,s.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})}function Re({isOpen:e,onClose:i,placement:a=`right`,size:l=`md`,title:u,children:d,footer:f,closeOnOverlayClick:p=!0,closeOnEsc:m=!0}){let h=t.f(),g=r.o(),_=(0,o.useId)(),v=r.i(e);if(r.r(i,m&&e),(0,o.useEffect)(()=>(e?Ne():Pe(),()=>{e&&Pe()}),[e]),typeof document>`u`)return null;let y=Ie(a,l),b=Fe(a),x=g?`none`:`transform 280ms cubic-bezier(0.4,0,0.2,1), opacity 280ms ease`,S=typeof u==`string`?n.m(u):u;return(0,c.createPortal)((0,s.jsxs)(`div`,{role:`presentation`,className:n.a(`fixed inset-0 z-[9000]`),style:{pointerEvents:e?`auto`:`none`,visibility:e?`visible`:`hidden`},children:[(0,s.jsx)(`div`,{"aria-hidden":`true`,onClick:p?i:void 0,className:n.a(`absolute inset-0`),style:{backgroundColor:`rgba(0,0,0,0.55)`,backdropFilter:`blur(3px)`,opacity:+!!e,transition:g?`none`:`opacity 280ms ease`,cursor:p?`pointer`:`default`}}),(0,s.jsxs)(`div`,{ref:v,role:`dialog`,"aria-modal":`true`,"aria-labelledby":u?_:void 0,className:n.a(`absolute flex flex-col font-sans`),style:{...y,backgroundColor:h.surface,borderLeft:a===`right`?`1px solid ${h.border}`:void 0,borderRight:a===`left`?`1px solid ${h.border}`:void 0,borderTop:a===`bottom`?`1px solid ${h.border}`:void 0,borderBottom:a===`top`?`1px solid ${h.border}`:void 0,boxShadow:`0 20px 60px ${h.bg}99`,transform:e?`translate(0,0)`:b,opacity:+!!e,transition:x,willChange:`transform`},children:[u!==void 0&&(0,s.jsxs)(`div`,{className:n.a(`flex items-center justify-between px-5 py-4 shrink-0`),style:{borderBottom:`1px solid ${h.border}`},children:[(0,s.jsx)(`h2`,{id:_,className:n.a(`m-0 text-base font-semibold leading-snug`),style:{color:h.text},children:S}),(0,s.jsx)(`button`,{onClick:i,"aria-label":`Close drawer`,className:n.a(`bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring`),style:{color:h.textMuted},children:(0,s.jsx)(Le,{})})]}),u===void 0&&(0,s.jsx)(`div`,{className:n.a(`flex justify-end px-3 pt-3 shrink-0`),children:(0,s.jsx)(`button`,{onClick:i,"aria-label":`Close drawer`,className:n.a(`bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring`),style:{color:h.textMuted},children:(0,s.jsx)(Le,{})})}),(0,s.jsx)(`div`,{className:n.a(`flex-1 overflow-y-auto px-5 py-4`),style:{color:h.text},children:d}),f&&(0,s.jsx)(`div`,{className:n.a(`flex items-center justify-end gap-2 px-5 py-4 shrink-0`),style:{borderTop:`1px solid ${h.border}`},children:f})]})]}),document.body)}var ze=[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],Be=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],Ve=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function He(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function Ue(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function We(e,t,n){if(!t||!n)return!1;let r=Ue(e).getTime(),i=Ue(t).getTime(),a=Ue(n).getTime();return r>Math.min(i,a)&&r<Math.max(i,a)}function Ge(e,t,n){return!!(t&&He(e,t)||n&&He(e,n))}function Ke(e,t=`en-US`,n){if(!e)return``;if(n){let t=String(e.getFullYear()),r=t.slice(-2),i=e.getMonth()+1,a=String(i).padStart(2,`0`),o=Ve[e.getMonth()],s=Be[e.getMonth()],c=e.getDate(),l=String(c).padStart(2,`0`);return n.replace(/YYYY/g,t).replace(/YY/g,r).replace(/MMMM/g,s).replace(/MMM/g,o).replace(/MM/g,a).replace(/\bM\b/g,String(i)).replace(/DD/g,l).replace(/\bD\b/g,String(c))}return e.toLocaleDateString(t,{month:`2-digit`,day:`2-digit`,year:`numeric`})}function qe(e,t){let n=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);if(n){let[,e,t,r]=n.map(Number);if(e>=1&&e<=12&&t>=1&&t<=31){let n=new Date(r,e-1,t);if(n.getMonth()===e-1)return n}}let r=e.match(/^(\d{4})-(\d{1,2})-(\d{1,2})$/);if(r){let[,e,t,n]=r.map(Number),i=new Date(e,t-1,n);if(i.getMonth()===t-1)return i}if(t&&/^DD/.test(t)){let t=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);if(t){let[,e,n,r]=t.map(Number),i=new Date(r,n-1,e);if(i.getMonth()===n-1)return i}}return null}function Je(e,t){return new Date(e,t+1,0).getDate()}function Ye(e,t){let n=new Date(e,t,1).getDay(),r=Je(e,t),i=[],a=Je(e,t-1);for(let r=n-1;r>=0;r--)i.push(new Date(e,t-1,a-r));for(let n=1;n<=r;n++)i.push(new Date(e,t,n));let o=1;for(;i.length<42;)i.push(new Date(e,t+1,o++));return i}function Xe(e){return Math.floor(e/10)*10}function Ze(){return[{label:`Today`,getValue:()=>{let e=Ue(new Date);return[e,e]}},{label:`Yesterday`,getValue:()=>{let e=Ue(new Date);return e.setDate(e.getDate()-1),[e,e]}},{label:`Last 7 days`,getValue:()=>{let e=Ue(new Date),t=new Date(e);return t.setDate(t.getDate()-6),[t,e]}},{label:`Last 30 days`,getValue:()=>{let e=Ue(new Date),t=new Date(e);return t.setDate(t.getDate()-29),[t,e]}},{label:`Last 90 days`,getValue:()=>{let e=Ue(new Date),t=new Date(e);return t.setDate(t.getDate()-89),[t,e]}},{label:`This week`,getValue:()=>{let e=Ue(new Date),t=new Date(e);t.setDate(t.getDate()-t.getDay());let n=new Date(t);return n.setDate(n.getDate()+6),[t,n]}},{label:`Last week`,getValue:()=>{let e=Ue(new Date),t=new Date(e);t.setDate(t.getDate()-t.getDay()-1);let n=new Date(t);return n.setDate(n.getDate()-6),[n,t]}},{label:`This month`,getValue:()=>{let e=new Date;return[new Date(e.getFullYear(),e.getMonth(),1),new Date(e.getFullYear(),e.getMonth()+1,0)]}},{label:`Last month`,getValue:()=>{let e=new Date;return[new Date(e.getFullYear(),e.getMonth()-1,1),new Date(e.getFullYear(),e.getMonth(),0)]}},{label:`This quarter`,getValue:()=>{let e=new Date,t=Math.floor(e.getMonth()/3);return[new Date(e.getFullYear(),t*3,1),new Date(e.getFullYear(),t*3+3,0)]}},{label:`Last quarter`,getValue:()=>{let e=new Date,t=Math.floor(e.getMonth()/3),n=t===0?3:t-1,r=t===0?e.getFullYear()-1:e.getFullYear();return[new Date(r,n*3,1),new Date(r,n*3+3,0)]}},{label:`This year`,getValue:()=>{let e=new Date().getFullYear();return[new Date(e,0,1),new Date(e,11,31)]}},{label:`Last year`,getValue:()=>{let e=new Date().getFullYear()-1;return[new Date(e,0,1),new Date(e,11,31)]}}]}function Qe(e,t){let n=e.getBoundingClientRect(),r=window.innerHeight,i=window.scrollY,a=window.scrollX,o=r-n.bottom<t+8&&n.top>t+8;return{top:o?i+n.top-t-4:i+n.bottom+4,left:a+n.left,flipUp:o}}function $e({values:e,selected:t,onSelect:n,label:r,theme:i,format:a}){let c=(0,o.useRef)([]),l=(0,o.useRef)(null);(0,o.useEffect)(()=>{let e=c.current[t];e&&l.current&&e.scrollIntoView({block:`nearest`})},[t]);let u=a??(e=>String(e).padStart(2,`0`));return(0,s.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,gap:`4px`},children:[(0,s.jsx)(`div`,{style:{fontSize:`11px`,fontWeight:600,color:i.textMuted,textTransform:`uppercase`,letterSpacing:`0.05em`},children:r}),(0,s.jsx)(`div`,{ref:l,style:{height:`160px`,overflowY:`auto`,width:`52px`,scrollbarWidth:`thin`,border:`1px solid ${i.border}`,borderRadius:`8px`,padding:`4px`},children:e.map(e=>{let r=e===t;return(0,s.jsx)(`button`,{ref:t=>{c.current[e]=t},type:`button`,onClick:()=>n(e),style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:`100%`,height:`32px`,borderRadius:`6px`,border:`none`,cursor:`pointer`,fontSize:`13px`,fontWeight:r?600:400,backgroundColor:r?i.primary:`transparent`,color:r?i.bg:i.text,fontFamily:`monospace`,transition:`background-color 100ms ease`},children:u(e)},e)})})]})}function et({year:e,month:t,today:n,mode:r,selectedDate:i,selectedRange:a,multiDates:o,hoverDate:c,focusedDate:l,isDateDisabled:u,onSelectDate:d,onHoverDate:f,onSetFocused:p,theme:m,locale:h}){let g=Ye(e,t);return(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(7, 1fr)`,gap:`2px`,marginBottom:`4px`},children:ze.map(e=>(0,s.jsx)(`div`,{style:{textAlign:`center`,fontSize:`11px`,fontWeight:600,color:m.textMuted,padding:`4px 0`,textTransform:`uppercase`,letterSpacing:`0.05em`},children:e},e))}),(0,s.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(7, 1fr)`,gap:`2px`},children:g.map((e,g)=>{let _=e.getMonth()===t,v=He(e,n),y=e.getDay()===0||e.getDay()===6,b=u(e),x=r===`single`&&i!=null&&He(e,i),S=r===`multiple`&&o.some(t=>He(t,e)),C=r===`range`&&Ge(e,a[0],null),w=r===`range`&&Ge(e,null,a[1]),T=C||w,E=r===`range`&&a[0]&&!a[1]&&c?c:a[1],D=r===`range`&&We(e,a[0],E),O=r===`range`&&a[0]&&!a[1]&&c&&He(e,c),k=x||S||T,A=l!=null&&He(e,l),j=`transparent`,M=_?y?`${m.text}cc`:m.text:`${m.textMuted}60`,N=`none`,P=400;return k||O?(j=m.primary,M=m.bg,P=600):D&&(j=`${m.primary}18`),v&&!k&&(N=`2px solid ${m.primary}`,P=600),b&&(M=`${m.textMuted}50`),A&&!k&&(N=`2px solid ${m.secondary}`),(0,s.jsx)(`button`,{type:`button`,"aria-label":e.toLocaleDateString(h,{weekday:`long`,year:`numeric`,month:`long`,day:`numeric`}),"aria-pressed":k,"aria-disabled":b,disabled:b,onClick:()=>!b&&d(e),onMouseEnter:()=>f(e),onMouseLeave:()=>f(null),onFocus:()=>p(e),style:{width:`34px`,height:`34px`,borderRadius:`8px`,backgroundColor:j,color:M,border:N,fontSize:`13px`,fontWeight:P,cursor:b?`not-allowed`:`pointer`,opacity:b?.35:1,display:`flex`,alignItems:`center`,justifyContent:`center`,fontFamily:`inherit`,position:`relative`,outline:`none`,textDecoration:b?`line-through`:`none`,transition:`background-color 80ms ease`},children:e.getDate()},g)})})]})}function tt({value:e,onChange:i,rangeValue:a,onRangeChange:l,multiValue:u,onMultiChange:d,mode:f=`single`,minDate:p,maxDate:m,disabledDates:h,locale:g=`en-US`,dateFormat:_,showTime:v=!1,timeValue:y,onTimeChange:b,showPresets:x=!1,customPresets:S,label:C,placeholder:w=`MM/DD/YYYY`,hint:T,isDisabled:E=!1,isInvalid:D=!1,errorMessage:O,numberOfMonths:k=1,id:A,className:j,style:M}){let N=t.f(),P=(0,o.useId)(),F=A??P,I=r.o(),L=Ue(new Date),R=e!==void 0,[z,B]=(0,o.useState)(null),V=R?e??null:z,H=a!==void 0,[U,W]=(0,o.useState)([null,null]),G=H?a:U,K=u!==void 0,[q,J]=(0,o.useState)([]),Y=K?u:q,[ee,X]=(0,o.useState)(`start`),Z=f===`range`||f===`single`&&v,[te,ne]=(0,o.useState)([null,null]),[re,ie]=(0,o.useState)(null),ae=V??G[0]??L,[Q,oe]=(0,o.useState)(ae.getFullYear()),[se,ce]=(0,o.useState)(ae.getMonth()),[le,ue]=(0,o.useState)(`day`),[de,fe]=(0,o.useState)({h:0,m:0}),pe=y??de,[$,me]=(0,o.useState)(!1),[he,ge]=(0,o.useState)(()=>{if(f===`single`)return Ke(V,g,_);if(f===`range`){let[e,t]=G;if(e&&t)return`${Ke(e,g,_)} – ${Ke(t,g,_)}`}return``}),[_e,ve]=(0,o.useState)(null),[ye,be]=(0,o.useState)(null),[xe,Se]=(0,o.useState)({top:0,left:0,flipUp:!1}),[,Ce]=(0,o.useReducer)(e=>e+1,0),we=(0,o.useRef)(null),Te=(0,o.useRef)(null),Ee=(0,o.useRef)(null),De=x?420:v?480:360;(0,o.useEffect)(()=>{if(f===`single`)ge(Ke(V,g,_));else if(f===`range`){let[e,t]=G;ge(e&&t?`${Ke(e,g,_)} – ${Ke(t,g,_)}`:e?Ke(e,g,_):``)}else f===`multiple`&&ge(Y.length>0?`${Y.length} date${Y.length===1?``:`s`} selected`:``)},[V,G,Y,f,g,_]);let Oe=(0,o.useCallback)(()=>{we.current&&Se(Qe(we.current,De))},[De]);(0,o.useEffect)(()=>{if($)return Oe(),window.addEventListener(`scroll`,Oe,!0),window.addEventListener(`resize`,Oe),()=>{window.removeEventListener(`scroll`,Oe,!0),window.removeEventListener(`resize`,Oe)}},[$,Oe]),(0,o.useEffect)(()=>{if(!$)return;let e=e=>{we.current?.contains(e.target)||Te.current?.contains(e.target)||me(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[$]),(0,o.useEffect)(()=>{if(!$)return;let e=e=>{e.key===`Escape`&&(me(!1),Ee.current?.focus())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[$]);let ke=(0,o.useCallback)(e=>p&&Ue(e)<Ue(p)||m&&Ue(e)>Ue(m)?!0:h?typeof h==`function`?h(e):h.some(t=>He(t,e)):!1,[p,m,h]),Ae=(0,o.useCallback)(e=>{if(!ke(e)){if(f===`single`)Z?ie(e):(R||B(e),i?.(e),ge(Ke(e,g,_)),me(!1));else if(f===`range`)if(ee===`start`){let t=[e,null];ne(t),H||W(t),l?.(t),X(`end`)}else{let t=te[0]??G[0],n=t&&e<t?[e,t]:[t,e];ne(n),Z?X(`start`):(H||W(n),l?.(n),X(`start`),me(!1))}else if(f===`multiple`){let t=Y.some(t=>He(t,e))?Y.filter(t=>!He(t,e)):[...Y,e];K||J(t),d?.(t)}Ce()}},[f,ke,R,H,K,i,l,d,ee,te,G,Y,Z,g]),je=(0,o.useCallback)(()=>{if(f===`single`){let e=re??V;R||B(e),i?.(e)}else f===`range`&&(H||W(te),l?.(te));me(!1),X(`start`)},[f,re,te,V,R,H,i,l]),Me=(0,o.useCallback)(()=>{ie(null),ne([null,null]),X(`start`),me(!1)},[]),Ne=()=>{se===0?(ce(11),oe(e=>e-1)):ce(e=>e-1),ue(`day`)},Pe=()=>{se===11?(ce(0),oe(e=>e+1)):ce(e=>e+1),ue(`day`)},Fe=()=>oe(e=>e-1),Ie=()=>oe(e=>e+1),Le=()=>oe(e=>e-10),Re=()=>oe(e=>e+10),ze=e=>{if(ge(e),f===`single`){let t=qe(e,_);t&&!ke(t)&&(R||B(t),i?.(t),oe(t.getFullYear()),ce(t.getMonth()))}},We=e=>{if(e.stopPropagation(),f===`single`)R||B(null),i?.(null),ge(``);else if(f===`range`){let e=[null,null];H||W(e),l?.(e),ne(e),ge(``),X(`start`)}else f===`multiple`&&(K||J([]),d?.([]),ge(``))},Ge=e=>{if(le!==`day`)return;let t=_e??V??L,n=null;if(e.key===`ArrowRight`)n=new Date(t.getFullYear(),t.getMonth(),t.getDate()+1);else if(e.key===`ArrowLeft`)n=new Date(t.getFullYear(),t.getMonth(),t.getDate()-1);else if(e.key===`ArrowDown`)n=new Date(t.getFullYear(),t.getMonth(),t.getDate()+7);else if(e.key===`ArrowUp`)n=new Date(t.getFullYear(),t.getMonth(),t.getDate()-7);else if(e.key===`Enter`&&_e){Ae(_e);return}n&&(e.preventDefault(),ve(n),(n.getMonth()!==se||n.getFullYear()!==Q)&&(ce(n.getMonth()),oe(n.getFullYear())))},Je=()=>{oe(L.getFullYear()),ce(L.getMonth()),ue(`day`),Ae(L)},Ye=S??Ze(),tt=e=>{let[t,n]=e.getValue(),r=[t,n];ne(r),H||W(r),l?.(r),oe(t.getFullYear()),ce(t.getMonth()),X(`start`),Z||me(!1)},nt=se===11?0:se+1,rt=se===11?Q+1:Q,it=k>=2,at=C?n.m(C):void 0,ot=T?n.m(T):void 0,st=O?n.m(O):void 0,ct=n.m(w),lt=f===`single`&&V!=null||f===`range`&&(G[0]!=null||G[1]!=null)||f===`multiple`&&Y.length>0,ut=f===`range`?Z?te:G:[null,null],dt=D?N.danger:$?N.primary:N.border,ft=Array.from({length:24},(e,t)=>t),pt=Array.from({length:60},(e,t)=>t),mt=(0,s.jsxs)(`div`,{ref:Te,role:`dialog`,"aria-label":`Date picker`,"aria-modal":`false`,onKeyDown:Ge,style:{position:`absolute`,top:xe.top,left:xe.left,zIndex:9999,backgroundColor:N.surface,border:`1px solid ${N.border}`,borderRadius:`14px`,boxShadow:`0 8px 30px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.1)`,display:`flex`,overflow:`hidden`,minWidth:it?`580px`:`300px`,maxWidth:it&&x?`780px`:it?`620px`:x?`520px`:`300px`,opacity:+!!$,transform:$?`translateY(0) scale(1)`:xe.flipUp?`translateY(4px) scale(0.98)`:`translateY(-4px) scale(0.98)`,transition:I?`none`:`opacity 120ms ease, transform 120ms ease`,fontFamily:`inherit`},children:[x&&f===`range`&&(0,s.jsxs)(`div`,{style:{width:`148px`,flexShrink:0,borderRight:`1px solid ${N.border}`,padding:`8px 6px`,overflowY:`auto`,display:`flex`,flexDirection:`column`,gap:`1px`},children:[(0,s.jsx)(`div`,{style:{fontSize:`11px`,fontWeight:600,color:N.textMuted,textTransform:`uppercase`,letterSpacing:`0.07em`,padding:`4px 8px 8px`},children:`Quick select`}),Ye.map(e=>{let[t,n]=e.getValue(),r=ut[0]&&ut[1]&&He(ut[0],t)&&He(ut[1],n);return(0,s.jsx)(`button`,{type:`button`,onClick:()=>tt(e),style:{width:`100%`,textAlign:`left`,padding:`7px 10px`,borderRadius:`7px`,border:`none`,cursor:`pointer`,fontSize:`13px`,backgroundColor:r?`${N.primary}20`:`transparent`,color:r?N.primary:N.text,fontWeight:r?600:400,fontFamily:`inherit`,transition:`background-color 80ms ease`},onMouseEnter:e=>{r||(e.currentTarget.style.backgroundColor=`${N.surfaceAlt}`)},onMouseLeave:e=>{r||(e.currentTarget.style.backgroundColor=`transparent`)},children:e.label},e.label)})]}),(0,s.jsxs)(`div`,{style:{flex:1,padding:`16px`,display:`flex`,flexDirection:`column`,gap:`12px`,minWidth:0},children:[(0,s.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,s.jsx)(`button`,{type:`button`,"aria-label":le===`day`?`Previous month`:le===`month`?`Previous year`:`Previous decade`,onClick:()=>{le===`day`?Ne():le===`month`?Fe():Le()},style:{border:`none`,background:`transparent`,cursor:`pointer`,color:N.textMuted,padding:`6px`,borderRadius:`6px`,display:`flex`,alignItems:`center`},children:(0,s.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,s.jsx)(`polyline`,{points:`15 18 9 12 15 6`})})}),(0,s.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`6px`},children:[le===`day`&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`button`,{type:`button`,onClick:()=>ue(`month`),style:{border:`none`,background:`transparent`,cursor:`pointer`,fontSize:`14px`,fontWeight:600,color:N.text,padding:`4px 6px`,borderRadius:`6px`,fontFamily:`inherit`},children:Be[se]}),(0,s.jsx)(`button`,{type:`button`,onClick:()=>ue(`year`),style:{border:`none`,background:`transparent`,cursor:`pointer`,fontSize:`14px`,fontWeight:600,color:N.text,padding:`4px 6px`,borderRadius:`6px`,fontFamily:`inherit`},children:Q}),it&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`span`,{style:{color:N.textMuted,fontSize:`14px`},children:`–`}),(0,s.jsxs)(`span`,{style:{fontSize:`14px`,fontWeight:600,color:N.text},children:[Be[nt],` `,rt]})]})]}),le===`month`&&(0,s.jsx)(`button`,{type:`button`,onClick:()=>ue(`year`),style:{border:`none`,background:`transparent`,cursor:`pointer`,fontSize:`14px`,fontWeight:600,color:N.text,padding:`4px 6px`,borderRadius:`6px`,fontFamily:`inherit`},children:Q}),le===`year`&&(0,s.jsxs)(`span`,{style:{fontSize:`14px`,fontWeight:600,color:N.text},children:[Xe(Q),`–`,Xe(Q)+9]})]}),(0,s.jsx)(`button`,{type:`button`,"aria-label":le===`day`?`Next month`:le===`month`?`Next year`:`Next decade`,onClick:()=>{le===`day`?Pe():le===`month`?Ie():Re()},style:{border:`none`,background:`transparent`,cursor:`pointer`,color:N.textMuted,padding:`6px`,borderRadius:`6px`,display:`flex`,alignItems:`center`},children:(0,s.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,s.jsx)(`polyline`,{points:`9 18 15 12 9 6`})})})]}),le===`day`&&(0,s.jsxs)(`div`,{style:{display:`flex`,gap:`20px`},children:[(0,s.jsx)(et,{year:Q,month:se,today:L,mode:f,selectedDate:V,selectedRange:ut,multiDates:Y,hoverDate:ye,focusedDate:_e,isDateDisabled:ke,onSelectDate:Ae,onHoverDate:be,onSetFocused:ve,theme:N,locale:g}),it&&(0,s.jsx)(et,{year:rt,month:nt,today:L,mode:f,selectedDate:V,selectedRange:ut,multiDates:Y,hoverDate:ye,focusedDate:_e,isDateDisabled:ke,onSelectDate:Ae,onHoverDate:be,onSetFocused:ve,theme:N,locale:g})]}),le===`month`&&(0,s.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(3, 1fr)`,gap:`6px`},children:Ve.map((e,t)=>{let n=t===se;return(0,s.jsx)(`button`,{type:`button`,onClick:()=>{ce(t),ue(`day`)},style:{padding:`10px`,borderRadius:`8px`,border:t===L.getMonth()&&Q===L.getFullYear()&&!n?`2px solid ${N.primary}`:`none`,cursor:`pointer`,fontSize:`13px`,fontWeight:n?600:400,backgroundColor:n?N.primary:`transparent`,color:n?N.bg:N.text,fontFamily:`inherit`,transition:`background-color 80ms ease`},children:e},e)})}),le===`year`&&(0,s.jsx)(`div`,{style:{display:`grid`,gridTemplateColumns:`repeat(4, 1fr)`,gap:`6px`},children:Array.from({length:12},(e,t)=>{let n=Xe(Q)-1+t,r=n===Q,i=n===L.getFullYear(),a=t===0||t===11;return(0,s.jsx)(`button`,{type:`button`,onClick:()=>{oe(n),ue(`month`)},style:{padding:`10px 6px`,borderRadius:`8px`,border:i&&!r?`2px solid ${N.primary}`:`none`,cursor:`pointer`,fontSize:`13px`,fontWeight:r?600:400,backgroundColor:r?N.primary:`transparent`,color:r?N.bg:a?N.textMuted:N.text,fontFamily:`inherit`,transition:`background-color 80ms ease`,opacity:a?.5:1},children:n},n)})}),v&&le===`day`&&(0,s.jsxs)(`div`,{style:{borderTop:`1px solid ${N.border}`,paddingTop:`12px`,display:`flex`,alignItems:`flex-start`,gap:`8px`,justifyContent:`center`},children:[(0,s.jsx)($e,{values:ft,selected:pe.h,onSelect:e=>{y||fe(t=>({...t,h:e})),b?.({...pe,h:e})},label:`Hour`,theme:N}),(0,s.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,height:`40px`,marginTop:`28px`,fontSize:`16px`,fontWeight:700,color:N.textMuted},children:`:`}),(0,s.jsx)($e,{values:pt,selected:pe.m,onSelect:e=>{y||fe(t=>({...t,m:e})),b?.({...pe,m:e})},label:`Min`,theme:N})]}),f===`multiple`&&le===`day`&&Y.length>0&&(0,s.jsxs)(`div`,{style:{borderTop:`1px solid ${N.border}`,paddingTop:`8px`,fontSize:`12px`,color:N.textMuted,textAlign:`center`},children:[Y.length,` date`,Y.length===1?``:`s`,` selected`]}),(0,s.jsxs)(`div`,{style:{borderTop:`1px solid ${N.border}`,paddingTop:`10px`,display:`flex`,alignItems:`center`,justifyContent:Z?`space-between`:`flex-start`,gap:`8px`},children:[(0,s.jsx)(`button`,{type:`button`,onClick:Je,style:{border:`none`,background:`transparent`,cursor:`pointer`,fontSize:`13px`,color:N.primary,fontWeight:500,padding:`6px 10px`,borderRadius:`6px`,fontFamily:`inherit`},children:`Today`}),Z&&(0,s.jsxs)(`div`,{style:{display:`flex`,gap:`6px`},children:[(0,s.jsx)(`button`,{type:`button`,onClick:Me,style:{padding:`6px 14px`,borderRadius:`7px`,border:`1px solid ${N.border}`,cursor:`pointer`,fontSize:`13px`,fontWeight:500,backgroundColor:`transparent`,color:N.text,fontFamily:`inherit`},children:`Cancel`}),(0,s.jsx)(`button`,{type:`button`,onClick:je,style:{padding:`6px 14px`,borderRadius:`7px`,border:`none`,cursor:`pointer`,fontSize:`13px`,fontWeight:600,backgroundColor:N.primary,color:N.bg,fontFamily:`inherit`},children:`Apply`})]})]})]})]});return(0,s.jsxs)(`div`,{className:j,style:{display:`flex`,flexDirection:`column`,gap:`4px`,width:`100%`,position:`relative`,...M},children:[at&&(0,s.jsx)(`label`,{htmlFor:F,style:{fontSize:`13px`,fontWeight:500,color:N.text,marginBottom:`2px`},children:at}),(0,s.jsxs)(`div`,{ref:we,style:{display:`flex`,alignItems:`center`,border:`1.5px solid ${dt}`,borderRadius:`8px`,backgroundColor:N.surface,overflow:`hidden`,transition:I?`none`:`border-color 120ms ease`,opacity:E?.5:1},children:[(0,s.jsx)(`span`,{style:{display:`flex`,alignItems:`center`,paddingLeft:`10px`,color:N.textMuted,flexShrink:0},children:(0,s.jsxs)(`svg`,{width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,s.jsx)(`rect`,{x:`3`,y:`4`,width:`18`,height:`18`,rx:`2`}),(0,s.jsx)(`line`,{x1:`16`,y1:`2`,x2:`16`,y2:`6`}),(0,s.jsx)(`line`,{x1:`8`,y1:`2`,x2:`8`,y2:`6`}),(0,s.jsx)(`line`,{x1:`3`,y1:`10`,x2:`21`,y2:`10`})]})}),(0,s.jsx)(`input`,{ref:Ee,id:F,type:`text`,value:he,placeholder:ct,disabled:E,"aria-invalid":D,"aria-haspopup":`dialog`,"aria-expanded":$,readOnly:f===`range`||f===`multiple`,onChange:e=>ze(e.target.value),onFocus:()=>{E||me(!0)},style:{flex:1,backgroundColor:`transparent`,border:`none`,outline:`none`,fontSize:`14px`,padding:`9px 8px`,color:N.text,cursor:f===`single`?`text`:`pointer`,fontFamily:`inherit`,minWidth:0}}),lt&&!E&&(0,s.jsx)(`button`,{type:`button`,"aria-label":`Clear selection`,onClick:We,style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:`28px`,height:`28px`,border:`none`,background:`transparent`,cursor:`pointer`,color:N.textMuted,flexShrink:0,borderRadius:`4px`,marginRight:`4px`},children:(0,s.jsxs)(`svg`,{width:`13`,height:`13`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,s.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,s.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})}),(0,s.jsx)(`button`,{type:`button`,"aria-label":$?`Close calendar`:`Open calendar`,tabIndex:-1,disabled:E,onClick:()=>{E||me(e=>!e)},style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:`34px`,height:`36px`,border:`none`,background:`transparent`,cursor:E?`not-allowed`:`pointer`,color:N.textMuted,flexShrink:0},children:(0,s.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,style:{transform:$?`rotate(180deg)`:`rotate(0deg)`,transition:I?`none`:`transform 160ms ease`},children:(0,s.jsx)(`polyline`,{points:`6 9 12 15 18 9`})})})]}),ot&&!D&&(0,s.jsx)(`span`,{style:{fontSize:`12px`,color:N.textMuted},children:ot}),D&&st&&(0,s.jsx)(`span`,{role:`alert`,style:{fontSize:`12px`,color:N.danger},children:st}),$&&typeof document<`u`&&(0,c.createPortal)(mt,document.body)]})}tt.displayName=`TkxDatePicker`;var nt={sm:{track:4,thumb:14,fontSize:`0.75rem`},md:{track:6,thumb:18,fontSize:`0.875rem`},lg:{track:8,thumb:22,fontSize:`1rem`}};function rt(e,t,n){return Math.min(Math.max(e,t),n)}function it(e,t,n){return Math.round((e-t)/n)*n+t}function at(e,t,n){return(e-t)/(n-t)*100}function ot({value:e,min:t,max:n,step:r,isDisabled:i,trackColor:a,thumbSize:c,ariaLabel:l,tooltipMode:u,formatValue:d,orientation:f,onChange:p,onChangeEnd:m}){let[h,g]=(0,o.useState)(!1),[_,v]=(0,o.useState)(!1),[y,b]=(0,o.useState)(!1),x=a=>{i||(a.key===`ArrowRight`||a.key===`ArrowUp`?(a.preventDefault(),p(rt(it(e+r,t,r),t,n))):a.key===`ArrowLeft`||a.key===`ArrowDown`?(a.preventDefault(),p(rt(it(e-r,t,r),t,n))):a.key===`Home`?(a.preventDefault(),p(t)):a.key===`End`&&(a.preventDefault(),p(n)))},S=f===`vertical`,C=at(e,t,n),w=u===`always`||u===`hover`&&(y||_||h),T=S?{position:`absolute`,bottom:`${C}%`,transform:`translateY(50%)`,left:`50%`,marginLeft:`-${c/2}px`,zIndex:2,cursor:i?`not-allowed`:`grab`}:{position:`absolute`,left:`${C}%`,transform:`translateX(-50%)`,top:`50%`,marginTop:`-${c/2}px`,zIndex:2,cursor:i?`not-allowed`:`grab`},E=S?{position:`absolute`,left:c+6,top:`50%`,transform:`translateY(-50%)`,backgroundColor:a,color:`#fff`,borderRadius:`4px`,padding:`2px 6px`,fontSize:`0.75rem`,whiteSpace:`nowrap`,pointerEvents:`none`}:{position:`absolute`,bottom:c+6,left:`50%`,transform:`translateX(-50%)`,backgroundColor:a,color:`#fff`,borderRadius:`4px`,padding:`2px 6px`,fontSize:`0.75rem`,whiteSpace:`nowrap`,pointerEvents:`none`};return(0,s.jsxs)(`div`,{style:T,children:[w&&(0,s.jsx)(`div`,{style:E,children:d(e)}),(0,s.jsx)(`div`,{role:`slider`,tabIndex:i?-1:0,"aria-label":l,"aria-valuemin":t,"aria-valuemax":n,"aria-valuenow":e,"aria-disabled":i,"aria-orientation":f,onKeyDown:x,onFocus:()=>g(!0),onBlur:()=>g(!1),onPointerEnter:()=>b(!0),onPointerLeave:()=>b(!1),onPointerDown:e=>{i||(v(!0),e.target.setPointerCapture(e.pointerId))},onPointerUp:()=>{v(!1),m?.()},style:{width:c,height:c,borderRadius:`50%`,backgroundColor:i?`#888`:a,border:`3px solid #fff`,boxShadow:h?`0 0 0 3px ${a}44`:`0 1px 4px rgba(0,0,0,0.3)`,outline:`none`,display:`block`,transition:`box-shadow 150ms ease`}})]})}function st({value:e,defaultValue:i=0,onChange:a,rangeValue:c,onRangeChange:l,min:u=0,max:d=100,step:f=1,isRange:p=!1,label:m,showValue:h=!1,showTicks:g=!1,tickCount:_=5,isDisabled:v=!1,colorScheme:y=`primary`,size:b=`md`,marks:x,orientation:S=`horizontal`,showTooltip:C=!1,formatValue:w,onChangeEnd:T,onRangeChangeEnd:E,gradient:D=!1}){let O=t.f(),k=(0,o.useId)(),A=r.o(),j=e!==void 0,[M,N]=(0,o.useState)(i),P=j?e:M,F=c!==void 0,[I,L]=(0,o.useState)([u,d]),R=F?c:I,z=(0,o.useRef)(null),B=(0,o.useRef)(P);B.current=P;let V=(0,o.useRef)(R);V.current=R;let H={primary:O.primary,success:O.success,danger:O.danger,warning:O.warning}[y],U=nt[b],W=S===`vertical`,G=C===!0?`hover`:C===!1?!1:C,K=w??(e=>String(e)),q=H+`66`,J=(0,o.useCallback)((e,t)=>{let n=z.current;if(!n)return u;let r=n.getBoundingClientRect(),i;return i=rt(W?(r.bottom-(t??0))/r.height:(e-r.left)/r.width,0,1),rt(it(i*(d-u)+u,u,f),u,d)},[u,d,f,W]),Y=(0,o.useCallback)(e=>{if(v)return;let t=J(e.clientX,e.clientY);if(!p)j||N(t),a?.(t);else{let[e,n]=R,r=Math.abs(t-e)<=Math.abs(t-n)?[t,n]:[e,t];F||L(r),l?.(r)}},[v,p,j,F,J,a,l,R]),ee=e=>{j||N(e),a?.(e)},X=e=>{let t=[rt(e,u,R[1]),R[1]];F||L(t),l?.(t)},Z=e=>{let t=[R[0],rt(e,R[0],d)];F||L(t),l?.(t)},te=p?at(R[0],u,d):0,ne=at(p?R[1]:P,u,d),re=g?Array.from({length:_},(e,t)=>u+t/(_-1)*(d-u)):[],ie=m?n.m(m):void 0,ae=A?`none`:`background 150ms ease`;return(0,s.jsxs)(`div`,{className:n.a(`flex flex-col gap-2`),style:{opacity:v?.55:1,...W?{height:200,width:`auto`,display:`inline-flex`}:{width:`100%`}},children:[(ie||h)&&(0,s.jsxs)(`div`,{className:n.a(`flex items-center justify-between`),children:[ie&&(0,s.jsx)(`label`,{htmlFor:k,className:n.a(`text-sm font-medium`),style:{color:O.text,fontSize:U.fontSize},children:ie}),h&&!p&&(0,s.jsx)(`span`,{className:n.a(`text-sm tabular-nums`),style:{color:O.textMuted,fontSize:U.fontSize},children:K(P)}),h&&p&&(0,s.jsxs)(`span`,{className:n.a(`text-sm tabular-nums`),style:{color:O.textMuted,fontSize:U.fontSize},children:[K(R[0]),` – `,K(R[1])]})]}),(0,s.jsxs)(`div`,{style:{position:`relative`,...W?{paddingLeft:U.thumb/2,paddingRight:U.thumb/2,flex:1}:{paddingTop:U.thumb/2,paddingBottom:U.thumb/2}},children:[(0,s.jsxs)(`div`,{ref:z,onPointerDown:Y,style:{position:`relative`,...W?{width:U.track,height:`100%`}:{height:U.track},borderRadius:9999,backgroundColor:O.border,cursor:v?`not-allowed`:`pointer`,userSelect:`none`,touchAction:`none`},children:[(0,s.jsx)(`div`,{style:{position:`absolute`,...W?{left:0,bottom:`${te}%`,height:`${ne-te}%`,width:`100%`}:{top:0,left:`${te}%`,width:`${ne-te}%`,height:`100%`},borderRadius:9999,...v?{backgroundColor:O.textMuted}:D?{background:W?`linear-gradient(to top, ${q}, ${H})`:`linear-gradient(to right, ${q}, ${H})`}:{backgroundColor:H},transition:ae}}),re.map((e,t)=>(0,s.jsx)(`div`,{style:{position:`absolute`,...W?{bottom:`${at(e,u,d)}%`,left:`50%`,transform:`translate(-50%, 50%)`,height:3,width:U.track+4}:{left:`${at(e,u,d)}%`,top:`50%`,transform:`translate(-50%, -50%)`,width:3,height:U.track+4},backgroundColor:O.surface,borderRadius:9999,pointerEvents:`none`}},t)),p?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ot,{value:R[0],min:u,max:R[1],step:f,isDisabled:v,trackColor:H,trackHeight:U.track,thumbSize:U.thumb,ariaLabel:`${ie??`Range`} start`,tooltipMode:G,formatValue:K,orientation:S,onChange:X,onChangeEnd:E?()=>E(V.current):void 0}),(0,s.jsx)(ot,{value:R[1],min:R[0],max:d,step:f,isDisabled:v,trackColor:H,trackHeight:U.track,thumbSize:U.thumb,ariaLabel:`${ie??`Range`} end`,tooltipMode:G,formatValue:K,orientation:S,onChange:Z,onChangeEnd:E?()=>E(V.current):void 0})]}):(0,s.jsx)(ot,{value:P,min:u,max:d,step:f,isDisabled:v,trackColor:H,trackHeight:U.track,thumbSize:U.thumb,ariaLabel:ie??`Slider`,tooltipMode:G,formatValue:K,orientation:S,onChange:ee,onChangeEnd:T?()=>T(B.current):void 0})]}),x&&x.length>0&&(0,s.jsx)(`div`,{style:{position:W?`absolute`:`relative`,...W?{left:`100%`,top:0,bottom:0,marginLeft:8}:{marginTop:8}},children:x.map((e,t)=>(0,s.jsx)(`div`,{style:{position:`absolute`,...W?{bottom:`${at(e.value,u,d)}%`,transform:`translateY(50%)`,left:0}:{left:`${at(e.value,u,d)}%`,transform:`translateX(-50%)`},fontSize:`0.6875rem`,color:O.textMuted,whiteSpace:`nowrap`},children:n.m(e.label)},t))})]}),g&&!x&&!W&&(0,s.jsx)(`div`,{style:{position:`relative`,height:`1rem`},children:re.map((e,t)=>(0,s.jsx)(`span`,{style:{position:`absolute`,left:`${at(e,u,d)}%`,transform:`translateX(-50%)`,fontSize:`0.6875rem`,color:O.textMuted},children:K(Math.round(e))},t))})]})}st.displayName=`TkxSlider`;var ct={sm:{height:28,minWidth:28,fontSize:`0.75rem`,px:8},md:{height:36,minWidth:36,fontSize:`0.875rem`,px:10},lg:{height:44,minWidth:44,fontSize:`1rem`,px:12}};function lt(e,t,n,r){if(t<=1)return[1];let i=(e,t)=>Array.from({length:Math.max(0,t-e+1)},(t,n)=>e+n),a=Math.max(e-n,1),o=Math.min(e+n,t);if(!r){let e=[];return a>1&&e.push(`...`),e.push(...i(a,o)),o<t&&e.push(`...`),e}let s=t,c=a>3,l=o<s-2,u=[];u.push(1),c?u.push(`left-ellipsis`):u.push(...i(2,a-1)),u.push(...i(Math.max(a,2),Math.min(o,t-1))),l?u.push(`right-ellipsis`):u.push(...i(o+1,t-1)),t>1&&u.push(t);let d=new Set,f=[];for(let e of u)typeof e==`number`?d.has(e)||(d.add(e),f.push(e)):f.push(e);return f}function ut({total:e,pageSize:r=10,page:i,defaultPage:a=1,onChange:c,siblingCount:l=1,showEdges:u=!0,showPageSize:d=!1,onPageSizeChange:f,pageSizeOptions:p=[10,25,50,100],size:m=`md`,variant:h=`default`}){let g=t.f(),_=(0,o.useId)(),v=i!==void 0,[y,b]=(0,o.useState)(a),x=v?i:y,[S,C]=(0,o.useState)(r),w=r,T=Math.max(1,Math.ceil(e/w)),E=e=>{let t=Math.min(Math.max(e,1),T);t!==x&&(v||b(t),c?.(t))},D=e=>{C(e),f?.(e),E(1)},O=lt(x,T,l,u),k=ct[m],A=Math.min((x-1)*w+1,e),j=Math.min(x*w,e),M=(e,t)=>{let n={height:k.height,minWidth:k.minWidth,paddingLeft:k.px,paddingRight:k.px,fontSize:k.fontSize,borderRadius:`8px`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,cursor:t?`not-allowed`:`pointer`,border:`none`,outline:`none`,fontFamily:`inherit`,transition:`background 120ms ease, color 120ms ease`,opacity:t?.4:1};return e?{...n,backgroundColor:g.primary,color:g.bg,fontWeight:600,boxShadow:`0 0 0 2px ${g.primary}44`}:h===`default`?{...n,backgroundColor:g.surface,color:g.text,border:`1px solid ${g.border}`}:h===`outline`?{...n,backgroundColor:`transparent`,color:g.text,border:`1px solid ${g.border}`}:{...n,backgroundColor:`transparent`,color:g.text}},N=({d:e})=>(0,s.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,"aria-hidden":`true`,children:(0,s.jsx)(`polyline`,{points:e})});return(0,s.jsxs)(`nav`,{"aria-label":`Pagination`,className:n.a(`flex flex-col gap-2`),children:[e>0&&(0,s.jsx)(`p`,{className:n.a(`text-sm`),style:{color:g.textMuted,fontSize:k.fontSize},children:n.m(`Showing ${A}–${j} of ${e} items`)}),(0,s.jsxs)(`div`,{className:n.a(`flex items-center gap-1 flex-wrap`),children:[u&&(0,s.jsxs)(`button`,{type:`button`,"aria-label":`First page`,disabled:x===1,onClick:()=>E(1),style:M(!1,x===1),children:[(0,s.jsx)(N,{d:`15 18 9 12 15 6`}),(0,s.jsx)(N,{d:`20 18 14 12 20 6`})]}),(0,s.jsx)(`button`,{type:`button`,"aria-label":`Previous page`,disabled:x===1,onClick:()=>E(x-1),style:M(!1,x===1),children:(0,s.jsx)(N,{d:`15 18 9 12 15 6`})}),O.map((e,t)=>{if(typeof e==`string`)return(0,s.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,minWidth:k.minWidth,height:k.height,fontSize:k.fontSize,color:g.textMuted,userSelect:`none`},children:`…`},`${e}-${t}`);let n=e,r=n===x;return(0,s.jsx)(`button`,{type:`button`,"aria-label":`Page ${n}`,"aria-current":r?`page`:void 0,onClick:()=>E(n),style:M(r,!1),children:n},n)}),(0,s.jsx)(`button`,{type:`button`,"aria-label":`Next page`,disabled:x===T,onClick:()=>E(x+1),style:M(!1,x===T),children:(0,s.jsx)(N,{d:`9 18 15 12 9 6`})}),u&&(0,s.jsxs)(`button`,{type:`button`,"aria-label":`Last page`,disabled:x===T,onClick:()=>E(T),style:M(!1,x===T),children:[(0,s.jsx)(N,{d:`4 18 10 12 4 6`}),(0,s.jsx)(N,{d:`14 18 20 12 14 6`})]}),d&&(0,s.jsxs)(`div`,{className:n.a(`flex items-center gap-2 ml-2`),children:[(0,s.jsx)(`label`,{htmlFor:_,className:n.a(`text-sm`),style:{color:g.textMuted,fontSize:k.fontSize,whiteSpace:`nowrap`},children:`Rows per page`}),(0,s.jsx)(`select`,{id:_,value:S,onChange:e=>D(Number(e.target.value)),style:{height:k.height,paddingLeft:k.px,paddingRight:k.px,fontSize:k.fontSize,borderRadius:`8px`,border:`1px solid ${g.border}`,backgroundColor:g.surface,color:g.text,cursor:`pointer`,outline:`none`,fontFamily:`inherit`},children:p.map(e=>(0,s.jsx)(`option`,{value:e,children:e},e))})]})]})]})}ut.displayName=`TkxPagination`;var dt={"1/1":`100%`,"4/3":`75%`,"16/9":`56.25%`,"3/2":`66.666%`,"9/16":`177.777%`},ft={none:`0`,sm:`4px`,md:`8px`,lg:`16px`,full:`9999px`};function pt({color:e,size:t}){return(0,s.jsxs)(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:`none`,stroke:e,strokeWidth:1.5,"aria-hidden":`true`,children:[(0,s.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`}),(0,s.jsx)(`circle`,{cx:`8.5`,cy:`8.5`,r:`1.5`}),(0,s.jsx)(`path`,{d:`M21 15l-5-5L5 21`})]})}function mt({src:e,alt:i,fallback:a,placeholder:l=`skeleton`,fit:u=`cover`,ratio:d=`auto`,radius:f=`none`,caption:p,lazy:m=!0,preview:h=!1,className:g,style:_,...v}){let y=t.f(),b=r.o(),[x,S]=(0,o.useState)(!1),[C,w]=(0,o.useState)(!1),[T,E]=(0,o.useState)(!1),D=(0,o.useRef)(null),O=n.m(e),k=i?n.m(i):``,A=p?n.m(p):``,j=ft[f];(0,o.useEffect)(()=>{D.current?.complete&&S(!0)},[]);let M=(0,o.useCallback)(()=>S(!0),[]),N=(0,o.useCallback)(()=>w(!0),[]),P=(0,o.useCallback)(()=>{h&&!C&&E(!0)},[h,C]),F=(0,o.useCallback)(()=>E(!1),[]);(0,o.useEffect)(()=>{if(!T)return;let e=e=>{e.key===`Escape`&&F()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[T,F]);let I=l===`skeleton`&&!x&&!C,L=I&&!b?{animation:`tkx-shimmer 1.5s ease-in-out infinite`}:{},R=C?null:(0,s.jsx)(`img`,{ref:D,src:O,alt:k||void 0,role:k?void 0:`img`,"aria-label":k?void 0:`Image`,loading:m?`lazy`:void 0,onLoad:M,onError:N,onClick:h?P:void 0,className:n.t(n.a(`block w-full h-full`),h&&!C?n.a(`cursor-pointer`):``),style:{objectFit:u,borderRadius:j,opacity:+!!x,transition:b?`none`:`opacity 200ms ease`,position:d===`auto`?void 0:`absolute`,inset:d===`auto`?void 0:0},...v}),z=C?a?(0,s.jsx)(s.Fragment,{children:a}):(0,s.jsxs)(`div`,{role:`img`,"aria-label":k||`Image failed to load`,className:n.a(`flex flex-col items-center justify-center gap-2 w-full h-full`),style:{backgroundColor:y.surfaceAlt,borderRadius:j,color:y.textMuted,minHeight:`80px`},children:[(0,s.jsx)(pt,{color:y.textMuted,size:32}),(0,s.jsx)(`span`,{className:n.a(`text-xs`),style:{color:y.textMuted},children:`Failed to load`})]}):null,B=I?(0,s.jsx)(`div`,{"aria-hidden":`true`,style:{position:d===`auto`?void 0:`absolute`,inset:d===`auto`?void 0:0,width:`100%`,height:d===`auto`?`100%`:void 0,minHeight:d===`auto`?`80px`:void 0,borderRadius:j,backgroundColor:y.surfaceAlt,...L}}):null,V=d===`auto`?(0,s.jsxs)(`div`,{className:n.a(`relative w-full`),style:{borderRadius:j},children:[B,R,z]}):(0,s.jsxs)(`div`,{className:n.a(`relative w-full overflow-hidden`),style:{paddingBottom:dt[d],borderRadius:j},children:[B,R,z]}),H=A?(0,s.jsxs)(`figure`,{className:n.a(`m-0 p-0 flex flex-col gap-2`),style:{borderRadius:j},children:[V,(0,s.jsx)(`figcaption`,{className:n.a(`text-sm text-center`),style:{color:y.textMuted},children:A})]}):V;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`div`,{className:n.t(n.a(`inline-block w-full`),g),style:_,children:H}),T&&typeof document<`u`?(0,c.createPortal)((0,s.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":k||`Image preview`,className:n.a(`fixed inset-0 z-[9500] flex items-center justify-center p-4`),onClick:F,children:[(0,s.jsx)(`div`,{"aria-hidden":`true`,className:n.a(`absolute inset-0`),style:{backgroundColor:`rgba(0,0,0,0.85)`,backdropFilter:`blur(6px)`}}),(0,s.jsx)(`img`,{src:O,alt:k||`Full-size preview`,onClick:e=>e.stopPropagation(),className:n.a(`relative z-10 max-w-full max-h-full`),style:{objectFit:`contain`,borderRadius:`8px`,boxShadow:`0 25px 60px rgba(0,0,0,0.5)`}}),(0,s.jsx)(`button`,{"aria-label":`Close preview`,onClick:F,className:n.a(`absolute top-4 right-4 z-10 flex items-center justify-center`,`bg-transparent border-none cursor-pointer rounded-full p-2`),style:{color:`#fff`,backgroundColor:`rgba(255,255,255,0.15)`},children:(0,s.jsxs)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,"aria-hidden":`true`,children:[(0,s.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,s.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]}),document.body):null]})}function ht(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function gt({mimeType:e,color:t}){return e.startsWith(`image/`)?(0,s.jsxs)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:t,strokeWidth:1.5,"aria-hidden":`true`,children:[(0,s.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`}),(0,s.jsx)(`circle`,{cx:`8.5`,cy:`8.5`,r:`1.5`}),(0,s.jsx)(`path`,{d:`M21 15l-5-5L5 21`})]}):e===`application/pdf`?(0,s.jsxs)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:t,strokeWidth:1.5,"aria-hidden":`true`,children:[(0,s.jsx)(`path`,{d:`M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z`}),(0,s.jsx)(`polyline`,{points:`14 2 14 8 20 8`}),(0,s.jsx)(`line`,{x1:`9`,y1:`13`,x2:`15`,y2:`13`}),(0,s.jsx)(`line`,{x1:`9`,y1:`17`,x2:`11`,y2:`17`})]}):(0,s.jsxs)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:t,strokeWidth:1.5,"aria-hidden":`true`,children:[(0,s.jsx)(`path`,{d:`M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z`}),(0,s.jsx)(`polyline`,{points:`14 2 14 8 20 8`})]})}var _t=0;function vt(){return`tkx-file-${++_t}`}function yt({accept:e,multiple:i=!1,maxSize:a,maxFiles:c,onChange:l,onError:u,label:d=`Upload files`,hint:f,isDisabled:p=!1,preview:m=!0,dragDrop:h=!0,variant:g=`dropzone`}){let _=t.f(),v=r.o(),y=(0,o.useId)(),b=(0,o.useRef)(null),[x,S]=(0,o.useState)(!1),[C,w]=(0,o.useState)([]);(0,o.useEffect)(()=>()=>{C.forEach(e=>{e.objectUrl&&URL.revokeObjectURL(e.objectUrl)})},[]);let T=(0,o.useCallback)(e=>{let t=0,n=setInterval(()=>{t+=Math.floor(Math.random()*20)+10,t>=100&&(t=100,clearInterval(n)),w(n=>n.map(n=>n.id===e?{...n,progress:t}:n))},100)},[]),E=(0,o.useCallback)(t=>{if(a&&t.size>a)return`"${n.m(t.name)}" exceeds max size of ${ht(a)}`;if(e&&!e.split(`,`).map(e=>e.trim()).some(e=>e.startsWith(`.`)?t.name.toLowerCase().endsWith(e.toLowerCase()):e.endsWith(`/*`)?t.type.startsWith(e.slice(0,-1)):t.type===e))return`"${n.m(t.name)}" is not an accepted file type`},[e,a]),D=(0,o.useCallback)(e=>{let t=c?c-C.length:1/0;if(t<=0){u?.(`Maximum of ${c} file${c===1?``:`s`} allowed`);return}let n=e.slice(0,t).map(e=>{let t=E(e),n=m&&e.type.startsWith(`image/`)&&!t?URL.createObjectURL(e):void 0;return{file:e,id:vt(),objectUrl:n,progress:0,error:t}});w(e=>{let t=i?[...e,...n]:n,r=t.filter(e=>!e.error).map(e=>e.file);return l?.(r),t}),n.forEach(e=>{e.error&&u?.(e.error)}),n.forEach(e=>{e.error||T(e.id)})},[C.length,c,i,l,u,m,T,E]),O=(0,o.useCallback)(e=>{let t=Array.from(e.target.files??[]);t.length&&D(t),e.target.value=``},[D]),k=(0,o.useCallback)(e=>{if(e.preventDefault(),S(!1),p)return;let t=Array.from(e.dataTransfer.files);t.length&&D(t)},[p,D]),A=(0,o.useCallback)(e=>{e.preventDefault(),p||S(!0)},[p]),j=(0,o.useCallback)(()=>S(!1),[]),M=(0,o.useCallback)(e=>{w(t=>{let n=t.find(t=>t.id===e);n?.objectUrl&&URL.revokeObjectURL(n.objectUrl);let r=t.filter(t=>t.id!==e);return l?.(r.filter(e=>!e.error).map(e=>e.file)),r})},[l]),N=(0,o.useCallback)(()=>{p||b.current?.click()},[p]),P=x?_.primary:_.border,F=n.m(d),I=f?n.m(f):``,L=(0,s.jsxs)(`div`,{role:`button`,tabIndex:p?-1:0,"aria-label":F,"aria-describedby":f?y:void 0,"aria-disabled":p,onClick:N,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),N())},onDrop:h?k:void 0,onDragOver:h?A:void 0,onDragLeave:h?j:void 0,className:n.a(`flex flex-col items-center justify-center gap-3 w-full p-8 rounded-lg`),style:{border:`2px dashed ${P}`,backgroundColor:x?`${_.primary}10`:_.surface,cursor:p?`not-allowed`:`pointer`,opacity:p?.5:1,transition:v?`none`:`border-color 150ms ease, background-color 150ms ease`,outline:`none`},children:[(0,s.jsxs)(`svg`,{width:`40`,height:`40`,viewBox:`0 0 24 24`,fill:`none`,stroke:x?_.primary:_.textMuted,strokeWidth:1.5,"aria-hidden":`true`,children:[(0,s.jsx)(`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),(0,s.jsx)(`polyline`,{points:`17 8 12 3 7 8`}),(0,s.jsx)(`line`,{x1:`12`,y1:`3`,x2:`12`,y2:`15`})]}),(0,s.jsxs)(`div`,{className:n.a(`text-center`),children:[(0,s.jsx)(`p`,{className:n.a(`m-0 text-sm font-medium`),style:{color:_.text},children:x?`Drop files here`:F}),I&&(0,s.jsx)(`p`,{id:y,className:n.a(`m-0 text-xs mt-1`),style:{color:_.textMuted},children:I})]})]}),R=(0,s.jsxs)(`button`,{type:`button`,disabled:p,onClick:N,"aria-describedby":f?y:void 0,className:n.a(`flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium font-sans border-none cursor-pointer`),style:{backgroundColor:_.primary,color:_.bg,opacity:p?.5:1,cursor:p?`not-allowed`:`pointer`},children:[(0,s.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,"aria-hidden":`true`,children:[(0,s.jsx)(`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),(0,s.jsx)(`polyline`,{points:`17 8 12 3 7 8`}),(0,s.jsx)(`line`,{x1:`12`,y1:`3`,x2:`12`,y2:`15`})]}),F,f&&(0,s.jsx)(`span`,{id:y,className:n.a(`sr-only`),children:I})]});return(0,s.jsxs)(`div`,{className:n.a(`flex flex-col gap-3 w-full font-sans`),children:[(0,s.jsx)(`input`,{ref:b,type:`file`,accept:e,multiple:i,disabled:p,onChange:O,className:n.a(`sr-only`),tabIndex:-1,"aria-hidden":`true`}),g===`dropzone`?L:R,C.length>0&&(0,s.jsx)(`ul`,{role:`status`,"aria-live":`polite`,"aria-label":`Uploaded files`,className:n.a(`m-0 p-0 flex flex-col gap-2`),style:{listStyle:`none`},children:C.map(e=>(0,s.jsxs)(`li`,{className:n.a(`flex flex-col gap-1 rounded-md p-3`),style:{backgroundColor:_.surfaceAlt,border:`1px solid ${e.error?_.danger:_.border}`},children:[(0,s.jsxs)(`div`,{className:n.a(`flex items-center gap-3`),children:[e.objectUrl&&m?(0,s.jsx)(`img`,{src:e.objectUrl,alt:n.m(e.file.name),className:n.a(`rounded`),style:{width:40,height:40,objectFit:`cover`,flexShrink:0}}):(0,s.jsx)(`span`,{style:{flexShrink:0},children:(0,s.jsx)(gt,{mimeType:e.file.type,color:e.error?_.danger:_.textMuted})}),(0,s.jsxs)(`div`,{className:n.a(`flex flex-col gap-0.5 flex-1 min-w-0`),children:[(0,s.jsx)(`span`,{className:n.a(`text-sm font-medium truncate`),style:{color:e.error?_.danger:_.text},title:e.file.name,children:n.m(e.file.name)}),(0,s.jsxs)(`span`,{className:n.a(`text-xs`),style:{color:_.textMuted},children:[ht(e.file.size),e.error&&` — ${e.error}`]})]}),(0,s.jsx)(`button`,{type:`button`,"aria-label":`Remove ${n.m(e.file.name)}`,onClick:()=>M(e.id),className:n.a(`flex items-center justify-center bg-transparent border-none cursor-pointer rounded p-1`),style:{color:_.textMuted,flexShrink:0},children:(0,s.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,"aria-hidden":`true`,children:[(0,s.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,s.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]}),!e.error&&e.progress<100&&(0,s.jsx)(`div`,{className:n.a(`w-full overflow-hidden`),style:{height:`3px`,borderRadius:`3px`,backgroundColor:_.border},"aria-hidden":`true`,children:(0,s.jsx)(`div`,{style:{height:`100%`,borderRadius:`3px`,backgroundColor:_.primary,width:`${e.progress}%`,transition:v?`none`:`width 100ms ease`}})})]},e.id))})]})}var bt={sm:16,md:24,lg:32,xl:40};function xt({size:e,filled:t,color:n,halfFilled:r,id:i}){let a=i?`hg-${i}`:void 0;return(0,s.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,"aria-hidden":`true`,style:{display:`block`},children:[r&&a&&(0,s.jsx)(`defs`,{children:(0,s.jsxs)(`linearGradient`,{id:a,x1:`0`,x2:`1`,y1:`0`,y2:`0`,children:[(0,s.jsx)(`stop`,{offset:`50%`,stopColor:n}),(0,s.jsx)(`stop`,{offset:`50%`,stopColor:`transparent`})]})}),(0,s.jsx)(`polygon`,{points:`12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2`,fill:r&&a?`url(#${a})`:t?n:`none`,stroke:n,strokeWidth:1.5,strokeLinejoin:`round`})]})}function St({size:e,filled:t,color:n,halfFilled:r,id:i}){let a=i?`hg-${i}`:void 0;return(0,s.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,"aria-hidden":`true`,style:{display:`block`},children:[r&&a&&(0,s.jsx)(`defs`,{children:(0,s.jsxs)(`linearGradient`,{id:a,x1:`0`,x2:`1`,y1:`0`,y2:`0`,children:[(0,s.jsx)(`stop`,{offset:`50%`,stopColor:n}),(0,s.jsx)(`stop`,{offset:`50%`,stopColor:`transparent`})]})}),(0,s.jsx)(`path`,{d:`M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z`,fill:r&&a?`url(#${a})`:t?n:`none`,stroke:n,strokeWidth:1.5,strokeLinejoin:`round`})]})}function Ct({size:e,filled:t,color:n,halfFilled:r,id:i}){let a=i?`hg-${i}`:void 0;return(0,s.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,"aria-hidden":`true`,style:{display:`block`},children:[r&&a&&(0,s.jsx)(`defs`,{children:(0,s.jsxs)(`linearGradient`,{id:a,x1:`0`,x2:`1`,y1:`0`,y2:`0`,children:[(0,s.jsx)(`stop`,{offset:`50%`,stopColor:n}),(0,s.jsx)(`stop`,{offset:`50%`,stopColor:`transparent`})]})}),(0,s.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`,fill:r&&a?`url(#${a})`:t?n:`none`,stroke:n,strokeWidth:1.5})]})}function wt({type:e,size:t,filled:n,color:r,halfFilled:i,uid:a}){let o={size:t,filled:n,color:r,halfFilled:i,id:a};return e===`heart`?(0,s.jsx)(St,{...o}):e===`circle`?(0,s.jsx)(Ct,{...o}):(0,s.jsx)(xt,{...o})}function Tt(e,t,n){return Math.min(n,Math.max(t,e))}function Et(e,t){return t===1?Math.round(e):Math.round(e*2)/2}function Dt(e,t,n){if(n===1)return t+1;let r=e.currentTarget.getBoundingClientRect(),i=r.left+r.width/2;return e.clientX<i?t+.5:t+1}function Ot({value:e,defaultValue:i=0,onChange:a,max:c=5,precision:l=1,size:u=`md`,isReadOnly:d=!1,isDisabled:f=!1,label:p,showValue:m=!1,colorScheme:h=`warning`,emptyIcon:g=`star`,filledIcon:_=`star`}){let v=t.f(),y=r.o(),b=(0,o.useId)(),x=e!==void 0,[S,C]=(0,o.useState)(i),[w,T]=(0,o.useState)(null),E=(0,o.useRef)(null),D=x?e??0:S,O=w??D,k={warning:v.warning,primary:v.primary,danger:v.danger}[h]??v.warning,A=bt[u],j=!d&&!f,M=(0,o.useCallback)(e=>{x||C(e),a?.(e)},[x,a]),N=(0,o.useCallback)((e,t)=>{j&&T(Dt(e,t,l))},[j,l]),P=(0,o.useCallback)(()=>{j&&T(null)},[j]),F=(0,o.useCallback)((e,t)=>{if(!j)return;let n=Dt(e,t,l);M(n===D?0:n)},[j,l,D,M]),I=(0,o.useCallback)(e=>{if(!j)return;let t=l,n=D;if(e.key===`ArrowRight`||e.key===`ArrowUp`)e.preventDefault(),n=Tt(D+t,0,c);else if(e.key===`ArrowLeft`||e.key===`ArrowDown`)e.preventDefault(),n=Tt(D-t,0,c);else if(e.key===`Home`)e.preventDefault(),n=0;else if(e.key===`End`)e.preventDefault(),n=c;else return;n=Et(n,l),M(n)},[j,D,c,l,M]),L=p?n.m(p):`Rating`;return(0,s.jsxs)(`div`,{className:n.t(n.a(`inline-flex items-center gap-2 font-sans`),f?n.a(`opacity-50`):``),children:[(0,s.jsx)(`div`,{ref:E,role:`radiogroup`,"aria-label":L,"aria-disabled":f,"aria-readonly":d,tabIndex:j?0:-1,onKeyDown:I,onMouseLeave:P,className:n.a(`flex items-center gap-0.5 outline-none`),style:{cursor:j?`pointer`:`default`},children:Array.from({length:c},(e,t)=>{let n=t+1,r=t+.5,i=O>=n,a=!i&&l===.5&&O>=r,o=`${b}-${t}`;return(0,s.jsx)(`span`,{role:`radio`,"aria-checked":l===.5&&D===r||D===n,"aria-label":l===.5?`${r} star${r===1?``:`s`} / ${n} star${n===1?``:`s`}`:`${n} star${n===1?``:`s`}`,tabIndex:-1,onMouseMove:e=>N(e,t),onClick:e=>F(e,t),style:{display:`inline-flex`,alignItems:`center`,lineHeight:0,transition:y?`none`:`transform 120ms ease`,transform:w!==null&&O>=r&&j?`scale(1.15)`:`scale(1)`},children:(0,s.jsx)(wt,{type:i||a?_:g,size:A,filled:i,halfFilled:a,color:i||a?k:v.border,uid:a?o:void 0})},t)})}),m&&(0,s.jsxs)(`span`,{className:n.a(`text-sm tabular-nums`),style:{color:v.textMuted},"aria-live":`polite`,"aria-atomic":`true`,children:[D%1==0?D.toFixed(0):D.toFixed(1),` / `,c]})]})}var kt=!1;function At(){if(kt||typeof document>`u`)return;kt=!0;let e=document.createElement(`style`);e.textContent=`
21
- @keyframes tkx-blink { 0%,100% { opacity:1 } 50% { opacity:0 } }
22
- @keyframes tkx-bounce { 0%,100% { transform:translateY(0) } 50% { transform:translateY(-5px) } }
23
- .tkx-cursor::after { content:'▋'; display:inline-block; animation:tkx-blink 1s step-start infinite; margin-left:1px; }
24
- .tkx-dot1 { animation:tkx-bounce 1s ease-in-out infinite; }
25
- .tkx-dot2 { animation:tkx-bounce 1s ease-in-out 0.2s infinite; }
26
- .tkx-dot3 { animation:tkx-bounce 1s ease-in-out 0.4s infinite; }
27
- `,document.head.appendChild(e)}function jt(){return(0,s.jsxs)(`svg`,{width:`28`,height:`28`,viewBox:`0 0 28 28`,fill:`none`,"aria-hidden":`true`,children:[(0,s.jsx)(`circle`,{cx:`14`,cy:`14`,r:`14`,fill:`currentColor`,fillOpacity:`0.15`}),(0,s.jsx)(`circle`,{cx:`14`,cy:`11`,r:`4`,fill:`currentColor`}),(0,s.jsx)(`path`,{d:`M6 24c0-4.418 3.582-8 8-8s8 3.582 8 8`,fill:`currentColor`})]})}function Mt(){return(0,s.jsxs)(`svg`,{width:`28`,height:`28`,viewBox:`0 0 28 28`,fill:`none`,"aria-hidden":`true`,children:[(0,s.jsx)(`circle`,{cx:`14`,cy:`14`,r:`14`,fill:`currentColor`,fillOpacity:`0.15`}),(0,s.jsx)(`path`,{d:`M14 5l2.2 6.5H23l-5.6 4 2.2 6.5L14 18l-5.6 4 2.2-6.5L5 11.5h6.8z`,fill:`currentColor`})]})}function Nt(){let e=t.f();return(0,s.jsxs)(`div`,{className:n.a(`flex items-center gap-1.5 px-4 py-3 rounded-2xl w-fit`),style:{backgroundColor:e.surface,border:`1px solid ${e.border}`},"aria-label":`Assistant is thinking`,children:[(0,s.jsx)(`span`,{className:`tkx-dot1 inline-block w-2 h-2 rounded-full`,style:{backgroundColor:e.textMuted}}),(0,s.jsx)(`span`,{className:`tkx-dot2 inline-block w-2 h-2 rounded-full`,style:{backgroundColor:e.textMuted}}),(0,s.jsx)(`span`,{className:`tkx-dot3 inline-block w-2 h-2 rounded-full`,style:{backgroundColor:e.textMuted}})]})}function Pt({message:e,showTimestamp:i,avatarUser:a,avatarAssistant:o}){let c=t.f(),l=r.o(),{role:u,content:d,timestamp:f,isStreaming:p,error:m}=e,h=n.m(d),g=f?new Intl.DateTimeFormat(`en-US`,{hour:`numeric`,minute:`2-digit`,hour12:!0}).format(f):null;if(u===`system`)return(0,s.jsx)(`div`,{role:`listitem`,className:n.a(`flex justify-center my-2`),children:(0,s.jsx)(`p`,{className:n.a(`text-xs italic px-3 py-1 rounded-full`),style:{color:c.textMuted,backgroundColor:c.surfaceAlt},children:h})});let _=u===`user`,v=_?a??(0,s.jsx)(jt,{}):o??(0,s.jsx)(Mt,{}),y=_?{backgroundColor:c.primary,color:c.bg}:{backgroundColor:c.surface,color:c.text,border:`1px solid ${m?c.danger:c.border}`};return m&&(y.borderColor=c.danger,y.borderWidth=`2px`),(0,s.jsxs)(`div`,{role:`listitem`,className:n.a(`flex gap-2 mb-4`,_?`flex-row-reverse`:`flex-row`),children:[(0,s.jsx)(`div`,{className:n.a(`shrink-0 w-8 h-8 rounded-full flex items-center justify-center overflow-hidden`),style:{color:_?c.primary:c.secondary},children:v}),(0,s.jsxs)(`div`,{className:n.a(`flex flex-col gap-1 max-w-[75%]`,_?`items-end`:`items-start`),children:[(0,s.jsxs)(`div`,{className:n.t(n.a(`px-4 py-2.5 rounded-2xl text-sm leading-relaxed break-words whitespace-pre-wrap`),p&&!l?`tkx-cursor`:``),style:y,children:[h,m&&(0,s.jsx)(`span`,{"aria-label":`Error`,style:{marginLeft:6,color:c.danger},children:`⚠`})]}),i&&g&&(0,s.jsx)(`span`,{className:n.a(`text-[10px]`),style:{color:c.textMuted},children:g})]})]})}function Ft({messages:e,onSend:i,isLoading:a=!1,placeholder:c=`Type a message…`,maxLength:l,showTimestamps:u=!1,avatarUser:d,avatarAssistant:f,height:p=480,inputPosition:m=`bottom`}){let h=t.f(),g=r.o(),[_,v]=(0,o.useState)(``),y=(0,o.useRef)(null),b=(0,o.useRef)(null);(0,o.useEffect)(()=>{At()},[]),(0,o.useEffect)(()=>{let e=y.current;e&&e.scrollTo({top:e.scrollHeight,behavior:g?`auto`:`smooth`})},[e,a,g]);let x=(0,o.useCallback)(()=>{let e=_.trim();!e||!i||(i(e),v(``),b.current&&(b.current.style.height=`auto`))},[_,i]),S=(0,o.useCallback)(e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),x())},[x]),C=(0,o.useCallback)(e=>{v(l?e.target.value.slice(0,l):e.target.value);let t=b.current;t&&(t.style.height=`auto`,t.style.height=`${Math.min(t.scrollHeight,120)}px`)},[l]),w=_.trim().length>0&&!a,T=typeof p==`number`?`${p}px`:p,E=m===`floating`,D=(0,s.jsxs)(`div`,{className:n.a(`flex flex-col gap-1 p-3`),style:E?{position:`absolute`,bottom:12,left:12,right:12,borderRadius:16,backgroundColor:h.surface,border:`1px solid ${h.border}`,boxShadow:`0 4px 24px rgba(0,0,0,0.18)`}:{borderTop:`1px solid ${h.border}`,backgroundColor:h.surface},children:[(0,s.jsxs)(`div`,{className:n.a(`flex items-end gap-2`),children:[(0,s.jsx)(`textarea`,{ref:b,rows:1,value:_,onChange:C,onKeyDown:S,placeholder:n.m(c),"aria-label":`Message input`,"aria-multiline":`true`,disabled:a,className:n.a(`flex-1 resize-none text-sm leading-6 bg-transparent outline-none py-1`),style:{color:h.text,caretColor:h.primary,minHeight:32,maxHeight:120}}),(0,s.jsx)(`button`,{onClick:x,disabled:!w,"aria-label":`Send message`,className:n.a(`shrink-0 w-9 h-9 rounded-xl flex items-center justify-center`,!g&&`transition-opacity duration-150`,w?`cursor-pointer opacity-100`:`opacity-40 cursor-not-allowed`),style:{backgroundColor:h.primary,color:h.bg},children:(0,s.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M2 14L14 8 2 2v4.5l8 1.5-8 1.5V14z`,fill:`currentColor`})})})]}),l&&(0,s.jsxs)(`div`,{className:n.a(`text-right text-[10px]`),style:{color:h.textMuted},children:[_.length,`/`,l]})]});return(0,s.jsxs)(`div`,{className:n.a(`flex flex-col overflow-hidden rounded-2xl`),style:{height:T,backgroundColor:h.bg,border:`1px solid ${h.border}`,position:`relative`},children:[(0,s.jsx)(`div`,{ref:y,role:`log`,"aria-live":`polite`,"aria-label":`Chat messages`,className:n.a(`flex-1 overflow-y-auto p-4`),style:{paddingBottom:E?80:void 0},children:(0,s.jsxs)(`div`,{role:`list`,children:[e.map(e=>(0,s.jsx)(Pt,{message:e,showTimestamp:u,avatarUser:d,avatarAssistant:f},e.id)),a&&(0,s.jsxs)(`div`,{role:`listitem`,className:n.a(`flex gap-2 mb-4`),children:[(0,s.jsx)(`div`,{className:n.a(`w-8 h-8 shrink-0`)}),(0,s.jsx)(Nt,{})]})]})}),D]})}var It={sm:`text-[11px]`,md:`text-xs`,lg:`text-sm`},Lt={sm:`px-2 py-0.5`,md:`px-2.5 py-1`,lg:`px-3 py-1.5`},Rt={sm:`gap-1`,md:`gap-1.5`,lg:`gap-2`},zt={sm:12,md:14,lg:16};function Bt(e,n){let r=t.f(),i={default:r.textMuted,primary:r.primary,secondary:r.secondary,success:r.success,danger:r.danger,warning:r.warning,info:r.info}[e];return n===`solid`?{bg:i,color:r.bg,border:`transparent`}:n===`subtle`?{bg:`${i}22`,color:i,border:`transparent`}:{bg:`transparent`,color:i,border:i}}function Vt({variant:e=`subtle`,size:i=`md`,colorScheme:a=`default`,onRemove:o,leftIcon:c,isDisabled:l=!1,clickable:u=!1,children:d,className:f,style:p,onClick:m,...h}){t.f();let g=r.o(),_=Bt(a,e),v=typeof d==`string`?n.m(d):d,y=zt[i],b=n.a(`inline-flex items-center font-medium rounded-full select-none`,It[i],Lt[i],Rt[i],l?`opacity-50 cursor-not-allowed`:u?`cursor-pointer`:`cursor-default`,u&&!g&&`transition-opacity duration-150`);return(0,s.jsxs)(`span`,{role:u?`button`:void 0,tabIndex:u&&!l?0:void 0,"aria-disabled":l||void 0,className:n.t(b,f),style:{backgroundColor:_.bg,color:_.color,border:`1px solid ${_.border===`transparent`?`transparent`:_.border}`,...p},onClick:l?void 0:m,onKeyDown:u&&!l&&m?e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),m(e))}:void 0,...h,children:[c&&(0,s.jsx)(`span`,{"aria-hidden":`true`,className:n.a(`shrink-0 flex items-center`),children:c}),(0,s.jsx)(`span`,{children:v}),o&&!l&&(0,s.jsx)(`button`,{type:`button`,"aria-label":`Remove ${typeof d==`string`?d:`tag`}`,onClick:e=>{e.stopPropagation(),o()},className:n.a(`shrink-0 flex items-center justify-center rounded-full cursor-pointer`),style:{width:y+4,height:y+4,color:_.color,backgroundColor:`transparent`,border:`none`,padding:0},tabIndex:0,children:(0,s.jsx)(`svg`,{width:y,height:y,viewBox:`0 0 12 12`,fill:`none`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M2 2l8 8M10 2L2 10`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`})})})]})}function Ht({value:e,defaultValue:i=[],onChange:a,placeholder:c=`Add tag…`,maxTags:l,allowDuplicates:u=!1,validate:d,colorScheme:f=`primary`,size:p=`md`,label:m,hint:h,isDisabled:g=!1}){let _=t.f(),v=r.o(),[y,b]=(0,o.useState)(i),[x,S]=(0,o.useState)(``),[C,w]=(0,o.useState)(null),T=(0,o.useRef)(null),E=e!==void 0,D=E?e:y,O=(0,o.useCallback)(e=>{E||b(e),a?.(e)},[E,a]),k=(0,o.useCallback)(e=>{let t=e.trim();if(t){if(l!==void 0&&D.length>=l){w(`Maximum ${l} tags allowed`);return}if(!u&&D.includes(t)){w(`Duplicate tags are not allowed`);return}if(d){let e=d(t);if(e===!1){w(`Invalid tag`);return}if(typeof e==`string`){w(e);return}}w(null),O([...D,t]),S(``)}},[D,l,u,d,O]),A=(0,o.useCallback)(e=>{O(D.filter((t,n)=>n!==e)),w(null)},[D,O]),j=(0,o.useCallback)(e=>{e.key===`Enter`||e.key===`,`?(e.preventDefault(),k(x)):e.key===`Backspace`&&x===``&&D.length>0&&A(D.length-1)},[x,D,k,A]),M=(0,o.useCallback)(e=>{let t=e.target.value;t.endsWith(`,`)?k(t.slice(0,-1)):(S(t),C&&w(null))},[k,C]),N=p===`sm`?`6px 8px`:p===`lg`?`10px 12px`:`8px 10px`,P=p===`sm`?11:p===`lg`?14:12;return(0,s.jsxs)(`div`,{className:n.a(`flex flex-col gap-1.5`),children:[m&&(0,s.jsx)(`label`,{className:n.a(`text-sm font-medium`),style:{color:_.text},onClick:()=>T.current?.focus(),children:n.m(m)}),(0,s.jsxs)(`div`,{className:n.a(`flex flex-wrap items-center gap-1.5 rounded-lg cursor-text`,!v&&`transition-colors duration-150`),style:{padding:N,backgroundColor:_.surface,border:`1.5px solid ${C?_.danger:_.border}`,opacity:g?.55:1,minHeight:p===`sm`?36:p===`lg`?48:40},onClick:()=>!g&&T.current?.focus(),children:[D.map((e,t)=>(0,s.jsx)(Vt,{size:p,variant:`subtle`,colorScheme:f,onRemove:g?void 0:()=>A(t),isDisabled:g,children:e},`${e}-${t}`)),(!l||D.length<l)&&!g&&(0,s.jsx)(`input`,{ref:T,type:`text`,value:x,onChange:M,onKeyDown:j,placeholder:D.length===0?n.m(c):``,disabled:g,className:n.a(`flex-1 bg-transparent outline-none min-w-[80px]`),style:{fontSize:P,color:_.text,caretColor:_.primary},"aria-label":m??`Tag input`})]}),C&&(0,s.jsx)(`p`,{className:n.a(`text-xs`),style:{color:_.danger},role:`alert`,children:C}),h&&!C&&(0,s.jsx)(`p`,{className:n.a(`text-xs`),style:{color:_.textMuted},children:n.m(h)})]})}var Ut=!1;function Wt(){if(Ut||typeof document>`u`)return;Ut=!0;let e=document.createElement(`style`);e.textContent=`
28
- @keyframes tkx-pulse-dot { 0%,100% { box-shadow:0 0 0 0 currentColor; opacity:1; } 70% { box-shadow:0 0 0 8px transparent; opacity:0.7; } }
29
- @keyframes tkx-draw-line { from { transform:scaleY(0); transform-origin:top center; } to { transform:scaleY(1); } }
30
- @keyframes tkx-draw-line-h { from { transform:scaleX(0); transform-origin:left center; } to { transform:scaleX(1); } }
31
- .tkx-pulse-dot { animation: tkx-pulse-dot 1.5s ease-in-out infinite; }
32
- .tkx-draw-v { animation: tkx-draw-line 0.6s ease forwards; }
33
- .tkx-draw-h { animation: tkx-draw-line-h 0.6s ease forwards; }
34
- `,document.head.appendChild(e)}function Gt(e=`pending`){let n=t.f();return{completed:n.success,active:n.primary,pending:n.border,error:n.danger}[e]}function Kt({status:e=`pending`,icon:i,size:a=28}){let o=t.f(),c=r.o(),l=Gt(e),u=e===`active`;return(0,s.jsx)(`div`,{className:n.t(n.a(`relative flex items-center justify-center rounded-full shrink-0 z-10`),u&&!c?`tkx-pulse-dot`:``),style:{width:a,height:a,backgroundColor:e===`pending`?o.surface:l,border:`2px solid ${l}`,color:e===`pending`?l:o.bg},"aria-hidden":`true`,children:i?(0,s.jsx)(`span`,{style:{fontSize:a*.45,lineHeight:1},children:i}):(0,s.jsx)(`span`,{style:{width:a*.35,height:a*.35,borderRadius:`50%`,backgroundColor:e===`pending`?l:o.bg,display:`block`}})})}function qt({style:e,color:r,animate:i}){return t.f(),(0,s.jsx)(`div`,{className:n.t(n.a(`w-0.5 flex-1 min-h-[24px]`),i?`tkx-draw-v`:``),style:{borderLeft:`2px ${e} ${r}`,backgroundColor:`transparent`,alignSelf:`stretch`,borderColor:r,marginLeft:1},"aria-hidden":`true`})}function Jt({style:e,color:t,animate:r}){return(0,s.jsx)(`div`,{className:n.t(n.a(`h-0.5 flex-1 min-w-[24px]`),r?`tkx-draw-h`:``),style:{borderTop:`2px ${e} ${t}`,borderColor:t},"aria-hidden":`true`})}function Yt({item:e,compact:r}){let i=t.f(),a=e.timestamp?n.m(e.timestamp):null;return(0,s.jsxs)(`div`,{className:n.a(`flex flex-col gap-0.5`,r?`pb-3`:`pb-5`),children:[(0,s.jsxs)(`div`,{className:n.a(`flex items-center gap-2 flex-wrap`),children:[(0,s.jsx)(`span`,{className:n.a(`text-sm font-semibold leading-snug`),style:{color:i.text},children:typeof e.title==`string`?n.m(e.title):e.title}),e.badge&&(0,s.jsx)(`span`,{children:e.badge}),a&&(0,s.jsx)(`span`,{className:n.a(`text-[11px] ml-auto`),style:{color:i.textMuted},children:a})]}),e.description&&!r&&(0,s.jsx)(`div`,{className:n.a(`text-xs leading-relaxed mt-0.5`),style:{color:i.textMuted},children:typeof e.description==`string`?n.m(e.description):e.description})]})}function Xt({items:e,variant:i=`default`,orientation:a=`vertical`,connectorStyle:c=`solid`}){let l=t.f(),u=r.o(),d=(0,o.useRef)(!1);(0,o.useEffect)(()=>{Wt(),d.current=!0},[]);let f=!u,p=i===`compact`,m=i===`alternating`&&a===`vertical`;return a===`horizontal`?(0,s.jsx)(`div`,{role:`list`,"aria-label":`Timeline`,className:n.a(`flex items-start w-full overflow-x-auto`),children:e.map((t,r)=>{let i=t.status??`pending`,a=i===`completed`?l.success:l.border,o=r===e.length-1;return(0,s.jsx)(`div`,{role:`listitem`,className:n.a(`flex items-start flex-1 min-w-0`),children:(0,s.jsxs)(`div`,{className:n.a(`flex flex-col items-center flex-1 min-w-0`),children:[(0,s.jsxs)(`div`,{className:n.a(`flex items-center w-full`),children:[r>0&&(0,s.jsx)(Jt,{style:c,color:a,animate:f}),(0,s.jsx)(Kt,{status:i,icon:t.icon,size:24}),!o&&(0,s.jsx)(Jt,{style:c,color:a,animate:f})]}),(0,s.jsxs)(`div`,{className:n.a(`mt-2 px-1 text-center min-w-0 w-full`),children:[(0,s.jsx)(`div`,{className:n.a(`text-xs font-semibold truncate`),style:{color:l.text},children:typeof t.title==`string`?n.m(t.title):t.title}),t.timestamp&&(0,s.jsx)(`div`,{className:n.a(`text-[10px] mt-0.5`),style:{color:l.textMuted},children:n.m(t.timestamp)})]})]})},t.id)})}):(0,s.jsx)(`div`,{role:`list`,"aria-label":`Timeline`,className:n.a(`flex flex-col`),children:e.map((t,r)=>{let i=t.status??`pending`,a=r===e.length-1,o=i===`completed`?l.success:l.border,u=m&&r%2==0;return m?(0,s.jsxs)(`div`,{role:`listitem`,className:n.a(`flex items-stretch gap-0`),children:[(0,s.jsx)(`div`,{className:n.a(`flex-1 flex flex-col items-end pr-4`,u?``:`invisible`),children:u&&(0,s.jsx)(Yt,{item:t,compact:p})}),(0,s.jsxs)(`div`,{className:n.a(`flex flex-col items-center`),children:[(0,s.jsx)(Kt,{status:i,icon:t.icon,size:28}),!a&&(0,s.jsx)(qt,{style:c,color:o,animate:f})]}),(0,s.jsx)(`div`,{className:n.a(`flex-1 flex flex-col items-start pl-4`,u?`invisible`:``),children:!u&&(0,s.jsx)(Yt,{item:t,compact:p})})]},t.id):(0,s.jsxs)(`div`,{role:`listitem`,className:n.a(`flex gap-3 items-stretch`),children:[(0,s.jsxs)(`div`,{className:n.a(`flex flex-col items-center`),children:[(0,s.jsx)(Kt,{status:i,icon:t.icon,size:p?22:28}),!a&&(0,s.jsx)(qt,{style:c,color:o,animate:f})]}),(0,s.jsx)(`div`,{className:n.a(`flex-1 min-w-0 pt-0.5`),children:(0,s.jsx)(Yt,{item:t,compact:p})})]},t.id)})})}function Zt(e,t,n,r){let i=window.innerWidth,a=window.innerHeight,o=0,s=0,c=`top left`;switch(t){case`bottom-start`:o=e.bottom+6,s=e.left,c=`top left`,o+r>a&&e.top-6-r>0&&(o=e.top-6-r,c=`bottom left`),s+n>i&&(s=Math.max(0,i-n-8));break;case`bottom-end`:o=e.bottom+6,s=e.right-n,c=`top right`,o+r>a&&e.top-6-r>0&&(o=e.top-6-r,c=`bottom right`),s<0&&(s=8);break;case`top-start`:o=e.top-6-r,s=e.left,c=`bottom left`,o<0&&(o=e.bottom+6,c=`top left`),s+n>i&&(s=Math.max(0,i-n-8));break;case`top-end`:o=e.top-6-r,s=e.right-n,c=`bottom right`,o<0&&(o=e.bottom+6,c=`top right`),s<0&&(s=8);break;case`right-start`:o=e.top,s=e.right+6,c=`top left`,s+n>i&&(s=e.left-6-n,c=`top right`),o+r>a&&(o=Math.max(8,a-r-8));break;case`left-start`:o=e.top,s=e.left-6-n,c=`top right`,s<0&&(s=e.right+6,c=`top left`),o+r>a&&(o=Math.max(8,a-r-8));break}return{top:o+window.scrollY,left:s+window.scrollX,transformOrigin:c}}function Qt(e,t,n){let r=window.innerWidth,i=window.innerHeight,a=e.right+4,o=`top left`;a+t>r&&(a=e.left-4-t,o=`top right`);let s=e.top;return s+n>i&&(s=Math.max(8,i-n-8)),{top:s+window.scrollY,left:a+window.scrollX,transformOrigin:o}}var $t=`
35
- @keyframes tkxMenuIn {
36
- from { opacity: 0; transform: scale(0.94); }
37
- to { opacity: 1; transform: scale(1); }
38
- }
39
- @keyframes tkxMenuInReduced {
40
- from { opacity: 0; }
41
- to { opacity: 1; }
42
- }
43
- @media (prefers-reduced-motion: no-preference) {
44
- .tkx-menu-panel {
45
- animation: tkxMenuIn 130ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
46
- }
47
- }
48
- @media (prefers-reduced-motion: reduce) {
49
- .tkx-menu-panel {
50
- animation: tkxMenuInReduced 100ms ease forwards;
51
- }
52
- }
53
- `;function en(e,t){return{position:`absolute`,top:t.top,left:t.left,zIndex:9999,minWidth:200,maxWidth:320,backgroundColor:e.surface,border:`1.5px solid ${e.border}`,borderRadius:10,boxShadow:`0 8px 32px rgba(0,0,0,0.28), 0 2px 8px rgba(0,0,0,0.14)`,padding:`4px 0`,transformOrigin:t.transformOrigin,overflow:`hidden`}}function tn({color:e}){return(0,s.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:e,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M20 6L9 17l-5-5`})})}function nn({color:e}){return(0,s.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,s.jsx)(`circle`,{cx:`12`,cy:`12`,r:`5`,fill:e}),(0,s.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`,fill:`none`,stroke:e,strokeWidth:`2`})]})}function rn({color:e}){return(0,s.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:e,strokeWidth:`2`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M9 18l6-6-6-6`})})}function an(e){let t=[],n=0;for(let r of e)if(r.type!==`separator`)if(r.type===`radio-group`)for(let e=0;e<r.options.length;e++)t.push({kind:`radio`,item:r,optionIdx:e,idx:n++});else r.type===`check`?t.push({kind:`check`,item:r,idx:n++}):r.type===`submenu`?t.push({kind:`submenu`,item:r,idx:n++}):t.push({kind:`action`,item:r,idx:n++});return t}function on({items:e,pos:r,panelId:i,onClose:a,onCloseAll:l,isSubmenu:u=!1}){let d=t.f(),[f,p]=(0,o.useState)(-1),[m,h]=(0,o.useState)(null),[g,_]=(0,o.useState)(null),v=(0,o.useRef)(null),[y,b]=(0,o.useState)(``),x=(0,o.useRef)(null),S=an(e);(0,o.useEffect)(()=>{v.current?.focus()},[]),(0,o.useEffect)(()=>{f<0||(v.current?.querySelector(`[data-midx="${f}"]`))?.scrollIntoView({block:`nearest`})},[f]);let C=(0,o.useCallback)(e=>{if(e.kind===`action`){if(e.item.disabled)return;e.item.onClick?.(),l()}else if(e.kind===`check`){if(e.item.disabled)return;e.item.onChange?.(!e.item.checked)}else if(e.kind===`radio`){if(e.item.disabled)return;e.item.onChange?.(e.item.options[e.optionIdx].value)}else if(e.kind===`submenu`){if(e.item.disabled)return;h(e.item.id)}},[l]),w=e=>{switch(e.key){case`ArrowDown`:e.preventDefault(),p(e=>{let t=e+1;return t<S.length?t:0});break;case`ArrowUp`:e.preventDefault(),p(e=>{let t=e-1;return t>=0?t:S.length-1});break;case`Home`:e.preventDefault(),p(0);break;case`End`:e.preventDefault(),p(S.length-1);break;case`Enter`:case` `:e.preventDefault(),f>=0&&S[f]&&C(S[f]);break;case`Escape`:e.preventDefault(),u?a():l();break;case`Tab`:e.preventDefault(),l();break;case`ArrowRight`:e.preventDefault(),f>=0&&S[f]?.kind===`submenu`&&h(S[f].item.id);break;case`ArrowLeft`:e.preventDefault(),u&&a();break;default:e.key.length===1&&!e.ctrlKey&&!e.metaKey&&T(e.key)}};function T(e){x.current&&clearTimeout(x.current);let t=y+e.toLowerCase();b(t);let n=S.findIndex(e=>(e.kind===`radio`?e.item.options[e.optionIdx].label:e.item.label).toLowerCase().startsWith(t));n>=0&&p(n),x.current=setTimeout(()=>b(``),800)}function E(e,t){let n=t.getBoundingClientRect();h(e.id),_(Qt(n,220,Math.min(e.items.length*38+12,360)))}function D(){h(null),_(null)}let O=()=>{let t=-1;return e.map(e=>{if(e.type===`separator`)return(0,s.jsx)(`div`,{role:`separator`,style:{margin:(e.label,`4px 0`),display:`flex`,alignItems:`center`,gap:8},children:e.label?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`div`,{style:{flex:1,height:1,backgroundColor:d.border,marginLeft:14}}),(0,s.jsx)(`span`,{style:{fontSize:`11px`,fontWeight:600,letterSpacing:`0.06em`,textTransform:`uppercase`,color:d.textMuted,fontFamily:`inherit`,whiteSpace:`nowrap`},children:n.m(e.label)}),(0,s.jsx)(`div`,{style:{flex:1,height:1,backgroundColor:d.border,marginRight:14}})]}):(0,s.jsx)(`div`,{style:{flex:1,height:1,backgroundColor:d.border,margin:`0 10px`}})},e.id);if(e.type===`radio-group`)return(0,s.jsxs)(`div`,{role:`group`,"aria-label":e.label,children:[e.label&&(0,s.jsx)(`div`,{style:{padding:`6px 14px 2px`,fontSize:`11px`,fontWeight:700,letterSpacing:`0.07em`,textTransform:`uppercase`,color:d.textMuted,fontFamily:`inherit`},"aria-hidden":`true`,children:n.m(e.label)}),e.options.map((r,i)=>{t++;let a=t,o=a===f,c=r.value===e.value,l=!!e.disabled,u=sn(d,o,!1,l);return(0,s.jsxs)(`div`,{role:`menuitemradio`,"aria-checked":c,"aria-disabled":l||void 0,"data-midx":a,tabIndex:-1,style:u,onClick:()=>!l&&e.onChange?.(r.value),onMouseEnter:()=>!l&&p(a),children:[(0,s.jsx)(`span`,{style:{width:16,flexShrink:0,display:`flex`,alignItems:`center`},children:c?(0,s.jsx)(nn,{color:d.primary}):(0,s.jsx)(`span`,{style:{width:14,height:14,borderRadius:`50%`,border:`2px solid ${d.border}`,display:`inline-block`}})}),r.icon&&(0,s.jsx)(`span`,{style:{flexShrink:0,display:`flex`,color:d.textMuted},children:r.icon}),(0,s.jsx)(`span`,{style:{flex:1,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:n.m(r.label)})]},r.value)})]},e.id);if(e.type===`check`){t++;let r=t,i=r===f,a=!!e.disabled,o=sn(d,i,!1,a);return(0,s.jsxs)(`div`,{role:`menuitemcheckbox`,"aria-checked":e.checked,"aria-disabled":a||void 0,"data-midx":r,tabIndex:-1,style:o,onClick:()=>!a&&e.onChange?.(!e.checked),onMouseEnter:()=>!a&&p(r),children:[(0,s.jsx)(`span`,{style:{width:16,flexShrink:0,display:`flex`,alignItems:`center`},children:e.checked?(0,s.jsx)(tn,{color:d.primary}):(0,s.jsx)(`span`,{style:{width:14,height:14,display:`inline-block`}})}),e.icon&&(0,s.jsx)(`span`,{style:{flexShrink:0,display:`flex`,color:d.textMuted},children:e.icon}),(0,s.jsx)(`span`,{style:{flex:1,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:n.m(e.label)})]},e.id)}if(e.type===`submenu`){t++;let r=t,a=r===f,o=!!e.disabled,u=m===e.id,_=sn(d,a||u,!1,o);return(0,s.jsxs)(`div`,{style:{position:`relative`},children:[(0,s.jsxs)(`div`,{role:`menuitem`,"aria-haspopup":`menu`,"aria-expanded":u,"aria-disabled":o||void 0,"data-midx":r,tabIndex:-1,style:_,onMouseEnter:t=>{o||(p(r),E(e,t.currentTarget))},onMouseLeave:()=>{},onClick:()=>{o||h(u?null:e.id)},children:[(0,s.jsx)(`span`,{style:{width:16,flexShrink:0,display:`flex`,alignItems:`center`},children:e.icon?(0,s.jsx)(`span`,{style:{display:`flex`,color:d.textMuted},children:e.icon}):(0,s.jsx)(`span`,{style:{width:14}})}),(0,s.jsx)(`span`,{style:{flex:1,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:n.m(e.label)}),(0,s.jsx)(rn,{color:d.textMuted})]}),u&&g&&(0,c.createPortal)((0,s.jsx)(on,{items:e.items,pos:g,panelId:`${i}-sub-${e.id}`,onClose:D,onCloseAll:l,isSubmenu:!0}),document.body)]},e.id)}let r=e;t++;let a=t,o=a===f,u=!!r.disabled,_=!!r.danger,v=sn(d,o,_,u);return(0,s.jsxs)(`div`,{role:`menuitem`,"aria-disabled":u||void 0,"data-midx":a,tabIndex:-1,style:v,onClick:()=>{u||(r.onClick?.(),l())},onMouseEnter:()=>{u||(p(a),D())},children:[(0,s.jsx)(`span`,{style:{width:16,flexShrink:0,display:`flex`,alignItems:`center`},children:r.icon?(0,s.jsx)(`span`,{style:{display:`flex`,color:_?d.danger:d.textMuted},children:r.icon}):(0,s.jsx)(`span`,{style:{width:14}})}),(0,s.jsxs)(`span`,{style:{flex:1,minWidth:0},children:[(0,s.jsx)(`span`,{style:{display:`block`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:n.m(r.label)}),r.description&&(0,s.jsx)(`span`,{style:{display:`block`,fontSize:`12px`,color:d.textMuted,marginTop:1,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:n.m(r.description)})]}),r.shortcut&&(0,s.jsx)(`span`,{style:{fontSize:`12px`,color:d.textMuted,fontFamily:`inherit`,flexShrink:0,marginLeft:16,opacity:.8},children:n.m(r.shortcut)})]},r.id)})};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`style`,{children:$t}),(0,s.jsx)(`div`,{ref:v,id:i,role:`menu`,tabIndex:-1,className:`tkx-menu-panel`,onKeyDown:w,style:{...en(d,r),maxHeight:400,overflowY:`auto`},children:O()})]})}function sn(e,t,n,r){let i=n?e.danger:e.text;return{display:`flex`,alignItems:`center`,gap:8,padding:`7px 14px`,fontSize:`14px`,fontFamily:`inherit`,cursor:r?`not-allowed`:`pointer`,userSelect:`none`,color:r?e.textMuted:t&&n?e.danger:i,backgroundColor:t?n?`${e.danger}18`:`${e.primary}18`:`transparent`,transition:`background-color 80ms`,opacity:r?.5:1,outline:`none`}}function cn({trigger:e,items:t,placement:n=`bottom-start`,isDisabled:r=!1,onOpen:i,onClose:a,className:l,style:u}){let d=`tkx-menu-${(0,o.useId)().replace(/:/g,``)}`,[f,p]=(0,o.useState)(!1),[m,h]=(0,o.useState)(null),g=(0,o.useRef)(null),_=(0,o.useCallback)(()=>{if(r)return;let e=g.current;e&&(h(Zt(e.getBoundingClientRect(),n,220,Math.min(t.length*38+12,360))),p(!0),i?.())},[r,t.length,i,n]),v=(0,o.useCallback)(()=>{p(!1),a?.(),(g.current?.firstElementChild)?.focus?.()},[a]);(0,o.useEffect)(()=>{if(!f)return;let e=e=>{let t=e.target;if(g.current?.contains(t))return;let n=document.querySelectorAll(`.tkx-menu-panel`);for(let e of n)if(e.contains(t))return;v()};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[f,v]),(0,o.useEffect)(()=>{if(!f)return;let e=()=>{let e=g.current;e&&h(Zt(e.getBoundingClientRect(),n,220,Math.min(t.length*38+12,360)))};return window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e)}},[f,t.length,n]);let y=e=>{(e.key===`Enter`||e.key===` `||e.key===`ArrowDown`)&&(e.preventDefault(),f||_()),e.key===`Escape`&&f&&(e.preventDefault(),v())};return(0,s.jsxs)(`span`,{ref:g,className:l,style:{display:`inline-flex`,...u},children:[(0,s.jsx)(`span`,{role:`button`,tabIndex:r?-1:0,"aria-haspopup":`menu`,"aria-expanded":f,"aria-controls":f?d:void 0,"aria-disabled":r||void 0,onClick:()=>f?v():_(),onKeyDown:y,style:{display:`inline-flex`,cursor:r?`not-allowed`:`pointer`,opacity:r?.55:1,outline:`none`},children:e}),f&&m&&(0,c.createPortal)((0,s.jsx)(on,{items:t,pos:m,panelId:d,onClose:v,onCloseAll:v}),document.body)]})}cn.displayName=`TkxMenu`;var ln={sm:120,md:180,lg:240,xl:320};function un(e){let t=new Date;if(e)try{let n=new Intl.DateTimeFormat(`en-US`,{timeZone:e,hour:`numeric`,minute:`numeric`,second:`numeric`,hour12:!1,weekday:`long`,month:`long`,day:`2-digit`,year:`numeric`}).formatToParts(t),r=e=>n.find(t=>t.type===e)?.value??`0`,i=parseInt(r(`hour`),10);i===24&&(i=0);let a=parseInt(r(`minute`),10),o=parseInt(r(`second`),10),s=`${r(`weekday`)}, ${r(`month`)} ${r(`day`)}, ${r(`year`)}`;return{hours:i,minutes:a,seconds:o,milliseconds:t.getMilliseconds(),dateString:s}}catch{}let n=t.getHours(),r=t.getMinutes(),i=t.getSeconds(),a=t.toLocaleDateString(`en-US`,{weekday:`long`,month:`long`,day:`2-digit`,year:`numeric`});return{hours:n,minutes:r,seconds:i,milliseconds:t.getMilliseconds(),dateString:a}}function dn({time:e,size:t,analogStyle:n,showSeconds:r,reducedMotion:i,primary:a,danger:o,text:c,textMuted:l,border:u,surface:d,bg:f}){let p=t/2,m=t/2,h=t/2-4,{hours:g,minutes:_,seconds:v,milliseconds:y}=e,b=(v+(i?0:y)/1e3)/60*360,x=_/60*360+v/60*6,S=g%12/12*360+_/60*30,C=(e,t)=>{let n=(e-90)*Math.PI/180;return{x:p+Math.cos(n)*t,y:m+Math.sin(n)*t}},w=i?`none`:`transform 0.15s cubic-bezier(0.4, 2.08, 0.55, 0.44)`;if(n===`modern`){let e=(e,t)=>{let n=-90+e*360,r={x:p+Math.cos(-90*Math.PI/180)*t,y:m+Math.sin(-90*Math.PI/180)*t},i={x:p+Math.cos(n*Math.PI/180)*t,y:m+Math.sin(n*Math.PI/180)*t},a=+(e>.5);return`M ${r.x} ${r.y} A ${t} ${t} 0 ${a} 1 ${i.x} ${i.y}`},n=g%12/12+_/60/12,d=_/60+v/3600,f=(v+(i?0:y/1e3))/60,b=h-2,x=h-10,S=h-18;return(0,s.jsxs)(`svg`,{width:t,height:t,viewBox:`0 0 ${t} ${t}`,"aria-hidden":`true`,children:[(0,s.jsx)(`circle`,{cx:p,cy:m,r:b,fill:`none`,stroke:u,strokeWidth:4}),(0,s.jsx)(`circle`,{cx:p,cy:m,r:x,fill:`none`,stroke:u,strokeWidth:4}),r&&(0,s.jsx)(`circle`,{cx:p,cy:m,r:S,fill:`none`,stroke:u,strokeWidth:3}),(0,s.jsx)(`path`,{d:e(n,b),fill:`none`,stroke:a,strokeWidth:4,strokeLinecap:`round`}),(0,s.jsx)(`path`,{d:e(d,x),fill:`none`,stroke:c,strokeWidth:4,strokeLinecap:`round`}),r&&(0,s.jsx)(`path`,{d:e(f,S),fill:`none`,stroke:o,strokeWidth:3,strokeLinecap:`round`}),(0,s.jsx)(`circle`,{cx:p,cy:m,r:4,fill:a}),(0,s.jsxs)(`text`,{x:p,y:m+20,textAnchor:`middle`,fontSize:t*.12,fill:l,fontFamily:`monospace`,style:{fontVariantNumeric:`tabular-nums`},children:[String(g).padStart(2,`0`),`:`,String(_).padStart(2,`0`)]})]})}let T=C(S,h*.5),E=C(x,h*.75),D=C(b,h*.85),O=C(b+180,h*.2),k=[];if(n===`classic`){for(let e=0;e<60;e++){let t=e/60*360,n=e%5==0,r=(t-90)*Math.PI/180,i=n?h-10:h-6,a=p+Math.cos(r)*h,o=m+Math.sin(r)*h,u=p+Math.cos(r)*i,d=m+Math.sin(r)*i;k.push((0,s.jsx)(`line`,{x1:a,y1:o,x2:u,y2:d,stroke:n?c:l,strokeWidth:n?2:1,strokeLinecap:`round`},e))}for(let{n:e,angle:n}of[{n:12,angle:0},{n:3,angle:90},{n:6,angle:180},{n:9,angle:270}]){let r=(n-90)*Math.PI/180,i=h-20;k.push((0,s.jsx)(`text`,{x:p+Math.cos(r)*i,y:m+Math.sin(r)*i,textAnchor:`middle`,dominantBaseline:`central`,fontSize:t*.09,fill:c,fontFamily:`system-ui, sans-serif`,fontWeight:`600`,children:e},`n${e}`))}}else for(let e=0;e<12;e++){let t=(e/12*360-90)*Math.PI/180,n=h-8;k.push((0,s.jsx)(`circle`,{cx:p+Math.cos(t)*n,cy:m+Math.sin(t)*n,r:e%3==0?3:2,fill:e%3==0?c:l},e))}return(0,s.jsxs)(`svg`,{width:t,height:t,viewBox:`0 0 ${t} ${t}`,"aria-hidden":`true`,style:{display:`block`},children:[(0,s.jsx)(`circle`,{cx:p,cy:m,r:h,fill:d,stroke:u,strokeWidth:2}),k,(0,s.jsx)(`line`,{x1:p,y1:m,x2:T.x,y2:T.y,stroke:a,strokeWidth:n===`minimal`?3:4,strokeLinecap:`round`,style:{transformOrigin:`${p}px ${m}px`,transition:w}}),(0,s.jsx)(`line`,{x1:p,y1:m,x2:E.x,y2:E.y,stroke:c,strokeWidth:n===`minimal`?2:3,strokeLinecap:`round`,style:{transformOrigin:`${p}px ${m}px`,transition:w}}),r&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`line`,{x1:O.x,y1:O.y,x2:D.x,y2:D.y,stroke:o,strokeWidth:1.5,strokeLinecap:`round`,style:{transformOrigin:`${p}px ${m}px`,transition:`none`}}),(0,s.jsx)(`circle`,{cx:p,cy:m,r:3,fill:o})]}),(0,s.jsx)(`circle`,{cx:p,cy:m,r:n===`minimal`?3:5,fill:a})]})}function fn({time:e,format:t,showSeconds:r,showDate:i,label:a,size:o,primary:c,text:l,textMuted:u,colonVisible:d}){let{hours:f,minutes:p,seconds:m,dateString:h}=e,g=f,_=``;t===`12h`&&(_=f>=12?`PM`:`AM`,g=f%12||12);let v=o*.2,y={opacity:+!!d,transition:`opacity 0.1s`,display:`inline-block`,minWidth:`0.5ch`,textAlign:`center`};return(0,s.jsxs)(`div`,{style:{textAlign:`center`,fontFamily:`'Courier New', Courier, monospace`,fontVariantNumeric:`tabular-nums`,lineHeight:1.1},children:[(0,s.jsxs)(`div`,{style:{fontSize:v,color:c,fontWeight:700,letterSpacing:`0.05em`,display:`flex`,alignItems:`center`,justifyContent:`center`,gap:0},children:[(0,s.jsx)(`span`,{children:String(g).padStart(2,`0`)}),(0,s.jsx)(`span`,{style:y,children:`:`}),(0,s.jsx)(`span`,{children:String(p).padStart(2,`0`)}),r&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`span`,{style:y,children:`:`}),(0,s.jsx)(`span`,{children:String(m).padStart(2,`0`)})]}),t===`12h`&&(0,s.jsx)(`span`,{style:{fontSize:v*.45,color:u,marginLeft:`0.4ch`,alignSelf:`flex-end`,marginBottom:v*.05},children:_})]}),i&&(0,s.jsx)(`div`,{style:{fontSize:o*.072,color:u,marginTop:o*.025,letterSpacing:`0.03em`},children:h}),a&&(0,s.jsx)(`div`,{style:{fontSize:o*.065,color:u,marginTop:o*.015,textTransform:`uppercase`,letterSpacing:`0.08em`},children:n.m(a)})]})}function pn({variant:e=`both`,size:n=`md`,showSeconds:i=!0,showDate:a=!1,format:c=`24h`,timezone:l,timezone2:u,label:d,analogStyle:f=`classic`,className:p,style:m}){let h=t.f(),g=r.o(),[_,v]=(0,o.useState)(()=>un(l)),[y,b]=(0,o.useState)(()=>u?un(u):null),[x,S]=(0,o.useState)(!0),[C,w]=(0,o.useState)(!1),T=(0,o.useRef)(null);(0,o.useEffect)(()=>{w(!0)},[]),(0,o.useEffect)(()=>{let e=()=>{v(un(l)),u&&b(un(u))};e();let t=setInterval(e,1e3);return()=>clearInterval(t)},[l,u]),(0,o.useEffect)(()=>(T.current=setInterval(()=>{S(e=>!e)},500),()=>{T.current&&clearInterval(T.current)}),[]);let E=ln[n],D=e===`analog`||e===`both`,O=e===`digital`||e===`both`;return(0,s.jsxs)(`div`,{className:p,style:{display:`inline-flex`,flexDirection:`column`,alignItems:`center`,gap:e===`both`?`${E*.06}px`:0,opacity:+!!C,transition:g?`none`:`opacity 0.4s ease`,...m},role:`timer`,"aria-live":`off`,children:[D&&(0,s.jsx)(dn,{time:_,size:E,analogStyle:f,showSeconds:i,reducedMotion:g,primary:h.primary,danger:h.danger,text:h.text,textMuted:h.textMuted,border:h.border,surface:h.surface,bg:h.bg}),O&&(0,s.jsx)(fn,{time:_,format:c,showSeconds:i,showDate:a,label:d,size:E,primary:h.primary,text:h.text,textMuted:h.textMuted,colonVisible:x}),y&&u&&(0,s.jsx)(`div`,{style:{marginTop:E*.04,padding:`${E*.03}px ${E*.06}px`,borderTop:`1px solid ${h.border}`,textAlign:`center`},children:(0,s.jsx)(fn,{time:y,format:c,showSeconds:!1,showDate:!1,label:u,size:E*.7,primary:h.secondary,text:h.text,textMuted:h.textMuted,colonVisible:x})})]})}pn.displayName=`TkxClock`;function mn(e){if(!isFinite(e)||isNaN(e))return`0:00`;let t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%60);return t>0?`${t}:${String(n).padStart(2,`0`)}:${String(r).padStart(2,`0`)}`:`${n}:${String(r).padStart(2,`0`)}`}function hn({path:e,size:t=20,color:n=`currentColor`,title:r}){return(0,s.jsx)(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:n,"aria-hidden":r?void 0:`true`,role:r?`img`:void 0,"aria-label":r,style:{display:`block`,flexShrink:0},children:(0,s.jsx)(`path`,{d:e})})}var gn={play:`M8 5v14l11-7z`,pause:`M6 19h4V5H6v14zm8-14v14h4V5h-4z`,volumeUp:`M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z`,volumeMute:`M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z`,volumeDown:`M18.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM5 9v6h4l5 5V4L9 9H5z`,fullscreen:`M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z`,fullscreenExit:`M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z`,pip:`M19 11h-8v6h8v-6zm4 8V4.98C23 3.88 22.1 3 21 3H3c-1.1 0-2 .88-2 1.98V19c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H3V4.97h18v14.05z`,download:`M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z`,closedCaption:`M19 4H5c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-8 7H9.5v-.5h-2v3h2V13H11v1c0 .55-.45 1-1 1H7c-.55 0-1-.45-1-1v-4c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v1zm7 0h-1.5v-.5h-2v3h2V13H18v1c0 .55-.45 1-1 1h-3c-.55 0-1-.45-1-1v-4c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v1z`,settings:`M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.8,11.69,4.8,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z`,replay10:`M11.99 5V1l-5 5 5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6h-2c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z`,forward10:`M18 13c0 3.31-2.69 6-6 6s-6-2.69-6-6h-2c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8V1l-5 5 5 5V7c3.31 0 6 2.69 6 6z`,errorOutline:`M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z`,refresh:`M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z`};function _n({onClick:e,title:t,children:n,active:r,primary:i}){let[a,c]=(0,o.useState)(!1);return(0,s.jsx)(`button`,{type:`button`,onClick:e,title:t,"aria-label":t,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),style:{background:`none`,border:`none`,padding:`6px`,cursor:`pointer`,color:r||a?i:`#ffffff`,display:`flex`,alignItems:`center`,justifyContent:`center`,borderRadius:`4px`,flexShrink:0,transition:`color 0.15s ease`},children:n})}function vn({src:e,poster:i,title:a,width:c=`100%`,height:l,autoPlay:u=!1,loop:d=!1,muted:f=!1,controls:p=!0,showTitle:m=!0,allowFullscreen:h=!0,allowPiP:g=!0,allowDownload:_=!1,chapters:v=[],subtitles:y=[],startTime:b,onPlay:x,onPause:S,onEnded:C,onTimeUpdate:w,className:T,style:E}){let D=t.f(),O=r.o(),k=(0,o.useRef)(null),A=(0,o.useRef)(null),j=(0,o.useRef)(null),M=(0,o.useRef)(null),[N,P]=(0,o.useState)(!1),[F,I]=(0,o.useState)(0),[L,R]=(0,o.useState)(0),[z,B]=(0,o.useState)(0),[V,H]=(0,o.useState)(1),[U,W]=(0,o.useState)(f),[G,K]=(0,o.useState)(!1),[q,J]=(0,o.useState)(!0),[Y,ee]=(0,o.useState)(!1),[X,Z]=(0,o.useState)(1),[te,ne]=(0,o.useState)(!1),[re,ie]=(0,o.useState)(-1),[ae,Q]=(0,o.useState)(null),[oe,se]=(0,o.useState)(0),[ce,le]=(0,o.useState)(null),[ue,de]=(0,o.useState)(!1),[fe,pe]=(0,o.useState)(!1),[$,me]=(0,o.useState)(null),[he,ge]=(0,o.useState)(!1);(0,o.useEffect)(()=>{let e=k.current;if(!e)return;b!==void 0&&(e.currentTime=b);let t=()=>{I(e.currentTime),e.buffered.length>0&&B(e.buffered.end(e.buffered.length-1))},n=()=>R(e.duration),r=()=>P(!0),i=()=>{P(!1),ee(!0)},a=()=>{P(!1),ee(!0),C?.()},o=()=>de(!0),s=()=>de(!1),c=()=>pe(!0),l=()=>pe(!1),u=()=>{let t=e.error;me(t?`Error ${t.code}: ${t.message||`Failed to load video`}`:`Failed to load video`),pe(!1)};return e.addEventListener(`timeupdate`,t),e.addEventListener(`durationchange`,n),e.addEventListener(`play`,r),e.addEventListener(`pause`,i),e.addEventListener(`ended`,a),e.addEventListener(`enterpictureinpicture`,o),e.addEventListener(`leavepictureinpicture`,s),e.addEventListener(`waiting`,c),e.addEventListener(`canplay`,l),e.addEventListener(`error`,u),()=>{e.removeEventListener(`timeupdate`,t),e.removeEventListener(`durationchange`,n),e.removeEventListener(`play`,r),e.removeEventListener(`pause`,i),e.removeEventListener(`ended`,a),e.removeEventListener(`enterpictureinpicture`,o),e.removeEventListener(`leavepictureinpicture`,s),e.removeEventListener(`waiting`,c),e.removeEventListener(`canplay`,l),e.removeEventListener(`error`,u)}},[C,b]),(0,o.useEffect)(()=>{k.current&&(N?x?.():S?.())},[N,x,S]),(0,o.useEffect)(()=>{w?.(F,L)},[F,L,w]),(0,o.useEffect)(()=>{let e=k.current;if(!e)return;let t=e.textTracks;for(let e=0;e<t.length;e++)t[e].mode=e===re?`showing`:`disabled`},[re]),(0,o.useEffect)(()=>{let e=()=>K(!!document.fullscreenElement);return document.addEventListener(`fullscreenchange`,e),()=>document.removeEventListener(`fullscreenchange`,e)},[]),(0,o.useEffect)(()=>{let e=A.current;if(!e)return;let t=e=>{let t=k.current;if(t&&e.target.tagName!==`INPUT`)switch(e.key){case` `:case`k`:e.preventDefault(),ve();break;case`f`:case`F`:h&&be();break;case`m`:case`M`:ye();break;case`ArrowRight`:e.preventDefault(),t.currentTime=Math.min(t.currentTime+10,t.duration);break;case`ArrowLeft`:e.preventDefault(),t.currentTime=Math.max(t.currentTime-10,0);break;case`ArrowUp`:e.preventDefault(),H(Math.min(V+.1,1)),k.current&&(k.current.volume=Math.min(V+.1,1));break;case`ArrowDown`:e.preventDefault(),H(Math.max(V-.1,0)),k.current&&(k.current.volume=Math.max(V-.1,0));break}};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)},[V,h]);let _e=(0,o.useCallback)(()=>{J(!0),M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{N&&J(!1)},3e3)},[N]);(0,o.useEffect)(()=>(_e(),()=>{M.current&&clearTimeout(M.current)}),[N,_e]);let ve=(0,o.useCallback)(()=>{let e=k.current;e&&(e.paused?(e.play().catch(()=>{}),le(`play`),ee(!1)):(e.pause(),le(`pause`)),setTimeout(()=>le(null),600))},[]),ye=(0,o.useCallback)(()=>{let e=k.current;if(!e)return;let t=!U;W(t),e.muted=t},[U]),be=(0,o.useCallback)(()=>{let e=A.current;e&&(document.fullscreenElement?document.exitFullscreen().catch(()=>{}):e.requestFullscreen().catch(()=>{}))},[]),xe=(0,o.useCallback)(async()=>{let e=k.current;if(e)try{document.pictureInPictureElement?await document.exitPictureInPicture():await e.requestPictureInPicture()}catch{}},[]),Se=(0,o.useCallback)(()=>{y.length!==0&&(ie(e=>(e+1)%(y.length+1)-1),ie(e=>{let t=e+1;return t>=y.length?-1:t}))},[y.length]),Ce=(0,o.useCallback)(()=>{let e=k.current;e&&(e.currentTime=Math.min(e.currentTime+10,e.duration||0))},[]),we=(0,o.useCallback)(()=>{let e=k.current;e&&(e.currentTime=Math.max(e.currentTime-10,0))},[]),Te=(0,o.useCallback)(()=>{let e=k.current;e&&(me(null),e.load())},[]),Ee=(0,o.useCallback)(()=>{h&&be()},[h,be]),De=(0,o.useCallback)(e=>{let t=k.current,n=j.current;if(!t||!n||!L)return;let r=n.getBoundingClientRect();t.currentTime=Math.max(0,Math.min(1,(e.clientX-r.left)/r.width))*L},[L]),Oe=(0,o.useCallback)(e=>{let t=j.current;if(!t||!L)return;let n=t.getBoundingClientRect();Q(Math.max(0,Math.min(1,(e.clientX-n.left)/n.width))*L),se(e.clientX-n.left)},[L]),ke=(0,o.useCallback)(e=>{let t=parseFloat(e.target.value);H(t),k.current&&(k.current.volume=t,k.current.muted=t===0,W(t===0))},[]),Ae=(0,o.useCallback)(e=>{Z(e),k.current&&(k.current.playbackRate=e),ne(!1)},[]),je=v.length>0?[...v].reverse().find(e=>F>=e.time):null,Me=e=>[...v].reverse().find(t=>e>=t.time)??null,Ne=Array.isArray(e)?e:[{src:e,type:`video/mp4`}],Pe=Array.isArray(e)?e[0].src:e,Fe=q||Y||!N,Ie=O?`none`:`opacity 0.25s ease`,Le=U||V===0?gn.volumeMute:V<.5?gn.volumeDown:gn.volumeUp,Re=L>0?F/L*100:0,ze=L>0?z/L*100:0;return(0,s.jsxs)(`div`,{ref:A,className:T,tabIndex:0,onMouseMove:_e,onMouseLeave:()=>{N&&J(!1)},style:{position:`relative`,width:c,height:l??`auto`,background:`#000`,borderRadius:`8px`,overflow:`hidden`,outline:`none`,userSelect:`none`,...E},children:[(0,s.jsxs)(`video`,{ref:k,style:{width:`100%`,height:`100%`,display:`block`,objectFit:`contain`},poster:i,autoPlay:u,loop:d,muted:f,playsInline:!0,onClick:ve,onDoubleClick:Ee,children:[Ne.map((e,t)=>(0,s.jsx)(`source`,{src:e.src,type:e.type},t)),y.map((e,t)=>(0,s.jsx)(`track`,{kind:`subtitles`,label:n.m(e.label),srcLang:e.lang,src:e.src,default:e.default},t))]}),m&&a&&(0,s.jsxs)(`div`,{style:{position:`absolute`,top:0,left:0,right:0,background:`linear-gradient(to bottom, rgba(0,0,0,0.75) 0%, transparent 100%)`,padding:`16px 16px 32px`,opacity:+!!Fe,transition:Ie,pointerEvents:`none`},children:[(0,s.jsx)(`span`,{style:{color:`#fff`,fontSize:`0.95rem`,fontWeight:600,textShadow:`0 1px 3px rgba(0,0,0,0.7)`},children:n.m(a)}),je&&(0,s.jsxs)(`span`,{style:{color:`rgba(255,255,255,0.65)`,fontSize:`0.8rem`,marginLeft:8},children:[`— `,n.m(je.label)]})]}),ce&&(0,s.jsx)(`div`,{"aria-hidden":`true`,style:{position:`absolute`,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`,background:`rgba(0,0,0,0.45)`,borderRadius:`50%`,width:64,height:64,display:`flex`,alignItems:`center`,justifyContent:`center`,animation:O?`none`:`tkxvp-flash 0.6s ease forwards`,pointerEvents:`none`},children:(0,s.jsx)(hn,{path:ce===`play`?gn.play:gn.pause,size:32,color:`#fff`})}),fe&&!$&&(0,s.jsx)(`div`,{"aria-label":`Loading`,style:{position:`absolute`,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`,pointerEvents:`none`,zIndex:10},children:(0,s.jsx)(`div`,{style:{width:48,height:48,border:`4px solid rgba(255,255,255,0.25)`,borderTopColor:D.primary,borderRadius:`50%`,animation:O?`none`:`tkxvp-spin 0.8s linear infinite`}})}),$&&(0,s.jsxs)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,background:`rgba(0,0,0,0.8)`,zIndex:20,gap:12},children:[(0,s.jsx)(hn,{path:gn.errorOutline,size:48,color:`#ef4444`}),(0,s.jsx)(`span`,{style:{color:`#fff`,fontSize:`0.9rem`,maxWidth:`80%`,textAlign:`center`},children:$}),(0,s.jsxs)(`button`,{type:`button`,onClick:Te,style:{display:`flex`,alignItems:`center`,gap:6,background:D.primary,color:`#fff`,border:`none`,borderRadius:6,padding:`8px 18px`,fontSize:`0.85rem`,fontWeight:600,cursor:`pointer`,marginTop:4},children:[(0,s.jsx)(hn,{path:gn.refresh,size:18,color:`#fff`}),`Retry`]})]}),p&&(0,s.jsxs)(`div`,{style:{position:`absolute`,bottom:0,left:0,right:0,background:`linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 70%, transparent 100%)`,padding:`32px 12px 8px`,opacity:+!!Fe,transition:Ie},onMouseEnter:()=>ee(!0),onMouseLeave:()=>ee(!1),children:[(0,s.jsxs)(`div`,{ref:j,role:`slider`,"aria-label":`Seek`,"aria-valuemin":0,"aria-valuemax":Math.floor(L),"aria-valuenow":Math.floor(F),tabIndex:0,onClick:De,onMouseMove:Oe,style:{position:`relative`,height:4,borderRadius:2,background:`rgba(255,255,255,0.25)`,cursor:`pointer`,marginBottom:8,transition:`height 0.15s ease`},onMouseEnter:e=>{e.currentTarget.style.height=`8px`},onMouseLeave:e=>{e.currentTarget.style.height=`4px`,Q(null)},children:[(0,s.jsx)(`div`,{style:{position:`absolute`,top:0,left:0,bottom:0,width:`${ze}%`,background:`rgba(255,255,255,0.3)`,borderRadius:2,pointerEvents:`none`}}),(0,s.jsx)(`div`,{style:{position:`absolute`,top:0,left:0,bottom:0,width:`${Re}%`,background:D.primary,borderRadius:2,pointerEvents:`none`}}),(0,s.jsx)(`div`,{style:{position:`absolute`,top:`50%`,left:`${Re}%`,transform:`translate(-50%, -50%)`,width:12,height:12,borderRadius:`50%`,background:D.primary,pointerEvents:`none`}}),v.map((e,t)=>{let r=L>0?e.time/L*100:0;return(0,s.jsx)(`div`,{title:n.m(e.label),style:{position:`absolute`,top:`50%`,left:`${r}%`,transform:`translate(-50%, -50%)`,width:8,height:8,borderRadius:`50%`,background:`#fff`,border:`2px solid ${D.primary}`,zIndex:2,cursor:`pointer`,pointerEvents:`auto`}},t)}),ae!==null&&(0,s.jsxs)(`div`,{style:{position:`absolute`,bottom:12,left:oe,transform:`translateX(-50%)`,background:`rgba(0,0,0,0.8)`,color:`#fff`,fontSize:`0.72rem`,padding:`2px 6px`,borderRadius:4,whiteSpace:`nowrap`,pointerEvents:`none`},children:[mn(ae),Me(ae)&&(0,s.jsx)(`span`,{style:{display:`block`,fontSize:`0.65rem`,color:`rgba(255,255,255,0.7)`},children:n.m(Me(ae).label)})]})]}),(0,s.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:2},children:[(0,s.jsx)(_n,{onClick:ve,title:N?`Pause`:`Play`,primary:D.primary,children:(0,s.jsx)(hn,{path:N?gn.pause:gn.play,size:22})}),(0,s.jsx)(_n,{onClick:we,title:`Skip back 10 seconds`,primary:D.primary,children:(0,s.jsxs)(`div`,{style:{position:`relative`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:[(0,s.jsx)(hn,{path:gn.replay10,size:22}),(0,s.jsx)(`span`,{style:{position:`absolute`,fontSize:`7px`,fontWeight:700,color:`currentColor`,marginTop:1},children:`10`})]})}),(0,s.jsx)(_n,{onClick:Ce,title:`Skip forward 10 seconds`,primary:D.primary,children:(0,s.jsxs)(`div`,{style:{position:`relative`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:[(0,s.jsx)(hn,{path:gn.forward10,size:22}),(0,s.jsx)(`span`,{style:{position:`absolute`,fontSize:`7px`,fontWeight:700,color:`currentColor`,marginTop:1},children:`10`})]})}),(0,s.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,position:`relative`},onMouseEnter:()=>ge(!0),onMouseLeave:()=>ge(!1),children:[(0,s.jsx)(_n,{onClick:ye,title:U?`Unmute`:`Mute`,primary:D.primary,children:(0,s.jsx)(hn,{path:Le,size:20})}),(0,s.jsx)(`div`,{style:{overflow:`hidden`,width:he?64:0,opacity:+!!he,transition:O?`none`:`width 0.2s ease, opacity 0.2s ease`,display:`flex`,alignItems:`center`},children:(0,s.jsx)(`input`,{type:`range`,min:0,max:1,step:.05,value:U?0:V,onChange:ke,"aria-label":`Volume`,style:{width:64,accentColor:D.primary,cursor:`pointer`,height:4}})})]}),(0,s.jsxs)(`span`,{style:{color:`#fff`,fontSize:`0.78rem`,fontFamily:`monospace`,fontVariantNumeric:`tabular-nums`,marginLeft:6,whiteSpace:`nowrap`,flexShrink:0},children:[mn(F),` / `,mn(L)]}),(0,s.jsx)(`div`,{style:{flex:1}}),y.length>0&&(0,s.jsx)(_n,{onClick:Se,title:`Subtitles`,primary:D.primary,active:re>=0,children:(0,s.jsx)(hn,{path:gn.closedCaption,size:20})}),(0,s.jsxs)(`div`,{style:{position:`relative`,display:`flex`,alignItems:`center`},children:[(0,s.jsxs)(`button`,{type:`button`,onClick:()=>ne(e=>!e),title:`Playback speed`,style:{background:`none`,border:`none`,cursor:`pointer`,color:`#fff`,fontSize:`0.75rem`,fontWeight:600,padding:`6px 8px`,letterSpacing:`0.02em`,position:`relative`},children:[X,`×`]}),X!==1&&(0,s.jsxs)(`span`,{style:{position:`absolute`,top:0,right:0,background:D.primary,color:`#fff`,fontSize:`0.55rem`,fontWeight:700,borderRadius:6,padding:`1px 4px`,lineHeight:1.2,pointerEvents:`none`},children:[X,`x`]}),te&&(0,s.jsx)(`div`,{style:{position:`absolute`,bottom:`100%`,right:0,background:`rgba(20,20,20,0.97)`,border:`1px solid ${D.border}`,borderRadius:6,overflow:`hidden`,zIndex:100,minWidth:80},children:[.5,.75,1,1.25,1.5,2].map(e=>(0,s.jsxs)(`button`,{type:`button`,onClick:()=>Ae(e),style:{display:`block`,width:`100%`,padding:`6px 14px`,background:e===X?D.primary+`30`:`none`,border:`none`,color:e===X?D.primary:`#fff`,fontSize:`0.8rem`,cursor:`pointer`,textAlign:`left`},children:[e,`×`]},e))})]}),g&&typeof document<`u`&&`pictureInPictureEnabled`in document&&(0,s.jsx)(_n,{onClick:xe,title:`Picture-in-Picture`,primary:D.primary,active:ue,children:(0,s.jsx)(hn,{path:gn.pip,size:20})}),_&&(0,s.jsx)(`a`,{href:Pe,download:!0,title:`Download`,style:{color:`#fff`,display:`flex`,alignItems:`center`,padding:`6px`},children:(0,s.jsx)(hn,{path:gn.download,size:20})}),h&&(0,s.jsx)(_n,{onClick:be,title:G?`Exit fullscreen`:`Fullscreen`,primary:D.primary,children:(0,s.jsx)(hn,{path:G?gn.fullscreenExit:gn.fullscreen,size:20})})]})]}),(0,s.jsx)(`style`,{children:`
54
- @keyframes tkxvp-flash {
55
- 0% { opacity: 1; transform: translate(-50%,-50%) scale(1); }
56
- 100% { opacity: 0; transform: translate(-50%,-50%) scale(1.5); }
57
- }
58
- @keyframes tkxvp-spin {
59
- 0% { transform: rotate(0deg); }
60
- 100% { transform: rotate(360deg); }
61
- }
62
- `})]})}vn.displayName=`TkxVideoPlayer`;var yn={sm:{circle:24,fontSize:`0.75rem`,titleSize:`0.8rem`,descSize:`0.7rem`,connectorWidth:2},md:{circle:32,fontSize:`0.875rem`,titleSize:`0.9rem`,descSize:`0.775rem`,connectorWidth:2},lg:{circle:40,fontSize:`1rem`,titleSize:`1rem`,descSize:`0.85rem`,connectorWidth:3}};function bn({size:e}){let t=e*.55;return(0,s.jsx)(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z`})})}function xn({size:e}){let t=e*.55;return(0,s.jsx)(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z`})})}function Sn({status:e,index:t,showStepNumbers:n,icon:r,circleSize:i,fontSize:a,primary:o,danger:c,success:l,text:u,textMuted:d,border:f,surface:p,variant:m,reducedMotion:h,clickable:g}){let _=e===`completed`,v=e===`active`,y=e===`error`,b=e===`pending`,x=p,S=f,C=d,w=2;_?(x=m===`filled`?l:p,S=l,C=m===`filled`?`#fff`:l):v?(x=m===`outlined`?p:o,S=o,C=m===`outlined`?o:`#fff`,w=2):y?(x=m===`filled`?c:p,S=c,C=m===`filled`?`#fff`:c):b&&(x=p,S=f,C=d);let T=v&&!h?{boxShadow:`0 0 0 4px ${o}30`,animation:`tkxstepper-pulse 2s ease-in-out infinite`}:{},E=g?{cursor:`pointer`,transition:`transform 0.15s ease, box-shadow 0.15s ease`}:{},D;return D=r&&!_&&!y?(0,s.jsx)(`span`,{style:{fontSize:a,lineHeight:1},children:r}):_?(0,s.jsx)(bn,{size:i}):y?(0,s.jsx)(xn,{size:i}):n?(0,s.jsx)(`span`,{style:{fontSize:a,fontWeight:600,lineHeight:1},children:t+1}):(0,s.jsx)(`span`,{style:{fontSize:i*.22,lineHeight:1,background:C,borderRadius:`50%`,width:i*.22,height:i*.22,display:`block`}}),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`style`,{children:`
63
- @keyframes tkxstepper-pulse {
64
- 0%, 100% { box-shadow: 0 0 0 0 ${o}50; }
65
- 50% { box-shadow: 0 0 0 6px ${o}20; }
66
- }
67
- `}),(0,s.jsx)(`div`,{style:{width:i,height:i,minWidth:i,borderRadius:`50%`,border:`${w}px solid ${S}`,backgroundColor:x,color:C,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,transition:h?`none`:`background-color 0.2s, border-color 0.2s`,...T,...E},children:D})]})}function Cn({completed:e,orientation:t,connectorStyle:n,connectorWidth:r,primary:i,border:a,reducedMotion:o}){let c=e?i:a;return t===`horizontal`?(0,s.jsx)(`div`,{"aria-hidden":`true`,style:{flex:1,height:r,background:n===`solid`?c:`none`,backgroundImage:n===`solid`?`none`:`repeating-linear-gradient(90deg, ${c} 0, ${c} 6px, transparent 6px, transparent ${n===`dashed`?12:9}px)`,borderRadius:1,transition:o?`none`:`background 0.3s ease`,alignSelf:`center`,marginLeft:4,marginRight:4}}):(0,s.jsx)(`div`,{"aria-hidden":`true`,style:{width:r,flex:1,minHeight:20,background:n===`solid`?c:`none`,backgroundImage:n===`solid`?`none`:`repeating-linear-gradient(180deg, ${c} 0, ${c} 6px, transparent 6px, transparent ${n===`dashed`?12:9}px)`,borderRadius:1,transition:o?`none`:`background 0.3s ease`,alignSelf:`stretch`,marginTop:4,marginBottom:4,marginLeft:`auto`,marginRight:`auto`}})}function wn({steps:e,activeStep:i=0,orientation:a=`horizontal`,variant:o=`default`,size:c=`md`,clickable:l=!1,onStepClick:u,showStepNumbers:d=!0,alternateLabel:f=!1,connector:p=`solid`,className:m,style:h}){let g=t.f(),_=r.o(),v=yn[c],y=(e,t)=>e.status?e.status:t<i?`completed`:t===i?`active`:`pending`,b=a===`horizontal`;return(0,s.jsx)(`div`,{className:m,role:`list`,"aria-label":`Steps`,style:{display:`flex`,flexDirection:b?`row`:`column`,alignItems:b?f?`flex-start`:`center`:`stretch`,width:`100%`,gap:0,...h},children:e.map((t,r)=>{let a=y(t,r),c=r===e.length-1,m=a===`completed`||r<i,h=r%2==0,x=()=>{l&&u?.(r)},S=(0,s.jsx)(Sn,{status:a,index:r,showStepNumbers:d,icon:t.icon,circleSize:v.circle,fontSize:v.fontSize,primary:g.primary,danger:g.danger,success:g.success,text:g.text,textMuted:g.textMuted,border:g.border,surface:g.surface,variant:o,reducedMotion:_,clickable:l}),C=(0,s.jsxs)(`div`,{style:{textAlign:b&&!f?`center`:`left`,maxWidth:b?120:void 0},children:[(0,s.jsxs)(`div`,{style:{fontSize:v.titleSize,fontWeight:a===`active`?600:500,color:a===`pending`?g.textMuted:a===`error`?g.danger:g.text,lineHeight:1.3,transition:_?`none`:`color 0.2s`},children:[n.m(t.title),t.optional&&(0,s.jsx)(`span`,{style:{fontSize:v.descSize,color:g.textMuted,fontWeight:400,marginLeft:4},children:`(optional)`})]}),t.description&&(0,s.jsx)(`div`,{style:{fontSize:v.descSize,color:g.textMuted,marginTop:2,lineHeight:1.4},children:n.m(t.description)}),t.error&&a===`error`&&(0,s.jsx)(`div`,{style:{fontSize:v.descSize,color:g.danger,marginTop:2},children:n.m(t.error)})]});return b?(0,s.jsxs)(`div`,{role:`listitem`,style:{display:`flex`,flex:+!c,alignItems:`center`,minWidth:0},children:[(0,s.jsxs)(`div`,{onClick:x,style:{display:`flex`,flexDirection:`column`,alignItems:`center`,gap:6,cursor:l?`pointer`:`default`,flexShrink:0},"aria-current":a===`active`?`step`:void 0,children:[f&&!h&&(0,s.jsx)(`div`,{style:{minHeight:v.circle*1.5+6,display:`flex`,alignItems:`flex-end`,paddingBottom:6},children:C}),S,!f&&C,f&&h&&(0,s.jsx)(`div`,{style:{marginTop:6},children:C})]}),!c&&(0,s.jsx)(Cn,{completed:m,orientation:`horizontal`,connectorStyle:p,connectorWidth:v.connectorWidth,primary:g.primary,border:g.border,reducedMotion:_})]},t.id):(0,s.jsxs)(`div`,{role:`listitem`,style:{display:`flex`,flexDirection:`row`,minHeight:0},children:[(0,s.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,marginRight:14,flexShrink:0},children:[(0,s.jsx)(`div`,{onClick:x,style:{cursor:l?`pointer`:`default`},"aria-current":a===`active`?`step`:void 0,children:S}),!c&&(0,s.jsx)(Cn,{completed:m,orientation:`vertical`,connectorStyle:p,connectorWidth:v.connectorWidth,primary:g.primary,border:g.border,reducedMotion:_})]}),(0,s.jsx)(`div`,{style:{paddingTop:(v.circle-parseFloat(v.titleSize)*16)/2,paddingBottom:c?0:16,flex:1,minWidth:0},children:C})]},t.id)})})}wn.displayName=`TkxStepper`;function Tn(e){let t=0,n=0,r=0,i=e.replace(`#`,``);i.length===3?(t=parseInt(i[0]+i[0],16),n=parseInt(i[1]+i[1],16),r=parseInt(i[2]+i[2],16)):i.length>=6&&(t=parseInt(i.slice(0,2),16),n=parseInt(i.slice(2,4),16),r=parseInt(i.slice(4,6),16)),t/=255,n/=255,r/=255;let a=Math.max(t,n,r),o=Math.min(t,n,r),s=0,c=0,l=(a+o)/2;if(a!==o){let e=a-o;switch(c=l>.5?e/(2-a-o):e/(a+o),a){case t:s=((n-r)/e+(n<r?6:0))/6;break;case n:s=((r-t)/e+2)/6;break;case r:s=((t-n)/e+4)/6;break}}return[Math.round(s*360),Math.round(c*100),Math.round(l*100)]}function En(e,t,n){t/=100,n/=100;let r=t*Math.min(n,1-n),i=t=>{let i=(t+e/30)%12,a=n-r*Math.max(Math.min(i-3,9-i,1),-1);return Math.round(255*a).toString(16).padStart(2,`0`)};return`#${i(0)}${i(8)}${i(4)}`}function Dn(e){let t=e.replace(`#`,``),n=parseInt(t.slice(0,2),16),r=parseInt(t.slice(2,4),16),i=parseInt(t.slice(4,6),16);return[isNaN(n)?0:n,isNaN(r)?0:r,isNaN(i)?0:i]}function On(e,t,n){return`#${e.toString(16).padStart(2,`0`)}${t.toString(16).padStart(2,`0`)}${n.toString(16).padStart(2,`0`)}`}function kn(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(e)}function An(e,t,n){if(n===`hex`)return t<1?`${e}${Math.round(t*255).toString(16).padStart(2,`0`)}`:e;let[r,i,a]=Dn(e);if(n===`rgb`)return t<1?`rgba(${r}, ${i}, ${a}, ${t.toFixed(2)})`:`rgb(${r}, ${i}, ${a})`;let[o,s,c]=Tn(e);return n===`hsl`?t<1?`hsla(${o}, ${s}%, ${c}%, ${t.toFixed(2)})`:`hsl(${o}, ${s}%, ${c}%)`:e}var jn=[`#ef4444`,`#f97316`,`#eab308`,`#22c55e`,`#06b6d4`,`#3b82f6`,`#8b5cf6`,`#ec4899`,`#ffffff`,`#94a3b8`,`#475569`,`#0f172a`];function Mn({hue:e,sat:t,bright:n,onChange:r}){let i=(0,o.useRef)(null),a=(0,o.useRef)(!1),c=(0,o.useCallback)(e=>{let t=i.current;if(!t)return;let n=t.getBoundingClientRect(),a=Math.max(0,Math.min(1,(e.clientX-n.left)/n.width)),o=Math.max(0,Math.min(1,(e.clientY-n.top)/n.height));r(Math.round(a*100),Math.round((1-o)*100))},[r]);(0,o.useEffect)(()=>{let e=e=>{a.current&&c(e)},t=()=>{a.current=!1};return document.addEventListener(`mousemove`,e),document.addEventListener(`mouseup`,t),()=>{document.removeEventListener(`mousemove`,e),document.removeEventListener(`mouseup`,t)}},[c]);let l=`${t}%`,u=`${100-n}%`;return(0,s.jsxs)(`div`,{ref:i,style:{position:`relative`,width:`100%`,height:`160px`,borderRadius:`6px`,cursor:`crosshair`,background:`hsl(${e}, 100%, 50%)`,flexShrink:0},onMouseDown:e=>{a.current=!0,c(e)},children:[(0,s.jsx)(`div`,{style:{position:`absolute`,inset:0,borderRadius:`6px`,background:`linear-gradient(to right, #ffffff, transparent)`}}),(0,s.jsx)(`div`,{style:{position:`absolute`,inset:0,borderRadius:`6px`,background:`linear-gradient(to bottom, transparent, #000000)`}}),(0,s.jsx)(`div`,{style:{position:`absolute`,left:l,top:u,transform:`translate(-50%, -50%)`,width:`14px`,height:`14px`,borderRadius:`50%`,border:`2px solid white`,boxShadow:`0 0 0 1px rgba(0,0,0,0.4)`,pointerEvents:`none`,backgroundColor:En(e,t,n/2+25)}})]})}function Nn({hue:e,onChange:t}){let n=(0,o.useRef)(null),r=(0,o.useRef)(!1),i=(0,o.useCallback)(e=>{let r=n.current;if(!r)return;let i=r.getBoundingClientRect(),a=Math.max(0,Math.min(1,(e.clientX-i.left)/i.width));t(Math.round(a*360))},[t]);return(0,o.useEffect)(()=>{let e=e=>{r.current&&i(e)},t=()=>{r.current=!1};return document.addEventListener(`mousemove`,e),document.addEventListener(`mouseup`,t),()=>{document.removeEventListener(`mousemove`,e),document.removeEventListener(`mouseup`,t)}},[i]),(0,s.jsx)(`div`,{ref:n,style:{position:`relative`,height:`12px`,borderRadius:`6px`,cursor:`pointer`,background:`linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)`},onMouseDown:e=>{r.current=!0,i(e)},children:(0,s.jsx)(`div`,{style:{position:`absolute`,left:`${e/360*100}%`,top:`50%`,transform:`translate(-50%, -50%)`,width:`16px`,height:`16px`,borderRadius:`50%`,border:`2px solid white`,boxShadow:`0 0 0 1px rgba(0,0,0,0.3)`,backgroundColor:`hsl(${e}, 100%, 50%)`,pointerEvents:`none`}})})}function Pn({alpha:e,hex:t,onChange:n}){let r=(0,o.useRef)(null),i=(0,o.useRef)(!1),a=(0,o.useCallback)(e=>{let t=r.current;if(!t)return;let i=t.getBoundingClientRect(),a=Math.max(0,Math.min(1,(e.clientX-i.left)/i.width));n(Math.round(a*100)/100)},[n]);(0,o.useEffect)(()=>{let e=e=>{i.current&&a(e)},t=()=>{i.current=!1};return document.addEventListener(`mousemove`,e),document.addEventListener(`mouseup`,t),()=>{document.removeEventListener(`mousemove`,e),document.removeEventListener(`mouseup`,t)}},[a]);let[c,l,u]=Dn(t);return(0,s.jsxs)(`div`,{style:{position:`relative`},children:[(0,s.jsx)(`div`,{style:{position:`absolute`,inset:0,borderRadius:`6px`,backgroundImage:`repeating-conic-gradient(#ccc 0% 25%, white 0% 50%)`,backgroundSize:`8px 8px`}}),(0,s.jsx)(`div`,{ref:r,style:{position:`relative`,height:`12px`,borderRadius:`6px`,cursor:`pointer`,background:`linear-gradient(to right, rgba(${c},${l},${u},0), rgba(${c},${l},${u},1))`},onMouseDown:e=>{i.current=!0,a(e)},children:(0,s.jsx)(`div`,{style:{position:`absolute`,left:`${e*100}%`,top:`50%`,transform:`translate(-50%, -50%)`,width:`16px`,height:`16px`,borderRadius:`50%`,border:`2px solid white`,boxShadow:`0 0 0 1px rgba(0,0,0,0.3)`,backgroundColor:`rgba(${c},${l},${u},${e})`,pointerEvents:`none`}})})]})}function Fn({value:e,defaultValue:n=`#3b82f6`,onChange:r,format:i=`hex`,showAlpha:a=!1,presets:l=jn,disabled:u=!1,size:d=`md`,placeholder:f,label:p,style:m}){let h=t.f(),g=(0,o.useRef)(null),_=(0,o.useRef)(null),[v,y]=(0,o.useState)(!1),b=e!==void 0,[x,S]=(0,o.useState)(b&&e||n),C=b?e||n:x,[w,T]=(0,o.useState)(1),[E,D]=(0,o.useState)(C),[O,k]=(0,o.useState)({top:0,left:0}),[A,j,M]=Tn(kn(C)?C:n);Math.round(M+j/100*Math.min(M/100,1-M/100)*100);let N=(0,o.useCallback)((e,t=w)=>{kn(e)&&(D(e),b||S(e),r?.(An(e,t,i),i))},[w,b,i,r]);(0,o.useEffect)(()=>{b&&e&&kn(e)&&D(e)},[b,e]);let P=()=>{if(u)return;let e=g.current;if(!e)return;let t=e.getBoundingClientRect();k({top:(window.innerHeight-t.bottom>320?t.bottom+6:t.top-326)+window.scrollY,left:t.left+window.scrollX}),y(!0)};(0,o.useEffect)(()=>{if(!v)return;let e=e=>{_.current&&!_.current.contains(e.target)&&g.current&&!g.current.contains(e.target)&&y(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[v]),(0,o.useEffect)(()=>{if(!v)return;let e=e=>{e.key===`Escape`&&y(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[v]);let F=(e,t)=>{let n=t/100,r=n*(1-e/100/2),i=r===0||r===1?0:(n-r)/Math.min(r,1-r);N(En(A,Math.round(i*100),Math.round(r*100)))},I=e=>{N(En(e,j,M))},L=e=>{T(e),r?.(An(C,e,i),i)},R=e=>{let t=e.target.value;D(t),kn(t)&&N(t)},z=(e,t)=>{let n=Math.max(0,Math.min(255,parseInt(t)||0)),[r,i,a]=Dn(C);N(e===`r`?On(n,i,a):e===`g`?On(r,n,a):On(r,i,n))},B={sm:28,md:34,lg:40}[d],[V,H,U]=Dn(kn(C)?C:n),W={display:`inline-flex`,alignItems:`center`,gap:`8px`,height:`${B}px`,padding:`4px 10px 4px 6px`,borderRadius:`8px`,border:`1px solid ${h.border}`,backgroundColor:h.surface,cursor:u?`not-allowed`:`pointer`,opacity:u?.5:1,color:h.text,fontSize:`13px`,fontFamily:`inherit`,transition:`border-color 0.15s`,...m},G={width:`${B-8}px`,height:`${B-8}px`,borderRadius:`4px`,backgroundColor:`rgba(${V},${H},${U},${w})`,border:`1px solid ${h.border}`,flexShrink:0},K={position:`absolute`,top:O.top,left:O.left,zIndex:9999,width:`260px`,backgroundColor:h.surface,border:`1px solid ${h.border}`,borderRadius:`12px`,padding:`16px`,boxShadow:`0 8px 32px rgba(0,0,0,0.24)`,display:`flex`,flexDirection:`column`,gap:`12px`},q={width:`100%`,padding:`6px 10px`,borderRadius:`6px`,border:`1px solid ${h.border}`,backgroundColor:h.bg,color:h.text,fontSize:`12px`,fontFamily:`monospace`,outline:`none`},J={flex:1,padding:`5px 6px`,borderRadius:`6px`,border:`1px solid ${h.border}`,backgroundColor:h.bg,color:h.text,fontSize:`11px`,textAlign:`center`,fontFamily:`monospace`,outline:`none`},Y=e=>({width:`20px`,height:`20px`,borderRadius:`50%`,backgroundColor:e,border:e.toLowerCase()===C.toLowerCase()?`2px solid ${h.primary}`:`1px solid ${h.border}`,cursor:`pointer`,flexShrink:0,transition:`transform 0.1s`});return(0,s.jsxs)(s.Fragment,{children:[p&&(0,s.jsx)(`label`,{style:{display:`block`,fontSize:`13px`,color:h.text,marginBottom:`6px`,fontWeight:500},children:p}),(0,s.jsxs)(`button`,{ref:g,type:`button`,style:W,onClick:P,disabled:u,"aria-label":`Color picker, current color ${C}`,"aria-haspopup":`dialog`,"aria-expanded":v,children:[(0,s.jsx)(`div`,{style:G}),(0,s.jsx)(`span`,{style:{fontFamily:`monospace`,fontSize:`12px`,color:h.textMuted},children:f??An(kn(C)?C:n,w,i)})]}),v&&(0,c.createPortal)((0,s.jsxs)(`div`,{ref:_,style:K,role:`dialog`,"aria-label":`Color picker`,children:[(0,s.jsx)(Mn,{hue:A,sat:j,bright:M,onChange:F}),(0,s.jsx)(Nn,{hue:A,onChange:I}),a&&(0,s.jsx)(Pn,{alpha:w,hex:kn(C)?C:n,onChange:L}),(0,s.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`8px`},children:[(0,s.jsx)(`div`,{style:{width:`28px`,height:`28px`,borderRadius:`6px`,flexShrink:0,backgroundColor:`rgba(${V},${H},${U},${w})`,border:`1px solid ${h.border}`}}),(0,s.jsx)(`input`,{style:q,value:E,onChange:R,maxLength:7,spellCheck:!1,"aria-label":`Hex color value`})]}),(0,s.jsxs)(`div`,{style:{display:`flex`,gap:`6px`,alignItems:`center`},children:[[`r`,`g`,`b`].map(e=>(0,s.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,gap:`3px`,alignItems:`center`},children:[(0,s.jsx)(`input`,{style:J,type:`number`,min:0,max:255,value:e===`r`?V:e===`g`?H:U,onChange:t=>z(e,t.target.value),"aria-label":`${e.toUpperCase()} channel`}),(0,s.jsx)(`span`,{style:{fontSize:`10px`,color:h.textMuted,textTransform:`uppercase`},children:e})]},e)),a&&(0,s.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,gap:`3px`,alignItems:`center`},children:[(0,s.jsx)(`input`,{style:J,type:`number`,min:0,max:100,value:Math.round(w*100),onChange:e=>L(Math.max(0,Math.min(1,parseInt(e.target.value)/100||0))),"aria-label":`Alpha channel`}),(0,s.jsx)(`span`,{style:{fontSize:`10px`,color:h.textMuted},children:`A%`})]})]}),l.length>0&&(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`div`,{style:{fontSize:`11px`,color:h.textMuted,marginBottom:`6px`,fontWeight:500},children:`Presets`}),(0,s.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:`6px`},children:l.map(e=>(0,s.jsx)(`button`,{type:`button`,style:Y(e),onClick:()=>N(e),"aria-label":`Select color ${e}`,onMouseEnter:e=>{e.currentTarget.style.transform=`scale(1.15)`},onMouseLeave:e=>{e.currentTarget.style.transform=`scale(1)`}},e))})]})]}),document.body)]})}var In={sm:{height:`32px`,fontSize:`0.8125rem`,px:`8px`,btnW:`28px`,iconSz:14},md:{height:`40px`,fontSize:`0.875rem`,px:`12px`,btnW:`34px`,iconSz:16},lg:{height:`48px`,fontSize:`1rem`,px:`14px`,btnW:`40px`,iconSz:18}};function Ln(e,t,n){let r=e;return t!==void 0&&(r=Math.max(r,t)),n!==void 0&&(r=Math.min(r,n)),r}function Rn(e,t){if(t===void 0)return e;let n=10**t;return Math.round(e*n)/n}function zn(e,t,n,r,i){let a=r??`en-US`;return t===`currency`?new Intl.NumberFormat(a,{style:`currency`,currency:n??`USD`,minimumFractionDigits:i??2,maximumFractionDigits:i??2}).format(e):t===`percent`?new Intl.NumberFormat(a,{style:`percent`,minimumFractionDigits:i??0,maximumFractionDigits:i??0}).format(e/100):t===`decimal`||i!==void 0?new Intl.NumberFormat(a,{minimumFractionDigits:i??0,maximumFractionDigits:i??20}).format(e):String(e)}function Bn({direction:e,isDisabled:t,btnW:n,height:r,primaryColor:i,borderColor:a,textMuted:c,iconSz:l,onStep:u}){let d=(0,o.useRef)(null),f=(0,o.useRef)(null),p=e===`inc`?1:-1,m=(0,o.useCallback)(()=>{u(p),d.current=setTimeout(()=>{f.current=setInterval(()=>u(p),60)},400)},[p,u]),h=(0,o.useCallback)(()=>{d.current&&=(clearTimeout(d.current),null),f.current&&=(clearInterval(f.current),null)},[]);(0,o.useEffect)(()=>()=>h(),[h]);let g=e===`inc`;return(0,s.jsx)(`button`,{type:`button`,"aria-label":g?`Increment`:`Decrement`,disabled:t,onMouseDown:m,onMouseUp:h,onMouseLeave:h,onTouchStart:e=>{e.preventDefault(),m()},onTouchEnd:h,style:{width:n,height:r,minWidth:n,flexShrink:0,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`transparent`,border:`none`,borderRight:g?void 0:`1px solid ${a}`,borderLeft:g?`1px solid ${a}`:void 0,cursor:t?`not-allowed`:`pointer`,color:t?c:i,transition:`color 120ms ease, background 120ms ease`,outline:`none`},onFocus:e=>{t||(e.currentTarget.style.background=`${i}12`)},onBlur:e=>{e.currentTarget.style.background=`transparent`},children:g?(0,s.jsxs)(`svg`,{width:l,height:l,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2.5,"aria-hidden":`true`,children:[(0,s.jsx)(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`}),(0,s.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`})]}):(0,s.jsx)(`svg`,{width:l,height:l,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2.5,"aria-hidden":`true`,children:(0,s.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`})})})}function Vn({value:e,defaultValue:r=0,onChange:i,min:a,max:c,step:l=1,precision:u,prefix:d,suffix:f,format:p,currency:m,locale:h,clampOnBlur:g=!0,allowMouseWheel:_=!1,size:v=`md`,label:y,hint:b,isDisabled:x=!1,isReadOnly:S=!1,isInvalid:C=!1,errorMessage:w,id:T,className:E,style:D}){let O=t.f(),k=(0,o.useId)(),A=T??k,j=`${A}-hint`,M=`${A}-error`,N=e!==void 0,[P,F]=(0,o.useState)(r),I=N?e:P,[L,R]=(0,o.useState)(!1),[z,B]=(0,o.useState)(``),V=In[v],H=C||!!w,U=H?O.danger:L?O.primary:O.border,W=[b&&j,H&&M].filter(Boolean).join(` `)||void 0,G=y?n.m(y):void 0,K=b?n.m(b):void 0,q=w?n.m(w):void 0,J=d?n.m(d):void 0,Y=f?n.m(f):void 0,ee=(0,o.useCallback)(e=>{let t=Rn(e,u);N||F(t),i?.(t)},[N,i,u]),X=(0,o.useCallback)(e=>{x||S||ee(Ln(Rn(I+e*l,u),a,c))},[x,S,I,l,u,a,c,ee]),Z=()=>{R(!0),B(String(I))},te=()=>{R(!1);let e=parseFloat(z);if(isNaN(e)){i?.(null),B(String(I));return}let t=Rn(e,u);g&&(t=Ln(t,a,c)),ee(t)},ne=e=>{B(e.target.value)},re=e=>{e.key===`ArrowUp`&&(e.preventDefault(),X(1)),e.key===`ArrowDown`&&(e.preventDefault(),X(-1))},ie=e=>{!_||!L||(e.preventDefault(),X(e.deltaY<0?1:-1))},ae=L?z:zn(I,p,m,h,u),Q=(J||Y)&&!L;return(0,s.jsxs)(`div`,{className:n.t(n.a(`flex flex-col gap-1 w-full`),E),style:D,children:[G&&(0,s.jsx)(`label`,{htmlFor:A,className:n.a(`text-sm font-medium font-sans`),style:{color:O.text},children:G}),(0,s.jsxs)(`div`,{className:n.a(`flex items-stretch overflow-hidden rounded-lg transition-colors duration-150`),style:{border:`1.5px solid ${U}`,backgroundColor:x?O.surfaceAlt:O.surface,opacity:x?.65:1,height:V.height},children:[(0,s.jsx)(Bn,{direction:`dec`,isDisabled:x||S,btnW:V.btnW,height:V.height,primaryColor:O.primary,borderColor:O.border,textMuted:O.textMuted,iconSz:V.iconSz,onStep:X}),(0,s.jsxs)(`div`,{className:n.a(`relative flex-1 flex items-center overflow-hidden`),children:[Q&&J&&(0,s.jsx)(`span`,{style:{position:`absolute`,left:V.px,fontSize:V.fontSize,color:O.textMuted,pointerEvents:`none`,userSelect:`none`},children:J}),(0,s.jsx)(`input`,{id:A,type:`text`,inputMode:`decimal`,value:L?z:ae,readOnly:S,disabled:x,"aria-invalid":H,"aria-describedby":W,"aria-valuemin":a,"aria-valuemax":c,"aria-valuenow":I,style:{width:`100%`,height:`100%`,border:`none`,background:`transparent`,outline:`none`,textAlign:`center`,fontSize:V.fontSize,fontFamily:`inherit`,color:O.text,paddingLeft:Q&&J?`calc(${V.px} + 1.2em)`:V.px,paddingRight:Q&&Y?`calc(${V.px} + 1.2em)`:V.px,cursor:x?`not-allowed`:S?`default`:`text`},onFocus:Z,onBlur:te,onChange:ne,onKeyDown:re,onWheel:ie}),Q&&Y&&(0,s.jsx)(`span`,{style:{position:`absolute`,right:V.px,fontSize:V.fontSize,color:O.textMuted,pointerEvents:`none`,userSelect:`none`},children:Y})]}),(0,s.jsx)(Bn,{direction:`inc`,isDisabled:x||S,btnW:V.btnW,height:V.height,primaryColor:O.primary,borderColor:O.border,textMuted:O.textMuted,iconSz:V.iconSz,onStep:X})]}),K&&!q&&(0,s.jsx)(`span`,{id:j,className:n.a(`text-xs`),style:{color:O.textMuted},children:K}),q&&(0,s.jsxs)(`span`,{id:M,role:`alert`,className:n.a(`text-xs flex items-center gap-1`),style:{color:O.danger},children:[(0,s.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z`})}),q]})]})}Vn.displayName=`TkxNumberInput`;var Hn={sm:{box:`36px`,fontSize:`1rem`,gap:`6px`},md:{box:`44px`,fontSize:`1.25rem`,gap:`8px`},lg:{box:`52px`,fontSize:`1.5rem`,gap:`10px`}},Un={number:/^\d$/,alphanumeric:/^[a-zA-Z0-9]$/,alpha:/^[a-zA-Z]$/};function Wn(e,t){return Un[t].test(e)?e.toUpperCase():``}function Gn({length:e=6,value:r,onChange:i,onComplete:a,type:c=`number`,mask:l=!1,autoFocus:u=!1,isDisabled:d=!1,isInvalid:f=!1,errorMessage:p,hint:m,size:h=`md`,separator:g,separatorPosition:_,className:v,style:y}){let b=t.f(),x=(0,o.useId)(),S=`${x}-hint`,C=`${x}-error`,w=r!==void 0,T=t=>{let n=t.split(``).slice(0,e);for(;n.length<e;)n.push(``);return n},[E,D]=(0,o.useState)(()=>T(w?r:``)),O=w?T(r):E,k=(0,o.useRef)([]),A=Hn[h],j=f||!!p,M=O.every(e=>e!==``),N=m?n.m(m):void 0,P=p?n.m(p):void 0,F=e=>j?b.danger:M?b.success:b.border;(0,o.useEffect)(()=>{u&&k.current[0]?.focus()},[]);let I=(0,o.useCallback)(e=>{w||D(e);let t=e.join(``);i?.(t),e.every(e=>e!==``)&&a?.(t)},[w,i,a]),L=t=>{let n=Math.max(0,Math.min(e-1,t));k.current[n]?.focus()},R=t=>n=>{if(!d){if(n.key===`Backspace`){if(n.preventDefault(),O[t]!==``){let e=[...O];e[t]=``,I(e)}else if(t>0){let e=[...O];e[t-1]=``,I(e),L(t-1)}return}if(n.key===`Delete`){n.preventDefault();let e=[...O];e[t]=``,I(e);return}if(n.key===`ArrowLeft`){n.preventDefault(),L(t-1);return}if(n.key===`ArrowRight`){n.preventDefault(),L(t+1);return}if(n.key===`Home`){n.preventDefault(),L(0);return}if(n.key===`End`){n.preventDefault(),L(e-1);return}}},z=t=>n=>{if(d)return;let r=n.target.value.slice(-1);if(!r)return;let i=Wn(r,c);if(!i)return;let a=[...O];a[t]=i,I(a),t<e-1&&L(t+1)},B=t=>n=>{if(n.preventDefault(),d)return;let r=n.clipboardData.getData(`text`).split(``).map(e=>Wn(e,c)).filter(Boolean);if(!r.length)return;let i=[...O],a=t;for(let t of r){if(a>=e)break;i[a]=t,a++}I(i),L(Math.min(a,e-1))},V=[N&&S,j&&C].filter(Boolean).join(` `)||void 0;return(0,s.jsxs)(`div`,{className:n.t(n.a(`flex flex-col gap-2 w-fit`),v),style:y,children:[(0,s.jsx)(`div`,{role:`group`,"aria-label":`One-time password`,"aria-describedby":V,className:n.a(`flex items-center`),style:{gap:A.gap},children:Array.from({length:e},(t,r)=>{let i=F(r);return typeof document<`u`&&(document.activeElement,k.current[r]),(0,s.jsxs)(`div`,{className:n.a(`flex items-center`),style:{gap:A.gap},children:[g&&_===r&&r!==0&&(0,s.jsx)(`span`,{"aria-hidden":`true`,style:{color:b.textMuted,userSelect:`none`,flexShrink:0},children:g}),(0,s.jsx)(`input`,{ref:e=>{k.current[r]=e},type:l?`password`:`text`,inputMode:c===`number`?`numeric`:`text`,maxLength:1,value:O[r],disabled:d,"aria-label":`Digit ${r+1} of ${e}`,autoComplete:`one-time-code`,spellCheck:!1,onChange:z(r),onKeyDown:R(r),onPaste:B(r),onFocus:e=>e.target.select(),style:{width:A.box,height:A.box,textAlign:`center`,fontSize:A.fontSize,fontFamily:`monospace`,fontWeight:600,border:`1.5px solid ${i}`,borderRadius:`8px`,backgroundColor:d?b.surfaceAlt:b.surface,color:b.text,outline:`none`,boxShadow:`none`,cursor:d?`not-allowed`:`text`,transition:`border-color 150ms ease, box-shadow 150ms ease`,opacity:d?.6:1},onFocusCapture:e=>{d||(e.currentTarget.style.borderColor=j?b.danger:b.primary,e.currentTarget.style.boxShadow=`0 0 0 3px ${j?b.danger:b.primary}33`)},onBlurCapture:e=>{e.currentTarget.style.borderColor=F(r),e.currentTarget.style.boxShadow=`none`}})]},r)})}),N&&!P&&(0,s.jsx)(`span`,{id:S,className:n.a(`text-xs`),style:{color:b.textMuted},children:N}),P&&(0,s.jsxs)(`span`,{id:C,role:`alert`,className:n.a(`text-xs flex items-center gap-1`),style:{color:b.danger},children:[(0,s.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z`})}),P]})]})}Gn.displayName=`TkxOTP`;function Kn(e,t){(0,o.useEffect)(()=>{if(!t)return;let n=t=>{t.key===`Escape`&&e()};return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[e,t])}function qn(e){let t=(0,o.useRef)(null);return(0,o.useEffect)(()=>{if(!e||!t.current)return;let n=t.current,r=n.querySelectorAll(`button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])`),i=r[0],a=r[r.length-1],o=e=>{e.key===`Tab`&&(e.shiftKey?document.activeElement===i&&(e.preventDefault(),a?.focus()):document.activeElement===a&&(e.preventDefault(),i?.focus()))};return n.addEventListener(`keydown`,o),()=>n.removeEventListener(`keydown`,o)},[e]),t}function Jn(){let[e,t]=(0,o.useState)(!1);return{isOpen:e,open:(0,o.useCallback)(()=>t(!0),[]),close:(0,o.useCallback)(()=>t(!1),[]),toggle:(0,o.useCallback)(()=>t(e=>!e),[])}}function Yn(e,t){if(!e)return{matched:!0,ranges:[],score:0};let n=e.toLowerCase(),r=t.toLowerCase(),i=r.indexOf(n);if(i!==-1)return{matched:!0,ranges:[[i,i+n.length-1]],score:i===0?100:80};let a=[],o=0,s=-1,c=-1;for(let e=0;e<r.length&&o<n.length;e++)r[e]===n[o]&&((c===-1||e!==c+1)&&(s!==-1&&a.push([s,c]),s=e),c=e,o++);return s!==-1&&c!==-1&&a.push([s,c]),o<n.length?{matched:!1,ranges:[],score:0}:{matched:!0,ranges:a,score:40}}function Xn(e,t){if(!e.trim())return t.filter(e=>!e.disabled).map(e=>({item:e,score:0,labelRanges:[]}));let n=[];for(let r of t){if(r.disabled)continue;let t=Yn(e,r.label),i=r.description?Yn(e,r.description):{matched:!1,score:0},a=(r.keywords??[]).some(t=>Yn(e,t).matched);t.matched?n.push({item:r,score:t.score+20,labelRanges:t.ranges}):i.matched?n.push({item:r,score:i.score,labelRanges:[]}):a&&n.push({item:r,score:20,labelRanges:[]})}return n.sort((e,t)=>t.score-e.score)}function Zn({text:e,ranges:t,color:n}){if(!t.length)return(0,s.jsx)(s.Fragment,{children:e});let r=[],i=0;for(let[a,o]of t)i<a&&r.push((0,s.jsx)(`span`,{children:e.slice(i,a)},`t-${i}`)),r.push((0,s.jsx)(`span`,{style:{color:n,fontWeight:700},children:e.slice(a,o+1)},`h-${a}`)),i=o+1;return i<e.length&&r.push((0,s.jsx)(`span`,{children:e.slice(i)},`t-end`)),(0,s.jsx)(s.Fragment,{children:r})}function Qn({surface:e,border:t}){return(0,s.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,padding:`10px 12px`,borderRadius:8,overflow:`hidden`},children:[(0,s.jsx)(`div`,{style:{width:24,height:24,borderRadius:6,background:`linear-gradient(90deg, ${t} 25%, ${e} 50%, ${t} 75%)`,backgroundSize:`200% 100%`,animation:`tkx-shimmer 1.4s ease-in-out infinite`,flexShrink:0}}),(0,s.jsxs)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,gap:5},children:[(0,s.jsx)(`div`,{style:{height:13,borderRadius:4,width:`60%`,background:`linear-gradient(90deg, ${t} 25%, ${e} 50%, ${t} 75%)`,backgroundSize:`200% 100%`,animation:`tkx-shimmer 1.4s ease-in-out infinite`}}),(0,s.jsx)(`div`,{style:{height:10,borderRadius:4,width:`40%`,background:`linear-gradient(90deg, ${t} 25%, ${e} 50%, ${t} 75%)`,backgroundSize:`200% 100%`,animation:`tkx-shimmer 1.4s ease-in-out 0.2s infinite`}})]})]})}function $n({items:e,isOpen:r=!1,onClose:i,placeholder:a=`Type a command or search…`,emptyMessage:l,maxItems:u=8,onItemSelect:d,className:f,style:p}){let m=t.f(),[h,g]=(0,o.useState)(``),[_,v]=(0,o.useState)(0),[y,b]=(0,o.useState)(!1),x=(0,o.useRef)(null),S=(0,o.useRef)(null),C=(0,o.useId)(),w=qn(r),T=Xn(h,e).slice(0,u),E=[];for(let e of T){let t=e.item.group,n=E.find(e=>e.group===t);n?n.items.push(e):E.push({group:t,items:[e]})}let D=E.flatMap(e=>e.items);Kn(()=>{i?.()},r),(0,o.useEffect)(()=>{r&&(g(``),v(0),setTimeout(()=>x.current?.focus(),30))},[r]),(0,o.useEffect)(()=>{_>=D.length&&v(Math.max(0,D.length-1))},[D.length,_]);let O=(0,o.useCallback)(e=>{let t=S.current;t&&t.querySelectorAll(`[data-command-item]`)[e]?.scrollIntoView({block:`nearest`})},[]),k=e=>{if(e.key===`ArrowDown`){e.preventDefault();let t=Math.min(D.length-1,_+1);v(t),O(t)}else if(e.key===`ArrowUp`){e.preventDefault();let t=Math.max(0,_-1);v(t),O(t)}else if(e.key===`Enter`){e.preventDefault();let t=D[_];t&&A(t.item)}},A=e=>{e.disabled||(e.onSelect?.(),d?.(e),i?.())};if(!r||typeof document>`u`)return null;let j=n.m(a),M=l?n.m(l):`No results for "${n.m(h)}"`;if(typeof document<`u`&&!document.getElementById(`tkx-shimmer-style`)){let e=document.createElement(`style`);e.id=`tkx-shimmer-style`,e.textContent=`@keyframes tkx-shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }`,document.head.appendChild(e)}return(0,c.createPortal)((0,s.jsxs)(`div`,{role:`presentation`,style:{position:`fixed`,inset:0,zIndex:1e4,display:`flex`,alignItems:`flex-start`,justifyContent:`center`,paddingTop:`15vh`,paddingLeft:16,paddingRight:16},children:[(0,s.jsx)(`div`,{"aria-hidden":`true`,onClick:i,style:{position:`absolute`,inset:0,backgroundColor:`rgba(0,0,0,0.55)`,backdropFilter:`blur(4px)`,animation:`tkx-fade-in 120ms ease`}}),(0,s.jsxs)(`div`,{ref:w,role:`dialog`,"aria-modal":`true`,"aria-label":`Command palette`,id:C,className:n.t(f),style:{position:`relative`,zIndex:1,width:`100%`,maxWidth:560,backgroundColor:m.surface,border:`1px solid ${m.border}`,borderRadius:16,boxShadow:`0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px ${m.border}`,overflow:`hidden`,display:`flex`,flexDirection:`column`,maxHeight:`70vh`,...p},children:[(0,s.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,padding:`14px 16px`,borderBottom:`1px solid ${m.border}`},children:[(0,s.jsxs)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:m.textMuted,strokeWidth:2,"aria-hidden":`true`,style:{flexShrink:0},children:[(0,s.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,s.jsx)(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`})]}),(0,s.jsx)(`input`,{ref:x,type:`text`,role:`combobox`,"aria-expanded":!0,"aria-autocomplete":`list`,"aria-controls":`${C}-list`,"aria-activedescendant":D[_]?`${C}-item-${D[_].item.id}`:void 0,value:h,onChange:e=>{g(e.target.value),v(0)},onKeyDown:k,placeholder:j,style:{flex:1,border:`none`,background:`transparent`,outline:`none`,fontSize:16,fontFamily:`inherit`,color:m.text}}),h&&(0,s.jsx)(`button`,{type:`button`,"aria-label":`Clear search`,onClick:()=>{g(``),v(0),x.current?.focus()},style:{border:`none`,background:`transparent`,cursor:`pointer`,color:m.textMuted,display:`flex`,alignItems:`center`,padding:0},children:(0,s.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,"aria-hidden":`true`,children:[(0,s.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,s.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]}),(0,s.jsx)(`div`,{id:`${C}-list`,ref:S,role:`listbox`,"aria-label":`Command results`,style:{overflowY:`auto`,flex:1,padding:`6px 8px`},children:y?Array.from({length:4},(e,t)=>(0,s.jsx)(Qn,{surface:m.surface,border:m.border},t)):D.length===0?(0,s.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:8,padding:`32px 16px`,color:m.textMuted},children:[(0,s.jsxs)(`svg`,{width:`32`,height:`32`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.5,"aria-hidden":`true`,children:[(0,s.jsx)(`circle`,{cx:`11`,cy:`11`,r:`8`}),(0,s.jsx)(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`}),(0,s.jsx)(`line`,{x1:`8`,y1:`11`,x2:`14`,y2:`11`})]}),(0,s.jsx)(`span`,{style:{fontSize:`0.875rem`},children:M})]}):E.map(({group:e,items:t},r)=>{let i=E.slice(0,r).reduce((e,t)=>e+t.items.length,0);return(0,s.jsxs)(`div`,{children:[e&&(0,s.jsx)(`div`,{role:`presentation`,style:{fontSize:`0.6875rem`,fontWeight:600,textTransform:`uppercase`,letterSpacing:`0.08em`,color:m.textMuted,padding:`10px 12px 4px`},children:n.m(e)}),t.map((e,t)=>{let r=i+t,a=r===_,o=e.item;return(0,s.jsxs)(`div`,{id:`${C}-item-${o.id}`,role:`option`,"aria-selected":a,"aria-disabled":o.disabled,"data-command-item":!0,onClick:()=>A(o),onMouseEnter:()=>v(r),style:{display:`flex`,alignItems:`center`,gap:10,padding:`9px 12px`,borderRadius:8,cursor:o.disabled?`not-allowed`:`pointer`,opacity:o.disabled?.45:1,backgroundColor:a?`${m.primary}18`:`transparent`,borderLeft:a?`2px solid ${m.primary}`:`2px solid transparent`,transition:`background 80ms ease`,userSelect:`none`},children:[o.icon&&(0,s.jsx)(`span`,{style:{width:20,height:20,flexShrink:0,display:`flex`,alignItems:`center`,justifyContent:`center`,color:a?m.primary:m.textMuted},children:o.icon}),(0,s.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,s.jsx)(`div`,{style:{fontSize:`0.875rem`,fontWeight:500,color:m.text,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:(0,s.jsx)(Zn,{text:o.label,ranges:e.labelRanges,color:m.primary})}),o.description&&(0,s.jsx)(`div`,{style:{fontSize:`0.75rem`,color:m.textMuted,marginTop:1,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:n.m(o.description)})]}),o.shortcut&&(0,s.jsx)(`span`,{style:{flexShrink:0,fontSize:`0.6875rem`,fontWeight:500,color:m.textMuted,backgroundColor:m.surfaceAlt,border:`1px solid ${m.border}`,borderRadius:6,padding:`2px 6px`,fontFamily:`monospace`,letterSpacing:`0.04em`},children:n.m(o.shortcut)})]},o.id)})]},e??`__default__`)})}),D.length>0&&(0,s.jsxs)(`div`,{"aria-hidden":`true`,style:{display:`flex`,alignItems:`center`,gap:12,padding:`8px 16px`,borderTop:`1px solid ${m.border}`,fontSize:`0.6875rem`,color:m.textMuted},children:[(0,s.jsxs)(`span`,{children:[(0,s.jsx)(`kbd`,{style:{fontFamily:`monospace`},children:`↑↓`}),` navigate`]}),(0,s.jsxs)(`span`,{children:[(0,s.jsx)(`kbd`,{style:{fontFamily:`monospace`},children:`↵`}),` select`]}),(0,s.jsxs)(`span`,{children:[(0,s.jsx)(`kbd`,{style:{fontFamily:`monospace`},children:`Esc`}),` close`]})]})]})]}),document.body)}$n.displayName=`TkxCommand`;function er({direction:e,onClick:t,isDisabled:n,primaryColor:r,position:i,orientation:a}){let o=a===`vertical`,c=e===`prev`,l=i===`inside`?{position:`absolute`,zIndex:3,...o?{[c?`top`:`bottom`]:10,left:`50%`,transform:`translateX(-50%)`}:{[c?`left`:`right`]:10,top:`50%`,transform:`translateY(-50%)`}}:{flexShrink:0,position:`relative`};return(0,s.jsx)(`button`,{type:`button`,"aria-label":c?`Previous slide`:`Next slide`,disabled:n,onClick:t,style:{...l,width:36,height:36,borderRadius:`50%`,border:`none`,backgroundColor:`rgba(0,0,0,0.45)`,backdropFilter:`blur(4px)`,color:`#fff`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:n?`not-allowed`:`pointer`,opacity:n?.35:1,transition:`background 150ms ease, opacity 150ms ease`,outline:`none`},onFocus:e=>{e.currentTarget.style.boxShadow=`0 0 0 3px ${r}55`},onBlur:e=>{e.currentTarget.style.boxShadow=`none`},onMouseEnter:e=>{n||(e.currentTarget.style.backgroundColor=`rgba(0,0,0,0.65)`)},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=`rgba(0,0,0,0.45)`},children:o?c?(0,s.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2.5,"aria-hidden":`true`,children:(0,s.jsx)(`polyline`,{points:`18 15 12 9 6 15`})}):(0,s.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2.5,"aria-hidden":`true`,children:(0,s.jsx)(`polyline`,{points:`6 9 12 15 18 9`})}):c?(0,s.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2.5,"aria-hidden":`true`,children:(0,s.jsx)(`polyline`,{points:`15 18 9 12 15 6`})}):(0,s.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2.5,"aria-hidden":`true`,children:(0,s.jsx)(`polyline`,{points:`9 18 15 12 9 6`})})})}function tr({slides:e,autoPlay:i=!1,autoPlayInterval:a=4e3,pauseOnHover:c=!0,loop:l=!0,showArrows:u=!0,showDots:d=!0,showThumbnails:f=!1,orientation:p=`horizontal`,slidesToShow:m=1,gap:h=0,transitionDuration:g=400,swipeable:_=!0,initialIndex:v=0,onChange:y,arrowPosition:b=`inside`,height:x=320,className:S,style:C}){let w=t.f(),T=r.o(),E=(0,o.useId)(),D=e.length,[O,k]=(0,o.useState)(v),[A,j]=(0,o.useState)(l?v+1:v),[M,N]=(0,o.useState)(!1),[P,F]=(0,o.useState)(!1),I=(0,o.useRef)(null),L=(0,o.useRef)(null),R=(0,o.useRef)(null),z=(0,o.useRef)(0),B=(0,o.useRef)(!1),V=p===`vertical`,H=T?0:g,U=l&&D>1?[e[D-1],...e,e[0]]:e,W=U.length,G=100/m,K=(e,t=0)=>{let n=t===0?``:` - ${t}px`;return V?`translateY(calc(-${e*G}%${n}))`:`translateX(calc(-${e*G}%${n}))`},q=(0,o.useCallback)((e,t=!1)=>{let n=l?(e%D+D)%D:Math.max(0,Math.min(D-1,e)),r=l?n+1:n;t&&I.current?(I.current.style.transition=`none`,j(r),k(n),I.current.offsetHeight,I.current.style.transition=``):(N(!0),j(r),k(n)),y?.(n)},[D,l,y]),J=(0,o.useCallback)(()=>q(O-1),[O,q]),Y=(0,o.useCallback)(()=>q(O+1),[O,q]),ee=(0,o.useCallback)(()=>{N(!1),!(!l||D<=1)&&(A===0?q(D-1,!0):A===W-1&&q(0,!0))},[l,D,A,W,q]);(0,o.useEffect)(()=>{if(!(!i||P||D<=1))return L.current=setInterval(Y,a),()=>{L.current&&clearInterval(L.current)}},[i,P,a,Y,D]),(0,o.useEffect)(()=>{let e=e=>{let t=document.activeElement;document.getElementById(E)?.contains(t)&&(e.key===(V?`ArrowUp`:`ArrowLeft`)&&(e.preventDefault(),J()),e.key===(V?`ArrowDown`:`ArrowRight`)&&(e.preventDefault(),Y()))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[E,V,J,Y]);let X=e=>`touches`in e?V?e.touches[0].clientY:e.touches[0].clientX:V?e.clientY:e.clientX,Z=e=>{_&&(R.current=X(e),z.current=0,B.current=!0)},te=e=>{if(!B.current||R.current===null)return;let t=X(e)-R.current;z.current=t,I.current&&(I.current.style.transition=`none`,I.current.style.transform=K(A,-t))},ne=()=>{if(!B.current)return;B.current=!1;let e=z.current;I.current&&(I.current.style.transition=``,I.current.style.transform=``),e<-50?Y():e>50?J():I.current&&(I.current.style.transform=K(A)),R.current=null,z.current=0},re=typeof x==`number`?`${x}px`:x,ie={display:`flex`,flexDirection:V?`column`:`row`,width:V?`100%`:`${W/m*100}%`,height:V?`${W/m*100}%`:`100%`,transform:K(A),transition:M||!T?`transform ${H}ms cubic-bezier(0.4, 0, 0.2, 1)`:`none`,willChange:`transform`,gap:h>0?h:void 0},ae={flexShrink:0,width:V?`100%`:`${G/(W/m)}%`,height:V?`${G/(W/m)}%`:`100%`,overflow:`hidden`,position:`relative`},Q=l||O>0,oe=l||O<D-1,se=b===`outside`;return(0,s.jsxs)(`div`,{id:E,className:n.t(n.a(`flex flex-col gap-2`),S),style:C,"aria-roledescription":`carousel`,"aria-label":`Content carousel`,children:[(0,s.jsxs)(`div`,{className:n.a(`flex items-center gap-2`),style:{gap:se&&u?8:0},children:[u&&se&&(0,s.jsx)(er,{direction:`prev`,onClick:J,isDisabled:!Q,primaryColor:w.primary,position:`outside`,orientation:p}),(0,s.jsxs)(`div`,{style:{position:`relative`,flex:1,overflow:`hidden`,height:re,borderRadius:12,cursor:_?B.current?`grabbing`:`grab`:`default`,userSelect:`none`},onMouseEnter:()=>c&&F(!0),onMouseLeave:()=>{F(!1),ne()},onTouchStart:Z,onTouchMove:te,onTouchEnd:ne,onMouseDown:Z,onMouseMove:te,onMouseUp:ne,"aria-live":`polite`,"aria-atomic":`false`,children:[u&&!se&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(er,{direction:`prev`,onClick:J,isDisabled:!Q,primaryColor:w.primary,position:`inside`,orientation:p}),(0,s.jsx)(er,{direction:`next`,onClick:Y,isDisabled:!oe,primaryColor:w.primary,position:`inside`,orientation:p})]}),(0,s.jsx)(`div`,{ref:I,style:ie,onTransitionEnd:ee,children:U.map((e,t)=>(0,s.jsx)(`div`,{style:ae,role:`group`,"aria-roledescription":`slide`,"aria-label":`Slide ${(t-+!!l+D)%D+1} of ${D}`,"aria-hidden":(t-+!!l+D)%D!==O,children:e.content},`${e.id}-${t}`))}),d&&!f&&(0,s.jsx)(`div`,{"aria-label":`Slide indicators`,style:{position:`absolute`,bottom:12,left:`50%`,transform:`translateX(-50%)`,display:`flex`,gap:6,zIndex:2},children:e.map((e,t)=>(0,s.jsx)(`button`,{type:`button`,"aria-label":`Go to slide ${t+1}`,"aria-current":t===O?`true`:void 0,onClick:()=>q(t),style:{width:t===O?20:8,height:8,borderRadius:9999,border:`none`,backgroundColor:t===O?w.primary:`rgba(255,255,255,0.5)`,cursor:`pointer`,padding:0,transition:`width 250ms ease, background 250ms ease`,outline:`none`},onFocus:e=>{e.currentTarget.style.boxShadow=`0 0 0 3px ${w.primary}66`},onBlur:e=>{e.currentTarget.style.boxShadow=`none`}},e.id))})]}),u&&se&&(0,s.jsx)(er,{direction:`next`,onClick:Y,isDisabled:!oe,primaryColor:w.primary,position:`outside`,orientation:p})]}),f&&(0,s.jsx)(`div`,{role:`tablist`,"aria-label":`Slide thumbnails`,style:{display:`flex`,gap:6,overflowX:`auto`,paddingBottom:4,scrollbarWidth:`thin`},children:e.map((e,t)=>(0,s.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":t===O,"aria-label":`Thumbnail for slide ${t+1}`,onClick:()=>q(t),style:{flexShrink:0,width:60,height:42,border:`2px solid ${t===O?w.primary:w.border}`,borderRadius:6,overflow:`hidden`,cursor:`pointer`,padding:0,background:w.surfaceAlt,transition:`border-color 150ms ease`,outline:`none`,position:`relative`},onFocus:e=>{e.currentTarget.style.boxShadow=`0 0 0 3px ${w.primary}55`},onBlur:e=>{e.currentTarget.style.boxShadow=`none`},children:[e.thumbnail?(0,s.jsx)(`img`,{src:e.thumbnail,alt:``,"aria-hidden":`true`,style:{width:`100%`,height:`100%`,objectFit:`cover`,display:`block`}}):(0,s.jsx)(`div`,{style:{width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:`0.625rem`,color:w.textMuted,fontWeight:600},children:t+1}),t===O&&(0,s.jsx)(`div`,{"aria-hidden":`true`,style:{position:`absolute`,inset:0,backgroundColor:`${w.primary}22`}})]},e.id))})]})}tr.displayName=`TkxCarousel`;function nr({color:e}){return(0,s.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,style:{flexShrink:0},children:(0,s.jsx)(`path`,{d:`M6 3l5 5-5 5`,stroke:e,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function rr({onClick:e,bgColor:t,hoverColor:r,textColor:i}){return(0,s.jsx)(`button`,{type:`button`,onClick:e,onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),e())},"aria-label":`Show hidden breadcrumb items`,className:n.a(`inline-flex items-center justify-center rounded px-1.5 py-0.5`,`text-sm font-medium cursor-pointer border-none outline-none`,`focus-visible:ring-2 focus-visible:ring-offset-1`),style:{backgroundColor:t,color:i,transition:`background-color 150ms ease`},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=r},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=t},children:`…`})}function ir({items:e,separator:i,maxItems:a,onNavigate:c,className:l,style:u}){let d=t.f(),f=r.o(),p=a!==void 0&&a>1&&e.length>a,m=(0,o.useCallback)(()=>{if(!p||!a)return e.map((e,t)=>({item:e,originalIndex:t}));let t=Math.ceil((a-1)/2),n=a-1-t,r=e.slice(0,t).map((e,t)=>({item:e,originalIndex:t})),i=e.slice(e.length-n).map((t,r)=>({item:t,originalIndex:e.length-n+r}));return r.concat(i)},[e,a,p])(),h=p&&a?Math.ceil((a-1)/2):-1,g=(e,t)=>{c?.(e,t)},_=(e,t,n)=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),g(t,n))},v=f?{}:{transition:`color 150ms ease, background-color 150ms ease`},y=e=>(0,s.jsx)(`li`,{role:`presentation`,"aria-hidden":`true`,className:n.a(`flex items-center mx-1.5`),children:i??(0,s.jsx)(nr,{color:d.textMuted})},e),b=(e,t,r)=>{let i=n.m(e.label);if(r)return(0,s.jsx)(`li`,{children:(0,s.jsxs)(`span`,{"aria-current":`page`,className:n.a(`inline-flex items-center gap-1.5 text-sm font-medium`),style:{color:d.text},children:[e.icon&&(0,s.jsx)(`span`,{"aria-hidden":`true`,className:n.a(`flex-shrink-0`),children:e.icon}),i]})},`item-${t}`);let a=!!e.href,o={color:d.textMuted,textDecoration:`none`,...v},l={onMouseEnter:e=>{e.currentTarget.style.color=d.primary},onMouseLeave:e=>{e.currentTarget.style.color=d.textMuted}},u=(0,s.jsxs)(s.Fragment,{children:[e.icon&&(0,s.jsx)(`span`,{"aria-hidden":`true`,className:n.a(`flex-shrink-0`),children:e.icon}),i]});return a?(0,s.jsx)(`li`,{children:(0,s.jsx)(`a`,{href:e.href,onClick:n=>{c&&(n.preventDefault(),g(e,t))},className:n.a(`inline-flex items-center gap-1.5 text-sm rounded`,`outline-none focus-visible:ring-2 focus-visible:ring-offset-1`),style:{...o,focusRingColor:d.primary},...l,children:u})},`item-${t}`):(0,s.jsx)(`li`,{children:(0,s.jsx)(`button`,{type:`button`,onClick:()=>g(e,t),onKeyDown:n=>_(n,e,t),className:n.a(`inline-flex items-center gap-1.5 text-sm rounded`,`border-none bg-transparent cursor-pointer p-0`,`outline-none focus-visible:ring-2 focus-visible:ring-offset-1`),style:o,...l,children:u})},`item-${t}`)},x=[],S=!1;for(let t=0;t<m.length;t++){let{item:n,originalIndex:r}=m[t],i=r===e.length-1;p&&!S&&t===h&&(x.length>0&&x.push(y(`sep-ellipsis-before`)),x.push((0,s.jsx)(`li`,{role:`presentation`,children:(0,s.jsx)(rr,{onClick:()=>{},bgColor:d.surfaceAlt,hoverColor:d.surface,textColor:d.textMuted})},`ellipsis`)),S=!0),x.length>0&&x[x.length-1]!==null&&x.push(y(`sep-${r}`)),x.push(b(n,r,i))}return(0,s.jsx)(`nav`,{"aria-label":`Breadcrumb`,className:n.a(`font-sans`,l??``),style:{...u},children:(0,s.jsx)(`ol`,{role:`list`,className:n.a(`flex items-center flex-wrap list-none m-0 p-0`),children:x})})}var ar=8,or=8;function sr(e,t,n){let r=t.getBoundingClientRect(),i=window.scrollX,a=window.scrollY,o=window.innerWidth,s=window.innerHeight,c=0,l=0,u=n,d={top:e.top-r.height-or-ar>0,bottom:e.bottom+r.height+or+ar<s,left:e.left-r.width-or-ar>0,right:e.right+r.width+or+ar<o};if(!d[n]){let e={top:`bottom`,bottom:`top`,left:`right`,right:`left`};d[e[n]]&&(u=e[n])}switch(u){case`top`:c=e.top+a-r.height-or-ar,l=e.left+i+e.width/2-r.width/2;break;case`bottom`:c=e.bottom+a+or+ar,l=e.left+i+e.width/2-r.width/2;break;case`left`:c=e.top+a+e.height/2-r.height/2,l=e.left+i-r.width-or-ar;break;case`right`:c=e.top+a+e.height/2-r.height/2,l=e.right+i+or+ar;break}l=Math.max(8,Math.min(l,o+i-r.width-8)),c=Math.max(8,Math.min(c,s+a-r.height-8));let f={position:`absolute`,width:0,height:0,borderStyle:`solid`,borderWidth:ar};switch(u){case`top`:Object.assign(f,{bottom:-ar*2,left:`50%`,transform:`translateX(-50%)`,borderColor:`var(--tkx-popover-bg) transparent transparent transparent`});break;case`bottom`:Object.assign(f,{top:-ar*2,left:`50%`,transform:`translateX(-50%)`,borderColor:`transparent transparent var(--tkx-popover-bg) transparent`});break;case`left`:Object.assign(f,{right:-ar*2,top:`50%`,transform:`translateY(-50%)`,borderColor:`transparent transparent transparent var(--tkx-popover-bg)`});break;case`right`:Object.assign(f,{left:-ar*2,top:`50%`,transform:`translateY(-50%)`,borderColor:`transparent var(--tkx-popover-bg) transparent transparent`});break}return{top:c,left:l,arrowStyle:f,resolvedPlacement:u}}function cr({trigger:e,content:i,placement:a=`bottom`,isOpen:l,onOpenChange:u,closeOnClickOutside:d=!0,className:f,style:p}){let m=t.f(),h=r.o(),g=(0,o.useId)(),_=l!==void 0,[v,y]=(0,o.useState)(!1),b=_?l:v,x=(0,o.useRef)(null),S=(0,o.useRef)(null);(0,o.useRef)(null);let[C,w]=(0,o.useState)(null),T=(0,o.useCallback)(e=>{_||y(e),u?.(e)},[_,u]),E=(0,o.useCallback)(()=>T(!1),[T]),D=(0,o.useCallback)(()=>T(!b),[T,b]);r.r(E,b),(0,o.useEffect)(()=>{if(!b||!d)return;let e=e=>{let t=e.target;x.current?.contains(t)||S.current?.contains(t)||E()};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[b,d,E]),(0,o.useEffect)(()=>{if(!b||!x.current)return;let e=()=>{!x.current||!S.current||w(sr(x.current.getBoundingClientRect(),S.current,a))};return requestAnimationFrame(e),window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e)}},[b,a]);let O=h?{opacity:1}:{animation:`tkxPopoverFadeIn 150ms ease forwards`,opacity:0},k=b&&typeof document<`u`?(0,c.createPortal)((0,s.jsxs)(`div`,{ref:S,id:g,role:`dialog`,"aria-modal":`false`,className:n.a(`absolute z-[9100] rounded-lg font-sans`,f??``),style:{"--tkx-popover-bg":m.surface,top:C?.top??-9999,left:C?.left??-9999,backgroundColor:m.surface,border:`1px solid ${m.border}`,boxShadow:`0 8px 24px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.1)`,minWidth:200,maxWidth:420,padding:`12px 16px`,color:m.text,...O,...p},children:[C&&(0,s.jsx)(`span`,{style:C.arrowStyle,"aria-hidden":`true`}),i]}),document.body):null;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`div`,{ref:x,className:n.a(`inline-flex`),onClick:D,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),D())},"aria-expanded":b,"aria-haspopup":`dialog`,"aria-controls":b?g:void 0,children:e}),k,b&&!h&&(0,s.jsx)(`style`,{children:`
68
- @keyframes tkxPopoverFadeIn {
69
- from { opacity: 0; transform: translateY(4px); }
70
- to { opacity: 1; transform: translateY(0); }
71
- }
72
- `})]})}function lr(e,t){if(!t)return!0;let n=t.toLowerCase(),r=e.label.toLowerCase(),i=0;for(let e=0;e<r.length&&i<n.length;e++)r[e]===n[i]&&i++;return i===n.length}function ur(e,t){let n=e.getBoundingClientRect(),r=window.innerHeight-n.bottom,i=n.top,a=r>=t+4||r>=i?`below`:`above`;return{top:a===`below`?n.bottom+window.scrollY+4:n.top+window.scrollY-t-4,left:n.left+window.scrollX,width:n.width,placement:a}}function dr({color:e}){return(0,s.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,style:{animation:`spin 0.8s linear infinite`,flexShrink:0},children:[(0,s.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6`,stroke:e,strokeWidth:`2`,opacity:`0.3`}),(0,s.jsx)(`path`,{d:`M14 8a6 6 0 00-6-6`,stroke:e,strokeWidth:`2`,strokeLinecap:`round`})]})}var fr=280;function pr({options:e,value:i,onChange:a,onInputChange:l,placeholder:u=``,label:d,isLoading:f=!1,emptyMessage:p=`No results found`,filterFn:m,freeSolo:h=!1,className:g,style:_}){let v=t.f(),y=r.o(),b=(0,o.useId)(),x=(0,o.useId)(),S=(0,o.useRef)(null),C=(0,o.useRef)(null),[w,T]=(0,o.useState)(``),[E,D]=(0,o.useState)(!1),[O,k]=(0,o.useState)(-1),[A,j]=(0,o.useState)(null);(0,o.useEffect)(()=>{if(i!==void 0){let t=e.find(e=>e.value===i);T(t?t.label:i)}},[i,e]);let M=m??lr,N=(0,o.useMemo)(()=>E?e.filter(e=>M(e,w)):[],[e,w,E,M]),P=n.m(d),F=n.m(p);(0,o.useEffect)(()=>{if(!E||!C.current)return;let e=()=>{C.current&&j(ur(C.current,fr))};return e(),window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e)}},[E]),(0,o.useEffect)(()=>{if(!E)return;let e=e=>{let t=e.target;C.current?.contains(t)||document.getElementById(x)?.contains(t)||D(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[E,x]),r.r(()=>D(!1),E);let I=(0,o.useCallback)(e=>{e.disabled||(T(e.label),a?.(e.value),D(!1),k(-1),S.current?.focus())},[a]),L=e=>{let t=e.target.value;T(t),l?.(t),E||D(!0),k(-1),h&&a?.(t)},R=e=>{if(!E&&(e.key===`ArrowDown`||e.key===`ArrowUp`)){D(!0);return}switch(e.key){case`ArrowDown`:e.preventDefault(),k(e=>{let t=e+1;for(;t<N.length&&N[t].disabled;)t++;return t<N.length?t:e});break;case`ArrowUp`:e.preventDefault(),k(e=>{let t=e-1;for(;t>=0&&N[t].disabled;)t--;return t>=0?t:e});break;case`Enter`:e.preventDefault(),O>=0&&O<N.length?I(N[O]):h&&w&&(a?.(w),D(!1));break;case`Escape`:D(!1),k(-1);break}};(0,o.useEffect)(()=>{if(O<0)return;let e=`${x}-opt-${O}`;document.getElementById(e)?.scrollIntoView({block:`nearest`})},[O,x]);let z=O>=0?`${x}-opt-${O}`:void 0,B=y?{}:{animation:`tkxAutoFadeIn 120ms ease forwards`},V=E&&typeof document<`u`&&A?(0,c.createPortal)((0,s.jsx)(`ul`,{id:x,role:`listbox`,"aria-label":P,className:n.a(`absolute z-[9200] list-none m-0 p-1 rounded-lg overflow-y-auto font-sans`),style:{top:A.top,left:A.left,width:A.width,maxHeight:fr,backgroundColor:v.surface,border:`1px solid ${v.border}`,boxShadow:`0 8px 24px rgba(0,0,0,0.15)`,...B},children:f?(0,s.jsxs)(`li`,{role:`option`,"aria-selected":!1,"aria-disabled":`true`,className:n.a(`flex items-center gap-2 px-3 py-2 text-sm`),style:{color:v.textMuted},children:[(0,s.jsx)(dr,{color:v.primary}),`Loading...`]}):N.length===0?(0,s.jsx)(`li`,{role:`option`,"aria-selected":!1,"aria-disabled":`true`,className:n.a(`px-3 py-2 text-sm text-center`),style:{color:v.textMuted},children:F}):N.map((e,t)=>{let r=t===O,a=n.m(e.label),o=e.description?n.m(e.description):null;return(0,s.jsxs)(`li`,{id:`${x}-opt-${t}`,role:`option`,"aria-selected":e.value===i,"aria-disabled":e.disabled||void 0,className:n.a(`flex items-center gap-2 px-3 py-2 text-sm rounded-md cursor-pointer`,e.disabled?`opacity-50 cursor-not-allowed`:``),style:{backgroundColor:r?v.surfaceAlt:`transparent`,color:e.disabled?v.textMuted:v.text,transition:y?`none`:`background-color 100ms ease`},onMouseEnter:()=>!e.disabled&&k(t),onMouseDown:t=>{t.preventDefault(),I(e)},children:[e.icon&&(0,s.jsx)(`span`,{"aria-hidden":`true`,className:n.a(`flex-shrink-0`),children:e.icon}),(0,s.jsxs)(`span`,{className:n.a(`flex flex-col min-w-0`),children:[(0,s.jsx)(`span`,{className:n.a(`truncate`),children:a}),o&&(0,s.jsx)(`span`,{className:n.a(`text-xs truncate`),style:{color:v.textMuted},children:o})]}),e.value===i&&(0,s.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,className:n.a(`ml-auto flex-shrink-0`),children:(0,s.jsx)(`path`,{d:`M3 8l3.5 3.5L13 5`,stroke:v.primary,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})]},e.value)})}),document.body):null;return(0,s.jsxs)(`div`,{ref:C,className:n.a(`relative font-sans`,g??``),style:_,children:[(0,s.jsx)(`label`,{htmlFor:b,className:n.a(`block text-sm font-medium mb-1.5`),style:{color:v.text},children:P}),(0,s.jsxs)(`div`,{className:n.a(`relative flex items-center`),style:{backgroundColor:v.surface,border:`1px solid ${E?v.primary:v.border}`,borderRadius:8,transition:y?`none`:`border-color 150ms ease`},children:[(0,s.jsx)(`input`,{ref:S,id:b,type:`text`,role:`combobox`,"aria-expanded":E,"aria-controls":x,"aria-activedescendant":z,"aria-autocomplete":`list`,"aria-label":P,value:w,placeholder:u,onChange:L,onFocus:()=>D(!0),onKeyDown:R,className:n.a(`w-full bg-transparent border-none outline-none text-sm py-2.5 px-3`,`placeholder:opacity-50`),style:{color:v.text}}),f&&(0,s.jsx)(`span`,{className:n.a(`pr-3`),children:(0,s.jsx)(dr,{color:v.primary})})]}),V,E&&!y&&(0,s.jsx)(`style`,{children:`
73
- @keyframes tkxAutoFadeIn {
74
- from { opacity: 0; transform: translateY(4px); }
75
- to { opacity: 1; transform: translateY(0); }
76
- }
77
- `})]})}function mr(e,t){let n=[];function r(e,i){for(let a of e)n.push({node:a,depth:i}),a.children?.length&&t.has(a.id)&&r(a.children,i+1)}return r(e,0),n}function hr({expanded:e,color:t,reducedMotion:n}){return(0,s.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,style:{transform:e?`rotate(90deg)`:`rotate(0deg)`,transition:n?`none`:`transform 150ms ease`,flexShrink:0},children:(0,s.jsx)(`path`,{d:`M6 3l5 5-5 5`,stroke:t,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function gr({checked:e,color:t,borderColor:r}){return(0,s.jsx)(`span`,{role:`presentation`,"aria-hidden":`true`,className:n.a(`inline-flex items-center justify-center flex-shrink-0`),style:{width:16,height:16,borderRadius:3,border:`1.5px solid ${e?t:r}`,backgroundColor:e?t:`transparent`,transition:`all 100ms ease`},children:e&&(0,s.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 10 10`,fill:`none`,children:(0,s.jsx)(`path`,{d:`M2 5l2.5 2.5L8 3`,stroke:`#fff`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})})}var _r=24;function vr({data:e,selected:i,onSelect:a,expanded:c,onExpand:l,multiSelect:u=!1,showCheckboxes:d=!1,showLines:f=!1,className:p,style:m}){let h=t.f(),g=r.o();(0,o.useId)();let[_,v]=(0,o.useState)([]),[y,b]=(0,o.useState)([]),x=new Set(i??_),S=new Set(c??y),C=(0,o.useCallback)(e=>{c===void 0&&b(e),l?.(e)},[c,l]),w=(0,o.useCallback)(e=>{i===void 0&&v(e),a?.(e)},[i,a]),T=(0,o.useCallback)(e=>{let t=Array.from(S);S.has(e)?C(t.filter(t=>t!==e)):C([...t,e])},[S,C]),E=(0,o.useCallback)(e=>{if(u){let t=Array.from(x);x.has(e)?w(t.filter(t=>t!==e)):w([...t,e])}else w(x.has(e)?[]:[e])},[u,x,w]),D=mr(e,S),O=(0,o.useRef)(0),k=(0,o.useRef)(new Map),A=e=>{O.current=e,k.current.get(e)?.focus()},j=(e,t)=>{for(let n of t){if(n.id===e)return n;if(n.children){let t=j(e,n.children);if(t)return t}}},M=(e,t)=>{let n=D[t];if(!n)return;let{node:r}=n,i=(r.children?.length??0)>0;switch(e.key){case`ArrowDown`:e.preventDefault(),t<D.length-1&&A(t+1);break;case`ArrowUp`:e.preventDefault(),t>0&&A(t-1);break;case`ArrowRight`:e.preventDefault(),i&&!S.has(r.id)?T(r.id):i&&S.has(r.id)&&t<D.length-1&&A(t+1);break;case`ArrowLeft`:if(e.preventDefault(),i&&S.has(r.id))T(r.id);else for(let e=t-1;e>=0;e--)if(D[e].depth<n.depth){A(e);break}break;case`Enter`:case` `:e.preventDefault(),r.disabled||E(r.id);break;case`Home`:e.preventDefault(),A(0);break;case`End`:e.preventDefault(),A(D.length-1);break}};return(0,s.jsx)(`ul`,{role:`tree`,"aria-label":`Tree view`,"aria-multiselectable":u||void 0,className:n.a(`list-none m-0 p-0 font-sans select-none`,p??``),style:{color:h.text,...m},children:D.map(({node:e,depth:t},r)=>{let i=(e.children?.length??0)>0,a=S.has(e.id),o=x.has(e.id),c=n.m(e.label);return(0,s.jsxs)(`li`,{role:`treeitem`,"aria-selected":o,"aria-expanded":i?a:void 0,"aria-disabled":e.disabled||void 0,"aria-level":t+1,"aria-setsize":D.filter(e=>e.depth===t).length,tabIndex:r===0?0:-1,ref:e=>{e?k.current.set(r,e):k.current.delete(r)},onKeyDown:e=>M(e,r),onClick:()=>{e.disabled||(i&&T(e.id),E(e.id))},className:n.a(`relative flex items-center gap-1.5 py-1 px-2 rounded-md cursor-pointer`,`outline-none focus-visible:ring-2 focus-visible:ring-offset-1`,e.disabled?`opacity-50 cursor-not-allowed`:``),style:{paddingLeft:t*_r+8,backgroundColor:o?`${h.primary}18`:`transparent`,transition:g?`none`:`background-color 100ms ease`,minHeight:32},onMouseEnter:t=>{!o&&!e.disabled&&(t.currentTarget.style.backgroundColor=h.surfaceAlt)},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=o?`${h.primary}18`:`transparent`},children:[f&&t>0&&(0,s.jsx)(`span`,{"aria-hidden":`true`,style:{position:`absolute`,left:(t-1)*_r+16,top:0,bottom:0,width:1,backgroundColor:h.border}}),i?(0,s.jsx)(`span`,{role:`presentation`,onClick:t=>{t.stopPropagation(),T(e.id)},className:n.a(`inline-flex items-center justify-center cursor-pointer`),style:{width:20,height:20},children:(0,s.jsx)(hr,{expanded:a,color:h.textMuted,reducedMotion:g})}):(0,s.jsx)(`span`,{style:{width:20,height:20},"aria-hidden":`true`}),d&&(0,s.jsx)(gr,{checked:o,color:h.primary,borderColor:h.border}),e.icon&&(0,s.jsx)(`span`,{"aria-hidden":`true`,className:n.a(`flex-shrink-0`),children:e.icon}),(0,s.jsx)(`span`,{className:n.a(`text-sm truncate`),style:{color:e.disabled?h.textMuted:h.text},children:c})]},e.id)})})}var yr={sm:{buttonPx:6,buttonPy:4,fontSize:12,iconSize:14,gap:2,separatorSize:16},md:{buttonPx:8,buttonPy:6,fontSize:13,iconSize:16,gap:4,separatorSize:20},lg:{buttonPx:12,buttonPy:8,fontSize:14,iconSize:18,gap:6,separatorSize:24}};function br({items:e,orientation:i=`horizontal`,size:a=`md`,variant:c=`default`,ariaLabel:l=`Toolbar`,className:u,style:d}){let f=t.f(),p=r.o(),m=yr[a],h=i===`horizontal`,g=(0,o.useRef)(new Map),_=e.filter(e=>e.type!==`separator`&&!e.disabled).map(e=>e.id),v=(0,o.useCallback)(e=>{g.current.get(e)?.focus()},[]),y=(0,o.useCallback)((e,t)=>{let n=_.indexOf(t);if(n<0)return;let r=h?`ArrowRight`:`ArrowDown`,i=h?`ArrowLeft`:`ArrowUp`;switch(e.key){case r:e.preventDefault(),v(_[n+1<_.length?n+1:0]);break;case i:e.preventDefault(),v(_[n-1>=0?n-1:_.length-1]);break;case`Home`:e.preventDefault(),v(_[0]);break;case`End`:e.preventDefault(),v(_[_.length-1]);break}},[_,v,h]),b=()=>{switch(c){case`outlined`:return{backgroundColor:`transparent`,border:`1px solid ${f.border}`};case`filled`:return{backgroundColor:f.surfaceAlt,border:`none`};default:return{backgroundColor:f.surface,border:`1px solid ${f.border}`}}},x=e=>{e.type;let t=e.active;return{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,gap:4,padding:`${m.buttonPy}px ${m.buttonPx}px`,fontSize:m.fontSize,borderRadius:6,border:`none`,cursor:e.disabled?`not-allowed`:`pointer`,backgroundColor:t?`${f.primary}20`:`transparent`,color:t?f.primary:e.disabled?f.textMuted:f.text,opacity:e.disabled?.5:1,outline:`none`,transition:p?`none`:`all 100ms ease`,whiteSpace:`nowrap`,lineHeight:1}};return(0,s.jsx)(`div`,{role:`toolbar`,"aria-label":l,"aria-orientation":i,className:n.a(`inline-flex items-center rounded-lg font-sans`,h?`flex-row`:`flex-col`,u??``),style:{...b(),padding:m.gap,gap:m.gap,...d},children:e.map((e,t)=>{if(e.type===`separator`)return(0,s.jsx)(`div`,{role:`separator`,"aria-orientation":h?`vertical`:`horizontal`,className:n.a(`flex-shrink-0`),style:{...h?{width:1,height:m.separatorSize,marginLeft:2,marginRight:2}:{height:1,width:m.separatorSize,marginTop:2,marginBottom:2},backgroundColor:f.border}},e.id);let r=n.m(e.label),i=!e.disabled,a=_[0]===e.id;return(0,s.jsxs)(`button`,{ref:t=>{t?g.current.set(e.id,t):g.current.delete(e.id)},type:`button`,role:(e.type,void 0),"aria-pressed":e.type===`toggle`?e.active:void 0,"aria-label":r,"aria-disabled":e.disabled||void 0,tabIndex:i&&a?0:-1,disabled:e.disabled,onClick:()=>{e.disabled||e.onClick?.()},onKeyDown:t=>{y(t,e.id),(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),e.disabled||e.onClick?.())},className:n.a(`focus-visible:ring-2 focus-visible:ring-offset-1`),style:x(e),onMouseEnter:t=>{!e.disabled&&!e.active&&(t.currentTarget.style.backgroundColor=f.surfaceAlt)},onMouseLeave:t=>{e.disabled||(t.currentTarget.style.backgroundColor=e.active?`${f.primary}20`:`transparent`)},children:[e.icon&&(0,s.jsx)(`span`,{"aria-hidden":`true`,style:{width:m.iconSize,height:m.iconSize,display:`flex`,alignItems:`center`,justifyContent:`center`},children:e.icon}),!e.icon&&r]},e.id)})})}function xr({color:e}){return(0,s.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 14 14`,fill:`none`,"aria-hidden":`true`,children:[(0,s.jsx)(`circle`,{cx:`6`,cy:`6`,r:`4.5`,stroke:e,strokeWidth:`1.5`}),(0,s.jsx)(`path`,{d:`M9.5 9.5L13 13`,stroke:e,strokeWidth:`1.5`,strokeLinecap:`round`})]})}function Sr({checked:e,primaryColor:t,borderColor:r}){return(0,s.jsx)(`span`,{"aria-hidden":`true`,className:n.a(`inline-flex items-center justify-center flex-shrink-0`),style:{width:16,height:16,borderRadius:3,border:`1.5px solid ${e?t:r}`,backgroundColor:e?t:`transparent`,transition:`all 100ms ease`},children:e&&(0,s.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 10 10`,fill:`none`,children:(0,s.jsx)(`path`,{d:`M2 5l2.5 2.5L8 3`,stroke:`#fff`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})})}function Cr({color:e}){return(0,s.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M3 8h10M9 4l4 4-4 4`,stroke:e,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function wr({color:e}){return(0,s.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M13 8H3M7 4l-4 4 4 4`,stroke:e,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})}function Tr({title:e,items:i,selected:a,onToggle:c,onToggleAll:l,search:u,onSearchChange:d,searchable:f,height:p,listId:m}){let h=t.f(),g=r.o(),_=n.m(e),v=(0,o.useMemo)(()=>{if(!u)return i;let e=u.toLowerCase();return i.filter(t=>t.label.toLowerCase().includes(e))},[i,u]),y=v.filter(e=>!e.disabled),b=y.length>0&&y.every(e=>a.has(e.value));y.some(e=>a.has(e.value));let x=(e,t)=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),c(t))};return(0,s.jsxs)(`div`,{className:n.a(`flex flex-col rounded-lg overflow-hidden flex-1 min-w-0`),style:{border:`1px solid ${h.border}`,backgroundColor:h.surface},children:[(0,s.jsxs)(`div`,{className:n.a(`flex items-center gap-2 px-3 py-2 border-b`),style:{borderColor:h.border,backgroundColor:h.surfaceAlt},children:[(0,s.jsx)(`button`,{type:`button`,"aria-label":b?`Deselect all ${_}`:`Select all ${_}`,onClick:l,className:n.a(`border-none bg-transparent cursor-pointer p-0 outline-none focus-visible:ring-2`),children:(0,s.jsx)(Sr,{checked:b,primaryColor:h.primary,borderColor:h.border})}),(0,s.jsx)(`span`,{className:n.a(`text-sm font-medium flex-1 truncate`),style:{color:h.text},children:_}),(0,s.jsxs)(`span`,{className:n.a(`text-xs`),style:{color:h.textMuted},children:[a.size,`/`,i.length]})]}),f&&(0,s.jsxs)(`div`,{className:n.a(`flex items-center gap-1.5 px-3 py-1.5 border-b`),style:{borderColor:h.border},children:[(0,s.jsx)(xr,{color:h.textMuted}),(0,s.jsx)(`input`,{type:`text`,"aria-label":`Search ${_}`,value:u,onChange:e=>d(e.target.value),placeholder:`Search...`,className:n.a(`flex-1 bg-transparent border-none outline-none text-xs`),style:{color:h.text}})]}),(0,s.jsx)(`ul`,{id:m,role:`listbox`,"aria-label":_,"aria-multiselectable":`true`,className:n.a(`list-none m-0 p-1 overflow-y-auto`),style:{height:p,minHeight:100},children:v.length===0?(0,s.jsx)(`li`,{className:n.a(`text-xs text-center py-4`),style:{color:h.textMuted},"aria-disabled":`true`,children:`No items`}):v.map(e=>{let t=a.has(e.value),r=n.m(e.label);return(0,s.jsxs)(`li`,{role:`option`,"aria-selected":t,"aria-disabled":e.disabled||void 0,tabIndex:0,onClick:()=>!e.disabled&&c(e.value),onKeyDown:t=>!e.disabled&&x(t,e.value),className:n.a(`flex items-center gap-2 px-2 py-1.5 rounded-md cursor-pointer text-sm`,`outline-none focus-visible:ring-2 focus-visible:ring-offset-1`,e.disabled?`opacity-50 cursor-not-allowed`:``),style:{color:e.disabled?h.textMuted:h.text,backgroundColor:t?`${h.primary}10`:`transparent`,transition:g?`none`:`background-color 100ms ease`},onMouseEnter:n=>{!e.disabled&&!t&&(n.currentTarget.style.backgroundColor=h.surfaceAlt)},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=t?`${h.primary}10`:`transparent`},children:[(0,s.jsx)(Sr,{checked:t,primaryColor:h.primary,borderColor:h.border}),(0,s.jsx)(`span`,{className:n.a(`truncate`),children:r})]},e.value)})})]})}function Er({sourceItems:e,targetItems:i,onTransfer:a,sourceTitle:c=`Available`,targetTitle:l=`Selected`,searchable:u=!1,height:d=300,className:f,style:p}){let m=t.f(),h=r.o(),g=(0,o.useId)(),_=(0,o.useId)(),[v,y]=(0,o.useState)(new Set),[b,x]=(0,o.useState)(new Set),[S,C]=(0,o.useState)(``),[w,T]=(0,o.useState)(``),E=(0,o.useCallback)(e=>{y(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),D=(0,o.useCallback)(e=>{x(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),O=(0,o.useCallback)(()=>{let t=e.filter(e=>!e.disabled).map(e=>e.value);t.every(e=>v.has(e))?y(new Set):y(new Set(t))},[e,v]),k=(0,o.useCallback)(()=>{let e=i.filter(e=>!e.disabled).map(e=>e.value);e.every(e=>b.has(e))?x(new Set):x(new Set(e))},[i,b]),A=(0,o.useCallback)(()=>{if(v.size===0)return;let t=e.filter(e=>v.has(e.value)&&!e.disabled);a(e.filter(e=>!v.has(e.value)||e.disabled),[...i,...t]),y(new Set)},[e,i,v,a]),j=(0,o.useCallback)(()=>{if(b.size===0)return;let t=i.filter(e=>b.has(e.value)&&!e.disabled),n=i.filter(e=>!b.has(e.value)||e.disabled);a([...e,...t],n),x(new Set)},[e,i,b,a]),M=e=>({display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:36,height:36,borderRadius:8,border:`1px solid ${m.border}`,backgroundColor:e?m.surface:m.surfaceAlt,cursor:e?`not-allowed`:`pointer`,opacity:e?.5:1,transition:h?`none`:`all 100ms ease`,outline:`none`});return(0,s.jsxs)(`div`,{className:n.a(`flex gap-3 font-sans`,`flex-col sm:flex-row`,f??``),style:{color:m.text,...p},children:[(0,s.jsx)(Tr,{title:c,items:e,selected:v,onToggle:E,onToggleAll:O,search:S,onSearchChange:C,searchable:u,height:d,listId:g}),(0,s.jsxs)(`div`,{className:n.a(`flex items-center justify-center gap-2`,`flex-row sm:flex-col`),style:{padding:`8px 0`},children:[(0,s.jsx)(`button`,{type:`button`,"aria-label":`Move selected items to target list`,disabled:v.size===0,onClick:A,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),A())},className:n.a(`focus-visible:ring-2 focus-visible:ring-offset-1`),style:M(v.size===0),onMouseEnter:e=>{v.size>0&&(e.currentTarget.style.backgroundColor=m.primary,e.currentTarget.style.borderColor=m.primary)},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=v.size===0?m.surface:m.surfaceAlt,e.currentTarget.style.borderColor=m.border},children:(0,s.jsx)(Cr,{color:m.text})}),(0,s.jsx)(`button`,{type:`button`,"aria-label":`Move selected items to source list`,disabled:b.size===0,onClick:j,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),j())},className:n.a(`focus-visible:ring-2 focus-visible:ring-offset-1`),style:M(b.size===0),onMouseEnter:e=>{b.size>0&&(e.currentTarget.style.backgroundColor=m.primary,e.currentTarget.style.borderColor=m.primary)},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=b.size===0?m.surface:m.surfaceAlt,e.currentTarget.style.borderColor=m.border},children:(0,s.jsx)(wr,{color:m.text})})]}),(0,s.jsx)(Tr,{title:l,items:i,selected:b,onToggle:D,onToggleAll:k,search:w,onSearchChange:T,searchable:u,height:d,listId:_})]})}function Dr({color:e,rotated:t,reducedMotion:n}){return(0,s.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,"aria-hidden":`true`,style:{transform:t?`rotate(45deg)`:`rotate(0deg)`,transition:n?`none`:`transform 200ms ease`},children:(0,s.jsx)(`path`,{d:`M12 5v14M5 12h14`,stroke:e,strokeWidth:`2.5`,strokeLinecap:`round`})})}var Or={"bottom-right":{bottom:24,right:24},"bottom-left":{bottom:24,left:24},"top-right":{top:24,right:24},"top-left":{top:24,left:24}};function kr(e,t,n){let r=(t+1)*n;switch(e){case`up`:return{bottom:r,left:`50%`,transform:`translateX(-50%)`};case`down`:return{top:r,left:`50%`,transform:`translateX(-50%)`};case`left`:return{right:r,top:`50%`,transform:`translateY(-50%)`};case`right`:return{left:r,top:`50%`,transform:`translateY(-50%)`}}}function Ar(e){switch(e){case`up`:case`down`:return{right:`100%`,top:`50%`,transform:`translateY(-50%)`,marginRight:10};case`left`:return{bottom:`100%`,left:`50%`,transform:`translateX(-50%)`,marginBottom:10};case`right`:return{bottom:`100%`,left:`50%`,transform:`translateX(-50%)`,marginBottom:10}}}var jr=56,Mr=48,Nr=64;function Pr({actions:e,icon:i,direction:a=`up`,position:l=`bottom-right`,className:u,style:d}){let f=t.f(),p=r.o(),m=(0,o.useId)(),[h,g]=(0,o.useState)(!1),[_,v]=(0,o.useState)(-1),y=(0,o.useRef)(null),b=(0,o.useRef)(new Map),x=(0,o.useCallback)(()=>{g(e=>!e),v(-1)},[]),S=(0,o.useCallback)(()=>{g(!1),v(-1)},[]);r.r(S,h),(0,o.useEffect)(()=>{if(!h)return;let e=e=>{y.current?.contains(e.target)||S()};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[h,S]),(0,o.useEffect)(()=>{_>=0&&b.current.get(_)?.focus()},[_]);let C=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),x()),h&&((e.key===`ArrowUp`||e.key===`ArrowLeft`)&&(e.preventDefault(),v(0)),(e.key===`ArrowDown`||e.key===`ArrowRight`)&&(e.preventDefault(),v(0)))},w=(t,n)=>{switch(t.key){case`ArrowUp`:case`ArrowLeft`:t.preventDefault(),v(n>0?n-1:e.length-1);break;case`ArrowDown`:case`ArrowRight`:t.preventDefault(),v(n<e.length-1?n+1:0);break;case`Enter`:case` `:t.preventDefault(),e[n].onClick?.(),S();break;case`Escape`:S();break;case`Home`:t.preventDefault(),v(0);break;case`End`:t.preventDefault(),v(e.length-1);break}},T=e=>p?`0ms`:`${e*40}ms`;return(0,s.jsxs)(s.Fragment,{children:[h&&typeof document<`u`&&(0,c.createPortal)((0,s.jsx)(`div`,{"aria-hidden":`true`,onClick:S,style:{position:`fixed`,inset:0,backgroundColor:`rgba(0,0,0,0.3)`,zIndex:9e3,transition:p?`none`:`opacity 200ms ease`}}),document.body),(0,s.jsxs)(`div`,{ref:y,className:n.a(`fixed z-[9100] font-sans`,u??``),style:{...Or[l],...d},children:[h&&e.map((e,t)=>{let r=n.m(e.label),i=kr(a,t,Nr),o=Ar(a);return(0,s.jsx)(`div`,{className:n.a(`absolute`),style:{...i,opacity:+!!p,animation:p?`none`:`tkxSpeedDialIn 180ms ease forwards`,animationDelay:T(t)},children:(0,s.jsxs)(`div`,{className:n.a(`relative inline-flex`),children:[(0,s.jsx)(`span`,{className:n.a(`absolute z-10 whitespace-nowrap text-xs py-1 px-2 rounded-md pointer-events-none`),style:{...o,backgroundColor:f.surfaceAlt,color:f.text,border:`1px solid ${f.border}`,boxShadow:`0 2px 8px rgba(0,0,0,0.15)`},role:`tooltip`,children:r}),(0,s.jsx)(`button`,{ref:e=>{e?b.current.set(t,e):b.current.delete(t)},type:`button`,"aria-label":r,tabIndex:h?0:-1,onClick:()=>{e.onClick?.(),S()},onKeyDown:e=>w(e,t),className:n.a(`inline-flex items-center justify-center rounded-full border-none cursor-pointer`,`outline-none focus-visible:ring-2 focus-visible:ring-offset-2`,`shadow-lg`),style:{width:Mr,height:Mr,backgroundColor:f.surface,color:f.text,border:`1px solid ${f.border}`,boxShadow:`0 4px 12px rgba(0,0,0,0.15)`,transition:p?`none`:`all 150ms ease`},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=f.surfaceAlt,e.currentTarget.style.transform=`scale(1.1)`},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=f.surface,e.currentTarget.style.transform=`scale(1)`},children:e.icon})]})},e.id)}),(0,s.jsx)(`button`,{type:`button`,"aria-label":h?`Close actions menu`:`Open actions menu`,"aria-expanded":h,"aria-controls":m,"aria-haspopup":`true`,onClick:x,onKeyDown:C,className:n.a(`inline-flex items-center justify-center rounded-full border-none cursor-pointer`,`outline-none focus-visible:ring-2 focus-visible:ring-offset-2`),style:{width:jr,height:jr,backgroundColor:f.primary,color:f.bg,boxShadow:`0 6px 20px ${f.primary}40`,transition:p?`none`:`all 200ms ease`,position:`relative`,zIndex:1},onMouseEnter:e=>{e.currentTarget.style.boxShadow=`0 8px 28px ${f.primary}60`,p||(e.currentTarget.style.transform=`scale(1.05)`)},onMouseLeave:e=>{e.currentTarget.style.boxShadow=`0 6px 20px ${f.primary}40`,e.currentTarget.style.transform=`scale(1)`},children:i??(0,s.jsx)(Dr,{color:f.bg,rotated:h,reducedMotion:p})}),(0,s.jsx)(`div`,{id:m,role:`menu`,"aria-label":`Speed dial actions`,style:{display:`none`},children:e.map(e=>(0,s.jsx)(`div`,{role:`menuitem`,children:n.m(e.label)},e.id))})]}),h&&!p&&(0,s.jsx)(`style`,{children:`
78
- @keyframes tkxSpeedDialIn {
79
- from { opacity: 0; transform: translateX(-50%) scale(0.5); }
80
- to { opacity: 1; transform: translateX(-50%) scale(1); }
81
- }
82
- `})]})}var Fr=768,Ir=56;function Lr({open:e}){return(0,s.jsx)(`svg`,{width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,"aria-hidden":`true`,children:e?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,s.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`line`,{x1:`3`,y1:`6`,x2:`21`,y2:`6`}),(0,s.jsx)(`line`,{x1:`3`,y1:`12`,x2:`21`,y2:`12`}),(0,s.jsx)(`line`,{x1:`3`,y1:`18`,x2:`21`,y2:`18`})]})})}function Rr(){let[e,t]=(0,o.useState)(()=>typeof window>`u`?!1:window.innerWidth<Fr);return(0,o.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>t(window.innerWidth<Fr);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function zr({title:e,logo:i,actions:a,navigation:c,position:l=`sticky`,variant:u=`default`,color:d=`surface`}){let f=t.f(),p=r.o(),m=Rr(),[h,g]=(0,o.useState)(!1),_=(0,o.useRef)(null),v=(0,o.useId)();r.r(()=>g(!1),h),(0,o.useEffect)(()=>{!m&&h&&g(!1)},[m,h]),(0,o.useEffect)(()=>{if(!h)return;let e=e=>{_.current&&!_.current.contains(e.target)&&g(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[h]);let y=(0,o.useCallback)(()=>{g(e=>!e)},[]),b=d===`primary`?f.primary:f.surface,x=d===`primary`?f.bg:f.text,S={default:{backgroundColor:b,borderBottom:`1px solid ${f.border}`},transparent:{backgroundColor:`transparent`,borderBottom:`none`},elevated:{backgroundColor:b,boxShadow:`0 2px 8px ${f.bg}66`,borderBottom:`none`}},C={fixed:{position:`fixed`,top:0,left:0,right:0,zIndex:1100},sticky:{position:`sticky`,top:0,zIndex:1100},static:{position:`static`}},w=typeof e==`string`?n.m(e):e,T=p?`none`:`max-height 300ms cubic-bezier(0.4,0,0.2,1), opacity 300ms ease`;return(0,s.jsxs)(`header`,{role:`banner`,className:n.a(`font-sans w-full`),style:{...C[l],...S[u],color:x,height:Ir},children:[(0,s.jsxs)(`div`,{ref:_,className:n.a(`flex items-center h-full px-4`),style:{maxWidth:1440,margin:`0 auto`},children:[i&&(0,s.jsx)(`div`,{className:n.a(`flex items-center shrink-0 mr-3`),"aria-hidden":`true`,children:i}),w&&(0,s.jsx)(`div`,{className:n.a(`text-base font-semibold shrink-0 mr-4 leading-snug`),style:{color:x},children:w}),!m&&c&&(0,s.jsx)(`nav`,{id:v,"aria-label":`Main navigation`,className:n.a(`flex items-center flex-1 gap-1`),children:c}),m&&(0,s.jsx)(`div`,{className:n.a(`flex-1`)}),a&&(0,s.jsx)(`div`,{className:n.a(`flex items-center gap-2 ml-auto shrink-0`),children:a}),m&&c&&(0,s.jsx)(`button`,{onClick:y,"aria-expanded":h,"aria-controls":v,"aria-label":h?`Close navigation menu`:`Open navigation menu`,className:n.a(`bg-transparent border-none cursor-pointer p-2 ml-2 rounded flex items-center justify-center`,`focus-visible:focus-ring`),style:{color:x},children:(0,s.jsx)(Lr,{open:h})})]}),m&&c&&(0,s.jsx)(`nav`,{id:v,"aria-label":`Main navigation`,style:{maxHeight:h?400:0,opacity:+!!h,overflow:`hidden`,transition:T,backgroundColor:f.surface,borderBottom:h?`1px solid ${f.border}`:`none`},children:(0,s.jsx)(`div`,{className:n.a(`flex flex-col gap-1 px-4 py-3`),role:`menu`,children:c})})]})}var Br=5,Vr=56,Hr=!1;function Ur(){if(Hr||typeof document>`u`)return;Hr=!0;let e=document.createElement(`style`);e.id=`tkx-bottom-nav-kf`,e.textContent=`
83
- @keyframes tkx-bottom-nav-pulse {
84
- 0% { transform: scale(1); }
85
- 50% { transform: scale(1.15); }
86
- 100% { transform: scale(1); }
87
- }
88
- `,document.head.appendChild(e)}function Wr({items:e,activeId:i,onChange:a,showLabels:c=!0}){let l=t.f(),u=r.o(),d=(0,o.useRef)(null);(0,o.useEffect)(()=>{Ur()},[]);let f=e.slice(0,Br),p=(0,o.useCallback)(e=>{a?.(e)},[a]),m=(0,o.useCallback)(e=>{let t=d.current;if(!t)return;let n=Array.from(t.querySelectorAll(`[role="tab"]`)),r=n.findIndex(e=>e===document.activeElement);if(r===-1)return;let i=r;e.key===`ArrowRight`||e.key===`ArrowDown`?(e.preventDefault(),i=(r+1)%n.length):e.key===`ArrowLeft`||e.key===`ArrowUp`?(e.preventDefault(),i=(r-1+n.length)%n.length):e.key===`Home`?(e.preventDefault(),i=0):e.key===`End`&&(e.preventDefault(),i=n.length-1),i!==r&&(n[i].focus(),p(f[i].id))},[p,f]),h=u?`none`:`color 200ms ease, transform 150ms ease`;return(0,s.jsx)(`nav`,{ref:d,role:`navigation`,"aria-label":`Bottom navigation`,className:n.a(`fixed bottom-0 left-0 right-0 z-[1000] font-sans`),style:{height:Vr,backgroundColor:l.surface,borderTop:`1px solid ${l.border}`,boxShadow:`0 -2px 12px ${l.bg}44`},children:(0,s.jsx)(`div`,{role:`tablist`,"aria-label":`Navigation tabs`,className:n.a(`flex items-center justify-around h-full`),onKeyDown:m,children:f.map(e=>{let t=e.id===i,r=n.m(e.label),a=t?l.primary:l.textMuted;return(0,s.jsxs)(`button`,{role:`tab`,"aria-selected":t,"aria-label":r,tabIndex:t?0:-1,onClick:()=>p(e.id),className:n.a(`flex flex-col items-center justify-center gap-0.5`,`bg-transparent border-none cursor-pointer p-1`,`flex-1 h-full relative`,`focus-visible:focus-ring`),style:{color:a,transition:h,outline:`none`},children:[t&&(0,s.jsx)(`div`,{"aria-hidden":`true`,style:{position:`absolute`,top:0,left:`25%`,right:`25%`,height:3,borderRadius:`0 0 3px 3px`,backgroundColor:l.primary,transition:u?`none`:`width 200ms ease`}}),(0,s.jsxs)(`div`,{className:n.a(`relative flex items-center justify-center`),style:{animation:t&&!u?`tkx-bottom-nav-pulse 300ms ease-out`:`none`},children:[e.icon,e.badge!==void 0&&e.badge>0&&(0,s.jsx)(`span`,{"aria-label":`${e.badge} notifications`,className:n.a(`absolute flex items-center justify-center`,`text-[10px] font-bold leading-none rounded-full`),style:{top:-4,right:-8,minWidth:16,height:16,padding:`0 4px`,backgroundColor:l.danger,color:l.bg},children:e.badge>99?`99+`:e.badge})]}),c&&(0,s.jsx)(`span`,{className:n.a(`text-[10px] leading-tight mt-0.5`),style:{fontWeight:t?600:400,maxWidth:`100%`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:r})]},e.id)})})})}var Gr=5e3,Kr=!1;function qr(){if(Kr||typeof document>`u`)return;Kr=!0;let e=document.createElement(`style`);e.id=`tkx-snackbar-kf`,e.textContent=`
89
- @keyframes tkx-snackbar-slide-up {
90
- from { opacity: 0; transform: translateY(24px); }
91
- to { opacity: 1; transform: translateY(0); }
92
- }
93
- @keyframes tkx-snackbar-slide-down {
94
- from { opacity: 0; transform: translateY(-24px); }
95
- to { opacity: 1; transform: translateY(0); }
96
- }
97
- @keyframes tkx-snackbar-fade-out {
98
- from { opacity: 1; }
99
- to { opacity: 0; transform: translateY(8px); }
100
- }
101
- `,document.head.appendChild(e)}var Jr={success:(0,s.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm-2 14.5l-4-4 1.41-1.41L10 13.67l6.59-6.59L18 8.5l-8 8z`})}),error:(0,s.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z`})}),warning:(0,s.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z`})}),info:(0,s.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z`})})},Yr={"bottom-left":{bottom:24,left:24},"bottom-center":{bottom:24,left:`50%`,transform:`translateX(-50%)`},"bottom-right":{bottom:24,right:24},"top-center":{top:24,left:`50%`,transform:`translateX(-50%)`}};function Xr({message:e,isOpen:i,onClose:a,action:l,variant:u=`default`,position:d=`bottom-center`,autoHideDuration:f=Gr,icon:p}){let m=t.f(),h=r.o(),g=(0,o.useId)(),_=(0,o.useRef)(null),[v,y]=(0,o.useState)(!1),[b,x]=(0,o.useState)(!1);(0,o.useEffect)(()=>{qr()},[]),(0,o.useEffect)(()=>{if(i)x(!1),y(!0);else if(v)if(h)y(!1);else{x(!0);let e=setTimeout(()=>{y(!1),x(!1)},250);return()=>clearTimeout(e)}},[i,h,v]),(0,o.useEffect)(()=>{if(!(!i||f<=0||!a))return _.current=setTimeout(()=>{a()},f),()=>{_.current&&clearTimeout(_.current)}},[i,f,a]);let S=(0,o.useCallback)(()=>{_.current&&=(clearTimeout(_.current),null)},[]),C=(0,o.useCallback)(()=>{i&&f>0&&a&&(_.current=setTimeout(()=>a(),f))},[i,f,a]),w={default:m.textMuted,success:m.success,error:m.danger,warning:m.warning,info:m.info}[u],T=n.m(e);if(!v||typeof document>`u`)return null;let E=d===`top-center`?`tkx-snackbar-slide-down`:`tkx-snackbar-slide-up`,D={};h||(D=b?{animation:`tkx-snackbar-fade-out 250ms ease forwards`}:{animation:`${E} 250ms cubic-bezier(0.16,1,0.3,1) both`});let O=p??Jr[u]??null;return(0,c.createPortal)((0,s.jsx)(`div`,{role:u===`error`?`alert`:`status`,"aria-live":u===`error`?`assertive`:`polite`,"aria-atomic":`true`,"aria-labelledby":g,className:n.a(`fixed z-[9500] font-sans`),style:{...Yr[d],...D,pointerEvents:`auto`},onMouseEnter:S,onMouseLeave:C,children:(0,s.jsxs)(`div`,{className:n.a(`flex items-center gap-3 px-4 py-3 rounded-lg shadow-lg`,`min-w-[280px] max-w-[480px]`),style:{backgroundColor:m.surface,border:`1px solid ${w}44`,boxShadow:`0 8px 24px ${m.bg}aa`,color:m.text},children:[O&&(0,s.jsx)(`span`,{className:n.a(`shrink-0 flex items-center`),style:{color:w},children:O}),(0,s.jsx)(`span`,{id:g,className:n.a(`flex-1 text-sm leading-snug`),children:T}),l&&(0,s.jsx)(`button`,{onClick:()=>{l.onClick(),a?.()},className:n.a(`bg-transparent border-none cursor-pointer p-0 ml-2`,`text-sm font-semibold shrink-0`,`focus-visible:focus-ring`),style:{color:m.primary},children:n.m(l.label)}),a&&(0,s.jsx)(`button`,{"aria-label":`Dismiss snackbar`,onClick:a,className:n.a(`bg-transparent border-none cursor-pointer rounded p-[2px] ml-1`,`shrink-0 flex items-center justify-center`,`focus-visible:focus-ring`),style:{color:m.textMuted},children:(0,s.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2.5,"aria-hidden":`true`,children:[(0,s.jsx)(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),(0,s.jsx)(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})]})})]})}),document.body)}function Zr({direction:e}){return(0,s.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,className:n.a(`shrink-0 ml-1`),children:e===`asc`?(0,s.jsx)(`path`,{d:`M7 14l5-5 5 5H7z`}):e===`desc`?(0,s.jsx)(`path`,{d:`M7 10l5 5 5-5H7z`}):(0,s.jsx)(`path`,{d:`M7 10l5 5 5-5H7zM7 14l5-5 5 5H7z`,opacity:`0.35`})})}function Qr({checked:e,indeterminate:n}){let r=t.f();return(0,s.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,s.jsx)(`rect`,{x:`1`,y:`1`,width:`14`,height:`14`,rx:`2`,fill:e||n?r.primary:`transparent`,stroke:e||n?r.primary:r.border,strokeWidth:`1.5`}),n&&(0,s.jsx)(`line`,{x1:`4`,y1:`8`,x2:`12`,y2:`8`,stroke:r.bg,strokeWidth:`2`}),e&&!n&&(0,s.jsx)(`path`,{d:`M4.5 8L7 10.5L11.5 5.5`,fill:`none`,stroke:r.bg,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}function $r(e,t){return typeof t==`function`?t(e):String(e[t])}function ei(e,t){return e[t]}function ti(e,t){return e==null&&t==null?0:e==null?1:t==null?-1:typeof e==`number`&&typeof t==`number`?e-t:String(e).localeCompare(String(t),void 0,{numeric:!0,sensitivity:`base`})}function ni(e){let t=String(e??``);return t.includes(`,`)||t.includes(`"`)||t.includes(`
102
- `)?`"${t.replace(/"/g,`""`)}"`:t}function ri({colCount:e}){let r=t.f();return(0,s.jsx)(`tbody`,{children:Array.from({length:5},(t,i)=>(0,s.jsx)(`tr`,{children:Array.from({length:e},(e,t)=>(0,s.jsx)(`td`,{className:n.a(`px-3 py-2`),style:{borderBottom:`1px solid ${r.border}`},children:(0,s.jsx)(K,{height:16})},t))},i))})}function ii({label:e,showExport:t,onExport:n,totalRows:r,selectedCount:i,theme:a}){return!t&&i===0?null:(0,s.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`8px 12px`,borderBottom:`1px solid ${a.border}`,backgroundColor:a.surface,gap:8},children:[(0,s.jsx)(`span`,{style:{fontSize:13,color:a.textMuted},children:i>0?`${i} of ${r} row${r===1?``:`s`} selected`:`${r} row${r===1?``:`s`}`}),t&&(0,s.jsxs)(`button`,{onClick:n,"aria-label":`Export ${e} as CSV`,style:{display:`inline-flex`,alignItems:`center`,gap:6,padding:`5px 12px`,fontSize:13,fontWeight:500,borderRadius:6,border:`1px solid ${a.border}`,backgroundColor:`transparent`,color:a.text,cursor:`pointer`},children:[(0,s.jsxs)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,s.jsx)(`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),(0,s.jsx)(`polyline`,{points:`7 10 12 15 17 10`}),(0,s.jsx)(`line`,{x1:`12`,y1:`15`,x2:`12`,y2:`3`})]}),`Export CSV`]})]})}function ai({page:e,totalPages:t,pageSize:n,totalRows:r,onPageChange:i,theme:a}){let o=(e-1)*n+1,c=Math.min(e*n,r),l={display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:32,height:32,borderRadius:6,border:`1px solid ${a.border}`,backgroundColor:`transparent`,color:a.text,cursor:`pointer`,fontSize:13,fontWeight:500};return(0,s.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`8px 12px`,borderTop:`1px solid ${a.border}`,backgroundColor:a.surface,gap:8,flexWrap:`wrap`},role:`navigation`,"aria-label":`Pagination`,children:[(0,s.jsx)(`span`,{style:{fontSize:13,color:a.textMuted},children:r===0?`0 rows`:`${o}–${c} of ${r}`}),(0,s.jsxs)(`div`,{style:{display:`flex`,gap:4},children:[(0,s.jsx)(`button`,{onClick:()=>i(1),disabled:e===1,"aria-label":`First page`,style:{...l,opacity:e===1?.4:1},children:`«`}),(0,s.jsx)(`button`,{onClick:()=>i(e-1),disabled:e===1,"aria-label":`Previous page`,style:{...l,opacity:e===1?.4:1},children:`‹`}),Array.from({length:Math.min(5,t)},(n,r)=>{let o=r+1;return t>5&&(o=Math.max(1,Math.min(e-2,t-4))+r),(0,s.jsx)(`button`,{onClick:()=>i(o),"aria-label":`Page ${o}`,"aria-current":o===e?`page`:void 0,style:{...l,backgroundColor:o===e?a.primary:`transparent`,color:o===e?a.bg:a.text,borderColor:o===e?a.primary:a.border},children:o},o)}),(0,s.jsx)(`button`,{onClick:()=>i(e+1),disabled:e===t,"aria-label":`Next page`,style:{...l,opacity:e===t?.4:1},children:`›`}),(0,s.jsx)(`button`,{onClick:()=>i(t),disabled:e===t,"aria-label":`Last page`,style:{...l,opacity:e===t?.4:1},children:`»`})]})]})}function oi({columns:e,data:i,rowKey:a,selectable:c=!1,selectedRows:l=[],onSelectionChange:u,sortable:d=!1,onSort:f,loading:p=!1,emptyMessage:m=`No data to display`,stickyHeader:h=!1,striped:g=!1,bordered:_=!1,compact:v=!1,maxHeight:y,onRowClick:b,virtualScroll:x,rowHeight:S=40,showFilters:C=!1,filterValues:w,onFilterChange:T,pageSize:E=0,showExport:D=!1,exportFileName:O=`export`,onLoadMore:k,hasMore:A,loadingMore:j=!1,loadMoreThreshold:M=200}){let N=t.f(),P=r.o(),F=(0,o.useId)(),[I,L]=(0,o.useState)(null),[R,z]=(0,o.useState)(`asc`),B=(0,o.useCallback)(e=>{let t=I===e&&R===`asc`?`desc`:`asc`;L(e),z(t),f?.(e,t)},[I,R,f]),V=(0,o.useMemo)(()=>f||!I?i:[...i].sort((e,t)=>{let n=ti(ei(e,I),ei(t,I));return R===`asc`?n:-n}),[i,I,R,f]),[H,U]=(0,o.useState)({}),W=w??H,G=(0,o.useCallback)((e,t)=>{T?T(e,t):U(n=>({...n,[e]:t}))},[T]),q=(0,o.useMemo)(()=>{let e=Object.entries(W).filter(([,e])=>e.trim()!==``);return e.length===0?V:V.filter(t=>e.every(([e,n])=>{let r=ei(t,e);return String(r??``).toLowerCase().includes(n.toLowerCase())}))},[V,W]),[J,Y]=(0,o.useState)(1),ee=E>0,X=q.length,Z=ee?Math.max(1,Math.ceil(X/E)):1;(0,o.useEffect)(()=>{Y(1)},[W,I,R]);let te=(0,o.useMemo)(()=>ee?q.slice((J-1)*E,J*E):q,[q,ee,J,E]),ne=x===void 0?!ee&&y!==void 0&&te.length>=50:x,re=(0,o.useRef)(null),[ie,ae]=(0,o.useState)(0),[Q,oe]=(0,o.useState)(0),se=(0,o.useCallback)(()=>{re.current&&ae(re.current.scrollTop)},[]);(0,o.useEffect)(()=>{if(!ne||!re.current)return;let e=re.current;oe(e.clientHeight);let t=new ResizeObserver(()=>oe(e.clientHeight));return t.observe(e),()=>t.disconnect()},[ne]),te.length*S;let ce=ne?Math.max(0,Math.floor(ie/S)-10):0,le=ne?Math.min(te.length,Math.ceil((ie+Q)/S)+10):te.length,ue=ne?te.slice(ce,le):te,de=ce*S,fe=(0,o.useRef)(null),pe=(0,o.useRef)(!1);(0,o.useEffect)(()=>{pe.current=!1},[i.length]),(0,o.useEffect)(()=>{if(!k)return;let e=fe.current;if(!e)return;let t=new IntersectionObserver(e=>{e[0].isIntersecting&&!pe.current&&A!==!1&&(pe.current=!0,k())},{root:re.current,rootMargin:`0px 0px ${M}px 0px`,threshold:0});return t.observe(e),()=>t.disconnect()},[k,A,M]);let $=(0,o.useMemo)(()=>new Set(l),[l]),me=(0,o.useMemo)(()=>q.map(e=>$r(e,a)),[q,a]),he=me.length>0&&me.every(e=>$.has(e)),ge=me.some(e=>$.has(e)),_e=(0,o.useCallback)(()=>{u?.(he?[]:me)},[he,me,u]),ve=(0,o.useCallback)(e=>{let t=$.has(e)?l.filter(t=>t!==e):[...l,e];u?.(t)},[$,l,u]),[ye,be]=(0,o.useState)({}),xe=(0,o.useRef)(null),Se=(0,o.useCallback)((e,t)=>{t.preventDefault(),t.stopPropagation();let n=t.target.closest(`th`);if(!n)return;let r=ye[e]||n.getBoundingClientRect().width;xe.current={key:e,startX:t.clientX,startWidth:r};let i=e=>{if(!xe.current)return;let t=Math.max(50,xe.current.startWidth+e.clientX-xe.current.startX);be(e=>({...e,[xe.current.key]:t}))},a=()=>{xe.current=null,document.removeEventListener(`mousemove`,i),document.removeEventListener(`mouseup`,a)};document.addEventListener(`mousemove`,i),document.addEventListener(`mouseup`,a)},[ye]),Ce=(0,o.useCallback)(()=>{let t=[e.map(e=>ni(e.header)).join(`,`),...q.map(t=>e.map(e=>ni(ei(t,e.key))).join(`,`))].join(`
103
- `),n=new Blob([t],{type:`text/csv;charset=utf-8;`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`${O}.csv`,i.click(),URL.revokeObjectURL(r)},[e,q,O]),we=v?`4px`:`8px`,Te=v?`8px`:`12px`,Ee=e=>{let t=ye[e.key]||e.width;return{width:t??void 0,minWidth:t??80,textAlign:e.align??`left`,padding:`${we} ${Te}`}},De=_?`1px solid ${N.border}`:`none`,Oe=n.m(m),ke=e.length+ +!!c,Ae=e.some(e=>e.filterable);return(0,s.jsxs)(`div`,{role:`grid`,"aria-label":`Data grid`,"aria-rowcount":X,id:F,className:n.a(`font-sans rounded-lg overflow-hidden`),style:{border:`1px solid ${N.border}`,backgroundColor:N.bg},children:[(0,s.jsx)(ii,{label:`data grid`,showExport:D,onExport:Ce,totalRows:X,selectedCount:l.length,theme:N}),(0,s.jsxs)(`div`,{ref:re,onScroll:ne?se:void 0,style:{maxHeight:y??`none`,overflowX:`auto`,overflowY:y?`auto`:`visible`},children:[(0,s.jsxs)(`table`,{className:n.a(`w-full`),style:{borderCollapse:`separate`,borderSpacing:0,tableLayout:`auto`},children:[(0,s.jsxs)(`thead`,{children:[(0,s.jsxs)(`tr`,{role:`row`,children:[c&&(0,s.jsx)(`th`,{scope:`col`,role:`columnheader`,style:{position:h?`sticky`:`static`,top:0,zIndex:2,backgroundColor:N.surface,borderBottom:`2px solid ${N.border}`,borderRight:De,padding:`${we} ${Te}`,width:40,textAlign:`center`},children:(0,s.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,margin:`0 auto`,width:16},children:[(0,s.jsx)(`input`,{type:`checkbox`,checked:he,ref:e=>{e&&(e.indeterminate=ge&&!he)},onChange:_e,"aria-label":he?`Deselect all rows`:`Select all rows`,style:{position:`absolute`,opacity:0,width:16,height:16,cursor:`pointer`,margin:0}}),(0,s.jsx)(Qr,{checked:he,indeterminate:ge&&!he})]})}),e.map(e=>{let t=(e.sortable??d)&&e.sortable!==!1,r=I===e.key,i=n.m(e.header);return(0,s.jsx)(`th`,{scope:`col`,role:`columnheader`,"aria-sort":r?R===`asc`?`ascending`:`descending`:t?`none`:void 0,className:n.a(`text-xs font-semibold uppercase tracking-wider`),style:{...Ee(e),position:h?`sticky`:`static`,top:0,zIndex:2,backgroundColor:N.surface,color:N.textMuted,borderBottom:`2px solid ${N.border}`,borderRight:De,cursor:t?`pointer`:`default`,userSelect:`none`,whiteSpace:`nowrap`,transition:P?`none`:`background-color 150ms ease`},onClick:t?()=>B(e.key):void 0,onKeyDown:t?t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),B(e.key))}:void 0,tabIndex:t?0:void 0,children:(0,s.jsxs)(`div`,{className:n.a(`flex items-center gap-1`),style:{position:`relative`},children:[e.renderHeader?e.renderHeader(e):i,t&&(0,s.jsx)(Zr,{direction:r?R:null}),e.resizable&&(0,s.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize column ${i}`,className:n.a(`cursor-col-resize shrink-0`),style:{position:`absolute`,right:0,top:0,bottom:0,width:4,backgroundColor:`transparent`},onMouseDown:t=>Se(e.key,t)})]})},e.key)})]}),(C||Ae)&&(0,s.jsxs)(`tr`,{role:`row`,"aria-label":`Column filters`,children:[c&&(0,s.jsx)(`th`,{scope:`col`,style:{backgroundColor:N.surfaceAlt,borderBottom:`1px solid ${N.border}`,borderRight:De,padding:`4px ${Te}`,width:40}}),e.map(e=>(0,s.jsx)(`th`,{scope:`col`,style:{backgroundColor:N.surfaceAlt,borderBottom:`1px solid ${N.border}`,borderRight:De,padding:`4px ${Te}`},children:(e.filterable||C)&&(0,s.jsx)(`input`,{type:`text`,value:W[e.key]??``,onChange:t=>G(e.key,t.target.value),placeholder:`Filter ${e.header}…`,"aria-label":`Filter by ${e.header}`,style:{width:`100%`,padding:`3px 8px`,fontSize:12,borderRadius:4,border:`1px solid ${N.border}`,backgroundColor:N.bg,color:N.text,outline:`none`}})},e.key))]})]}),p&&(0,s.jsx)(ri,{colCount:ke}),!p&&(0,s.jsx)(`tbody`,{children:te.length===0?(0,s.jsx)(`tr`,{children:(0,s.jsx)(`td`,{colSpan:ke,className:n.a(`text-center py-10`),style:{color:N.textMuted},children:Oe})}):(0,s.jsxs)(s.Fragment,{children:[ne&&de>0&&(0,s.jsx)(`tr`,{"aria-hidden":`true`,children:(0,s.jsx)(`td`,{colSpan:ke,style:{height:de,padding:0,border:`none`}})}),ue.map((t,r)=>{let i=ce+r,o=$r(t,a),l=$.has(o),u=g&&i%2==1,d=`transparent`;return l?d=`${N.primary}22`:u&&(d=N.surfaceAlt),(0,s.jsxs)(`tr`,{role:`row`,"aria-rowindex":i+1,"aria-selected":c?l:void 0,onClick:b?()=>b(t):void 0,onKeyDown:b?e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),b(t))}:void 0,tabIndex:b?0:void 0,className:n.a(b?`cursor-pointer`:``),style:{backgroundColor:d,transition:P?`none`:`background-color 120ms ease`,...ne?{height:S,boxSizing:`border-box`}:{}},onMouseEnter:b?e=>{e.currentTarget.style.backgroundColor=l?`${N.primary}30`:N.surfaceAlt}:void 0,onMouseLeave:b?e=>{e.currentTarget.style.backgroundColor=d}:void 0,children:[c&&(0,s.jsx)(`td`,{role:`gridcell`,style:{borderBottom:`1px solid ${N.border}`,borderRight:De,padding:`${we} ${Te}`,textAlign:`center`,width:40},children:(0,s.jsxs)(`label`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,margin:`0 auto`,width:16},onClick:e=>e.stopPropagation(),children:[(0,s.jsx)(`input`,{type:`checkbox`,checked:l,onChange:()=>ve(o),"aria-label":l?`Deselect row ${o}`:`Select row ${o}`,style:{position:`absolute`,opacity:0,width:16,height:16,cursor:`pointer`,margin:0}}),(0,s.jsx)(Qr,{checked:l})]})}),e.map(e=>{let r=ei(t,e.key),i=e.renderCell?e.renderCell(r,t):typeof r==`string`?n.m(r):String(r??``);return(0,s.jsx)(`td`,{role:`gridcell`,className:n.a(`text-sm`),style:{...Ee(e),borderBottom:`1px solid ${N.border}`,borderRight:De,color:N.text,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:i},e.key)})]},o)}),ne&&le<te.length&&(0,s.jsx)(`tr`,{"aria-hidden":`true`,children:(0,s.jsx)(`td`,{colSpan:ke,style:{height:(te.length-le)*S,padding:0,border:`none`}})})]})})]}),(A||j)&&(0,s.jsx)(`div`,{ref:fe,style:{height:1,width:`100%`},children:j&&(0,s.jsx)(`table`,{style:{width:`100%`,borderCollapse:`collapse`},children:(0,s.jsx)(`tbody`,{children:Array.from({length:3},(t,n)=>(0,s.jsx)(`tr`,{children:e.map(e=>(0,s.jsx)(`td`,{style:{padding:`10px 16px`},children:(0,s.jsx)(K,{variant:`text`,height:`16px`})},e.key))},n))})})}),!A&&k&&(0,s.jsx)(`div`,{style:{padding:`16px`,textAlign:`center`,fontSize:13,color:N.textMuted},children:`✓ All rows loaded`})]}),ee&&!p&&(0,s.jsx)(ai,{page:J,totalPages:Z,pageSize:E,totalRows:X,onPageChange:Y,theme:N})]})}var si={sm:0,md:768,lg:1024};function ci(){let[e,t]=(0,o.useState)(()=>{if(typeof window>`u`)return`lg`;let e=window.innerWidth;return e>=si.lg?`lg`:e>=si.md?`md`:`sm`});return(0,o.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>{let e=window.innerWidth;e>=si.lg?t(`lg`):e>=si.md?t(`md`):t(`sm`)};return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}function li(e,t){return e===void 0?3:typeof e==`number`?Math.max(1,e):t===`lg`?e.lg??e.md??e.sm??3:t===`md`?e.md??e.sm??2:e.sm??1}var ui=!1;function di(){if(ui||typeof document>`u`)return;ui=!0;let e=document.createElement(`style`);e.id=`tkx-masonry-kf`,e.textContent=`
104
- @keyframes tkx-masonry-fade-in {
105
- from { opacity: 0; transform: translateY(8px); }
106
- to { opacity: 1; transform: translateY(0); }
107
- }
108
- `,document.head.appendChild(e)}function fi({columns:e,gap:i=16,children:a}){t.f();let c=r.o(),l=ci();(0,o.useEffect)(()=>{di()},[]);let u=li(e,l),d=o.Children.toArray(a),f=(0,o.useMemo)(()=>{let e=Array.from({length:u},()=>[]);return d.forEach((t,n)=>{e[n%u].push(t)}),e},[d,u]),p=e=>c?{}:{animation:`tkx-masonry-fade-in 300ms cubic-bezier(0.16,1,0.3,1) both`,animationDelay:`${Math.min(e*40,400)}ms`};return(0,s.jsx)(`div`,{role:`list`,"aria-label":`Masonry grid`,className:n.a(`flex w-full`),style:{gap:i,alignItems:`flex-start`},children:f.map((e,t)=>(0,s.jsx)(`div`,{className:n.a(`flex flex-col`),style:{flex:1,gap:i,minWidth:0},children:e.map((e,n)=>(0,s.jsx)(`div`,{role:`listitem`,style:p(n*u+t),children:e},n))},t))})}var pi={info:(0,s.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z`})}),warning:(0,s.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z`})}),success:(0,s.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm-2 14.5l-4-4 1.41-1.41L10 13.67l6.59-6.59L18 8.5l-8 8z`})}),danger:(0,s.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z`})})},mi={1:{fontSize:`1.75rem`,fontWeight:700,lineHeight:1.25,marginTop:24,marginBottom:12},2:{fontSize:`1.375rem`,fontWeight:600,lineHeight:1.3,marginTop:20,marginBottom:10},3:{fontSize:`1.1rem`,fontWeight:600,lineHeight:1.35,marginTop:16,marginBottom:8}};function hi({block:e}){let r=t.f(),i=e.level??1,a=`h${i}`,o=n.m(e.content??``);return(0,s.jsx)(a,{className:n.a(`m-0`),style:{...mi[i],color:r.text},children:o})}function gi({block:e}){let r=t.f(),i=n.m(e.content??``);return(0,s.jsx)(`p`,{className:n.a(`m-0`),style:{fontSize:`0.938rem`,lineHeight:1.7,color:r.text,marginBottom:12},children:i})}function _i({block:e}){let r=t.f(),i=n.m(e.content??``);return(0,s.jsx)(`blockquote`,{className:n.a(`m-0`),style:{borderLeft:`3px solid ${r.primary}`,paddingLeft:16,paddingTop:8,paddingBottom:8,marginTop:12,marginBottom:12,backgroundColor:`${r.surfaceAlt}`,borderRadius:`0 6px 6px 0`,color:r.textMuted,fontStyle:`italic`,fontSize:`0.938rem`,lineHeight:1.6},children:i})}function vi({block:e}){let r=t.f(),i=n.m(e.content??``),a=e.language?n.m(e.language):null;return(0,s.jsxs)(`div`,{className:n.a(`rounded-lg overflow-hidden`),style:{marginTop:12,marginBottom:12,border:`1px solid ${r.border}`,backgroundColor:r.surfaceAlt},children:[a&&(0,s.jsx)(`div`,{className:n.a(`px-3 py-1 text-[11px] font-semibold uppercase tracking-wider`),style:{color:r.textMuted,borderBottom:`1px solid ${r.border}`,backgroundColor:r.surface},children:a}),(0,s.jsx)(`pre`,{className:n.a(`m-0 p-4 overflow-x-auto`),style:{fontFamily:`'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace`,fontSize:`0.85rem`,lineHeight:1.6,color:r.text,tabSize:2},children:(0,s.jsx)(`code`,{"aria-label":a?`Code block in ${a}`:`Code block`,children:i})})]})}function yi({block:e}){let r=t.f(),i=e.ordered?`ol`:`ul`,a=(e.items??[]).map(e=>n.m(e));return(0,s.jsx)(i,{className:n.a(`m-0`),style:{paddingLeft:24,marginTop:8,marginBottom:12,color:r.text,fontSize:`0.938rem`,lineHeight:1.7,listStyleType:e.ordered?`decimal`:`disc`},role:`list`,children:a.map((e,t)=>(0,s.jsx)(`li`,{role:`listitem`,style:{marginBottom:4},children:e},t))})}function bi(){return(0,s.jsx)(`hr`,{"aria-hidden":`true`,style:{border:`none`,borderTop:`1px solid ${t.f().border}`,marginTop:20,marginBottom:20}})}function xi({block:e}){let r=t.f(),i=n.m(e.src??``),a=n.m(e.alt??`Image`);return(0,s.jsxs)(`figure`,{className:n.a(`m-0`),style:{marginTop:12,marginBottom:12},children:[(0,s.jsx)(`img`,{src:i,alt:a,loading:`lazy`,className:n.a(`rounded-lg`),style:{maxWidth:`100%`,height:`auto`,display:`block`,border:`1px solid ${r.border}`}}),e.alt&&(0,s.jsx)(`figcaption`,{className:n.a(`text-xs mt-2 text-center`),style:{color:r.textMuted},children:a})]})}function Si({block:e}){let r=t.f(),i=e.variant??`info`,a=n.m(e.content??``),o={info:r.info,warning:r.warning,success:r.success,danger:r.danger}[i],c=pi[i];return(0,s.jsxs)(`div`,{role:{info:`note`,warning:`alert`,success:`status`,danger:`alert`}[i],className:n.a(`flex gap-3 px-4 py-3 rounded-lg`),style:{backgroundColor:`${o}12`,border:`1px solid ${o}33`,marginTop:12,marginBottom:12},children:[(0,s.jsx)(`span`,{className:n.a(`shrink-0 mt-[2px]`),style:{color:o},children:c}),(0,s.jsx)(`div`,{className:n.a(`flex-1`),style:{fontSize:`0.9rem`,lineHeight:1.6,color:r.text},children:a})]})}var Ci={heading:hi,paragraph:gi,blockquote:_i,code:vi,list:yi,divider:bi,image:xi,callout:Si};function wi({blocks:e,className:i,style:a}){let c=t.f(),l=r.o(),u=(0,o.useMemo)(()=>e.map((e,t)=>{let n=Ci[e.type];return n?(0,s.jsx)(`div`,{style:l?void 0:{animation:`tkx-rich-text-fade-in 300ms ease both`,animationDelay:`${Math.min(t*30,300)}ms`},children:(0,s.jsx)(n,{block:e,index:t})},t):null}),[e,l]);return(0,o.useMemo)(()=>{if(typeof document>`u`||document.getElementById(`tkx-rich-text-kf`))return;let e=document.createElement(`style`);e.id=`tkx-rich-text-kf`,e.textContent=`
109
- @keyframes tkx-rich-text-fade-in {
110
- from { opacity: 0; }
111
- to { opacity: 1; }
112
- }
113
- `,document.head.appendChild(e)},[]),(0,s.jsx)(`article`,{"aria-label":`Rich text content`,className:n.a(`font-sans`,i??``),style:{color:c.text,maxWidth:720,...a},children:u})}function Ti(e){let t=[],n=0,r=``,i=()=>{r&&=(t.push({kind:`text`,value:r}),``)};for(;n<e.length;){let a=e[n];if(a===`\\`&&n+1<e.length){r+=e[n+1],n+=2;continue}if(a===`!`&&e[n+1]===`[`){let r=e.indexOf(`]`,n+2);if(r!==-1&&e[r+1]===`(`){let a=e.indexOf(`)`,r+2);if(a!==-1){i(),t.push({kind:`image`,alt:e.slice(n+2,r),src:e.slice(r+2,a)}),n=a+1;continue}}}if(a===`[`){let r=Ei(e,n,`[`,`]`);if(r!==-1&&e[r+1]===`(`){let a=e.indexOf(`)`,r+2);if(a!==-1){i(),t.push({kind:`link`,href:e.slice(r+2,a).trim(),children:Ti(e.slice(n+1,r))}),n=a+1;continue}}}if(a===`<`){let r=e.indexOf(`>`,n+1);if(r!==-1){let a=e.slice(n+1,r);if(/^(https?:\/\/|mailto:)/i.test(a)||/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a)){i();let e=/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a)?`mailto:${a}`:a;t.push({kind:`link`,href:e,children:[{kind:`text`,value:a}]}),n=r+1;continue}}}if(a==="`"){let r=e.indexOf("`",n+1);if(r!==-1){i(),t.push({kind:`code`,value:e.slice(n+1,r)}),n=r+1;continue}}if(a===`~`&&e[n+1]===`~`){let r=e.indexOf(`~~`,n+2);if(r!==-1){i(),t.push({kind:`strike`,children:Ti(e.slice(n+2,r))}),n=r+2;continue}}if(a===`*`&&e[n+1]===`*`||a===`_`&&e[n+1]===`_`){let r=a+a,o=e.indexOf(r,n+2);if(o!==-1){i(),t.push({kind:`bold`,children:Ti(e.slice(n+2,o))}),n=o+2;continue}}if((a===`*`||a===`_`)&&e[n+1]!==a){let r=e.indexOf(a,n+1);if(r!==-1&&e.slice(n+1,r).trim().length>0){i(),t.push({kind:`italic`,children:Ti(e.slice(n+1,r))}),n=r+1;continue}}r+=a,n++}return i(),t}function Ei(e,t,n,r){let i=0;for(let a=t;a<e.length;a++){if(e[a]===`\\`){a++;continue}if(e[a]===n)i++;else if(e[a]===r&&(i--,i===0))return a}return-1}function Di(e){let t=e.replace(/^\uFEFF/,``).replace(/\r\n?/g,`
114
- `).split(`
115
- `),n=[],r=0;for(;r<t.length;){let e=t[r];if(/^\s*$/.test(e)){r++;continue}let i=e.match(/^\s*```(.*)$/);if(i){let e=i[1].trim();r++;let a=[];for(;r<t.length&&!/^\s*```\s*$/.test(t[r]);)a.push(t[r]),r++;r<t.length&&r++,n.push({kind:`code`,language:e,value:a.join(`
116
- `)});continue}let a=e.match(/^(#{1,6})\s+(.*?)\s*#*\s*$/);if(a){n.push({kind:`heading`,level:a[1].length,inline:Ti(a[2])}),r++;continue}if(/^\s*([-*_])\s*(?:\1\s*){2,}$/.test(e)){n.push({kind:`hr`}),r++;continue}if(Ai(e)&&r+1<t.length&&ji(t[r+1])){let i=Mi(e).map(Ti),a=Ni(t[r+1]);r+=2;let o=[];for(;r<t.length&&Ai(t[r]);)o.push(Mi(t[r]).map(Ti)),r++;n.push({kind:`table`,headers:i,rows:o,align:a});continue}if(/^\s*>/.test(e)){let e=[];for(;r<t.length&&/^\s*>/.test(t[r]);)e.push(t[r].replace(/^\s*>\s?/,``)),r++;n.push({kind:`blockquote`,children:Di(e.join(`
117
- `))});continue}if(Oi(e)){let[e,i]=ki(t,r);n.push(e),r=i;continue}let o=[e];for(r++;r<t.length&&!/^\s*$/.test(t[r])&&!/^#{1,6}\s/.test(t[r])&&!/^\s*```/.test(t[r])&&!/^\s*>/.test(t[r])&&!Oi(t[r])&&!/^\s*([-*_])\s*(?:\1\s*){2,}$/.test(t[r]);)o.push(t[r]),r++;n.push({kind:`paragraph`,inline:Ti(o.join(` `))})}return n}function Oi(e){return/^(\s*)([-*+]|\d+[.)])\s+/.test(e)}function ki(e,t){let n=e[t].match(/^(\s*)([-*+]|\d+[.)])\s+/),r=n[1].length,i=/\d/.test(n[2]),a=[],o=t;for(;o<e.length;){let t=e[o].match(/^(\s*)([-*+]|\d+[.)])\s+(.*)$/);if(!t||t[1].length!==r)break;let n=t[3],i=null,s=n,c=n.match(/^\[([ xX])\]\s+(.*)$/);c&&(i=c[1].toLowerCase()===`x`?`checked`:`unchecked`,s=c[2]);let l=[s];for(o++;o<e.length;){if(/^\s*$/.test(e[o])){if(o+1<e.length&&/^\s+\S/.test(e[o+1])){l.push(``),o++;continue}break}let t=e[o].match(/^(\s*)(\S)/);if(t&&t[1].length>r){l.push(e[o].slice(r+2)),o++;continue}break}a.push({blocks:Di(l.join(`
118
- `)),task:i})}return[{kind:`list`,ordered:i,items:a},o]}function Ai(e){return/^\s*\|.+\|\s*$/.test(e.trim())||e.includes(`|`)&&e.trim().startsWith(`|`)}function ji(e){return/^\s*\|?\s*:?-{2,}:?\s*(\|\s*:?-{2,}:?\s*)+\|?\s*$/.test(e)}function Mi(e){return e.trim().replace(/^\|/,``).replace(/\|$/,``).split(`|`).map(e=>e.trim())}function Ni(e){return Mi(e).map(e=>{let t=e.startsWith(`:`),n=e.endsWith(`:`);return t&&n?`center`:n?`right`:t?`left`:null})}function Pi(e,t,r=`i`){return e.map((e,i)=>{let a=`${r}-${i}`;switch(e.kind){case`text`:return(0,s.jsx)(`span`,{children:n.m(e.value)},a);case`bold`:return(0,s.jsx)(`strong`,{children:Pi(e.children,t,a)},a);case`italic`:return(0,s.jsx)(`em`,{children:Pi(e.children,t,a)},a);case`strike`:return(0,s.jsx)(`s`,{children:Pi(e.children,t,a)},a);case`code`:return(0,s.jsx)(`code`,{style:{background:t.theme.surfaceAlt,border:`1px solid ${t.theme.border}`,borderRadius:4,padding:`0.15em 0.4em`,fontSize:`0.9em`,fontFamily:`ui-monospace, SFMono-Regular, Menlo, Consolas, monospace`,wordBreak:`break-word`},children:n.m(e.value)},a);case`link`:{let n=Fi(e.href);if(!n)return(0,s.jsx)(`span`,{children:Pi(e.children,t,a)},a);let r=/^(https?:)?\/\//i.test(n)||n.startsWith(`mailto:`);return(0,s.jsx)(`a`,{href:n,target:r?t.externalLinkTarget:void 0,rel:r?t.externalLinkRel:void 0,onClick:e=>{t.onLinkClick?.(n,e)===!1&&e.preventDefault()},style:{color:t.theme.primary,textDecoration:`underline`,wordBreak:`break-word`},children:Pi(e.children,t,a)},a)}case`image`:return(0,s.jsx)(`img`,{src:Fi(e.src)||``,alt:n.m(e.alt),loading:`lazy`,decoding:`async`,style:{maxWidth:`100%`,height:`auto`,borderRadius:6,display:`inline-block`}},a)}})}function Fi(e){let t=e.trim();return!t||/^javascript:/i.test(t)||/^data:/i.test(t)&&!/^data:image\//i.test(t)||/^vbscript:/i.test(t)?null:t}function Ii({text:e,theme:t}){let[n,r]=(0,o.useState)(!1);return(0,s.jsx)(`button`,{type:`button`,onClick:()=>{typeof navigator<`u`&&navigator.clipboard&&navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})},"aria-label":n?`Copied to clipboard`:`Copy code`,style:{position:`absolute`,top:6,right:6,padding:`2px 8px`,fontSize:11,background:t.surface,color:n?t.success:t.textMuted,border:`1px solid ${t.border}`,borderRadius:4,cursor:`pointer`,fontFamily:`inherit`,transition:`color 120ms`},children:n?`Copied`:`Copy`})}function Li(e,t,r=`b`){return e.map((e,i)=>{let a=`${r}-${i}`;switch(e.kind){case`heading`:{let n=`h${e.level}`,r={1:{fs:t.compact?`1.75rem`:`2rem`,lh:`1.2`,mt:`0.6em`,mb:`0.5em`,fw:700},2:{fs:t.compact?`1.4rem`:`1.6rem`,lh:`1.25`,mt:`1em`,mb:`0.5em`,fw:700},3:{fs:t.compact?`1.2rem`:`1.3rem`,lh:`1.3`,mt:`1em`,mb:`0.4em`,fw:600},4:{fs:`1.1rem`,lh:`1.35`,mt:`1em`,mb:`0.4em`,fw:600},5:{fs:`1rem`,lh:`1.4`,mt:`1em`,mb:`0.3em`,fw:600},6:{fs:`0.9rem`,lh:`1.4`,mt:`1em`,mb:`0.3em`,fw:600}}[e.level];return(0,s.jsx)(n,{style:{fontSize:r.fs,lineHeight:r.lh,marginTop:r.mt,marginBottom:r.mb,fontWeight:r.fw,color:t.theme.text,scrollMarginTop:`1em`},children:Pi(e.inline,t,a)},a)}case`paragraph`:return(0,s.jsx)(`p`,{style:{margin:`0 0 ${t.compact?`0.7em`:`1em`}`,lineHeight:1.65,color:t.theme.text,wordBreak:`break-word`},children:Pi(e.inline,t,a)},a);case`blockquote`:return(0,s.jsx)(`blockquote`,{style:{margin:`0 0 1em`,padding:`0.5em 1em`,borderLeft:`4px solid ${t.theme.primary}`,background:`${t.theme.surfaceAlt}`,color:t.theme.textMuted,borderRadius:`0 6px 6px 0`},children:Li(e.children,t,a)},a);case`code`:{let r=e.value;return(0,s.jsxs)(`div`,{style:{position:`relative`,margin:`0 0 1em`,border:`1px solid ${t.theme.border}`,borderRadius:8,background:t.theme.surfaceAlt,overflow:`hidden`},children:[e.language&&(0,s.jsx)(`div`,{style:{padding:`4px 10px`,fontSize:11,color:t.theme.textMuted,borderBottom:`1px solid ${t.theme.border}`,textTransform:`uppercase`,letterSpacing:`0.05em`},children:n.m(e.language)}),t.copyableCode&&(0,s.jsx)(Ii,{text:r,theme:t.theme}),(0,s.jsx)(`pre`,{style:{margin:0,padding:12,overflowX:`auto`,fontSize:13,lineHeight:1.55,fontFamily:`ui-monospace, SFMono-Regular, Menlo, Consolas, monospace`,color:t.theme.text,whiteSpace:`pre`},children:(0,s.jsx)(`code`,{children:n.m(r)})})]},a)}case`list`:return(0,s.jsx)(e.ordered?`ol`:`ul`,{style:{margin:`0 0 1em`,paddingLeft:`1.5em`,color:t.theme.text,lineHeight:1.65},children:e.items.map((e,n)=>(0,s.jsxs)(`li`,{style:{listStyle:e.task===null?void 0:`none`,marginLeft:e.task===null?void 0:`-1.25em`},children:[e.task!==null&&(0,s.jsx)(`input`,{type:`checkbox`,disabled:!0,checked:e.task===`checked`,readOnly:!0,style:{marginRight:6,verticalAlign:`middle`},"aria-label":e.task===`checked`?`Completed task`:`Uncompleted task`}),Li(e.blocks,t,`${a}-${n}`)]},`${a}-${n}`))},a);case`hr`:return(0,s.jsx)(`hr`,{style:{border:`none`,borderTop:`1px solid ${t.theme.border}`,margin:`1.5em 0`}},a);case`table`:return(0,s.jsx)(`div`,{style:{overflowX:`auto`,margin:`0 0 1em`,border:`1px solid ${t.theme.border}`,borderRadius:6,WebkitOverflowScrolling:`touch`},children:(0,s.jsxs)(`table`,{style:{width:`100%`,borderCollapse:`collapse`,fontSize:14,color:t.theme.text},children:[(0,s.jsx)(`thead`,{children:(0,s.jsx)(`tr`,{children:e.headers.map((n,r)=>(0,s.jsx)(`th`,{style:{padding:`8px 12px`,textAlign:e.align[r]??`left`,borderBottom:`2px solid ${t.theme.border}`,background:t.theme.surfaceAlt,fontWeight:600},children:Pi(n,t,`${a}-h-${r}`)},r))})}),(0,s.jsx)(`tbody`,{children:e.rows.map((n,r)=>(0,s.jsx)(`tr`,{children:n.map((n,i)=>(0,s.jsx)(`td`,{style:{padding:`8px 12px`,textAlign:e.align[i]??`left`,borderBottom:`1px solid ${t.theme.border}`},children:Pi(n,t,`${a}-r-${r}-${i}`)},i))},r))})]})},a)}})}function Ri({source:e,src:r,maxWidth:i=`100%`,compact:a=!1,copyableCode:c=!0,onLinkClick:l,externalLinkRel:u=`noopener noreferrer`,externalLinkTarget:d=`_blank`,loadingFallback:f,errorFallback:p,className:m,style:h}){let g=t.f(),[_,v]=(0,o.useState)({text:null,error:null,loading:!!r&&e===void 0}),y=(0,o.useRef)(null);(0,o.useEffect)(()=>{if(e!==void 0||!r)return;y.current?.abort();let t=new AbortController;return y.current=t,v({text:null,error:null,loading:!0}),fetch(r,{signal:t.signal}).then(async e=>{if(!e.ok)throw Error(`Failed to load markdown (HTTP ${e.status})`);v({text:await e.text(),error:null,loading:!1})}).catch(e=>{e.name!==`AbortError`&&v({text:null,error:e.message,loading:!1})}),()=>t.abort()},[r,e]);let b=e??_.text??``,x=(0,o.useMemo)(()=>b?Di(b):[],[b]),S={theme:g,compact:a,copyableCode:c,externalLinkRel:u,externalLinkTarget:d,onLinkClick:l},C={maxWidth:i,width:`100%`,color:g.text,fontFamily:`inherit`,fontSize:a?14:15,lineHeight:1.65,wordBreak:`break-word`,overflowWrap:`anywhere`,boxSizing:`border-box`,...h};if(e===void 0&&r){if(_.loading)return(0,s.jsx)(`div`,{className:m,style:C,"aria-busy":`true`,"aria-live":`polite`,children:f??(0,s.jsx)(`span`,{style:{color:g.textMuted},children:`Loading…`})});if(_.error)return(0,s.jsx)(`div`,{className:m,style:C,role:`alert`,children:p?p(_.error):(0,s.jsx)(`span`,{style:{color:g.danger},children:n.m(_.error)})})}return(0,s.jsx)(`div`,{className:m,style:C,children:Li(x,S)})}Ri.displayName=`TkxMarkdown`;var zi={sm:576,md:768,lg:992,xl:1200};function Bi(e){return typeof e==`number`?`${e}px`:e}var Vi=(0,o.createContext)({h:0,v:0}),Hi=(0,o.forwardRef)(({children:e,hasSider:r=!1,className:i,style:a,...o},c)=>{let l=t.f(),u=n.a(`flex min-h-0 w-full font-sans`),d=r?{flexDirection:`row`}:{flexDirection:`column`};return(0,s.jsx)(`section`,{ref:c,className:n.t(`tkx-layout`,u,i),style:{minHeight:`100%`,color:l.text,backgroundColor:l.bg,...d,...a},...o,children:e})});Hi.displayName=`TkxLayout`;var Ui=(0,o.forwardRef)(({children:e,height:r=64,fixed:i=!1,className:a,style:o,...c},l)=>{let u=t.f(),d=Bi(r),f=n.a(`flex items-center px-6 shrink-0 w-full`),p=i?{position:`fixed`,top:0,left:0,right:0,zIndex:1e3}:{};return(0,s.jsx)(`header`,{ref:l,className:n.t(`tkx-layout-header`,f,a),style:{height:d,minHeight:d,backgroundColor:u.surface,borderBottom:`1px solid ${u.border}`,...p,...o},...c,children:e})});Ui.displayName=`TkxHeader`;function Wi({collapsed:e,onClick:t,color:i}){let a=r.o();return(0,s.jsx)(`button`,{type:`button`,"aria-label":e?`Expand sidebar`:`Collapse sidebar`,onClick:t,className:n.a(`flex items-center justify-center w-full py-3 cursor-pointer`,`border-0 bg-transparent`),style:{color:i},children:(0,s.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,style:{transform:e?`rotate(0deg)`:`rotate(180deg)`,transition:a?`none`:`transform 200ms ease`},"aria-hidden":`true`,children:(0,s.jsx)(`path`,{d:`M6 3l5 5-5 5`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})})}var Gi=(0,o.forwardRef)(({children:e,width:i=240,collapsedWidth:a=64,collapsed:c,onCollapse:l,collapsible:u=!1,breakpoint:d,trigger:f,className:p,style:m,...h},g)=>{let _=t.f(),v=r.o(),[y,b]=(0,o.useState)(!1),x=c??y,S=(0,o.useCallback)(e=>{c===void 0&&b(e),l?.(e)},[c,l]);(0,o.useEffect)(()=>{if(!d)return;let e=zi[d];if(!e)return;let t=window.matchMedia(`(max-width: ${e-1}px)`),n=e=>{S(e.matches)};return S(t.matches),t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)},[d,S]);let C=Bi(i),w=x?`${a}px`:C,T=u&&f!==null,E=v?`none`:`width 200ms ease, min-width 200ms ease, max-width 200ms ease`;return(0,s.jsxs)(`aside`,{ref:g,className:n.t(`tkx-layout-sider`,n.a(`shrink-0 overflow-hidden flex flex-col`),p),style:{width:w,minWidth:w,maxWidth:w,backgroundColor:_.surface,borderRight:`1px solid ${_.border}`,transition:E,...m},...h,children:[(0,s.jsx)(`div`,{className:n.a(`flex-1 overflow-y-auto overflow-x-hidden`),style:{width:w,transition:E},children:e}),T&&(0,s.jsx)(`div`,{className:n.a(`shrink-0`),style:{borderTop:`1px solid ${_.border}`},children:f===void 0?(0,s.jsx)(Wi,{collapsed:x,onClick:()=>S(!x),color:_.textMuted}):f})]})});Gi.displayName=`TkxSider`;var Ki=(0,o.forwardRef)(({children:e,className:r,style:i,...a},o)=>{let c=t.f();return(0,s.jsx)(`main`,{ref:o,className:n.t(`tkx-layout-content`,n.a(`flex-1 min-w-0 min-h-0`),r),style:{backgroundColor:c.bg,padding:`24px`,...i},...a,children:e})});Ki.displayName=`TkxContent`;var qi=(0,o.forwardRef)(({children:e,className:r,style:i,...a},o)=>{let c=t.f();return(0,s.jsx)(`footer`,{ref:o,className:n.t(`tkx-layout-footer`,n.a(`flex items-center px-6 py-4 shrink-0`),r),style:{backgroundColor:c.surface,borderTop:`1px solid ${c.border}`,color:c.textMuted,...i},...a,children:e})});qi.displayName=`TkxFooter`;var Ji={start:`flex-start`,center:`center`,end:`flex-end`,"space-between":`space-between`,"space-around":`space-around`,"space-evenly":`space-evenly`},Yi={top:`flex-start`,middle:`center`,bottom:`flex-end`,stretch:`stretch`},Xi=(0,o.forwardRef)(({children:e,gutter:t,justify:r=`start`,align:i=`top`,wrap:a=!0,className:o,style:c,...l},u)=>{let[d,f]=Array.isArray(t)?t:[t??0,0],p=d/2,m=f/2,h=d||f?{marginLeft:-p,marginRight:-p,marginTop:-m,marginBottom:-m}:{},g={h:p,v:m};return(0,s.jsx)(Vi.Provider,{value:g,children:(0,s.jsx)(`div`,{ref:u,className:n.t(`tkx-row`,n.a(`flex w-full`),o),style:{flexWrap:a?`wrap`:`nowrap`,justifyContent:Ji[r]??`flex-start`,alignItems:Yi[i]??`flex-start`,...h,...c},...l,children:e})})});Xi.displayName=`TkxRow`;var Zi=!1;function Qi(){if(Zi||typeof document>`u`)return;Zi=!0;let e=[];for(let[t,n]of Object.entries(zi)){for(let r=1;r<=24;r++){let i=`${r/24*100}%`;e.push(`@media (min-width: ${n}px) { .tkx-col-${t}-${r} { flex: 0 0 ${i} !important; max-width: ${i} !important; } }`)}for(let r=0;r<=24;r++){let i=`${r/24*100}%`;e.push(`@media (min-width: ${n}px) { .tkx-col-${t}-offset-${r} { margin-left: ${i} !important; } }`)}}let t=document.createElement(`style`);t.id=`tkx-col-responsive`,t.textContent=e.join(`
119
- `),document.head.appendChild(t)}function $i(e){if(e!==void 0)return typeof e==`number`?{span:e}:e}var ea=(0,o.forwardRef)(({children:e,span:t,offset:r=0,push:i,pull:a,order:c,sm:l,md:u,lg:d,xl:f,className:p,style:m,...h},g)=>{(0,o.useEffect)(()=>{Qi()},[]);let _=(0,o.useContext)(Vi),v=t===void 0?void 0:`${t/24*100}%`,y=r?`${r/24*100}%`:void 0,b=[],x=[[`sm`,l],[`md`,u],[`lg`,d],[`xl`,f]];for(let[e,t]of x){let n=$i(t);n&&(b.push(`tkx-col-${e}-${n.span}`),n.offset!==void 0&&n.offset>0&&b.push(`tkx-col-${e}-offset-${n.offset}`))}let S={};return i!==void 0&&(S.left=`${i/24*100}%`,S.position=`relative`),a!==void 0&&(S.right=`${a/24*100}%`,S.position=`relative`),c!==void 0&&(S.order=c),(0,s.jsx)(`div`,{ref:g,className:n.t(`tkx-col`,n.a(`box-border min-h-[1px]`),...b,p),style:{flex:v?`0 0 ${v}`:`1`,maxWidth:v??`100%`,marginLeft:y,paddingLeft:_.h||void 0,paddingRight:_.h||void 0,paddingTop:_.v||void 0,paddingBottom:_.v||void 0,...S,...m},...h,children:e})});ea.displayName=`TkxCol`;var ta=(0,o.createContext)({locale:`en-US`,direction:`ltr`,componentDefaults:{size:`md`,variant:`default`,animation:!0,bordered:!0},componentOverrides:{},prefixCls:`tkx`,configured:!1,cls:e=>`tkx-${e}`,getSize:()=>`md`,getAnimation:()=>!0,getBordered:()=>!0});function na({children:e,locale:t,direction:n,componentDefaults:r,componentOverrides:i,prefixCls:a}){let c=(0,o.useContext)(ta),l=(0,o.useMemo)(()=>({size:r?.size??c.componentDefaults.size,variant:r?.variant??c.componentDefaults.variant,animation:r?.animation??c.componentDefaults.animation,bordered:r?.bordered??c.componentDefaults.bordered}),[r,c.componentDefaults]),u=(0,o.useMemo)(()=>{let e=c.componentOverrides,t=i??{};return{button:{...e.button,...t.button},input:{...e.input,...t.input},table:{...e.table,...t.table},modal:{...e.modal,...t.modal}}},[i,c.componentOverrides]),d=t??c.locale,f=n??c.direction,p=a??c.prefixCls,m=(0,o.useCallback)(e=>`${p}-${e}`,[p]),h=(0,o.useCallback)((e,t)=>{if(t!==void 0)return t;if(e){let t=u[e];if(t?.size)return t.size}return l.size},[l.size,u]),g=(0,o.useCallback)(e=>e===void 0?l.animation:e,[l.animation]),_=(0,o.useCallback)((e,t)=>{if(t!==void 0)return t;if(e){let t=u[e];if(t?.bordered!==void 0)return t.bordered}return l.bordered},[l.bordered,u]),v=(0,o.useMemo)(()=>({locale:d,direction:f,componentDefaults:l,componentOverrides:u,prefixCls:p,configured:!0,cls:m,getSize:h,getAnimation:g,getBordered:_}),[d,f,l,u,p,m,h,g,_]);return(0,s.jsx)(ta.Provider,{value:v,children:(0,s.jsx)(`div`,{dir:f,lang:d,className:`${p}-config-root`,style:{direction:f},children:e})})}na.displayName=`TkxConfigProvider`;function ra(){return(0,o.useContext)(ta)}function ia(e,t){let{prefixCls:n}=ra();return`${t??n}-${e}`}function aa(e,t){let{getSize:n}=ra();return n(e,t)}var oa={sm:32,md:40,lg:48},sa={sm:`0.75rem`,md:`0.875rem`,lg:`1rem`},ca={sm:8,md:12,lg:16},la={sm:4,md:8,lg:12},ua={sm:4,md:6,lg:8},da={sm:14,md:16,lg:20};function fa(){let{direction:e}=ra();if(e===`rtl`)return{transform:`scaleX(-1)`}}function pa(e,t=0){let{direction:n}=ra(),r=typeof e==`number`?`${e}px`:e,i=typeof t==`number`?`${t}px`:t;return n===`rtl`?{marginRight:r,marginLeft:i}:{marginLeft:r,marginRight:i}}var ma={"en-US":`English (US)`,"en-GB":`English (UK)`,"es-ES":`Spanish`,"fr-FR":`French`,"de-DE":`German`,"ja-JP":`Japanese`,"ko-KR":`Korean`,"zh-CN":`Chinese (Simplified)`,"zh-TW":`Chinese (Traditional)`,"pt-BR":`Portuguese (Brazil)`,"ar-SA":`Arabic`,"hi-IN":`Hindi`,"ru-RU":`Russian`,"it-IT":`Italian`,"nl-NL":`Dutch`,"sv-SE":`Swedish`,"pl-PL":`Polish`,"tr-TR":`Turkish`,"th-TH":`Thai`,"vi-VN":`Vietnamese`},ha=new Set([`ar`,`ar-SA`,`ar-EG`,`ar-AE`,`he`,`he-IL`,`fa`,`fa-IR`,`ur`,`ur-PK`,`ps`,`ps-AF`]);function ga(e){return ha.has(e)||ha.has(e.split(`-`)[0])}function _a(e){if(ma[e])return ma[e];if(typeof Intl<`u`&&Intl.DisplayNames)try{return new Intl.DisplayNames([`en`],{type:`language`}).of(e)??e}catch{return e}return e}function va(e){return typeof e==`string`?e:typeof e==`number`?String(e):Array.isArray(e)?e.map(va).join(``):e&&typeof e==`object`&&`props`in e?va(e.props.children):``}function ya({text:e}){let n=t.f(),[r,i]=(0,o.useState)(!1);return(0,o.createElement)(`button`,{type:`button`,onClick:(0,o.useCallback)(()=>{navigator.clipboard.writeText(e).then(()=>{i(!0),setTimeout(()=>i(!1),2e3)})},[e]),"aria-label":r?`Copied`:`Copy to clipboard`,style:{display:`inline-flex`,alignItems:`center`,marginLeft:`4px`,padding:`2px 6px`,border:`none`,background:`transparent`,color:r?n.success:n.textMuted,cursor:`pointer`,fontSize:`0.8em`,borderRadius:`4px`,transition:`color 0.2s`}},r?`Copied!`:`⎘`)}function ba(e=`default`){let n=t.f();return{default:n.text,secondary:n.textMuted,success:n.success,warning:n.warning,danger:n.danger}[e]}var xa={1:{fontSize:`2.25rem`,lineHeight:`1.2`,fontWeight:700},2:{fontSize:`1.875rem`,lineHeight:`1.25`,fontWeight:700},3:{fontSize:`1.5rem`,lineHeight:`1.3`,fontWeight:600},4:{fontSize:`1.25rem`,lineHeight:`1.35`,fontWeight:600},5:{fontSize:`1rem`,lineHeight:`1.4`,fontWeight:600}};function Sa({level:e=1,children:r,copyable:i=!1,type:a=`default`,style:s}){let c=ba(a);t.f();let l=xa[e],u=`h${e}`,d=typeof r==`string`?n.m(r):r,f=va(r);return(0,o.createElement)(u,{style:{color:c,fontSize:l.fontSize,lineHeight:l.lineHeight,fontWeight:l.fontWeight,margin:`0 0 0.5em 0`,fontFamily:`inherit`,...s}},d,i&&(0,o.createElement)(ya,{text:f}))}function Ca({children:e,type:r=`default`,strong:i=!1,italic:a=!1,underline:s=!1,delete:c=!1,code:l=!1,mark:u=!1,copyable:d=!1,style:f}){let p=ba(r),m=t.f(),h=va(e),g=typeof e==`string`?n.m(e):e,_=[];s&&_.push(`underline`),c&&_.push(`line-through`);let v=g;return l&&(v=(0,o.createElement)(`code`,{style:{padding:`0.15em 0.4em`,fontSize:`0.875em`,backgroundColor:m.surfaceAlt,border:`1px solid ${m.border}`,borderRadius:`4px`,fontFamily:`monospace`}},v)),u&&(v=(0,o.createElement)(`mark`,{style:{backgroundColor:`${m.warning}33`,color:p,padding:`0 2px`,borderRadius:`2px`}},v)),(0,o.createElement)(i?`strong`:a?`em`:`span`,{style:{color:p,fontStyle:a?`italic`:`normal`,textDecoration:_.length>0?_.join(` `):`none`,...f}},v,d&&(0,o.createElement)(ya,{text:h}))}function wa({children:e,type:r=`default`,copyable:i=!1,ellipsis:a=!1,style:s}){let c=t.f(),l=r===`secondary`?c.textMuted:c.text,u=va(e),d=typeof e==`string`?n.m(e):e,f={};if(a){let e=typeof a==`object`?a.rows??3:3;f.display=`-webkit-box`,f.WebkitLineClamp=e,f.WebkitBoxOrient=`vertical`,f.overflow=`hidden`}return(0,o.createElement)(`div`,{style:{color:l,fontSize:`1rem`,lineHeight:`1.6`,margin:`0 0 1em 0`,...f,...s}},d,i&&(0,o.createElement)(ya,{text:u}))}var Ta={sm:{dimension:20,borderWidth:2,fontSize:`0.75rem`},md:{dimension:32,borderWidth:3,fontSize:`0.875rem`},lg:{dimension:48,borderWidth:4,fontSize:`1rem`}},Ea=!1;function Da(){if(Ea||typeof document>`u`)return;Ea=!0;let e=document.createElement(`style`);e.id=`tkx-spin-styles`,e.textContent=`
120
- @keyframes tkx-spin-rotate {
121
- 0% { transform: rotate(0deg); }
122
- 100% { transform: rotate(360deg); }
123
- }
124
- `,document.head.appendChild(e)}function Oa({size:e,color:t}){return(0,o.createElement)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,fill:`none`,role:`img`,"aria-label":`Loading`},(0,o.createElement)(`circle`,{cx:12,cy:12,r:10,stroke:`${t}33`,strokeWidth:2.5,fill:`none`}),(0,o.createElement)(`path`,{d:`M12 2a10 10 0 0 1 10 10`,stroke:t,strokeWidth:2.5,strokeLinecap:`round`,fill:`none`}))}function ka({size:e,borderWidth:t,color:n,reducedMotion:r}){return r?(0,o.createElement)(Oa,{size:e,color:n}):(Da(),(0,o.createElement)(`div`,{role:`img`,"aria-label":`Loading`,style:{width:`${e}px`,height:`${e}px`,border:`${t}px solid ${n}33`,borderTopColor:n,borderRadius:`50%`,animation:`tkx-spin-rotate 0.8s linear infinite`,boxSizing:`border-box`}}))}function Aa({spinning:e=!0,size:i=`md`,tip:a,indicator:s,children:c,fullscreen:l=!1,delay:u=0,style:d}){let f=t.f(),p=r.o(),[m,h]=(0,o.useState)(u===0&&e),g=(0,o.useRef)(null);if((0,o.useEffect)(()=>(e&&u>0?g.current=setTimeout(()=>h(!0),u):h(e),()=>{g.current!==null&&clearTimeout(g.current)}),[e,u]),!m)return c?(0,o.createElement)(`div`,{style:d},c):null;let _=Ta[i],v=a?n.m(a):void 0,y=(0,o.createElement)(`div`,{role:`status`,"aria-live":`polite`,"aria-label":v??`Loading`,style:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,gap:`8px`}},s??(0,o.createElement)(ka,{size:_.dimension,borderWidth:_.borderWidth,color:f.primary,reducedMotion:p}),v&&(0,o.createElement)(`span`,{style:{color:f.primary,fontSize:_.fontSize,marginTop:`4px`}},v));return l?(0,o.createElement)(`div`,{style:{position:`fixed`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,backgroundColor:`${f.bg}cc`,zIndex:9999,...d}},y):c?(0,o.createElement)(`div`,{style:{position:`relative`,...d}},(0,o.createElement)(`div`,{style:{filter:`blur(1px)`,opacity:.5,pointerEvents:`none`,userSelect:`none`,transition:p?`none`:`opacity 0.2s, filter 0.2s`}},c),(0,o.createElement)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,backgroundColor:`${f.bg}66`,borderRadius:`4px`}},y)):(0,o.createElement)(`div`,{style:{display:`inline-flex`,alignItems:`center`,justifyContent:`center`,...d}},y)}function ja({color:e,mutedColor:t}){return(0,o.createElement)(`svg`,{width:120,height:100,viewBox:`0 0 120 100`,fill:`none`,"aria-hidden":`true`},(0,o.createElement)(`path`,{d:`M20 40 L60 20 L100 40 L60 60 Z`,fill:`${t}18`,stroke:t,strokeWidth:1.5,strokeLinejoin:`round`}),(0,o.createElement)(`path`,{d:`M20 40 L20 65 L60 85 L60 60 Z`,fill:`${t}10`,stroke:t,strokeWidth:1.5,strokeLinejoin:`round`}),(0,o.createElement)(`path`,{d:`M100 40 L100 65 L60 85 L60 60 Z`,fill:`${t}0d`,stroke:t,strokeWidth:1.5,strokeLinejoin:`round`}),(0,o.createElement)(`path`,{d:`M20 40 L40 28 L60 40 L40 52 Z`,fill:`${e}15`,stroke:e,strokeWidth:1,strokeLinejoin:`round`,strokeDasharray:`3 2`}),(0,o.createElement)(`path`,{d:`M60 40 L80 28 L100 40 L80 52 Z`,fill:`${e}15`,stroke:e,strokeWidth:1,strokeLinejoin:`round`,strokeDasharray:`3 2`}))}function Ma({mutedColor:e}){return(0,o.createElement)(`svg`,{width:64,height:64,viewBox:`0 0 64 64`,fill:`none`,"aria-hidden":`true`},(0,o.createElement)(`rect`,{x:16,y:8,width:32,height:40,rx:3,fill:`${e}12`,stroke:e,strokeWidth:1.5}),(0,o.createElement)(`line`,{x1:24,y1:20,x2:40,y2:20,stroke:e,strokeWidth:1.5,strokeLinecap:`round`}),(0,o.createElement)(`line`,{x1:24,y1:28,x2:36,y2:28,stroke:e,strokeWidth:1.5,strokeLinecap:`round`}),(0,o.createElement)(`line`,{x1:24,y1:36,x2:32,y2:36,stroke:e,strokeWidth:1.5,strokeLinecap:`round`}),(0,o.createElement)(`circle`,{cx:32,cy:54,r:6,stroke:e,strokeWidth:1.2,fill:`none`}),(0,o.createElement)(`line`,{x1:28,y1:54,x2:36,y2:54,stroke:e,strokeWidth:1.2,strokeLinecap:`round`}))}function Na({image:e=`default`,description:r=`No data`,children:i,style:a}){let s=t.f(),c=typeof r==`string`?n.m(r):r,l;return l=e===`default`?(0,o.createElement)(ja,{color:s.primary,mutedColor:s.textMuted}):e===`simple`?(0,o.createElement)(Ma,{mutedColor:s.textMuted}):e,(0,o.createElement)(`div`,{role:`status`,style:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,padding:`32px 16px`,textAlign:`center`,...a}},(0,o.createElement)(`div`,{style:{marginBottom:`12px`,opacity:.85}},l),c&&(0,o.createElement)(`div`,{style:{color:s.textMuted,fontSize:`0.875rem`,lineHeight:`1.5`,maxWidth:`320px`}},c),i&&(0,o.createElement)(`div`,{style:{marginTop:`16px`}},i))}function Pa(e,t,n=`,`){if(typeof e==`string`)return e;let[r,i]=(t===void 0?String(e):e.toFixed(t)).split(`.`),a=r.replace(/\B(?=(\d{3})+(?!\d))/g,n);return i===void 0?a:`${a}.${i}`}function Fa(e,t){if(e<=0)return t.replace(/DD?/g,`0`).replace(/HH?/g,`00`).replace(/mm?/g,`00`).replace(/ss?/g,`00`);let n=Math.floor(e/1e3),r=Math.floor(n/86400),i=Math.floor(n%86400/3600),a=Math.floor(n%3600/60),o=n%60,s=e=>String(e).padStart(2,`0`);return t.replace(/DD/g,s(r)).replace(/D/g,String(r)).replace(/HH/g,s(i)).replace(/H/g,String(i)).replace(/mm/g,s(a)).replace(/m/g,String(a)).replace(/ss/g,s(o)).replace(/s/g,String(o))}function Ia({direction:e,color:t}){return(0,o.createElement)(`svg`,{width:16,height:14,viewBox:`0 0 20 14`,fill:`none`,"aria-hidden":`true`,style:{display:`inline-block`,verticalAlign:`middle`}},(0,o.createElement)(`path`,{d:e===`up`?`M6 10 L10 4 L14 10`:`M6 4 L10 10 L14 4`,stroke:t,strokeWidth:2.5,strokeLinecap:`round`,strokeLinejoin:`round`,fill:`none`}))}var La=!1;function Ra(){if(La||typeof document>`u`)return;La=!0;let e=document.createElement(`style`);e.id=`tkx-statistic-skeleton`,e.textContent=`@keyframes tkx-stat-shimmer{0%{background-position:-200% 0}100%{background-position:200% 0}}`,document.head.appendChild(e)}function za({w:e,h:t,alt:n,bdr:r,rm:i}){return i||Ra(),(0,o.createElement)(`div`,{"aria-hidden":`true`,style:{width:e,height:t,borderRadius:`4px`,background:i?n:`linear-gradient(90deg, ${n} 25%, ${r} 50%, ${n} 75%)`,backgroundSize:`200% 100%`,animation:i?`none`:`tkx-stat-shimmer 1.5s ease-in-out infinite`}})}function Ba({title:e,value:i,prefix:a,suffix:s,precision:c,groupSeparator:l=`,`,valueStyle:u,loading:d=!1,trend:f,trendValue:p,style:m}){let h=t.f(),g=r.o(),_=n.m(e),v=p?n.m(p):void 0,y=f===`up`?h.success:f===`down`?h.danger:void 0;return(0,o.createElement)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`4px`,...m}},(0,o.createElement)(`div`,{style:{color:h.textMuted,fontSize:`0.875rem`,lineHeight:`1.4`}},_),d?(0,o.createElement)(za,{w:`120px`,h:`32px`,alt:h.surfaceAlt,bdr:h.border,rm:g}):(0,o.createElement)(`div`,{style:{display:`flex`,alignItems:`baseline`,gap:`4px`,fontSize:`1.75rem`,fontWeight:700,lineHeight:`1.2`,color:h.text,fontVariantNumeric:`tabular-nums`,...u}},a&&(0,o.createElement)(`span`,{style:{fontSize:`0.75em`,fontWeight:400}},a),(0,o.createElement)(`span`,null,Pa(i,c,l)),s&&(0,o.createElement)(`span`,{style:{fontSize:`0.6em`,fontWeight:400,color:h.textMuted}},s)),f&&(0,o.createElement)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`4px`,fontSize:`0.8125rem`,color:y,marginTop:`2px`}},(0,o.createElement)(Ia,{direction:f,color:y}),v&&(0,o.createElement)(`span`,null,v)))}function Va({title:e,value:r,format:i=`HH:mm:ss`,onFinish:a,prefix:s,suffix:c,style:l}){let u=t.f(),d=n.m(e),f=(0,o.useRef)(a);f.current=a;let p=(0,o.useRef)(!1),[m,h]=(0,o.useState)(()=>Math.max(0,r-Date.now()));(0,o.useEffect)(()=>{p.current=!1;let e=()=>{let e=Math.max(0,r-Date.now());h(e),e<=0&&!p.current&&(p.current=!0,f.current?.())};e();let t=setInterval(e,1e3);return()=>clearInterval(t)},[r]);let g=Fa(m,i);return(0,o.createElement)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:`4px`,...l}},(0,o.createElement)(`div`,{style:{color:u.textMuted,fontSize:`0.875rem`,lineHeight:`1.4`}},d),(0,o.createElement)(`div`,{style:{display:`flex`,alignItems:`baseline`,gap:`4px`,fontSize:`1.75rem`,fontWeight:700,lineHeight:`1.2`,color:m<=0?u.danger:u.text,fontVariantNumeric:`tabular-nums`}},s&&(0,o.createElement)(`span`,{style:{fontSize:`0.75em`,fontWeight:400}},s),(0,o.createElement)(`span`,null,g),c&&(0,o.createElement)(`span`,{style:{fontSize:`0.6em`,fontWeight:400,color:u.textMuted}},c)))}var Ha={sm:{height:28,fontSize:12,px:10},md:{height:36,fontSize:14,px:16},lg:{height:44,fontSize:16,px:20}};function Ua({options:e,value:i,onChange:a,size:c=`md`,block:l=!1}){let u=t.f(),d=r.o(),f=(0,o.useRef)(null),[p,m]=(0,o.useState)(()=>Math.max(0,e.findIndex(e=>e.value===i))),[h,g]=(0,o.useState)({}),_=Ha[c];(0,o.useEffect)(()=>{let t=e.findIndex(e=>e.value===i);t>=0&&m(t)},[i,e]),(0,o.useEffect)(()=>{let e=f.current;if(!e)return;let t=e.querySelectorAll(`[data-seg-btn]`)[p];t&&g({left:t.offsetLeft,width:t.offsetWidth,height:t.offsetHeight,transition:d?`none`:`left 0.2s ease, width 0.2s ease`})},[p,e,d]);let v=(0,o.useCallback)(t=>{let n=e[t];!n||n.disabled||(m(t),a?.(n.value))},[e,a]),y=(0,o.useCallback)(t=>{let n=p;if(t.key===`ArrowRight`||t.key===`ArrowDown`)for(t.preventDefault(),n=(p+1)%e.length;e[n]?.disabled&&n!==p;)n=(n+1)%e.length;else if(t.key===`ArrowLeft`||t.key===`ArrowUp`)for(t.preventDefault(),n=(p-1+e.length)%e.length;e[n]?.disabled&&n!==p;)n=(n-1+e.length)%e.length;n!==p&&(v(n),(f.current?.querySelectorAll(`[data-seg-btn]`))?.[n]?.focus())},[p,e,v]);return(0,s.jsxs)(`div`,{ref:f,role:`radiogroup`,"aria-label":`Segmented control`,className:n.a(`relative inline-flex items-center rounded-lg p-1`),style:{backgroundColor:u.surfaceAlt,border:`1px solid ${u.border}`,width:l?`100%`:void 0},onKeyDown:y,children:[(0,s.jsx)(`div`,{"aria-hidden":`true`,className:n.a(`absolute top-1 rounded-md`),style:{...h,backgroundColor:u.surface,boxShadow:`0 1px 3px ${u.border}`,zIndex:0}}),e.map((e,t)=>{let r=t===p,i=n.m(e.label);return(0,s.jsxs)(`button`,{"data-seg-btn":!0,type:`button`,role:`radio`,"aria-checked":r,"aria-disabled":e.disabled||void 0,disabled:e.disabled,tabIndex:r?0:-1,className:n.a(`relative z-10 flex items-center justify-center gap-1 rounded-md border-0 cursor-pointer`,`font-sans whitespace-nowrap select-none`),style:{height:_.height,fontSize:_.fontSize,padding:`0 ${_.px}px`,flex:l?1:void 0,color:r?u.text:u.textMuted,backgroundColor:`transparent`,opacity:e.disabled?.4:1,fontWeight:r?600:400,transition:d?`none`:`color 0.15s ease`},onClick:()=>v(t),children:[e.icon&&(0,s.jsx)(`span`,{"aria-hidden":`true`,children:e.icon}),i]},e.value)})]})}function Wa({options:e,value:i=``,onChange:a,trigger:c=`@`,placeholder:l,label:u}){let d=t.f(),f=r.o(),p=(0,o.useRef)(null),m=(0,o.useRef)(null),[h,g]=(0,o.useState)(i),[_,v]=(0,o.useState)(!1),[y,b]=(0,o.useState)(``),[x,S]=(0,o.useState)(0),[C,w]=(0,o.useState)(-1);(0,o.useEffect)(()=>{i!==void 0&&g(i)},[i]);let T=e.filter(e=>e.label.toLowerCase().includes(y.toLowerCase())),E=(0,o.useCallback)(e=>{let t=e.target.value;g(t),a?.(t);let n=e.target.selectionStart??t.length,r=t.slice(0,n),i=r.lastIndexOf(c);if(i>=0){let e=r.slice(i+c.length);if(!/\s/.test(e)){b(e),w(i),v(!0),S(0);return}}v(!1)},[c,a]),D=(0,o.useCallback)(e=>{let t=h.slice(0,C),n=h.slice(C+c.length+y.length),r=`${t}${c}${e.value} ${n}`;g(r),a?.(r),v(!1),p.current?.focus()},[h,C,c,y,a]),O=(0,o.useCallback)(e=>{_&&(e.key===`ArrowDown`?(e.preventDefault(),S(e=>(e+1)%T.length)):e.key===`ArrowUp`?(e.preventDefault(),S(e=>(e-1+T.length)%T.length)):e.key===`Enter`&&T[x]?(e.preventDefault(),D(T[x])):e.key===`Escape`&&v(!1))},[_,T,x,D]);(0,o.useEffect)(()=>{!_||!m.current||m.current.children[x]?.scrollIntoView({block:`nearest`})},[x,_]);let k=u?n.m(u):void 0,A=l?n.m(l):void 0;return(0,s.jsxs)(`div`,{className:n.a(`relative font-sans`),style:{width:`100%`},children:[k&&(0,s.jsx)(`label`,{className:n.a(`block text-sm font-medium mb-1`),style:{color:d.text},children:k}),(0,s.jsx)(`textarea`,{ref:p,role:`combobox`,"aria-expanded":_,"aria-haspopup":`listbox`,"aria-autocomplete":`list`,"aria-label":k??`Mentions input`,value:h,placeholder:A,onChange:E,onKeyDown:O,onBlur:()=>setTimeout(()=>v(!1),200),className:n.a(`w-full rounded-lg border px-3 py-2 text-sm resize-y`),style:{backgroundColor:d.surface,borderColor:d.border,color:d.text,minHeight:80,outline:`none`},rows:3}),_&&T.length>0&&(0,s.jsx)(`ul`,{ref:m,role:`listbox`,"aria-label":`Mention suggestions`,className:n.a(`absolute left-0 right-0 z-50 rounded-lg border overflow-auto`),style:{backgroundColor:d.surface,borderColor:d.border,maxHeight:200,top:`100%`,marginTop:4,listStyle:`none`,padding:0,boxShadow:`0 4px 12px ${d.bg}80`,animation:f?`none`:`tkxFadeIn 0.15s ease`},children:T.map((e,t)=>(0,s.jsxs)(`li`,{role:`option`,"aria-selected":t===x,className:n.a(`flex items-center gap-3 px-3 py-2 cursor-pointer text-sm`),style:{backgroundColor:t===x?d.surfaceAlt:`transparent`,color:d.text},onMouseDown:t=>{t.preventDefault(),D(e)},onMouseEnter:()=>S(t),children:[e.avatar&&(0,s.jsx)(`img`,{src:n.m(e.avatar),alt:``,"aria-hidden":`true`,width:24,height:24,className:n.a(`rounded-full`),style:{objectFit:`cover`}}),(0,s.jsx)(`span`,{children:n.m(e.label)}),(0,s.jsxs)(`span`,{style:{color:d.textMuted,marginLeft:`auto`},children:[c,n.m(e.value)]})]},e.value))})]})}function Ga(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n)|0;return Math.abs(t)}function Ka(e){let t=e;return()=>(t=t*1664525+1013904223|0,(t>>>0)/4294967295)}var qa={L:.38,M:.42,Q:.48,H:.55};function Ja(e,t,n){let r=Ka(Ga(e)),i=qa[n]??.42,a=Array.from({length:t},()=>Array.from({length:t},()=>!1)),o=(e,t)=>{for(let n=0;n<7;n++)for(let r=0;r<7;r++){let i=n===0||n===6||r===0||r===6,o=n>=2&&n<=4&&r>=2&&r<=4;a[e+n][t+r]=i||o}};o(0,0),o(0,t-7),o(t-7,0);for(let e=7;e<t-7;e++)a[6][e]=e%2==0,a[e][6]=e%2==0;for(let e=0;e<t;e++)for(let n=0;n<t;n++)e<8&&n<8||e<8&&n>=t-8||e>=t-8&&n<8||e===6||n===6||(a[e][n]=r()<i);return a}function Ya({value:e,size:i=160,color:a,bgColor:c,errorLevel:l=`M`,icon:u,bordered:d=!0}){let f=t.f(),p=r.o(),m=(0,o.useRef)(null),h=n.m(e),g=a??f.text,_=c??f.surface,v=(0,o.useMemo)(()=>Ja(h,25,l),[h,l]);return(0,o.useEffect)(()=>{let e=m.current;if(!e)return;let t=e.getContext(`2d`);if(!t)return;let r=window.devicePixelRatio||1;e.width=i*r,e.height=i*r,t.scale(r,r);let a=i/25;t.fillStyle=_,t.fillRect(0,0,i,i),t.fillStyle=g;for(let e=0;e<25;e++)for(let n=0;n<25;n++)v[e][n]&&t.fillRect(n*a,e*a,a,a);if(u){let e=i*.22,r=(i-e)/2;t.fillStyle=_,t.fillRect(r-2,r-2,e+4,e+4);let a=new Image;a.crossOrigin=`anonymous`,a.onload=()=>{t.drawImage(a,r,r,e,e)},a.src=n.m(u)}},[v,i,g,_,u]),(0,s.jsx)(`div`,{role:`img`,"aria-label":`QR code for: ${h}`,className:n.a(`inline-block rounded-lg`),style:{padding:d?12:0,backgroundColor:d?_:`transparent`,border:d?`1px solid ${f.border}`:`none`,lineHeight:0,animation:p?`none`:`tkxFadeIn 0.2s ease`},children:(0,s.jsx)(`canvas`,{ref:m,"aria-hidden":`true`,style:{width:i,height:i,display:`block`}})})}var Xa={success:e=>(0,s.jsxs)(`svg`,{width:`72`,height:`72`,viewBox:`0 0 72 72`,fill:`none`,"aria-hidden":`true`,children:[(0,s.jsx)(`circle`,{cx:`36`,cy:`36`,r:`34`,stroke:e,strokeWidth:`3`,fill:`${e}18`}),(0,s.jsx)(`path`,{d:`M22 37l9 9 19-19`,stroke:e,strokeWidth:`4`,strokeLinecap:`round`,strokeLinejoin:`round`})]}),error:e=>(0,s.jsxs)(`svg`,{width:`72`,height:`72`,viewBox:`0 0 72 72`,fill:`none`,"aria-hidden":`true`,children:[(0,s.jsx)(`circle`,{cx:`36`,cy:`36`,r:`34`,stroke:e,strokeWidth:`3`,fill:`${e}18`}),(0,s.jsx)(`path`,{d:`M26 26l20 20M46 26L26 46`,stroke:e,strokeWidth:`4`,strokeLinecap:`round`})]}),warning:e=>(0,s.jsxs)(`svg`,{width:`72`,height:`72`,viewBox:`0 0 72 72`,fill:`none`,"aria-hidden":`true`,children:[(0,s.jsx)(`path`,{d:`M36 6L4 64h64L36 6z`,stroke:e,strokeWidth:`3`,fill:`${e}18`}),(0,s.jsx)(`path`,{d:`M36 30v16`,stroke:e,strokeWidth:`4`,strokeLinecap:`round`}),(0,s.jsx)(`circle`,{cx:`36`,cy:`54`,r:`2.5`,fill:e})]}),info:e=>(0,s.jsxs)(`svg`,{width:`72`,height:`72`,viewBox:`0 0 72 72`,fill:`none`,"aria-hidden":`true`,children:[(0,s.jsx)(`circle`,{cx:`36`,cy:`36`,r:`34`,stroke:e,strokeWidth:`3`,fill:`${e}18`}),(0,s.jsx)(`path`,{d:`M36 32v18`,stroke:e,strokeWidth:`4`,strokeLinecap:`round`}),(0,s.jsx)(`circle`,{cx:`36`,cy:`22`,r:`2.5`,fill:e})]}),404:e=>(0,s.jsxs)(`svg`,{width:`72`,height:`72`,viewBox:`0 0 72 72`,fill:`none`,"aria-hidden":`true`,children:[(0,s.jsx)(`circle`,{cx:`36`,cy:`36`,r:`34`,stroke:e,strokeWidth:`3`,fill:`${e}18`}),(0,s.jsx)(`text`,{x:`36`,y:`44`,textAnchor:`middle`,fontSize:`22`,fontWeight:`bold`,fill:e,children:`404`})]}),403:e=>(0,s.jsxs)(`svg`,{width:`72`,height:`72`,viewBox:`0 0 72 72`,fill:`none`,"aria-hidden":`true`,children:[(0,s.jsx)(`circle`,{cx:`36`,cy:`36`,r:`34`,stroke:e,strokeWidth:`3`,fill:`${e}18`}),(0,s.jsx)(`path`,{d:`M28 30h16v16H28z`,stroke:e,strokeWidth:`3`,fill:`none`}),(0,s.jsx)(`path`,{d:`M32 30v-4a4 4 0 018 0v4`,stroke:e,strokeWidth:`3`,fill:`none`})]}),500:e=>(0,s.jsxs)(`svg`,{width:`72`,height:`72`,viewBox:`0 0 72 72`,fill:`none`,"aria-hidden":`true`,children:[(0,s.jsx)(`circle`,{cx:`36`,cy:`36`,r:`34`,stroke:e,strokeWidth:`3`,fill:`${e}18`}),(0,s.jsx)(`text`,{x:`36`,y:`44`,textAnchor:`middle`,fontSize:`22`,fontWeight:`bold`,fill:e,children:`500`})]})};function Za(e,t){switch(e){case`success`:return t.success;case`error`:case`500`:return t.danger;case`warning`:return t.warning;case`info`:return t.info;case`404`:case`403`:return t.textMuted}}function Qa({status:e,title:i,subTitle:a,icon:o,extra:c}){let l=t.f(),u=r.o(),d=Za(e,l),f=n.m(i),p=a?n.m(a):void 0;return(0,s.jsxs)(`div`,{role:`status`,"aria-live":`polite`,className:n.a(`flex flex-col items-center text-center px-6 py-12 font-sans`),style:{animation:u?`none`:`tkxFadeIn 0.3s ease`},children:[(0,s.jsx)(`div`,{className:n.a(`mb-6`),children:o??Xa[e](d)}),(0,s.jsx)(`h2`,{className:n.a(`text-xl font-semibold m-0 mb-2`),style:{color:l.text},children:f}),p&&(0,s.jsx)(`p`,{className:n.a(`text-sm m-0 mb-6 max-w-md leading-relaxed`),style:{color:l.textMuted},children:p}),c&&(0,s.jsx)(`div`,{className:n.a(`flex items-center gap-3 mt-4`),children:c})]})}function $a(e){let t=document.querySelector(e);return t?t.getBoundingClientRect():null}function eo(e,t,n,r){switch(t){case`top`:return{top:e.top-r-12+window.scrollY,left:e.left+e.width/2-n/2+window.scrollX};case`bottom`:return{top:e.bottom+12+window.scrollY,left:e.left+e.width/2-n/2+window.scrollX};case`left`:return{top:e.top+e.height/2-r/2+window.scrollY,left:e.left-n-12+window.scrollX};case`right`:return{top:e.top+e.height/2-r/2+window.scrollY,left:e.right+12+window.scrollX};default:return{top:e.bottom+12+window.scrollY,left:e.left+window.scrollX}}}function to({steps:e,isOpen:i=!1,onClose:a,current:l,onChange:u}){let d=t.f(),f=r.o(),[p,m]=(0,o.useState)(0),h=l??p,g=(0,o.useRef)(null),[_,v]=(0,o.useState)({top:0,left:0}),[y,b]=(0,o.useState)(null),x=e[h],S=(0,o.useCallback)(()=>{if(!x)return;let e=$a(x.target);if(b(e),e&&g.current){let t=g.current.offsetWidth,n=g.current.offsetHeight;v(eo(e,x.placement??`bottom`,t,n))}},[x]);(0,o.useEffect)(()=>{if(i)return S(),window.addEventListener(`resize`,S),window.addEventListener(`scroll`,S,!0),()=>{window.removeEventListener(`resize`,S),window.removeEventListener(`scroll`,S,!0)}},[i,h,S]),(0,o.useEffect)(()=>{i&&g.current?.focus()},[i,h]);let C=(0,o.useCallback)(e=>{m(e),u?.(e)},[u]),w=(0,o.useCallback)(()=>{h<e.length-1?C(h+1):a?.()},[h,e.length,C,a]),T=(0,o.useCallback)(()=>{h>0&&C(h-1)},[h,C]);if(!i||!x)return null;let E=n.m(x.title),D=n.m(x.description);return(0,c.createPortal)((0,s.jsxs)(`div`,{"aria-hidden":`true`,children:[(0,s.jsx)(`div`,{style:{position:`fixed`,inset:0,zIndex:9998,backgroundColor:`rgba(0,0,0,0.55)`,clipPath:y?`polygon(0% 0%, 0% 100%, ${y.left-6}px 100%, ${y.left-6}px ${y.top-6}px, ${y.right+6}px ${y.top-6}px, ${y.right+6}px ${y.bottom+6}px, ${y.left-6}px ${y.bottom+6}px, ${y.left-6}px 100%, 100% 100%, 100% 0%)`:void 0,transition:f?`none`:`clip-path 0.25s ease`},onClick:a}),(0,s.jsxs)(`div`,{ref:g,role:`dialog`,"aria-modal":`true`,"aria-label":`Tour step ${h+1} of ${e.length}`,tabIndex:-1,style:{position:`absolute`,zIndex:9999,top:_.top,left:_.left,width:300,backgroundColor:d.surface,border:`1px solid ${d.border}`,borderRadius:10,padding:20,boxShadow:`0 8px 24px ${d.bg}80`,animation:f?`none`:`tkxFadeIn 0.2s ease`,fontFamily:`inherit`},onKeyDown:e=>{e.key===`Escape`&&a?.()},children:[(0,s.jsx)(`h3`,{className:n.a(`m-0 mb-2 text-base font-semibold`),style:{color:d.text},children:E}),(0,s.jsx)(`p`,{className:n.a(`m-0 mb-4 text-sm leading-relaxed`),style:{color:d.textMuted},children:D}),(0,s.jsx)(`div`,{className:n.a(`flex items-center gap-1 mb-4`),"aria-label":`Tour progress`,children:e.map((e,t)=>(0,s.jsx)(`span`,{"aria-hidden":`true`,style:{width:8,height:8,borderRadius:`50%`,backgroundColor:t===h?d.primary:d.border,transition:f?`none`:`background-color 0.2s`}},t))}),(0,s.jsxs)(`div`,{className:n.a(`flex items-center justify-between gap-2`),children:[(0,s.jsx)(`button`,{type:`button`,"aria-label":`Skip tour`,onClick:a,className:n.a(`border-0 bg-transparent cursor-pointer text-sm px-2 py-1`),style:{color:d.textMuted},children:`Skip`}),(0,s.jsxs)(`div`,{className:n.a(`flex gap-2`),children:[h>0&&(0,s.jsx)(`button`,{type:`button`,"aria-label":`Previous step`,onClick:T,className:n.a(`rounded-md border px-3 py-1 text-sm cursor-pointer bg-transparent`),style:{borderColor:d.border,color:d.text},children:`Prev`}),(0,s.jsx)(`button`,{type:`button`,"aria-label":h===e.length-1?`Finish tour`:`Next step`,onClick:w,className:n.a(`rounded-md border-0 px-4 py-1 text-sm cursor-pointer font-medium`),style:{backgroundColor:d.primary,color:`#fff`},children:h===e.length-1?`Finish`:`Next`})]})]})]})]}),document.body)}function no(e,t,n,r,i){let a=document.createElement(`canvas`),o=a.getContext(`2d`);if(!o)return``;let s=r*1.5,c=e.length*s,l=Math.max(...e.map(e=>e.length))*r*.6,u=n[0]+l,d=n[1]+c;return a.width=u*2,a.height=d*2,o.scale(2,2),o.translate(u/2,d/2),o.rotate(t*Math.PI/180),o.font=`${r}px sans-serif`,o.fillStyle=i,o.textAlign=`center`,o.textBaseline=`middle`,e.forEach((t,n)=>{let r=(n-(e.length-1)/2)*s;o.fillText(t,0,r)}),a.toDataURL()}function ro({text:e,children:i,rotate:a=-22,gap:c=[100,100],fontSize:l=14,color:u,zIndex:d=10}){let f=t.f(),p=r.o(),m=(0,o.useRef)(null),[h,g]=(0,o.useState)(``),_=(0,o.useMemo)(()=>(Array.isArray(e)?e:[e]).map(e=>n.m(e)),[e]),v=u??`${f.textMuted}22`,y=(0,o.useCallback)(()=>no(_,a,c,l,v),[_,a,c,l,v]);return(0,o.useEffect)(()=>{let e=y();e&&g(`url(${e})`)},[y]),(0,o.useEffect)(()=>{let e=m.current?.querySelector(`[data-watermark]`);if(!e)return;let t=new MutationObserver(()=>{let t=y();t&&(e.style.backgroundImage=`url(${t})`)});return t.observe(e,{attributes:!0,attributeFilter:[`style`]}),()=>t.disconnect()},[y]),(0,s.jsxs)(`div`,{ref:m,className:n.a(`relative`),style:{overflow:`hidden`},children:[i,(0,s.jsx)(`div`,{"data-watermark":!0,"aria-hidden":`true`,className:n.a(`absolute inset-0 pointer-events-none`),style:{zIndex:d,backgroundImage:h,backgroundRepeat:`repeat`,animation:p?`none`:`tkxFadeIn 0.3s ease`}})]})}function io(e){if(e)try{return e()}catch{return window}return window}function ao(e){if(e instanceof Window)return{top:0,bottom:e.innerHeight};let t=e.getBoundingClientRect();return{top:t.top,bottom:t.bottom}}function oo({children:e,offsetTop:i,offsetBottom:a,onChange:c,target:l}){let u=t.f(),d=r.o(),f=(0,o.useRef)(null),p=(0,o.useRef)(null),[m,h]=(0,o.useState)(!1),[g,_]=(0,o.useState)({width:0,height:0}),v=(0,o.useRef)(!1),y=(0,o.useMemo)(()=>n.m(`Sticky content`),[]),b=(0,o.useCallback)(()=>{let e=f.current;if(!e)return;let t=e.getBoundingClientRect(),n=ao(io(l)),r=!1;i===void 0?a!==void 0&&(r=n.bottom-t.bottom<=a):r=t.top-n.top<=i,r!==v.current&&(v.current=r,h(r),_({width:t.width,height:t.height}),c?.(r))},[i,a,c,l]);(0,o.useEffect)(()=>{let e=io(l);return b(),e.addEventListener(`scroll`,b,{passive:!0}),window.addEventListener(`resize`,b),()=>{e.removeEventListener(`scroll`,b),window.removeEventListener(`resize`,b)}},[b,l]);let x=m?{position:`fixed`,zIndex:100,...i===void 0?{}:{top:i},...a===void 0?{}:{bottom:a},width:g.width||void 0,transition:d?`none`:`box-shadow 0.2s ease`,boxShadow:`0 2px 8px ${u.border}`}:{};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`div`,{ref:f,"aria-hidden":m,style:m?{height:g.height,width:g.width}:{}}),(0,s.jsx)(`div`,{ref:p,role:`region`,"aria-label":y,className:n.a(m?`tkx-affixed`:``),style:x,children:e})]})}function so(e){let t=[];for(let n of e)t.push(n),n.children&&t.push(...so(n.children));return t}function co(e){return e.startsWith(`#`)?e.slice(1):e}function lo({item:e,activeKey:t,depth:r,onClick:i,theme:a,reducedMotion:o}){let c=e.key===t,l=n.m(e.title);return(0,s.jsxs)(`li`,{role:`none`,style:{listStyle:`none`},children:[(0,s.jsx)(`a`,{role:`treeitem`,"aria-current":c?`location`:void 0,href:e.href,onClick:t=>{t.preventDefault(),i(e.href)},className:n.a(`block text-sm py-1 no-underline`),style:{paddingLeft:12+r*16,color:c?a.primary:a.textMuted,fontWeight:c?600:400,borderLeft:`2px solid ${c?a.primary:`transparent`}`,transition:o?`none`:`color 0.15s ease, border-color 0.15s ease`},children:l}),e.children&&e.children.length>0&&(0,s.jsx)(`ul`,{role:`group`,style:{margin:0,padding:0},children:e.children.map(e=>(0,s.jsx)(lo,{item:e,activeKey:t,depth:r+1,onClick:i,theme:a,reducedMotion:o},e.key))})]})}function uo({items:e,offsetTop:i=0,getCurrentAnchor:a,onChange:c}){let l=t.f(),u=r.o(),[d,f]=(0,o.useState)(e[0]?.key??``),p=(0,o.useRef)(!1),m=so(e),h=(0,o.useCallback)(()=>{if(p.current)return;let e=m[0]?.key??``;for(let t of m){let n=co(t.href),r=document.getElementById(n);r&&r.getBoundingClientRect().top<=i+10&&(e=t.key)}a&&(e=a(e)),e!==d&&(f(e),c?.(e))},[m,i,a,d,c]);(0,o.useEffect)(()=>(window.addEventListener(`scroll`,h,{passive:!0}),h(),()=>window.removeEventListener(`scroll`,h)),[h]);let g=(0,o.useCallback)(e=>{let t=co(e),n=document.getElementById(t);if(!n)return;p.current=!0;let r=n.getBoundingClientRect().top+window.scrollY-i;window.scrollTo({top:r,behavior:u?`auto`:`smooth`});let a=m.find(t=>t.href===e);a&&(f(a.key),c?.(a.key)),setTimeout(()=>{p.current=!1},800)},[m,i,u,c]);return(0,s.jsx)(`nav`,{role:`tree`,"aria-label":`Anchor navigation`,className:n.a(`font-sans`),style:{borderLeft:`1px solid ${l.border}`,padding:`4px 0`},children:(0,s.jsx)(`ul`,{role:`group`,style:{margin:0,padding:0},children:e.map(e=>(0,s.jsx)(lo,{item:e,activeKey:d,depth:0,onClick:g,theme:l,reducedMotion:u},e.key))})})}function fo(e,t){let n=[e],r=e;for(let e of t){let t=r.find(t=>t.value===e);if(t?.children?.length)n.push(t.children),r=t.children;else break}return n}function po(e,t){let n=[],r=e;for(let e of t){let t=r.find(t=>t.value===e);if(t)n.push(t),r=t.children??[];else break}return n}function mo(e,t){return po(e,t).map(e=>n.m(e.label)).join(` / `)}function ho({options:e,value:i=[],onChange:a,placeholder:l=`Select...`,label:u,multiple:d=!1}){let f=t.f(),p=r.o(),m=(0,o.useRef)(null),h=(0,o.useRef)(null),[g,_]=(0,o.useState)(!1),[v,y]=(0,o.useState)(i),[b,x]=(0,o.useState)({top:0,left:0,width:0}),S=u?n.m(u):void 0,C=n.m(l),w=i.length>0?mo(e,i):``;(0,o.useEffect)(()=>{if(!g||!m.current)return;let e=m.current.getBoundingClientRect();x({top:e.bottom+4+window.scrollY,left:e.left+window.scrollX,width:Math.max(e.width,200)})},[g]),(0,o.useEffect)(()=>{if(!g)return;let e=e=>{!m.current?.contains(e.target)&&!h.current?.contains(e.target)&&_(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[g]);let T=(0,o.useCallback)((t,n)=>{if(n.disabled)return;let r=[...v.slice(0,t),n.value];if(y(r),!n.children?.length){let t=po(e,r);a?.(r,t),d||_(!1)}},[v,e,a,d]),E=(0,o.useCallback)(e=>{e.key===`Escape`?(_(!1),m.current?.focus()):(e.key===`Enter`||e.key===` `)&&(g||(e.preventDefault(),_(!0)))},[g]),D=fo(e,v),O=g?(0,c.createPortal)((0,s.jsx)(`div`,{ref:h,role:`tree`,"aria-label":S??`Cascader options`,className:n.a(`flex rounded-lg border overflow-hidden`),style:{position:`absolute`,zIndex:9999,top:b.top,left:b.left,backgroundColor:f.surface,borderColor:f.border,boxShadow:`0 4px 16px ${f.bg}80`,animation:p?`none`:`tkxFadeIn 0.15s ease`},children:D.map((e,t)=>(0,s.jsx)(`ul`,{role:`group`,className:n.a(`m-0 p-0 overflow-auto`),style:{listStyle:`none`,minWidth:160,maxHeight:260,borderRight:t<D.length-1?`1px solid ${f.border}`:`none`},children:e.map(e=>{let r=v[t]===e.value,i=n.m(e.label);return(0,s.jsxs)(`li`,{role:`treeitem`,"aria-selected":r,"aria-disabled":e.disabled||void 0,"aria-expanded":e.children?.length?r:void 0,className:n.a(`flex items-center justify-between px-3 py-2 cursor-pointer text-sm`),style:{backgroundColor:r?f.surfaceAlt:`transparent`,color:e.disabled?f.textMuted:f.text,opacity:e.disabled?.5:1,cursor:e.disabled?`not-allowed`:`pointer`},onClick:()=>T(t,e),onMouseEnter:()=>{e.disabled||y(n=>[...n.slice(0,t),e.value])},children:[(0,s.jsx)(`span`,{children:i}),e.children&&e.children.length>0&&(0,s.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,style:{color:f.textMuted,flexShrink:0},children:(0,s.jsx)(`path`,{d:`M10 6l6 6-6 6V6z`})})]},e.value)})},t))}),document.body):null;return(0,s.jsxs)(`div`,{className:n.a(`relative font-sans`),onKeyDown:E,children:[S&&(0,s.jsx)(`label`,{className:n.a(`block text-sm font-medium mb-1`),style:{color:f.text},children:S}),(0,s.jsxs)(`button`,{ref:m,type:`button`,role:`combobox`,"aria-expanded":g,"aria-haspopup":`tree`,"aria-label":S??`Cascader`,className:n.a(`w-full flex items-center justify-between rounded-lg border px-3 py-2 text-sm cursor-pointer`),style:{backgroundColor:f.surface,borderColor:g?f.primary:f.border,color:w?f.text:f.textMuted,outline:`none`,minHeight:38,textAlign:`left`},onClick:()=>_(e=>!e),children:[(0,s.jsx)(`span`,{className:n.a(`truncate`),children:w||C}),(0,s.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,style:{color:f.textMuted,transform:g?`rotate(180deg)`:`rotate(0deg)`,transition:p?`none`:`transform 0.2s ease`,flexShrink:0},children:(0,s.jsx)(`path`,{d:`M7 10l5 5 5-5H7z`})})]}),O]})}var go={sm:`8px 12px`,md:`12px 16px`,lg:`16px 20px`};function _o({theme:e,reducedMotion:t}){return(0,s.jsxs)(`div`,{className:n.a(`flex items-center gap-3 px-4 py-3`),"aria-hidden":`true`,children:[(0,s.jsx)(`div`,{style:{width:40,height:40,borderRadius:`50%`,backgroundColor:e.surfaceAlt,animation:t?`none`:`tkxPulse 1.5s ease infinite`}}),(0,s.jsxs)(`div`,{className:n.a(`flex-1`),children:[(0,s.jsx)(`div`,{style:{width:`60%`,height:14,borderRadius:4,backgroundColor:e.surfaceAlt,marginBottom:8,animation:t?`none`:`tkxPulse 1.5s ease infinite`}}),(0,s.jsx)(`div`,{style:{width:`40%`,height:12,borderRadius:4,backgroundColor:e.surfaceAlt,animation:t?`none`:`tkxPulse 1.5s ease infinite`}})]})]})}function vo({items:e,header:i,footer:a,bordered:o=!0,size:c=`md`,loading:l=!1,emptyText:u=`No data`,grid:d}){let f=t.f(),p=r.o(),m=n.m(u),h=go[c],g=!!d,_=d?.column??1,v=d?.gutter??16;return(0,s.jsxs)(`div`,{role:`list`,"aria-label":`List`,"aria-busy":l,className:n.a(`font-sans rounded-lg overflow-hidden`),style:{border:o?`1px solid ${f.border}`:`none`,backgroundColor:f.surface},children:[i&&(0,s.jsx)(`div`,{className:n.a(`font-semibold text-sm`),style:{padding:h,color:f.text,borderBottom:`1px solid ${f.border}`,backgroundColor:f.surfaceAlt},children:i}),l&&(0,s.jsx)(`div`,{children:Array.from({length:3}).map((e,t)=>(0,s.jsx)(_o,{theme:f,reducedMotion:p},t))}),!l&&e.length===0&&(0,s.jsx)(`div`,{role:`status`,className:n.a(`text-center py-12 text-sm`),style:{color:f.textMuted},children:m}),!l&&e.length>0&&(0,s.jsx)(`div`,{style:g?{display:`grid`,gridTemplateColumns:`repeat(${_}, 1fr)`,gap:v,padding:v}:void 0,children:e.map((t,r)=>{let i=n.m(t.title),a=t.description?n.m(t.description):void 0;return(0,s.jsxs)(`div`,{role:`listitem`,className:n.a(`flex items-start gap-3`),style:{padding:h,borderBottom:!g&&r<e.length-1?`1px solid ${f.border}`:`none`,...g?{border:`1px solid ${f.border}`,borderRadius:8,backgroundColor:f.surface}:{},animation:p?`none`:`tkxFadeIn 0.2s ease ${r*.03}s both`},children:[t.avatar&&(0,s.jsx)(`div`,{"aria-hidden":`true`,className:n.a(`shrink-0`),children:t.avatar}),(0,s.jsxs)(`div`,{className:n.a(`flex-1 min-w-0`),children:[(0,s.jsx)(`div`,{className:n.a(`text-sm font-medium`),style:{color:f.text},children:i}),a&&(0,s.jsx)(`div`,{className:n.a(`text-xs mt-1 leading-relaxed`),style:{color:f.textMuted},children:a})]}),t.extra&&(0,s.jsx)(`div`,{className:n.a(`shrink-0 ml-auto`),style:{color:f.textMuted},children:t.extra}),t.actions&&(0,s.jsx)(`div`,{className:n.a(`shrink-0 flex items-center gap-2`),children:t.actions})]},t.key)})}),a&&(0,s.jsx)(`div`,{className:n.a(`text-sm`),style:{padding:h,color:f.textMuted,borderTop:`1px solid ${f.border}`,backgroundColor:f.surfaceAlt},children:a})]})}function yo({locale:e=`en-US`,direction:t,strings:n,children:r}){let i=(0,o.useMemo)(()=>{let r=a.LOCALES[e]??a.enUS,i=n?{...r,...n}:r;return{locale:e,direction:t??(a.isRTL(e)?`rtl`:`ltr`),strings:i}},[e,t,n]);return(0,s.jsx)(a.I18nContext.Provider,{value:i,children:(0,s.jsx)(`div`,{dir:i.direction,style:{direction:i.direction,display:`contents`},children:r})})}function bo({contentId:e=`tkx-main-content`,label:t=`Skip to main content`}){return(0,s.jsx)(`a`,{href:`#${e}`,className:`tkx-skip-nav`,children:t})}function xo({politeness:e=`polite`,children:t,atomic:n=!0}){return(0,s.jsx)(`div`,{role:`status`,"aria-live":e,"aria-atomic":n,className:`tkx-sr-only`,children:t})}function So({active:e,children:t,as:n=`div`}){return(0,s.jsx)(n,{ref:r.i(e),children:t})}function Co({as:e,children:t,...n}){return(0,s.jsx)(e??`span`,{className:`tkx-sr-only`,...n,children:t})}function wo(e,t,n,r){let i=e.getBoundingClientRect(),a=t?t.offsetHeight:320,o=t?t.offsetWidth:200,s=window.innerWidth,c=window.innerHeight,l=window.scrollX,u=window.scrollY,d=0,f=0;switch(n){case`bottom-start`:d=i.bottom+u+r,f=i.left+l;break;case`bottom-end`:d=i.bottom+u+r,f=i.right+l-o;break;case`top-start`:d=i.top+u-r-a,f=i.left+l;break;case`top-end`:d=i.top+u-r-a,f=i.right+l-o;break;case`right`:d=i.top+u,f=i.right+l+r;break;case`left`:d=i.top+u,f=i.left+l-r-o;break;default:d=i.bottom+u+r,f=i.left+l}return n.startsWith(`bottom`)&&i.bottom+a>c&&(d=i.top+u-r-a),n.startsWith(`top`)&&i.top-a<0&&(d=i.bottom+u+r),f+o>s+l&&(f=s+l-o-8),f<l&&(f=l+8),{top:d,left:f,minWidth:i.width}}function To(e,t){if(!t)return e;let n=e.toLowerCase().indexOf(t.toLowerCase());return n===-1?e:(0,s.jsxs)(s.Fragment,{children:[e.slice(0,n),(0,s.jsx)(`mark`,{style:{background:`rgba(0,245,212,0.3)`,color:`inherit`,borderRadius:2},children:e.slice(n,n+t.length)}),e.slice(n+t.length)]})}function Eo(e,t){let n=[];for(let r of e)for(let e of r.items)e.disabled||(!t||e.label.toLowerCase().includes(t.toLowerCase()))&&n.push(e);return n}function Do({groups:e,position:r,maxHeight:i,minWidth:a,selectedKeys:c,multiSelect:l,searchable:u,searchPlaceholder:d,onSelect:f,onClose:p,renderItem:m,menuRef:h,isPortal:g,menuId:_}){let v=t.f(),[y,b]=(0,o.useState)(``),[x,S]=(0,o.useState)(0),[C,w]=(0,o.useState)(null),[T,E]=(0,o.useState)(0),D=(0,o.useRef)(null),O=(0,o.useRef)([]),k=(0,o.useRef)([]),A=y?e.map(e=>({...e,items:e.items.filter(e=>e.label.toLowerCase().includes(y.toLowerCase())||e.description?.toLowerCase().includes(y.toLowerCase())||e.children?.some(e=>e.label.toLowerCase().includes(y.toLowerCase())))})).filter(e=>e.items.length>0):e,j=Eo(A,y);(0,o.useEffect)(()=>{u&&D.current?D.current.focus():O.current[0]?.focus(),S(0)},[u]),(0,o.useEffect)(()=>{(!u||y!==``)&&O.current[x]?.focus()},[x,u,y]);let M=(0,o.useCallback)(e=>{switch(e.key){case`ArrowDown`:if(e.preventDefault(),C){let e=(j.find(e=>e.key===C)?.children??[]).filter(e=>!e.disabled);E(t=>Math.min(t+1,e.length-1))}else S(e=>Math.min(e+1,j.length-1));break;case`ArrowUp`:e.preventDefault(),C?E(e=>Math.max(e-1,0)):S(e=>Math.max(e-1,0));break;case`ArrowRight`:{e.preventDefault();let t=j[x];t?.children?.length&&(w(t.key),E(0));break}case`ArrowLeft`:e.preventDefault(),w(null);break;case`Enter`:case` `:if(e.preventDefault(),C){let e=(j.find(e=>e.key===C)?.children??[]).filter(e=>!e.disabled)[T];e&&f(e.key,e)}else{let e=j[x];e&&f(e.key,e)}break;case`Escape`:e.preventDefault(),C?w(null):p();break;case`Tab`:p();break;default:break}},[j,x,p,f,C,T]);(0,o.useEffect)(()=>{C&&k.current[T]?.focus()},[T,C]);let N={position:g?`fixed`:`absolute`,top:g?r.top:void 0,left:g?r.left:void 0,minWidth:Math.max(a,r.minWidth),maxHeight:i,overflowY:`auto`,background:v.surface,border:`1px solid ${v.border}`,borderRadius:8,boxShadow:`0 8px 32px rgba(0,0,0,0.4)`,zIndex:9999,outline:`none`,transformOrigin:`top left`,animation:`tkx-dropdown-in 150ms ease forwards`},P=0;return(0,s.jsxs)(`div`,{ref:h,id:_,role:`menu`,"aria-label":`Dropdown menu`,tabIndex:-1,style:N,onKeyDown:M,children:[(0,s.jsx)(`style`,{children:`
125
- @keyframes tkx-dropdown-in {
126
- from { opacity: 0; transform: scale(0.95); }
127
- to { opacity: 1; transform: scale(1); }
128
- }
129
- `}),u&&(0,s.jsx)(`div`,{style:{padding:`8px 8px 4px`},children:(0,s.jsx)(`input`,{ref:D,type:`text`,value:y,onChange:e=>{b(e.target.value),S(0)},placeholder:d,"aria-label":`Search items`,style:{width:`100%`,boxSizing:`border-box`,padding:`6px 10px`,background:v.surfaceAlt,border:`1px solid ${v.border}`,borderRadius:6,color:v.text,fontSize:13,outline:`none`}})}),A.length===0&&(0,s.jsx)(`div`,{style:{padding:`12px 16px`,color:v.textMuted,fontSize:13,textAlign:`center`},children:`No results found`}),A.map((e,t)=>(0,s.jsxs)(`div`,{role:`group`,"aria-label":e.label,children:[e.label&&(0,s.jsx)(`div`,{style:{padding:`8px 12px 4px`,fontSize:11,fontWeight:600,letterSpacing:`0.06em`,textTransform:`uppercase`,color:v.textMuted},children:n.m(e.label)}),e.items.map(e=>{let t=P;e.disabled||P++;let n=c.includes(e.key),r=t===x&&!e.disabled,i=!!e.children?.length,a=C===e.key,o=m?m(e,n):(0,s.jsx)(Oo,{item:e,isSelected:n,isFocused:r,multiSelect:l,query:y,theme:v,hasSubmenu:i});return(0,s.jsxs)(`div`,{children:[e.divider&&(0,s.jsx)(`div`,{role:`separator`,style:{height:1,background:v.border,margin:`4px 0`}}),(0,s.jsxs)(`div`,{ref:e=>{O.current[t]=e},role:`menuitem`,"aria-disabled":e.disabled,"aria-checked":l?n:void 0,"aria-selected":l?void 0:n,"aria-haspopup":i?`menu`:void 0,"aria-expanded":i?a:void 0,tabIndex:e.disabled?-1:0,style:{position:`relative`,cursor:e.disabled?`not-allowed`:`pointer`,opacity:e.disabled?.5:1},onClick:()=>{e.disabled||(i?(w(a?null:e.key),E(0)):f(e.key,e))},onMouseEnter:()=>{e.disabled||(S(t),i?(w(e.key),E(0)):w(null))},onFocus:()=>{e.disabled||S(t)},children:[o,i&&a&&(0,s.jsx)(`div`,{role:`menu`,style:{position:`absolute`,top:0,left:`100%`,minWidth:180,background:v.surface,border:`1px solid ${v.border}`,borderRadius:8,boxShadow:`0 8px 32px rgba(0,0,0,0.4)`,zIndex:1e4,animation:`tkx-dropdown-in 120ms ease forwards`},children:e.children.map((e,t)=>{let n=c.includes(e.key),r=t===T;return(0,s.jsx)(`div`,{ref:e=>{k.current[t]=e},role:`menuitem`,"aria-disabled":e.disabled,"aria-selected":n,tabIndex:e.disabled?-1:0,style:{cursor:e.disabled?`not-allowed`:`pointer`,opacity:e.disabled?.5:1},onClick:t=>{t.stopPropagation(),e.disabled||f(e.key,e)},onMouseEnter:()=>E(t),children:(0,s.jsx)(Oo,{item:e,isSelected:n,isFocused:r,multiSelect:l,query:y,theme:v,hasSubmenu:!1})},e.key)})})]})]},e.key)})]},t))]})}function Oo({item:e,isSelected:t,isFocused:n,multiSelect:r,query:i,theme:a,hasSubmenu:o}){return(0,s.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,padding:`8px 12px`,background:n?e.danger?`${a.danger}20`:`${a.primary}18`:`transparent`,transition:`background 80ms`,color:e.danger?a.danger:a.text,fontSize:14,userSelect:`none`},children:[r&&(0,s.jsx)(`div`,{style:{width:16,height:16,border:`2px solid ${t?a.primary:a.border}`,borderRadius:4,background:t?a.primary:`transparent`,display:`flex`,alignItems:`center`,justifyContent:`center`,flexShrink:0,transition:`all 120ms`},children:t&&(0,s.jsx)(`svg`,{width:`10`,height:`8`,viewBox:`0 0 10 8`,fill:`none`,children:(0,s.jsx)(`path`,{d:`M1 4l3 3L9 1`,stroke:a.bg,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),e.icon&&(0,s.jsx)(`span`,{style:{display:`flex`,alignItems:`center`,flexShrink:0,color:e.danger?a.danger:a.textMuted},children:e.icon}),(0,s.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,s.jsx)(`div`,{style:{fontWeight:t&&!r?600:400},children:To(e.label,i)}),e.description&&(0,s.jsx)(`div`,{style:{fontSize:12,color:a.textMuted,marginTop:1},children:To(e.description,i)})]}),e.badge!==void 0&&(0,s.jsx)(`span`,{style:{background:a.primary,color:a.bg,fontSize:11,fontWeight:700,borderRadius:10,padding:`1px 7px`,flexShrink:0},children:e.badge}),e.shortcut&&!o&&(0,s.jsx)(`span`,{style:{fontSize:12,color:a.textMuted,flexShrink:0},children:e.shortcut}),o&&(0,s.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,fill:`none`,style:{flexShrink:0},children:(0,s.jsx)(`path`,{d:`M4 2l4 4-4 4`,stroke:a.textMuted,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})}),!r&&t&&(0,s.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 14 14`,fill:`none`,style:{flexShrink:0},children:(0,s.jsx)(`path`,{d:`M2 7l4 4L12 3`,stroke:a.primary,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})]})}function ko({trigger:e,items:t,groups:n,placement:r=`bottom-start`,onSelect:i,selectedKeys:a,multiSelect:l=!1,searchable:u=!1,searchPlaceholder:d=`Search…`,closeOnSelect:f,disabled:p=!1,maxHeight:m=320,minWidth:h=200,open:g,onOpenChange:_,portal:v=!0,offset:y=6,renderItem:b}){let[x,S]=(0,o.useState)(!1),[C,w]=(0,o.useState)([]),[T,E]=(0,o.useState)({top:0,left:0,minWidth:h}),D=(0,o.useRef)(null),O=(0,o.useRef)(null),k=(0,o.useId)(),A=g===void 0?x:g,j=a===void 0?C:a,M=f===void 0?!l:f,N=n??(t?[{items:t}]:[{items:[]}]),P=(0,o.useCallback)(e=>{g===void 0&&S(e),_?.(e)},[g,_]),F=(0,o.useCallback)((e,t)=>{l&&a===void 0&&w(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),i?.(e,t),M&&P(!1)},[l,a,i,M,P]),I=(0,o.useCallback)(()=>P(!1),[P]);(0,o.useEffect)(()=>{A&&D.current&&E(wo(D.current,O.current,r,y))},[A,r,y]),(0,o.useEffect)(()=>{A&&D.current&&O.current&&E(wo(D.current,O.current,r,y))},[A,r,y]),(0,o.useEffect)(()=>{if(!A)return;let e=e=>{let t=e.target;D.current&&!D.current.contains(t)&&O.current&&!O.current.contains(t)&&P(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[A,P]);let L=()=>{p||P(!A)},R=A?(0,s.jsx)(Do,{groups:N,position:T,maxHeight:m,minWidth:h,selectedKeys:j,multiSelect:l,searchable:u,searchPlaceholder:d,onSelect:F,onClose:I,renderItem:b,menuRef:O,isPortal:v,menuId:k}):null;return(0,s.jsxs)(`div`,{style:{display:`inline-block`,position:`relative`},children:[(0,s.jsx)(`div`,{ref:D,onClick:L,"aria-haspopup":`menu`,"aria-expanded":A,"aria-controls":A?k:void 0,"aria-disabled":p,style:{cursor:p?`not-allowed`:`pointer`,opacity:p?.5:1,display:`inline-block`},children:e}),v&&typeof document<`u`?(0,c.createPortal)(R,document.body):R]})}var Ao={sm:4,md:8,lg:12};function jo(e,t){return e>=80?`#10b981`:e>=55?t:e>=30?`#f59e0b`:`#ef4444`}function Mo({value:e,label:r,showLabel:i=!0,size:a=`md`,animate:c=!0,className:l,style:u}){let d=t.f(),f=(0,o.useRef)(null),p=Math.max(0,Math.min(100,e)),m=jo(p,d.primary),h=Ao[a];(0,o.useEffect)(()=>{if(!c||!f.current)return;let e=f.current;e.style.width=`0%`;let t=requestAnimationFrame(()=>{e.style.transition=`width 0.9s cubic-bezier(0.4, 0, 0.2, 1)`,e.style.width=`${p}%`});return()=>cancelAnimationFrame(t)},[p,c]);let g=typeof p==`number`?`${p.toFixed(0)}% AI confidence${r?` for ${r}`:``}`:r;return(0,s.jsxs)(`div`,{className:n.t(n.a(`flex flex-col gap-1`),l),style:u,role:`meter`,"aria-valuenow":p,"aria-valuemin":0,"aria-valuemax":100,"aria-label":g,children:[(r||i)&&(0,s.jsxs)(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:4},children:[r&&(0,s.jsx)(`span`,{style:{fontSize:12,fontWeight:600,color:d.textMuted},children:r}),i&&(0,s.jsxs)(`span`,{style:{fontSize:12,fontWeight:700,color:m,marginLeft:`auto`},children:[p.toFixed(0),`%`]})]}),(0,s.jsxs)(`div`,{style:{height:h,borderRadius:h,background:`${d.border}`,overflow:`hidden`,position:`relative`},children:[(0,s.jsx)(`div`,{style:{position:`absolute`,inset:0,background:`linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.12) 50%, transparent 100%)`,backgroundSize:`200% 100%`,animation:`tkx-ai-shimmer 2s linear infinite`,pointerEvents:`none`,zIndex:1}}),(0,s.jsx)(`div`,{ref:f,style:{height:`100%`,width:c?`0%`:`${p}%`,background:`linear-gradient(90deg, ${m}cc, ${m})`,borderRadius:h,boxShadow:`0 0 8px ${m}66`,transition:c?void 0:`width 0.3s ease`}})]}),(0,s.jsxs)(`div`,{style:{fontSize:10,color:d.textMuted,marginTop:2,display:`flex`,gap:4,alignItems:`center`},children:[(0,s.jsx)(`span`,{style:{width:6,height:6,borderRadius:`50%`,background:m,display:`inline-block`,flexShrink:0}}),p>=80?`High confidence`:p>=55?`Moderate confidence`:p>=30?`Low confidence`:`Very low — review manually`]}),(0,s.jsx)(`style`,{children:`
130
- @keyframes tkx-ai-shimmer {
131
- 0% { background-position: -200% 0; }
132
- 100% { background-position: 200% 0; }
133
- }
134
- `})]})}function No(e,t){return e>=80?`#10b981`:e>=55?t:e>=30?`#f59e0b`:`#ef4444`}function Po({src:e,name:n,size:r=32}){let i=t.f(),a=n?n.split(` `).map(e=>e[0]).join(``).slice(0,2).toUpperCase():`?`;return e?(0,s.jsx)(`img`,{src:e,alt:n??`avatar`,width:r,height:r,style:{borderRadius:`50%`,objectFit:`cover`,flexShrink:0}}):(0,s.jsx)(`div`,{style:{width:r,height:r,borderRadius:`50%`,flexShrink:0,background:`${i.primary}22`,border:`1px solid ${i.primary}44`,display:`flex`,alignItems:`center`,justifyContent:`center`,fontSize:r*.35,fontWeight:700,color:i.primary},children:a})}function Fo({role:e,content:r,avatar:i,name:a,timestamp:c,streaming:l=!1,confidence:u,copyable:d=!1,className:f,style:p}){let m=t.f(),h=e===`user`,g=e===`system`,_=typeof r==`string`?n.m(r):``,[v,y]=(0,o.useState)(l?``:_),[b,x]=(0,o.useState)(!1),[S,C]=(0,o.useState)(l?``:_),w=(0,o.useRef)(0),T=(0,o.useRef)(null);(0,o.useEffect)(()=>{if(!l||typeof r!=`string`){C(_);return}w.current=0,y(``),C(``);let e=setInterval(()=>{w.current++;let t=_.slice(0,w.current);y(t),T.current&&clearTimeout(T.current),T.current=setTimeout(()=>C(t),350),w.current>=_.length&&(clearInterval(e),T.current&&clearTimeout(T.current),C(_))},18);return()=>{clearInterval(e),T.current&&clearTimeout(T.current)}},[_,l,r]);let E=()=>{navigator.clipboard?.writeText(_),x(!0),setTimeout(()=>x(!1),2e3)};if(g)return(0,s.jsx)(`div`,{style:{display:`flex`,justifyContent:`center`,padding:`8px 0`},children:(0,s.jsx)(`div`,{style:{padding:`6px 16px`,borderRadius:999,fontSize:12,background:`${m.border}`,color:m.textMuted,fontStyle:`italic`},children:typeof r==`string`?n.m(r):r})});let D={maxWidth:`75%`,padding:`12px 16px`,borderRadius:h?`18px 18px 4px 18px`:`18px 18px 18px 4px`,background:h?`linear-gradient(135deg, ${m.primary}, ${m.primary}cc)`:`${m.surface}`,border:h?`none`:`1px solid ${m.border}`,color:h?`#fff`:m.text,fontSize:14,lineHeight:1.65,boxShadow:h?`0 4px 16px -4px ${m.primary}55`:`0 2px 8px -2px rgba(0,0,0,0.2)`,position:`relative`,wordBreak:`break-word`};return(0,s.jsxs)(`div`,{className:n.t(n.a(`flex gap-2`),f),style:{flexDirection:h?`row-reverse`:`row`,alignItems:`flex-end`,...p},children:[(0,s.jsx)(Po,{src:i,name:a??(h?`You`:`AI`)}),(0,s.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4,alignItems:h?`flex-end`:`flex-start`},children:[(a||c)&&(0,s.jsxs)(`div`,{style:{display:`flex`,gap:8,alignItems:`center`,paddingInline:4},children:[a&&(0,s.jsx)(`span`,{style:{fontSize:11,fontWeight:700,color:m.textMuted},children:a}),c&&(0,s.jsx)(`span`,{style:{fontSize:10,color:m.textMuted},children:c})]}),(0,s.jsxs)(`div`,{style:D,role:`article`,"aria-label":h?`Your message`:`Assistant message`,children:[typeof r==`string`?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`span`,{"aria-hidden":l?`true`:void 0,children:l?v:n.m(r)}),l&&v.length<_.length&&(0,s.jsx)(`span`,{"aria-hidden":`true`,style:{display:`inline-block`,width:2,height:14,background:h?`#fff`:m.primary,marginLeft:2,animation:`tkx-blink 1s step-end infinite`,verticalAlign:`text-bottom`}}),l&&(0,s.jsx)(`span`,{"aria-live":`polite`,"aria-atomic":`false`,style:{position:`absolute`,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0,0,0,0)`,whiteSpace:`nowrap`,border:0},children:S})]}):r,d&&!h&&(0,s.jsx)(`button`,{onClick:E,title:`Copy message`,style:{position:`absolute`,top:8,right:8,background:`none`,border:`none`,cursor:`pointer`,fontSize:13,color:b?`#10b981`:m.textMuted,padding:`2px 4px`,borderRadius:4,transition:`color 0.2s`},children:b?`✓`:`⎘`})]}),!h&&u!==void 0&&(0,s.jsx)(`div`,{style:{paddingInline:4,width:`100%`,maxWidth:240},children:(0,s.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,s.jsx)(`div`,{style:{flex:1,height:3,borderRadius:3,background:m.border,overflow:`hidden`},children:(0,s.jsx)(`div`,{style:{height:`100%`,width:`${u}%`,background:No(u,m.primary),borderRadius:3,transition:`width 0.8s ease`}})}),(0,s.jsxs)(`span`,{style:{fontSize:10,color:m.textMuted,whiteSpace:`nowrap`},children:[u,`% confident`]})]})})]}),(0,s.jsx)(`style`,{children:`
135
- @keyframes tkx-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
136
- `})]})}function Io({color:e}){return(0,s.jsx)(`div`,{style:{display:`flex`,gap:4,alignItems:`center`},children:[0,1,2].map(t=>(0,s.jsx)(`div`,{style:{width:7,height:7,borderRadius:`50%`,background:e,animation:`tkx-thinking-dot 1.2s ease-in-out ${t*.18}s infinite`}},t))})}function Lo({color:e}){return(0,s.jsxs)(`div`,{style:{position:`relative`,width:24,height:24},children:[(0,s.jsx)(`div`,{style:{position:`absolute`,inset:0,borderRadius:`50%`,background:e,opacity:.15,animation:`tkx-thinking-pulse 1.5s ease-out infinite`}}),(0,s.jsx)(`div`,{style:{position:`absolute`,inset:4,borderRadius:`50%`,background:e,opacity:.6,animation:`tkx-thinking-pulse 1.5s ease-out 0.3s infinite`}}),(0,s.jsx)(`div`,{style:{position:`absolute`,inset:8,borderRadius:`50%`,background:e}})]})}function Ro({color:e}){return(0,s.jsx)(`div`,{style:{display:`flex`,gap:3,alignItems:`center`,height:20},children:[0,1,2,3,4].map(t=>(0,s.jsx)(`div`,{style:{width:3,borderRadius:3,background:e,animation:`tkx-thinking-wave 1s ease-in-out ${t*.1}s infinite`}},t))})}function zo({color:e}){return(0,s.jsxs)(`div`,{style:{position:`relative`,width:28,height:28},children:[(0,s.jsx)(`div`,{style:{position:`absolute`,inset:0,borderRadius:`50%`,border:`2px solid ${e}33`}}),(0,s.jsx)(`div`,{style:{position:`absolute`,inset:0,borderRadius:`50%`,border:`2px solid transparent`,borderTopColor:e,animation:`tkx-thinking-orbit 0.8s linear infinite`}}),(0,s.jsx)(`div`,{style:{position:`absolute`,inset:`38%`,borderRadius:`50%`,background:e,opacity:.8}})]})}var Bo={sm:12,md:14,lg:16};function Vo({label:e=`Thinking…`,steps:r,size:i=`md`,variant:a=`dots`,active:c=!0,className:l,style:u}){let d=t.f(),[f,p]=(0,o.useState)(0);(0,o.useEffect)(()=>{if(!r?.length||!c)return;let e=setInterval(()=>{p(e=>(e+1)%r.length)},1800);return()=>clearInterval(e)},[r,c]);let m=d.primary,h=Bo[i],g={dots:(0,s.jsx)(Io,{color:m}),pulse:(0,s.jsx)(Lo,{color:m}),wave:(0,s.jsx)(Ro,{color:m}),orbit:(0,s.jsx)(zo,{color:m})}[a];return(0,s.jsxs)(`div`,{className:n.t(n.a(`inline-flex flex-col gap-2`),l),style:u,role:`status`,"aria-live":`polite`,"aria-label":c?e:`Done thinking`,children:[(0,s.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10},children:[(0,s.jsx)(`div`,{style:{opacity:c?1:.35,transition:`opacity 0.3s`},children:c?g:(0,s.jsx)(`div`,{style:{width:20,height:20,borderRadius:`50%`,background:`#10b981`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:(0,s.jsx)(`span`,{style:{color:`#fff`,fontSize:11,fontWeight:900},children:`✓`})})}),(0,s.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:2},children:[(0,s.jsx)(`span`,{style:{fontSize:h,fontWeight:600,color:c?d.text:d.textMuted,transition:`color 0.3s`},children:c?r?r[f]:e:`Done`}),c&&(0,s.jsx)(`span`,{style:{fontSize:h-2,color:d.textMuted},children:`⚛ Quantum AI · Amplitude Amplification`})]})]}),r&&r.length>1&&(0,s.jsx)(`div`,{style:{display:`flex`,gap:4,paddingLeft:2},children:r.map((e,t)=>(0,s.jsx)(`div`,{style:{width:t===f?16:6,height:4,borderRadius:4,background:t===f?m:`${m}44`,transition:`all 0.3s ease`}},t))}),(0,s.jsx)(`style`,{children:`
137
- @keyframes tkx-thinking-dot {
138
- 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
139
- 40% { transform: scale(1); opacity: 1; }
140
- }
141
- @keyframes tkx-thinking-pulse {
142
- 0% { transform: scale(0.6); opacity: 0.8; }
143
- 100% { transform: scale(2); opacity: 0; }
144
- }
145
- @keyframes tkx-thinking-wave {
146
- 0%, 100% { height: 6px; }
147
- 50% { height: 18px; }
148
- }
149
- @keyframes tkx-thinking-orbit {
150
- to { transform: rotate(360deg); }
151
- }
152
- `})]})}exports.FocusTrap=So,exports.I18nContext=a.I18nContext,exports.I18nProvider=yo,exports.LRUCache=t.N,exports.LiveRegion=xo,exports.Quantum=t.P,exports.SIZE_BORDER_RADIUS=ua,exports.SIZE_FONT=sa,exports.SIZE_HEIGHT=oa,exports.SIZE_ICON=da,exports.SIZE_PADDING_X=ca,exports.SIZE_PADDING_Y=la,exports.Shield=n.u,exports.SkipNav=bo,exports.TKX=t.w,exports.ThemeContext=t.t,exports.ThemeProvider=t.n,exports.TkxAIChatBubble=Fo,exports.TkxAIConfidenceBar=Mo,exports.TkxAIThinking=Vo,exports.TkxAccordion=Ae,exports.TkxAffix=oo,exports.TkxAlert=A,exports.TkxAnchor=uo,exports.TkxAppBar=zr,exports.TkxAutocomplete=pr,exports.TkxAvatar=Y,exports.TkxBadge=C,exports.TkxBottomNav=Wr,exports.TkxBreadcrumb=ir,exports.TkxButton=m,exports.TkxCard=g,exports.TkxCardBody=v,exports.TkxCardFooter=y,exports.TkxCardHeader=_,exports.TkxCarousel=tr,exports.TkxCascader=ho,exports.TkxChat=Ft,exports.TkxChatBubble=Pt,exports.TkxCheckbox=oe,exports.TkxClock=pn,exports.TkxCol=ea,exports.TkxColorPicker=Fn,exports.TkxCommand=$n,exports.TkxConfigProvider=na,exports.TkxContent=Ki,exports.TkxCountdown=Va,exports.TkxDataGrid=oi,exports.TkxDatePicker=tt,exports.TkxDivider=Z,exports.TkxDrawer=Re,exports.TkxDropdown=ko,exports.TkxEmpty=Na,exports.TkxFileUpload=yt,exports.TkxFooter=qi,exports.TkxForm=i.t,exports.TkxFormField=i.n,exports.TkxHeader=Ui,exports.TkxImage=mt,exports.TkxInput=b,exports.TkxLayout=Hi,exports.TkxList=vo,exports.TkxMarkdown=Ri,exports.TkxMasonry=fi,exports.TkxMentions=Wa,exports.TkxMenu=cn,exports.TkxModal=F,exports.TkxNumberInput=Vn,exports.TkxOTP=Gn,exports.TkxPagination=ut,exports.TkxParagraph=wa,exports.TkxPopover=cr,exports.TkxProgress=E,exports.TkxQRCode=Ya,exports.TkxRadio=ue,exports.TkxRadioGroup=de,exports.TkxRating=Ot,exports.TkxResult=Qa,exports.TkxRichTextDisplay=wi,exports.TkxRow=Xi,exports.TkxSegmented=Ua,exports.TkxSelect=ae,exports.TkxSider=Gi,exports.TkxSkeleton=K,exports.TkxSlider=st,exports.TkxSnackbar=Xr,exports.TkxSpeedDial=Pr,exports.TkxSpin=Aa,exports.TkxStatistic=Ba,exports.TkxStepper=wn,exports.TkxTab=B,exports.TkxTabList=z,exports.TkxTabPanel=H,exports.TkxTabPanels=V,exports.TkxTable=X,exports.TkxTabs=R,exports.TkxTag=Vt,exports.TkxTagInput=Ht,exports.TkxText=Ca,exports.TkxThinkingIndicator=Nt,exports.TkxTimeline=Xt,exports.TkxTitle=Sa,exports.TkxToastProvider=Ee,exports.TkxToggle=O,exports.TkxToolbar=br,exports.TkxTooltip=W,exports.TkxTour=to,exports.TkxTransferList=Er,exports.TkxTreeView=vr,exports.TkxVideoPlayer=vn,exports.TkxWatermark=ro,exports.VisuallyHidden=Co,exports.WCAGEngine=t.m,exports.audit=n.d,exports.auroraLight=t.r,exports.batchUpdate=t.F,exports.breakpoints=t.i,exports.contrastRatio=t.h,exports.createFocusTrap=t._,exports.createTheme=t.a,exports.css=t.T,exports.cssVar=t.E,exports.cx=n.t,exports.extractAtomicCSS=n.n,exports.extractCSS=t.D,exports.fnv1aHash=t.I,exports.fromObject=t.O,exports.generatePalette=t.o,exports.getAccessibleForeground=t.v,exports.getAuditLog=n.f,exports.getLocaleDisplayName=_a,exports.injectStyles=t.k,exports.isRTL=a.isRTL,exports.isRtlLocale=ga,exports.keyframes=t.A,exports.meetsAA=t.b,exports.meetsAAA=t.x,exports.memoize=t.L,exports.prefersHighContrast=t.S,exports.prefersReducedMotion=t.C,exports.quantumDark=t.s,exports.radii=t.c,exports.resetAtomicCSS=n.r,exports.resolvePluginUtility=n.i,exports.responsive=t.M,exports.sanitizeProps=n.p,exports.sanitizeString=n.m,exports.shadows=t.l,exports.spacing=t.u,exports.tkx=n.a,exports.tkxListPlugins=n.o,exports.tkxPlugin=n.s,exports.tkxRemovePlugin=n.c,exports.tx=n.l,exports.typography=t.d,exports.useAnnounce=r.t,exports.useClickOutside=r.n,exports.useComponentSize=aa,exports.useConfig=ra,exports.useDirection=a.useDirection,exports.useEscapeKey=r.r,exports.useFocusTrap=r.i,exports.useHighContrast=r.a,exports.useI18n=a.useI18n,exports.useLocale=a.useLocale,exports.useLogicalSpacing=pa,exports.usePrefixCls=ia,exports.useReducedMotion=r.o,exports.useRtlFlip=fa,exports.useTheme=t.f,exports.useTkxCommand=Jn,exports.useTkxForm=i.r,exports.useToast=xe,exports.validateProps=n.h,exports.verifyAuditIntegrity=n.g,exports.zIndex=t.p;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunk-DmRB1Blb.js"),t=require("./chunk-DjxOP8W4.js"),n=require("./chunk-LWkKqC8d.js"),o=require("./chunk-Bc16rJT-.js"),r=require("./chunk-DkoFTL1O.js"),i=require("./i18n.cjs");let l=require("react");l=e.__toESM(l,1);let a=require("react/jsx-runtime"),s=require("react-dom");var d={sm:"text-xs font-semibold",md:"text-sm font-semibold",lg:"text-base font-semibold",xl:"text-lg font-semibold"},c={sm:"py-1.5 px-3",md:"py-2 px-4",lg:"py-2.5 px-5",xl:"py-3 px-6"},u={sm:"min-h-[32px]",md:"min-h-[40px]",lg:"min-h-[48px]",xl:"min-h-[56px]"},p={sm:14,md:16,lg:18,xl:20};function h({size:e}){const t=p[e];return(0,a.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",className:n.tkx("animate-spin shrink-0"),children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",strokeOpacity:"0.25"}),(0,a.jsx)("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]})}var f=(0,l.forwardRef)(({variant:e="solid",size:r="md",colorScheme:i="primary",isLoading:l=!1,loadingText:s,leftIcon:p,rightIcon:f,isFullWidth:m=!1,glow:x=!1,disabled:g,children:b,className:y,style:v,...w},k)=>{const C=t.useTheme(),S=o.useReducedMotion(),$=g||l,z={primary:C.primary,secondary:C.secondary,danger:C.danger,warning:C.warning,success:C.success}[i],N=t.getAccessibleForeground(z,["#ffffff","#000000",C.bg]),M="string"==typeof b?n.sanitizeString(b):b,I=s?n.sanitizeString(s):void 0,L="solid"===e?{backgroundColor:z,color:N,border:"none",boxShadow:x&&!S?`0 0 20px ${z}55`:void 0}:"outline"===e?{backgroundColor:"transparent",color:z,border:`2px solid ${z}`}:"ghost"===e?{backgroundColor:"transparent",color:z,border:"none"}:{backgroundColor:"transparent",color:z,border:"none",textDecoration:"underline"};return(0,a.jsx)("button",{ref:k,"aria-busy":l,"aria-disabled":$,disabled:$,className:n.cx(n.tkx("inline-flex items-center justify-center gap-2","rounded-lg font-sans font-semibold","select-none relative overflow-hidden",d[r],c[r],u[r],"link"!==e&&u[r],m&&"w-full",$?"cursor-not-allowed opacity-60":"cursor-pointer",!S&&"transition-all duration-200","focus-visible:focus-ring"),y),style:{...L,...v},...w,children:l?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h,{size:r}),I??M]}):(0,a.jsxs)(a.Fragment,{children:[p&&(0,a.jsx)("span",{"aria-hidden":"true",children:p}),M,f&&(0,a.jsx)("span",{"aria-hidden":"true",children:f})]})})});f.displayName="TkxButton";var m={none:"",sm:"p-3",md:"p-5",lg:"p-7"},x=(0,l.forwardRef)(({variant:e="default",isHoverable:r,isClickable:i,padding:l="md",as:s,children:d,className:c,style:u,...p},h)=>{const f=t.useTheme(),x=o.useReducedMotion(),g=s??(i?"button":"div"),b={default:{backgroundColor:f.surface,border:`1px solid ${f.border}`},glass:{backgroundColor:`${f.surface}cc`,backdropFilter:"blur(12px)",border:`1px solid ${f.border}55`,boxShadow:`0 4px 24px ${f.bg}40`},quantum:{backgroundColor:f.surfaceAlt,border:`1px solid ${f.primary}33`,boxShadow:`0 0 24px ${f.primary}18`},elevated:{backgroundColor:f.surface,boxShadow:`0 4px 20px ${f.bg}60`},outlined:{backgroundColor:"transparent",border:`2px solid ${f.border}`}}[e];return(0,a.jsx)(g,{ref:h,className:n.cx("tkx-card",n.tkx("rounded-xl w-full text-left block font-sans focus-visible:focus-ring",m[l],(r||i)&&!x&&"transition-transform duration-150 hover:scale-[1.01]",i?"cursor-pointer":"cursor-default"),c),style:{color:f.text,...b,...u},...p,children:d})});x.displayName="TkxCard";var g=(0,l.forwardRef)(({label:e,id:o,error:r,hint:i,leftAddon:s,rightAddon:d,isInvalid:c,isRequired:u,disabled:p,className:h,style:f,unicodeSafe:m=!0,onChange:x,...g},b)=>{const y=t.useTheme(),v=(0,l.useId)(),w=o??v,k=`${w}-hint`,C=`${w}-error`,S=c||!!r,$=[i&&k,S&&C].filter(Boolean).join(" ")||void 0,z=n.sanitizeString(e),N=r?n.sanitizeString(r):void 0,M=i?n.sanitizeString(i):void 0,I=S?y.danger:y.border;return(0,a.jsxs)("div",{className:n.cx(n.tkx("flex flex-col gap-1 w-full"),h),style:f,children:[(0,a.jsxs)("label",{htmlFor:w,className:n.tkx("text-sm font-medium font-sans"),style:{color:y.text},children:[z,u&&(0,a.jsx)("span",{"aria-hidden":"true",className:n.tkx("ml-1"),style:{color:y.danger},children:"*"})]}),(0,a.jsxs)("div",{className:n.tkx("flex items-center rounded-lg overflow-hidden","transition-colors duration-150",p?"opacity-60":""),style:{border:`1.5px solid ${I}`,backgroundColor:y.surface},children:[s&&(0,a.jsx)("div",{className:n.tkx("px-2.5 self-stretch flex items-center text-sm shrink-0"),style:{backgroundColor:y.surfaceAlt,color:y.textMuted,borderRight:`1px solid ${y.border}`},children:s}),(0,a.jsx)("input",{ref:b,id:w,"aria-invalid":S,"aria-required":u,"aria-describedby":$,disabled:p,className:n.cx(n.tkx("flex-1 border-none bg-transparent text-sm font-sans py-2.5 px-3 outline-none min-w-0 focus-visible:focus-ring")),style:{color:y.text},onChange:m?e=>{const t=n.sanitizeUnicode(e.target.value);t!==e.target.value&&(e.target.value=t),x?.(e)}:x,...g}),d&&(0,a.jsx)("div",{className:n.tkx("px-2.5 self-stretch flex items-center text-sm shrink-0"),style:{backgroundColor:y.surfaceAlt,color:y.textMuted,borderLeft:`1px solid ${y.border}`},children:d})]}),M&&!N&&(0,a.jsx)("span",{id:k,className:n.tkx("text-xs"),style:{color:y.textMuted},children:M}),N&&(0,a.jsxs)("span",{id:C,role:"alert",className:n.tkx("text-xs flex items-center gap-1"),style:{color:y.danger},children:[(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),N]})]})});g.displayName="TkxInput";var b={sm:"text-xs px-1.5 py-[2px] min-h-[16px]",md:"text-xs px-2 py-[3px] min-h-[20px]",lg:"text-sm px-3 py-1 min-h-[24px]"},y={sm:"size-[6px]",md:"size-2",lg:"size-2.5"},v=(0,l.forwardRef)(({variant:e="default",size:o="md",dot:r=!1,pulse:i=!1,outlined:l=!1,children:s,className:d,style:c,...u},p)=>{const h=t.useTheme(),f={default:h.border,primary:h.primary,secondary:h.secondary,danger:h.danger,warning:h.warning,success:h.success,info:h.info}[e]||"#666666",m=t.getAccessibleForeground(f,["#ffffff","#000000",h.bg||"#000000"]),x="string"==typeof s?n.sanitizeString(s):s;return r?(0,a.jsx)("span",{ref:p,"aria-label":"string"==typeof s?n.sanitizeString(s):void 0,className:n.cx(n.tkx("inline-block rounded-full",y[o],i&&"animate-pulse"),d),style:{backgroundColor:f,...c},...u}):(0,a.jsx)("span",{ref:p,className:n.cx(n.tkx("inline-flex items-center justify-center rounded-full font-semibold font-sans tracking-wide",b[o],i&&"animate-pulse"),d),style:{backgroundColor:l?"transparent":f,color:l?f:m,border:l?`1px solid ${f}`:"none",...c},...u,children:x})});v.displayName="TkxBadge";var w={sm:"4px",md:"8px",lg:"12px"},k={sm:32,md:48,lg:64},C=(0,l.forwardRef)(({value:e,variant:r="linear",size:i="md",label:l,showValue:s,color:d,className:c,style:u,...p},h)=>{const f=t.useTheme(),m=o.useReducedMotion(),x=d??f.primary,g=void 0===e,b=void 0!==e?Math.min(100,Math.max(0,e)):0;if(void 0!==e){const{errors:t}=n.validateProps({value:e},{value:{type:"number",min:0,max:100}});t.length}if("circular"===r){const e=k[i],t="sm"===i?3:"md"===i?4:5,o=(e-2*t)/2,r=2*Math.PI*o,d=g?0:r-b/100*r;return(0,a.jsxs)("div",{ref:h,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":g?void 0:b,"aria-label":l??(g?"Loading":`${b}%`),className:n.cx(n.tkx("inline-flex flex-col items-center gap-1"),c),style:u,children:[(0,a.jsxs)("svg",{width:e,height:e,viewBox:`0 0 ${e} ${e}`,"aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:e/2,cy:e/2,r:o,fill:"none",stroke:f.border,strokeWidth:t}),(0,a.jsx)("circle",{cx:e/2,cy:e/2,r:o,fill:"none",stroke:x,strokeWidth:t,strokeLinecap:"round",strokeDasharray:r,strokeDashoffset:d,transform:`rotate(-90 ${e/2} ${e/2})`,style:{transition:m?"none":"stroke-dashoffset 300ms ease",animation:g&&!m?"tkx-spin 1s linear infinite":void 0}})]}),s&&!g&&(0,a.jsxs)("span",{className:n.tkx("text-xs"),style:{color:f.textMuted},children:[b,"%"]})]})}const y=w[i];return(0,a.jsxs)("div",{ref:h,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":g?void 0:b,"aria-label":l??(g?"Loading":`${b}%`),className:n.cx(n.tkx("flex flex-col gap-1 w-full"),c),style:u,children:[l&&(0,a.jsxs)("div",{className:n.tkx("flex justify-between text-sm"),style:{color:f.text},children:[(0,a.jsx)("span",{children:l}),s&&!g&&(0,a.jsxs)("span",{children:[b,"%"]})]}),(0,a.jsx)("div",{className:n.tkx("w-full overflow-hidden"),style:{height:y,borderRadius:y,backgroundColor:f.border},children:(0,a.jsx)("div",{style:{height:"100%",borderRadius:y,backgroundColor:x,width:g?"40%":`${b}%`,transition:m?"none":"width 300ms ease",animation:g&&!m?"tkx-shimmer 1.5s ease-in-out infinite":void 0}})})]})});C.displayName="TkxProgress";var S={sm:{tw:28,th:16,td:10,gap:3},md:{tw:40,th:22,td:14,gap:4},lg:{tw:52,th:28,td:18,gap:5}},$=(0,l.forwardRef)(({checked:e,onChange:r,label:i,size:s="md",hideLabel:d,disabled:c,className:u,style:p,...h},f)=>{const m=t.useTheme(),x=o.useReducedMotion(),g=(0,l.useId)();n.validateProps({label:i,checked:e},{label:{type:"string",required:!0},checked:{type:"boolean",required:!0}});const{tw:b,th:y,td:v,gap:w}=S[s],k=e?b-v-w:w,C=e?m.primary:m.border;return(0,a.jsxs)("div",{className:n.cx(n.tkx("inline-flex items-center gap-2",c?"opacity-50":""),u),style:p,children:[!d&&(0,a.jsx)("label",{htmlFor:g,className:n.tkx("text-sm font-sans",c?"cursor-not-allowed":"cursor-pointer","select-none"),style:{color:m.text},children:i}),(0,a.jsx)("button",{ref:f,id:g,role:"switch","aria-checked":e,"aria-label":d?i:void 0,disabled:c,onClick:()=>!c&&r(!e),onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||c||(t.preventDefault(),r(!e))},className:n.cx(n.tkx("relative border-none p-0 outline-none shrink-0 focus-visible:focus-ring",c?"cursor-not-allowed":"cursor-pointer",!x&&"transition-colors duration-200")),style:{width:b,height:y,borderRadius:y,backgroundColor:C},...h,children:(0,a.jsx)("span",{"aria-hidden":"true",className:n.tkx("absolute rounded-full"),style:{top:"50%",left:k,width:v,height:v,transform:"translateY(-50%)",backgroundColor:"#ffffff",boxShadow:"0 1px 3px rgba(0,0,0,0.3)",transition:x?"none":"left 200ms ease"}})})]})});$.displayName="TkxToggle";var z={info:(0,a.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})}),success:(0,a.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm-2 14.5l-4-4 1.41-1.41L10 13.67l6.59-6.59L18 8.5l-8 8z"})}),warning:(0,a.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),danger:(0,a.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})})},N={sm:"400px",md:"560px",lg:"720px",full:"100vw"},M=0;function I(){--M<=0&&(M=0,document.body.style.overflow="")}var L=(0,l.createContext)(null);function W(){const e=(0,l.useContext)(L);if(!e)throw new Error("TkxTab must be used inside TkxTabs");return e}var D={top:{bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:6},bottom:{top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:6},left:{right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:6},right:{left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:6}};function R({variant:e,width:t,height:o,animation:r,bgColor:i,accentColor:l}){const s=void 0!==t?"number"==typeof t?`${t}px`:t:"100%",d=void 0!==o?"number"==typeof o?`${o}px`:o:{text:"1em",circular:s,rectangular:"80px"}[e],c=n.tkx("circular"===e?"rounded-full":"text"===e?"rounded":"rounded-lg"),u="pulse"===r?n.tkx("animate-pulse"):"wave"===r?n.tkx("animate-shimmer"):"",p="wave"===r?{background:`linear-gradient(90deg,${i} 25%,${l} 50%,${i} 75%)`,backgroundSize:"200% 100%"}:{backgroundColor:i};return(0,a.jsx)("div",{className:n.cx(c,u),style:{width:s,height:d,...p}})}var T=(0,l.forwardRef)(({variant:e="rectangular",width:r,height:i,lines:l,animation:s="pulse",className:d,style:c,...u},p)=>{const h=t.useTheme(),f=!o.useReducedMotion()&&s;return"text"===e&&l&&l>1?(0,a.jsx)("div",{ref:p,role:"progressbar","aria-busy":"true","aria-label":"Loading...",className:n.cx(n.tkx("flex flex-col gap-2"),d),style:c,...u,children:Array.from({length:l},(e,t)=>(0,a.jsx)(R,{variant:"text",width:t===l-1?"75%":r,height:i,animation:f,bgColor:h.surfaceAlt,accentColor:h.border},t))}):(0,a.jsx)("div",{ref:p,role:"progressbar","aria-busy":"true","aria-label":"Loading...",className:d,style:c,...u,children:(0,a.jsx)(R,{variant:e,width:r,height:i,animation:f,bgColor:h.surfaceAlt,accentColor:h.border})})});T.displayName="TkxSkeleton";var B={xs:24,sm:32,md:40,lg:56,xl:72},A={online:"#06d6a0",offline:"#8888aa",away:"#ffbe0b",busy:"#f72585"},F=(0,l.forwardRef)(({src:e,alt:o,initials:r,size:i="md",shape:s="circle",status:d,className:c,style:u,...p},h)=>{const f=t.useTheme(),[m,x]=(0,l.useState)(!1),g=B[i],b="circle"===s,y=f.surfaceAlt,v=t.getAccessibleForeground(y,[f.text,f.textMuted]),w=e&&!m,k=!w&&r,C=Math.max(8,.22*g),S=n.tkx("relative inline-flex shrink-0",b?"rounded-full":"rounded-lg"),$=n.tkx("block object-cover",b?"rounded-full":"rounded-lg"),z=n.tkx("flex items-center justify-center font-semibold font-sans select-none",b?"rounded-full":"rounded-lg");return(0,a.jsxs)("div",{ref:h,className:n.cx(S,c),style:{width:g,height:g,...u},...p,children:[w?(0,a.jsx)("img",{src:n.sanitizeString(e),alt:n.sanitizeString(o),onError:()=>x(!0),className:$,style:{width:g,height:g}}):(0,a.jsx)("div",{role:"img","aria-label":n.sanitizeString(o),className:z,style:{width:g,height:g,backgroundColor:y,color:v,fontSize:.38*g},children:k?n.sanitizeString(r).slice(0,2).toUpperCase():(0,a.jsxs)("svg",{width:.5*g,height:.5*g,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),(0,a.jsx)("circle",{cx:"12",cy:"7",r:"4"})]})}),d&&(0,a.jsx)("span",{"aria-label":`Status: ${d}`,className:n.tkx("absolute bottom-0 right-0 rounded-full"),style:{width:C,height:C,backgroundColor:A[d],border:`2px solid ${f.bg}`}})]})});function H({dir:e}){return(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:n.tkx("shrink-0"),children:"asc"===e?(0,a.jsx)("path",{d:"M7 14l5-5 5 5H7z"}):"desc"===e?(0,a.jsx)("path",{d:"M7 10l5 5 5-5H7z"}):(0,a.jsx)("path",{d:"M7 10l5 5 5-5H7zM7 14l5-5 5 5H7z",opacity:"0.4"})})}F.displayName="TkxAvatar";var E=(0,l.forwardRef)(({orientation:e="horizontal",label:o,variant:r="solid",className:i,style:l,...s},d)=>{const c=t.useTheme(),u=o?n.sanitizeString(o):void 0,p="vertical"===e,h=p?"borderLeft":"borderTop",f=`1px ${r} ${c.border}`;return u?(0,a.jsxs)("div",{role:"separator","aria-orientation":e,className:n.cx(n.tkx("flex items-center gap-3 text-xs"),i),style:{color:c.textMuted,...l},...s,children:[(0,a.jsx)("hr",{className:n.tkx("flex-1 m-0 border-none"),style:{[h]:f}}),(0,a.jsx)("span",{children:u}),(0,a.jsx)("hr",{className:n.tkx("flex-1 m-0 border-none"),style:{[h]:f}})]}):(0,a.jsx)("hr",{ref:d,role:"separator","aria-orientation":e,className:n.cx(n.tkx(p?"inline-block self-stretch border-none w-0 h-full":"w-full border-none m-0"),i),style:{[h]:f,...l},...s})});E.displayName="TkxDivider";var j={sm:{py:"6px",px:"10px",fontSize:"13px",iconSize:14,tagPy:"1px",tagPx:"6px"},md:{py:"9px",px:"12px",fontSize:"14px",iconSize:16,tagPy:"2px",tagPx:"8px"},lg:{py:"12px",px:"14px",fontSize:"15px",iconSize:18,tagPy:"3px",tagPx:"10px"}};function O(e){return void 0===e?[]:Array.isArray(e)?e:[e]}function P({size:e,color:t}){return(0,a.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2.5",strokeLinecap:"round","aria-hidden":"true",style:{animation:"tkx-spin 0.7s linear infinite"},children:[(0,a.jsx)("style",{children:"@keyframes tkx-spin{to{transform:rotate(360deg)}}"}),(0,a.jsx)("path",{d:"M12 2a10 10 0 0 1 10 10"})]})}function V({options:e,value:o,defaultValue:r,placeholder:i="Select an option…",size:d="md",isDisabled:c=!1,isInvalid:u=!1,label:p,hint:h,errorMessage:f,multiple:m=!1,searchable:x=!1,clearable:g=!1,isLoading:b=!1,onChange:y,renderOption:v,maxMenuHeight:w=280,virtualScroll:k,optionHeight:C=36,id:S,className:$,style:z}){const N=t.useTheme(),M=(0,l.useId)(),I=S??M,L=`${I}-listbox`,W=`${I}-hint`,D=`${I}-error`,R=void 0!==o,[T,B]=(0,l.useState)(O(r)),A=R?O(o):T,[F,H]=(0,l.useState)(!1),[E,V]=(0,l.useState)(""),[Y,U]=(0,l.useState)(-1),[K,X]=(0,l.useState)(null),[q,G]=(0,l.useState)(""),Z=(0,l.useRef)(null),_=(0,l.useRef)(null),J=(0,l.useRef)(null),Q=(0,l.useRef)(null),ee=(0,l.useRef)(null),te=j[d],ne=u||!!f,oe=(0,l.useRef)(null),[re,ie]=(0,l.useState)(0),[le,ae]=(0,l.useState)(0),se=(0,l.useCallback)(()=>{oe.current&&ie(oe.current.scrollTop)},[]);(0,l.useEffect)(()=>{if(!F)return void ie(0);const e=oe.current;if(!e)return;ae(e.clientHeight);const t=new ResizeObserver(()=>{ae(e.clientHeight)});return t.observe(e),()=>t.disconnect()},[F]);const de=x&&E?e.filter(e=>e.label.toLowerCase().includes(E.toLowerCase())):e,ce=de.filter(e=>!e.disabled),ue=de.some(e=>!!e.group),pe=(void 0!==k?k:de.length>=100)&&!ue,he=de.length*C,fe=pe?Math.max(0,Math.floor(re/C)-8):0,me=pe?Math.min(de.length,Math.ceil((re+le)/C)+8):de.length,xe=pe?de.slice(fe,me):de,ge=fe*C,be=de.reduce((e,t)=>{const n=t.group??"";return e[n]||(e[n]=[]),e[n].push(t),e},{}),ye=(0,l.useCallback)(e=>{let t;t=m?A.includes(e)?A.filter(t=>t!==e):[...A,e]:[e],R||B(t),y?.(m?t:t[0]??""),m||(H(!1),V(""),U(-1),_.current?.focus())},[R,m,y,A]),ve=(0,l.useCallback)((e,t)=>{t.stopPropagation();const n=A.filter(t=>t!==e);R||B(n),y?.(m?n:n[0]??"")},[R,m,y,A]),we=(0,l.useCallback)(e=>{e.stopPropagation(),R||B([]),y?.(m?[]:"")},[R,m,y]),ke=(0,l.useCallback)(()=>{_.current&&F&&X(function(e,t){const n=e.getBoundingClientRect(),o=window.innerHeight-n.bottom-6,r=n.top-6,i=o>=Math.min(t,200)||o>=r?"below":"above";return{top:"below"===i?n.bottom+window.scrollY+6:n.top+window.scrollY-6-Math.min(t,280),left:n.left+window.scrollX,width:n.width,placement:i}}(_.current,w))},[F,w]);function Ce(){if(c||b)return;H(!0);const e=ce.findIndex(e=>A.includes(e.value));U(e>=0?e:0)}(0,l.useEffect)(()=>{if(F)return ke(),window.addEventListener("scroll",ke,!0),window.addEventListener("resize",ke),()=>{window.removeEventListener("scroll",ke,!0),window.removeEventListener("resize",ke)}},[F,ke]),(0,l.useEffect)(()=>{if(!F)return;const e=e=>{const t=e.target;_.current?.contains(t)||Q.current?.contains(t)||(H(!1),V(""))};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[F]),(0,l.useEffect)(()=>{F&&x&&setTimeout(()=>J.current?.focus(),0)},[F,x]),(0,l.useEffect)(()=>{if(F&&!(Y<0))if(pe&&oe.current){const e=Y*C,t=e+C,n=oe.current;e<n.scrollTop?n.scrollTop=e:t>n.scrollTop+n.clientHeight&&(n.scrollTop=t-n.clientHeight)}else(ee.current?.querySelector(`[data-idx="${Y}"]`))?.scrollIntoView({block:"nearest"})},[Y,F,pe,C]);const Se=ne?N.danger:F?N.primary:N.border,$e=Y>=0&&ce[Y]?`${I}-opt-${ce[Y].value}`:void 0,ze=[h&&W,ne&&D].filter(Boolean).join(" ")||void 0,Ne=A.map(t=>e.find(e=>e.value===t)).filter(Boolean),Me=F&&K?(0,s.createPortal)((0,a.jsxs)("div",{ref:Q,role:"listbox",id:L,"aria-label":p?n.sanitizeString(p):"Options","aria-multiselectable":m,style:{position:"absolute",top:K.top,left:K.left,width:K.width,zIndex:9999,backgroundColor:N.surface,border:`1.5px solid ${N.border}`,borderRadius:10,boxShadow:"0 8px 32px rgba(0,0,0,0.28), 0 2px 8px rgba(0,0,0,0.14)",overflow:"hidden",minWidth:K.width,maxHeight:w,display:"flex",flexDirection:"column"},children:[x&&(0,a.jsxs)("div",{style:{padding:"8px 10px",borderBottom:`1px solid ${N.border}`,flexShrink:0,display:"flex",alignItems:"center",gap:6},children:[(0,a.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:N.textMuted,strokeWidth:"2","aria-hidden":"true",style:{flexShrink:0},children:[(0,a.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,a.jsx)("path",{d:"M21 21l-4.35-4.35"})]}),(0,a.jsx)("input",{ref:J,type:"text",value:E,onChange:e=>{V(e.target.value),U(0)},onKeyDown:e=>{switch(e.key){case"Escape":e.preventDefault(),H(!1),V(""),_.current?.focus();break;case"ArrowDown":e.preventDefault(),U(e=>Math.min(e+1,ce.length-1));break;case"ArrowUp":e.preventDefault(),U(e=>Math.max(e-1,0));break;case"Home":e.preventDefault(),U(0);break;case"End":e.preventDefault(),U(ce.length-1);break;case"Enter":e.preventDefault(),Y>=0&&ce[Y]&&ye(ce[Y].value)}},placeholder:"Search…","aria-label":"Search options",style:{border:"none",outline:"none",background:"transparent",color:N.text,fontSize:te.fontSize,fontFamily:"inherit",width:"100%"}})]}),(0,a.jsx)("div",{ref:e=>{ee.current=e,oe.current=e},onScroll:pe?se:void 0,style:{overflowY:"auto",flexGrow:1,maxHeight:w-(x?48:0)},children:pe?(0,a.jsxs)("div",{style:{height:he,position:"relative"},children:[(0,a.jsx)("div",{style:{position:"absolute",top:ge,left:0,right:0},children:xe.map(e=>{const t=ce.indexOf(e),o=t===Y,r=A.includes(e.value),i=v?v(e,r):(0,a.jsxs)("span",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0},children:[(0,a.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:8},children:[e.icon&&(0,a.jsx)("span",{style:{flexShrink:0,display:"flex"},children:e.icon}),(0,a.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.sanitizeString(e.label)})]}),e.description&&(0,a.jsx)("span",{style:{fontSize:"12px",color:N.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.sanitizeString(e.description)})]});return(0,a.jsxs)("div",{id:`${I}-opt-${e.value}`,"data-idx":t>=0?t:void 0,role:"option","aria-selected":r,"aria-disabled":e.disabled||void 0,onClick:()=>!e.disabled&&ye(e.value),onMouseEnter:()=>!e.disabled&&t>=0&&U(t),style:{height:C,boxSizing:"border-box",padding:`0 ${te.px}`,fontSize:te.fontSize,fontFamily:"inherit",color:e.disabled?N.textMuted:N.text,backgroundColor:o?`${N.primary}22`:r?`${N.primary}12`:"transparent",cursor:e.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,transition:"background-color 80ms",opacity:e.disabled?.5:1,userSelect:"none",touchAction:"manipulation"},children:[i,r&&!v&&(0,a.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:N.primary,strokeWidth:"2.5","aria-hidden":"true",style:{flexShrink:0},children:(0,a.jsx)("path",{d:"M20 6L9 17l-5-5"})})]},e.value)})}),0===de.length&&(0,a.jsx)("div",{style:{padding:`${te.py} ${te.px}`,fontSize:te.fontSize,fontFamily:"inherit",color:N.textMuted,textAlign:"center",position:"absolute",top:0,left:0,right:0},children:b?"Loading…":"No options found"})]}):(0,a.jsxs)(a.Fragment,{children:[Object.entries(be).map(([e,t])=>(0,a.jsxs)("div",{children:[e&&(0,a.jsx)("div",{"aria-hidden":"true",style:{padding:"8px 12px 4px",fontSize:"11px",fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase",color:N.textMuted,fontFamily:"inherit",position:"sticky",top:0,backgroundColor:N.surface,zIndex:1,borderBottom:`1px solid ${N.border}`},children:n.sanitizeString(e)}),t.map(e=>{const t=ce.indexOf(e),o=t===Y,r=A.includes(e.value),i=v?v(e,r):(0,a.jsxs)("span",{style:{display:"flex",flexDirection:"column",flex:1,minWidth:0},children:[(0,a.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:8},children:[e.icon&&(0,a.jsx)("span",{style:{flexShrink:0,display:"flex"},children:e.icon}),(0,a.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.sanitizeString(e.label)})]}),e.description&&(0,a.jsx)("span",{style:{fontSize:"12px",color:N.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.sanitizeString(e.description)})]});return(0,a.jsxs)("div",{id:`${I}-opt-${e.value}`,"data-idx":t>=0?t:void 0,role:"option","aria-selected":r,"aria-disabled":e.disabled||void 0,onClick:()=>!e.disabled&&ye(e.value),onMouseEnter:()=>!e.disabled&&t>=0&&U(t),style:{padding:`${te.py} ${te.px}`,fontSize:te.fontSize,fontFamily:"inherit",color:e.disabled?N.textMuted:N.text,backgroundColor:o?`${N.primary}22`:r?`${N.primary}12`:"transparent",cursor:e.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,transition:"background-color 80ms",opacity:e.disabled?.5:1,userSelect:"none",touchAction:"manipulation"},children:[i,r&&!v&&(0,a.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:N.primary,strokeWidth:"2.5","aria-hidden":"true",style:{flexShrink:0},children:(0,a.jsx)("path",{d:"M20 6L9 17l-5-5"})})]},e.value)})]},e)),0===de.length&&(0,a.jsx)("div",{style:{padding:`${te.py} ${te.px}`,fontSize:te.fontSize,fontFamily:"inherit",color:N.textMuted,textAlign:"center"},children:b?"Loading…":"No options found"})]})})]}),document.body):null,Ie=g&&A.length>0&&!c&&!b;return(0,a.jsxs)("div",{className:n.cx(n.tkx("flex flex-col gap-1 w-full"),$),style:z,children:[p&&(0,a.jsx)("label",{htmlFor:I,style:{fontSize:"14px",fontWeight:500,fontFamily:"inherit",color:N.text,userSelect:"none"},children:n.sanitizeString(p)}),(0,a.jsx)("div",{style:{position:"relative",width:"100%",opacity:c?.55:1},children:(0,a.jsxs)("button",{ref:_,id:I,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":F,"aria-controls":L,"aria-activedescendant":$e,"aria-invalid":ne||void 0,"aria-describedby":ze,"aria-multiselectable":m,disabled:c,onClick:()=>F?H(!1):Ce(),onKeyDown:e=>{switch(e.key){case"Enter":case" ":e.preventDefault(),F?Y>=0&&ce[Y]&&ye(ce[Y].value):Ce();break;case"Escape":e.preventDefault(),H(!1),V("");break;case"ArrowDown":e.preventDefault(),F?U(e=>Math.min(e+1,ce.length-1)):Ce();break;case"ArrowUp":e.preventDefault(),F?U(e=>Math.max(e-1,0)):Ce();break;case"Home":e.preventDefault(),F&&U(0);break;case"End":e.preventDefault(),F&&U(ce.length-1);break;default:1!==e.key.length||e.ctrlKey||e.metaKey||(F||Ce(),function(e){Z.current&&clearTimeout(Z.current);const t=q+e.toLowerCase();G(t);const n=ce.findIndex(e=>e.label.toLowerCase().startsWith(t));n>=0&&U(n),Z.current=setTimeout(()=>G(""),800)}(e.key))}},style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:m&&A.length>0?`4px ${te.px}`:`${te.py} ${te.px}`,fontSize:te.fontSize,fontFamily:"inherit",backgroundColor:N.surface,color:A.length>0?N.text:N.textMuted,border:`1.5px solid ${Se}`,borderRadius:8,boxSizing:"border-box",transition:"border-color 150ms",textAlign:"left",cursor:c?"not-allowed":"pointer",outline:"none",minHeight:"sm"===d?34:"lg"===d?50:42,flexWrap:"wrap",touchAction:"manipulation"},children:[(0,a.jsx)("span",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:4,flex:1,minWidth:0},children:m&&Ne.length>0?Ne.map(e=>(0,a.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:`${te.tagPy} ${te.tagPx}`,fontSize:`calc(${te.fontSize} - 1px)`,fontFamily:"inherit",backgroundColor:`${N.primary}22`,color:N.primary,borderRadius:6,border:`1px solid ${N.primary}44`,lineHeight:1.4,maxWidth:150,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[(0,a.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:110},children:n.sanitizeString(e.label)}),(0,a.jsx)("span",{role:"button","aria-label":`Remove ${n.sanitizeString(e.label)}`,tabIndex:-1,onClick:t=>ve(e.value,t),style:{cursor:"pointer",flexShrink:0,display:"flex",alignItems:"center",opacity:.8},children:(0,a.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M18 6L6 18M6 6l12 12"})})})]},e.value)):!m&&A.length>0?(()=>{const t=e.find(e=>e.value===A[0]);return(0,a.jsxs)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:6},children:[t?.icon&&(0,a.jsx)("span",{style:{flexShrink:0,display:"flex"},children:t.icon}),t?n.sanitizeString(t.label):""]})})():(0,a.jsx)("span",{style:{opacity:.6},children:n.sanitizeString(i)})}),(0,a.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:4,flexShrink:0,color:N.textMuted},children:[b&&(0,a.jsx)(P,{size:te.iconSize,color:N.primary}),Ie&&!b&&(0,a.jsx)("span",{role:"button","aria-label":"Clear selection",tabIndex:-1,onClick:we,style:{cursor:"pointer",display:"flex",alignItems:"center",lineHeight:1,opacity:.7,transition:"opacity 120ms"},onMouseEnter:e=>e.currentTarget.style.opacity="1",onMouseLeave:e=>e.currentTarget.style.opacity="0.7",children:(0,a.jsx)("svg",{width:te.iconSize,height:te.iconSize,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M18 6L6 18M6 6l12 12"})})}),(0,a.jsx)("svg",{width:te.iconSize,height:te.iconSize,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",style:{transform:F?"rotate(180deg)":"rotate(0deg)",transition:"transform 150ms",flexShrink:0},children:(0,a.jsx)("path",{d:"M6 9l6 6 6-6"})})]})]})}),h&&!ne&&(0,a.jsx)("span",{id:W,style:{fontSize:"12px",color:N.textMuted,fontFamily:"inherit"},children:n.sanitizeString(h)}),ne&&f&&(0,a.jsxs)("span",{id:D,role:"alert",style:{fontSize:"12px",color:N.danger,display:"flex",alignItems:"center",gap:4,fontFamily:"inherit"},children:[(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),n.sanitizeString(f)]}),Me]})}V.displayName="TkxSelect";var Y={sm:{box:16,fontSize:"13px",iconStroke:2.5},md:{box:20,fontSize:"14px",iconStroke:2.5},lg:{box:24,fontSize:"15px",iconStroke:2}},U=(0,l.forwardRef)(({label:e,hint:r,isInvalid:i,errorMessage:s,isIndeterminate:d=!1,size:c="md",colorScheme:u="primary",checked:p,defaultChecked:h,onChange:f,disabled:m,className:x,style:g,id:b,...y},v)=>{const w=t.useTheme(),k=o.useReducedMotion(),C=(0,l.useId)(),S=b??C,$=`${S}-hint`,z=`${S}-error`,N=(0,l.useRef)(null),[M,I]=(0,l.useState)(!1),L=Y[c],W=i||!!s,D={primary:w.primary,success:w.success,danger:w.danger,warning:w.warning}[u]??w.primary,R=void 0!==p?p:void 0;(0,l.useEffect)(()=>{const e=v?.current??N.current;e&&(e.indeterminate=d)},[d,v]);const T=d||(R??!1),B=T?D:w.surface,A=W?w.danger:T?D:w.border,F=t.getAccessibleForeground(D),H=M?{outline:`2px solid ${D}`,outlineOffset:"2px"}:{},E=[r&&$,W&&z].filter(Boolean).join(" ")||void 0,j=!k&&T?{animation:"tkx-check-scale-in 120ms ease forwards"}:{};return(0,a.jsxs)("div",{className:n.cx(n.tkx("flex flex-col gap-1"),x),style:{opacity:m?.5:1,...g},children:[(0,a.jsx)("style",{children:"\n @keyframes tkx-check-scale-in {\n from { transform: scale(0.4); opacity: 0; }\n to { transform: scale(1); opacity: 1; }\n }\n "}),(0,a.jsxs)("label",{htmlFor:S,className:n.tkx("flex items-center gap-2 select-none"),style:{cursor:m?"not-allowed":"pointer",fontFamily:"inherit"},children:[(0,a.jsx)("input",{ref:e=>{N.current=e,"function"==typeof v?v(e):v&&(v.current=e)},id:S,type:"checkbox",checked:p,defaultChecked:h,onChange:f,disabled:m,"aria-invalid":W,"aria-describedby":E,onFocus:e=>{e.target.matches(":focus-visible")&&I(!0)},onBlur:()=>I(!1),className:n.tkx("sr-only"),...y}),(0,a.jsx)("span",{"aria-hidden":"true",style:{width:L.box,height:L.box,minWidth:L.box,borderRadius:"4px",border:`2px solid ${A}`,backgroundColor:B,display:"flex",alignItems:"center",justifyContent:"center",transition:k?"none":"background-color 120ms, border-color 120ms",boxSizing:"border-box",...H},children:d?(0,a.jsx)("span",{"aria-hidden":"true",style:{display:"block",width:.5*L.box,height:2,backgroundColor:F,borderRadius:"1px",...j}}):T?(0,a.jsx)("svg",{width:.6*L.box,height:.6*L.box,viewBox:"0 0 24 24",fill:"none",stroke:F,strokeWidth:L.iconStroke,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:j,children:(0,a.jsx)("path",{d:"M20 6L9 17l-5-5"})}):null}),e&&(0,a.jsx)("span",{style:{fontSize:L.fontSize,color:w.text,lineHeight:1.4},children:"string"==typeof e?n.sanitizeString(e):e})]}),r&&!W&&(0,a.jsx)("span",{id:$,className:n.tkx("text-xs ml-7"),style:{color:w.textMuted,marginLeft:L.box+8},children:n.sanitizeString(r)}),W&&s&&(0,a.jsxs)("span",{id:z,role:"alert",className:n.tkx("text-xs flex items-center gap-1"),style:{color:w.danger,marginLeft:L.box+8},children:[(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),n.sanitizeString(s)]})]})});U.displayName="TkxCheckbox";var K=(0,l.createContext)(null),X={sm:{outer:16,inner:7,fontSize:"13px"},md:{outer:20,inner:9,fontSize:"14px"},lg:{outer:24,inner:11,fontSize:"15px"}},q=(0,l.forwardRef)(({label:e,hint:r,size:i="md",colorScheme:s="primary",value:d,checked:c,onChange:u,disabled:p,name:h,className:f,style:m,id:x,...g},b)=>{const y=t.useTheme(),v=o.useReducedMotion(),w=(0,l.useId)(),k=x??w,C=(0,l.useContext)(K),S=C?C.value===String(d??""):c??!1,$=p??C?.isDisabled??!1,z=h??C?.name??"",N=X[i],M={primary:y.primary,success:y.success,danger:y.danger}[s]??y.primary;t.getAccessibleForeground(M);const I=S?M:y.border,L=y.surface;return(0,a.jsxs)("div",{className:n.cx(n.tkx("flex flex-col gap-0.5"),f),style:{opacity:$?.5:1,...m},children:[(0,a.jsx)("style",{children:"\n @keyframes tkx-radio-dot-in {\n from { transform: scale(0) translate(-50%, -50%); opacity: 0; }\n to { transform: scale(1) translate(-50%, -50%); opacity: 1; }\n }\n "}),(0,a.jsxs)("label",{htmlFor:k,className:n.tkx("flex items-center gap-2 select-none"),style:{cursor:$?"not-allowed":"pointer",fontFamily:"inherit"},children:[(0,a.jsx)("input",{ref:b,id:k,type:"radio",name:z,value:d,checked:S,onChange:()=>{$||(C?C.onChange(String(d??"")):u?.({target:{value:String(d??"")}}))},disabled:$,"aria-invalid":C?.isInvalid,className:n.tkx("sr-only"),...g}),(0,a.jsx)("span",{"aria-hidden":"true",style:{position:"relative",width:N.outer,height:N.outer,minWidth:N.outer,borderRadius:"50%",border:`2px solid ${I}`,backgroundColor:L,display:"inline-block",boxSizing:"border-box",transition:v?"none":"border-color 120ms"},children:S&&(0,a.jsx)("span",{"aria-hidden":"true",style:{position:"absolute",top:"50%",left:"50%",width:N.inner,height:N.inner,borderRadius:"50%",backgroundColor:M,transform:"translate(-50%, -50%)",transformOrigin:"center",...v?{}:{animation:"tkx-radio-dot-in 130ms ease forwards"}}})}),e&&(0,a.jsx)("span",{style:{fontSize:N.fontSize,color:y.text,lineHeight:1.4},children:"string"==typeof e?n.sanitizeString(e):e})]}),r&&(0,a.jsx)("span",{className:n.tkx("text-xs"),style:{color:y.textMuted,marginLeft:N.outer+8},children:n.sanitizeString(r)})]})});q.displayName="TkxRadio";var G=[],Z=[],_=new Set,J=new Map;function Q(){const e=[...Z];_.forEach(t=>t(e))}function ee(e,t){0!==t&&J.set(e,setTimeout(()=>te(e),t))}function te(e){clearTimeout(J.get(e)),J.delete(e);const t=Z.some(t=>t.id===e);if(Z=Z.filter(t=>t.id!==e),G=G.filter(t=>t.id!==e),t&&G.length>0&&Z.length<5){const e=G.shift();Z=[...Z,e],ee(e.id,e.duration??4e3)}Q()}var ne={default:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})}),success:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm-2 14.5l-4-4 1.41-1.41L10 13.67l6.59-6.59L18 8.5l-8 8z"})}),danger:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),warning:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),info:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})})},oe={"top-right":{top:16,right:16,alignItems:"flex-end"},"top-left":{top:16,left:16,alignItems:"flex-start"},"top-center":{top:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"},"bottom-right":{bottom:16,right:16,alignItems:"flex-end"},"bottom-left":{bottom:16,left:16,alignItems:"flex-start"},"bottom-center":{bottom:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"}};function re(e,t){return t?{}:{animation:`tkx-toast-slide-${e.startsWith("top")?"down":"up"} 220ms cubic-bezier(0.16,1,0.3,1) both`}}function ie({toast:e,position:o,onDismiss:r,reduced:i}){const s=t.useTheme(),d=(0,l.useId)(),c={default:s.textMuted,success:s.success,danger:s.danger,warning:s.warning,info:s.info},u=e.variant??"default",p=c[u],h="danger"===u,f=e.title?n.sanitizeString(e.title):void 0,m=e.description?n.sanitizeString(e.description):void 0;return(0,a.jsxs)("div",{role:h?"alert":"status","aria-live":h?"assertive":"polite","aria-atomic":"true","aria-labelledby":f?d:void 0,className:n.tkx("flex items-start gap-3 px-4 py-3 rounded-lg shadow-lg font-sans min-w-[280px] max-w-[380px]"),style:{backgroundColor:s.surface,border:`1px solid ${p}55`,boxShadow:`0 8px 24px ${s.bg}cc`,color:s.text,...re(o,i)},children:[(0,a.jsx)("span",{className:n.tkx("shrink-0 mt-[2px]"),style:{color:p},children:ne[u]}),(0,a.jsxs)("div",{className:n.tkx("flex-1 min-w-0"),children:[f&&(0,a.jsx)("p",{id:d,className:n.tkx("m-0 font-semibold text-sm leading-snug"),children:f}),m&&(0,a.jsx)("p",{className:n.tkx("m-0 text-xs mt-[2px] leading-relaxed"),style:{color:s.textMuted},children:m}),e.action&&(0,a.jsx)("button",{onClick:()=>{e.action.onClick(),r(e.id)},className:n.tkx("border-none bg-transparent cursor-pointer p-0 mt-2 text-xs font-semibold focus-visible:focus-ring"),style:{color:p},children:n.sanitizeString(e.action.label)})]}),(0,a.jsx)("button",{"aria-label":"Dismiss notification",onClick:()=>r(e.id),className:n.tkx("bg-transparent border-none cursor-pointer rounded p-[2px] shrink-0 flex items-center justify-center focus-visible:focus-ring"),style:{color:s.textMuted},children:(0,a.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}var le={sm:{triggerPadding:"10px 12px",contentPadding:"0 12px 10px 12px",fontSize:"13px",subtitleSize:"11px",iconSize:14},md:{triggerPadding:"14px 16px",contentPadding:"0 16px 14px 16px",fontSize:"14px",subtitleSize:"12px",iconSize:16},lg:{triggerPadding:"18px 20px",contentPadding:"0 20px 18px 20px",fontSize:"16px",subtitleSize:"13px",iconSize:18}};function ae({open:e,reduced:t,iconStyle:n,size:o,color:r}){const i=t?"none":"transform 240ms cubic-bezier(0.4, 0, 0.2, 1)";return"chevron"===n?(0,a.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:e?"rotate(180deg)":"rotate(0deg)",transition:i,flexShrink:0},children:(0,a.jsx)("polyline",{points:"6 9 12 15 18 9"})}):"plus"===n?(0,a.jsxs)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:e?"rotate(45deg)":"rotate(0deg)",transition:i,flexShrink:0},children:[(0,a.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,a.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}):(0,a.jsxs)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:e?"rotate(90deg)":"rotate(0deg)",transition:i,flexShrink:0},children:[(0,a.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),(0,a.jsx)("polyline",{points:"12 5 19 12 12 19"})]})}function se({isOpen:e,reduced:t,children:n,id:o,triggerId:r}){const i=(0,l.useRef)(null),s=(0,l.useRef)(null),d=(0,l.useRef)(e),c=(0,l.useRef)(!1);return(0,l.useEffect)(()=>{const t=i.current;t&&(e?(t.style.height="auto",t.style.overflow="visible"):(t.style.height="0px",t.style.overflow="hidden"))},[]),(0,l.useEffect)(()=>{if(d.current===e)return;d.current=e;const n=i.current,o=s.current;if(n&&o){if(t)return n.style.height=e?"auto":"0px",void(n.style.overflow=e?"visible":"hidden");if(c.current){const e=n.getBoundingClientRect().height;n.style.transition="none",n.style.height=`${e}px`,n.offsetHeight}c.current=!0,n.style.overflow="hidden",e?(n.style.height="0px",n.style.transition="height 280ms cubic-bezier(0.4, 0, 0.2, 1)",requestAnimationFrame(()=>{requestAnimationFrame(()=>{n.style.height=`${o.scrollHeight}px`})})):(n.style.height=`${o.scrollHeight}px`,n.style.transition="height 280ms cubic-bezier(0.4, 0, 0.2, 1)",requestAnimationFrame(()=>{requestAnimationFrame(()=>{n.style.height="0px"})}))}},[e,t]),(0,a.jsx)("div",{ref:i,id:o,role:"region","aria-labelledby":r,onTransitionEnd:t=>{if("height"!==t.propertyName)return;c.current=!1;const n=i.current;n&&(e?(n.style.height="auto",n.style.overflow="visible"):n.style.overflow="hidden")},style:{willChange:"height"},children:(0,a.jsx)("div",{ref:s,children:n})})}function de({items:e,multiple:r=!1,defaultOpen:i,value:s,onChange:d,variant:c="default",size:u="md",iconPosition:p="right",iconStyle:h="chevron",flush:f=!1,className:m,style:x}){const g=t.useTheme(),b=o.useReducedMotion(),y=(0,l.useId)(),v=void 0!==s,w=e=>e?Array.isArray(e)?new Set(e):new Set([e]):new Set,[k,C]=(0,l.useState)(()=>w(i)),S=v?w(s):k,$=(0,l.useCallback)((e,t)=>{if(t)return;let n;if(!v)return void C(t=>{n=new Set(t),n.has(e)?n.delete(e):(r||n.clear(),n.add(e));const o=[...n];return d?.(r?o:o[0]??""),n});{const t=w(s);n=new Set(t),n.has(e)?n.delete(e):(r||n.clear(),n.add(e))}const o=[...n];d?.(r?o:o[0]??"")},[r,d,v,s]),z=le[u],N=(e,t,n)=>{if(f)return{};switch(c){case"default":case"bordered":return{borderBottom:n?"none":`1px solid ${g.border}`};case"separated":return{border:`1px solid ${g.border}`,borderRadius:"10px",overflow:"hidden",boxShadow:"0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04)"};default:return{}}},M="separated"===c;return(0,a.jsx)("div",{className:n.tkx(m??""),style:{...f?{}:"bordered"===c?{border:`1px solid ${g.border}`,borderRadius:"10px",overflow:"hidden"}:{},display:M?"flex":void 0,flexDirection:M?"column":void 0,gap:M?"8px":void 0,...x},children:e.map((t,n)=>{const o=S.has(t.id),r=n===e.length-1,i=`${y}-trigger-${t.id}`,l=`${y}-panel-${t.id}`;return(0,a.jsxs)("div",{className:t.className,style:N(0,0,r),children:[(0,a.jsxs)("button",{id:i,type:"button",role:"button","aria-expanded":o,"aria-controls":l,disabled:t.disabled,onClick:()=>$(t.id,t.disabled),style:{width:"100%",display:"flex",alignItems:t.subtitle?"flex-start":"center",gap:"8px",padding:z.triggerPadding,border:"none",background:"transparent",cursor:t.disabled?"not-allowed":"pointer",textAlign:"left",fontFamily:"inherit",fontSize:z.fontSize,fontWeight:500,color:t.disabled?g.textMuted:g.text,opacity:t.disabled?.5:1,transition:b?"none":"background-color 160ms ease",outline:"none"},onMouseEnter:e=>{t.disabled||(e.currentTarget.style.backgroundColor=(e=>"ghost"===c||"flush"===c?e?`${g.primary}10`:`${g.surfaceAlt}80`:e?`${g.primary}0d`:`${g.surfaceAlt}60`)(o))},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=o?`${g.primary}0d`:"transparent"},onFocus:e=>{t.disabled||(e.currentTarget.style.outline=`2px solid ${g.primary}`,e.currentTarget.style.outlineOffset="2px")},onBlur:e=>{e.currentTarget.style.outline="none"},children:[t.icon&&(0,a.jsx)("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:g.primary,marginTop:t.subtitle?"1px":void 0},children:t.icon}),"left"===p&&(0,a.jsx)("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:o?g.primary:g.textMuted,marginTop:t.subtitle?"1px":void 0},children:(0,a.jsx)(ae,{open:o,reduced:b,iconStyle:h,size:z.iconSize,color:o?g.primary:g.textMuted})}),(0,a.jsxs)("span",{style:{flex:1,minWidth:0},children:[(0,a.jsx)("span",{style:{display:"block",lineHeight:1.4},children:t.title}),t.subtitle&&(0,a.jsx)("span",{style:{display:"block",fontSize:z.subtitleSize,color:g.textMuted,fontWeight:400,marginTop:"2px",lineHeight:1.3},children:t.subtitle})]}),t.badge&&(0,a.jsx)("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0},children:t.badge}),"right"===p&&(0,a.jsx)("span",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",flexShrink:0,color:o?g.primary:g.textMuted,marginTop:t.subtitle?"1px":void 0},children:(0,a.jsx)(ae,{open:o,reduced:b,iconStyle:h,size:z.iconSize,color:o?g.primary:g.textMuted})})]}),(0,a.jsx)(se,{isOpen:o,reduced:b,id:l,triggerId:i,children:(0,a.jsx)("div",{style:{padding:z.contentPadding,fontSize:z.fontSize,lineHeight:1.6,color:g.textMuted,fontFamily:"inherit"},children:t.content})})]},t.id)})})}de.displayName="TkxAccordion";var ce={sm:"280px",md:"380px",lg:"480px",xl:"600px",full:"100%"},ue=0;function pe(){--ue<=0&&(ue=0,document.body.style.overflow="")}function he(){return(0,a.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}var fe=["Su","Mo","Tu","We","Th","Fr","Sa"],me=["January","February","March","April","May","June","July","August","September","October","November","December"],xe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ge(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function be(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function ye(e,t,n){return!(!t||!ge(e,t))||!(!n||!ge(e,n))}function ve(e,t="en-US",n){if(!e)return"";if(n){const t=String(e.getFullYear()),o=t.slice(-2),r=e.getMonth()+1,i=String(r).padStart(2,"0"),l=xe[e.getMonth()],a=me[e.getMonth()],s=e.getDate(),d=String(s).padStart(2,"0");return n.replace(/YYYY/g,t).replace(/YY/g,o).replace(/MMMM/g,a).replace(/MMM/g,l).replace(/MM/g,i).replace(/\bM\b/g,String(r)).replace(/DD/g,d).replace(/\bD\b/g,String(s))}return e.toLocaleDateString(t,{month:"2-digit",day:"2-digit",year:"numeric"})}function we(e,t){return new Date(e,t+1,0).getDate()}function ke(e){return 10*Math.floor(e/10)}function Ce({values:e,selected:t,onSelect:n,label:o,theme:r,format:i}){const s=(0,l.useRef)([]),d=(0,l.useRef)(null);(0,l.useEffect)(()=>{const e=s.current[t];e&&d.current&&e.scrollIntoView({block:"nearest"})},[t]);const c=i??(e=>String(e).padStart(2,"0"));return(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px"},children:[(0,a.jsx)("div",{style:{fontSize:"11px",fontWeight:600,color:r.textMuted,textTransform:"uppercase",letterSpacing:"0.05em"},children:o}),(0,a.jsx)("div",{ref:d,style:{height:"160px",overflowY:"auto",width:"52px",scrollbarWidth:"thin",border:`1px solid ${r.border}`,borderRadius:"8px",padding:"4px"},children:e.map(e=>{const o=e===t;return(0,a.jsx)("button",{ref:t=>{s.current[e]=t},type:"button",onClick:()=>n(e),style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"32px",borderRadius:"6px",border:"none",cursor:"pointer",fontSize:"13px",fontWeight:o?600:400,backgroundColor:o?r.primary:"transparent",color:o?r.bg:r.text,fontFamily:"monospace",transition:"background-color 100ms ease"},children:c(e)},e)})})]})}function Se({year:e,month:t,today:n,mode:o,selectedDate:r,selectedRange:i,multiDates:l,hoverDate:s,focusedDate:d,isDateDisabled:c,onSelectDate:u,onHoverDate:p,onSetFocused:h,theme:f,locale:m}){const x=function(e,t){const n=new Date(e,t,1).getDay(),o=we(e,t),r=[],i=we(e,t-1);for(let a=n-1;a>=0;a--)r.push(new Date(e,t-1,i-a));for(let a=1;a<=o;a++)r.push(new Date(e,t,a));let l=1;for(;r.length<42;)r.push(new Date(e,t+1,l++));return r}(e,t);return(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px",marginBottom:"4px"},children:fe.map(e=>(0,a.jsx)("div",{style:{textAlign:"center",fontSize:"11px",fontWeight:600,color:f.textMuted,padding:"4px 0",textTransform:"uppercase",letterSpacing:"0.05em"},children:e},e))}),(0,a.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"2px"},children:x.map((e,x)=>{const g=e.getMonth()===t,b=ge(e,n),y=0===e.getDay()||6===e.getDay(),v=c(e),w="single"===o&&null!=r&&ge(e,r),k="multiple"===o&&l.some(t=>ge(t,e)),C="range"===o&&ye(e,i[0],null),S="range"===o&&ye(e,null,i[1]),$=C||S,z="range"===o&&i[0]&&!i[1]&&s?s:i[1],N="range"===o&&function(e,t,n){if(!t||!n)return!1;const o=be(e).getTime(),r=be(t).getTime(),i=be(n).getTime();return o>Math.min(r,i)&&o<Math.max(r,i)}(e,i[0],z),M="range"===o&&i[0]&&!i[1]&&s&&ge(e,s),I=w||k||$,L=null!=d&&ge(e,d);let W="transparent",D=g?y?`${f.text}cc`:f.text:`${f.textMuted}60`,R="none",T=400;return I||M?(W=f.primary,D=f.bg,T=600):N&&(W=`${f.primary}18`),b&&!I&&(R=`2px solid ${f.primary}`,T=600),v&&(D=`${f.textMuted}50`),L&&!I&&(R=`2px solid ${f.secondary}`),(0,a.jsx)("button",{type:"button","aria-label":e.toLocaleDateString(m,{weekday:"long",year:"numeric",month:"long",day:"numeric"}),"aria-pressed":I,"aria-disabled":v,disabled:v,onClick:()=>!v&&u(e),onMouseEnter:()=>p(e),onMouseLeave:()=>p(null),onFocus:()=>h(e),style:{width:"34px",height:"34px",borderRadius:"8px",backgroundColor:W,color:D,border:R,fontSize:"13px",fontWeight:T,cursor:v?"not-allowed":"pointer",opacity:v?.35:1,display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"inherit",position:"relative",outline:"none",textDecoration:v?"line-through":"none",transition:"background-color 80ms ease"},children:e.getDate()},x)})})]})}function $e({value:e,onChange:r,rangeValue:i,onRangeChange:d,multiValue:c,onMultiChange:u,mode:p="single",minDate:h,maxDate:f,disabledDates:m,locale:x="en-US",dateFormat:g,showTime:b=!1,timeValue:y,onTimeChange:v,showPresets:w=!1,customPresets:k,label:C,placeholder:S="MM/DD/YYYY",hint:$,isDisabled:z=!1,isInvalid:N=!1,errorMessage:M,numberOfMonths:I=1,id:L,className:W,style:D}){const R=t.useTheme(),T=(0,l.useId)(),B=L??T,A=o.useReducedMotion(),F=be(new Date),H=void 0!==e,[E,j]=(0,l.useState)(null),O=H?e??null:E,P=void 0!==i,[V,Y]=(0,l.useState)([null,null]),U=P?i:V,K=void 0!==c,[X,q]=(0,l.useState)([]),G=K?c:X,[Z,_]=(0,l.useState)("start"),J="range"===p||"single"===p&&b,[Q,ee]=(0,l.useState)([null,null]),[te,ne]=(0,l.useState)(null),oe=O??U[0]??F,[re,ie]=(0,l.useState)(oe.getFullYear()),[le,ae]=(0,l.useState)(oe.getMonth()),[se,de]=(0,l.useState)("day"),[ce,ue]=(0,l.useState)({h:0,m:0}),pe=y??ce,[he,fe]=(0,l.useState)(!1),[ye,we]=(0,l.useState)(()=>{if("single"===p)return ve(O,x,g);if("range"===p){const[e,t]=U;if(e&&t)return`${ve(e,x,g)} – ${ve(t,x,g)}`}return""}),[$e,ze]=(0,l.useState)(null),[Ne,Me]=(0,l.useState)(null),[Ie,Le]=(0,l.useState)({top:0,left:0,flipUp:!1}),[,We]=(0,l.useReducer)(e=>e+1,0),De=(0,l.useRef)(null),Re=(0,l.useRef)(null),Te=(0,l.useRef)(null),Be=w?420:b?480:360;(0,l.useEffect)(()=>{if("single"===p)we(ve(O,x,g));else if("range"===p){const[e,t]=U;we(e&&t?`${ve(e,x,g)} – ${ve(t,x,g)}`:e?ve(e,x,g):"")}else"multiple"===p&&we(G.length>0?`${G.length} date${1!==G.length?"s":""} selected`:"")},[O,U,G,p,x,g]);const Ae=(0,l.useCallback)(()=>{De.current&&Le(function(e,t){const n=e.getBoundingClientRect(),o=window.innerHeight,r=window.scrollY,i=window.scrollX,l=o-n.bottom<t+8&&n.top>t+8;return{top:l?r+n.top-t-4:r+n.bottom+4,left:i+n.left,flipUp:l}}(De.current,Be))},[Be]);(0,l.useEffect)(()=>{if(he)return Ae(),window.addEventListener("scroll",Ae,!0),window.addEventListener("resize",Ae),()=>{window.removeEventListener("scroll",Ae,!0),window.removeEventListener("resize",Ae)}},[he,Ae]),(0,l.useEffect)(()=>{if(!he)return;const e=e=>{De.current?.contains(e.target)||Re.current?.contains(e.target)||fe(!1)};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[he]),(0,l.useEffect)(()=>{if(!he)return;const e=e=>{"Escape"===e.key&&(fe(!1),Te.current?.focus())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[he]);const Fe=(0,l.useCallback)(e=>!!(h&&be(e)<be(h))||!!(f&&be(e)>be(f))||!!m&&("function"==typeof m?m(e):m.some(t=>ge(t,e))),[h,f,m]),He=(0,l.useCallback)(e=>{if(!Fe(e)){if("single"===p)J?ne(e):(H||j(e),r?.(e),we(ve(e,x,g)),fe(!1));else if("range"===p)if("start"===Z){const t=[e,null];ee(t),P||Y(t),d?.(t),_("end")}else{const t=Q[0]??U[0],n=t&&e<t?[e,t]:[t,e];ee(n),J?_("start"):(P||Y(n),d?.(n),_("start"),fe(!1))}else if("multiple"===p){const t=G.some(t=>ge(t,e))?G.filter(t=>!ge(t,e)):[...G,e];K||q(t),u?.(t)}We()}},[p,Fe,H,P,K,r,d,u,Z,Q,U,G,J,x]),Ee=(0,l.useCallback)(()=>{if("single"===p){const e=te??O;H||j(e),r?.(e)}else"range"===p&&(P||Y(Q),d?.(Q));fe(!1),_("start")},[p,te,Q,O,H,P,r,d]),je=(0,l.useCallback)(()=>{ne(null),ee([null,null]),_("start"),fe(!1)},[]),Oe=k??[{label:"Today",getValue:()=>{const e=be(new Date);return[e,e]}},{label:"Yesterday",getValue:()=>{const e=be(new Date);return e.setDate(e.getDate()-1),[e,e]}},{label:"Last 7 days",getValue:()=>{const e=be(new Date),t=new Date(e);return t.setDate(t.getDate()-6),[t,e]}},{label:"Last 30 days",getValue:()=>{const e=be(new Date),t=new Date(e);return t.setDate(t.getDate()-29),[t,e]}},{label:"Last 90 days",getValue:()=>{const e=be(new Date),t=new Date(e);return t.setDate(t.getDate()-89),[t,e]}},{label:"This week",getValue:()=>{const e=be(new Date),t=new Date(e);t.setDate(t.getDate()-t.getDay());const n=new Date(t);return n.setDate(n.getDate()+6),[t,n]}},{label:"Last week",getValue:()=>{const e=be(new Date),t=new Date(e);t.setDate(t.getDate()-t.getDay()-1);const n=new Date(t);return n.setDate(n.getDate()-6),[n,t]}},{label:"This month",getValue:()=>{const e=new Date;return[new Date(e.getFullYear(),e.getMonth(),1),new Date(e.getFullYear(),e.getMonth()+1,0)]}},{label:"Last month",getValue:()=>{const e=new Date;return[new Date(e.getFullYear(),e.getMonth()-1,1),new Date(e.getFullYear(),e.getMonth(),0)]}},{label:"This quarter",getValue:()=>{const e=new Date,t=Math.floor(e.getMonth()/3);return[new Date(e.getFullYear(),3*t,1),new Date(e.getFullYear(),3*t+3,0)]}},{label:"Last quarter",getValue:()=>{const e=new Date,t=Math.floor(e.getMonth()/3),n=0===t?3:t-1,o=0===t?e.getFullYear()-1:e.getFullYear();return[new Date(o,3*n,1),new Date(o,3*n+3,0)]}},{label:"This year",getValue:()=>{const e=(new Date).getFullYear();return[new Date(e,0,1),new Date(e,11,31)]}},{label:"Last year",getValue:()=>{const e=(new Date).getFullYear()-1;return[new Date(e,0,1),new Date(e,11,31)]}}],Pe=11===le?0:le+1,Ve=11===le?re+1:re,Ye=I>=2,Ue=C?n.sanitizeString(C):void 0,Ke=$?n.sanitizeString($):void 0,Xe=M?n.sanitizeString(M):void 0,qe=n.sanitizeString(S),Ge="single"===p&&null!=O||"range"===p&&(null!=U[0]||null!=U[1])||"multiple"===p&&G.length>0,Ze="range"===p?J?Q:U:[null,null],_e=N?R.danger:he?R.primary:R.border,Je=Array.from({length:24},(e,t)=>t),Qe=Array.from({length:60},(e,t)=>t),et=(0,a.jsxs)("div",{ref:Re,role:"dialog","aria-label":"Date picker","aria-modal":"false",onKeyDown:e=>{if("day"!==se)return;const t=$e??O??F;let n=null;if("ArrowRight"===e.key)n=new Date(t.getFullYear(),t.getMonth(),t.getDate()+1);else if("ArrowLeft"===e.key)n=new Date(t.getFullYear(),t.getMonth(),t.getDate()-1);else if("ArrowDown"===e.key)n=new Date(t.getFullYear(),t.getMonth(),t.getDate()+7);else if("ArrowUp"===e.key)n=new Date(t.getFullYear(),t.getMonth(),t.getDate()-7);else if("Enter"===e.key&&$e)return void He($e);n&&(e.preventDefault(),ze(n),n.getMonth()===le&&n.getFullYear()===re||(ae(n.getMonth()),ie(n.getFullYear())))},style:{position:"absolute",top:Ie.top,left:Ie.left,zIndex:9999,backgroundColor:R.surface,border:`1px solid ${R.border}`,borderRadius:"14px",boxShadow:"0 8px 30px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.1)",display:"flex",overflow:"hidden",minWidth:Ye?"580px":"300px",maxWidth:Ye&&w?"780px":Ye?"620px":w?"520px":"300px",opacity:he?1:0,transform:he?"translateY(0) scale(1)":Ie.flipUp?"translateY(4px) scale(0.98)":"translateY(-4px) scale(0.98)",transition:A?"none":"opacity 120ms ease, transform 120ms ease",fontFamily:"inherit"},children:[w&&"range"===p&&(0,a.jsxs)("div",{style:{width:"148px",flexShrink:0,borderRight:`1px solid ${R.border}`,padding:"8px 6px",overflowY:"auto",display:"flex",flexDirection:"column",gap:"1px"},children:[(0,a.jsx)("div",{style:{fontSize:"11px",fontWeight:600,color:R.textMuted,textTransform:"uppercase",letterSpacing:"0.07em",padding:"4px 8px 8px"},children:"Quick select"}),Oe.map(e=>{const[t,n]=e.getValue(),o=Ze[0]&&Ze[1]&&ge(Ze[0],t)&&ge(Ze[1],n);return(0,a.jsx)("button",{type:"button",onClick:()=>(e=>{const[t,n]=e.getValue(),o=[t,n];ee(o),P||Y(o),d?.(o),ie(t.getFullYear()),ae(t.getMonth()),_("start"),J||fe(!1)})(e),style:{width:"100%",textAlign:"left",padding:"7px 10px",borderRadius:"7px",border:"none",cursor:"pointer",fontSize:"13px",backgroundColor:o?`${R.primary}20`:"transparent",color:o?R.primary:R.text,fontWeight:o?600:400,fontFamily:"inherit",transition:"background-color 80ms ease"},onMouseEnter:e=>{o||(e.currentTarget.style.backgroundColor=`${R.surfaceAlt}`)},onMouseLeave:e=>{o||(e.currentTarget.style.backgroundColor="transparent")},children:e.label},e.label)})]}),(0,a.jsxs)("div",{style:{flex:1,padding:"16px",display:"flex",flexDirection:"column",gap:"12px",minWidth:0},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,a.jsx)("button",{type:"button","aria-label":"day"===se?"Previous month":"month"===se?"Previous year":"Previous decade",onClick:()=>{"day"===se?(0===le?(ae(11),ie(e=>e-1)):ae(e=>e-1),de("day")):ie("month"===se?e=>e-1:e=>e-10)},style:{border:"none",background:"transparent",cursor:"pointer",color:R.textMuted,padding:"6px",borderRadius:"6px",display:"flex",alignItems:"center"},children:(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,a.jsx)("polyline",{points:"15 18 9 12 15 6"})})}),(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:["day"===se&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{type:"button",onClick:()=>de("month"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:R.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:me[le]}),(0,a.jsx)("button",{type:"button",onClick:()=>de("year"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:R.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:re}),Ye&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{style:{color:R.textMuted,fontSize:"14px"},children:"–"}),(0,a.jsxs)("span",{style:{fontSize:"14px",fontWeight:600,color:R.text},children:[me[Pe]," ",Ve]})]})]}),"month"===se&&(0,a.jsx)("button",{type:"button",onClick:()=>de("year"),style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"14px",fontWeight:600,color:R.text,padding:"4px 6px",borderRadius:"6px",fontFamily:"inherit"},children:re}),"year"===se&&(0,a.jsxs)("span",{style:{fontSize:"14px",fontWeight:600,color:R.text},children:[ke(re),"–",ke(re)+9]})]}),(0,a.jsx)("button",{type:"button","aria-label":"day"===se?"Next month":"month"===se?"Next year":"Next decade",onClick:()=>{"day"===se?(11===le?(ae(0),ie(e=>e+1)):ae(e=>e+1),de("day")):ie("month"===se?e=>e+1:e=>e+10)},style:{border:"none",background:"transparent",cursor:"pointer",color:R.textMuted,padding:"6px",borderRadius:"6px",display:"flex",alignItems:"center"},children:(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,a.jsx)("polyline",{points:"9 18 15 12 9 6"})})})]}),"day"===se&&(0,a.jsxs)("div",{style:{display:"flex",gap:"20px"},children:[(0,a.jsx)(Se,{year:re,month:le,today:F,mode:p,selectedDate:O,selectedRange:Ze,multiDates:G,hoverDate:Ne,focusedDate:$e,isDateDisabled:Fe,onSelectDate:He,onHoverDate:Me,onSetFocused:ze,theme:R,locale:x}),Ye&&(0,a.jsx)(Se,{year:Ve,month:Pe,today:F,mode:p,selectedDate:O,selectedRange:Ze,multiDates:G,hoverDate:Ne,focusedDate:$e,isDateDisabled:Fe,onSelectDate:He,onHoverDate:Me,onSetFocused:ze,theme:R,locale:x})]}),"month"===se&&(0,a.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"6px"},children:xe.map((e,t)=>{const n=t===le;return(0,a.jsx)("button",{type:"button",onClick:()=>{ae(t),de("day")},style:{padding:"10px",borderRadius:"8px",border:t!==F.getMonth()||re!==F.getFullYear()||n?"none":`2px solid ${R.primary}`,cursor:"pointer",fontSize:"13px",fontWeight:n?600:400,backgroundColor:n?R.primary:"transparent",color:n?R.bg:R.text,fontFamily:"inherit",transition:"background-color 80ms ease"},children:e},e)})}),"year"===se&&(0,a.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"6px"},children:Array.from({length:12},(e,t)=>{const n=ke(re)-1+t,o=n===re,r=n===F.getFullYear(),i=0===t||11===t;return(0,a.jsx)("button",{type:"button",onClick:()=>{ie(n),de("month")},style:{padding:"10px 6px",borderRadius:"8px",border:r&&!o?`2px solid ${R.primary}`:"none",cursor:"pointer",fontSize:"13px",fontWeight:o?600:400,backgroundColor:o?R.primary:"transparent",color:o?R.bg:i?R.textMuted:R.text,fontFamily:"inherit",transition:"background-color 80ms ease",opacity:i?.5:1},children:n},n)})}),b&&"day"===se&&(0,a.jsxs)("div",{style:{borderTop:`1px solid ${R.border}`,paddingTop:"12px",display:"flex",alignItems:"flex-start",gap:"8px",justifyContent:"center"},children:[(0,a.jsx)(Ce,{values:Je,selected:pe.h,onSelect:e=>{y||ue(t=>({...t,h:e})),v?.({...pe,h:e})},label:"Hour",theme:R}),(0,a.jsx)("div",{style:{display:"flex",alignItems:"center",height:"40px",marginTop:"28px",fontSize:"16px",fontWeight:700,color:R.textMuted},children:":"}),(0,a.jsx)(Ce,{values:Qe,selected:pe.m,onSelect:e=>{y||ue(t=>({...t,m:e})),v?.({...pe,m:e})},label:"Min",theme:R})]}),"multiple"===p&&"day"===se&&G.length>0&&(0,a.jsxs)("div",{style:{borderTop:`1px solid ${R.border}`,paddingTop:"8px",fontSize:"12px",color:R.textMuted,textAlign:"center"},children:[G.length," date",1!==G.length?"s":""," selected"]}),(0,a.jsxs)("div",{style:{borderTop:`1px solid ${R.border}`,paddingTop:"10px",display:"flex",alignItems:"center",justifyContent:J?"space-between":"flex-start",gap:"8px"},children:[(0,a.jsx)("button",{type:"button",onClick:()=>{ie(F.getFullYear()),ae(F.getMonth()),de("day"),He(F)},style:{border:"none",background:"transparent",cursor:"pointer",fontSize:"13px",color:R.primary,fontWeight:500,padding:"6px 10px",borderRadius:"6px",fontFamily:"inherit"},children:"Today"}),J&&(0,a.jsxs)("div",{style:{display:"flex",gap:"6px"},children:[(0,a.jsx)("button",{type:"button",onClick:je,style:{padding:"6px 14px",borderRadius:"7px",border:`1px solid ${R.border}`,cursor:"pointer",fontSize:"13px",fontWeight:500,backgroundColor:"transparent",color:R.text,fontFamily:"inherit"},children:"Cancel"}),(0,a.jsx)("button",{type:"button",onClick:Ee,style:{padding:"6px 14px",borderRadius:"7px",border:"none",cursor:"pointer",fontSize:"13px",fontWeight:600,backgroundColor:R.primary,color:R.bg,fontFamily:"inherit"},children:"Apply"})]})]})]})]});return(0,a.jsxs)("div",{className:W,style:{display:"flex",flexDirection:"column",gap:"4px",width:"100%",position:"relative",...D},children:[Ue&&(0,a.jsx)("label",{htmlFor:B,style:{fontSize:"13px",fontWeight:500,color:R.text,marginBottom:"2px"},children:Ue}),(0,a.jsxs)("div",{ref:De,style:{display:"flex",alignItems:"center",border:`1.5px solid ${_e}`,borderRadius:"8px",backgroundColor:R.surface,overflow:"hidden",transition:A?"none":"border-color 120ms ease",opacity:z?.5:1},children:[(0,a.jsx)("span",{style:{display:"flex",alignItems:"center",paddingLeft:"10px",color:R.textMuted,flexShrink:0},children:(0,a.jsxs)("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,a.jsx)("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),(0,a.jsx)("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),(0,a.jsx)("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),(0,a.jsx)("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})}),(0,a.jsx)("input",{ref:Te,id:B,type:"text",value:ye,placeholder:qe,disabled:z,"aria-invalid":N,"aria-haspopup":"dialog","aria-expanded":he,readOnly:"range"===p||"multiple"===p,onChange:e=>(e=>{if(we(e),"single"===p){const t=function(e,t){const n=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);if(n){const[,e,t,o]=n.map(Number);if(e>=1&&e<=12&&t>=1&&t<=31){const n=new Date(o,e-1,t);if(n.getMonth()===e-1)return n}}const o=e.match(/^(\d{4})-(\d{1,2})-(\d{1,2})$/);if(o){const[,e,t,n]=o.map(Number),r=new Date(e,t-1,n);if(r.getMonth()===t-1)return r}if(t&&/^DD/.test(t)){const t=e.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);if(t){const[,e,n,o]=t.map(Number),r=new Date(o,n-1,e);if(r.getMonth()===n-1)return r}}return null}(e,g);t&&!Fe(t)&&(H||j(t),r?.(t),ie(t.getFullYear()),ae(t.getMonth()))}})(e.target.value),onFocus:()=>{z||fe(!0)},style:{flex:1,backgroundColor:"transparent",border:"none",outline:"none",fontSize:"14px",padding:"9px 8px",color:R.text,cursor:"single"!==p?"pointer":"text",fontFamily:"inherit",minWidth:0}}),Ge&&!z&&(0,a.jsx)("button",{type:"button","aria-label":"Clear selection",onClick:e=>{if(e.stopPropagation(),"single"===p)H||j(null),r?.(null),we("");else if("range"===p){const e=[null,null];P||Y(e),d?.(e),ee(e),we(""),_("start")}else"multiple"===p&&(K||q([]),u?.([]),we(""))},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",border:"none",background:"transparent",cursor:"pointer",color:R.textMuted,flexShrink:0,borderRadius:"4px",marginRight:"4px"},children:(0,a.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),(0,a.jsx)("button",{type:"button","aria-label":he?"Close calendar":"Open calendar",tabIndex:-1,disabled:z,onClick:()=>{z||fe(e=>!e)},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"34px",height:"36px",border:"none",background:"transparent",cursor:z?"not-allowed":"pointer",color:R.textMuted,flexShrink:0},children:(0,a.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",style:{transform:he?"rotate(180deg)":"rotate(0deg)",transition:A?"none":"transform 160ms ease"},children:(0,a.jsx)("polyline",{points:"6 9 12 15 18 9"})})})]}),Ke&&!N&&(0,a.jsx)("span",{style:{fontSize:"12px",color:R.textMuted},children:Ke}),N&&Xe&&(0,a.jsx)("span",{role:"alert",style:{fontSize:"12px",color:R.danger},children:Xe}),he&&"undefined"!=typeof document&&(0,s.createPortal)(et,document.body)]})}$e.displayName="TkxDatePicker";var ze={sm:{track:4,thumb:14,fontSize:"0.75rem"},md:{track:6,thumb:18,fontSize:"0.875rem"},lg:{track:8,thumb:22,fontSize:"1rem"}};function Ne(e,t,n){return Math.min(Math.max(e,t),n)}function Me(e,t,n){return Math.round((e-t)/n)*n+t}function Ie(e,t,n){return(e-t)/(n-t)*100}function Le({value:e,min:t,max:n,step:o,isDisabled:r,trackColor:i,thumbSize:s,ariaLabel:d,tooltipMode:c,formatValue:u,orientation:p,onChange:h,onChangeEnd:f}){const[m,x]=(0,l.useState)(!1),[g,b]=(0,l.useState)(!1),[y,v]=(0,l.useState)(!1),w="vertical"===p,k=Ie(e,t,n),C="always"===c||"hover"===c&&(y||g||m),S=w?{position:"absolute",bottom:`${k}%`,transform:"translateY(50%)",left:"50%",marginLeft:`-${s/2}px`,zIndex:2,cursor:r?"not-allowed":"grab"}:{position:"absolute",left:`${k}%`,transform:"translateX(-50%)",top:"50%",marginTop:`-${s/2}px`,zIndex:2,cursor:r?"not-allowed":"grab"},$=w?{position:"absolute",left:s+6,top:"50%",transform:"translateY(-50%)",backgroundColor:i,color:"#fff",borderRadius:"4px",padding:"2px 6px",fontSize:"0.75rem",whiteSpace:"nowrap",pointerEvents:"none"}:{position:"absolute",bottom:s+6,left:"50%",transform:"translateX(-50%)",backgroundColor:i,color:"#fff",borderRadius:"4px",padding:"2px 6px",fontSize:"0.75rem",whiteSpace:"nowrap",pointerEvents:"none"};return(0,a.jsxs)("div",{style:S,children:[C&&(0,a.jsx)("div",{style:$,children:u(e)}),(0,a.jsx)("div",{role:"slider",tabIndex:r?-1:0,"aria-label":d,"aria-valuemin":t,"aria-valuemax":n,"aria-valuenow":e,"aria-disabled":r,"aria-orientation":p,onKeyDown:i=>{r||("ArrowRight"===i.key||"ArrowUp"===i.key?(i.preventDefault(),h(Ne(Me(e+o,t,o),t,n))):"ArrowLeft"===i.key||"ArrowDown"===i.key?(i.preventDefault(),h(Ne(Me(e-o,t,o),t,n))):"Home"===i.key?(i.preventDefault(),h(t)):"End"===i.key&&(i.preventDefault(),h(n)))},onFocus:()=>x(!0),onBlur:()=>x(!1),onPointerEnter:()=>v(!0),onPointerLeave:()=>v(!1),onPointerDown:e=>{r||(b(!0),e.target.setPointerCapture(e.pointerId))},onPointerUp:()=>{b(!1),f?.()},style:{width:s,height:s,borderRadius:"50%",backgroundColor:r?"#888":i,border:"3px solid #fff",boxShadow:m?`0 0 0 3px ${i}44`:"0 1px 4px rgba(0,0,0,0.3)",outline:"none",display:"block",transition:"box-shadow 150ms ease"}})]})}function We({value:e,defaultValue:r=0,onChange:i,rangeValue:s,onRangeChange:d,min:c=0,max:u=100,step:p=1,isRange:h=!1,label:f,showValue:m=!1,showTicks:x=!1,tickCount:g=5,isDisabled:b=!1,colorScheme:y="primary",size:v="md",marks:w,orientation:k="horizontal",showTooltip:C=!1,formatValue:S,onChangeEnd:$,onRangeChangeEnd:z,gradient:N=!1}){const M=t.useTheme(),I=(0,l.useId)(),L=o.useReducedMotion(),W=void 0!==e,[D,R]=(0,l.useState)(r),T=W?e:D,B=void 0!==s,[A,F]=(0,l.useState)([c,u]),H=B?s:A,E=(0,l.useRef)(null),j=(0,l.useRef)(T);j.current=T;const O=(0,l.useRef)(H);O.current=H;const P={primary:M.primary,success:M.success,danger:M.danger,warning:M.warning}[y],V=ze[v],Y="vertical"===k,U=!0===C?"hover":!1!==C&&C,K=S??(e=>String(e)),X=P+"66",q=(0,l.useCallback)((e,t)=>{const n=E.current;if(!n)return c;const o=n.getBoundingClientRect();let r;return r=Ne(Y?(o.bottom-(t??0))/o.height:(e-o.left)/o.width,0,1),Ne(Me(r*(u-c)+c,c,p),c,u)},[c,u,p,Y]),G=(0,l.useCallback)(e=>{if(b)return;const t=q(e.clientX,e.clientY);if(h){const[e,n]=H,o=Math.abs(t-e)<=Math.abs(t-n)?[t,n]:[e,t];B||F(o),d?.(o)}else W||R(t),i?.(t)},[b,h,W,B,q,i,d,H]),Z=h?Ie(H[0],c,u):0,_=Ie(h?H[1]:T,c,u),J=x?Array.from({length:g},(e,t)=>c+t/(g-1)*(u-c)):[],Q=f?n.sanitizeString(f):void 0,ee=L?"none":"background 150ms ease";return(0,a.jsxs)("div",{className:n.tkx("flex flex-col gap-2"),style:{opacity:b?.55:1,...Y?{height:200,width:"auto",display:"inline-flex"}:{width:"100%"}},children:[(Q||m)&&(0,a.jsxs)("div",{className:n.tkx("flex items-center justify-between"),children:[Q&&(0,a.jsx)("label",{htmlFor:I,className:n.tkx("text-sm font-medium"),style:{color:M.text,fontSize:V.fontSize},children:Q}),m&&!h&&(0,a.jsx)("span",{className:n.tkx("text-sm tabular-nums"),style:{color:M.textMuted,fontSize:V.fontSize},children:K(T)}),m&&h&&(0,a.jsxs)("span",{className:n.tkx("text-sm tabular-nums"),style:{color:M.textMuted,fontSize:V.fontSize},children:[K(H[0])," – ",K(H[1])]})]}),(0,a.jsxs)("div",{style:{position:"relative",...Y?{paddingLeft:V.thumb/2,paddingRight:V.thumb/2,flex:1}:{paddingTop:V.thumb/2,paddingBottom:V.thumb/2}},children:[(0,a.jsxs)("div",{ref:E,onPointerDown:G,style:{position:"relative",...Y?{width:V.track,height:"100%"}:{height:V.track},borderRadius:9999,backgroundColor:M.border,cursor:b?"not-allowed":"pointer",userSelect:"none",touchAction:"none"},children:[(0,a.jsx)("div",{style:{position:"absolute",...Y?{left:0,bottom:`${Z}%`,height:_-Z+"%",width:"100%"}:{top:0,left:`${Z}%`,width:_-Z+"%",height:"100%"},borderRadius:9999,...b?{backgroundColor:M.textMuted}:N?{background:Y?`linear-gradient(to top, ${X}, ${P})`:`linear-gradient(to right, ${X}, ${P})`}:{backgroundColor:P},transition:ee}}),J.map((e,t)=>(0,a.jsx)("div",{style:{position:"absolute",...Y?{bottom:`${Ie(e,c,u)}%`,left:"50%",transform:"translate(-50%, 50%)",height:3,width:V.track+4}:{left:`${Ie(e,c,u)}%`,top:"50%",transform:"translate(-50%, -50%)",width:3,height:V.track+4},backgroundColor:M.surface,borderRadius:9999,pointerEvents:"none"}},t)),h?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Le,{value:H[0],min:c,max:H[1],step:p,isDisabled:b,trackColor:P,trackHeight:V.track,thumbSize:V.thumb,ariaLabel:`${Q??"Range"} start`,tooltipMode:U,formatValue:K,orientation:k,onChange:e=>{const t=[Ne(e,c,H[1]),H[1]];B||F(t),d?.(t)},onChangeEnd:z?()=>z(O.current):void 0}),(0,a.jsx)(Le,{value:H[1],min:H[0],max:u,step:p,isDisabled:b,trackColor:P,trackHeight:V.track,thumbSize:V.thumb,ariaLabel:`${Q??"Range"} end`,tooltipMode:U,formatValue:K,orientation:k,onChange:e=>{const t=[H[0],Ne(e,H[0],u)];B||F(t),d?.(t)},onChangeEnd:z?()=>z(O.current):void 0})]}):(0,a.jsx)(Le,{value:T,min:c,max:u,step:p,isDisabled:b,trackColor:P,trackHeight:V.track,thumbSize:V.thumb,ariaLabel:Q??"Slider",tooltipMode:U,formatValue:K,orientation:k,onChange:e=>{W||R(e),i?.(e)},onChangeEnd:$?()=>$(j.current):void 0})]}),w&&w.length>0&&(0,a.jsx)("div",{style:{position:Y?"absolute":"relative",...Y?{left:"100%",top:0,bottom:0,marginLeft:8}:{marginTop:8}},children:w.map((e,t)=>(0,a.jsx)("div",{style:{position:"absolute",...Y?{bottom:`${Ie(e.value,c,u)}%`,transform:"translateY(50%)",left:0}:{left:`${Ie(e.value,c,u)}%`,transform:"translateX(-50%)"},fontSize:"0.6875rem",color:M.textMuted,whiteSpace:"nowrap"},children:n.sanitizeString(e.label)},t))})]}),x&&!w&&!Y&&(0,a.jsx)("div",{style:{position:"relative",height:"1rem"},children:J.map((e,t)=>(0,a.jsx)("span",{style:{position:"absolute",left:`${Ie(e,c,u)}%`,transform:"translateX(-50%)",fontSize:"0.6875rem",color:M.textMuted},children:K(Math.round(e))},t))})]})}We.displayName="TkxSlider";var De={sm:{height:28,minWidth:28,fontSize:"0.75rem",px:8},md:{height:36,minWidth:36,fontSize:"0.875rem",px:10},lg:{height:44,minWidth:44,fontSize:"1rem",px:12}};function Re({total:e,pageSize:o=10,page:r,defaultPage:i=1,onChange:s,siblingCount:d=1,showEdges:c=!0,showPageSize:u=!1,onPageSizeChange:p,pageSizeOptions:h=[10,25,50,100],size:f="md",variant:m="default"}){const x=t.useTheme(),g=(0,l.useId)(),b=void 0!==r,[y,v]=(0,l.useState)(i),w=b?r:y,[k,C]=(0,l.useState)(o),S=o,$=Math.max(1,Math.ceil(e/S)),z=e=>{const t=Math.min(Math.max(e,1),$);t!==w&&(b||v(t),s?.(t))},N=function(e,t,n,o){if(t<=1)return[1];const r=(e,t)=>Array.from({length:Math.max(0,t-e+1)},(t,n)=>e+n),i=Math.max(e-n,1),l=Math.min(e+n,t);if(!o){const e=[];return i>1&&e.push("..."),e.push(...r(i,l)),l<t&&e.push("..."),e}const a=i>3,s=l<t-2,d=[];d.push(1),a?d.push("left-ellipsis"):d.push(...r(2,i-1)),d.push(...r(Math.max(i,2),Math.min(l,t-1))),s?d.push("right-ellipsis"):d.push(...r(l+1,t-1)),t>1&&d.push(t);const c=new Set,u=[];for(const p of d)"number"==typeof p?c.has(p)||(c.add(p),u.push(p)):u.push(p);return u}(w,$,d,c),M=De[f],I=Math.min((w-1)*S+1,e),L=Math.min(w*S,e),W=(e,t)=>{const n={height:M.height,minWidth:M.minWidth,paddingLeft:M.px,paddingRight:M.px,fontSize:M.fontSize,borderRadius:"8px",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:t?"not-allowed":"pointer",border:"none",outline:"none",fontFamily:"inherit",transition:"background 120ms ease, color 120ms ease",opacity:t?.4:1};return e?{...n,backgroundColor:x.primary,color:x.bg,fontWeight:600,boxShadow:`0 0 0 2px ${x.primary}44`}:"default"===m?{...n,backgroundColor:x.surface,color:x.text,border:`1px solid ${x.border}`}:"outline"===m?{...n,backgroundColor:"transparent",color:x.text,border:`1px solid ${x.border}`}:{...n,backgroundColor:"transparent",color:x.text}},D=({d:e})=>(0,a.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5","aria-hidden":"true",children:(0,a.jsx)("polyline",{points:e})});return(0,a.jsxs)("nav",{"aria-label":"Pagination",className:n.tkx("flex flex-col gap-2"),children:[e>0&&(0,a.jsx)("p",{className:n.tkx("text-sm"),style:{color:x.textMuted,fontSize:M.fontSize},children:n.sanitizeString(`Showing ${I}–${L} of ${e} items`)}),(0,a.jsxs)("div",{className:n.tkx("flex items-center gap-1 flex-wrap"),children:[c&&(0,a.jsxs)("button",{type:"button","aria-label":"First page",disabled:1===w,onClick:()=>z(1),style:W(!1,1===w),children:[(0,a.jsx)(D,{d:"15 18 9 12 15 6"}),(0,a.jsx)(D,{d:"20 18 14 12 20 6"})]}),(0,a.jsx)("button",{type:"button","aria-label":"Previous page",disabled:1===w,onClick:()=>z(w-1),style:W(!1,1===w),children:(0,a.jsx)(D,{d:"15 18 9 12 15 6"})}),N.map((e,t)=>{if("string"==typeof e)return(0,a.jsx)("span",{"aria-hidden":"true",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:M.minWidth,height:M.height,fontSize:M.fontSize,color:x.textMuted,userSelect:"none"},children:"…"},`${e}-${t}`);const n=e,o=n===w;return(0,a.jsx)("button",{type:"button","aria-label":`Page ${n}`,"aria-current":o?"page":void 0,onClick:()=>z(n),style:W(o,!1),children:n},n)}),(0,a.jsx)("button",{type:"button","aria-label":"Next page",disabled:w===$,onClick:()=>z(w+1),style:W(!1,w===$),children:(0,a.jsx)(D,{d:"9 18 15 12 9 6"})}),c&&(0,a.jsxs)("button",{type:"button","aria-label":"Last page",disabled:w===$,onClick:()=>z($),style:W(!1,w===$),children:[(0,a.jsx)(D,{d:"4 18 10 12 4 6"}),(0,a.jsx)(D,{d:"14 18 20 12 14 6"})]}),u&&(0,a.jsxs)("div",{className:n.tkx("flex items-center gap-2 ml-2"),children:[(0,a.jsx)("label",{htmlFor:g,className:n.tkx("text-sm"),style:{color:x.textMuted,fontSize:M.fontSize,whiteSpace:"nowrap"},children:"Rows per page"}),(0,a.jsx)("select",{id:g,value:k,onChange:e=>{return t=Number(e.target.value),C(t),p?.(t),void z(1);var t},style:{height:M.height,paddingLeft:M.px,paddingRight:M.px,fontSize:M.fontSize,borderRadius:"8px",border:`1px solid ${x.border}`,backgroundColor:x.surface,color:x.text,cursor:"pointer",outline:"none",fontFamily:"inherit"},children:h.map(e=>(0,a.jsx)("option",{value:e,children:e},e))})]})]})]})}Re.displayName="TkxPagination";var Te={"1/1":"100%","4/3":"75%","16/9":"56.25%","3/2":"66.666%","9/16":"177.777%"},Be={none:"0",sm:"4px",md:"8px",lg:"16px",full:"9999px"};function Ae({color:e,size:t}){return(0,a.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:e,strokeWidth:1.5,"aria-hidden":"true",children:[(0,a.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,a.jsx)("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),(0,a.jsx)("path",{d:"M21 15l-5-5L5 21"})]})}function Fe(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function He({mimeType:e,color:t}){return e.startsWith("image/")?(0,a.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:1.5,"aria-hidden":"true",children:[(0,a.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,a.jsx)("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),(0,a.jsx)("path",{d:"M21 15l-5-5L5 21"})]}):"application/pdf"===e?(0,a.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:1.5,"aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),(0,a.jsx)("polyline",{points:"14 2 14 8 20 8"}),(0,a.jsx)("line",{x1:"9",y1:"13",x2:"15",y2:"13"}),(0,a.jsx)("line",{x1:"9",y1:"17",x2:"11",y2:"17"})]}):(0,a.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:1.5,"aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),(0,a.jsx)("polyline",{points:"14 2 14 8 20 8"})]})}var Ee=0,je={sm:16,md:24,lg:32,xl:40};function Oe({size:e,filled:t,color:n,halfFilled:o,id:r}){const i=r?`hg-${r}`:void 0;return(0,a.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[o&&i&&(0,a.jsx)("defs",{children:(0,a.jsxs)("linearGradient",{id:i,x1:"0",x2:"1",y1:"0",y2:"0",children:[(0,a.jsx)("stop",{offset:"50%",stopColor:n}),(0,a.jsx)("stop",{offset:"50%",stopColor:"transparent"})]})}),(0,a.jsx)("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",fill:o&&i?`url(#${i})`:t?n:"none",stroke:n,strokeWidth:1.5,strokeLinejoin:"round"})]})}function Pe({size:e,filled:t,color:n,halfFilled:o,id:r}){const i=r?`hg-${r}`:void 0;return(0,a.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[o&&i&&(0,a.jsx)("defs",{children:(0,a.jsxs)("linearGradient",{id:i,x1:"0",x2:"1",y1:"0",y2:"0",children:[(0,a.jsx)("stop",{offset:"50%",stopColor:n}),(0,a.jsx)("stop",{offset:"50%",stopColor:"transparent"})]})}),(0,a.jsx)("path",{d:"M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z",fill:o&&i?`url(#${i})`:t?n:"none",stroke:n,strokeWidth:1.5,strokeLinejoin:"round"})]})}function Ve({size:e,filled:t,color:n,halfFilled:o,id:r}){const i=r?`hg-${r}`:void 0;return(0,a.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",style:{display:"block"},children:[o&&i&&(0,a.jsx)("defs",{children:(0,a.jsxs)("linearGradient",{id:i,x1:"0",x2:"1",y1:"0",y2:"0",children:[(0,a.jsx)("stop",{offset:"50%",stopColor:n}),(0,a.jsx)("stop",{offset:"50%",stopColor:"transparent"})]})}),(0,a.jsx)("circle",{cx:"12",cy:"12",r:"9",fill:o&&i?`url(#${i})`:t?n:"none",stroke:n,strokeWidth:1.5})]})}function Ye({type:e,size:t,filled:n,color:o,halfFilled:r,uid:i}){const l={size:t,filled:n,color:o,halfFilled:r,id:i};return"heart"===e?(0,a.jsx)(Pe,{...l}):"circle"===e?(0,a.jsx)(Ve,{...l}):(0,a.jsx)(Oe,{...l})}function Ue(e,t,n){return Math.min(n,Math.max(t,e))}function Ke(e,t,n){if(1===n)return t+1;const o=e.currentTarget.getBoundingClientRect(),r=o.left+o.width/2;return e.clientX<r?t+.5:t+1}var Xe=!1;function qe(){return(0,a.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"14",cy:"14",r:"14",fill:"currentColor",fillOpacity:"0.15"}),(0,a.jsx)("circle",{cx:"14",cy:"11",r:"4",fill:"currentColor"}),(0,a.jsx)("path",{d:"M6 24c0-4.418 3.582-8 8-8s8 3.582 8 8",fill:"currentColor"})]})}function Ge(){return(0,a.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"14",cy:"14",r:"14",fill:"currentColor",fillOpacity:"0.15"}),(0,a.jsx)("path",{d:"M14 5l2.2 6.5H23l-5.6 4 2.2 6.5L14 18l-5.6 4 2.2-6.5L5 11.5h6.8z",fill:"currentColor"})]})}function Ze(){const e=t.useTheme();return(0,a.jsxs)("div",{className:n.tkx("flex items-center gap-1.5 px-4 py-3 rounded-2xl w-fit"),style:{backgroundColor:e.surface,border:`1px solid ${e.border}`},"aria-label":"Assistant is thinking",children:[(0,a.jsx)("span",{className:"tkx-dot1 inline-block w-2 h-2 rounded-full",style:{backgroundColor:e.textMuted}}),(0,a.jsx)("span",{className:"tkx-dot2 inline-block w-2 h-2 rounded-full",style:{backgroundColor:e.textMuted}}),(0,a.jsx)("span",{className:"tkx-dot3 inline-block w-2 h-2 rounded-full",style:{backgroundColor:e.textMuted}})]})}function _e({message:e,showTimestamp:r,avatarUser:i,avatarAssistant:l}){const s=t.useTheme(),d=o.useReducedMotion(),{role:c,content:u,timestamp:p,isStreaming:h,error:f}=e,m=n.sanitizeString(u),x=p?new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}).format(p):null;if("system"===c)return(0,a.jsx)("div",{role:"listitem",className:n.tkx("flex justify-center my-2"),children:(0,a.jsx)("p",{className:n.tkx("text-xs italic px-3 py-1 rounded-full"),style:{color:s.textMuted,backgroundColor:s.surfaceAlt},children:m})});const g="user"===c,b=g?i??(0,a.jsx)(qe,{}):l??(0,a.jsx)(Ge,{}),y=g?{backgroundColor:s.primary,color:s.bg}:{backgroundColor:s.surface,color:s.text,border:`1px solid ${f?s.danger:s.border}`};return f&&(y.borderColor=s.danger,y.borderWidth="2px"),(0,a.jsxs)("div",{role:"listitem",className:n.tkx("flex gap-2 mb-4",g?"flex-row-reverse":"flex-row"),children:[(0,a.jsx)("div",{className:n.tkx("shrink-0 w-8 h-8 rounded-full flex items-center justify-center overflow-hidden"),style:{color:g?s.primary:s.secondary},children:b}),(0,a.jsxs)("div",{className:n.tkx("flex flex-col gap-1 max-w-[75%]",g?"items-end":"items-start"),children:[(0,a.jsxs)("div",{className:n.cx(n.tkx("px-4 py-2.5 rounded-2xl text-sm leading-relaxed break-words whitespace-pre-wrap"),h&&!d?"tkx-cursor":""),style:y,children:[m,f&&(0,a.jsx)("span",{"aria-label":"Error",style:{marginLeft:6,color:s.danger},children:"⚠"})]}),r&&x&&(0,a.jsx)("span",{className:n.tkx("text-[10px]"),style:{color:s.textMuted},children:x})]})]})}var Je={sm:"text-[11px]",md:"text-xs",lg:"text-sm"},Qe={sm:"px-2 py-0.5",md:"px-2.5 py-1",lg:"px-3 py-1.5"},et={sm:"gap-1",md:"gap-1.5",lg:"gap-2"},tt={sm:12,md:14,lg:16};function nt({variant:e="subtle",size:r="md",colorScheme:i="default",onRemove:l,leftIcon:s,isDisabled:d=!1,clickable:c=!1,children:u,className:p,style:h,onClick:f,...m}){t.useTheme();const x=o.useReducedMotion(),g=function(e,n){const o=t.useTheme(),r={default:o.textMuted,primary:o.primary,secondary:o.secondary,success:o.success,danger:o.danger,warning:o.warning,info:o.info}[e];return"solid"===n?{bg:r,color:o.bg,border:"transparent"}:"subtle"===n?{bg:`${r}22`,color:r,border:"transparent"}:{bg:"transparent",color:r,border:r}}(i,e),b="string"==typeof u?n.sanitizeString(u):u,y=tt[r],v=n.tkx("inline-flex items-center font-medium rounded-full select-none",Je[r],Qe[r],et[r],d?"opacity-50 cursor-not-allowed":c?"cursor-pointer":"cursor-default",c&&!x&&"transition-opacity duration-150");return(0,a.jsxs)("span",{role:c?"button":void 0,tabIndex:c&&!d?0:void 0,"aria-disabled":d||void 0,className:n.cx(v,p),style:{backgroundColor:g.bg,color:g.color,border:`1px solid ${"transparent"===g.border?"transparent":g.border}`,...h},onClick:d?void 0:f,onKeyDown:c&&!d&&f?e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),f(e))}:void 0,...m,children:[s&&(0,a.jsx)("span",{"aria-hidden":"true",className:n.tkx("shrink-0 flex items-center"),children:s}),(0,a.jsx)("span",{children:b}),l&&!d&&(0,a.jsx)("button",{type:"button","aria-label":`Remove ${"string"==typeof u?u:"tag"}`,onClick:e=>{e.stopPropagation(),l()},className:n.tkx("shrink-0 flex items-center justify-center rounded-full cursor-pointer"),style:{width:y+4,height:y+4,color:g.color,backgroundColor:"transparent",border:"none",padding:0},tabIndex:0,children:(0,a.jsx)("svg",{width:y,height:y,viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})})})]})}var ot=!1;function rt({status:e="pending",icon:r,size:i=28}){const l=t.useTheme(),s=o.useReducedMotion(),d=function(e="pending"){const n=t.useTheme();return{completed:n.success,active:n.primary,pending:n.border,error:n.danger}[e]}(e),c="active"===e;return(0,a.jsx)("div",{className:n.cx(n.tkx("relative flex items-center justify-center rounded-full shrink-0 z-10"),c&&!s?"tkx-pulse-dot":""),style:{width:i,height:i,backgroundColor:"pending"===e?l.surface:d,border:`2px solid ${d}`,color:"pending"===e?d:l.bg},"aria-hidden":"true",children:r?(0,a.jsx)("span",{style:{fontSize:.45*i,lineHeight:1},children:r}):(0,a.jsx)("span",{style:{width:.35*i,height:.35*i,borderRadius:"50%",backgroundColor:"pending"===e?d:l.bg,display:"block"}})})}function it({style:e,color:o,animate:r}){return t.useTheme(),(0,a.jsx)("div",{className:n.cx(n.tkx("w-0.5 flex-1 min-h-[24px]"),r?"tkx-draw-v":""),style:{borderLeft:`2px ${e} ${o}`,backgroundColor:"transparent",alignSelf:"stretch",borderColor:o,marginLeft:1},"aria-hidden":"true"})}function lt({style:e,color:t,animate:o}){return(0,a.jsx)("div",{className:n.cx(n.tkx("h-0.5 flex-1 min-w-[24px]"),o?"tkx-draw-h":""),style:{borderTop:`2px ${e} ${t}`,borderColor:t},"aria-hidden":"true"})}function at({item:e,compact:o}){const r=t.useTheme(),i=e.timestamp?n.sanitizeString(e.timestamp):null;return(0,a.jsxs)("div",{className:n.tkx("flex flex-col gap-0.5",o?"pb-3":"pb-5"),children:[(0,a.jsxs)("div",{className:n.tkx("flex items-center gap-2 flex-wrap"),children:[(0,a.jsx)("span",{className:n.tkx("text-sm font-semibold leading-snug"),style:{color:r.text},children:"string"==typeof e.title?n.sanitizeString(e.title):e.title}),e.badge&&(0,a.jsx)("span",{children:e.badge}),i&&(0,a.jsx)("span",{className:n.tkx("text-[11px] ml-auto"),style:{color:r.textMuted},children:i})]}),e.description&&!o&&(0,a.jsx)("div",{className:n.tkx("text-xs leading-relaxed mt-0.5"),style:{color:r.textMuted},children:"string"==typeof e.description?n.sanitizeString(e.description):e.description})]})}function st(e,t,n,o){const r=window.innerWidth,i=window.innerHeight;let l=0,a=0,s="top left";switch(t){case"bottom-start":l=e.bottom+6,a=e.left,s="top left",l+o>i&&e.top-6-o>0&&(l=e.top-6-o,s="bottom left"),a+n>r&&(a=Math.max(0,r-n-8));break;case"bottom-end":l=e.bottom+6,a=e.right-n,s="top right",l+o>i&&e.top-6-o>0&&(l=e.top-6-o,s="bottom right"),a<0&&(a=8);break;case"top-start":l=e.top-6-o,a=e.left,s="bottom left",l<0&&(l=e.bottom+6,s="top left"),a+n>r&&(a=Math.max(0,r-n-8));break;case"top-end":l=e.top-6-o,a=e.right-n,s="bottom right",l<0&&(l=e.bottom+6,s="top right"),a<0&&(a=8);break;case"right-start":l=e.top,a=e.right+6,s="top left",a+n>r&&(a=e.left-6-n,s="top right"),l+o>i&&(l=Math.max(8,i-o-8));break;case"left-start":l=e.top,a=e.left-6-n,s="top right",a<0&&(a=e.right+6,s="top left"),l+o>i&&(l=Math.max(8,i-o-8))}return{top:l+window.scrollY,left:a+window.scrollX,transformOrigin:s}}function dt(e,t){return{position:"absolute",top:t.top,left:t.left,zIndex:9999,minWidth:200,maxWidth:320,backgroundColor:e.surface,border:`1.5px solid ${e.border}`,borderRadius:10,boxShadow:"0 8px 32px rgba(0,0,0,0.28), 0 2px 8px rgba(0,0,0,0.14)",padding:"4px 0",transformOrigin:t.transformOrigin,overflow:"hidden"}}function ct({color:e}){return(0,a.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:e,strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M20 6L9 17l-5-5"})})}function ut({color:e}){return(0,a.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"5",fill:e}),(0,a.jsx)("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:e,strokeWidth:"2"})]})}function pt({color:e}){return(0,a.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:e,strokeWidth:"2","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M9 18l6-6-6-6"})})}function ht({items:e,pos:o,panelId:r,onClose:i,onCloseAll:d,isSubmenu:c=!1}){const u=t.useTheme(),[p,h]=(0,l.useState)(-1),[f,m]=(0,l.useState)(null),[x,g]=(0,l.useState)(null),b=(0,l.useRef)(null),[y,v]=(0,l.useState)(""),w=(0,l.useRef)(null),k=function(e){const t=[];let n=0;for(const o of e)if("separator"!==o.type)if("radio-group"===o.type)for(let e=0;e<o.options.length;e++)t.push({kind:"radio",item:o,optionIdx:e,idx:n++});else"check"===o.type?t.push({kind:"check",item:o,idx:n++}):"submenu"===o.type?t.push({kind:"submenu",item:o,idx:n++}):t.push({kind:"action",item:o,idx:n++});return t}(e);(0,l.useEffect)(()=>{b.current?.focus()},[]),(0,l.useEffect)(()=>{p<0||(b.current?.querySelector(`[data-midx="${p}"]`))?.scrollIntoView({block:"nearest"})},[p]);const C=(0,l.useCallback)(e=>{if("action"===e.kind){if(e.item.disabled)return;e.item.onClick?.(),d()}else if("check"===e.kind){if(e.item.disabled)return;e.item.onChange?.(!e.item.checked)}else if("radio"===e.kind){if(e.item.disabled)return;e.item.onChange?.(e.item.options[e.optionIdx].value)}else if("submenu"===e.kind){if(e.item.disabled)return;m(e.item.id)}},[d]);function S(){m(null),g(null)}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("style",{children:"\n@keyframes tkxMenuIn {\n from { opacity: 0; transform: scale(0.94); }\n to { opacity: 1; transform: scale(1); }\n}\n@keyframes tkxMenuInReduced {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n@media (prefers-reduced-motion: no-preference) {\n .tkx-menu-panel {\n animation: tkxMenuIn 130ms cubic-bezier(0.16, 1, 0.3, 1) forwards;\n }\n}\n@media (prefers-reduced-motion: reduce) {\n .tkx-menu-panel {\n animation: tkxMenuInReduced 100ms ease forwards;\n }\n}\n"}),(0,a.jsx)("div",{ref:b,id:r,role:"menu",tabIndex:-1,className:"tkx-menu-panel",onKeyDown:e=>{switch(e.key){case"ArrowDown":e.preventDefault(),h(e=>{const t=e+1;return t<k.length?t:0});break;case"ArrowUp":e.preventDefault(),h(e=>{const t=e-1;return t>=0?t:k.length-1});break;case"Home":e.preventDefault(),h(0);break;case"End":e.preventDefault(),h(k.length-1);break;case"Enter":case" ":e.preventDefault(),p>=0&&k[p]&&C(k[p]);break;case"Escape":e.preventDefault(),c?i():d();break;case"Tab":e.preventDefault(),d();break;case"ArrowRight":e.preventDefault(),p>=0&&"submenu"===k[p]?.kind&&m(k[p].item.id);break;case"ArrowLeft":e.preventDefault(),c&&i();break;default:1!==e.key.length||e.ctrlKey||e.metaKey||function(e){w.current&&clearTimeout(w.current);const t=y+e.toLowerCase();v(t);const n=k.findIndex(e=>("radio"===e.kind?e.item.options[e.optionIdx].label:e.item.label).toLowerCase().startsWith(t));n>=0&&h(n),w.current=setTimeout(()=>v(""),800)}(e.key)}},style:{...dt(u,o),maxHeight:400,overflowY:"auto"},children:(()=>{let t=-1;return e.map(e=>{if("separator"===e.type)return(0,a.jsx)("div",{role:"separator",style:{margin:(e.label,"4px 0"),display:"flex",alignItems:"center",gap:8},children:e.label?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{style:{flex:1,height:1,backgroundColor:u.border,marginLeft:14}}),(0,a.jsx)("span",{style:{fontSize:"11px",fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:u.textMuted,fontFamily:"inherit",whiteSpace:"nowrap"},children:n.sanitizeString(e.label)}),(0,a.jsx)("div",{style:{flex:1,height:1,backgroundColor:u.border,marginRight:14}})]}):(0,a.jsx)("div",{style:{flex:1,height:1,backgroundColor:u.border,margin:"0 10px"}})},e.id);if("radio-group"===e.type)return(0,a.jsxs)("div",{role:"group","aria-label":e.label,children:[e.label&&(0,a.jsx)("div",{style:{padding:"6px 14px 2px",fontSize:"11px",fontWeight:700,letterSpacing:"0.07em",textTransform:"uppercase",color:u.textMuted,fontFamily:"inherit"},"aria-hidden":"true",children:n.sanitizeString(e.label)}),e.options.map((o,r)=>{t++;const i=t,l=i===p,s=o.value===e.value,d=!!e.disabled,c=ft(u,l,!1,d);return(0,a.jsxs)("div",{role:"menuitemradio","aria-checked":s,"aria-disabled":d||void 0,"data-midx":i,tabIndex:-1,style:c,onClick:()=>!d&&e.onChange?.(o.value),onMouseEnter:()=>!d&&h(i),children:[(0,a.jsx)("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:s?(0,a.jsx)(ut,{color:u.primary}):(0,a.jsx)("span",{style:{width:14,height:14,borderRadius:"50%",border:`2px solid ${u.border}`,display:"inline-block"}})}),o.icon&&(0,a.jsx)("span",{style:{flexShrink:0,display:"flex",color:u.textMuted},children:o.icon}),(0,a.jsx)("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.sanitizeString(o.label)})]},o.value)})]},e.id);if("check"===e.type){t++;const o=t,r=o===p,i=!!e.disabled,l=ft(u,r,!1,i);return(0,a.jsxs)("div",{role:"menuitemcheckbox","aria-checked":e.checked,"aria-disabled":i||void 0,"data-midx":o,tabIndex:-1,style:l,onClick:()=>!i&&e.onChange?.(!e.checked),onMouseEnter:()=>!i&&h(o),children:[(0,a.jsx)("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:e.checked?(0,a.jsx)(ct,{color:u.primary}):(0,a.jsx)("span",{style:{width:14,height:14,display:"inline-block"}})}),e.icon&&(0,a.jsx)("span",{style:{flexShrink:0,display:"flex",color:u.textMuted},children:e.icon}),(0,a.jsx)("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.sanitizeString(e.label)})]},e.id)}if("submenu"===e.type){t++;const o=t,i=o===p,l=!!e.disabled,c=f===e.id,b=ft(u,i||c,!1,l);return(0,a.jsxs)("div",{style:{position:"relative"},children:[(0,a.jsxs)("div",{role:"menuitem","aria-haspopup":"menu","aria-expanded":c,"aria-disabled":l||void 0,"data-midx":o,tabIndex:-1,style:b,onMouseEnter:t=>{l||(h(o),function(e,t){const n=t.getBoundingClientRect();m(e.id),g(function(e,t,n){const o=window.innerWidth,r=window.innerHeight;let i=e.right+4,l="top left";i+220>o&&(i=e.left-4-220,l="top right");let a=e.top;return a+n>r&&(a=Math.max(8,r-n-8)),{top:a+window.scrollY,left:i+window.scrollX,transformOrigin:l}}(n,0,Math.min(38*e.items.length+12,360)))}(e,t.currentTarget))},onMouseLeave:()=>{},onClick:()=>{l||m(c?null:e.id)},children:[(0,a.jsx)("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:e.icon?(0,a.jsx)("span",{style:{display:"flex",color:u.textMuted},children:e.icon}):(0,a.jsx)("span",{style:{width:14}})}),(0,a.jsx)("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.sanitizeString(e.label)}),(0,a.jsx)(pt,{color:u.textMuted})]}),c&&x&&(0,s.createPortal)((0,a.jsx)(ht,{items:e.items,pos:x,panelId:`${r}-sub-${e.id}`,onClose:S,onCloseAll:d,isSubmenu:!0}),document.body)]},e.id)}const o=e;t++;const i=t,l=i===p,c=!!o.disabled,b=!!o.danger,y=ft(u,l,b,c);return(0,a.jsxs)("div",{role:"menuitem","aria-disabled":c||void 0,"data-midx":i,tabIndex:-1,style:y,onClick:()=>{c||(o.onClick?.(),d())},onMouseEnter:()=>{c||(h(i),S())},children:[(0,a.jsx)("span",{style:{width:16,flexShrink:0,display:"flex",alignItems:"center"},children:o.icon?(0,a.jsx)("span",{style:{display:"flex",color:b?u.danger:u.textMuted},children:o.icon}):(0,a.jsx)("span",{style:{width:14}})}),(0,a.jsxs)("span",{style:{flex:1,minWidth:0},children:[(0,a.jsx)("span",{style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.sanitizeString(o.label)}),o.description&&(0,a.jsx)("span",{style:{display:"block",fontSize:"12px",color:u.textMuted,marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.sanitizeString(o.description)})]}),o.shortcut&&(0,a.jsx)("span",{style:{fontSize:"12px",color:u.textMuted,fontFamily:"inherit",flexShrink:0,marginLeft:16,opacity:.8},children:n.sanitizeString(o.shortcut)})]},o.id)})})()})]})}function ft(e,t,n,o){const r=n?e.danger:e.text;return{display:"flex",alignItems:"center",gap:8,padding:"7px 14px",fontSize:"14px",fontFamily:"inherit",cursor:o?"not-allowed":"pointer",userSelect:"none",color:o?e.textMuted:t&&n?e.danger:r,backgroundColor:t?n?`${e.danger}18`:`${e.primary}18`:"transparent",transition:"background-color 80ms",opacity:o?.5:1,outline:"none"}}function mt({trigger:e,items:t,placement:n="bottom-start",isDisabled:o=!1,onOpen:r,onClose:i,className:d,style:c}){const u=`tkx-menu-${(0,l.useId)().replace(/:/g,"")}`,[p,h]=(0,l.useState)(!1),[f,m]=(0,l.useState)(null),x=(0,l.useRef)(null),g=(0,l.useCallback)(()=>{if(o)return;const e=x.current;e&&(m(st(e.getBoundingClientRect(),n,220,Math.min(38*t.length+12,360))),h(!0),r?.())},[o,t.length,r,n]),b=(0,l.useCallback)(()=>{h(!1),i?.(),(x.current?.firstElementChild)?.focus?.()},[i]);return(0,l.useEffect)(()=>{if(!p)return;const e=e=>{const t=e.target;if(x.current?.contains(t))return;const n=document.querySelectorAll(".tkx-menu-panel");for(const o of n)if(o.contains(t))return;b()};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[p,b]),(0,l.useEffect)(()=>{if(!p)return;const e=()=>{const e=x.current;e&&m(st(e.getBoundingClientRect(),n,220,Math.min(38*t.length+12,360)))};return window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[p,t.length,n]),(0,a.jsxs)("span",{ref:x,className:d,style:{display:"inline-flex",...c},children:[(0,a.jsx)("span",{role:"button",tabIndex:o?-1:0,"aria-haspopup":"menu","aria-expanded":p,"aria-controls":p?u:void 0,"aria-disabled":o||void 0,onClick:()=>p?b():g(),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key&&"ArrowDown"!==e.key||(e.preventDefault(),p||g()),"Escape"===e.key&&p&&(e.preventDefault(),b())},style:{display:"inline-flex",cursor:o?"not-allowed":"pointer",opacity:o?.55:1,outline:"none"},children:e}),p&&f&&(0,s.createPortal)((0,a.jsx)(ht,{items:t,pos:f,panelId:u,onClose:b,onCloseAll:b}),document.body)]})}mt.displayName="TkxMenu";var xt={sm:120,md:180,lg:240,xl:320};function gt(e){const t=new Date;if(e)try{const n=new Intl.DateTimeFormat("en-US",{timeZone:e,hour:"numeric",minute:"numeric",second:"numeric",hour12:!1,weekday:"long",month:"long",day:"2-digit",year:"numeric"}).formatToParts(t),o=e=>n.find(t=>t.type===e)?.value??"0";let r=parseInt(o("hour"),10);24===r&&(r=0);const i=parseInt(o("minute"),10),l=parseInt(o("second"),10),a=`${o("weekday")}, ${o("month")} ${o("day")}, ${o("year")}`;return{hours:r,minutes:i,seconds:l,milliseconds:t.getMilliseconds(),dateString:a}}catch{}const n=t.getHours(),o=t.getMinutes(),r=t.getSeconds(),i=t.toLocaleDateString("en-US",{weekday:"long",month:"long",day:"2-digit",year:"numeric"});return{hours:n,minutes:o,seconds:r,milliseconds:t.getMilliseconds(),dateString:i}}function bt({time:e,size:t,analogStyle:n,showSeconds:o,reducedMotion:r,primary:i,danger:l,text:s,textMuted:d,border:c,surface:u,bg:p}){const h=t/2,f=t/2,m=t/2-4,{hours:x,minutes:g,seconds:b,milliseconds:y}=e,v=(b+(r?0:y)/1e3)/60*360,w=g/60*360+b/60*6,k=x%12/12*360+g/60*30,C=(e,t)=>{const n=(e-90)*Math.PI/180;return{x:h+Math.cos(n)*t,y:f+Math.sin(n)*t}},S=r?"none":"transform 0.15s cubic-bezier(0.4, 2.08, 0.55, 0.44)";if("modern"===n){const e=(e,t)=>{const n=360*e-90;return`M ${h+Math.cos(-90*Math.PI/180)*t} ${f+Math.sin(-90*Math.PI/180)*t} A ${t} ${t} 0 ${e>.5?1:0} 1 ${h+Math.cos(n*Math.PI/180)*t} ${f+Math.sin(n*Math.PI/180)*t}`},n=x%12/12+g/60/12,u=g/60+b/3600,p=(b+(r?0:y/1e3))/60,v=m-2,w=m-10,k=m-18;return(0,a.jsxs)("svg",{width:t,height:t,viewBox:`0 0 ${t} ${t}`,"aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:h,cy:f,r:v,fill:"none",stroke:c,strokeWidth:4}),(0,a.jsx)("circle",{cx:h,cy:f,r:w,fill:"none",stroke:c,strokeWidth:4}),o&&(0,a.jsx)("circle",{cx:h,cy:f,r:k,fill:"none",stroke:c,strokeWidth:3}),(0,a.jsx)("path",{d:e(n,v),fill:"none",stroke:i,strokeWidth:4,strokeLinecap:"round"}),(0,a.jsx)("path",{d:e(u,w),fill:"none",stroke:s,strokeWidth:4,strokeLinecap:"round"}),o&&(0,a.jsx)("path",{d:e(p,k),fill:"none",stroke:l,strokeWidth:3,strokeLinecap:"round"}),(0,a.jsx)("circle",{cx:h,cy:f,r:4,fill:i}),(0,a.jsxs)("text",{x:h,y:f+20,textAnchor:"middle",fontSize:.12*t,fill:d,fontFamily:"monospace",style:{fontVariantNumeric:"tabular-nums"},children:[String(x).padStart(2,"0"),":",String(g).padStart(2,"0")]})]})}const $=C(k,.5*m),z=C(w,.75*m),N=C(v,.85*m),M=C(v+180,.2*m),I=[];if("classic"===n){for(let e=0;e<60;e++){const t=e%5==0,n=(e/60*360-90)*Math.PI/180,o=t?m-10:m-6,r=h+Math.cos(n)*m,i=f+Math.sin(n)*m,l=h+Math.cos(n)*o,c=f+Math.sin(n)*o;I.push((0,a.jsx)("line",{x1:r,y1:i,x2:l,y2:c,stroke:t?s:d,strokeWidth:t?2:1,strokeLinecap:"round"},e))}for(const{n:e,angle:n}of[{n:12,angle:0},{n:3,angle:90},{n:6,angle:180},{n:9,angle:270}]){const o=(n-90)*Math.PI/180,r=m-20;I.push((0,a.jsx)("text",{x:h+Math.cos(o)*r,y:f+Math.sin(o)*r,textAnchor:"middle",dominantBaseline:"central",fontSize:.09*t,fill:s,fontFamily:"system-ui, sans-serif",fontWeight:"600",children:e},`n${e}`))}}else for(let L=0;L<12;L++){const e=(L/12*360-90)*Math.PI/180,t=m-8;I.push((0,a.jsx)("circle",{cx:h+Math.cos(e)*t,cy:f+Math.sin(e)*t,r:L%3==0?3:2,fill:L%3==0?s:d},L))}return(0,a.jsxs)("svg",{width:t,height:t,viewBox:`0 0 ${t} ${t}`,"aria-hidden":"true",style:{display:"block"},children:[(0,a.jsx)("circle",{cx:h,cy:f,r:m,fill:u,stroke:c,strokeWidth:2}),I,(0,a.jsx)("line",{x1:h,y1:f,x2:$.x,y2:$.y,stroke:i,strokeWidth:"minimal"===n?3:4,strokeLinecap:"round",style:{transformOrigin:`${h}px ${f}px`,transition:S}}),(0,a.jsx)("line",{x1:h,y1:f,x2:z.x,y2:z.y,stroke:s,strokeWidth:"minimal"===n?2:3,strokeLinecap:"round",style:{transformOrigin:`${h}px ${f}px`,transition:S}}),o&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("line",{x1:M.x,y1:M.y,x2:N.x,y2:N.y,stroke:l,strokeWidth:1.5,strokeLinecap:"round",style:{transformOrigin:`${h}px ${f}px`,transition:"none"}}),(0,a.jsx)("circle",{cx:h,cy:f,r:3,fill:l})]}),(0,a.jsx)("circle",{cx:h,cy:f,r:"minimal"===n?3:5,fill:i})]})}function yt({time:e,format:t,showSeconds:o,showDate:r,label:i,size:l,primary:s,text:d,textMuted:c,colonVisible:u}){const{hours:p,minutes:h,seconds:f,dateString:m}=e;let x=p,g="";"12h"===t&&(g=p>=12?"PM":"AM",x=p%12||12);const b=.2*l,y={opacity:u?1:0,transition:"opacity 0.1s",display:"inline-block",minWidth:"0.5ch",textAlign:"center"};return(0,a.jsxs)("div",{style:{textAlign:"center",fontFamily:"'Courier New', Courier, monospace",fontVariantNumeric:"tabular-nums",lineHeight:1.1},children:[(0,a.jsxs)("div",{style:{fontSize:b,color:s,fontWeight:700,letterSpacing:"0.05em",display:"flex",alignItems:"center",justifyContent:"center",gap:0},children:[(0,a.jsx)("span",{children:String(x).padStart(2,"0")}),(0,a.jsx)("span",{style:y,children:":"}),(0,a.jsx)("span",{children:String(h).padStart(2,"0")}),o&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{style:y,children:":"}),(0,a.jsx)("span",{children:String(f).padStart(2,"0")})]}),"12h"===t&&(0,a.jsx)("span",{style:{fontSize:.45*b,color:c,marginLeft:"0.4ch",alignSelf:"flex-end",marginBottom:.05*b},children:g})]}),r&&(0,a.jsx)("div",{style:{fontSize:.072*l,color:c,marginTop:.025*l,letterSpacing:"0.03em"},children:m}),i&&(0,a.jsx)("div",{style:{fontSize:.065*l,color:c,marginTop:.015*l,textTransform:"uppercase",letterSpacing:"0.08em"},children:n.sanitizeString(i)})]})}function vt({variant:e="both",size:n="md",showSeconds:r=!0,showDate:i=!1,format:s="24h",timezone:d,timezone2:c,label:u,analogStyle:p="classic",className:h,style:f}){const m=t.useTheme(),x=o.useReducedMotion(),[g,b]=(0,l.useState)(()=>gt(d)),[y,v]=(0,l.useState)(()=>c?gt(c):null),[w,k]=(0,l.useState)(!0),[C,S]=(0,l.useState)(!1),$=(0,l.useRef)(null);(0,l.useEffect)(()=>{S(!0)},[]),(0,l.useEffect)(()=>{const e=()=>{b(gt(d)),c&&v(gt(c))};e();const t=setInterval(e,1e3);return()=>clearInterval(t)},[d,c]),(0,l.useEffect)(()=>($.current=setInterval(()=>{k(e=>!e)},500),()=>{$.current&&clearInterval($.current)}),[]);const z=xt[n],N="analog"===e||"both"===e,M="digital"===e||"both"===e;return(0,a.jsxs)("div",{className:h,style:{display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"both"===e?.06*z+"px":0,opacity:C?1:0,transition:x?"none":"opacity 0.4s ease",...f},role:"timer","aria-live":"off",children:[N&&(0,a.jsx)(bt,{time:g,size:z,analogStyle:p,showSeconds:r,reducedMotion:x,primary:m.primary,danger:m.danger,text:m.text,textMuted:m.textMuted,border:m.border,surface:m.surface,bg:m.bg}),M&&(0,a.jsx)(yt,{time:g,format:s,showSeconds:r,showDate:i,label:u,size:z,primary:m.primary,text:m.text,textMuted:m.textMuted,colonVisible:w}),y&&c&&(0,a.jsx)("div",{style:{marginTop:.04*z,padding:`${.03*z}px ${.06*z}px`,borderTop:`1px solid ${m.border}`,textAlign:"center"},children:(0,a.jsx)(yt,{time:y,format:s,showSeconds:!1,showDate:!1,label:c,size:.7*z,primary:m.secondary,text:m.text,textMuted:m.textMuted,colonVisible:w})})]})}function wt(e){if(!isFinite(e)||isNaN(e))return"0:00";const t=Math.floor(e/3600),n=Math.floor(e%3600/60),o=Math.floor(e%60);return t>0?`${t}:${String(n).padStart(2,"0")}:${String(o).padStart(2,"0")}`:`${n}:${String(o).padStart(2,"0")}`}function kt({path:e,size:t=20,color:n="currentColor",title:o}){return(0,a.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:n,"aria-hidden":o?void 0:"true",role:o?"img":void 0,"aria-label":o,style:{display:"block",flexShrink:0},children:(0,a.jsx)("path",{d:e})})}vt.displayName="TkxClock";var Ct="M8 5v14l11-7z",St="M6 19h4V5H6v14zm8-14v14h4V5h-4z";function $t({onClick:e,title:t,children:n,active:o,primary:r}){const[i,s]=(0,l.useState)(!1);return(0,a.jsx)("button",{type:"button",onClick:e,title:t,"aria-label":t,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),style:{background:"none",border:"none",padding:"6px",cursor:"pointer",color:o||i?r:"#ffffff",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",flexShrink:0,transition:"color 0.15s ease"},children:n})}function zt({src:e,poster:r,title:i,width:s="100%",height:d,autoPlay:c=!1,loop:u=!1,muted:p=!1,controls:h=!0,showTitle:f=!0,allowFullscreen:m=!0,allowPiP:x=!0,allowDownload:g=!1,chapters:b=[],subtitles:y=[],startTime:v,onPlay:w,onPause:k,onEnded:C,onTimeUpdate:S,className:$,style:z}){const N=t.useTheme(),M=o.useReducedMotion(),I=(0,l.useRef)(null),L=(0,l.useRef)(null),W=(0,l.useRef)(null),D=(0,l.useRef)(null),[R,T]=(0,l.useState)(!1),[B,A]=(0,l.useState)(0),[F,H]=(0,l.useState)(0),[E,j]=(0,l.useState)(0),[O,P]=(0,l.useState)(1),[V,Y]=(0,l.useState)(p),[U,K]=(0,l.useState)(!1),[X,q]=(0,l.useState)(!0),[G,Z]=(0,l.useState)(!1),[_,J]=(0,l.useState)(1),[Q,ee]=(0,l.useState)(!1),[te,ne]=(0,l.useState)(-1),[oe,re]=(0,l.useState)(null),[ie,le]=(0,l.useState)(0),[ae,se]=(0,l.useState)(null),[de,ce]=(0,l.useState)(!1),[ue,pe]=(0,l.useState)(!1),[he,fe]=(0,l.useState)(null),[me,xe]=(0,l.useState)(!1);(0,l.useEffect)(()=>{const e=I.current;if(!e)return;void 0!==v&&(e.currentTime=v);const t=()=>{A(e.currentTime),e.buffered.length>0&&j(e.buffered.end(e.buffered.length-1))},n=()=>H(e.duration),o=()=>T(!0),r=()=>{T(!1),Z(!0)},i=()=>{T(!1),Z(!0),C?.()},l=()=>ce(!0),a=()=>ce(!1),s=()=>pe(!0),d=()=>pe(!1),c=()=>{const t=e.error;fe(t?`Error ${t.code}: ${t.message||"Failed to load video"}`:"Failed to load video"),pe(!1)};return e.addEventListener("timeupdate",t),e.addEventListener("durationchange",n),e.addEventListener("play",o),e.addEventListener("pause",r),e.addEventListener("ended",i),e.addEventListener("enterpictureinpicture",l),e.addEventListener("leavepictureinpicture",a),e.addEventListener("waiting",s),e.addEventListener("canplay",d),e.addEventListener("error",c),()=>{e.removeEventListener("timeupdate",t),e.removeEventListener("durationchange",n),e.removeEventListener("play",o),e.removeEventListener("pause",r),e.removeEventListener("ended",i),e.removeEventListener("enterpictureinpicture",l),e.removeEventListener("leavepictureinpicture",a),e.removeEventListener("waiting",s),e.removeEventListener("canplay",d),e.removeEventListener("error",c)}},[C,v]),(0,l.useEffect)(()=>{I.current&&(R?w?.():k?.())},[R,w,k]),(0,l.useEffect)(()=>{S?.(B,F)},[B,F,S]),(0,l.useEffect)(()=>{const e=I.current;if(!e)return;const t=e.textTracks;for(let n=0;n<t.length;n++)t[n].mode=n===te?"showing":"disabled"},[te]),(0,l.useEffect)(()=>{const e=()=>K(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",e),()=>document.removeEventListener("fullscreenchange",e)},[]),(0,l.useEffect)(()=>{const e=L.current;if(!e)return;const t=e=>{const t=I.current;if(t&&"INPUT"!==e.target.tagName)switch(e.key){case" ":case"k":e.preventDefault(),be();break;case"f":case"F":m&&ve();break;case"m":case"M":ye();break;case"ArrowRight":e.preventDefault(),t.currentTime=Math.min(t.currentTime+10,t.duration);break;case"ArrowLeft":e.preventDefault(),t.currentTime=Math.max(t.currentTime-10,0);break;case"ArrowUp":e.preventDefault(),P(Math.min(O+.1,1)),I.current&&(I.current.volume=Math.min(O+.1,1));break;case"ArrowDown":e.preventDefault(),P(Math.max(O-.1,0)),I.current&&(I.current.volume=Math.max(O-.1,0))}};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)},[O,m]);const ge=(0,l.useCallback)(()=>{q(!0),D.current&&clearTimeout(D.current),D.current=setTimeout(()=>{R&&q(!1)},3e3)},[R]);(0,l.useEffect)(()=>(ge(),()=>{D.current&&clearTimeout(D.current)}),[R,ge]);const be=(0,l.useCallback)(()=>{const e=I.current;e&&(e.paused?(e.play().catch(()=>{}),se("play"),Z(!1)):(e.pause(),se("pause")),setTimeout(()=>se(null),600))},[]),ye=(0,l.useCallback)(()=>{const e=I.current;if(!e)return;const t=!V;Y(t),e.muted=t},[V]),ve=(0,l.useCallback)(()=>{const e=L.current;e&&(document.fullscreenElement?document.exitFullscreen().catch(()=>{}):e.requestFullscreen().catch(()=>{}))},[]),we=(0,l.useCallback)(async()=>{const e=I.current;if(e)try{document.pictureInPictureElement?await document.exitPictureInPicture():await e.requestPictureInPicture()}catch{}},[]),ke=(0,l.useCallback)(()=>{0!==y.length&&(ne(e=>(e+1)%(y.length+1)-1),ne(e=>{const t=e+1;return t>=y.length?-1:t}))},[y.length]),Ce=(0,l.useCallback)(()=>{const e=I.current;e&&(e.currentTime=Math.min(e.currentTime+10,e.duration||0))},[]),Se=(0,l.useCallback)(()=>{const e=I.current;e&&(e.currentTime=Math.max(e.currentTime-10,0))},[]),$e=(0,l.useCallback)(()=>{const e=I.current;e&&(fe(null),e.load())},[]),ze=(0,l.useCallback)(()=>{m&&ve()},[m,ve]),Ne=(0,l.useCallback)(e=>{const t=I.current,n=W.current;if(!t||!n||!F)return;const o=n.getBoundingClientRect();t.currentTime=Math.max(0,Math.min(1,(e.clientX-o.left)/o.width))*F},[F]),Me=(0,l.useCallback)(e=>{const t=W.current;if(!t||!F)return;const n=t.getBoundingClientRect();re(Math.max(0,Math.min(1,(e.clientX-n.left)/n.width))*F),le(e.clientX-n.left)},[F]),Ie=(0,l.useCallback)(e=>{const t=parseFloat(e.target.value);P(t),I.current&&(I.current.volume=t,I.current.muted=0===t,Y(0===t))},[]),Le=(0,l.useCallback)(e=>{J(e),I.current&&(I.current.playbackRate=e),ee(!1)},[]),We=b.length>0?[...b].reverse().find(e=>B>=e.time):null,De=e=>[...b].reverse().find(t=>e>=t.time)??null,Re=Array.isArray(e)?e:[{src:e,type:"video/mp4"}],Te=Array.isArray(e)?e[0].src:e,Be=X||G||!R,Ae=M?"none":"opacity 0.25s ease",Fe=V||0===O?"M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z":O<.5?"M18.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM5 9v6h4l5 5V4L9 9H5z":"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z",He=F>0?B/F*100:0,Ee=F>0?E/F*100:0;return(0,a.jsxs)("div",{ref:L,className:$,tabIndex:0,onMouseMove:ge,onMouseLeave:()=>{R&&q(!1)},style:{position:"relative",width:s,height:d??"auto",background:"#000",borderRadius:"8px",overflow:"hidden",outline:"none",userSelect:"none",...z},children:[(0,a.jsxs)("video",{ref:I,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"},poster:r,autoPlay:c,loop:u,muted:p,playsInline:!0,onClick:be,onDoubleClick:ze,children:[Re.map((e,t)=>(0,a.jsx)("source",{src:e.src,type:e.type},t)),y.map((e,t)=>(0,a.jsx)("track",{kind:"subtitles",label:n.sanitizeString(e.label),srcLang:e.lang,src:e.src,default:e.default},t))]}),f&&i&&(0,a.jsxs)("div",{style:{position:"absolute",top:0,left:0,right:0,background:"linear-gradient(to bottom, rgba(0,0,0,0.75) 0%, transparent 100%)",padding:"16px 16px 32px",opacity:Be?1:0,transition:Ae,pointerEvents:"none"},children:[(0,a.jsx)("span",{style:{color:"#fff",fontSize:"0.95rem",fontWeight:600,textShadow:"0 1px 3px rgba(0,0,0,0.7)"},children:n.sanitizeString(i)}),We&&(0,a.jsxs)("span",{style:{color:"rgba(255,255,255,0.65)",fontSize:"0.8rem",marginLeft:8},children:["— ",n.sanitizeString(We.label)]})]}),ae&&(0,a.jsx)("div",{"aria-hidden":"true",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",background:"rgba(0,0,0,0.45)",borderRadius:"50%",width:64,height:64,display:"flex",alignItems:"center",justifyContent:"center",animation:M?"none":"tkxvp-flash 0.6s ease forwards",pointerEvents:"none"},children:(0,a.jsx)(kt,{path:"play"===ae?Ct:St,size:32,color:"#fff"})}),ue&&!he&&(0,a.jsx)("div",{"aria-label":"Loading",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none",zIndex:10},children:(0,a.jsx)("div",{style:{width:48,height:48,border:"4px solid rgba(255,255,255,0.25)",borderTopColor:N.primary,borderRadius:"50%",animation:M?"none":"tkxvp-spin 0.8s linear infinite"}})}),he&&(0,a.jsxs)("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.8)",zIndex:20,gap:12},children:[(0,a.jsx)(kt,{path:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z",size:48,color:"#ef4444"}),(0,a.jsx)("span",{style:{color:"#fff",fontSize:"0.9rem",maxWidth:"80%",textAlign:"center"},children:he}),(0,a.jsxs)("button",{type:"button",onClick:$e,style:{display:"flex",alignItems:"center",gap:6,background:N.primary,color:"#fff",border:"none",borderRadius:6,padding:"8px 18px",fontSize:"0.85rem",fontWeight:600,cursor:"pointer",marginTop:4},children:[(0,a.jsx)(kt,{path:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z",size:18,color:"#fff"}),"Retry"]})]}),h&&(0,a.jsxs)("div",{style:{position:"absolute",bottom:0,left:0,right:0,background:"linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 70%, transparent 100%)",padding:"32px 12px 8px",opacity:Be?1:0,transition:Ae},onMouseEnter:()=>Z(!0),onMouseLeave:()=>Z(!1),children:[(0,a.jsxs)("div",{ref:W,role:"slider","aria-label":"Seek","aria-valuemin":0,"aria-valuemax":Math.floor(F),"aria-valuenow":Math.floor(B),tabIndex:0,onClick:Ne,onMouseMove:Me,style:{position:"relative",height:4,borderRadius:2,background:"rgba(255,255,255,0.25)",cursor:"pointer",marginBottom:8,transition:"height 0.15s ease"},onMouseEnter:e=>{e.currentTarget.style.height="8px"},onMouseLeave:e=>{e.currentTarget.style.height="4px",re(null)},children:[(0,a.jsx)("div",{style:{position:"absolute",top:0,left:0,bottom:0,width:`${Ee}%`,background:"rgba(255,255,255,0.3)",borderRadius:2,pointerEvents:"none"}}),(0,a.jsx)("div",{style:{position:"absolute",top:0,left:0,bottom:0,width:`${He}%`,background:N.primary,borderRadius:2,pointerEvents:"none"}}),(0,a.jsx)("div",{style:{position:"absolute",top:"50%",left:`${He}%`,transform:"translate(-50%, -50%)",width:12,height:12,borderRadius:"50%",background:N.primary,pointerEvents:"none"}}),b.map((e,t)=>{const o=F>0?e.time/F*100:0;return(0,a.jsx)("div",{title:n.sanitizeString(e.label),style:{position:"absolute",top:"50%",left:`${o}%`,transform:"translate(-50%, -50%)",width:8,height:8,borderRadius:"50%",background:"#fff",border:`2px solid ${N.primary}`,zIndex:2,cursor:"pointer",pointerEvents:"auto"}},t)}),null!==oe&&(0,a.jsxs)("div",{style:{position:"absolute",bottom:12,left:ie,transform:"translateX(-50%)",background:"rgba(0,0,0,0.8)",color:"#fff",fontSize:"0.72rem",padding:"2px 6px",borderRadius:4,whiteSpace:"nowrap",pointerEvents:"none"},children:[wt(oe),De(oe)&&(0,a.jsx)("span",{style:{display:"block",fontSize:"0.65rem",color:"rgba(255,255,255,0.7)"},children:n.sanitizeString(De(oe).label)})]})]}),(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:2},children:[(0,a.jsx)($t,{onClick:be,title:R?"Pause":"Play",primary:N.primary,children:(0,a.jsx)(kt,{path:R?St:Ct,size:22})}),(0,a.jsx)($t,{onClick:Se,title:"Skip back 10 seconds",primary:N.primary,children:(0,a.jsxs)("div",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[(0,a.jsx)(kt,{path:"M11.99 5V1l-5 5 5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6h-2c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z",size:22}),(0,a.jsx)("span",{style:{position:"absolute",fontSize:"7px",fontWeight:700,color:"currentColor",marginTop:1},children:"10"})]})}),(0,a.jsx)($t,{onClick:Ce,title:"Skip forward 10 seconds",primary:N.primary,children:(0,a.jsxs)("div",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:[(0,a.jsx)(kt,{path:"M18 13c0 3.31-2.69 6-6 6s-6-2.69-6-6h-2c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8V1l-5 5 5 5V7c3.31 0 6 2.69 6 6z",size:22}),(0,a.jsx)("span",{style:{position:"absolute",fontSize:"7px",fontWeight:700,color:"currentColor",marginTop:1},children:"10"})]})}),(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",position:"relative"},onMouseEnter:()=>xe(!0),onMouseLeave:()=>xe(!1),children:[(0,a.jsx)($t,{onClick:ye,title:V?"Unmute":"Mute",primary:N.primary,children:(0,a.jsx)(kt,{path:Fe,size:20})}),(0,a.jsx)("div",{style:{overflow:"hidden",width:me?64:0,opacity:me?1:0,transition:M?"none":"width 0.2s ease, opacity 0.2s ease",display:"flex",alignItems:"center"},children:(0,a.jsx)("input",{type:"range",min:0,max:1,step:.05,value:V?0:O,onChange:Ie,"aria-label":"Volume",style:{width:64,accentColor:N.primary,cursor:"pointer",height:4}})})]}),(0,a.jsxs)("span",{style:{color:"#fff",fontSize:"0.78rem",fontFamily:"monospace",fontVariantNumeric:"tabular-nums",marginLeft:6,whiteSpace:"nowrap",flexShrink:0},children:[wt(B)," / ",wt(F)]}),(0,a.jsx)("div",{style:{flex:1}}),y.length>0&&(0,a.jsx)($t,{onClick:ke,title:"Subtitles",primary:N.primary,active:te>=0,children:(0,a.jsx)(kt,{path:"M19 4H5c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-8 7H9.5v-.5h-2v3h2V13H11v1c0 .55-.45 1-1 1H7c-.55 0-1-.45-1-1v-4c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v1zm7 0h-1.5v-.5h-2v3h2V13H18v1c0 .55-.45 1-1 1h-3c-.55 0-1-.45-1-1v-4c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v1z",size:20})}),(0,a.jsxs)("div",{style:{position:"relative",display:"flex",alignItems:"center"},children:[(0,a.jsxs)("button",{type:"button",onClick:()=>ee(e=>!e),title:"Playback speed",style:{background:"none",border:"none",cursor:"pointer",color:"#fff",fontSize:"0.75rem",fontWeight:600,padding:"6px 8px",letterSpacing:"0.02em",position:"relative"},children:[_,"×"]}),1!==_&&(0,a.jsxs)("span",{style:{position:"absolute",top:0,right:0,background:N.primary,color:"#fff",fontSize:"0.55rem",fontWeight:700,borderRadius:6,padding:"1px 4px",lineHeight:1.2,pointerEvents:"none"},children:[_,"x"]}),Q&&(0,a.jsx)("div",{style:{position:"absolute",bottom:"100%",right:0,background:"rgba(20,20,20,0.97)",border:`1px solid ${N.border}`,borderRadius:6,overflow:"hidden",zIndex:100,minWidth:80},children:[.5,.75,1,1.25,1.5,2].map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>Le(e),style:{display:"block",width:"100%",padding:"6px 14px",background:e===_?N.primary+"30":"none",border:"none",color:e===_?N.primary:"#fff",fontSize:"0.8rem",cursor:"pointer",textAlign:"left"},children:[e,"×"]},e))})]}),x&&"undefined"!=typeof document&&"pictureInPictureEnabled"in document&&(0,a.jsx)($t,{onClick:we,title:"Picture-in-Picture",primary:N.primary,active:de,children:(0,a.jsx)(kt,{path:"M19 11h-8v6h8v-6zm4 8V4.98C23 3.88 22.1 3 21 3H3c-1.1 0-2 .88-2 1.98V19c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H3V4.97h18v14.05z",size:20})}),g&&(0,a.jsx)("a",{href:Te,download:!0,title:"Download",style:{color:"#fff",display:"flex",alignItems:"center",padding:"6px"},children:(0,a.jsx)(kt,{path:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z",size:20})}),m&&(0,a.jsx)($t,{onClick:ve,title:U?"Exit fullscreen":"Fullscreen",primary:N.primary,children:(0,a.jsx)(kt,{path:U?"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z":"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z",size:20})})]})]}),(0,a.jsx)("style",{children:"\n @keyframes tkxvp-flash {\n 0% { opacity: 1; transform: translate(-50%,-50%) scale(1); }\n 100% { opacity: 0; transform: translate(-50%,-50%) scale(1.5); }\n }\n @keyframes tkxvp-spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n "})]})}zt.displayName="TkxVideoPlayer";var Nt={sm:{circle:24,fontSize:"0.75rem",titleSize:"0.8rem",descSize:"0.7rem",connectorWidth:2},md:{circle:32,fontSize:"0.875rem",titleSize:"0.9rem",descSize:"0.775rem",connectorWidth:2},lg:{circle:40,fontSize:"1rem",titleSize:"1rem",descSize:"0.85rem",connectorWidth:3}};function Mt({size:e}){const t=.55*e;return(0,a.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"})})}function It({size:e}){const t=.55*e;return(0,a.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"})})}function Lt({status:e,index:t,showStepNumbers:n,icon:o,circleSize:r,fontSize:i,primary:l,danger:s,success:d,text:c,textMuted:u,border:p,surface:h,variant:f,reducedMotion:m,clickable:x}){const g="completed"===e,b="active"===e,y="error"===e;let v=h,w=p,k=u,C=2;g?(v="filled"===f?d:h,w=d,k="filled"===f?"#fff":d):b?(v="outlined"===f?h:l,w=l,k="outlined"===f?l:"#fff",C=2):y?(v="filled"===f?s:h,w=s,k="filled"===f?"#fff":s):"pending"===e&&(v=h,w=p,k=u);const S=b&&!m?{boxShadow:`0 0 0 4px ${l}30`,animation:"tkxstepper-pulse 2s ease-in-out infinite"}:{},$=x?{cursor:"pointer",transition:"transform 0.15s ease, box-shadow 0.15s ease"}:{};let z;return z=!o||g||y?g?(0,a.jsx)(Mt,{size:r}):y?(0,a.jsx)(It,{size:r}):n?(0,a.jsx)("span",{style:{fontSize:i,fontWeight:600,lineHeight:1},children:t+1}):(0,a.jsx)("span",{style:{fontSize:.22*r,lineHeight:1,background:k,borderRadius:"50%",width:.22*r,height:.22*r,display:"block"}}):(0,a.jsx)("span",{style:{fontSize:i,lineHeight:1},children:o}),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("style",{children:`\n @keyframes tkxstepper-pulse {\n 0%, 100% { box-shadow: 0 0 0 0 ${l}50; }\n 50% { box-shadow: 0 0 0 6px ${l}20; }\n }\n `}),(0,a.jsx)("div",{style:{width:r,height:r,minWidth:r,borderRadius:"50%",border:`${C}px solid ${w}`,backgroundColor:v,color:k,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:m?"none":"background-color 0.2s, border-color 0.2s",...S,...$},children:z})]})}function Wt({completed:e,orientation:t,connectorStyle:n,connectorWidth:o,primary:r,border:i,reducedMotion:l}){const s=e?r:i;return"horizontal"===t?(0,a.jsx)("div",{"aria-hidden":"true",style:{flex:1,height:o,background:"solid"===n?s:"none",backgroundImage:"solid"!==n?`repeating-linear-gradient(90deg, ${s} 0, ${s} 6px, transparent 6px, transparent ${"dashed"===n?12:9}px)`:"none",borderRadius:1,transition:l?"none":"background 0.3s ease",alignSelf:"center",marginLeft:4,marginRight:4}}):(0,a.jsx)("div",{"aria-hidden":"true",style:{width:o,flex:1,minHeight:20,background:"solid"===n?s:"none",backgroundImage:"solid"!==n?`repeating-linear-gradient(180deg, ${s} 0, ${s} 6px, transparent 6px, transparent ${"dashed"===n?12:9}px)`:"none",borderRadius:1,transition:l?"none":"background 0.3s ease",alignSelf:"stretch",marginTop:4,marginBottom:4,marginLeft:"auto",marginRight:"auto"}})}function Dt({steps:e,activeStep:r=0,orientation:i="horizontal",variant:l="default",size:s="md",clickable:d=!1,onStepClick:c,showStepNumbers:u=!0,alternateLabel:p=!1,connector:h="solid",className:f,style:m}){const x=t.useTheme(),g=o.useReducedMotion(),b=Nt[s],y="horizontal"===i;return(0,a.jsx)("div",{className:f,role:"list","aria-label":"Steps",style:{display:"flex",flexDirection:y?"row":"column",alignItems:y?p?"flex-start":"center":"stretch",width:"100%",gap:0,...m},children:e.map((t,o)=>{const i=((e,t)=>e.status?e.status:t<r?"completed":t===r?"active":"pending")(t,o),s=o===e.length-1,f="completed"===i||o<r,m=o%2==0,v=()=>{d&&c?.(o)},w=(0,a.jsx)(Lt,{status:i,index:o,showStepNumbers:u,icon:t.icon,circleSize:b.circle,fontSize:b.fontSize,primary:x.primary,danger:x.danger,success:x.success,text:x.text,textMuted:x.textMuted,border:x.border,surface:x.surface,variant:l,reducedMotion:g,clickable:d}),k=(0,a.jsxs)("div",{style:{textAlign:y&&!p?"center":"left",maxWidth:y?120:void 0},children:[(0,a.jsxs)("div",{style:{fontSize:b.titleSize,fontWeight:"active"===i?600:500,color:"pending"===i?x.textMuted:"error"===i?x.danger:x.text,lineHeight:1.3,transition:g?"none":"color 0.2s"},children:[n.sanitizeString(t.title),t.optional&&(0,a.jsx)("span",{style:{fontSize:b.descSize,color:x.textMuted,fontWeight:400,marginLeft:4},children:"(optional)"})]}),t.description&&(0,a.jsx)("div",{style:{fontSize:b.descSize,color:x.textMuted,marginTop:2,lineHeight:1.4},children:n.sanitizeString(t.description)}),t.error&&"error"===i&&(0,a.jsx)("div",{style:{fontSize:b.descSize,color:x.danger,marginTop:2},children:n.sanitizeString(t.error)})]});return y?(0,a.jsxs)("div",{role:"listitem",style:{display:"flex",flex:s?0:1,alignItems:"center",minWidth:0},children:[(0,a.jsxs)("div",{onClick:v,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:6,cursor:d?"pointer":"default",flexShrink:0},"aria-current":"active"===i?"step":void 0,children:[p&&!m&&(0,a.jsx)("div",{style:{minHeight:1.5*b.circle+6,display:"flex",alignItems:"flex-end",paddingBottom:6},children:k}),w,!p&&k,p&&m&&(0,a.jsx)("div",{style:{marginTop:6},children:k})]}),!s&&(0,a.jsx)(Wt,{completed:f,orientation:"horizontal",connectorStyle:h,connectorWidth:b.connectorWidth,primary:x.primary,border:x.border,reducedMotion:g})]},t.id):(0,a.jsxs)("div",{role:"listitem",style:{display:"flex",flexDirection:"row",minHeight:0},children:[(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",marginRight:14,flexShrink:0},children:[(0,a.jsx)("div",{onClick:v,style:{cursor:d?"pointer":"default"},"aria-current":"active"===i?"step":void 0,children:w}),!s&&(0,a.jsx)(Wt,{completed:f,orientation:"vertical",connectorStyle:h,connectorWidth:b.connectorWidth,primary:x.primary,border:x.border,reducedMotion:g})]}),(0,a.jsx)("div",{style:{paddingTop:(b.circle-16*parseFloat(b.titleSize))/2,paddingBottom:s?0:16,flex:1,minWidth:0},children:k})]},t.id)})})}function Rt(e){let t=0,n=0,o=0;const r=e.replace("#","");3===r.length?(t=parseInt(r[0]+r[0],16),n=parseInt(r[1]+r[1],16),o=parseInt(r[2]+r[2],16)):r.length>=6&&(t=parseInt(r.slice(0,2),16),n=parseInt(r.slice(2,4),16),o=parseInt(r.slice(4,6),16)),t/=255,n/=255,o/=255;const i=Math.max(t,n,o),l=Math.min(t,n,o);let a=0,s=0;const d=(i+l)/2;if(i!==l){const e=i-l;switch(s=d>.5?e/(2-i-l):e/(i+l),i){case t:a=((n-o)/e+(n<o?6:0))/6;break;case n:a=((o-t)/e+2)/6;break;case o:a=((t-n)/e+4)/6}}return[Math.round(360*a),Math.round(100*s),Math.round(100*d)]}function Tt(e,t,n){n/=100;const o=(t/=100)*Math.min(n,1-n),r=t=>{const r=(t+e/30)%12,i=n-o*Math.max(Math.min(r-3,9-r,1),-1);return Math.round(255*i).toString(16).padStart(2,"0")};return`#${r(0)}${r(8)}${r(4)}`}function Bt(e){const t=e.replace("#",""),n=parseInt(t.slice(0,2),16),o=parseInt(t.slice(2,4),16),r=parseInt(t.slice(4,6),16);return[isNaN(n)?0:n,isNaN(o)?0:o,isNaN(r)?0:r]}function At(e,t,n){return`#${e.toString(16).padStart(2,"0")}${t.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}`}function Ft(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(e)}function Ht(e,t,n){if("hex"===n)return t<1?`${e}${Math.round(255*t).toString(16).padStart(2,"0")}`:e;const[o,r,i]=Bt(e);if("rgb"===n)return t<1?`rgba(${o}, ${r}, ${i}, ${t.toFixed(2)})`:`rgb(${o}, ${r}, ${i})`;const[l,a,s]=Rt(e);return"hsl"===n?t<1?`hsla(${l}, ${a}%, ${s}%, ${t.toFixed(2)})`:`hsl(${l}, ${a}%, ${s}%)`:e}Dt.displayName="TkxStepper";var Et=["#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#8b5cf6","#ec4899","#ffffff","#94a3b8","#475569","#0f172a"];function jt({hue:e,sat:t,bright:n,onChange:o}){const r=(0,l.useRef)(null),i=(0,l.useRef)(!1),s=(0,l.useCallback)(e=>{const t=r.current;if(!t)return;const n=t.getBoundingClientRect(),i=Math.max(0,Math.min(1,(e.clientX-n.left)/n.width)),l=Math.max(0,Math.min(1,(e.clientY-n.top)/n.height));o(Math.round(100*i),Math.round(100*(1-l)))},[o]);(0,l.useEffect)(()=>{const e=e=>{i.current&&s(e)},t=()=>{i.current=!1};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[s]);const d=`${t}%`,c=100-n+"%";return(0,a.jsxs)("div",{ref:r,style:{position:"relative",width:"100%",height:"160px",borderRadius:"6px",cursor:"crosshair",background:`hsl(${e}, 100%, 50%)`,flexShrink:0},onMouseDown:e=>{i.current=!0,s(e)},children:[(0,a.jsx)("div",{style:{position:"absolute",inset:0,borderRadius:"6px",background:"linear-gradient(to right, #ffffff, transparent)"}}),(0,a.jsx)("div",{style:{position:"absolute",inset:0,borderRadius:"6px",background:"linear-gradient(to bottom, transparent, #000000)"}}),(0,a.jsx)("div",{style:{position:"absolute",left:d,top:c,transform:"translate(-50%, -50%)",width:"14px",height:"14px",borderRadius:"50%",border:"2px solid white",boxShadow:"0 0 0 1px rgba(0,0,0,0.4)",pointerEvents:"none",backgroundColor:Tt(e,t,n/2+25)}})]})}function Ot({hue:e,onChange:t}){const n=(0,l.useRef)(null),o=(0,l.useRef)(!1),r=(0,l.useCallback)(e=>{const o=n.current;if(!o)return;const r=o.getBoundingClientRect(),i=Math.max(0,Math.min(1,(e.clientX-r.left)/r.width));t(Math.round(360*i))},[t]);return(0,l.useEffect)(()=>{const e=e=>{o.current&&r(e)},t=()=>{o.current=!1};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[r]),(0,a.jsx)("div",{ref:n,style:{position:"relative",height:"12px",borderRadius:"6px",cursor:"pointer",background:"linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)"},onMouseDown:e=>{o.current=!0,r(e)},children:(0,a.jsx)("div",{style:{position:"absolute",left:e/360*100+"%",top:"50%",transform:"translate(-50%, -50%)",width:"16px",height:"16px",borderRadius:"50%",border:"2px solid white",boxShadow:"0 0 0 1px rgba(0,0,0,0.3)",backgroundColor:`hsl(${e}, 100%, 50%)`,pointerEvents:"none"}})})}function Pt({alpha:e,hex:t,onChange:n}){const o=(0,l.useRef)(null),r=(0,l.useRef)(!1),i=(0,l.useCallback)(e=>{const t=o.current;if(!t)return;const r=t.getBoundingClientRect(),i=Math.max(0,Math.min(1,(e.clientX-r.left)/r.width));n(Math.round(100*i)/100)},[n]);(0,l.useEffect)(()=>{const e=e=>{r.current&&i(e)},t=()=>{r.current=!1};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[i]);const[s,d,c]=Bt(t);return(0,a.jsxs)("div",{style:{position:"relative"},children:[(0,a.jsx)("div",{style:{position:"absolute",inset:0,borderRadius:"6px",backgroundImage:"repeating-conic-gradient(#ccc 0% 25%, white 0% 50%)",backgroundSize:"8px 8px"}}),(0,a.jsx)("div",{ref:o,style:{position:"relative",height:"12px",borderRadius:"6px",cursor:"pointer",background:`linear-gradient(to right, rgba(${s},${d},${c},0), rgba(${s},${d},${c},1))`},onMouseDown:e=>{r.current=!0,i(e)},children:(0,a.jsx)("div",{style:{position:"absolute",left:100*e+"%",top:"50%",transform:"translate(-50%, -50%)",width:"16px",height:"16px",borderRadius:"50%",border:"2px solid white",boxShadow:"0 0 0 1px rgba(0,0,0,0.3)",backgroundColor:`rgba(${s},${d},${c},${e})`,pointerEvents:"none"}})})]})}var Vt={sm:{height:"32px",fontSize:"0.8125rem",px:"8px",btnW:"28px",iconSz:14},md:{height:"40px",fontSize:"0.875rem",px:"12px",btnW:"34px",iconSz:16},lg:{height:"48px",fontSize:"1rem",px:"14px",btnW:"40px",iconSz:18}};function Yt(e,t,n){let o=e;return void 0!==t&&(o=Math.max(o,t)),void 0!==n&&(o=Math.min(o,n)),o}function Ut(e,t){if(void 0===t)return e;const n=Math.pow(10,t);return Math.round(e*n)/n}function Kt({direction:e,isDisabled:t,btnW:n,height:o,primaryColor:r,borderColor:i,textMuted:s,iconSz:d,onStep:c}){const u=(0,l.useRef)(null),p=(0,l.useRef)(null),h="inc"===e?1:-1,f=(0,l.useCallback)(()=>{c(h),u.current=setTimeout(()=>{p.current=setInterval(()=>c(h),60)},400)},[h,c]),m=(0,l.useCallback)(()=>{u.current&&(clearTimeout(u.current),u.current=null),p.current&&(clearInterval(p.current),p.current=null)},[]);(0,l.useEffect)(()=>()=>m(),[m]);const x="inc"===e;return(0,a.jsx)("button",{type:"button","aria-label":x?"Increment":"Decrement",disabled:t,onMouseDown:f,onMouseUp:m,onMouseLeave:m,onTouchStart:e=>{e.preventDefault(),f()},onTouchEnd:m,style:{width:n,height:o,minWidth:n,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:"transparent",border:"none",borderRight:x?void 0:`1px solid ${i}`,borderLeft:x?`1px solid ${i}`:void 0,cursor:t?"not-allowed":"pointer",color:t?s:r,transition:"color 120ms ease, background 120ms ease",outline:"none"},onFocus:e=>{t||(e.currentTarget.style.background=`${r}12`)},onBlur:e=>{e.currentTarget.style.background="transparent"},children:x?(0,a.jsxs)("svg",{width:d,height:d,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:[(0,a.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,a.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}):(0,a.jsx)("svg",{width:d,height:d,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:(0,a.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})})})}function Xt({value:e,defaultValue:o=0,onChange:r,min:i,max:s,step:d=1,precision:c,prefix:u,suffix:p,format:h,currency:f,locale:m,clampOnBlur:x=!0,allowMouseWheel:g=!1,size:b="md",label:y,hint:v,isDisabled:w=!1,isReadOnly:k=!1,isInvalid:C=!1,errorMessage:S,id:$,className:z,style:N}){const M=t.useTheme(),I=(0,l.useId)(),L=$??I,W=`${L}-hint`,D=`${L}-error`,R=void 0!==e,[T,B]=(0,l.useState)(o),A=R?e:T,[F,H]=(0,l.useState)(!1),[E,j]=(0,l.useState)(""),O=Vt[b],P=C||!!S,V=P?M.danger:F?M.primary:M.border,Y=[v&&W,P&&D].filter(Boolean).join(" ")||void 0,U=y?n.sanitizeString(y):void 0,K=v?n.sanitizeString(v):void 0,X=S?n.sanitizeString(S):void 0,q=u?n.sanitizeString(u):void 0,G=p?n.sanitizeString(p):void 0,Z=(0,l.useCallback)(e=>{const t=Ut(e,c);R||B(t),r?.(t)},[R,r,c]),_=(0,l.useCallback)(e=>{w||k||Z(Yt(Ut(A+e*d,c),i,s))},[w,k,A,d,c,i,s,Z]),J=F?E:function(e,t,n,o,r){const i=o??"en-US";return"currency"===t?new Intl.NumberFormat(i,{style:"currency",currency:n??"USD",minimumFractionDigits:r??2,maximumFractionDigits:r??2}).format(e):"percent"===t?new Intl.NumberFormat(i,{style:"percent",minimumFractionDigits:r??0,maximumFractionDigits:r??0}).format(e/100):"decimal"===t||void 0!==r?new Intl.NumberFormat(i,{minimumFractionDigits:r??0,maximumFractionDigits:r??20}).format(e):String(e)}(A,h,f,m,c),Q=(q||G)&&!F;return(0,a.jsxs)("div",{className:n.cx(n.tkx("flex flex-col gap-1 w-full"),z),style:N,children:[U&&(0,a.jsx)("label",{htmlFor:L,className:n.tkx("text-sm font-medium font-sans"),style:{color:M.text},children:U}),(0,a.jsxs)("div",{className:n.tkx("flex items-stretch overflow-hidden rounded-lg transition-colors duration-150"),style:{border:`1.5px solid ${V}`,backgroundColor:w?M.surfaceAlt:M.surface,opacity:w?.65:1,height:O.height},children:[(0,a.jsx)(Kt,{direction:"dec",isDisabled:w||k,btnW:O.btnW,height:O.height,primaryColor:M.primary,borderColor:M.border,textMuted:M.textMuted,iconSz:O.iconSz,onStep:_}),(0,a.jsxs)("div",{className:n.tkx("relative flex-1 flex items-center overflow-hidden"),children:[Q&&q&&(0,a.jsx)("span",{style:{position:"absolute",left:O.px,fontSize:O.fontSize,color:M.textMuted,pointerEvents:"none",userSelect:"none"},children:q}),(0,a.jsx)("input",{id:L,type:"text",inputMode:"decimal",value:F?E:J,readOnly:k,disabled:w,"aria-invalid":P,"aria-describedby":Y,"aria-valuemin":i,"aria-valuemax":s,"aria-valuenow":A,style:{width:"100%",height:"100%",border:"none",background:"transparent",outline:"none",textAlign:"center",fontSize:O.fontSize,fontFamily:"inherit",color:M.text,paddingLeft:Q&&q?`calc(${O.px} + 1.2em)`:O.px,paddingRight:Q&&G?`calc(${O.px} + 1.2em)`:O.px,cursor:w?"not-allowed":k?"default":"text"},onFocus:()=>{H(!0),j(String(A))},onBlur:()=>{H(!1);const e=parseFloat(E);if(isNaN(e))return r?.(null),void j(String(A));let t=Ut(e,c);x&&(t=Yt(t,i,s)),Z(t)},onChange:e=>{j(e.target.value)},onKeyDown:e=>{"ArrowUp"===e.key&&(e.preventDefault(),_(1)),"ArrowDown"===e.key&&(e.preventDefault(),_(-1))},onWheel:e=>{g&&F&&(e.preventDefault(),_(e.deltaY<0?1:-1))}}),Q&&G&&(0,a.jsx)("span",{style:{position:"absolute",right:O.px,fontSize:O.fontSize,color:M.textMuted,pointerEvents:"none",userSelect:"none"},children:G})]}),(0,a.jsx)(Kt,{direction:"inc",isDisabled:w||k,btnW:O.btnW,height:O.height,primaryColor:M.primary,borderColor:M.border,textMuted:M.textMuted,iconSz:O.iconSz,onStep:_})]}),K&&!X&&(0,a.jsx)("span",{id:W,className:n.tkx("text-xs"),style:{color:M.textMuted},children:K}),X&&(0,a.jsxs)("span",{id:D,role:"alert",className:n.tkx("text-xs flex items-center gap-1"),style:{color:M.danger},children:[(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),X]})]})}Xt.displayName="TkxNumberInput";var qt={sm:{box:"36px",fontSize:"1rem",gap:"6px"},md:{box:"44px",fontSize:"1.25rem",gap:"8px"},lg:{box:"52px",fontSize:"1.5rem",gap:"10px"}},Gt={number:/^\d$/,alphanumeric:/^[a-zA-Z0-9]$/,alpha:/^[a-zA-Z]$/};function Zt(e,t){return Gt[t].test(e)?e.toUpperCase():""}function _t({length:e=6,value:o,onChange:r,onComplete:i,type:s="number",mask:d=!1,autoFocus:c=!1,isDisabled:u=!1,isInvalid:p=!1,errorMessage:h,hint:f,size:m="md",separator:x,separatorPosition:g,className:b,style:y}){const v=t.useTheme(),w=(0,l.useId)(),k=`${w}-hint`,C=`${w}-error`,S=void 0!==o,$=t=>{const n=t.split("").slice(0,e);for(;n.length<e;)n.push("");return n},[z,N]=(0,l.useState)(()=>$(S?o:"")),M=S?$(o):z,I=(0,l.useRef)([]),L=qt[m],W=p||!!h,D=M.every(e=>""!==e),R=f?n.sanitizeString(f):void 0,T=h?n.sanitizeString(h):void 0,B=e=>W?v.danger:D?v.success:v.border;(0,l.useEffect)(()=>{c&&I.current[0]?.focus()},[]);const A=(0,l.useCallback)(e=>{S||N(e);const t=e.join("");r?.(t),e.every(e=>""!==e)&&i?.(t)},[S,r,i]),F=t=>{const n=Math.max(0,Math.min(e-1,t));I.current[n]?.focus()},H=t=>n=>{if(!u){if("Backspace"!==n.key){if("Delete"===n.key){n.preventDefault();const e=[...M];return e[t]="",void A(e)}return"ArrowLeft"===n.key?(n.preventDefault(),void F(t-1)):"ArrowRight"===n.key?(n.preventDefault(),void F(t+1)):"Home"===n.key?(n.preventDefault(),void F(0)):"End"===n.key?(n.preventDefault(),void F(e-1)):void 0}if(n.preventDefault(),""!==M[t]){const e=[...M];e[t]="",A(e)}else if(t>0){const e=[...M];e[t-1]="",A(e),F(t-1)}}},E=t=>n=>{if(u)return;const o=n.target.value.slice(-1);if(!o)return;const r=Zt(o,s);if(!r)return;const i=[...M];i[t]=r,A(i),t<e-1&&F(t+1)},j=t=>n=>{if(n.preventDefault(),u)return;const o=n.clipboardData.getData("text").split("").map(e=>Zt(e,s)).filter(Boolean);if(!o.length)return;const r=[...M];let i=t;for(const t of o){if(i>=e)break;r[i]=t,i++}A(r),F(Math.min(i,e-1))},O=[R&&k,W&&C].filter(Boolean).join(" ")||void 0;return(0,a.jsxs)("div",{className:n.cx(n.tkx("flex flex-col gap-2 w-fit"),b),style:y,children:[(0,a.jsx)("div",{role:"group","aria-label":"One-time password","aria-describedby":O,className:n.tkx("flex items-center"),style:{gap:L.gap},children:Array.from({length:e},(t,o)=>{const r=B();return"undefined"!=typeof document&&(document.activeElement,I.current[o]),(0,a.jsxs)("div",{className:n.tkx("flex items-center"),style:{gap:L.gap},children:[x&&g===o&&0!==o&&(0,a.jsx)("span",{"aria-hidden":"true",style:{color:v.textMuted,userSelect:"none",flexShrink:0},children:x}),(0,a.jsx)("input",{ref:e=>{I.current[o]=e},type:d?"password":"text",inputMode:"number"===s?"numeric":"text",maxLength:1,value:M[o],disabled:u,"aria-label":`Digit ${o+1} of ${e}`,autoComplete:"one-time-code",spellCheck:!1,onChange:E(o),onKeyDown:H(o),onPaste:j(o),onFocus:e=>e.target.select(),style:{width:L.box,height:L.box,textAlign:"center",fontSize:L.fontSize,fontFamily:"monospace",fontWeight:600,border:`1.5px solid ${r}`,borderRadius:"8px",backgroundColor:u?v.surfaceAlt:v.surface,color:v.text,outline:"none",boxShadow:"none",cursor:u?"not-allowed":"text",transition:"border-color 150ms ease, box-shadow 150ms ease",opacity:u?.6:1},onFocusCapture:e=>{u||(e.currentTarget.style.borderColor=W?v.danger:v.primary,e.currentTarget.style.boxShadow=`0 0 0 3px ${W?v.danger:v.primary}33`)},onBlurCapture:e=>{e.currentTarget.style.borderColor=B(),e.currentTarget.style.boxShadow="none"}})]},o)})}),R&&!T&&(0,a.jsx)("span",{id:k,className:n.tkx("text-xs"),style:{color:v.textMuted},children:R}),T&&(0,a.jsxs)("span",{id:C,role:"alert",className:n.tkx("text-xs flex items-center gap-1"),style:{color:v.danger},children:[(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),T]})]})}function Jt(e,t){if(!e)return{matched:!0,ranges:[],score:0};const n=e.toLowerCase(),o=t.toLowerCase(),r=o.indexOf(n);if(-1!==r)return{matched:!0,ranges:[[r,r+n.length-1]],score:0===r?100:80};const i=[];let l=0,a=-1,s=-1;for(let d=0;d<o.length&&l<n.length;d++)o[d]===n[l]&&(-1!==s&&d===s+1||(-1!==a&&i.push([a,s]),a=d),s=d,l++);return-1!==a&&-1!==s&&i.push([a,s]),l<n.length?{matched:!1,ranges:[],score:0}:{matched:!0,ranges:i,score:40}}function Qt({text:e,ranges:t,color:n}){if(!t.length)return(0,a.jsx)(a.Fragment,{children:e});const o=[];let r=0;for(const[i,l]of t)r<i&&o.push((0,a.jsx)("span",{children:e.slice(r,i)},`t-${r}`)),o.push((0,a.jsx)("span",{style:{color:n,fontWeight:700},children:e.slice(i,l+1)},`h-${i}`)),r=l+1;return r<e.length&&o.push((0,a.jsx)("span",{children:e.slice(r)},"t-end")),(0,a.jsx)(a.Fragment,{children:o})}function en({surface:e,border:t}){return(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 12px",borderRadius:8,overflow:"hidden"},children:[(0,a.jsx)("div",{style:{width:24,height:24,borderRadius:6,background:`linear-gradient(90deg, ${t} 25%, ${e} 50%, ${t} 75%)`,backgroundSize:"200% 100%",animation:"tkx-shimmer 1.4s ease-in-out infinite",flexShrink:0}}),(0,a.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:5},children:[(0,a.jsx)("div",{style:{height:13,borderRadius:4,width:"60%",background:`linear-gradient(90deg, ${t} 25%, ${e} 50%, ${t} 75%)`,backgroundSize:"200% 100%",animation:"tkx-shimmer 1.4s ease-in-out infinite"}}),(0,a.jsx)("div",{style:{height:10,borderRadius:4,width:"40%",background:`linear-gradient(90deg, ${t} 25%, ${e} 50%, ${t} 75%)`,backgroundSize:"200% 100%",animation:"tkx-shimmer 1.4s ease-in-out 0.2s infinite"}})]})]})}function tn({items:e,isOpen:o=!1,onClose:r,placeholder:i="Type a command or search…",emptyMessage:d,maxItems:c=8,onItemSelect:u,className:p,style:h}){const f=t.useTheme(),[m,x]=(0,l.useState)(""),[g,b]=(0,l.useState)(0),[y,v]=(0,l.useState)(!1),w=(0,l.useRef)(null),k=(0,l.useRef)(null),C=(0,l.useId)(),S=function(e){const t=(0,l.useRef)(null);return(0,l.useEffect)(()=>{if(!e||!t.current)return;const n=t.current,o=n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),r=o[0],i=o[o.length-1],l=e=>{"Tab"===e.key&&(e.shiftKey?document.activeElement===r&&(e.preventDefault(),i?.focus()):document.activeElement===i&&(e.preventDefault(),r?.focus()))};return n.addEventListener("keydown",l),()=>n.removeEventListener("keydown",l)},[e]),t}(o),$=function(e,t){if(!e.trim())return t.filter(e=>!e.disabled).map(e=>({item:e,score:0,labelRanges:[]}));const n=[];for(const o of t){if(o.disabled)continue;const t=Jt(e,o.label),r=o.description?Jt(e,o.description):{matched:!1,score:0},i=(o.keywords??[]).some(t=>Jt(e,t).matched);t.matched?n.push({item:o,score:t.score+20,labelRanges:t.ranges}):r.matched?n.push({item:o,score:r.score,labelRanges:[]}):i&&n.push({item:o,score:20,labelRanges:[]})}return n.sort((e,t)=>t.score-e.score)}(m,e).slice(0,c),z=[];for(const t of $){const e=t.item.group,n=z.find(t=>t.group===e);n?n.items.push(t):z.push({group:e,items:[t]})}const N=z.flatMap(e=>e.items);var M,I;M=()=>{r?.()},I=o,(0,l.useEffect)(()=>{if(!I)return;const e=e=>{"Escape"===e.key&&M()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[M,I]),(0,l.useEffect)(()=>{o&&(x(""),b(0),setTimeout(()=>w.current?.focus(),30))},[o]),(0,l.useEffect)(()=>{g>=N.length&&b(Math.max(0,N.length-1))},[N.length,g]);const L=(0,l.useCallback)(e=>{const t=k.current;t&&t.querySelectorAll("[data-command-item]")[e]?.scrollIntoView({block:"nearest"})},[]),W=e=>{e.disabled||(e.onSelect?.(),u?.(e),r?.())};if(!o||"undefined"==typeof document)return null;const D=n.sanitizeString(i),R=d?n.sanitizeString(d):`No results for "${n.sanitizeString(m)}"`;if("undefined"!=typeof document&&!document.getElementById("tkx-shimmer-style")){const e=document.createElement("style");e.id="tkx-shimmer-style",e.textContent="@keyframes tkx-shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }",document.head.appendChild(e)}return(0,s.createPortal)((0,a.jsxs)("div",{role:"presentation",style:{position:"fixed",inset:0,zIndex:1e4,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"15vh",paddingLeft:16,paddingRight:16},children:[(0,a.jsx)("div",{"aria-hidden":"true",onClick:r,style:{position:"absolute",inset:0,backgroundColor:"rgba(0,0,0,0.55)",backdropFilter:"blur(4px)",animation:"tkx-fade-in 120ms ease"}}),(0,a.jsxs)("div",{ref:S,role:"dialog","aria-modal":"true","aria-label":"Command palette",id:C,className:n.cx(p),style:{position:"relative",zIndex:1,width:"100%",maxWidth:560,backgroundColor:f.surface,border:`1px solid ${f.border}`,borderRadius:16,boxShadow:`0 24px 64px rgba(0,0,0,0.5), 0 0 0 1px ${f.border}`,overflow:"hidden",display:"flex",flexDirection:"column",maxHeight:"70vh",...h},children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"14px 16px",borderBottom:`1px solid ${f.border}`},children:[(0,a.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:f.textMuted,strokeWidth:2,"aria-hidden":"true",style:{flexShrink:0},children:[(0,a.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,a.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),(0,a.jsx)("input",{ref:w,type:"text",role:"combobox","aria-expanded":!0,"aria-autocomplete":"list","aria-controls":`${C}-list`,"aria-activedescendant":N[g]?`${C}-item-${N[g].item.id}`:void 0,value:m,onChange:e=>{x(e.target.value),b(0)},onKeyDown:e=>{if("ArrowDown"===e.key){e.preventDefault();const t=Math.min(N.length-1,g+1);b(t),L(t)}else if("ArrowUp"===e.key){e.preventDefault();const t=Math.max(0,g-1);b(t),L(t)}else if("Enter"===e.key){e.preventDefault();const t=N[g];t&&W(t.item)}},placeholder:D,style:{flex:1,border:"none",background:"transparent",outline:"none",fontSize:16,fontFamily:"inherit",color:f.text}}),m&&(0,a.jsx)("button",{type:"button","aria-label":"Clear search",onClick:()=>{x(""),b(0),w.current?.focus()},style:{border:"none",background:"transparent",cursor:"pointer",color:f.textMuted,display:"flex",alignItems:"center",padding:0},children:(0,a.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),(0,a.jsx)("div",{id:`${C}-list`,ref:k,role:"listbox","aria-label":"Command results",style:{overflowY:"auto",flex:1,padding:"6px 8px"},children:y?Array.from({length:4},(e,t)=>(0,a.jsx)(en,{surface:f.surface,border:f.border},t)):0===N.length?(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:8,padding:"32px 16px",color:f.textMuted},children:[(0,a.jsxs)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,a.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),(0,a.jsx)("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]}),(0,a.jsx)("span",{style:{fontSize:"0.875rem"},children:R})]}):z.map(({group:e,items:t},o)=>{const r=z.slice(0,o).reduce((e,t)=>e+t.items.length,0);return(0,a.jsxs)("div",{children:[e&&(0,a.jsx)("div",{role:"presentation",style:{fontSize:"0.6875rem",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.08em",color:f.textMuted,padding:"10px 12px 4px"},children:n.sanitizeString(e)}),t.map((e,t)=>{const o=r+t,i=o===g,l=e.item;return(0,a.jsxs)("div",{id:`${C}-item-${l.id}`,role:"option","aria-selected":i,"aria-disabled":l.disabled,"data-command-item":!0,onClick:()=>W(l),onMouseEnter:()=>b(o),style:{display:"flex",alignItems:"center",gap:10,padding:"9px 12px",borderRadius:8,cursor:l.disabled?"not-allowed":"pointer",opacity:l.disabled?.45:1,backgroundColor:i?`${f.primary}18`:"transparent",borderLeft:i?`2px solid ${f.primary}`:"2px solid transparent",transition:"background 80ms ease",userSelect:"none"},children:[l.icon&&(0,a.jsx)("span",{style:{width:20,height:20,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",color:i?f.primary:f.textMuted},children:l.icon}),(0,a.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,a.jsx)("div",{style:{fontSize:"0.875rem",fontWeight:500,color:f.text,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(0,a.jsx)(Qt,{text:l.label,ranges:e.labelRanges,color:f.primary})}),l.description&&(0,a.jsx)("div",{style:{fontSize:"0.75rem",color:f.textMuted,marginTop:1,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.sanitizeString(l.description)})]}),l.shortcut&&(0,a.jsx)("span",{style:{flexShrink:0,fontSize:"0.6875rem",fontWeight:500,color:f.textMuted,backgroundColor:f.surfaceAlt,border:`1px solid ${f.border}`,borderRadius:6,padding:"2px 6px",fontFamily:"monospace",letterSpacing:"0.04em"},children:n.sanitizeString(l.shortcut)})]},l.id)})]},e??"__default__")})}),N.length>0&&(0,a.jsxs)("div",{"aria-hidden":"true",style:{display:"flex",alignItems:"center",gap:12,padding:"8px 16px",borderTop:`1px solid ${f.border}`,fontSize:"0.6875rem",color:f.textMuted},children:[(0,a.jsxs)("span",{children:[(0,a.jsx)("kbd",{style:{fontFamily:"monospace"},children:"↑↓"})," navigate"]}),(0,a.jsxs)("span",{children:[(0,a.jsx)("kbd",{style:{fontFamily:"monospace"},children:"↵"})," select"]}),(0,a.jsxs)("span",{children:[(0,a.jsx)("kbd",{style:{fontFamily:"monospace"},children:"Esc"})," close"]})]})]})]}),document.body)}function nn({direction:e,onClick:t,isDisabled:n,primaryColor:o,position:r,orientation:i}){const l="vertical"===i,s="prev"===e,d="inside"===r?{position:"absolute",zIndex:3,...l?{[s?"top":"bottom"]:10,left:"50%",transform:"translateX(-50%)"}:{[s?"left":"right"]:10,top:"50%",transform:"translateY(-50%)"}}:{flexShrink:0,position:"relative"};return(0,a.jsx)("button",{type:"button","aria-label":s?"Previous slide":"Next slide",disabled:n,onClick:t,style:{...d,width:36,height:36,borderRadius:"50%",border:"none",backgroundColor:"rgba(0,0,0,0.45)",backdropFilter:"blur(4px)",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",cursor:n?"not-allowed":"pointer",opacity:n?.35:1,transition:"background 150ms ease, opacity 150ms ease",outline:"none"},onFocus:e=>{e.currentTarget.style.boxShadow=`0 0 0 3px ${o}55`},onBlur:e=>{e.currentTarget.style.boxShadow="none"},onMouseEnter:e=>{n||(e.currentTarget.style.backgroundColor="rgba(0,0,0,0.65)")},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="rgba(0,0,0,0.45)"},children:l?s?(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:(0,a.jsx)("polyline",{points:"18 15 12 9 6 15"})}):(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:(0,a.jsx)("polyline",{points:"6 9 12 15 18 9"})}):s?(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:(0,a.jsx)("polyline",{points:"15 18 9 12 15 6"})}):(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:(0,a.jsx)("polyline",{points:"9 18 15 12 9 6"})})})}function on({slides:e,autoPlay:r=!1,autoPlayInterval:i=4e3,pauseOnHover:s=!0,loop:d=!0,showArrows:c=!0,showDots:u=!0,showThumbnails:p=!1,orientation:h="horizontal",slidesToShow:f=1,gap:m=0,transitionDuration:x=400,swipeable:g=!0,initialIndex:b=0,onChange:y,arrowPosition:v="inside",height:w=320,className:k,style:C}){const S=t.useTheme(),$=o.useReducedMotion(),z=(0,l.useId)(),N=e.length,[M,I]=(0,l.useState)(b),[L,W]=(0,l.useState)(d?b+1:b),[D,R]=(0,l.useState)(!1),[T,B]=(0,l.useState)(!1),A=(0,l.useRef)(null),F=(0,l.useRef)(null),H=(0,l.useRef)(null),E=(0,l.useRef)(0),j=(0,l.useRef)(!1),O="vertical"===h,P=$?0:x,V=d&&N>1?[e[N-1],...e,e[0]]:e,Y=V.length,U=100/f,K=(e,t=0)=>{const n=0!==t?` - ${t}px`:"";return O?`translateY(calc(-${e*U}%${n}))`:`translateX(calc(-${e*U}%${n}))`},X=(0,l.useCallback)((e,t=!1)=>{const n=d?(e%N+N)%N:Math.max(0,Math.min(N-1,e)),o=d?n+1:n;t&&A.current?(A.current.style.transition="none",W(o),I(n),A.current.offsetHeight,A.current.style.transition=""):(R(!0),W(o),I(n)),y?.(n)},[N,d,y]),q=(0,l.useCallback)(()=>X(M-1),[M,X]),G=(0,l.useCallback)(()=>X(M+1),[M,X]),Z=(0,l.useCallback)(()=>{R(!1),!d||N<=1||(0===L?X(N-1,!0):L===Y-1&&X(0,!0))},[d,N,L,Y,X]);(0,l.useEffect)(()=>{if(!(!r||T||N<=1))return F.current=setInterval(G,i),()=>{F.current&&clearInterval(F.current)}},[r,T,i,G,N]),(0,l.useEffect)(()=>{const e=e=>{const t=document.activeElement;document.getElementById(z)?.contains(t)&&(e.key===(O?"ArrowUp":"ArrowLeft")&&(e.preventDefault(),q()),e.key===(O?"ArrowDown":"ArrowRight")&&(e.preventDefault(),G()))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[z,O,q,G]);const _=e=>"touches"in e?O?e.touches[0].clientY:e.touches[0].clientX:O?e.clientY:e.clientX,J=e=>{g&&(H.current=_(e),E.current=0,j.current=!0)},Q=e=>{if(!j.current||null===H.current)return;const t=_(e)-H.current;E.current=t,A.current&&(A.current.style.transition="none",A.current.style.transform=K(L,-t))},ee=()=>{if(!j.current)return;j.current=!1;const e=E.current;A.current&&(A.current.style.transition="",A.current.style.transform=""),e<-50?G():e>50?q():A.current&&(A.current.style.transform=K(L)),H.current=null,E.current=0},te="number"==typeof w?`${w}px`:w,ne={display:"flex",flexDirection:O?"column":"row",width:O?"100%":Y/f*100+"%",height:O?Y/f*100+"%":"100%",transform:K(L),transition:D||!$?`transform ${P}ms cubic-bezier(0.4, 0, 0.2, 1)`:"none",willChange:"transform",gap:m>0?m:void 0},oe={flexShrink:0,width:O?"100%":U/(Y/f)+"%",height:O?U/(Y/f)+"%":"100%",overflow:"hidden",position:"relative"},re=d||M>0,ie=d||M<N-1,le="outside"===v;return(0,a.jsxs)("div",{id:z,className:n.cx(n.tkx("flex flex-col gap-2"),k),style:C,"aria-roledescription":"carousel","aria-label":"Content carousel",children:[(0,a.jsxs)("div",{className:n.tkx("flex items-center gap-2"),style:{gap:le&&c?8:0},children:[c&&le&&(0,a.jsx)(nn,{direction:"prev",onClick:q,isDisabled:!re,primaryColor:S.primary,position:"outside",orientation:h}),(0,a.jsxs)("div",{style:{position:"relative",flex:1,overflow:"hidden",height:te,borderRadius:12,cursor:g?j.current?"grabbing":"grab":"default",userSelect:"none"},onMouseEnter:()=>s&&B(!0),onMouseLeave:()=>{B(!1),ee()},onTouchStart:J,onTouchMove:Q,onTouchEnd:ee,onMouseDown:J,onMouseMove:Q,onMouseUp:ee,"aria-live":"polite","aria-atomic":"false",children:[c&&!le&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(nn,{direction:"prev",onClick:q,isDisabled:!re,primaryColor:S.primary,position:"inside",orientation:h}),(0,a.jsx)(nn,{direction:"next",onClick:G,isDisabled:!ie,primaryColor:S.primary,position:"inside",orientation:h})]}),(0,a.jsx)("div",{ref:A,style:ne,onTransitionEnd:Z,children:V.map((e,t)=>(0,a.jsx)("div",{style:oe,role:"group","aria-roledescription":"slide","aria-label":`Slide ${(t-(d?1:0)+N)%N+1} of ${N}`,"aria-hidden":(t-(d?1:0)+N)%N!==M,children:e.content},`${e.id}-${t}`))}),u&&!p&&(0,a.jsx)("div",{"aria-label":"Slide indicators",style:{position:"absolute",bottom:12,left:"50%",transform:"translateX(-50%)",display:"flex",gap:6,zIndex:2},children:e.map((e,t)=>(0,a.jsx)("button",{type:"button","aria-label":`Go to slide ${t+1}`,"aria-current":t===M?"true":void 0,onClick:()=>X(t),style:{width:t===M?20:8,height:8,borderRadius:9999,border:"none",backgroundColor:t===M?S.primary:"rgba(255,255,255,0.5)",cursor:"pointer",padding:0,transition:"width 250ms ease, background 250ms ease",outline:"none"},onFocus:e=>{e.currentTarget.style.boxShadow=`0 0 0 3px ${S.primary}66`},onBlur:e=>{e.currentTarget.style.boxShadow="none"}},e.id))})]}),c&&le&&(0,a.jsx)(nn,{direction:"next",onClick:G,isDisabled:!ie,primaryColor:S.primary,position:"outside",orientation:h})]}),p&&(0,a.jsx)("div",{role:"tablist","aria-label":"Slide thumbnails",style:{display:"flex",gap:6,overflowX:"auto",paddingBottom:4,scrollbarWidth:"thin"},children:e.map((e,t)=>(0,a.jsxs)("button",{type:"button",role:"tab","aria-selected":t===M,"aria-label":`Thumbnail for slide ${t+1}`,onClick:()=>X(t),style:{flexShrink:0,width:60,height:42,border:`2px solid ${t===M?S.primary:S.border}`,borderRadius:6,overflow:"hidden",cursor:"pointer",padding:0,background:S.surfaceAlt,transition:"border-color 150ms ease",outline:"none",position:"relative"},onFocus:e=>{e.currentTarget.style.boxShadow=`0 0 0 3px ${S.primary}55`},onBlur:e=>{e.currentTarget.style.boxShadow="none"},children:[e.thumbnail?(0,a.jsx)("img",{src:e.thumbnail,alt:"","aria-hidden":"true",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}}):(0,a.jsx)("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"0.625rem",color:S.textMuted,fontWeight:600},children:t+1}),t===M&&(0,a.jsx)("div",{"aria-hidden":"true",style:{position:"absolute",inset:0,backgroundColor:`${S.primary}22`}})]},e.id))})]})}function rn({color:e}){return(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{flexShrink:0},children:(0,a.jsx)("path",{d:"M6 3l5 5-5 5",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function ln({onClick:e,bgColor:t,hoverColor:o,textColor:r}){return(0,a.jsx)("button",{type:"button",onClick:e,onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e())},"aria-label":"Show hidden breadcrumb items",className:n.tkx("inline-flex items-center justify-center rounded px-1.5 py-0.5","text-sm font-medium cursor-pointer border-none outline-none","focus-visible:ring-2 focus-visible:ring-offset-1"),style:{backgroundColor:t,color:r,transition:"background-color 150ms ease"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=o},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=t},children:"…"})}function an(e,t){if(!t)return!0;const n=t.toLowerCase(),o=e.label.toLowerCase();let r=0;for(let i=0;i<o.length&&r<n.length;i++)o[i]===n[r]&&r++;return r===n.length}function sn({color:e}){return(0,a.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{animation:"spin 0.8s linear infinite",flexShrink:0},children:[(0,a.jsx)("circle",{cx:"8",cy:"8",r:"6",stroke:e,strokeWidth:"2",opacity:"0.3"}),(0,a.jsx)("path",{d:"M14 8a6 6 0 00-6-6",stroke:e,strokeWidth:"2",strokeLinecap:"round"})]})}function dn({expanded:e,color:t,reducedMotion:n}){return(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{transform:e?"rotate(90deg)":"rotate(0deg)",transition:n?"none":"transform 150ms ease",flexShrink:0},children:(0,a.jsx)("path",{d:"M6 3l5 5-5 5",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function cn({checked:e,color:t,borderColor:o}){return(0,a.jsx)("span",{role:"presentation","aria-hidden":"true",className:n.tkx("inline-flex items-center justify-center flex-shrink-0"),style:{width:16,height:16,borderRadius:3,border:`1.5px solid ${e?t:o}`,backgroundColor:e?t:"transparent",transition:"all 100ms ease"},children:e&&(0,a.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:(0,a.jsx)("path",{d:"M2 5l2.5 2.5L8 3",stroke:"#fff",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})}_t.displayName="TkxOTP",tn.displayName="TkxCommand",on.displayName="TkxCarousel";var un={sm:{buttonPx:6,buttonPy:4,fontSize:12,iconSize:14,gap:2,separatorSize:16},md:{buttonPx:8,buttonPy:6,fontSize:13,iconSize:16,gap:4,separatorSize:20},lg:{buttonPx:12,buttonPy:8,fontSize:14,iconSize:18,gap:6,separatorSize:24}};function pn({color:e}){return(0,a.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"6",cy:"6",r:"4.5",stroke:e,strokeWidth:"1.5"}),(0,a.jsx)("path",{d:"M9.5 9.5L13 13",stroke:e,strokeWidth:"1.5",strokeLinecap:"round"})]})}function hn({checked:e,primaryColor:t,borderColor:o}){return(0,a.jsx)("span",{"aria-hidden":"true",className:n.tkx("inline-flex items-center justify-center flex-shrink-0"),style:{width:16,height:16,borderRadius:3,border:`1.5px solid ${e?t:o}`,backgroundColor:e?t:"transparent",transition:"all 100ms ease"},children:e&&(0,a.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:(0,a.jsx)("path",{d:"M2 5l2.5 2.5L8 3",stroke:"#fff",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})}function fn({color:e}){return(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M3 8h10M9 4l4 4-4 4",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function mn({color:e}){return(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M13 8H3M7 4l-4 4 4 4",stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function xn({title:e,items:r,selected:i,onToggle:s,onToggleAll:d,search:c,onSearchChange:u,searchable:p,height:h,listId:f}){const m=t.useTheme(),x=o.useReducedMotion(),g=n.sanitizeString(e),b=(0,l.useMemo)(()=>{if(!c)return r;const e=c.toLowerCase();return r.filter(t=>t.label.toLowerCase().includes(e))},[r,c]),y=b.filter(e=>!e.disabled),v=y.length>0&&y.every(e=>i.has(e.value));return y.some(e=>i.has(e.value)),(0,a.jsxs)("div",{className:n.tkx("flex flex-col rounded-lg overflow-hidden flex-1 min-w-0"),style:{border:`1px solid ${m.border}`,backgroundColor:m.surface},children:[(0,a.jsxs)("div",{className:n.tkx("flex items-center gap-2 px-3 py-2 border-b"),style:{borderColor:m.border,backgroundColor:m.surfaceAlt},children:[(0,a.jsx)("button",{type:"button","aria-label":v?`Deselect all ${g}`:`Select all ${g}`,onClick:d,className:n.tkx("border-none bg-transparent cursor-pointer p-0 outline-none focus-visible:ring-2"),children:(0,a.jsx)(hn,{checked:v,primaryColor:m.primary,borderColor:m.border})}),(0,a.jsx)("span",{className:n.tkx("text-sm font-medium flex-1 truncate"),style:{color:m.text},children:g}),(0,a.jsxs)("span",{className:n.tkx("text-xs"),style:{color:m.textMuted},children:[i.size,"/",r.length]})]}),p&&(0,a.jsxs)("div",{className:n.tkx("flex items-center gap-1.5 px-3 py-1.5 border-b"),style:{borderColor:m.border},children:[(0,a.jsx)(pn,{color:m.textMuted}),(0,a.jsx)("input",{type:"text","aria-label":`Search ${g}`,value:c,onChange:e=>u(e.target.value),placeholder:"Search...",className:n.tkx("flex-1 bg-transparent border-none outline-none text-xs"),style:{color:m.text}})]}),(0,a.jsx)("ul",{id:f,role:"listbox","aria-label":g,"aria-multiselectable":"true",className:n.tkx("list-none m-0 p-1 overflow-y-auto"),style:{height:h,minHeight:100},children:0===b.length?(0,a.jsx)("li",{className:n.tkx("text-xs text-center py-4"),style:{color:m.textMuted},"aria-disabled":"true",children:"No items"}):b.map(e=>{const t=i.has(e.value),o=n.sanitizeString(e.label);return(0,a.jsxs)("li",{role:"option","aria-selected":t,"aria-disabled":e.disabled||void 0,tabIndex:0,onClick:()=>!e.disabled&&s(e.value),onKeyDown:t=>!e.disabled&&((e,t)=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),s(t))})(t,e.value),className:n.tkx("flex items-center gap-2 px-2 py-1.5 rounded-md cursor-pointer text-sm","outline-none focus-visible:ring-2 focus-visible:ring-offset-1",e.disabled?"opacity-50 cursor-not-allowed":""),style:{color:e.disabled?m.textMuted:m.text,backgroundColor:t?`${m.primary}10`:"transparent",transition:x?"none":"background-color 100ms ease"},onMouseEnter:n=>{e.disabled||t||(n.currentTarget.style.backgroundColor=m.surfaceAlt)},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=t?`${m.primary}10`:"transparent"},children:[(0,a.jsx)(hn,{checked:t,primaryColor:m.primary,borderColor:m.border}),(0,a.jsx)("span",{className:n.tkx("truncate"),children:o})]},e.value)})})]})}function gn({color:e,rotated:t,reducedMotion:n}){return(0,a.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",style:{transform:t?"rotate(45deg)":"rotate(0deg)",transition:n?"none":"transform 200ms ease"},children:(0,a.jsx)("path",{d:"M12 5v14M5 12h14",stroke:e,strokeWidth:"2.5",strokeLinecap:"round"})})}var bn={"bottom-right":{bottom:24,right:24},"bottom-left":{bottom:24,left:24},"top-right":{top:24,right:24},"top-left":{top:24,left:24}};function yn({open:e}){return(0,a.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round","aria-hidden":"true",children:e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),(0,a.jsx)("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),(0,a.jsx)("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})})}var vn=!1,wn=!1,kn={success:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm-2 14.5l-4-4 1.41-1.41L10 13.67l6.59-6.59L18 8.5l-8 8z"})}),error:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),warning:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),info:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})})},Cn={"bottom-left":{bottom:24,left:24},"bottom-center":{bottom:24,left:"50%",transform:"translateX(-50%)"},"bottom-right":{bottom:24,right:24},"top-center":{top:24,left:"50%",transform:"translateX(-50%)"}};function Sn({direction:e}){return(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:n.tkx("shrink-0 ml-1"),children:"asc"===e?(0,a.jsx)("path",{d:"M7 14l5-5 5 5H7z"}):"desc"===e?(0,a.jsx)("path",{d:"M7 10l5 5 5-5H7z"}):(0,a.jsx)("path",{d:"M7 10l5 5 5-5H7zM7 14l5-5 5 5H7z",opacity:"0.35"})})}function $n({checked:e,indeterminate:n}){const o=t.useTheme();return(0,a.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",children:[(0,a.jsx)("rect",{x:"1",y:"1",width:"14",height:"14",rx:"2",fill:e||n?o.primary:"transparent",stroke:e||n?o.primary:o.border,strokeWidth:"1.5"}),n&&(0,a.jsx)("line",{x1:"4",y1:"8",x2:"12",y2:"8",stroke:o.bg,strokeWidth:"2"}),e&&!n&&(0,a.jsx)("path",{d:"M4.5 8L7 10.5L11.5 5.5",fill:"none",stroke:o.bg,strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})}function zn(e,t){return"function"==typeof t?t(e):String(e[t])}function Nn(e,t){return e[t]}function Mn(e){const t=String(e??"");return t.includes(",")||t.includes('"')||t.includes("\n")?`"${t.replace(/"/g,'""')}"`:t}function In({colCount:e}){const o=t.useTheme();return(0,a.jsx)("tbody",{children:Array.from({length:5},(t,r)=>(0,a.jsx)("tr",{children:Array.from({length:e},(e,t)=>(0,a.jsx)("td",{className:n.tkx("px-3 py-2"),style:{borderBottom:`1px solid ${o.border}`},children:(0,a.jsx)(T,{height:16})},t))},r))})}function Ln({label:e,showExport:t,onExport:n,totalRows:o,selectedCount:r,theme:i}){return t||0!==r?(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",borderBottom:`1px solid ${i.border}`,backgroundColor:i.surface,gap:8},children:[(0,a.jsx)("span",{style:{fontSize:13,color:i.textMuted},children:r>0?`${r} of ${o} row${1!==o?"s":""} selected`:`${o} row${1!==o?"s":""}`}),t&&(0,a.jsxs)("button",{onClick:n,"aria-label":`Export ${e} as CSV`,style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 12px",fontSize:13,fontWeight:500,borderRadius:6,border:`1px solid ${i.border}`,backgroundColor:"transparent",color:i.text,cursor:"pointer"},children:[(0,a.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,a.jsx)("polyline",{points:"7 10 12 15 17 10"}),(0,a.jsx)("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}),"Export CSV"]})]}):null}function Wn({page:e,totalPages:t,pageSize:n,totalRows:o,onPageChange:r,theme:i}){const l=(e-1)*n+1,s=Math.min(e*n,o),d={display:"inline-flex",alignItems:"center",justifyContent:"center",width:32,height:32,borderRadius:6,border:`1px solid ${i.border}`,backgroundColor:"transparent",color:i.text,cursor:"pointer",fontSize:13,fontWeight:500};return(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",borderTop:`1px solid ${i.border}`,backgroundColor:i.surface,gap:8,flexWrap:"wrap"},role:"navigation","aria-label":"Pagination",children:[(0,a.jsx)("span",{style:{fontSize:13,color:i.textMuted},children:0===o?"0 rows":`${l}–${s} of ${o}`}),(0,a.jsxs)("div",{style:{display:"flex",gap:4},children:[(0,a.jsx)("button",{onClick:()=>r(1),disabled:1===e,"aria-label":"First page",style:{...d,opacity:1===e?.4:1},children:"«"}),(0,a.jsx)("button",{onClick:()=>r(e-1),disabled:1===e,"aria-label":"Previous page",style:{...d,opacity:1===e?.4:1},children:"‹"}),Array.from({length:Math.min(5,t)},(n,o)=>{let l=o+1;return t>5&&(l=Math.max(1,Math.min(e-Math.floor(2.5),t-4))+o),(0,a.jsx)("button",{onClick:()=>r(l),"aria-label":`Page ${l}`,"aria-current":l===e?"page":void 0,style:{...d,backgroundColor:l===e?i.primary:"transparent",color:l===e?i.bg:i.text,borderColor:l===e?i.primary:i.border},children:l},l)}),(0,a.jsx)("button",{onClick:()=>r(e+1),disabled:e===t,"aria-label":"Next page",style:{...d,opacity:e===t?.4:1},children:"›"}),(0,a.jsx)("button",{onClick:()=>r(t),disabled:e===t,"aria-label":"Last page",style:{...d,opacity:e===t?.4:1},children:"»"})]})]})}var Dn=!1,Rn={info:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"})}),warning:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),success:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm-2 14.5l-4-4 1.41-1.41L10 13.67l6.59-6.59L18 8.5l-8 8z"})}),danger:(0,a.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})})},Tn={1:{fontSize:"1.75rem",fontWeight:700,lineHeight:1.25,marginTop:24,marginBottom:12},2:{fontSize:"1.375rem",fontWeight:600,lineHeight:1.3,marginTop:20,marginBottom:10},3:{fontSize:"1.1rem",fontWeight:600,lineHeight:1.35,marginTop:16,marginBottom:8}},Bn={heading:function({block:e}){const o=t.useTheme(),r=e.level??1,i=`h${r}`,l=n.sanitizeString(e.content??"");return(0,a.jsx)(i,{className:n.tkx("m-0"),style:{...Tn[r],color:o.text},children:l})},paragraph:function({block:e}){const o=t.useTheme(),r=n.sanitizeString(e.content??"");return(0,a.jsx)("p",{className:n.tkx("m-0"),style:{fontSize:"0.938rem",lineHeight:1.7,color:o.text,marginBottom:12},children:r})},blockquote:function({block:e}){const o=t.useTheme(),r=n.sanitizeString(e.content??"");return(0,a.jsx)("blockquote",{className:n.tkx("m-0"),style:{borderLeft:`3px solid ${o.primary}`,paddingLeft:16,paddingTop:8,paddingBottom:8,marginTop:12,marginBottom:12,backgroundColor:`${o.surfaceAlt}`,borderRadius:"0 6px 6px 0",color:o.textMuted,fontStyle:"italic",fontSize:"0.938rem",lineHeight:1.6},children:r})},code:function({block:e}){const o=t.useTheme(),r=n.sanitizeString(e.content??""),i=e.language?n.sanitizeString(e.language):null;return(0,a.jsxs)("div",{className:n.tkx("rounded-lg overflow-hidden"),style:{marginTop:12,marginBottom:12,border:`1px solid ${o.border}`,backgroundColor:o.surfaceAlt},children:[i&&(0,a.jsx)("div",{className:n.tkx("px-3 py-1 text-[11px] font-semibold uppercase tracking-wider"),style:{color:o.textMuted,borderBottom:`1px solid ${o.border}`,backgroundColor:o.surface},children:i}),(0,a.jsx)("pre",{className:n.tkx("m-0 p-4 overflow-x-auto"),style:{fontFamily:"'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace",fontSize:"0.85rem",lineHeight:1.6,color:o.text,tabSize:2},children:(0,a.jsx)("code",{"aria-label":i?`Code block in ${i}`:"Code block",children:r})})]})},list:function({block:e}){const o=t.useTheme(),r=e.ordered?"ol":"ul",i=(e.items??[]).map(e=>n.sanitizeString(e));return(0,a.jsx)(r,{className:n.tkx("m-0"),style:{paddingLeft:24,marginTop:8,marginBottom:12,color:o.text,fontSize:"0.938rem",lineHeight:1.7,listStyleType:e.ordered?"decimal":"disc"},role:"list",children:i.map((e,t)=>(0,a.jsx)("li",{role:"listitem",style:{marginBottom:4},children:e},t))})},divider:function(){return(0,a.jsx)("hr",{"aria-hidden":"true",style:{border:"none",borderTop:`1px solid ${t.useTheme().border}`,marginTop:20,marginBottom:20}})},image:function({block:e}){const o=t.useTheme(),r=n.sanitizeString(e.src??""),i=n.sanitizeString(e.alt??"Image");return(0,a.jsxs)("figure",{className:n.tkx("m-0"),style:{marginTop:12,marginBottom:12},children:[(0,a.jsx)("img",{src:r,alt:i,loading:"lazy",className:n.tkx("rounded-lg"),style:{maxWidth:"100%",height:"auto",display:"block",border:`1px solid ${o.border}`}}),e.alt&&(0,a.jsx)("figcaption",{className:n.tkx("text-xs mt-2 text-center"),style:{color:o.textMuted},children:i})]})},callout:function({block:e}){const o=t.useTheme(),r=e.variant??"info",i=n.sanitizeString(e.content??""),l={info:o.info,warning:o.warning,success:o.success,danger:o.danger}[r],s=Rn[r];return(0,a.jsxs)("div",{role:{info:"note",warning:"alert",success:"status",danger:"alert"}[r],className:n.tkx("flex gap-3 px-4 py-3 rounded-lg"),style:{backgroundColor:`${l}12`,border:`1px solid ${l}33`,marginTop:12,marginBottom:12},children:[(0,a.jsx)("span",{className:n.tkx("shrink-0 mt-[2px]"),style:{color:l},children:s}),(0,a.jsx)("div",{className:n.tkx("flex-1"),style:{fontSize:"0.9rem",lineHeight:1.6,color:o.text},children:i})]})}};function An(e){const t=[];let n=0,o="";const r=()=>{o&&(t.push({kind:"text",value:o}),o="")};for(;n<e.length;){const i=e[n];if("\\"===i&&n+1<e.length)o+=e[n+1],n+=2;else{if("!"===i&&"["===e[n+1]){const o=e.indexOf("]",n+2);if(-1!==o&&"("===e[o+1]){const i=e.indexOf(")",o+2);if(-1!==i){r(),t.push({kind:"image",alt:e.slice(n+2,o),src:e.slice(o+2,i)}),n=i+1;continue}}}if("["===i){const o=Fn(e,n,"[","]");if(-1!==o&&"("===e[o+1]){const i=e.indexOf(")",o+2);if(-1!==i){r(),t.push({kind:"link",href:e.slice(o+2,i).trim(),children:An(e.slice(n+1,o))}),n=i+1;continue}}}if("<"===i){const o=e.indexOf(">",n+1);if(-1!==o){const i=e.slice(n+1,o);if(/^(https?:\/\/|mailto:)/i.test(i)||/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i)){r();const e=/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i)?`mailto:${i}`:i;t.push({kind:"link",href:e,children:[{kind:"text",value:i}]}),n=o+1;continue}}}if("`"===i){const o=e.indexOf("`",n+1);if(-1!==o){r(),t.push({kind:"code",value:e.slice(n+1,o)}),n=o+1;continue}}if("~"===i&&"~"===e[n+1]){const o=e.indexOf("~~",n+2);if(-1!==o){r(),t.push({kind:"strike",children:An(e.slice(n+2,o))}),n=o+2;continue}}if("*"===i&&"*"===e[n+1]||"_"===i&&"_"===e[n+1]){const o=i+i,l=e.indexOf(o,n+2);if(-1!==l){r(),t.push({kind:"bold",children:An(e.slice(n+2,l))}),n=l+2;continue}}if(("*"===i||"_"===i)&&e[n+1]!==i){const o=e.indexOf(i,n+1);if(-1!==o&&e.slice(n+1,o).trim().length>0){r(),t.push({kind:"italic",children:An(e.slice(n+1,o))}),n=o+1;continue}}o+=i,n++}}return r(),t}function Fn(e,t,n,o){let r=0;for(let i=t;i<e.length;i++)if("\\"!==e[i]){if(e[i]===n)r++;else if(e[i]===o&&(r--,0===r))return i}else i++;return-1}function Hn(e){const t=e.replace(/^\uFEFF/,"").replace(/\r\n?/g,"\n").split("\n"),n=[];let o=0;for(;o<t.length;){const e=t[o];if(/^\s*$/.test(e)){o++;continue}const r=e.match(/^\s*```(.*)$/);if(r){const e=r[1].trim();o++;const i=[];for(;o<t.length&&!/^\s*```\s*$/.test(t[o]);)i.push(t[o]),o++;o<t.length&&o++,n.push({kind:"code",language:e,value:i.join("\n")});continue}const i=e.match(/^(#{1,6})\s+(.*?)\s*#*\s*$/);if(i){n.push({kind:"heading",level:i[1].length,inline:An(i[2])}),o++;continue}if(/^\s*([-*_])\s*(?:\1\s*){2,}$/.test(e)){n.push({kind:"hr"}),o++;continue}if(On(e)&&o+1<t.length&&Pn(t[o+1])){const r=Vn(e).map(An),i=Yn(t[o+1]);o+=2;const l=[];for(;o<t.length&&On(t[o]);)l.push(Vn(t[o]).map(An)),o++;n.push({kind:"table",headers:r,rows:l,align:i});continue}if(/^\s*>/.test(e)){const e=[];for(;o<t.length&&/^\s*>/.test(t[o]);)e.push(t[o].replace(/^\s*>\s?/,"")),o++;n.push({kind:"blockquote",children:Hn(e.join("\n"))});continue}if(En(e)){const[e,r]=jn(t,o);n.push(e),o=r;continue}const l=[e];for(o++;o<t.length&&!/^\s*$/.test(t[o])&&!/^#{1,6}\s/.test(t[o])&&!/^\s*```/.test(t[o])&&!/^\s*>/.test(t[o])&&!En(t[o])&&!/^\s*([-*_])\s*(?:\1\s*){2,}$/.test(t[o]);)l.push(t[o]),o++;n.push({kind:"paragraph",inline:An(l.join(" "))})}return n}function En(e){return/^(\s*)([-*+]|\d+[.)])\s+/.test(e)}function jn(e,t){const n=e[t].match(/^(\s*)([-*+]|\d+[.)])\s+/),o=n[1].length,r=/\d/.test(n[2]),i=[];let l=t;for(;l<e.length;){const t=e[l].match(/^(\s*)([-*+]|\d+[.)])\s+(.*)$/);if(!t||t[1].length!==o)break;const n=t[3];let r=null,a=n;const s=n.match(/^\[([ xX])\]\s+(.*)$/);s&&(r="x"===s[1].toLowerCase()?"checked":"unchecked",a=s[2]);const d=[a];for(l++;l<e.length;){if(/^\s*$/.test(e[l])){if(l+1<e.length&&/^\s+\S/.test(e[l+1])){d.push(""),l++;continue}break}const t=e[l].match(/^(\s*)(\S)/);if(!(t&&t[1].length>o))break;d.push(e[l].slice(o+2)),l++}i.push({blocks:Hn(d.join("\n")),task:r})}return[{kind:"list",ordered:r,items:i},l]}function On(e){return/^\s*\|.+\|\s*$/.test(e.trim())||e.includes("|")&&e.trim().startsWith("|")}function Pn(e){return/^\s*\|?\s*:?-{2,}:?\s*(\|\s*:?-{2,}:?\s*)+\|?\s*$/.test(e)}function Vn(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(e=>e.trim())}function Yn(e){return Vn(e).map(e=>{const t=e.startsWith(":"),n=e.endsWith(":");return t&&n?"center":n?"right":t?"left":null})}function Un(e,t,o="i"){return e.map((e,r)=>{const i=`${o}-${r}`;switch(e.kind){case"text":return(0,a.jsx)("span",{children:n.sanitizeString(e.value)},i);case"bold":return(0,a.jsx)("strong",{children:Un(e.children,t,i)},i);case"italic":return(0,a.jsx)("em",{children:Un(e.children,t,i)},i);case"strike":return(0,a.jsx)("s",{children:Un(e.children,t,i)},i);case"code":return(0,a.jsx)("code",{style:{background:t.theme.surfaceAlt,border:`1px solid ${t.theme.border}`,borderRadius:4,padding:"0.15em 0.4em",fontSize:"0.9em",fontFamily:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",wordBreak:"break-word"},children:n.sanitizeString(e.value)},i);case"link":{const n=Kn(e.href);if(!n)return(0,a.jsx)("span",{children:Un(e.children,t,i)},i);const o=/^(https?:)?\/\//i.test(n)||n.startsWith("mailto:");return(0,a.jsx)("a",{href:n,target:o?t.externalLinkTarget:void 0,rel:o?t.externalLinkRel:void 0,onClick:e=>{!1===t.onLinkClick?.(n,e)&&e.preventDefault()},style:{color:t.theme.primary,textDecoration:"underline",wordBreak:"break-word"},children:Un(e.children,t,i)},i)}case"image":return(0,a.jsx)("img",{src:Kn(e.src)||"",alt:n.sanitizeString(e.alt),loading:"lazy",decoding:"async",style:{maxWidth:"100%",height:"auto",borderRadius:6,display:"inline-block"}},i)}})}function Kn(e){const t=e.trim();return t?/^javascript:/i.test(t)||/^data:/i.test(t)&&!/^data:image\//i.test(t)||/^vbscript:/i.test(t)?null:t:null}function Xn({text:e,theme:t}){const[n,o]=(0,l.useState)(!1);return(0,a.jsx)("button",{type:"button",onClick:()=>{"undefined"!=typeof navigator&&navigator.clipboard&&navigator.clipboard.writeText(e).then(()=>{o(!0),setTimeout(()=>o(!1),1500)})},"aria-label":n?"Copied to clipboard":"Copy code",style:{position:"absolute",top:6,right:6,padding:"2px 8px",fontSize:11,background:t.surface,color:n?t.success:t.textMuted,border:`1px solid ${t.border}`,borderRadius:4,cursor:"pointer",fontFamily:"inherit",transition:"color 120ms"},children:n?"Copied":"Copy"})}function qn(e,t,o="b"){return e.map((e,r)=>{const i=`${o}-${r}`;switch(e.kind){case"heading":{const n=`h${e.level}`,o={1:{fs:t.compact?"1.75rem":"2rem",lh:"1.2",mt:"0.6em",mb:"0.5em",fw:700},2:{fs:t.compact?"1.4rem":"1.6rem",lh:"1.25",mt:"1em",mb:"0.5em",fw:700},3:{fs:t.compact?"1.2rem":"1.3rem",lh:"1.3",mt:"1em",mb:"0.4em",fw:600},4:{fs:"1.1rem",lh:"1.35",mt:"1em",mb:"0.4em",fw:600},5:{fs:"1rem",lh:"1.4",mt:"1em",mb:"0.3em",fw:600},6:{fs:"0.9rem",lh:"1.4",mt:"1em",mb:"0.3em",fw:600}}[e.level];return(0,a.jsx)(n,{style:{fontSize:o.fs,lineHeight:o.lh,marginTop:o.mt,marginBottom:o.mb,fontWeight:o.fw,color:t.theme.text,scrollMarginTop:"1em"},children:Un(e.inline,t,i)},i)}case"paragraph":return(0,a.jsx)("p",{style:{margin:"0 0 "+(t.compact?"0.7em":"1em"),lineHeight:1.65,color:t.theme.text,wordBreak:"break-word"},children:Un(e.inline,t,i)},i);case"blockquote":return(0,a.jsx)("blockquote",{style:{margin:"0 0 1em",padding:"0.5em 1em",borderLeft:`4px solid ${t.theme.primary}`,background:`${t.theme.surfaceAlt}`,color:t.theme.textMuted,borderRadius:"0 6px 6px 0"},children:qn(e.children,t,i)},i);case"code":{const o=e.value;return(0,a.jsxs)("div",{style:{position:"relative",margin:"0 0 1em",border:`1px solid ${t.theme.border}`,borderRadius:8,background:t.theme.surfaceAlt,overflow:"hidden"},children:[e.language&&(0,a.jsx)("div",{style:{padding:"4px 10px",fontSize:11,color:t.theme.textMuted,borderBottom:`1px solid ${t.theme.border}`,textTransform:"uppercase",letterSpacing:"0.05em"},children:n.sanitizeString(e.language)}),t.copyableCode&&(0,a.jsx)(Xn,{text:o,theme:t.theme}),(0,a.jsx)("pre",{style:{margin:0,padding:12,overflowX:"auto",fontSize:13,lineHeight:1.55,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",color:t.theme.text,whiteSpace:"pre"},children:(0,a.jsx)("code",{children:n.sanitizeString(o)})})]},i)}case"list":return(0,a.jsx)(e.ordered?"ol":"ul",{style:{margin:"0 0 1em",paddingLeft:"1.5em",color:t.theme.text,lineHeight:1.65},children:e.items.map((e,n)=>(0,a.jsxs)("li",{style:{listStyle:null!==e.task?"none":void 0,marginLeft:null!==e.task?"-1.25em":void 0},children:[null!==e.task&&(0,a.jsx)("input",{type:"checkbox",disabled:!0,checked:"checked"===e.task,readOnly:!0,style:{marginRight:6,verticalAlign:"middle"},"aria-label":"checked"===e.task?"Completed task":"Uncompleted task"}),qn(e.blocks,t,`${i}-${n}`)]},`${i}-${n}`))},i);case"hr":return(0,a.jsx)("hr",{style:{border:"none",borderTop:`1px solid ${t.theme.border}`,margin:"1.5em 0"}},i);case"table":return(0,a.jsx)("div",{style:{overflowX:"auto",margin:"0 0 1em",border:`1px solid ${t.theme.border}`,borderRadius:6,WebkitOverflowScrolling:"touch"},children:(0,a.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:14,color:t.theme.text},children:[(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{children:e.headers.map((n,o)=>(0,a.jsx)("th",{style:{padding:"8px 12px",textAlign:e.align[o]??"left",borderBottom:`2px solid ${t.theme.border}`,background:t.theme.surfaceAlt,fontWeight:600},children:Un(n,t,`${i}-h-${o}`)},o))})}),(0,a.jsx)("tbody",{children:e.rows.map((n,o)=>(0,a.jsx)("tr",{children:n.map((n,r)=>(0,a.jsx)("td",{style:{padding:"8px 12px",textAlign:e.align[r]??"left",borderBottom:`1px solid ${t.theme.border}`},children:Un(n,t,`${i}-r-${o}-${r}`)},r))},o))})]})},i)}})}function Gn({source:e,src:o,maxWidth:r="100%",compact:i=!1,copyableCode:s=!0,onLinkClick:d,externalLinkRel:c="noopener noreferrer",externalLinkTarget:u="_blank",loadingFallback:p,errorFallback:h,className:f,style:m}){const x=t.useTheme(),[g,b]=(0,l.useState)({text:null,error:null,loading:!!o&&void 0===e}),y=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(void 0!==e||!o)return;y.current?.abort();const t=new AbortController;return y.current=t,b({text:null,error:null,loading:!0}),fetch(o,{signal:t.signal}).then(async e=>{if(!e.ok)throw new Error(`Failed to load markdown (HTTP ${e.status})`);b({text:await e.text(),error:null,loading:!1})}).catch(e=>{"AbortError"!==e.name&&b({text:null,error:e.message,loading:!1})}),()=>t.abort()},[o,e]);const v=e??g.text??"",w=(0,l.useMemo)(()=>v?Hn(v):[],[v]),k={theme:x,compact:i,copyableCode:s,externalLinkRel:c,externalLinkTarget:u,onLinkClick:d},C={maxWidth:r,width:"100%",color:x.text,fontFamily:"inherit",fontSize:i?14:15,lineHeight:1.65,wordBreak:"break-word",overflowWrap:"anywhere",boxSizing:"border-box",...m};if(void 0===e&&o){if(g.loading)return(0,a.jsx)("div",{className:f,style:C,"aria-busy":"true","aria-live":"polite",children:p??(0,a.jsx)("span",{style:{color:x.textMuted},children:"Loading…"})});if(g.error)return(0,a.jsx)("div",{className:f,style:C,role:"alert",children:h?h(g.error):(0,a.jsx)("span",{style:{color:x.danger},children:n.sanitizeString(g.error)})})}return(0,a.jsx)("div",{className:f,style:C,children:qn(w,k)})}Gn.displayName="TkxMarkdown";var Zn={sm:576,md:768,lg:992,xl:1200};function _n(e){return"number"==typeof e?`${e}px`:e}var Jn=(0,l.createContext)({h:0,v:0}),Qn=(0,l.forwardRef)(({children:e,hasSider:o=!1,className:r,style:i,...l},s)=>{const d=t.useTheme(),c=n.tkx("flex min-h-0 w-full font-sans"),u=o?{flexDirection:"row"}:{flexDirection:"column"};return(0,a.jsx)("section",{ref:s,className:n.cx("tkx-layout",c,r),style:{minHeight:"100%",color:d.text,backgroundColor:d.bg,...u,...i},...l,children:e})});Qn.displayName="TkxLayout";var eo=(0,l.forwardRef)(({children:e,height:o=64,fixed:r=!1,className:i,style:l,...s},d)=>{const c=t.useTheme(),u=_n(o),p=n.tkx("flex items-center px-6 shrink-0 w-full"),h=r?{position:"fixed",top:0,left:0,right:0,zIndex:1e3}:{};return(0,a.jsx)("header",{ref:d,className:n.cx("tkx-layout-header",p,i),style:{height:u,minHeight:u,backgroundColor:c.surface,borderBottom:`1px solid ${c.border}`,...h,...l},...s,children:e})});function to({collapsed:e,onClick:t,color:r}){const i=o.useReducedMotion();return(0,a.jsx)("button",{type:"button","aria-label":e?"Expand sidebar":"Collapse sidebar",onClick:t,className:n.tkx("flex items-center justify-center w-full py-3 cursor-pointer","border-0 bg-transparent"),style:{color:r},children:(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",style:{transform:e?"rotate(0deg)":"rotate(180deg)",transition:i?"none":"transform 200ms ease"},"aria-hidden":"true",children:(0,a.jsx)("path",{d:"M6 3l5 5-5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}eo.displayName="TkxHeader";var no=(0,l.forwardRef)(({children:e,width:r=240,collapsedWidth:i=64,collapsed:s,onCollapse:d,collapsible:c=!1,breakpoint:u,trigger:p,className:h,style:f,...m},x)=>{const g=t.useTheme(),b=o.useReducedMotion(),[y,v]=(0,l.useState)(!1),w=s??y,k=(0,l.useCallback)(e=>{void 0===s&&v(e),d?.(e)},[s,d]);(0,l.useEffect)(()=>{if(!u)return;const e=Zn[u];if(!e)return;const t=window.matchMedia(`(max-width: ${e-1}px)`),n=e=>{k(e.matches)};return k(t.matches),t.addEventListener("change",n),()=>t.removeEventListener("change",n)},[u,k]);const C=_n(r),S=w?`${i}px`:C,$=c&&null!==p,z=b?"none":"width 200ms ease, min-width 200ms ease, max-width 200ms ease";return(0,a.jsxs)("aside",{ref:x,className:n.cx("tkx-layout-sider",n.tkx("shrink-0 overflow-hidden flex flex-col"),h),style:{width:S,minWidth:S,maxWidth:S,backgroundColor:g.surface,borderRight:`1px solid ${g.border}`,transition:z,...f},...m,children:[(0,a.jsx)("div",{className:n.tkx("flex-1 overflow-y-auto overflow-x-hidden"),style:{width:S,transition:z},children:e}),$&&(0,a.jsx)("div",{className:n.tkx("shrink-0"),style:{borderTop:`1px solid ${g.border}`},children:void 0!==p?p:(0,a.jsx)(to,{collapsed:w,onClick:()=>k(!w),color:g.textMuted})})]})});no.displayName="TkxSider";var oo=(0,l.forwardRef)(({children:e,className:o,style:r,...i},l)=>{const s=t.useTheme();return(0,a.jsx)("main",{ref:l,className:n.cx("tkx-layout-content",n.tkx("flex-1 min-w-0 min-h-0"),o),style:{backgroundColor:s.bg,padding:"24px",...r},...i,children:e})});oo.displayName="TkxContent";var ro=(0,l.forwardRef)(({children:e,className:o,style:r,...i},l)=>{const s=t.useTheme();return(0,a.jsx)("footer",{ref:l,className:n.cx("tkx-layout-footer",n.tkx("flex items-center px-6 py-4 shrink-0"),o),style:{backgroundColor:s.surface,borderTop:`1px solid ${s.border}`,color:s.textMuted,...r},...i,children:e})});ro.displayName="TkxFooter";var io={start:"flex-start",center:"center",end:"flex-end","space-between":"space-between","space-around":"space-around","space-evenly":"space-evenly"},lo={top:"flex-start",middle:"center",bottom:"flex-end",stretch:"stretch"},ao=(0,l.forwardRef)(({children:e,gutter:t,justify:o="start",align:r="top",wrap:i=!0,className:l,style:s,...d},c)=>{const[u,p]=Array.isArray(t)?t:[t??0,0],h=u/2,f=p/2,m=u||p?{marginLeft:-h,marginRight:-h,marginTop:-f,marginBottom:-f}:{},x={h,v:f};return(0,a.jsx)(Jn.Provider,{value:x,children:(0,a.jsx)("div",{ref:c,className:n.cx("tkx-row",n.tkx("flex w-full"),l),style:{flexWrap:i?"wrap":"nowrap",justifyContent:io[o]??"flex-start",alignItems:lo[r]??"flex-start",...m,...s},...d,children:e})})});ao.displayName="TkxRow";var so=!1;function co(e){if(void 0!==e)return"number"==typeof e?{span:e}:e}var uo=(0,l.forwardRef)(({children:e,span:t,offset:o=0,push:r,pull:i,order:s,sm:d,md:c,lg:u,xl:p,className:h,style:f,...m},x)=>{(0,l.useEffect)(()=>{!function(){if(so||"undefined"==typeof document)return;so=!0;const e=[];for(const[n,o]of Object.entries(Zn)){for(let t=1;t<=24;t++){const r=t/24*100+"%";e.push(`@media (min-width: ${o}px) { .tkx-col-${n}-${t} { flex: 0 0 ${r} !important; max-width: ${r} !important; } }`)}for(let t=0;t<=24;t++){const r=t/24*100+"%";e.push(`@media (min-width: ${o}px) { .tkx-col-${n}-offset-${t} { margin-left: ${r} !important; } }`)}}const t=document.createElement("style");t.id="tkx-col-responsive",t.textContent=e.join("\n"),document.head.appendChild(t)}()},[]);const g=(0,l.useContext)(Jn),b=void 0!==t?t/24*100+"%":void 0,y=o?o/24*100+"%":void 0,v=[],w=[["sm",d],["md",c],["lg",u],["xl",p]];for(const[n,l]of w){const e=co(l);e&&(v.push(`tkx-col-${n}-${e.span}`),void 0!==e.offset&&e.offset>0&&v.push(`tkx-col-${n}-offset-${e.offset}`))}const k={};return void 0!==r&&(k.left=r/24*100+"%",k.position="relative"),void 0!==i&&(k.right=i/24*100+"%",k.position="relative"),void 0!==s&&(k.order=s),(0,a.jsx)("div",{ref:x,className:n.cx("tkx-col",n.tkx("box-border min-h-[1px]"),...v,h),style:{flex:b?`0 0 ${b}`:"1",maxWidth:b??"100%",marginLeft:y,paddingLeft:g.h||void 0,paddingRight:g.h||void 0,paddingTop:g.v||void 0,paddingBottom:g.v||void 0,...k,...f},...m,children:e})});uo.displayName="TkxCol";var po=(0,l.createContext)({locale:"en-US",direction:"ltr",componentDefaults:{size:"md",variant:"default",animation:!0,bordered:!0},componentOverrides:{},prefixCls:"tkx",configured:!1,cls:e=>`tkx-${e}`,getSize:()=>"md",getAnimation:()=>!0,getBordered:()=>!0});function ho({children:e,locale:t,direction:n,componentDefaults:o,componentOverrides:r,prefixCls:i}){const s=(0,l.useContext)(po),d=(0,l.useMemo)(()=>({size:o?.size??s.componentDefaults.size,variant:o?.variant??s.componentDefaults.variant,animation:o?.animation??s.componentDefaults.animation,bordered:o?.bordered??s.componentDefaults.bordered}),[o,s.componentDefaults]),c=(0,l.useMemo)(()=>{const e=s.componentOverrides,t=r??{};return{button:{...e.button,...t.button},input:{...e.input,...t.input},table:{...e.table,...t.table},modal:{...e.modal,...t.modal}}},[r,s.componentOverrides]),u=t??s.locale,p=n??s.direction,h=i??s.prefixCls,f=(0,l.useCallback)(e=>`${h}-${e}`,[h]),m=(0,l.useCallback)((e,t)=>{if(void 0!==t)return t;if(e){const t=c[e];if(t?.size)return t.size}return d.size},[d.size,c]),x=(0,l.useCallback)(e=>void 0!==e?e:d.animation,[d.animation]),g=(0,l.useCallback)((e,t)=>{if(void 0!==t)return t;if(e){const t=c[e];if(void 0!==t?.bordered)return t.bordered}return d.bordered},[d.bordered,c]),b=(0,l.useMemo)(()=>({locale:u,direction:p,componentDefaults:d,componentOverrides:c,prefixCls:h,configured:!0,cls:f,getSize:m,getAnimation:x,getBordered:g}),[u,p,d,c,h,f,m,x,g]);return(0,a.jsx)(po.Provider,{value:b,children:(0,a.jsx)("div",{dir:p,lang:u,className:`${h}-config-root`,style:{direction:p},children:e})})}function fo(){return(0,l.useContext)(po)}ho.displayName="TkxConfigProvider";var mo={"en-US":"English (US)","en-GB":"English (UK)","es-ES":"Spanish","fr-FR":"French","de-DE":"German","ja-JP":"Japanese","ko-KR":"Korean","zh-CN":"Chinese (Simplified)","zh-TW":"Chinese (Traditional)","pt-BR":"Portuguese (Brazil)","ar-SA":"Arabic","hi-IN":"Hindi","ru-RU":"Russian","it-IT":"Italian","nl-NL":"Dutch","sv-SE":"Swedish","pl-PL":"Polish","tr-TR":"Turkish","th-TH":"Thai","vi-VN":"Vietnamese"},xo=new Set(["ar","ar-SA","ar-EG","ar-AE","he","he-IL","fa","fa-IR","ur","ur-PK","ps","ps-AF"]);function go(e){return"string"==typeof e?e:"number"==typeof e?String(e):Array.isArray(e)?e.map(go).join(""):e&&"object"==typeof e&&"props"in e?go(e.props.children):""}function bo({text:e}){const n=t.useTheme(),[o,r]=(0,l.useState)(!1);return(0,l.createElement)("button",{type:"button",onClick:(0,l.useCallback)(()=>{navigator.clipboard.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)})},[e]),"aria-label":o?"Copied":"Copy to clipboard",style:{display:"inline-flex",alignItems:"center",marginLeft:"4px",padding:"2px 6px",border:"none",background:"transparent",color:o?n.success:n.textMuted,cursor:"pointer",fontSize:"0.8em",borderRadius:"4px",transition:"color 0.2s"}},o?"Copied!":"⎘")}function yo(e="default"){const n=t.useTheme();return{default:n.text,secondary:n.textMuted,success:n.success,warning:n.warning,danger:n.danger}[e]}var vo={1:{fontSize:"2.25rem",lineHeight:"1.2",fontWeight:700},2:{fontSize:"1.875rem",lineHeight:"1.25",fontWeight:700},3:{fontSize:"1.5rem",lineHeight:"1.3",fontWeight:600},4:{fontSize:"1.25rem",lineHeight:"1.35",fontWeight:600},5:{fontSize:"1rem",lineHeight:"1.4",fontWeight:600}},wo={sm:{dimension:20,borderWidth:2,fontSize:"0.75rem"},md:{dimension:32,borderWidth:3,fontSize:"0.875rem"},lg:{dimension:48,borderWidth:4,fontSize:"1rem"}},ko=!1;function Co({size:e,color:t}){return(0,l.createElement)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",role:"img","aria-label":"Loading"},(0,l.createElement)("circle",{cx:12,cy:12,r:10,stroke:`${t}33`,strokeWidth:2.5,fill:"none"}),(0,l.createElement)("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:t,strokeWidth:2.5,strokeLinecap:"round",fill:"none"}))}function So({size:e,borderWidth:t,color:n,reducedMotion:o}){return o?(0,l.createElement)(Co,{size:e,color:n}):(function(){if(ko||"undefined"==typeof document)return;ko=!0;const e=document.createElement("style");e.id="tkx-spin-styles",e.textContent="\n @keyframes tkx-spin-rotate {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n ",document.head.appendChild(e)}(),(0,l.createElement)("div",{role:"img","aria-label":"Loading",style:{width:`${e}px`,height:`${e}px`,border:`${t}px solid ${n}33`,borderTopColor:n,borderRadius:"50%",animation:"tkx-spin-rotate 0.8s linear infinite",boxSizing:"border-box"}}))}function $o({color:e,mutedColor:t}){return(0,l.createElement)("svg",{width:120,height:100,viewBox:"0 0 120 100",fill:"none","aria-hidden":"true"},(0,l.createElement)("path",{d:"M20 40 L60 20 L100 40 L60 60 Z",fill:`${t}18`,stroke:t,strokeWidth:1.5,strokeLinejoin:"round"}),(0,l.createElement)("path",{d:"M20 40 L20 65 L60 85 L60 60 Z",fill:`${t}10`,stroke:t,strokeWidth:1.5,strokeLinejoin:"round"}),(0,l.createElement)("path",{d:"M100 40 L100 65 L60 85 L60 60 Z",fill:`${t}0d`,stroke:t,strokeWidth:1.5,strokeLinejoin:"round"}),(0,l.createElement)("path",{d:"M20 40 L40 28 L60 40 L40 52 Z",fill:`${e}15`,stroke:e,strokeWidth:1,strokeLinejoin:"round",strokeDasharray:"3 2"}),(0,l.createElement)("path",{d:"M60 40 L80 28 L100 40 L80 52 Z",fill:`${e}15`,stroke:e,strokeWidth:1,strokeLinejoin:"round",strokeDasharray:"3 2"}))}function zo({mutedColor:e}){return(0,l.createElement)("svg",{width:64,height:64,viewBox:"0 0 64 64",fill:"none","aria-hidden":"true"},(0,l.createElement)("rect",{x:16,y:8,width:32,height:40,rx:3,fill:`${e}12`,stroke:e,strokeWidth:1.5}),(0,l.createElement)("line",{x1:24,y1:20,x2:40,y2:20,stroke:e,strokeWidth:1.5,strokeLinecap:"round"}),(0,l.createElement)("line",{x1:24,y1:28,x2:36,y2:28,stroke:e,strokeWidth:1.5,strokeLinecap:"round"}),(0,l.createElement)("line",{x1:24,y1:36,x2:32,y2:36,stroke:e,strokeWidth:1.5,strokeLinecap:"round"}),(0,l.createElement)("circle",{cx:32,cy:54,r:6,stroke:e,strokeWidth:1.2,fill:"none"}),(0,l.createElement)("line",{x1:28,y1:54,x2:36,y2:54,stroke:e,strokeWidth:1.2,strokeLinecap:"round"}))}function No({direction:e,color:t}){return(0,l.createElement)("svg",{width:16,height:14,viewBox:"0 0 20 14",fill:"none","aria-hidden":"true",style:{display:"inline-block",verticalAlign:"middle"}},(0,l.createElement)("path",{d:"up"===e?"M6 10 L10 4 L14 10":"M6 4 L10 10 L14 4",stroke:t,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}))}var Mo=!1;function Io({w:e,h:t,alt:n,bdr:o,rm:r}){return r||function(){if(Mo||"undefined"==typeof document)return;Mo=!0;const e=document.createElement("style");e.id="tkx-statistic-skeleton",e.textContent="@keyframes tkx-stat-shimmer{0%{background-position:-200% 0}100%{background-position:200% 0}}",document.head.appendChild(e)}(),(0,l.createElement)("div",{"aria-hidden":"true",style:{width:e,height:t,borderRadius:"4px",background:r?n:`linear-gradient(90deg, ${n} 25%, ${o} 50%, ${n} 75%)`,backgroundSize:"200% 100%",animation:r?"none":"tkx-stat-shimmer 1.5s ease-in-out infinite"}})}var Lo={sm:{height:28,fontSize:12,px:10},md:{height:36,fontSize:14,px:16},lg:{height:44,fontSize:16,px:20}},Wo={L:.38,M:.42,Q:.48,H:.55},Do={success:e=>(0,a.jsxs)("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),(0,a.jsx)("path",{d:"M22 37l9 9 19-19",stroke:e,strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]}),error:e=>(0,a.jsxs)("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),(0,a.jsx)("path",{d:"M26 26l20 20M46 26L26 46",stroke:e,strokeWidth:"4",strokeLinecap:"round"})]}),warning:e=>(0,a.jsxs)("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M36 6L4 64h64L36 6z",stroke:e,strokeWidth:"3",fill:`${e}18`}),(0,a.jsx)("path",{d:"M36 30v16",stroke:e,strokeWidth:"4",strokeLinecap:"round"}),(0,a.jsx)("circle",{cx:"36",cy:"54",r:"2.5",fill:e})]}),info:e=>(0,a.jsxs)("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),(0,a.jsx)("path",{d:"M36 32v18",stroke:e,strokeWidth:"4",strokeLinecap:"round"}),(0,a.jsx)("circle",{cx:"36",cy:"22",r:"2.5",fill:e})]}),404:e=>(0,a.jsxs)("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),(0,a.jsx)("text",{x:"36",y:"44",textAnchor:"middle",fontSize:"22",fontWeight:"bold",fill:e,children:"404"})]}),403:e=>(0,a.jsxs)("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),(0,a.jsx)("path",{d:"M28 30h16v16H28z",stroke:e,strokeWidth:"3",fill:"none"}),(0,a.jsx)("path",{d:"M32 30v-4a4 4 0 018 0v4",stroke:e,strokeWidth:"3",fill:"none"})]}),500:e=>(0,a.jsxs)("svg",{width:"72",height:"72",viewBox:"0 0 72 72",fill:"none","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"36",cy:"36",r:"34",stroke:e,strokeWidth:"3",fill:`${e}18`}),(0,a.jsx)("text",{x:"36",y:"44",textAnchor:"middle",fontSize:"22",fontWeight:"bold",fill:e,children:"500"})]})};function Ro(e){if(e)try{return e()}catch{return window}return window}function To(e){const t=[];for(const n of e)t.push(n),n.children&&t.push(...To(n.children));return t}function Bo(e){return e.startsWith("#")?e.slice(1):e}function Ao({item:e,activeKey:t,depth:o,onClick:r,theme:i,reducedMotion:l}){const s=e.key===t,d=n.sanitizeString(e.title);return(0,a.jsxs)("li",{role:"none",style:{listStyle:"none"},children:[(0,a.jsx)("a",{role:"treeitem","aria-current":s?"location":void 0,href:e.href,onClick:t=>{t.preventDefault(),r(e.href)},className:n.tkx("block text-sm py-1 no-underline"),style:{paddingLeft:12+16*o,color:s?i.primary:i.textMuted,fontWeight:s?600:400,borderLeft:`2px solid ${s?i.primary:"transparent"}`,transition:l?"none":"color 0.15s ease, border-color 0.15s ease"},children:d}),e.children&&e.children.length>0&&(0,a.jsx)("ul",{role:"group",style:{margin:0,padding:0},children:e.children.map(e=>(0,a.jsx)(Ao,{item:e,activeKey:t,depth:o+1,onClick:r,theme:i,reducedMotion:l},e.key))})]})}function Fo(e,t){const n=[];let o=e;for(const r of t){const e=o.find(e=>e.value===r);if(!e)break;n.push(e),o=e.children??[]}return n}var Ho={sm:"8px 12px",md:"12px 16px",lg:"16px 20px"};function Eo({theme:e,reducedMotion:t}){return(0,a.jsxs)("div",{className:n.tkx("flex items-center gap-3 px-4 py-3"),"aria-hidden":"true",children:[(0,a.jsx)("div",{style:{width:40,height:40,borderRadius:"50%",backgroundColor:e.surfaceAlt,animation:t?"none":"tkxPulse 1.5s ease infinite"}}),(0,a.jsxs)("div",{className:n.tkx("flex-1"),children:[(0,a.jsx)("div",{style:{width:"60%",height:14,borderRadius:4,backgroundColor:e.surfaceAlt,marginBottom:8,animation:t?"none":"tkxPulse 1.5s ease infinite"}}),(0,a.jsx)("div",{style:{width:"40%",height:12,borderRadius:4,backgroundColor:e.surfaceAlt,animation:t?"none":"tkxPulse 1.5s ease infinite"}})]})]})}function jo(e,t,n,o,r){if("vertical"===r){const r=e.x+n/2,i=e.y+o,l=t.x+n/2,a=t.y,s=(i+a)/2;return`M${r},${i} C${r},${s} ${l},${s} ${l},${a}`}const i=e.x+n,l=e.y+o/2,a=t.x,s=t.y+o/2,d=(i+a)/2;return`M${i},${l} C${d},${l} ${d},${s} ${a},${s}`}function Oo({node:e,w:t,h:o,isActive:r,theme:i}){const l=e.accent??i.primary,s=function(e){if(!e)return;const t=e.trim();return!t||/^javascript:/i.test(t)||/^vbscript:/i.test(t)||/^data:/i.test(t)&&!/^data:image\//i.test(t)?void 0:t}(e.avatar),d=n.sanitizeString(e.label),c=e.subLabel?n.sanitizeString(e.subLabel):"",u=e.badge?n.sanitizeString(e.badge):"";return(0,a.jsxs)("div",{style:{width:t,height:o,boxSizing:"border-box",background:i.surface,border:`1.5px solid ${r?l:i.border}`,borderRadius:12,padding:"10px 12px",display:"flex",alignItems:"center",gap:10,boxShadow:r?`0 8px 24px -8px ${l}66`:`0 2px 8px -4px ${i.border}88`,transition:"border-color 0.15s ease, box-shadow 0.15s ease",overflow:"hidden"},children:[(0,a.jsx)("div",{style:{width:40,height:40,minWidth:40,borderRadius:"50%",overflow:"hidden",background:`${l}22`,color:l,display:"flex",alignItems:"center",justifyContent:"center",fontSize:14,fontWeight:700,border:`1.5px solid ${l}44`},"aria-hidden":"true",children:s?(0,a.jsx)("img",{src:s,alt:"",loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",style:{width:"100%",height:"100%",objectFit:"cover"}}):d.slice(0,2).toUpperCase()}),(0,a.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,a.jsx)("div",{style:{fontSize:13.5,fontWeight:700,color:i.text,lineHeight:1.25,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:d}),c&&(0,a.jsx)("div",{style:{fontSize:11.5,color:i.textMuted,lineHeight:1.3,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginTop:1},children:c})]}),u&&(0,a.jsx)("span",{style:{fontSize:10,fontWeight:700,padding:"3px 7px",borderRadius:999,color:l,background:`${l}18`,border:`1px solid ${l}33`,letterSpacing:"0.04em",textTransform:"uppercase",flexShrink:0},children:u})]})}function Po({collapsed:e,onClick:t,theme:n,direction:o,w:r,h:i}){const l={position:"absolute",..."vertical"===o?{left:r/2-10,top:i-10}:{left:r-10,top:i/2-10},width:20,height:20,borderRadius:"50%",background:n.surfaceAlt,border:`1.5px solid ${n.border}`,color:n.text,fontSize:12,fontWeight:700,cursor:"pointer",padding:0,lineHeight:1,zIndex:2,display:"flex",alignItems:"center",justifyContent:"center"};return(0,a.jsx)("button",{type:"button","aria-label":e?"Expand subtree":"Collapse subtree","aria-expanded":!e,onClick:e=>{e.stopPropagation(),t(e)},onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.stopPropagation(),t(e))},style:l,children:e?"+":"−"})}function Vo({data:e,direction:o="vertical",interactive:r=!0,initialZoom:i=1,nodeWidth:s=200,nodeHeight:d=84,siblingGap:c=28,levelGap:u=64,onNodeClick:p,renderNode:h,collapsedByDefault:f=!1,height:m=560,ariaLabel:x="Organization chart",className:g,style:b}){const y=t.useTheme(),v=(0,l.useRef)(null),w=(0,l.useRef)(null),[k,C]=(0,l.useState)(()=>{if(!f)return new Set;const t=new Set;return function n(o){o.id!==e.id&&t.add(o.id),(o.children??[]).forEach(n)}(e),t}),[S,$]=(0,l.useState)(Yo(i)),[z,N]=(0,l.useState)({x:0,y:0}),[M,I]=(0,l.useState)(e.id),L=(0,l.useMemo)(()=>function(e,t,n){const{nodeWidth:o,nodeHeight:r,siblingGap:i,levelGap:l,direction:a}=n,s=[],d=function e(n,o,r){const i=t.has(n.id),l={id:n.id,node:n,x:0,y:0,depth:o,parent:r,children:[],collapsed:i};if(!i)for(const t of n.children??[])l.children.push(e(t,o+1,l));return s.push(l),l}(e,0,null);let c=0;!function e(t){if(0===t.children.length)return t.x=c,void(c+=o+i);t.children.forEach(e),t.x=(t.children[0].x+t.children[t.children.length-1].x)/2}(d);for(const m of s)m.y=m.depth*(r+l);if("horizontal"===a)for(const m of s){const e=m.x;m.x=m.y,m.y=e}let u=1/0,p=1/0,h=-1/0,f=-1/0;for(const m of s)m.x<u&&(u=m.x),m.y<p&&(p=m.y),m.x>h&&(h=m.x),m.y>f&&(f=m.y);Number.isFinite(u)||(u=0,p=0,h=0,f=0);for(const m of s)m.x-=u,m.y-=p;return{nodes:s,width:h-u+o,height:f-p+r}}(e,k,{nodeWidth:s,nodeHeight:d,siblingGap:c,levelGap:u,direction:o}),[e,k,s,d,c,u,o]),W=(0,l.useCallback)(e=>{C(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);(0,l.useEffect)(()=>{if(!r)return;const e=v.current;if(!e)return;const t=e=>{if(!e.ctrlKey&&!e.metaKey){if(Math.abs(e.deltaY)<4&&Math.abs(e.deltaX)<4)return;return N(t=>({x:t.x-e.deltaX,y:t.y-e.deltaY})),void e.preventDefault()}e.preventDefault();const t=e.deltaY<0?.1:-.1;$(e=>Yo(e+t))};return e.addEventListener("wheel",t,{passive:!1}),()=>e.removeEventListener("wheel",t)},[r]),(0,l.useEffect)(()=>{if(!r)return;const e=v.current;if(!e)return;let t=!1,n=0,o=0,i=0,l=0;const a=r=>{r.target.closest('button, [role="treeitem"], a, input')||(t=!0,n=r.clientX,o=r.clientY,i=z.x,l=z.y,e.setPointerCapture(r.pointerId))},s=e=>{t&&N({x:i+(e.clientX-n),y:l+(e.clientY-o)})},d=n=>{t=!1;try{e.releasePointerCapture(n.pointerId)}catch{}};return e.addEventListener("pointerdown",a),e.addEventListener("pointermove",s),e.addEventListener("pointerup",d),e.addEventListener("pointercancel",d),()=>{e.removeEventListener("pointerdown",a),e.removeEventListener("pointermove",s),e.removeEventListener("pointerup",d),e.removeEventListener("pointercancel",d)}},[r,z]);const D=(0,l.useCallback)(e=>{const t=L.nodes.find(e=>e.id===M);if(t)if("ArrowRight"===e.key||"ArrowDown"===e.key){const n=t.children[0];n&&(I(n.id),e.preventDefault())}else"ArrowLeft"===e.key||"ArrowUp"===e.key?t.parent&&(I(t.parent.id),e.preventDefault()):"Enter"===e.key||" "===e.key?(p?.(t.node),e.preventDefault()):"+"===e.key||"="===e.key?$(e=>Yo(e+.1)):"-"===e.key?$(e=>Yo(e-.1)):"0"===e.key&&($(1),N({x:0,y:0}))},[M,L,p]),R=(0,l.useMemo)(()=>{const e=[];for(const t of L.nodes)for(const n of t.children)e.push({id:`${t.id}→${n.id}`,d:jo(t,n,s,d,o)});return e},[L,s,d,o]),T={position:"relative",width:"100%",height:m,overflow:"hidden",borderRadius:12,background:y.bg,border:`1px solid ${y.border}`,touchAction:"none",cursor:r?"grab":"default",boxSizing:"border-box",...b},B={position:"absolute",left:"50%",top:24,width:L.width,height:L.height,transform:`translate(calc(-50% + ${z.x}px), ${z.y}px) scale(${S})`,transformOrigin:"top center",transition:"transform 0.08s ease-out"};return(0,a.jsxs)("div",{ref:v,className:g,style:T,role:"tree","aria-label":n.sanitizeString(x),tabIndex:0,onKeyDown:D,children:[r&&(0,a.jsxs)("div",{style:{position:"absolute",top:12,right:12,zIndex:3,display:"flex",gap:6,background:y.surface,border:`1px solid ${y.border}`,borderRadius:8,padding:4,boxShadow:`0 4px 12px -6px ${y.border}88`},children:[(0,a.jsx)(Uo,{theme:y,label:"Zoom out",onClick:()=>$(e=>Yo(e-.1)),children:"−"}),(0,a.jsx)(Uo,{theme:y,label:"Reset zoom",onClick:()=>{$(1),N({x:0,y:0})},children:"⟳"}),(0,a.jsx)(Uo,{theme:y,label:"Zoom in",onClick:()=>$(e=>Yo(e+.1)),children:"+"})]}),(0,a.jsxs)("div",{ref:w,style:B,children:[(0,a.jsx)("svg",{width:L.width,height:L.height,style:{position:"absolute",left:0,top:0,pointerEvents:"none"},"aria-hidden":"true",children:R.map(e=>(0,a.jsx)("path",{d:e.d,fill:"none",stroke:y.border,strokeWidth:1.5},e.id))}),L.nodes.map(e=>{const t=(e.node.children?.length??0)>0,r=e.id===M;return(0,a.jsxs)("div",{role:"treeitem","aria-label":n.sanitizeString(e.node.label),"aria-selected":r,"aria-level":e.depth+1,"aria-expanded":t?!e.collapsed:void 0,tabIndex:-1,onClick:t=>{t.stopPropagation(),I(e.id),p?.(e.node)},style:{position:"absolute",left:e.x,top:e.y,width:s,height:d,cursor:p?"pointer":"default"},children:[h?h(e.node,r):(0,a.jsx)(Oo,{node:e.node,w:s,h:d,isActive:r,theme:y}),t&&(0,a.jsx)(Po,{collapsed:e.collapsed,onClick:()=>W(e.id),theme:y,direction:o,w:s,h:d})]},e.id)})]})]})}function Yo(e){return e<.25?.25:e>4?4:e}function Uo({children:e,onClick:t,label:n,theme:o}){return(0,a.jsx)("button",{type:"button","aria-label":n,onClick:t,style:{width:28,height:28,borderRadius:6,background:"transparent",border:"none",color:o.text,fontSize:14,fontWeight:700,cursor:"pointer",padding:0,display:"flex",alignItems:"center",justifyContent:"center"},onMouseEnter:e=>{e.currentTarget.style.background=o.surfaceAlt},onMouseLeave:e=>{e.currentTarget.style.background="transparent"},children:e})}function Ko(e,t,n,o){const r=e.getBoundingClientRect(),i=t?t.offsetHeight:320,l=t?t.offsetWidth:200,a=window.innerWidth,s=window.innerHeight,d=window.scrollX,c=window.scrollY;let u=0,p=0;switch(n){case"bottom-start":default:u=r.bottom+c+o,p=r.left+d;break;case"bottom-end":u=r.bottom+c+o,p=r.right+d-l;break;case"top-start":u=r.top+c-o-i,p=r.left+d;break;case"top-end":u=r.top+c-o-i,p=r.right+d-l;break;case"right":u=r.top+c,p=r.right+d+o;break;case"left":u=r.top+c,p=r.left+d-o-l}return n.startsWith("bottom")&&r.bottom+i>s&&(u=r.top+c-o-i),n.startsWith("top")&&r.top-i<0&&(u=r.bottom+c+o),p+l>a+d&&(p=a+d-l-8),p<d&&(p=d+8),{top:u,left:p,minWidth:r.width}}function Xo(e,t){if(!t)return e;const n=e.toLowerCase().indexOf(t.toLowerCase());return-1===n?e:(0,a.jsxs)(a.Fragment,{children:[e.slice(0,n),(0,a.jsx)("mark",{style:{background:"rgba(0,245,212,0.3)",color:"inherit",borderRadius:2},children:e.slice(n,n+t.length)}),e.slice(n+t.length)]})}function qo({groups:e,position:o,maxHeight:r,minWidth:i,selectedKeys:s,multiSelect:d,searchable:c,searchPlaceholder:u,onSelect:p,onClose:h,renderItem:f,menuRef:m,isPortal:x,menuId:g}){const b=t.useTheme(),[y,v]=(0,l.useState)(""),[w,k]=(0,l.useState)(0),[C,S]=(0,l.useState)(null),[$,z]=(0,l.useState)(0),N=(0,l.useRef)(null),M=(0,l.useRef)([]),I=(0,l.useRef)([]),L=y?e.map(e=>({...e,items:e.items.filter(e=>e.label.toLowerCase().includes(y.toLowerCase())||e.description?.toLowerCase().includes(y.toLowerCase())||e.children?.some(e=>e.label.toLowerCase().includes(y.toLowerCase())))})).filter(e=>e.items.length>0):e,W=function(e,t){const n=[];for(const o of e)for(const e of o.items)e.disabled||t&&!e.label.toLowerCase().includes(t.toLowerCase())||n.push(e);return n}(L,y);(0,l.useEffect)(()=>{c&&N.current?N.current.focus():M.current[0]?.focus(),k(0)},[c]),(0,l.useEffect)(()=>{c&&""===y||M.current[w]?.focus()},[w,c,y]);const D=(0,l.useCallback)(e=>{switch(e.key){case"ArrowDown":if(e.preventDefault(),C){const e=(W.find(e=>e.key===C)?.children??[]).filter(e=>!e.disabled);z(t=>Math.min(t+1,e.length-1))}else k(e=>Math.min(e+1,W.length-1));break;case"ArrowUp":e.preventDefault(),C?z(e=>Math.max(e-1,0)):k(e=>Math.max(e-1,0));break;case"ArrowRight":{e.preventDefault();const t=W[w];t?.children?.length&&(S(t.key),z(0));break}case"ArrowLeft":e.preventDefault(),S(null);break;case"Enter":case" ":if(e.preventDefault(),C){const e=(W.find(e=>e.key===C)?.children??[]).filter(e=>!e.disabled)[$];e&&p(e.key,e)}else{const e=W[w];e&&p(e.key,e)}break;case"Escape":e.preventDefault(),C?S(null):h();break;case"Tab":h()}},[W,w,h,p,C,$]);(0,l.useEffect)(()=>{C&&I.current[$]?.focus()},[$,C]);const R={position:x?"fixed":"absolute",top:x?o.top:void 0,left:x?o.left:void 0,minWidth:Math.max(i,o.minWidth),maxHeight:r,overflowY:"auto",background:b.surface,border:`1px solid ${b.border}`,borderRadius:8,boxShadow:"0 8px 32px rgba(0,0,0,0.4)",zIndex:9999,outline:"none",transformOrigin:"top left",animation:"tkx-dropdown-in 150ms ease forwards"};let T=0;return(0,a.jsxs)("div",{ref:m,id:g,role:"menu","aria-label":"Dropdown menu",tabIndex:-1,style:R,onKeyDown:D,children:[(0,a.jsx)("style",{children:"\n @keyframes tkx-dropdown-in {\n from { opacity: 0; transform: scale(0.95); }\n to { opacity: 1; transform: scale(1); }\n }\n "}),c&&(0,a.jsx)("div",{style:{padding:"8px 8px 4px"},children:(0,a.jsx)("input",{ref:N,type:"text",value:y,onChange:e=>{v(e.target.value),k(0)},placeholder:u,"aria-label":"Search items",style:{width:"100%",boxSizing:"border-box",padding:"6px 10px",background:b.surfaceAlt,border:`1px solid ${b.border}`,borderRadius:6,color:b.text,fontSize:13,outline:"none"}})}),0===L.length&&(0,a.jsx)("div",{style:{padding:"12px 16px",color:b.textMuted,fontSize:13,textAlign:"center"},children:"No results found"}),L.map((e,t)=>(0,a.jsxs)("div",{role:"group","aria-label":e.label,children:[e.label&&(0,a.jsx)("div",{style:{padding:"8px 12px 4px",fontSize:11,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:b.textMuted},children:n.sanitizeString(e.label)}),e.items.map(e=>{const t=T;e.disabled||T++;const n=s.includes(e.key),o=t===w&&!e.disabled,r=!!e.children?.length,i=C===e.key,l=f?f(e,n):(0,a.jsx)(Go,{item:e,isSelected:n,isFocused:o,multiSelect:d,query:y,theme:b,hasSubmenu:r});return(0,a.jsxs)("div",{children:[e.divider&&(0,a.jsx)("div",{role:"separator",style:{height:1,background:b.border,margin:"4px 0"}}),(0,a.jsxs)("div",{ref:e=>{M.current[t]=e},role:"menuitem","aria-disabled":e.disabled,"aria-checked":d?n:void 0,"aria-selected":d?void 0:n,"aria-haspopup":r?"menu":void 0,"aria-expanded":r?i:void 0,tabIndex:e.disabled?-1:0,style:{position:"relative",cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.5:1},onClick:()=>{e.disabled||(r?(S(i?null:e.key),z(0)):p(e.key,e))},onMouseEnter:()=>{e.disabled||(k(t),r?(S(e.key),z(0)):S(null))},onFocus:()=>{e.disabled||k(t)},children:[l,r&&i&&(0,a.jsx)("div",{role:"menu",style:{position:"absolute",top:0,left:"100%",minWidth:180,background:b.surface,border:`1px solid ${b.border}`,borderRadius:8,boxShadow:"0 8px 32px rgba(0,0,0,0.4)",zIndex:1e4,animation:"tkx-dropdown-in 120ms ease forwards"},children:e.children.map((e,t)=>{const n=s.includes(e.key),o=t===$;return(0,a.jsx)("div",{ref:e=>{I.current[t]=e},role:"menuitem","aria-disabled":e.disabled,"aria-selected":n,tabIndex:e.disabled?-1:0,style:{cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?.5:1},onClick:t=>{t.stopPropagation(),e.disabled||p(e.key,e)},onMouseEnter:()=>z(t),children:(0,a.jsx)(Go,{item:e,isSelected:n,isFocused:o,multiSelect:d,query:y,theme:b,hasSubmenu:!1})},e.key)})})]})]},e.key)})]},t))]})}function Go({item:e,isSelected:t,isFocused:n,multiSelect:o,query:r,theme:i,hasSubmenu:l}){return(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 12px",background:n?e.danger?`${i.danger}20`:`${i.primary}18`:"transparent",transition:"background 80ms",color:e.danger?i.danger:i.text,fontSize:14,userSelect:"none"},children:[o&&(0,a.jsx)("div",{style:{width:16,height:16,border:`2px solid ${t?i.primary:i.border}`,borderRadius:4,background:t?i.primary:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"all 120ms"},children:t&&(0,a.jsx)("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",children:(0,a.jsx)("path",{d:"M1 4l3 3L9 1",stroke:i.bg,strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.icon&&(0,a.jsx)("span",{style:{display:"flex",alignItems:"center",flexShrink:0,color:e.danger?i.danger:i.textMuted},children:e.icon}),(0,a.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,a.jsx)("div",{style:{fontWeight:t&&!o?600:400},children:Xo(e.label,r)}),e.description&&(0,a.jsx)("div",{style:{fontSize:12,color:i.textMuted,marginTop:1},children:Xo(e.description,r)})]}),void 0!==e.badge&&(0,a.jsx)("span",{style:{background:i.primary,color:i.bg,fontSize:11,fontWeight:700,borderRadius:10,padding:"1px 7px",flexShrink:0},children:e.badge}),e.shortcut&&!l&&(0,a.jsx)("span",{style:{fontSize:12,color:i.textMuted,flexShrink:0},children:e.shortcut}),l&&(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",style:{flexShrink:0},children:(0,a.jsx)("path",{d:"M4 2l4 4-4 4",stroke:i.textMuted,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),!o&&t&&(0,a.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",style:{flexShrink:0},children:(0,a.jsx)("path",{d:"M2 7l4 4L12 3",stroke:i.primary,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})}Vo.displayName="TkxOrgChart";var Zo={sm:4,md:8,lg:12};function _o({src:e,name:n,size:o=32}){const r=t.useTheme(),i=n?n.split(" ").map(e=>e[0]).join("").slice(0,2).toUpperCase():"?";return e?(0,a.jsx)("img",{src:e,alt:n??"avatar",width:o,height:o,style:{borderRadius:"50%",objectFit:"cover",flexShrink:0}}):(0,a.jsx)("div",{style:{width:o,height:o,borderRadius:"50%",flexShrink:0,background:`${r.primary}22`,border:`1px solid ${r.primary}44`,display:"flex",alignItems:"center",justifyContent:"center",fontSize:.35*o,fontWeight:700,color:r.primary},children:i})}function Jo({color:e}){return(0,a.jsx)("div",{style:{display:"flex",gap:4,alignItems:"center"},children:[0,1,2].map(t=>(0,a.jsx)("div",{style:{width:7,height:7,borderRadius:"50%",background:e,animation:`tkx-thinking-dot 1.2s ease-in-out ${.18*t}s infinite`}},t))})}function Qo({color:e}){return(0,a.jsxs)("div",{style:{position:"relative",width:24,height:24},children:[(0,a.jsx)("div",{style:{position:"absolute",inset:0,borderRadius:"50%",background:e,opacity:.15,animation:"tkx-thinking-pulse 1.5s ease-out infinite"}}),(0,a.jsx)("div",{style:{position:"absolute",inset:4,borderRadius:"50%",background:e,opacity:.6,animation:"tkx-thinking-pulse 1.5s ease-out 0.3s infinite"}}),(0,a.jsx)("div",{style:{position:"absolute",inset:8,borderRadius:"50%",background:e}})]})}function er({color:e}){return(0,a.jsx)("div",{style:{display:"flex",gap:3,alignItems:"center",height:20},children:[0,1,2,3,4].map(t=>(0,a.jsx)("div",{style:{width:3,borderRadius:3,background:e,animation:`tkx-thinking-wave 1s ease-in-out ${.1*t}s infinite`}},t))})}function tr({color:e}){return(0,a.jsxs)("div",{style:{position:"relative",width:28,height:28},children:[(0,a.jsx)("div",{style:{position:"absolute",inset:0,borderRadius:"50%",border:`2px solid ${e}33`}}),(0,a.jsx)("div",{style:{position:"absolute",inset:0,borderRadius:"50%",border:"2px solid transparent",borderTopColor:e,animation:"tkx-thinking-orbit 0.8s linear infinite"}}),(0,a.jsx)("div",{style:{position:"absolute",inset:"38%",borderRadius:"50%",background:e,opacity:.8}})]})}var nr={sm:12,md:14,lg:16};exports.FocusTrap=function({active:e,children:t,as:n="div"}){return(0,a.jsx)(n,{ref:o.useFocusTrap(e),children:t})},exports.I18nContext=i.I18nContext,exports.I18nProvider=function({locale:e="en-US",direction:t,strings:n,children:o}){const r=(0,l.useMemo)(()=>{const o=i.LOCALES[e]??i.enUS,r=n?{...o,...n}:o;return{locale:e,direction:t??(i.isRTL(e)?"rtl":"ltr"),strings:r}},[e,t,n]);return(0,a.jsx)(i.I18nContext.Provider,{value:r,children:(0,a.jsx)("div",{dir:r.direction,style:{direction:r.direction,display:"contents"},children:o})})},exports.LRUCache=t.LRUCache,exports.LiveRegion=function({politeness:e="polite",children:t,atomic:n=!0}){return(0,a.jsx)("div",{role:"status","aria-live":e,"aria-atomic":n,className:"tkx-sr-only",children:t})},exports.Quantum=t.Quantum,exports.SIZE_BORDER_RADIUS={sm:4,md:6,lg:8},exports.SIZE_FONT={sm:"0.75rem",md:"0.875rem",lg:"1rem"},exports.SIZE_HEIGHT={sm:32,md:40,lg:48},exports.SIZE_ICON={sm:14,md:16,lg:20},exports.SIZE_PADDING_X={sm:8,md:12,lg:16},exports.SIZE_PADDING_Y={sm:4,md:8,lg:12},exports.SecurityCore=n.SecurityCore,exports.Shield=n.Shield,exports.SkipNav=function({contentId:e="tkx-main-content",label:t="Skip to main content"}){return(0,a.jsx)("a",{href:`#${e}`,className:"tkx-skip-nav",children:t})},exports.TKX=t.TKX,exports.ThemeContext=t.ThemeContext,exports.ThemeProvider=t.ThemeProvider,exports.TkxAIChatBubble=function({role:e,content:o,avatar:r,name:i,timestamp:s,streaming:d=!1,confidence:c,copyable:u=!1,className:p,style:h}){const f=t.useTheme(),m="user"===e,x="system"===e,g="string"==typeof o?n.sanitizeString(o):"",[b,y]=(0,l.useState)(d?"":g),[v,w]=(0,l.useState)(!1),[k,C]=(0,l.useState)(d?"":g),S=(0,l.useRef)(0),$=(0,l.useRef)(null);if((0,l.useEffect)(()=>{if(!d||"string"!=typeof o)return void C(g);S.current=0,y(""),C("");const e=setInterval(()=>{S.current++;const t=g.slice(0,S.current);y(t),$.current&&clearTimeout($.current),$.current=setTimeout(()=>C(t),350),S.current>=g.length&&(clearInterval(e),$.current&&clearTimeout($.current),C(g))},18);return()=>{clearInterval(e),$.current&&clearTimeout($.current)}},[g,d,o]),x)return(0,a.jsx)("div",{style:{display:"flex",justifyContent:"center",padding:"8px 0"},children:(0,a.jsx)("div",{style:{padding:"6px 16px",borderRadius:999,fontSize:12,background:`${f.border}`,color:f.textMuted,fontStyle:"italic"},children:"string"==typeof o?n.sanitizeString(o):o})});const z={maxWidth:"75%",padding:"12px 16px",borderRadius:m?"18px 18px 4px 18px":"18px 18px 18px 4px",background:m?`linear-gradient(135deg, ${f.primary}, ${f.primary}cc)`:`${f.surface}`,border:m?"none":`1px solid ${f.border}`,color:m?"#fff":f.text,fontSize:14,lineHeight:1.65,boxShadow:m?`0 4px 16px -4px ${f.primary}55`:"0 2px 8px -2px rgba(0,0,0,0.2)",position:"relative",wordBreak:"break-word"};return(0,a.jsxs)("div",{className:n.cx(n.tkx("flex gap-2"),p),style:{flexDirection:m?"row-reverse":"row",alignItems:"flex-end",...h},children:[(0,a.jsx)(_o,{src:r,name:i??(m?"You":"AI")}),(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:4,alignItems:m?"flex-end":"flex-start"},children:[(i||s)&&(0,a.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center",paddingInline:4},children:[i&&(0,a.jsx)("span",{style:{fontSize:11,fontWeight:700,color:f.textMuted},children:i}),s&&(0,a.jsx)("span",{style:{fontSize:10,color:f.textMuted},children:s})]}),(0,a.jsxs)("div",{style:z,role:"article","aria-label":m?"Your message":"Assistant message",children:["string"==typeof o?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{"aria-hidden":d?"true":void 0,children:d?b:n.sanitizeString(o)}),d&&b.length<g.length&&(0,a.jsx)("span",{"aria-hidden":"true",style:{display:"inline-block",width:2,height:14,background:m?"#fff":f.primary,marginLeft:2,animation:"tkx-blink 1s step-end infinite",verticalAlign:"text-bottom"}}),d&&(0,a.jsx)("span",{"aria-live":"polite","aria-atomic":"false",style:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0},children:k})]}):o,u&&!m&&(0,a.jsx)("button",{onClick:()=>{navigator.clipboard?.writeText(g),w(!0),setTimeout(()=>w(!1),2e3)},title:"Copy message",style:{position:"absolute",top:8,right:8,background:"none",border:"none",cursor:"pointer",fontSize:13,color:v?"#10b981":f.textMuted,padding:"2px 4px",borderRadius:4,transition:"color 0.2s"},children:v?"✓":"⎘"})]}),!m&&void 0!==c&&(0,a.jsx)("div",{style:{paddingInline:4,width:"100%",maxWidth:240},children:(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6},children:[(0,a.jsx)("div",{style:{flex:1,height:3,borderRadius:3,background:f.border,overflow:"hidden"},children:(0,a.jsx)("div",{style:{height:"100%",width:`${c}%`,background:(N=c,M=f.primary,N>=80?"#10b981":N>=55?M:N>=30?"#f59e0b":"#ef4444"),borderRadius:3,transition:"width 0.8s ease"}})}),(0,a.jsxs)("span",{style:{fontSize:10,color:f.textMuted,whiteSpace:"nowrap"},children:[c,"% confident"]})]})})]}),(0,a.jsx)("style",{children:"\n @keyframes tkx-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }\n "})]});var N,M},exports.TkxAIConfidenceBar=function({value:e,label:o,showLabel:r=!0,size:i="md",animate:s=!0,className:d,style:c}){const u=t.useTheme(),p=(0,l.useRef)(null),h=Math.max(0,Math.min(100,e)),f=function(e,t){return e>=80?"#10b981":e>=55?t:e>=30?"#f59e0b":"#ef4444"}(h,u.primary),m=Zo[i];(0,l.useEffect)(()=>{if(!s||!p.current)return;const e=p.current;e.style.width="0%";const t=requestAnimationFrame(()=>{e.style.transition="width 0.9s cubic-bezier(0.4, 0, 0.2, 1)",e.style.width=`${h}%`});return()=>cancelAnimationFrame(t)},[h,s]);const x="number"==typeof h?`${h.toFixed(0)}% AI confidence${o?` for ${o}`:""}`:o;return(0,a.jsxs)("div",{className:n.cx(n.tkx("flex flex-col gap-1"),d),style:c,role:"meter","aria-valuenow":h,"aria-valuemin":0,"aria-valuemax":100,"aria-label":x,children:[(o||r)&&(0,a.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[o&&(0,a.jsx)("span",{style:{fontSize:12,fontWeight:600,color:u.textMuted},children:o}),r&&(0,a.jsxs)("span",{style:{fontSize:12,fontWeight:700,color:f,marginLeft:"auto"},children:[h.toFixed(0),"%"]})]}),(0,a.jsxs)("div",{style:{height:m,borderRadius:m,background:`${u.border}`,overflow:"hidden",position:"relative"},children:[(0,a.jsx)("div",{style:{position:"absolute",inset:0,background:"linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.12) 50%, transparent 100%)",backgroundSize:"200% 100%",animation:"tkx-ai-shimmer 2s linear infinite",pointerEvents:"none",zIndex:1}}),(0,a.jsx)("div",{ref:p,style:{height:"100%",width:s?"0%":`${h}%`,background:`linear-gradient(90deg, ${f}cc, ${f})`,borderRadius:m,boxShadow:`0 0 8px ${f}66`,transition:s?void 0:"width 0.3s ease"}})]}),(0,a.jsxs)("div",{style:{fontSize:10,color:u.textMuted,marginTop:2,display:"flex",gap:4,alignItems:"center"},children:[(0,a.jsx)("span",{style:{width:6,height:6,borderRadius:"50%",background:f,display:"inline-block",flexShrink:0}}),h>=80?"High confidence":h>=55?"Moderate confidence":h>=30?"Low confidence":"Very low — review manually"]}),(0,a.jsx)("style",{children:"\n @keyframes tkx-ai-shimmer {\n 0% { background-position: -200% 0; }\n 100% { background-position: 200% 0; }\n }\n "})]})},exports.TkxAIThinking=function({label:e="Thinking…",steps:o,size:r="md",variant:i="dots",active:s=!0,className:d,style:c}){const u=t.useTheme(),[p,h]=(0,l.useState)(0);(0,l.useEffect)(()=>{if(!o?.length||!s)return;const e=setInterval(()=>{h(e=>(e+1)%o.length)},1800);return()=>clearInterval(e)},[o,s]);const f=u.primary,m=nr[r],x={dots:(0,a.jsx)(Jo,{color:f}),pulse:(0,a.jsx)(Qo,{color:f}),wave:(0,a.jsx)(er,{color:f}),orbit:(0,a.jsx)(tr,{color:f})}[i];return(0,a.jsxs)("div",{className:n.cx(n.tkx("inline-flex flex-col gap-2"),d),style:c,role:"status","aria-live":"polite","aria-label":s?e:"Done thinking",children:[(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,a.jsx)("div",{style:{opacity:s?1:.35,transition:"opacity 0.3s"},children:s?x:(0,a.jsx)("div",{style:{width:20,height:20,borderRadius:"50%",background:"#10b981",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,a.jsx)("span",{style:{color:"#fff",fontSize:11,fontWeight:900},children:"✓"})})}),(0,a.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[(0,a.jsx)("span",{style:{fontSize:m,fontWeight:600,color:s?u.text:u.textMuted,transition:"color 0.3s"},children:s?o?o[p]:e:"Done"}),s&&(0,a.jsx)("span",{style:{fontSize:m-2,color:u.textMuted},children:"⚛ Quantum AI · Amplitude Amplification"})]})]}),o&&o.length>1&&(0,a.jsx)("div",{style:{display:"flex",gap:4,paddingLeft:2},children:o.map((e,t)=>(0,a.jsx)("div",{style:{width:t===p?16:6,height:4,borderRadius:4,background:t===p?f:`${f}44`,transition:"all 0.3s ease"}},t))}),(0,a.jsx)("style",{children:"\n @keyframes tkx-thinking-dot {\n 0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }\n 40% { transform: scale(1); opacity: 1; }\n }\n @keyframes tkx-thinking-pulse {\n 0% { transform: scale(0.6); opacity: 0.8; }\n 100% { transform: scale(2); opacity: 0; }\n }\n @keyframes tkx-thinking-wave {\n 0%, 100% { height: 6px; }\n 50% { height: 18px; }\n }\n @keyframes tkx-thinking-orbit {\n to { transform: rotate(360deg); }\n }\n "})]})},exports.TkxAccordion=de,exports.TkxAffix=function({children:e,offsetTop:r,offsetBottom:i,onChange:s,target:d}){const c=t.useTheme(),u=o.useReducedMotion(),p=(0,l.useRef)(null),h=(0,l.useRef)(null),[f,m]=(0,l.useState)(!1),[x,g]=(0,l.useState)({width:0,height:0}),b=(0,l.useRef)(!1),y=(0,l.useMemo)(()=>n.sanitizeString("Sticky content"),[]),v=(0,l.useCallback)(()=>{const e=p.current;if(!e)return;const t=e.getBoundingClientRect(),n=function(e){if(e instanceof Window)return{top:0,bottom:e.innerHeight};const t=e.getBoundingClientRect();return{top:t.top,bottom:t.bottom}}(Ro(d));let o=!1;void 0!==r?o=t.top-n.top<=r:void 0!==i&&(o=n.bottom-t.bottom<=i),o!==b.current&&(b.current=o,m(o),g({width:t.width,height:t.height}),s?.(o))},[r,i,s,d]);(0,l.useEffect)(()=>{const e=Ro(d);return v(),e.addEventListener("scroll",v,{passive:!0}),window.addEventListener("resize",v),()=>{e.removeEventListener("scroll",v),window.removeEventListener("resize",v)}},[v,d]);const w=f?{position:"fixed",zIndex:100,...void 0!==r?{top:r}:{},...void 0!==i?{bottom:i}:{},width:x.width||void 0,transition:u?"none":"box-shadow 0.2s ease",boxShadow:`0 2px 8px ${c.border}`}:{};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{ref:p,"aria-hidden":f,style:f?{height:x.height,width:x.width}:{}}),(0,a.jsx)("div",{ref:h,role:"region","aria-label":y,className:n.tkx(f?"tkx-affixed":""),style:w,children:e})]})},exports.TkxAlert=function({variant:e,title:r,children:i,dismissible:s,onDismiss:d,icon:c,style:u,className:p}){const h=t.useTheme(),f=o.useAnnounce(),m=r?n.sanitizeString(r):void 0;(0,l.useEffect)(()=>{m&&f(m,"danger"===e||"warning"===e?"assertive":"polite")},[m,e]);const x={info:h.info,success:h.success,warning:h.warning,danger:h.danger}[e];return(0,a.jsxs)("div",{role:"danger"===e||"warning"===e?"alert":"status",className:n.tkx("flex items-start gap-3 px-4 py-3 rounded-lg border animate-fade-in font-sans",p??""),style:{backgroundColor:`${x}18`,borderColor:x,color:h.text,...u},children:[(0,a.jsx)("span",{className:n.tkx("shrink-0 mt-[1px]"),style:{color:x},children:c??z[e]}),(0,a.jsxs)("div",{className:n.tkx("flex-1 min-w-0"),children:[m&&(0,a.jsx)("p",{className:n.tkx("m-0 font-semibold text-sm mb-1"),children:m}),(0,a.jsx)("div",{className:n.tkx("text-sm leading-relaxed"),children:i})]}),s&&d&&(0,a.jsx)("button",{"aria-label":"Dismiss alert",onClick:d,className:n.tkx("bg-transparent border-none cursor-pointer rounded p-[2px] shrink-0 flex items-center justify-center focus-visible:focus-ring"),style:{color:h.textMuted},children:(0,a.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})},exports.TkxAnchor=function({items:e,offsetTop:r=0,getCurrentAnchor:i,onChange:s}){const d=t.useTheme(),c=o.useReducedMotion(),[u,p]=(0,l.useState)(e[0]?.key??""),h=(0,l.useRef)(!1),f=To(e),m=(0,l.useCallback)(()=>{if(h.current)return;let e=f[0]?.key??"";for(const t of f){const n=Bo(t.href),o=document.getElementById(n);o&&o.getBoundingClientRect().top<=r+10&&(e=t.key)}i&&(e=i(e)),e!==u&&(p(e),s?.(e))},[f,r,i,u,s]);(0,l.useEffect)(()=>(window.addEventListener("scroll",m,{passive:!0}),m(),()=>window.removeEventListener("scroll",m)),[m]);const x=(0,l.useCallback)(e=>{const t=Bo(e),n=document.getElementById(t);if(!n)return;h.current=!0;const o=n.getBoundingClientRect().top+window.scrollY-r;window.scrollTo({top:o,behavior:c?"auto":"smooth"});const i=f.find(t=>t.href===e);i&&(p(i.key),s?.(i.key)),setTimeout(()=>{h.current=!1},800)},[f,r,c,s]);return(0,a.jsx)("nav",{role:"tree","aria-label":"Anchor navigation",className:n.tkx("font-sans"),style:{borderLeft:`1px solid ${d.border}`,padding:"4px 0"},children:(0,a.jsx)("ul",{role:"group",style:{margin:0,padding:0},children:e.map(e=>(0,a.jsx)(Ao,{item:e,activeKey:u,depth:0,onClick:x,theme:d,reducedMotion:c},e.key))})})},exports.TkxAppBar=function({title:e,logo:r,actions:i,navigation:s,position:d="sticky",variant:c="default",color:u="surface"}){const p=t.useTheme(),h=o.useReducedMotion(),f=function(){const[e,t]=(0,l.useState)(()=>"undefined"!=typeof window&&window.innerWidth<768);return(0,l.useEffect)(()=>{if("undefined"==typeof window)return;const e=()=>t(window.innerWidth<768);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}(),[m,x]=(0,l.useState)(!1),g=(0,l.useRef)(null),b=(0,l.useId)();o.useEscapeKey(()=>x(!1),m),(0,l.useEffect)(()=>{!f&&m&&x(!1)},[f,m]),(0,l.useEffect)(()=>{if(!m)return;const e=e=>{g.current&&!g.current.contains(e.target)&&x(!1)};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[m]);const y=(0,l.useCallback)(()=>{x(e=>!e)},[]),v="primary"===u?p.primary:p.surface,w="primary"===u?p.bg:p.text,k={default:{backgroundColor:v,borderBottom:`1px solid ${p.border}`},transparent:{backgroundColor:"transparent",borderBottom:"none"},elevated:{backgroundColor:v,boxShadow:`0 2px 8px ${p.bg}66`,borderBottom:"none"}},C="string"==typeof e?n.sanitizeString(e):e,S=h?"none":"max-height 300ms cubic-bezier(0.4,0,0.2,1), opacity 300ms ease";return(0,a.jsxs)("header",{role:"banner",className:n.tkx("font-sans w-full"),style:{...{fixed:{position:"fixed",top:0,left:0,right:0,zIndex:1100},sticky:{position:"sticky",top:0,zIndex:1100},static:{position:"static"}}[d],...k[c],color:w,height:56},children:[(0,a.jsxs)("div",{ref:g,className:n.tkx("flex items-center h-full px-4"),style:{maxWidth:1440,margin:"0 auto"},children:[r&&(0,a.jsx)("div",{className:n.tkx("flex items-center shrink-0 mr-3"),"aria-hidden":"true",children:r}),C&&(0,a.jsx)("div",{className:n.tkx("text-base font-semibold shrink-0 mr-4 leading-snug"),style:{color:w},children:C}),!f&&s&&(0,a.jsx)("nav",{id:b,"aria-label":"Main navigation",className:n.tkx("flex items-center flex-1 gap-1"),children:s}),f&&(0,a.jsx)("div",{className:n.tkx("flex-1")}),i&&(0,a.jsx)("div",{className:n.tkx("flex items-center gap-2 ml-auto shrink-0"),children:i}),f&&s&&(0,a.jsx)("button",{onClick:y,"aria-expanded":m,"aria-controls":b,"aria-label":m?"Close navigation menu":"Open navigation menu",className:n.tkx("bg-transparent border-none cursor-pointer p-2 ml-2 rounded flex items-center justify-center","focus-visible:focus-ring"),style:{color:w},children:(0,a.jsx)(yn,{open:m})})]}),f&&s&&(0,a.jsx)("nav",{id:b,"aria-label":"Main navigation",style:{maxHeight:m?400:0,opacity:m?1:0,overflow:"hidden",transition:S,backgroundColor:p.surface,borderBottom:m?`1px solid ${p.border}`:"none"},children:(0,a.jsx)("div",{className:n.tkx("flex flex-col gap-1 px-4 py-3"),role:"menu",children:s})})]})},exports.TkxAutocomplete=function({options:e,value:r,onChange:i,onInputChange:d,placeholder:c="",label:u,isLoading:p=!1,emptyMessage:h="No results found",filterFn:f,freeSolo:m=!1,className:x,style:g}){const b=t.useTheme(),y=o.useReducedMotion(),v=(0,l.useId)(),w=(0,l.useId)(),k=(0,l.useRef)(null),C=(0,l.useRef)(null),[S,$]=(0,l.useState)(""),[z,N]=(0,l.useState)(!1),[M,I]=(0,l.useState)(-1),[L,W]=(0,l.useState)(null);(0,l.useEffect)(()=>{if(void 0!==r){const t=e.find(e=>e.value===r);$(t?t.label:r)}},[r,e]);const D=f??an,R=(0,l.useMemo)(()=>z?e.filter(e=>D(e,S)):[],[e,S,z,D]),T=n.sanitizeString(u),B=n.sanitizeString(h);(0,l.useEffect)(()=>{if(!z||!C.current)return;const e=()=>{C.current&&W(function(e){const t=e.getBoundingClientRect(),n=window.innerHeight-t.bottom,o=t.top,r=n>=284||n>=o?"below":"above";return{top:"below"===r?t.bottom+window.scrollY+4:t.top+window.scrollY-280-4,left:t.left+window.scrollX,width:t.width,placement:r}}(C.current))};return e(),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[z]),(0,l.useEffect)(()=>{if(!z)return;const e=e=>{const t=e.target;C.current?.contains(t)||document.getElementById(w)?.contains(t)||N(!1)};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[z,w]),o.useEscapeKey(()=>N(!1),z);const A=(0,l.useCallback)(e=>{e.disabled||($(e.label),i?.(e.value),N(!1),I(-1),k.current?.focus())},[i]);(0,l.useEffect)(()=>{if(M<0)return;const e=`${w}-opt-${M}`;document.getElementById(e)?.scrollIntoView({block:"nearest"})},[M,w]);const F=M>=0?`${w}-opt-${M}`:void 0,H=y?{}:{animation:"tkxAutoFadeIn 120ms ease forwards"},E=z&&"undefined"!=typeof document&&L?(0,s.createPortal)((0,a.jsx)("ul",{id:w,role:"listbox","aria-label":T,className:n.tkx("absolute z-[9200] list-none m-0 p-1 rounded-lg overflow-y-auto font-sans"),style:{top:L.top,left:L.left,width:L.width,maxHeight:280,backgroundColor:b.surface,border:`1px solid ${b.border}`,boxShadow:"0 8px 24px rgba(0,0,0,0.15)",...H},children:p?(0,a.jsxs)("li",{role:"option","aria-selected":!1,"aria-disabled":"true",className:n.tkx("flex items-center gap-2 px-3 py-2 text-sm"),style:{color:b.textMuted},children:[(0,a.jsx)(sn,{color:b.primary}),"Loading..."]}):0===R.length?(0,a.jsx)("li",{role:"option","aria-selected":!1,"aria-disabled":"true",className:n.tkx("px-3 py-2 text-sm text-center"),style:{color:b.textMuted},children:B}):R.map((e,t)=>{const o=t===M,i=n.sanitizeString(e.label),l=e.description?n.sanitizeString(e.description):null;return(0,a.jsxs)("li",{id:`${w}-opt-${t}`,role:"option","aria-selected":e.value===r,"aria-disabled":e.disabled||void 0,className:n.tkx("flex items-center gap-2 px-3 py-2 text-sm rounded-md cursor-pointer",e.disabled?"opacity-50 cursor-not-allowed":""),style:{backgroundColor:o?b.surfaceAlt:"transparent",color:e.disabled?b.textMuted:b.text,transition:y?"none":"background-color 100ms ease"},onMouseEnter:()=>!e.disabled&&I(t),onMouseDown:t=>{t.preventDefault(),A(e)},children:[e.icon&&(0,a.jsx)("span",{"aria-hidden":"true",className:n.tkx("flex-shrink-0"),children:e.icon}),(0,a.jsxs)("span",{className:n.tkx("flex flex-col min-w-0"),children:[(0,a.jsx)("span",{className:n.tkx("truncate"),children:i}),l&&(0,a.jsx)("span",{className:n.tkx("text-xs truncate"),style:{color:b.textMuted},children:l})]}),e.value===r&&(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",className:n.tkx("ml-auto flex-shrink-0"),children:(0,a.jsx)("path",{d:"M3 8l3.5 3.5L13 5",stroke:b.primary,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},e.value)})}),document.body):null;return(0,a.jsxs)("div",{ref:C,className:n.tkx("relative font-sans",x??""),style:g,children:[(0,a.jsx)("label",{htmlFor:v,className:n.tkx("block text-sm font-medium mb-1.5"),style:{color:b.text},children:T}),(0,a.jsxs)("div",{className:n.tkx("relative flex items-center"),style:{backgroundColor:b.surface,border:`1px solid ${z?b.primary:b.border}`,borderRadius:8,transition:y?"none":"border-color 150ms ease"},children:[(0,a.jsx)("input",{ref:k,id:v,type:"text",role:"combobox","aria-expanded":z,"aria-controls":w,"aria-activedescendant":F,"aria-autocomplete":"list","aria-label":T,value:S,placeholder:c,onChange:e=>{const t=e.target.value;$(t),d?.(t),z||N(!0),I(-1),m&&i?.(t)},onFocus:()=>N(!0),onKeyDown:e=>{if(z||"ArrowDown"!==e.key&&"ArrowUp"!==e.key)switch(e.key){case"ArrowDown":e.preventDefault(),I(e=>{let t=e+1;for(;t<R.length&&R[t].disabled;)t++;return t<R.length?t:e});break;case"ArrowUp":e.preventDefault(),I(e=>{let t=e-1;for(;t>=0&&R[t].disabled;)t--;return t>=0?t:e});break;case"Enter":e.preventDefault(),M>=0&&M<R.length?A(R[M]):m&&S&&(i?.(S),N(!1));break;case"Escape":N(!1),I(-1)}else N(!0)},className:n.tkx("w-full bg-transparent border-none outline-none text-sm py-2.5 px-3","placeholder:opacity-50"),style:{color:b.text}}),p&&(0,a.jsx)("span",{className:n.tkx("pr-3"),children:(0,a.jsx)(sn,{color:b.primary})})]}),E,z&&!y&&(0,a.jsx)("style",{children:"\n @keyframes tkxAutoFadeIn {\n from { opacity: 0; transform: translateY(4px); }\n to { opacity: 1; transform: translateY(0); }\n }\n "})]})},exports.TkxAvatar=F,exports.TkxBadge=v,exports.TkxBottomNav=function({items:e,activeId:r,onChange:i,showLabels:s=!0}){const d=t.useTheme(),c=o.useReducedMotion(),u=(0,l.useRef)(null);(0,l.useEffect)(()=>{!function(){if(vn||"undefined"==typeof document)return;vn=!0;const e=document.createElement("style");e.id="tkx-bottom-nav-kf",e.textContent="\n @keyframes tkx-bottom-nav-pulse {\n 0% { transform: scale(1); }\n 50% { transform: scale(1.15); }\n 100% { transform: scale(1); }\n }\n ",document.head.appendChild(e)}()},[]);const p=e.slice(0,5),h=(0,l.useCallback)(e=>{i?.(e)},[i]),f=(0,l.useCallback)(e=>{const t=u.current;if(!t)return;const n=Array.from(t.querySelectorAll('[role="tab"]')),o=n.findIndex(e=>e===document.activeElement);if(-1===o)return;let r=o;"ArrowRight"===e.key||"ArrowDown"===e.key?(e.preventDefault(),r=(o+1)%n.length):"ArrowLeft"===e.key||"ArrowUp"===e.key?(e.preventDefault(),r=(o-1+n.length)%n.length):"Home"===e.key?(e.preventDefault(),r=0):"End"===e.key&&(e.preventDefault(),r=n.length-1),r!==o&&(n[r].focus(),h(p[r].id))},[h,p]),m=c?"none":"color 200ms ease, transform 150ms ease";return(0,a.jsx)("nav",{ref:u,role:"navigation","aria-label":"Bottom navigation",className:n.tkx("fixed bottom-0 left-0 right-0 z-[1000] font-sans"),style:{height:56,backgroundColor:d.surface,borderTop:`1px solid ${d.border}`,boxShadow:`0 -2px 12px ${d.bg}44`},children:(0,a.jsx)("div",{role:"tablist","aria-label":"Navigation tabs",className:n.tkx("flex items-center justify-around h-full"),onKeyDown:f,children:p.map(e=>{const t=e.id===r,o=n.sanitizeString(e.label),i=t?d.primary:d.textMuted;return(0,a.jsxs)("button",{role:"tab","aria-selected":t,"aria-label":o,tabIndex:t?0:-1,onClick:()=>h(e.id),className:n.tkx("flex flex-col items-center justify-center gap-0.5","bg-transparent border-none cursor-pointer p-1","flex-1 h-full relative","focus-visible:focus-ring"),style:{color:i,transition:m,outline:"none"},children:[t&&(0,a.jsx)("div",{"aria-hidden":"true",style:{position:"absolute",top:0,left:"25%",right:"25%",height:3,borderRadius:"0 0 3px 3px",backgroundColor:d.primary,transition:c?"none":"width 200ms ease"}}),(0,a.jsxs)("div",{className:n.tkx("relative flex items-center justify-center"),style:{animation:t&&!c?"tkx-bottom-nav-pulse 300ms ease-out":"none"},children:[e.icon,void 0!==e.badge&&e.badge>0&&(0,a.jsx)("span",{"aria-label":`${e.badge} notifications`,className:n.tkx("absolute flex items-center justify-center","text-[10px] font-bold leading-none rounded-full"),style:{top:-4,right:-8,minWidth:16,height:16,padding:"0 4px",backgroundColor:d.danger,color:d.bg},children:e.badge>99?"99+":e.badge})]}),s&&(0,a.jsx)("span",{className:n.tkx("text-[10px] leading-tight mt-0.5"),style:{fontWeight:t?600:400,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o})]},e.id)})})})},exports.TkxBreadcrumb=function({items:e,separator:r,maxItems:i,onNavigate:s,className:d,style:c}){const u=t.useTheme(),p=o.useReducedMotion(),h=void 0!==i&&i>1&&e.length>i,f=(0,l.useCallback)(()=>{if(!h||!i)return e.map((e,t)=>({item:e,originalIndex:t}));const t=Math.ceil((i-1)/2),n=i-1-t,o=e.slice(0,t).map((e,t)=>({item:e,originalIndex:t})),r=e.slice(e.length-n).map((t,o)=>({item:t,originalIndex:e.length-n+o}));return o.concat(r)},[e,i,h])(),m=h&&i?Math.ceil((i-1)/2):-1,x=(e,t)=>{s?.(e,t)},g=p?{}:{transition:"color 150ms ease, background-color 150ms ease"},b=e=>(0,a.jsx)("li",{role:"presentation","aria-hidden":"true",className:n.tkx("flex items-center mx-1.5"),children:r??(0,a.jsx)(rn,{color:u.textMuted})},e),y=(e,t,o)=>{const r=n.sanitizeString(e.label);if(o)return(0,a.jsx)("li",{children:(0,a.jsxs)("span",{"aria-current":"page",className:n.tkx("inline-flex items-center gap-1.5 text-sm font-medium"),style:{color:u.text},children:[e.icon&&(0,a.jsx)("span",{"aria-hidden":"true",className:n.tkx("flex-shrink-0"),children:e.icon}),r]})},`item-${t}`);const i=!!e.href,l={color:u.textMuted,textDecoration:"none",...g},d={onMouseEnter:e=>{e.currentTarget.style.color=u.primary},onMouseLeave:e=>{e.currentTarget.style.color=u.textMuted}},c=(0,a.jsxs)(a.Fragment,{children:[e.icon&&(0,a.jsx)("span",{"aria-hidden":"true",className:n.tkx("flex-shrink-0"),children:e.icon}),r]});return i?(0,a.jsx)("li",{children:(0,a.jsx)("a",{href:e.href,onClick:n=>{s&&(n.preventDefault(),x(e,t))},className:n.tkx("inline-flex items-center gap-1.5 text-sm rounded","outline-none focus-visible:ring-2 focus-visible:ring-offset-1"),style:{...l,focusRingColor:u.primary},...d,children:c})},`item-${t}`):(0,a.jsx)("li",{children:(0,a.jsx)("button",{type:"button",onClick:()=>x(e,t),onKeyDown:n=>((e,t,n)=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),x(t,n))})(n,e,t),className:n.tkx("inline-flex items-center gap-1.5 text-sm rounded","border-none bg-transparent cursor-pointer p-0","outline-none focus-visible:ring-2 focus-visible:ring-offset-1"),style:l,...d,children:c})},`item-${t}`)},v=[];let w=!1;for(let t=0;t<f.length;t++){const{item:n,originalIndex:o}=f[t],r=o===e.length-1;h&&!w&&t===m&&(v.length>0&&v.push(b("sep-ellipsis-before")),v.push((0,a.jsx)("li",{role:"presentation",children:(0,a.jsx)(ln,{onClick:()=>{},bgColor:u.surfaceAlt,hoverColor:u.surface,textColor:u.textMuted})},"ellipsis")),w=!0),v.length>0&&null!==v[v.length-1]&&v.push(b(`sep-${o}`)),v.push(y(n,o,r))}return(0,a.jsx)("nav",{"aria-label":"Breadcrumb",className:n.tkx("font-sans",d??""),style:{...c},children:(0,a.jsx)("ol",{role:"list",className:n.tkx("flex items-center flex-wrap list-none m-0 p-0"),children:v})})},exports.TkxButton=f,exports.TkxCard=x,exports.TkxCardBody=function({children:e,className:t,...o}){return(0,a.jsx)("div",{className:n.cx(n.tkx(""),t),...o,children:e})},exports.TkxCardFooter=function({children:e,className:o,style:r,...i}){const l=t.useTheme();return(0,a.jsx)("div",{className:n.cx(n.tkx("flex items-center justify-end gap-2 mt-4 pt-4"),o),style:{borderTop:`1px solid ${l.border}`,...r},...i,children:e})},exports.TkxCardHeader=function({title:e,subtitle:o,action:r,children:i,className:l,...s}){const d=t.useTheme();return(0,a.jsxs)("div",{className:n.cx(n.tkx("flex justify-between items-start mb-4"),l),...s,children:[(0,a.jsxs)("div",{className:n.tkx("flex-1 min-w-0"),children:[e&&(0,a.jsx)("h3",{className:n.tkx("text-base font-semibold m-0"),style:{color:d.text},children:e}),o&&(0,a.jsx)("p",{className:n.tkx("text-sm mt-1 mb-0"),style:{color:d.textMuted},children:o}),i]}),r&&(0,a.jsx)("div",{className:n.tkx("ml-3 shrink-0"),children:r})]})},exports.TkxCarousel=on,exports.TkxCascader=function({options:e,value:r=[],onChange:i,placeholder:d="Select...",label:c,multiple:u=!1}){const p=t.useTheme(),h=o.useReducedMotion(),f=(0,l.useRef)(null),m=(0,l.useRef)(null),[x,g]=(0,l.useState)(!1),[b,y]=(0,l.useState)(r),[v,w]=(0,l.useState)({top:0,left:0,width:0}),k=c?n.sanitizeString(c):void 0,C=n.sanitizeString(d),S=r.length>0?function(e,t){return Fo(e,t).map(e=>n.sanitizeString(e.label)).join(" / ")}(e,r):"";(0,l.useEffect)(()=>{if(!x||!f.current)return;const e=f.current.getBoundingClientRect();w({top:e.bottom+4+window.scrollY,left:e.left+window.scrollX,width:Math.max(e.width,200)})},[x]),(0,l.useEffect)(()=>{if(!x)return;const e=e=>{f.current?.contains(e.target)||m.current?.contains(e.target)||g(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[x]);const $=(0,l.useCallback)((t,n)=>{if(n.disabled)return;const o=[...b.slice(0,t),n.value];if(y(o),!n.children?.length){const t=Fo(e,o);i?.(o,t),u||g(!1)}},[b,e,i,u]),z=(0,l.useCallback)(e=>{"Escape"===e.key?(g(!1),f.current?.focus()):"Enter"!==e.key&&" "!==e.key||x||(e.preventDefault(),g(!0))},[x]),N=function(e,t){const n=[e];let o=e;for(const r of t){const e=o.find(e=>e.value===r);if(!e?.children?.length)break;n.push(e.children),o=e.children}return n}(e,b),M=x?(0,s.createPortal)((0,a.jsx)("div",{ref:m,role:"tree","aria-label":k??"Cascader options",className:n.tkx("flex rounded-lg border overflow-hidden"),style:{position:"absolute",zIndex:9999,top:v.top,left:v.left,backgroundColor:p.surface,borderColor:p.border,boxShadow:`0 4px 16px ${p.bg}80`,animation:h?"none":"tkxFadeIn 0.15s ease"},children:N.map((e,t)=>(0,a.jsx)("ul",{role:"group",className:n.tkx("m-0 p-0 overflow-auto"),style:{listStyle:"none",minWidth:160,maxHeight:260,borderRight:t<N.length-1?`1px solid ${p.border}`:"none"},children:e.map(e=>{const o=b[t]===e.value,r=n.sanitizeString(e.label);return(0,a.jsxs)("li",{role:"treeitem","aria-selected":o,"aria-disabled":e.disabled||void 0,"aria-expanded":e.children?.length?o:void 0,className:n.tkx("flex items-center justify-between px-3 py-2 cursor-pointer text-sm"),style:{backgroundColor:o?p.surfaceAlt:"transparent",color:e.disabled?p.textMuted:p.text,opacity:e.disabled?.5:1,cursor:e.disabled?"not-allowed":"pointer"},onClick:()=>$(t,e),onMouseEnter:()=>{e.disabled||y(n=>[...n.slice(0,t),e.value])},children:[(0,a.jsx)("span",{children:r}),e.children&&e.children.length>0&&(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",style:{color:p.textMuted,flexShrink:0},children:(0,a.jsx)("path",{d:"M10 6l6 6-6 6V6z"})})]},e.value)})},t))}),document.body):null;return(0,a.jsxs)("div",{className:n.tkx("relative font-sans"),onKeyDown:z,children:[k&&(0,a.jsx)("label",{className:n.tkx("block text-sm font-medium mb-1"),style:{color:p.text},children:k}),(0,a.jsxs)("button",{ref:f,type:"button",role:"combobox","aria-expanded":x,"aria-haspopup":"tree","aria-label":k??"Cascader",className:n.tkx("w-full flex items-center justify-between rounded-lg border px-3 py-2 text-sm cursor-pointer"),style:{backgroundColor:p.surface,borderColor:x?p.primary:p.border,color:S?p.text:p.textMuted,outline:"none",minHeight:38,textAlign:"left"},onClick:()=>g(e=>!e),children:[(0,a.jsx)("span",{className:n.tkx("truncate"),children:S||C}),(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",style:{color:p.textMuted,transform:x?"rotate(180deg)":"rotate(0deg)",transition:h?"none":"transform 0.2s ease",flexShrink:0},children:(0,a.jsx)("path",{d:"M7 10l5 5 5-5H7z"})})]}),M]})},exports.TkxChat=function({messages:e,onSend:r,isLoading:i=!1,placeholder:s="Type a message…",maxLength:d,showTimestamps:c=!1,avatarUser:u,avatarAssistant:p,height:h=480,inputPosition:f="bottom"}){const m=t.useTheme(),x=o.useReducedMotion(),[g,b]=(0,l.useState)(""),y=(0,l.useRef)(null),v=(0,l.useRef)(null);(0,l.useEffect)(()=>{!function(){if(Xe||"undefined"==typeof document)return;Xe=!0;const e=document.createElement("style");e.textContent="\n @keyframes tkx-blink { 0%,100% { opacity:1 } 50% { opacity:0 } }\n @keyframes tkx-bounce { 0%,100% { transform:translateY(0) } 50% { transform:translateY(-5px) } }\n .tkx-cursor::after { content:'▋'; display:inline-block; animation:tkx-blink 1s step-start infinite; margin-left:1px; }\n .tkx-dot1 { animation:tkx-bounce 1s ease-in-out infinite; }\n .tkx-dot2 { animation:tkx-bounce 1s ease-in-out 0.2s infinite; }\n .tkx-dot3 { animation:tkx-bounce 1s ease-in-out 0.4s infinite; }\n ",document.head.appendChild(e)}()},[]),(0,l.useEffect)(()=>{const e=y.current;e&&e.scrollTo({top:e.scrollHeight,behavior:x?"auto":"smooth"})},[e,i,x]);const w=(0,l.useCallback)(()=>{const e=g.trim();e&&r&&(r(e),b(""),v.current&&(v.current.style.height="auto"))},[g,r]),k=(0,l.useCallback)(e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),w())},[w]),C=(0,l.useCallback)(e=>{b(d?e.target.value.slice(0,d):e.target.value);const t=v.current;if(t){t.style.height="auto";const e=120;t.style.height=`${Math.min(t.scrollHeight,e)}px`}},[d]),S=g.trim().length>0&&!i,$="number"==typeof h?`${h}px`:h,z="floating"===f,N=(0,a.jsxs)("div",{className:n.tkx("flex flex-col gap-1 p-3"),style:z?{position:"absolute",bottom:12,left:12,right:12,borderRadius:16,backgroundColor:m.surface,border:`1px solid ${m.border}`,boxShadow:"0 4px 24px rgba(0,0,0,0.18)"}:{borderTop:`1px solid ${m.border}`,backgroundColor:m.surface},children:[(0,a.jsxs)("div",{className:n.tkx("flex items-end gap-2"),children:[(0,a.jsx)("textarea",{ref:v,rows:1,value:g,onChange:C,onKeyDown:k,placeholder:n.sanitizeString(s),"aria-label":"Message input","aria-multiline":"true",disabled:i,className:n.tkx("flex-1 resize-none text-sm leading-6 bg-transparent outline-none py-1"),style:{color:m.text,caretColor:m.primary,minHeight:32,maxHeight:120}}),(0,a.jsx)("button",{onClick:w,disabled:!S,"aria-label":"Send message",className:n.tkx("shrink-0 w-9 h-9 rounded-xl flex items-center justify-center",!x&&"transition-opacity duration-150",S?"cursor-pointer opacity-100":"opacity-40 cursor-not-allowed"),style:{backgroundColor:m.primary,color:m.bg},children:(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M2 14L14 8 2 2v4.5l8 1.5-8 1.5V14z",fill:"currentColor"})})})]}),d&&(0,a.jsxs)("div",{className:n.tkx("text-right text-[10px]"),style:{color:m.textMuted},children:[g.length,"/",d]})]});return(0,a.jsxs)("div",{className:n.tkx("flex flex-col overflow-hidden rounded-2xl"),style:{height:$,backgroundColor:m.bg,border:`1px solid ${m.border}`,position:"relative"},children:[(0,a.jsx)("div",{ref:y,role:"log","aria-live":"polite","aria-label":"Chat messages",className:n.tkx("flex-1 overflow-y-auto p-4"),style:{paddingBottom:z?80:void 0},children:(0,a.jsxs)("div",{role:"list",children:[e.map(e=>(0,a.jsx)(_e,{message:e,showTimestamp:c,avatarUser:u,avatarAssistant:p},e.id)),i&&(0,a.jsxs)("div",{role:"listitem",className:n.tkx("flex gap-2 mb-4"),children:[(0,a.jsx)("div",{className:n.tkx("w-8 h-8 shrink-0")}),(0,a.jsx)(Ze,{})]})]})}),N]})},exports.TkxChatBubble=_e,exports.TkxCheckbox=U,exports.TkxClock=vt,exports.TkxCol=uo,exports.TkxColorPicker=function({value:e,defaultValue:n="#3b82f6",onChange:o,format:r="hex",showAlpha:i=!1,presets:d=Et,disabled:c=!1,size:u="md",placeholder:p,label:h,style:f}){const m=t.useTheme(),x=(0,l.useRef)(null),g=(0,l.useRef)(null),[b,y]=(0,l.useState)(!1),v=void 0!==e,[w,k]=(0,l.useState)(v&&e||n),C=v?e||n:w,[S,$]=(0,l.useState)(1),[z,N]=(0,l.useState)(C),[M,I]=(0,l.useState)({top:0,left:0}),[L,W,D]=Rt(Ft(C)?C:n);Math.round(D+W/100*Math.min(D/100,1-D/100)*100);const R=(0,l.useCallback)((e,t=S)=>{Ft(e)&&(N(e),v||k(e),o?.(Ht(e,t,r),r))},[S,v,r,o]);(0,l.useEffect)(()=>{v&&e&&Ft(e)&&N(e)},[v,e]),(0,l.useEffect)(()=>{if(!b)return;const e=e=>{g.current&&!g.current.contains(e.target)&&x.current&&!x.current.contains(e.target)&&y(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[b]),(0,l.useEffect)(()=>{if(!b)return;const e=e=>{"Escape"===e.key&&y(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[b]);const T=e=>{$(e),o?.(Ht(C,e,r),r)},B={sm:28,md:34,lg:40}[u],[A,F,H]=Bt(Ft(C)?C:n),E={display:"inline-flex",alignItems:"center",gap:"8px",height:`${B}px`,padding:"4px 10px 4px 6px",borderRadius:"8px",border:`1px solid ${m.border}`,backgroundColor:m.surface,cursor:c?"not-allowed":"pointer",opacity:c?.5:1,color:m.text,fontSize:"13px",fontFamily:"inherit",transition:"border-color 0.15s",...f},j={width:B-8+"px",height:B-8+"px",borderRadius:"4px",backgroundColor:`rgba(${A},${F},${H},${S})`,border:`1px solid ${m.border}`,flexShrink:0},O={position:"absolute",top:M.top,left:M.left,zIndex:9999,width:"260px",backgroundColor:m.surface,border:`1px solid ${m.border}`,borderRadius:"12px",padding:"16px",boxShadow:"0 8px 32px rgba(0,0,0,0.24)",display:"flex",flexDirection:"column",gap:"12px"},P={width:"100%",padding:"6px 10px",borderRadius:"6px",border:`1px solid ${m.border}`,backgroundColor:m.bg,color:m.text,fontSize:"12px",fontFamily:"monospace",outline:"none"},V={flex:1,padding:"5px 6px",borderRadius:"6px",border:`1px solid ${m.border}`,backgroundColor:m.bg,color:m.text,fontSize:"11px",textAlign:"center",fontFamily:"monospace",outline:"none"},Y=e=>({width:"20px",height:"20px",borderRadius:"50%",backgroundColor:e,border:e.toLowerCase()===C.toLowerCase()?`2px solid ${m.primary}`:`1px solid ${m.border}`,cursor:"pointer",flexShrink:0,transition:"transform 0.1s"});return(0,a.jsxs)(a.Fragment,{children:[h&&(0,a.jsx)("label",{style:{display:"block",fontSize:"13px",color:m.text,marginBottom:"6px",fontWeight:500},children:h}),(0,a.jsxs)("button",{ref:x,type:"button",style:E,onClick:()=>{if(c)return;const e=x.current;if(!e)return;const t=e.getBoundingClientRect();I({top:(window.innerHeight-t.bottom>320?t.bottom+6:t.top-326)+window.scrollY,left:t.left+window.scrollX}),y(!0)},disabled:c,"aria-label":`Color picker, current color ${C}`,"aria-haspopup":"dialog","aria-expanded":b,children:[(0,a.jsx)("div",{style:j}),(0,a.jsx)("span",{style:{fontFamily:"monospace",fontSize:"12px",color:m.textMuted},children:p??Ht(Ft(C)?C:n,S,r)})]}),b&&(0,s.createPortal)((0,a.jsxs)("div",{ref:g,style:O,role:"dialog","aria-label":"Color picker",children:[(0,a.jsx)(jt,{hue:L,sat:W,bright:D,onChange:(e,t)=>{const n=t/100,o=n*(1-e/100/2),r=0===o||1===o?0:(n-o)/Math.min(o,1-o);R(Tt(L,Math.round(100*r),Math.round(100*o)))}}),(0,a.jsx)(Ot,{hue:L,onChange:e=>{R(Tt(e,W,D))}}),i&&(0,a.jsx)(Pt,{alpha:S,hex:Ft(C)?C:n,onChange:T}),(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,a.jsx)("div",{style:{width:"28px",height:"28px",borderRadius:"6px",flexShrink:0,backgroundColor:`rgba(${A},${F},${H},${S})`,border:`1px solid ${m.border}`}}),(0,a.jsx)("input",{style:P,value:z,onChange:e=>{const t=e.target.value;N(t),Ft(t)&&R(t)},maxLength:7,spellCheck:!1,"aria-label":"Hex color value"})]}),(0,a.jsxs)("div",{style:{display:"flex",gap:"6px",alignItems:"center"},children:[["r","g","b"].map(e=>(0,a.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"3px",alignItems:"center"},children:[(0,a.jsx)("input",{style:V,type:"number",min:0,max:255,value:"r"===e?A:"g"===e?F:H,onChange:t=>((e,t)=>{const n=Math.max(0,Math.min(255,parseInt(t)||0)),[o,r,i]=Bt(C);R("r"===e?At(n,r,i):"g"===e?At(o,n,i):At(o,r,n))})(e,t.target.value),"aria-label":`${e.toUpperCase()} channel`}),(0,a.jsx)("span",{style:{fontSize:"10px",color:m.textMuted,textTransform:"uppercase"},children:e})]},e)),i&&(0,a.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"3px",alignItems:"center"},children:[(0,a.jsx)("input",{style:V,type:"number",min:0,max:100,value:Math.round(100*S),onChange:e=>T(Math.max(0,Math.min(1,parseInt(e.target.value)/100||0))),"aria-label":"Alpha channel"}),(0,a.jsx)("span",{style:{fontSize:"10px",color:m.textMuted},children:"A%"})]})]}),d.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{style:{fontSize:"11px",color:m.textMuted,marginBottom:"6px",fontWeight:500},children:"Presets"}),(0,a.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:d.map(e=>(0,a.jsx)("button",{type:"button",style:Y(e),onClick:()=>R(e),"aria-label":`Select color ${e}`,onMouseEnter:e=>{e.currentTarget.style.transform="scale(1.15)"},onMouseLeave:e=>{e.currentTarget.style.transform="scale(1)"}},e))})]})]}),document.body)]})},exports.TkxCommand=tn,exports.TkxConfigProvider=ho,exports.TkxContent=oo,exports.TkxCountdown=function({title:e,value:o,format:r="HH:mm:ss",onFinish:i,prefix:a,suffix:s,style:d}){const c=t.useTheme(),u=n.sanitizeString(e),p=(0,l.useRef)(i);p.current=i;const h=(0,l.useRef)(!1),[f,m]=(0,l.useState)(()=>Math.max(0,o-Date.now()));(0,l.useEffect)(()=>{h.current=!1;const e=()=>{const e=Math.max(0,o-Date.now());m(e),e<=0&&!h.current&&(h.current=!0,p.current?.())};e();const t=setInterval(e,1e3);return()=>clearInterval(t)},[o]);const x=function(e,t){if(e<=0)return t.replace(/DD?/g,"0").replace(/HH?/g,"00").replace(/mm?/g,"00").replace(/ss?/g,"00");const n=Math.floor(e/1e3),o=Math.floor(n/86400),r=Math.floor(n%86400/3600),i=Math.floor(n%3600/60),l=n%60,a=e=>String(e).padStart(2,"0");return t.replace(/DD/g,a(o)).replace(/D/g,String(o)).replace(/HH/g,a(r)).replace(/H/g,String(r)).replace(/mm/g,a(i)).replace(/m/g,String(i)).replace(/ss/g,a(l)).replace(/s/g,String(l))}(f,r);return(0,l.createElement)("div",{style:{display:"flex",flexDirection:"column",gap:"4px",...d}},(0,l.createElement)("div",{style:{color:c.textMuted,fontSize:"0.875rem",lineHeight:"1.4"}},u),(0,l.createElement)("div",{style:{display:"flex",alignItems:"baseline",gap:"4px",fontSize:"1.75rem",fontWeight:700,lineHeight:"1.2",color:f<=0?c.danger:c.text,fontVariantNumeric:"tabular-nums"}},a&&(0,l.createElement)("span",{style:{fontSize:"0.75em",fontWeight:400}},a),(0,l.createElement)("span",null,x),s&&(0,l.createElement)("span",{style:{fontSize:"0.6em",fontWeight:400,color:c.textMuted}},s)))},exports.TkxDataGrid=function({columns:e,data:r,rowKey:i,selectable:s=!1,selectedRows:d=[],onSelectionChange:c,sortable:u=!1,onSort:p,loading:h=!1,emptyMessage:f="No data to display",stickyHeader:m=!1,striped:x=!1,bordered:g=!1,compact:b=!1,maxHeight:y,onRowClick:v,virtualScroll:w,rowHeight:k=40,showFilters:C=!1,filterValues:S,onFilterChange:$,pageSize:z=0,showExport:N=!1,exportFileName:M="export",onLoadMore:I,hasMore:L,loadingMore:W=!1,loadMoreThreshold:D=200}){const R=t.useTheme(),B=o.useReducedMotion(),A=(0,l.useId)(),[F,H]=(0,l.useState)(null),[E,j]=(0,l.useState)("asc"),O=(0,l.useCallback)(e=>{const t=F===e&&"asc"===E?"desc":"asc";H(e),j(t),p?.(e,t)},[F,E,p]),P=(0,l.useMemo)(()=>p||!F?r:[...r].sort((e,t)=>{const n=function(e,t){return null==e&&null==t?0:null==e?1:null==t?-1:"number"==typeof e&&"number"==typeof t?e-t:String(e).localeCompare(String(t),void 0,{numeric:!0,sensitivity:"base"})}(Nn(e,F),Nn(t,F));return"asc"===E?n:-n}),[r,F,E,p]),[V,Y]=(0,l.useState)({}),U=S??V,K=(0,l.useCallback)((e,t)=>{$?$(e,t):Y(n=>({...n,[e]:t}))},[$]),X=(0,l.useMemo)(()=>{const e=Object.entries(U).filter(([,e])=>""!==e.trim());return 0===e.length?P:P.filter(t=>e.every(([e,n])=>{const o=Nn(t,e);return String(o??"").toLowerCase().includes(n.toLowerCase())}))},[P,U]),[q,G]=(0,l.useState)(1),Z=z>0,_=X.length,J=Z?Math.max(1,Math.ceil(_/z)):1;(0,l.useEffect)(()=>{G(1)},[U,F,E]);const Q=(0,l.useMemo)(()=>Z?X.slice((q-1)*z,q*z):X,[X,Z,q,z]),ee=void 0!==w?w:!Z&&void 0!==y&&Q.length>=50,te=(0,l.useRef)(null),[ne,oe]=(0,l.useState)(0),[re,ie]=(0,l.useState)(0),le=(0,l.useCallback)(()=>{te.current&&oe(te.current.scrollTop)},[]);(0,l.useEffect)(()=>{if(!ee||!te.current)return;const e=te.current;ie(e.clientHeight);const t=new ResizeObserver(()=>ie(e.clientHeight));return t.observe(e),()=>t.disconnect()},[ee]),Q.length;const ae=ee?Math.max(0,Math.floor(ne/k)-10):0,se=ee?Math.min(Q.length,Math.ceil((ne+re)/k)+10):Q.length,de=ee?Q.slice(ae,se):Q,ce=ae*k,ue=(0,l.useRef)(null),pe=(0,l.useRef)(!1);(0,l.useEffect)(()=>{pe.current=!1},[r.length]),(0,l.useEffect)(()=>{if(!I)return;const e=ue.current;if(!e)return;const t=new IntersectionObserver(e=>{e[0].isIntersecting&&!pe.current&&!1!==L&&(pe.current=!0,I())},{root:te.current,rootMargin:`0px 0px ${D}px 0px`,threshold:0});return t.observe(e),()=>t.disconnect()},[I,L,D]);const he=(0,l.useMemo)(()=>new Set(d),[d]),fe=(0,l.useMemo)(()=>X.map(e=>zn(e,i)),[X,i]),me=fe.length>0&&fe.every(e=>he.has(e)),xe=fe.some(e=>he.has(e)),ge=(0,l.useCallback)(()=>{c?.(me?[]:fe)},[me,fe,c]),be=(0,l.useCallback)(e=>{const t=he.has(e)?d.filter(t=>t!==e):[...d,e];c?.(t)},[he,d,c]),[ye,ve]=(0,l.useState)({}),we=(0,l.useRef)(null),ke=(0,l.useCallback)((e,t)=>{t.preventDefault(),t.stopPropagation();const n=t.target.closest("th");if(!n)return;const o=ye[e]||n.getBoundingClientRect().width;we.current={key:e,startX:t.clientX,startWidth:o};const r=e=>{if(!we.current)return;const t=Math.max(50,we.current.startWidth+e.clientX-we.current.startX);ve(e=>({...e,[we.current.key]:t}))},i=()=>{we.current=null,document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",i)};document.addEventListener("mousemove",r),document.addEventListener("mouseup",i)},[ye]),Ce=(0,l.useCallback)(()=>{const t=[e.map(e=>Mn(e.header)).join(","),...X.map(t=>e.map(e=>Mn(Nn(t,e.key))).join(","))].join("\n"),n=new Blob([t],{type:"text/csv;charset=utf-8;"}),o=URL.createObjectURL(n),r=document.createElement("a");r.href=o,r.download=`${M}.csv`,r.click(),URL.revokeObjectURL(o)},[e,X,M]),Se=b?"4px":"8px",$e=b?"8px":"12px",ze=e=>{const t=ye[e.key]||e.width;return{width:null!=t?t:void 0,minWidth:null!=t?t:80,textAlign:e.align??"left",padding:`${Se} ${$e}`}},Ne=g?`1px solid ${R.border}`:"none",Me=n.sanitizeString(f),Ie=e.length+(s?1:0),Le=e.some(e=>e.filterable);return(0,a.jsxs)("div",{role:"grid","aria-label":"Data grid","aria-rowcount":_,id:A,className:n.tkx("font-sans rounded-lg overflow-hidden"),style:{border:`1px solid ${R.border}`,backgroundColor:R.bg},children:[(0,a.jsx)(Ln,{label:"data grid",showExport:N,onExport:Ce,totalRows:_,selectedCount:d.length,theme:R}),(0,a.jsxs)("div",{ref:te,onScroll:ee?le:void 0,style:{maxHeight:y??"none",overflowX:"auto",overflowY:y?"auto":"visible"},children:[(0,a.jsxs)("table",{className:n.tkx("w-full"),style:{borderCollapse:"separate",borderSpacing:0,tableLayout:"auto"},children:[(0,a.jsxs)("thead",{children:[(0,a.jsxs)("tr",{role:"row",children:[s&&(0,a.jsx)("th",{scope:"col",role:"columnheader",style:{position:m?"sticky":"static",top:0,zIndex:2,backgroundColor:R.surface,borderBottom:`2px solid ${R.border}`,borderRight:Ne,padding:`${Se} ${$e}`,width:40,textAlign:"center"},children:(0,a.jsxs)("label",{style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",margin:"0 auto",width:16},children:[(0,a.jsx)("input",{type:"checkbox",checked:me,ref:e=>{e&&(e.indeterminate=xe&&!me)},onChange:ge,"aria-label":me?"Deselect all rows":"Select all rows",style:{position:"absolute",opacity:0,width:16,height:16,cursor:"pointer",margin:0}}),(0,a.jsx)($n,{checked:me,indeterminate:xe&&!me})]})}),e.map(e=>{const t=(e.sortable??u)&&!1!==e.sortable,o=F===e.key,r=n.sanitizeString(e.header);return(0,a.jsx)("th",{scope:"col",role:"columnheader","aria-sort":o?"asc"===E?"ascending":"descending":t?"none":void 0,className:n.tkx("text-xs font-semibold uppercase tracking-wider"),style:{...ze(e),position:m?"sticky":"static",top:0,zIndex:2,backgroundColor:R.surface,color:R.textMuted,borderBottom:`2px solid ${R.border}`,borderRight:Ne,cursor:t?"pointer":"default",userSelect:"none",whiteSpace:"nowrap",transition:B?"none":"background-color 150ms ease"},onClick:t?()=>O(e.key):void 0,onKeyDown:t?t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),O(e.key))}:void 0,tabIndex:t?0:void 0,children:(0,a.jsxs)("div",{className:n.tkx("flex items-center gap-1"),style:{position:"relative"},children:[e.renderHeader?e.renderHeader(e):r,t&&(0,a.jsx)(Sn,{direction:o?E:null}),e.resizable&&(0,a.jsx)("div",{role:"separator","aria-orientation":"vertical","aria-label":`Resize column ${r}`,className:n.tkx("cursor-col-resize shrink-0"),style:{position:"absolute",right:0,top:0,bottom:0,width:4,backgroundColor:"transparent"},onMouseDown:t=>ke(e.key,t)})]})},e.key)})]}),(C||Le)&&(0,a.jsxs)("tr",{role:"row","aria-label":"Column filters",children:[s&&(0,a.jsx)("th",{scope:"col",style:{backgroundColor:R.surfaceAlt,borderBottom:`1px solid ${R.border}`,borderRight:Ne,padding:`4px ${$e}`,width:40}}),e.map(e=>(0,a.jsx)("th",{scope:"col",style:{backgroundColor:R.surfaceAlt,borderBottom:`1px solid ${R.border}`,borderRight:Ne,padding:`4px ${$e}`},children:(e.filterable||C)&&(0,a.jsx)("input",{type:"text",value:U[e.key]??"",onChange:t=>K(e.key,t.target.value),placeholder:`Filter ${e.header}…`,"aria-label":`Filter by ${e.header}`,style:{width:"100%",padding:"3px 8px",fontSize:12,borderRadius:4,border:`1px solid ${R.border}`,backgroundColor:R.bg,color:R.text,outline:"none"}})},e.key))]})]}),h&&(0,a.jsx)(In,{colCount:Ie}),!h&&(0,a.jsx)("tbody",{children:0===Q.length?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:Ie,className:n.tkx("text-center py-10"),style:{color:R.textMuted},children:Me})}):(0,a.jsxs)(a.Fragment,{children:[ee&&ce>0&&(0,a.jsx)("tr",{"aria-hidden":"true",children:(0,a.jsx)("td",{colSpan:Ie,style:{height:ce,padding:0,border:"none"}})}),de.map((t,o)=>{const r=ae+o,l=zn(t,i),d=he.has(l),c=x&&r%2==1;let u="transparent";return d?u=`${R.primary}22`:c&&(u=R.surfaceAlt),(0,a.jsxs)("tr",{role:"row","aria-rowindex":r+1,"aria-selected":s?d:void 0,onClick:v?()=>v(t):void 0,onKeyDown:v?e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),v(t))}:void 0,tabIndex:v?0:void 0,className:n.tkx(v?"cursor-pointer":""),style:{backgroundColor:u,transition:B?"none":"background-color 120ms ease",...ee?{height:k,boxSizing:"border-box"}:{}},onMouseEnter:v?e=>{e.currentTarget.style.backgroundColor=d?`${R.primary}30`:R.surfaceAlt}:void 0,onMouseLeave:v?e=>{e.currentTarget.style.backgroundColor=u}:void 0,children:[s&&(0,a.jsx)("td",{role:"gridcell",style:{borderBottom:`1px solid ${R.border}`,borderRight:Ne,padding:`${Se} ${$e}`,textAlign:"center",width:40},children:(0,a.jsxs)("label",{style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",margin:"0 auto",width:16},onClick:e=>e.stopPropagation(),children:[(0,a.jsx)("input",{type:"checkbox",checked:d,onChange:()=>be(l),"aria-label":d?`Deselect row ${l}`:`Select row ${l}`,style:{position:"absolute",opacity:0,width:16,height:16,cursor:"pointer",margin:0}}),(0,a.jsx)($n,{checked:d})]})}),e.map(e=>{const o=Nn(t,e.key),r=e.renderCell?e.renderCell(o,t):"string"==typeof o?n.sanitizeString(o):String(o??"");return(0,a.jsx)("td",{role:"gridcell",className:n.tkx("text-sm"),style:{...ze(e),borderBottom:`1px solid ${R.border}`,borderRight:Ne,color:R.text,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r},e.key)})]},l)}),ee&&se<Q.length&&(0,a.jsx)("tr",{"aria-hidden":"true",children:(0,a.jsx)("td",{colSpan:Ie,style:{height:(Q.length-se)*k,padding:0,border:"none"}})})]})})]}),(L||W)&&(0,a.jsx)("div",{ref:ue,style:{height:1,width:"100%"},children:W&&(0,a.jsx)("table",{style:{width:"100%",borderCollapse:"collapse"},children:(0,a.jsx)("tbody",{children:Array.from({length:3},(t,n)=>(0,a.jsx)("tr",{children:e.map(e=>(0,a.jsx)("td",{style:{padding:"10px 16px"},children:(0,a.jsx)(T,{variant:"text",height:"16px"})},e.key))},n))})})}),!L&&I&&(0,a.jsx)("div",{style:{padding:"16px",textAlign:"center",fontSize:13,color:R.textMuted},children:"✓ All rows loaded"})]}),Z&&!h&&(0,a.jsx)(Wn,{page:q,totalPages:J,pageSize:z,totalRows:_,onPageChange:G,theme:R})]})},exports.TkxDatePicker=$e,exports.TkxDivider=E,exports.TkxDrawer=function({isOpen:e,onClose:r,placement:i="right",size:d="md",title:c,children:u,footer:p,closeOnOverlayClick:h=!0,closeOnEsc:f=!0}){const m=t.useTheme(),x=o.useReducedMotion(),g=(0,l.useId)(),b=o.useFocusTrap(e);if(o.useEscapeKey(r,f&&e),(0,l.useEffect)(()=>{if(e){if(1===++ue&&(document.body.style.overflow="hidden"),n.isFramed())try{window.dispatchEvent(new CustomEvent("tkx:framed-drawer",{detail:{placement:i,at:Date.now()}}))}catch{}}else pe();return()=>{e&&pe()}},[e,i]),"undefined"==typeof document)return null;const y=function(e,t){const n=ce[t],o={position:"absolute"};return"left"===e||"right"===e?{...o,top:0,bottom:0,[e]:0,width:n,maxWidth:"100vw",height:"100%"}:{...o,left:0,right:0,[e]:0,height:n,maxHeight:"100vh",width:"100%"}}(i,d),v=function(e){switch(e){case"left":return"translateX(-100%)";case"right":return"translateX(100%)";case"top":return"translateY(-100%)";case"bottom":return"translateY(100%)"}}(i),w=x?"none":"transform 280ms cubic-bezier(0.4,0,0.2,1), opacity 280ms ease",k="string"==typeof c?n.sanitizeString(c):c;return(0,s.createPortal)((0,a.jsxs)("div",{role:"presentation",className:n.tkx("fixed inset-0 z-[9000]"),style:{pointerEvents:e?"auto":"none",visibility:e?"visible":"hidden"},children:[(0,a.jsx)("div",{"aria-hidden":"true",onClick:h?r:void 0,className:n.tkx("absolute inset-0"),style:{backgroundColor:"rgba(0,0,0,0.55)",backdropFilter:"blur(3px)",opacity:e?1:0,transition:x?"none":"opacity 280ms ease",cursor:h?"pointer":"default"}}),(0,a.jsxs)("div",{ref:b,role:"dialog","aria-modal":"true","aria-labelledby":c?g:void 0,className:n.tkx("absolute flex flex-col font-sans"),style:{...y,backgroundColor:m.surface,borderLeft:"right"===i?`1px solid ${m.border}`:void 0,borderRight:"left"===i?`1px solid ${m.border}`:void 0,borderTop:"bottom"===i?`1px solid ${m.border}`:void 0,borderBottom:"top"===i?`1px solid ${m.border}`:void 0,boxShadow:`0 20px 60px ${m.bg}99`,transform:e?"translate(0,0)":v,opacity:e?1:0,transition:w,willChange:"transform"},children:[void 0!==c&&(0,a.jsxs)("div",{className:n.tkx("flex items-center justify-between px-5 py-4 shrink-0"),style:{borderBottom:`1px solid ${m.border}`},children:[(0,a.jsx)("h2",{id:g,className:n.tkx("m-0 text-base font-semibold leading-snug"),style:{color:m.text},children:k}),(0,a.jsx)("button",{onClick:r,"aria-label":"Close drawer",className:n.tkx("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:m.textMuted},children:(0,a.jsx)(he,{})})]}),void 0===c&&(0,a.jsx)("div",{className:n.tkx("flex justify-end px-3 pt-3 shrink-0"),children:(0,a.jsx)("button",{onClick:r,"aria-label":"Close drawer",className:n.tkx("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:m.textMuted},children:(0,a.jsx)(he,{})})}),(0,a.jsx)("div",{className:n.tkx("flex-1 overflow-y-auto px-5 py-4"),style:{color:m.text},children:u}),p&&(0,a.jsx)("div",{className:n.tkx("flex items-center justify-end gap-2 px-5 py-4 shrink-0"),style:{borderTop:`1px solid ${m.border}`},children:p})]})]}),document.body)},exports.TkxDropdown=function({trigger:e,items:t,groups:n,placement:o="bottom-start",onSelect:r,selectedKeys:i,multiSelect:d=!1,searchable:c=!1,searchPlaceholder:u="Search…",closeOnSelect:p,disabled:h=!1,maxHeight:f=320,minWidth:m=200,open:x,onOpenChange:g,portal:b=!0,offset:y=6,renderItem:v}){const[w,k]=(0,l.useState)(!1),[C,S]=(0,l.useState)([]),[$,z]=(0,l.useState)({top:0,left:0,minWidth:m}),N=(0,l.useRef)(null),M=(0,l.useRef)(null),I=(0,l.useId)(),L=void 0!==x?x:w,W=void 0!==i?i:C,D=void 0!==p?p:!d,R=n??(t?[{items:t}]:[{items:[]}]),T=(0,l.useCallback)(e=>{void 0===x&&k(e),g?.(e)},[x,g]),B=(0,l.useCallback)((e,t)=>{d&&void 0===i&&S(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),r?.(e,t),D&&T(!1)},[d,i,r,D,T]),A=(0,l.useCallback)(()=>T(!1),[T]);(0,l.useEffect)(()=>{L&&N.current&&z(Ko(N.current,M.current,o,y))},[L,o,y]),(0,l.useEffect)(()=>{L&&N.current&&M.current&&z(Ko(N.current,M.current,o,y))},[L,o,y]),(0,l.useEffect)(()=>{if(!L)return;const e=e=>{const t=e.target;N.current&&!N.current.contains(t)&&M.current&&!M.current.contains(t)&&T(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[L,T]);const F=L?(0,a.jsx)(qo,{groups:R,position:$,maxHeight:f,minWidth:m,selectedKeys:W,multiSelect:d,searchable:c,searchPlaceholder:u,onSelect:B,onClose:A,renderItem:v,menuRef:M,isPortal:b,menuId:I}):null;return(0,a.jsxs)("div",{style:{display:"inline-block",position:"relative"},children:[(0,a.jsx)("div",{ref:N,onClick:()=>{h||T(!L)},"aria-haspopup":"menu","aria-expanded":L,"aria-controls":L?I:void 0,"aria-disabled":h,style:{cursor:h?"not-allowed":"pointer",opacity:h?.5:1,display:"inline-block"},children:e}),b&&"undefined"!=typeof document?(0,s.createPortal)(F,document.body):F]})},exports.TkxEmpty=function({image:e="default",description:o="No data",children:r,style:i}){const a=t.useTheme(),s="string"==typeof o?n.sanitizeString(o):o;let d;return d="default"===e?(0,l.createElement)($o,{color:a.primary,mutedColor:a.textMuted}):"simple"===e?(0,l.createElement)(zo,{mutedColor:a.textMuted}):e,(0,l.createElement)("div",{role:"status",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"32px 16px",textAlign:"center",...i}},(0,l.createElement)("div",{style:{marginBottom:"12px",opacity:.85}},d),s&&(0,l.createElement)("div",{style:{color:a.textMuted,fontSize:"0.875rem",lineHeight:"1.5",maxWidth:"320px"}},s),r&&(0,l.createElement)("div",{style:{marginTop:"16px"}},r))},exports.TkxFileUpload=function({accept:e,multiple:r=!1,maxSize:i,maxFiles:s,onChange:d,onError:c,label:u="Upload files",hint:p,isDisabled:h=!1,preview:f=!0,dragDrop:m=!0,variant:x="dropzone"}){const g=t.useTheme(),b=o.useReducedMotion(),y=(0,l.useId)(),v=(0,l.useRef)(null),[w,k]=(0,l.useState)(!1),[C,S]=(0,l.useState)([]);(0,l.useEffect)(()=>()=>{C.forEach(e=>{e.objectUrl&&URL.revokeObjectURL(e.objectUrl)})},[]);const $=(0,l.useCallback)(e=>{let t=0;const n=setInterval(()=>{t+=Math.floor(20*Math.random())+10,t>=100&&(t=100,clearInterval(n)),S(n=>n.map(n=>n.id===e?{...n,progress:t}:n))},100)},[]),z=(0,l.useCallback)(t=>i&&t.size>i?`"${n.sanitizeString(t.name)}" exceeds max size of ${Fe(i)}`:/[\u0000-\u001F\u007F]|\.\.\/|\.\.\\/.test(t.name)?`"${n.sanitizeString(t.name)}" contains forbidden characters`:e&&!e.split(",").map(e=>e.trim()).some(e=>e.startsWith(".")?t.name.toLowerCase().endsWith(e.toLowerCase()):e.endsWith("/*")?t.type.startsWith(e.slice(0,-1)):t.type===e)?`"${n.sanitizeString(t.name)}" is not an accepted file type`:void 0,[e,i]),N=(0,l.useCallback)(async e=>{if(!e.error)try{const t=await n.sniffMimeType(e.file);if(t&&e.file.type&&!e.file.type.startsWith(t.split("/")[0])){const t=`"${n.sanitizeString(e.file.name)}" file content does not match its type`;S(n=>n.map(n=>n.id===e.id?{...n,error:t}:n)),c?.(t)}}catch{}},[c]),M=(0,l.useCallback)(e=>{const t=s?s-C.length:1/0;if(t<=0)return void c?.(`Maximum of ${s} file${1===s?"":"s"} allowed`);const n=e.slice(0,t).map(e=>{const t=z(e),n=f&&e.type.startsWith("image/")&&!t?URL.createObjectURL(e):void 0;return{file:e,id:"tkx-file-"+ ++Ee,objectUrl:n,progress:0,error:t}});S(e=>{const t=r?[...e,...n]:n,o=t.filter(e=>!e.error).map(e=>e.file);return d?.(o),t}),n.forEach(e=>{e.error?c?.(e.error):N(e)}),n.forEach(e=>{e.error||$(e.id)})},[C.length,s,r,d,c,f,$,z]),I=(0,l.useCallback)(e=>{const t=Array.from(e.target.files??[]);t.length&&M(t),e.target.value=""},[M]),L=(0,l.useCallback)(e=>{if(e.preventDefault(),k(!1),h)return;const t=Array.from(e.dataTransfer.files);t.length&&M(t)},[h,M]),W=(0,l.useCallback)(e=>{e.preventDefault(),h||k(!0)},[h]),D=(0,l.useCallback)(()=>k(!1),[]),R=(0,l.useCallback)(e=>{S(t=>{const n=t.find(t=>t.id===e);n?.objectUrl&&URL.revokeObjectURL(n.objectUrl);const o=t.filter(t=>t.id!==e);return d?.(o.filter(e=>!e.error).map(e=>e.file)),o})},[d]),T=(0,l.useCallback)(()=>{h||v.current?.click()},[h]),B=w?g.primary:g.border,A=n.sanitizeString(u),F=p?n.sanitizeString(p):"",H=(0,a.jsxs)("div",{role:"button",tabIndex:h?-1:0,"aria-label":A,"aria-describedby":p?y:void 0,"aria-disabled":h,onClick:T,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),T())},onDrop:m?L:void 0,onDragOver:m?W:void 0,onDragLeave:m?D:void 0,className:n.tkx("flex flex-col items-center justify-center gap-3 w-full p-8 rounded-lg"),style:{border:`2px dashed ${B}`,backgroundColor:w?`${g.primary}10`:g.surface,cursor:h?"not-allowed":"pointer",opacity:h?.5:1,transition:b?"none":"border-color 150ms ease, background-color 150ms ease",outline:"none"},children:[(0,a.jsxs)("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:w?g.primary:g.textMuted,strokeWidth:1.5,"aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,a.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,a.jsx)("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),(0,a.jsxs)("div",{className:n.tkx("text-center"),children:[(0,a.jsx)("p",{className:n.tkx("m-0 text-sm font-medium"),style:{color:g.text},children:w?"Drop files here":A}),F&&(0,a.jsx)("p",{id:y,className:n.tkx("m-0 text-xs mt-1"),style:{color:g.textMuted},children:F})]})]}),E=(0,a.jsxs)("button",{type:"button",disabled:h,onClick:T,"aria-describedby":p?y:void 0,className:n.tkx("flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium font-sans border-none cursor-pointer"),style:{backgroundColor:g.primary,color:g.bg,opacity:h?.5:1,cursor:h?"not-allowed":"pointer"},children:[(0,a.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[(0,a.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,a.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,a.jsx)("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),A,p&&(0,a.jsx)("span",{id:y,className:n.tkx("sr-only"),children:F})]});return(0,a.jsxs)("div",{className:n.tkx("flex flex-col gap-3 w-full font-sans"),children:[(0,a.jsx)("input",{ref:v,type:"file",accept:e,multiple:r,disabled:h,onChange:I,className:n.tkx("sr-only"),tabIndex:-1,"aria-hidden":"true"}),"dropzone"===x?H:E,C.length>0&&(0,a.jsx)("ul",{role:"status","aria-live":"polite","aria-label":"Uploaded files",className:n.tkx("m-0 p-0 flex flex-col gap-2"),style:{listStyle:"none"},children:C.map(e=>(0,a.jsxs)("li",{className:n.tkx("flex flex-col gap-1 rounded-md p-3"),style:{backgroundColor:g.surfaceAlt,border:`1px solid ${e.error?g.danger:g.border}`},children:[(0,a.jsxs)("div",{className:n.tkx("flex items-center gap-3"),children:[e.objectUrl&&f?(0,a.jsx)("img",{src:e.objectUrl,alt:n.sanitizeString(e.file.name),className:n.tkx("rounded"),style:{width:40,height:40,objectFit:"cover",flexShrink:0}}):(0,a.jsx)("span",{style:{flexShrink:0},children:(0,a.jsx)(He,{mimeType:e.file.type,color:e.error?g.danger:g.textMuted})}),(0,a.jsxs)("div",{className:n.tkx("flex flex-col gap-0.5 flex-1 min-w-0"),children:[(0,a.jsx)("span",{className:n.tkx("text-sm font-medium truncate"),style:{color:e.error?g.danger:g.text},title:e.file.name,children:n.sanitizeString(e.file.name)}),(0,a.jsxs)("span",{className:n.tkx("text-xs"),style:{color:g.textMuted},children:[Fe(e.file.size),e.error&&` — ${e.error}`]})]}),(0,a.jsx)("button",{type:"button","aria-label":`Remove ${n.sanitizeString(e.file.name)}`,onClick:()=>R(e.id),className:n.tkx("flex items-center justify-center bg-transparent border-none cursor-pointer rounded p-1"),style:{color:g.textMuted,flexShrink:0},children:(0,a.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),!e.error&&e.progress<100&&(0,a.jsx)("div",{className:n.tkx("w-full overflow-hidden"),style:{height:"3px",borderRadius:"3px",backgroundColor:g.border},"aria-hidden":"true",children:(0,a.jsx)("div",{style:{height:"100%",borderRadius:"3px",backgroundColor:g.primary,width:`${e.progress}%`,transition:b?"none":"width 100ms ease"}})})]},e.id))})]})},exports.TkxFooter=ro,exports.TkxForm=r.TkxForm,exports.TkxFormField=r.TkxFormField,exports.TkxHeader=eo,exports.TkxImage=function({src:e,alt:r,fallback:i,placeholder:d="skeleton",fit:c="cover",ratio:u="auto",radius:p="none",caption:h,lazy:f=!0,preview:m=!1,className:x,style:g,...b}){const y=t.useTheme(),v=o.useReducedMotion(),[w,k]=(0,l.useState)(!1),[C,S]=(0,l.useState)(!1),[$,z]=(0,l.useState)(!1),N=(0,l.useRef)(null),M=n.sanitizeString(e),I=r?n.sanitizeString(r):"",L=h?n.sanitizeString(h):"",W=Be[p];(0,l.useEffect)(()=>{N.current?.complete&&k(!0)},[]);const D=(0,l.useCallback)(()=>k(!0),[]),R=(0,l.useCallback)(()=>S(!0),[]),T=(0,l.useCallback)(()=>{m&&!C&&z(!0)},[m,C]),B=(0,l.useCallback)(()=>z(!1),[]);(0,l.useEffect)(()=>{if(!$)return;const e=e=>{"Escape"===e.key&&B()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[$,B]);const A="skeleton"===d&&!w&&!C,F=A&&!v?{animation:"tkx-shimmer 1.5s ease-in-out infinite"}:{},H=C?null:(0,a.jsx)("img",{ref:N,src:M,alt:I||void 0,role:I?void 0:"img","aria-label":I?void 0:"Image",loading:f?"lazy":void 0,onLoad:D,onError:R,onClick:m?T:void 0,className:n.cx(n.tkx("block w-full h-full"),m&&!C?n.tkx("cursor-pointer"):""),style:{objectFit:c,borderRadius:W,opacity:w?1:0,transition:v?"none":"opacity 200ms ease",position:"auto"===u?void 0:"absolute",inset:"auto"===u?void 0:0},...b}),E=C?i?(0,a.jsx)(a.Fragment,{children:i}):(0,a.jsxs)("div",{role:"img","aria-label":I||"Image failed to load",className:n.tkx("flex flex-col items-center justify-center gap-2 w-full h-full"),style:{backgroundColor:y.surfaceAlt,borderRadius:W,color:y.textMuted,minHeight:"80px"},children:[(0,a.jsx)(Ae,{color:y.textMuted,size:32}),(0,a.jsx)("span",{className:n.tkx("text-xs"),style:{color:y.textMuted},children:"Failed to load"})]}):null,j=A?(0,a.jsx)("div",{"aria-hidden":"true",style:{position:"auto"===u?void 0:"absolute",inset:"auto"===u?void 0:0,width:"100%",height:"auto"===u?"100%":void 0,minHeight:"auto"===u?"80px":void 0,borderRadius:W,backgroundColor:y.surfaceAlt,...F}}):null,O="auto"===u?(0,a.jsxs)("div",{className:n.tkx("relative w-full"),style:{borderRadius:W},children:[j,H,E]}):(0,a.jsxs)("div",{className:n.tkx("relative w-full overflow-hidden"),style:{paddingBottom:Te[u],borderRadius:W},children:[j,H,E]}),P=L?(0,a.jsxs)("figure",{className:n.tkx("m-0 p-0 flex flex-col gap-2"),style:{borderRadius:W},children:[O,(0,a.jsx)("figcaption",{className:n.tkx("text-sm text-center"),style:{color:y.textMuted},children:L})]}):O;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:n.cx(n.tkx("inline-block w-full"),x),style:g,children:P}),$&&"undefined"!=typeof document?(0,s.createPortal)((0,a.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":I||"Image preview",className:n.tkx("fixed inset-0 z-[9500] flex items-center justify-center p-4"),onClick:B,children:[(0,a.jsx)("div",{"aria-hidden":"true",className:n.tkx("absolute inset-0"),style:{backgroundColor:"rgba(0,0,0,0.85)",backdropFilter:"blur(6px)"}}),(0,a.jsx)("img",{src:M,alt:I||"Full-size preview",onClick:e=>e.stopPropagation(),className:n.tkx("relative z-10 max-w-full max-h-full"),style:{objectFit:"contain",borderRadius:"8px",boxShadow:"0 25px 60px rgba(0,0,0,0.5)"}}),(0,a.jsx)("button",{"aria-label":"Close preview",onClick:B,className:n.tkx("absolute top-4 right-4 z-10 flex items-center justify-center","bg-transparent border-none cursor-pointer rounded-full p-2"),style:{color:"#fff",backgroundColor:"rgba(255,255,255,0.15)"},children:(0,a.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),document.body):null]})},exports.TkxInput=g,exports.TkxLayout=Qn,exports.TkxList=function({items:e,header:r,footer:i,bordered:l=!0,size:s="md",loading:d=!1,emptyText:c="No data",grid:u}){const p=t.useTheme(),h=o.useReducedMotion(),f=n.sanitizeString(c),m=Ho[s],x=!!u,g=u?.column??1,b=u?.gutter??16;return(0,a.jsxs)("div",{role:"list","aria-label":"List","aria-busy":d,className:n.tkx("font-sans rounded-lg overflow-hidden"),style:{border:l?`1px solid ${p.border}`:"none",backgroundColor:p.surface},children:[r&&(0,a.jsx)("div",{className:n.tkx("font-semibold text-sm"),style:{padding:m,color:p.text,borderBottom:`1px solid ${p.border}`,backgroundColor:p.surfaceAlt},children:r}),d&&(0,a.jsx)("div",{children:Array.from({length:3}).map((e,t)=>(0,a.jsx)(Eo,{theme:p,reducedMotion:h},t))}),!d&&0===e.length&&(0,a.jsx)("div",{role:"status",className:n.tkx("text-center py-12 text-sm"),style:{color:p.textMuted},children:f}),!d&&e.length>0&&(0,a.jsx)("div",{style:x?{display:"grid",gridTemplateColumns:`repeat(${g}, 1fr)`,gap:b,padding:b}:void 0,children:e.map((t,o)=>{const r=n.sanitizeString(t.title),i=t.description?n.sanitizeString(t.description):void 0;return(0,a.jsxs)("div",{role:"listitem",className:n.tkx("flex items-start gap-3"),style:{padding:m,borderBottom:!x&&o<e.length-1?`1px solid ${p.border}`:"none",...x?{border:`1px solid ${p.border}`,borderRadius:8,backgroundColor:p.surface}:{},animation:h?"none":`tkxFadeIn 0.2s ease ${.03*o}s both`},children:[t.avatar&&(0,a.jsx)("div",{"aria-hidden":"true",className:n.tkx("shrink-0"),children:t.avatar}),(0,a.jsxs)("div",{className:n.tkx("flex-1 min-w-0"),children:[(0,a.jsx)("div",{className:n.tkx("text-sm font-medium"),style:{color:p.text},children:r}),i&&(0,a.jsx)("div",{className:n.tkx("text-xs mt-1 leading-relaxed"),style:{color:p.textMuted},children:i})]}),t.extra&&(0,a.jsx)("div",{className:n.tkx("shrink-0 ml-auto"),style:{color:p.textMuted},children:t.extra}),t.actions&&(0,a.jsx)("div",{className:n.tkx("shrink-0 flex items-center gap-2"),children:t.actions})]},t.key)})}),i&&(0,a.jsx)("div",{className:n.tkx("text-sm"),style:{padding:m,color:p.textMuted,borderTop:`1px solid ${p.border}`,backgroundColor:p.surfaceAlt},children:i})]})},exports.TkxMarkdown=Gn,exports.TkxMasonry=function({columns:e,gap:r=16,children:i}){t.useTheme();const s=o.useReducedMotion(),d=function(){const[e,t]=(0,l.useState)(()=>{if("undefined"==typeof window)return"lg";const e=window.innerWidth;return e>=1024?"lg":e>=768?"md":"sm"});return(0,l.useEffect)(()=>{if("undefined"==typeof window)return;const e=()=>{const e=window.innerWidth;t(e>=1024?"lg":e>=768?"md":"sm")};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}();(0,l.useEffect)(()=>{!function(){if(Dn||"undefined"==typeof document)return;Dn=!0;const e=document.createElement("style");e.id="tkx-masonry-kf",e.textContent="\n @keyframes tkx-masonry-fade-in {\n from { opacity: 0; transform: translateY(8px); }\n to { opacity: 1; transform: translateY(0); }\n }\n ",document.head.appendChild(e)}()},[]);const c=function(e,t){return void 0===e?3:"number"==typeof e?Math.max(1,e):"lg"===t?e.lg??e.md??e.sm??3:"md"===t?e.md??e.sm??2:e.sm??1}(e,d),u=l.Children.toArray(i),p=(0,l.useMemo)(()=>{const e=Array.from({length:c},()=>[]);return u.forEach((t,n)=>{e[n%c].push(t)}),e},[u,c]);return(0,a.jsx)("div",{role:"list","aria-label":"Masonry grid",className:n.tkx("flex w-full"),style:{gap:r,alignItems:"flex-start"},children:p.map((e,t)=>(0,a.jsx)("div",{className:n.tkx("flex flex-col"),style:{flex:1,gap:r,minWidth:0},children:e.map((e,n)=>{return(0,a.jsx)("div",{role:"listitem",style:(o=n*c+t,s?{}:{animation:"tkx-masonry-fade-in 300ms cubic-bezier(0.16,1,0.3,1) both",animationDelay:`${Math.min(40*o,400)}ms`}),children:e},n);var o})},t))})},exports.TkxMentions=function({options:e,value:r="",onChange:i,trigger:s="@",placeholder:d,label:c}){const u=t.useTheme(),p=o.useReducedMotion(),h=(0,l.useRef)(null),f=(0,l.useRef)(null),[m,x]=(0,l.useState)(r),[g,b]=(0,l.useState)(!1),[y,v]=(0,l.useState)(""),[w,k]=(0,l.useState)(0),[C,S]=(0,l.useState)(-1);(0,l.useEffect)(()=>{void 0!==r&&x(r)},[r]);const $=e.filter(e=>e.label.toLowerCase().includes(y.toLowerCase())),z=(0,l.useCallback)(e=>{const t=e.target.value;x(t),i?.(t);const n=e.target.selectionStart??t.length,o=t.slice(0,n),r=o.lastIndexOf(s);if(r>=0){const e=o.slice(r+s.length);if(!/\s/.test(e))return v(e),S(r),b(!0),void k(0)}b(!1)},[s,i]),N=(0,l.useCallback)(e=>{const t=m.slice(0,C),n=m.slice(C+s.length+y.length),o=`${t}${s}${e.value} ${n}`;x(o),i?.(o),b(!1),h.current?.focus()},[m,C,s,y,i]),M=(0,l.useCallback)(e=>{g&&("ArrowDown"===e.key?(e.preventDefault(),k(e=>(e+1)%$.length)):"ArrowUp"===e.key?(e.preventDefault(),k(e=>(e-1+$.length)%$.length)):"Enter"===e.key&&$[w]?(e.preventDefault(),N($[w])):"Escape"===e.key&&b(!1))},[g,$,w,N]);(0,l.useEffect)(()=>{g&&f.current&&f.current.children[w]?.scrollIntoView({block:"nearest"})},[w,g]);const I=c?n.sanitizeString(c):void 0,L=d?n.sanitizeString(d):void 0;return(0,a.jsxs)("div",{className:n.tkx("relative font-sans"),style:{width:"100%"},children:[I&&(0,a.jsx)("label",{className:n.tkx("block text-sm font-medium mb-1"),style:{color:u.text},children:I}),(0,a.jsx)("textarea",{ref:h,role:"combobox","aria-expanded":g,"aria-haspopup":"listbox","aria-autocomplete":"list","aria-label":I??"Mentions input",value:m,placeholder:L,onChange:z,onKeyDown:M,onBlur:()=>setTimeout(()=>b(!1),200),className:n.tkx("w-full rounded-lg border px-3 py-2 text-sm resize-y"),style:{backgroundColor:u.surface,borderColor:u.border,color:u.text,minHeight:80,outline:"none"},rows:3}),g&&$.length>0&&(0,a.jsx)("ul",{ref:f,role:"listbox","aria-label":"Mention suggestions",className:n.tkx("absolute left-0 right-0 z-50 rounded-lg border overflow-auto"),style:{backgroundColor:u.surface,borderColor:u.border,maxHeight:200,top:"100%",marginTop:4,listStyle:"none",padding:0,boxShadow:`0 4px 12px ${u.bg}80`,animation:p?"none":"tkxFadeIn 0.15s ease"},children:$.map((e,t)=>(0,a.jsxs)("li",{role:"option","aria-selected":t===w,className:n.tkx("flex items-center gap-3 px-3 py-2 cursor-pointer text-sm"),style:{backgroundColor:t===w?u.surfaceAlt:"transparent",color:u.text},onMouseDown:t=>{t.preventDefault(),N(e)},onMouseEnter:()=>k(t),children:[e.avatar&&(0,a.jsx)("img",{src:n.sanitizeString(e.avatar),alt:"","aria-hidden":"true",width:24,height:24,className:n.tkx("rounded-full"),style:{objectFit:"cover"}}),(0,a.jsx)("span",{children:n.sanitizeString(e.label)}),(0,a.jsxs)("span",{style:{color:u.textMuted,marginLeft:"auto"},children:[s,n.sanitizeString(e.value)]})]},e.value))})]})},exports.TkxMenu=mt,exports.TkxModal=function({isOpen:e,onClose:r,title:i,size:d="md",closeOnOverlayClick:c=!0,closeOnEscape:u=!0,children:p,footer:h}){const f=t.useTheme(),m=(0,l.useId)(),x=o.useFocusTrap(e),g=o.useReducedMotion(),b=o.useAnnounce(),y=n.sanitizeString(i),v="full"===d;return o.useEscapeKey(r,u&&e),(0,l.useEffect)(()=>{if(e){if(1===++M&&(document.body.style.overflow="hidden"),b(y,"polite"),n.isFramed())try{window.dispatchEvent(new CustomEvent("tkx:framed-modal",{detail:{title:y,at:Date.now()}}))}catch{}}else I();return()=>{e&&I()}},[e,y,b]),e&&"undefined"!=typeof document?(0,s.createPortal)((0,a.jsxs)("div",{role:"presentation",className:n.tkx("fixed inset-0 z-[9000] flex",v?"items-stretch":"items-center justify-center",v?"":"p-4"),children:[(0,a.jsx)("div",{"aria-hidden":"true",onClick:c?r:void 0,className:n.tkx("absolute inset-0",!g&&"animate-fade-in"),style:{backgroundColor:"rgba(0,0,0,0.6)",backdropFilter:"blur(4px)"}}),(0,a.jsxs)("div",{ref:x,role:"dialog","aria-modal":"true","aria-labelledby":m,className:n.tkx("relative z-10 flex flex-col overflow-hidden",!g&&"animate-slide-up",v?"":"rounded-xl"),style:{backgroundColor:f.surface,border:`1px solid ${f.border}`,width:N[d],maxWidth:"100%",maxHeight:v?"100vh":"90vh",boxShadow:`0 20px 60px ${f.bg}80`},children:[(0,a.jsxs)("div",{className:n.tkx("flex items-center justify-between px-6 py-5 shrink-0"),style:{borderBottom:`1px solid ${f.border}`},children:[(0,a.jsx)("h2",{id:m,className:n.tkx("m-0 text-lg font-semibold font-sans"),style:{color:f.text},children:y}),(0,a.jsx)("button",{onClick:r,"aria-label":"Close dialog",className:n.tkx("bg-transparent border-none cursor-pointer rounded p-1 flex items-center justify-center focus-visible:focus-ring"),style:{color:f.textMuted},children:(0,a.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),(0,a.jsx)("div",{className:n.tkx("flex-1 overflow-y-auto px-6 py-6 font-sans"),style:{color:f.text},children:p}),h&&(0,a.jsx)("div",{className:n.tkx("flex justify-end gap-2 px-6 py-4 shrink-0"),style:{borderTop:`1px solid ${f.border}`},children:h})]})]}),document.body):null},exports.TkxNumberInput=Xt,exports.TkxOTP=_t,exports.TkxOrgChart=Vo,exports.TkxPagination=Re,exports.TkxParagraph=function({children:e,type:o="default",copyable:r=!1,ellipsis:i=!1,style:a}){const s=t.useTheme(),d="secondary"===o?s.textMuted:s.text,c=go(e),u="string"==typeof e?n.sanitizeString(e):e,p={};if(i){const e="object"==typeof i?i.rows??3:3;p.display="-webkit-box",p.WebkitLineClamp=e,p.WebkitBoxOrient="vertical",p.overflow="hidden"}return(0,l.createElement)("div",{style:{color:d,fontSize:"1rem",lineHeight:"1.6",margin:"0 0 1em 0",...p,...a}},u,r&&(0,l.createElement)(bo,{text:c}))},exports.TkxPopover=function({trigger:e,content:r,placement:i="bottom",isOpen:d,onOpenChange:c,closeOnClickOutside:u=!0,className:p,style:h}){const f=t.useTheme(),m=o.useReducedMotion(),x=(0,l.useId)(),g=void 0!==d,[b,y]=(0,l.useState)(!1),v=g?d:b,w=(0,l.useRef)(null),k=(0,l.useRef)(null);(0,l.useRef)(null);const[C,S]=(0,l.useState)(null),$=(0,l.useCallback)(e=>{g||y(e),c?.(e)},[g,c]),z=(0,l.useCallback)(()=>$(!1),[$]),N=(0,l.useCallback)(()=>$(!v),[$,v]);o.useEscapeKey(z,v),(0,l.useEffect)(()=>{if(!v||!u)return;const e=e=>{const t=e.target;w.current?.contains(t)||k.current?.contains(t)||z()};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[v,u,z]),(0,l.useEffect)(()=>{if(!v||!w.current)return;const e=()=>{w.current&&k.current&&S(function(e,t,n){const o=t.getBoundingClientRect(),r=window.scrollX,i=window.scrollY,l=window.innerWidth,a=window.innerHeight;let s=0,d=0,c=n;const u={top:e.top-o.height-8-8>0,bottom:e.bottom+o.height+8+8<a,left:e.left-o.width-8-8>0,right:e.right+o.width+8+8<l};if(!u[n]){const e={top:"bottom",bottom:"top",left:"right",right:"left"};u[e[n]]&&(c=e[n])}switch(c){case"top":s=e.top+i-o.height-8-8,d=e.left+r+e.width/2-o.width/2;break;case"bottom":s=e.bottom+i+8+8,d=e.left+r+e.width/2-o.width/2;break;case"left":s=e.top+i+e.height/2-o.height/2,d=e.left+r-o.width-8-8;break;case"right":s=e.top+i+e.height/2-o.height/2,d=e.right+r+8+8}d=Math.max(8,Math.min(d,l+r-o.width-8)),s=Math.max(8,Math.min(s,a+i-o.height-8));const p={position:"absolute",width:0,height:0,borderStyle:"solid",borderWidth:8};switch(c){case"top":Object.assign(p,{bottom:-16,left:"50%",transform:"translateX(-50%)",borderColor:"var(--tkx-popover-bg) transparent transparent transparent"});break;case"bottom":Object.assign(p,{top:-16,left:"50%",transform:"translateX(-50%)",borderColor:"transparent transparent var(--tkx-popover-bg) transparent"});break;case"left":Object.assign(p,{right:-16,top:"50%",transform:"translateY(-50%)",borderColor:"transparent transparent transparent var(--tkx-popover-bg)"});break;case"right":Object.assign(p,{left:-16,top:"50%",transform:"translateY(-50%)",borderColor:"transparent var(--tkx-popover-bg) transparent transparent"})}return{top:s,left:d,arrowStyle:p,resolvedPlacement:c}}(w.current.getBoundingClientRect(),k.current,i))};return requestAnimationFrame(e),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[v,i]);const M=m?{opacity:1}:{animation:"tkxPopoverFadeIn 150ms ease forwards",opacity:0},I=v&&"undefined"!=typeof document?(0,s.createPortal)((0,a.jsxs)("div",{ref:k,id:x,role:"dialog","aria-modal":"false",className:n.tkx("absolute z-[9100] rounded-lg font-sans",p??""),style:{"--tkx-popover-bg":f.surface,top:C?.top??-9999,left:C?.left??-9999,backgroundColor:f.surface,border:`1px solid ${f.border}`,boxShadow:"0 8px 24px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.1)",minWidth:200,maxWidth:420,padding:"12px 16px",color:f.text,...M,...h},children:[C&&(0,a.jsx)("span",{style:C.arrowStyle,"aria-hidden":"true"}),r]}),document.body):null;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{ref:w,className:n.tkx("inline-flex"),onClick:N,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),N())},"aria-expanded":v,"aria-haspopup":"dialog","aria-controls":v?x:void 0,children:e}),I,v&&!m&&(0,a.jsx)("style",{children:"\n @keyframes tkxPopoverFadeIn {\n from { opacity: 0; transform: translateY(4px); }\n to { opacity: 1; transform: translateY(0); }\n }\n "})]})},exports.TkxProgress=C,exports.TkxQRCode=function({value:e,size:r=160,color:i,bgColor:s,errorLevel:d="M",icon:c,bordered:u=!0}){const p=t.useTheme(),h=o.useReducedMotion(),f=(0,l.useRef)(null),m=n.sanitizeString(e),x=i??p.text,g=s??p.surface,b=(0,l.useMemo)(()=>function(e,t,n){const o=function(e){let t=e;return()=>(t=1664525*t+1013904223|0,(t>>>0)/4294967295)}(function(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n)|0;return Math.abs(t)}(e)),r=Wo[n]??.42,i=Array.from({length:t},()=>Array.from({length:t},()=>!1)),l=(e,t)=>{for(let n=0;n<7;n++)for(let o=0;o<7;o++){const r=0===n||6===n||0===o||6===o,l=n>=2&&n<=4&&o>=2&&o<=4;i[e+n][t+o]=r||l}};l(0,0),l(0,18),l(18,0);for(let a=7;a<18;a++)i[6][a]=a%2==0,i[a][6]=a%2==0;for(let a=0;a<t;a++)for(let e=0;e<t;e++)a<8&&e<8||a<8&&e>=17||a>=17&&e<8||6===a||6===e||(i[a][e]=o()<r);return i}(m,25,d),[m,d]);return(0,l.useEffect)(()=>{const e=f.current;if(!e)return;const t=e.getContext("2d");if(!t)return;const o=window.devicePixelRatio||1;e.width=r*o,e.height=r*o,t.scale(o,o);const i=r/25;t.fillStyle=g,t.fillRect(0,0,r,r),t.fillStyle=x;for(let n=0;n<25;n++)for(let e=0;e<25;e++)b[n][e]&&t.fillRect(e*i,n*i,i,i);if(c){const e=.22*r,o=(r-e)/2;t.fillStyle=g,t.fillRect(o-2,o-2,e+4,e+4);const i=new Image;i.crossOrigin="anonymous",i.onload=()=>{t.drawImage(i,o,o,e,e)},i.src=n.sanitizeString(c)}},[b,r,x,g,c]),(0,a.jsx)("div",{role:"img","aria-label":`QR code for: ${m}`,className:n.tkx("inline-block rounded-lg"),style:{padding:u?12:0,backgroundColor:u?g:"transparent",border:u?`1px solid ${p.border}`:"none",lineHeight:0,animation:h?"none":"tkxFadeIn 0.2s ease"},children:(0,a.jsx)("canvas",{ref:f,"aria-hidden":"true",style:{width:r,height:r,display:"block"}})})},exports.TkxRadio=q,exports.TkxRadioGroup=function({name:e,value:o,defaultValue:r="",onChange:i,label:s,orientation:d="vertical",isDisabled:c=!1,isInvalid:u=!1,errorMessage:p,children:h}){const f=t.useTheme(),m=`${(0,l.useId)()}-error`,[x,g]=(0,l.useState)(r),b=void 0!==o,y=b?o:x,v=u||!!p;return(0,a.jsx)(K.Provider,{value:{name:e,value:y,onChange:e=>{b||g(e),i?.(e)},isDisabled:c,isInvalid:u},children:(0,a.jsxs)("div",{role:"radiogroup","aria-label":s?n.sanitizeString(s):void 0,"aria-describedby":v?m:void 0,"aria-invalid":v,children:[s&&(0,a.jsx)("div",{className:n.tkx("text-sm font-medium font-sans mb-2"),style:{color:f.text},children:n.sanitizeString(s)}),(0,a.jsx)("div",{className:n.tkx("horizontal"===d?"flex flex-row flex-wrap gap-4":"flex flex-col gap-2"),children:h}),v&&p&&(0,a.jsxs)("span",{id:m,role:"alert",className:n.tkx("text-xs flex items-center gap-1 mt-1"),style:{color:f.danger},children:[(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),n.sanitizeString(p)]})]})})},exports.TkxRating=function({value:e,defaultValue:r=0,onChange:i,max:s=5,precision:d=1,size:c="md",isReadOnly:u=!1,isDisabled:p=!1,label:h,showValue:f=!1,colorScheme:m="warning",emptyIcon:x="star",filledIcon:g="star"}){const b=t.useTheme(),y=o.useReducedMotion(),v=(0,l.useId)(),w=void 0!==e,[k,C]=(0,l.useState)(r),[S,$]=(0,l.useState)(null),z=(0,l.useRef)(null),N=w?e??0:k,M=S??N,I={warning:b.warning,primary:b.primary,danger:b.danger}[m]??b.warning,L=je[c],W=!u&&!p,D=(0,l.useCallback)(e=>{w||C(e),i?.(e)},[w,i]),R=(0,l.useCallback)((e,t)=>{W&&$(Ke(e,t,d))},[W,d]),T=(0,l.useCallback)(()=>{W&&$(null)},[W]),B=(0,l.useCallback)((e,t)=>{if(!W)return;const n=Ke(e,t,d);D(n===N?0:n)},[W,d,N,D]),A=(0,l.useCallback)(e=>{if(!W)return;const t=d;let n=N;if("ArrowRight"===e.key||"ArrowUp"===e.key)e.preventDefault(),n=Ue(N+t,0,s);else if("ArrowLeft"===e.key||"ArrowDown"===e.key)e.preventDefault(),n=Ue(N-t,0,s);else if("Home"===e.key)e.preventDefault(),n=0;else{if("End"!==e.key)return;e.preventDefault(),n=s}n=function(e,t){return 1===t?Math.round(e):Math.round(2*e)/2}(n,d),D(n)},[W,N,s,d,D]),F=h?n.sanitizeString(h):"Rating";return(0,a.jsxs)("div",{className:n.cx(n.tkx("inline-flex items-center gap-2 font-sans"),p?n.tkx("opacity-50"):""),children:[(0,a.jsx)("div",{ref:z,role:"radiogroup","aria-label":F,"aria-disabled":p,"aria-readonly":u,tabIndex:W?0:-1,onKeyDown:A,onMouseLeave:T,className:n.tkx("flex items-center gap-0.5 outline-none"),style:{cursor:W?"pointer":"default"},children:Array.from({length:s},(e,t)=>{const n=t+1,o=t+.5,r=M>=n,i=!r&&.5===d&&M>=o,l=`${v}-${t}`;return(0,a.jsx)("span",{role:"radio","aria-checked":.5===d&&N===o||N===n,"aria-label":.5===d?`${o} star${1!==o?"s":""} / ${n} star${1!==n?"s":""}`:`${n} star${1!==n?"s":""}`,tabIndex:-1,onMouseMove:e=>R(e,t),onClick:e=>B(e,t),style:{display:"inline-flex",alignItems:"center",lineHeight:0,transition:y?"none":"transform 120ms ease",transform:null!==S&&M>=o&&W?"scale(1.15)":"scale(1)"},children:(0,a.jsx)(Ye,{type:r||i?g:x,size:L,filled:r,halfFilled:i,color:r||i?I:b.border,uid:i?l:void 0})},t)})}),f&&(0,a.jsxs)("span",{className:n.tkx("text-sm tabular-nums"),style:{color:b.textMuted},"aria-live":"polite","aria-atomic":"true",children:[N%1==0?N.toFixed(0):N.toFixed(1)," / ",s]})]})},exports.TkxResult=function({status:e,title:r,subTitle:i,icon:l,extra:s}){const d=t.useTheme(),c=o.useReducedMotion(),u=function(e,t){switch(e){case"success":return t.success;case"error":case"500":return t.danger;case"warning":return t.warning;case"info":return t.info;case"404":case"403":return t.textMuted}}(e,d),p=n.sanitizeString(r),h=i?n.sanitizeString(i):void 0;return(0,a.jsxs)("div",{role:"status","aria-live":"polite",className:n.tkx("flex flex-col items-center text-center px-6 py-12 font-sans"),style:{animation:c?"none":"tkxFadeIn 0.3s ease"},children:[(0,a.jsx)("div",{className:n.tkx("mb-6"),children:l??Do[e](u)}),(0,a.jsx)("h2",{className:n.tkx("text-xl font-semibold m-0 mb-2"),style:{color:d.text},children:p}),h&&(0,a.jsx)("p",{className:n.tkx("text-sm m-0 mb-6 max-w-md leading-relaxed"),style:{color:d.textMuted},children:h}),s&&(0,a.jsx)("div",{className:n.tkx("flex items-center gap-3 mt-4"),children:s})]})},exports.TkxRichTextDisplay=function({blocks:e,className:r,style:i}){const s=t.useTheme(),d=o.useReducedMotion(),c=(0,l.useMemo)(()=>e.map((e,t)=>{const n=Bn[e.type];return n?(0,a.jsx)("div",{style:d?void 0:{animation:"tkx-rich-text-fade-in 300ms ease both",animationDelay:`${Math.min(30*t,300)}ms`},children:(0,a.jsx)(n,{block:e,index:t})},t):null}),[e,d]);return(0,l.useMemo)(()=>{if("undefined"==typeof document)return;if(document.getElementById("tkx-rich-text-kf"))return;const e=document.createElement("style");e.id="tkx-rich-text-kf",e.textContent="\n @keyframes tkx-rich-text-fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n ",document.head.appendChild(e)},[]),(0,a.jsx)("article",{"aria-label":"Rich text content",className:n.tkx("font-sans",r??""),style:{color:s.text,maxWidth:720,...i},children:c})},exports.TkxRow=ao,exports.TkxSegmented=function({options:e,value:r,onChange:i,size:s="md",block:d=!1}){const c=t.useTheme(),u=o.useReducedMotion(),p=(0,l.useRef)(null),[h,f]=(0,l.useState)(()=>Math.max(0,e.findIndex(e=>e.value===r))),[m,x]=(0,l.useState)({}),g=Lo[s];(0,l.useEffect)(()=>{const t=e.findIndex(e=>e.value===r);t>=0&&f(t)},[r,e]),(0,l.useEffect)(()=>{const e=p.current;if(!e)return;const t=e.querySelectorAll("[data-seg-btn]")[h];t&&x({left:t.offsetLeft,width:t.offsetWidth,height:t.offsetHeight,transition:u?"none":"left 0.2s ease, width 0.2s ease"})},[h,e,u]);const b=(0,l.useCallback)(t=>{const n=e[t];n&&!n.disabled&&(f(t),i?.(n.value))},[e,i]),y=(0,l.useCallback)(t=>{let n=h;if("ArrowRight"===t.key||"ArrowDown"===t.key)for(t.preventDefault(),n=(h+1)%e.length;e[n]?.disabled&&n!==h;)n=(n+1)%e.length;else if("ArrowLeft"===t.key||"ArrowUp"===t.key)for(t.preventDefault(),n=(h-1+e.length)%e.length;e[n]?.disabled&&n!==h;)n=(n-1+e.length)%e.length;n!==h&&(b(n),(p.current?.querySelectorAll("[data-seg-btn]"))?.[n]?.focus())},[h,e,b]);return(0,a.jsxs)("div",{ref:p,role:"radiogroup","aria-label":"Segmented control",className:n.tkx("relative inline-flex items-center rounded-lg p-1"),style:{backgroundColor:c.surfaceAlt,border:`1px solid ${c.border}`,width:d?"100%":void 0},onKeyDown:y,children:[(0,a.jsx)("div",{"aria-hidden":"true",className:n.tkx("absolute top-1 rounded-md"),style:{...m,backgroundColor:c.surface,boxShadow:`0 1px 3px ${c.border}`,zIndex:0}}),e.map((e,t)=>{const o=t===h,r=n.sanitizeString(e.label);return(0,a.jsxs)("button",{"data-seg-btn":!0,type:"button",role:"radio","aria-checked":o,"aria-disabled":e.disabled||void 0,disabled:e.disabled,tabIndex:o?0:-1,className:n.tkx("relative z-10 flex items-center justify-center gap-1 rounded-md border-0 cursor-pointer","font-sans whitespace-nowrap select-none"),style:{height:g.height,fontSize:g.fontSize,padding:`0 ${g.px}px`,flex:d?1:void 0,color:o?c.text:c.textMuted,backgroundColor:"transparent",opacity:e.disabled?.4:1,fontWeight:o?600:400,transition:u?"none":"color 0.15s ease"},onClick:()=>b(t),children:[e.icon&&(0,a.jsx)("span",{"aria-hidden":"true",children:e.icon}),r]},e.value)})]})},exports.TkxSelect=V,exports.TkxSider=no,exports.TkxSkeleton=T,exports.TkxSlider=We,exports.TkxSnackbar=function({message:e,isOpen:r,onClose:i,action:d,variant:c="default",position:u="bottom-center",autoHideDuration:p=5e3,icon:h}){const f=t.useTheme(),m=o.useReducedMotion(),x=(0,l.useId)(),g=(0,l.useRef)(null),[b,y]=(0,l.useState)(!1),[v,w]=(0,l.useState)(!1);(0,l.useEffect)(()=>{!function(){if(wn||"undefined"==typeof document)return;wn=!0;const e=document.createElement("style");e.id="tkx-snackbar-kf",e.textContent="\n @keyframes tkx-snackbar-slide-up {\n from { opacity: 0; transform: translateY(24px); }\n to { opacity: 1; transform: translateY(0); }\n }\n @keyframes tkx-snackbar-slide-down {\n from { opacity: 0; transform: translateY(-24px); }\n to { opacity: 1; transform: translateY(0); }\n }\n @keyframes tkx-snackbar-fade-out {\n from { opacity: 1; }\n to { opacity: 0; transform: translateY(8px); }\n }\n ",document.head.appendChild(e)}()},[]),(0,l.useEffect)(()=>{if(r)w(!1),y(!0);else if(b){if(!m){w(!0);const e=setTimeout(()=>{y(!1),w(!1)},250);return()=>clearTimeout(e)}y(!1)}},[r,m,b]),(0,l.useEffect)(()=>{if(r&&!(p<=0)&&i)return g.current=setTimeout(()=>{i()},p),()=>{g.current&&clearTimeout(g.current)}},[r,p,i]);const k=(0,l.useCallback)(()=>{g.current&&(clearTimeout(g.current),g.current=null)},[]),C=(0,l.useCallback)(()=>{r&&p>0&&i&&(g.current=setTimeout(()=>i(),p))},[r,p,i]),S={default:f.textMuted,success:f.success,error:f.danger,warning:f.warning,info:f.info}[c],$=n.sanitizeString(e);if(!b||"undefined"==typeof document)return null;let z={};m||(z=v?{animation:"tkx-snackbar-fade-out 250ms ease forwards"}:{animation:("top-center"===u?"tkx-snackbar-slide-down":"tkx-snackbar-slide-up")+" 250ms cubic-bezier(0.16,1,0.3,1) both"});const N=h??kn[c]??null;return(0,s.createPortal)((0,a.jsx)("div",{role:"error"===c?"alert":"status","aria-live":"error"===c?"assertive":"polite","aria-atomic":"true","aria-labelledby":x,className:n.tkx("fixed z-[9500] font-sans"),style:{...Cn[u],...z,pointerEvents:"auto"},onMouseEnter:k,onMouseLeave:C,children:(0,a.jsxs)("div",{className:n.tkx("flex items-center gap-3 px-4 py-3 rounded-lg shadow-lg","min-w-[280px] max-w-[480px]"),style:{backgroundColor:f.surface,border:`1px solid ${S}44`,boxShadow:`0 8px 24px ${f.bg}aa`,color:f.text},children:[N&&(0,a.jsx)("span",{className:n.tkx("shrink-0 flex items-center"),style:{color:S},children:N}),(0,a.jsx)("span",{id:x,className:n.tkx("flex-1 text-sm leading-snug"),children:$}),d&&(0,a.jsx)("button",{onClick:()=>{d.onClick(),i?.()},className:n.tkx("bg-transparent border-none cursor-pointer p-0 ml-2","text-sm font-semibold shrink-0","focus-visible:focus-ring"),style:{color:f.primary},children:n.sanitizeString(d.label)}),i&&(0,a.jsx)("button",{"aria-label":"Dismiss snackbar",onClick:i,className:n.tkx("bg-transparent border-none cursor-pointer rounded p-[2px] ml-1","shrink-0 flex items-center justify-center","focus-visible:focus-ring"),style:{color:f.textMuted},children:(0,a.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,"aria-hidden":"true",children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}),document.body)},exports.TkxSpeedDial=function({actions:e,icon:r,direction:i="up",position:d="bottom-right",className:c,style:u}){const p=t.useTheme(),h=o.useReducedMotion(),f=(0,l.useId)(),[m,x]=(0,l.useState)(!1),[g,b]=(0,l.useState)(-1),y=(0,l.useRef)(null),v=(0,l.useRef)(new Map),w=(0,l.useCallback)(()=>{x(e=>!e),b(-1)},[]),k=(0,l.useCallback)(()=>{x(!1),b(-1)},[]);o.useEscapeKey(k,m),(0,l.useEffect)(()=>{if(!m)return;const e=e=>{y.current?.contains(e.target)||k()};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[m,k]),(0,l.useEffect)(()=>{g>=0&&v.current.get(g)?.focus()},[g]);const C=e=>h?"0ms":40*e+"ms";return(0,a.jsxs)(a.Fragment,{children:[m&&"undefined"!=typeof document&&(0,s.createPortal)((0,a.jsx)("div",{"aria-hidden":"true",onClick:k,style:{position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.3)",zIndex:9e3,transition:h?"none":"opacity 200ms ease"}}),document.body),(0,a.jsxs)("div",{ref:y,className:n.tkx("fixed z-[9100] font-sans",c??""),style:{...bn[d],...u},children:[m&&e.map((t,o)=>{const r=n.sanitizeString(t.label),l=function(e,t){const n=64*(t+1);switch(e){case"up":return{bottom:n,left:"50%",transform:"translateX(-50%)"};case"down":return{top:n,left:"50%",transform:"translateX(-50%)"};case"left":return{right:n,top:"50%",transform:"translateY(-50%)"};case"right":return{left:n,top:"50%",transform:"translateY(-50%)"}}}(i,o),s=function(e){switch(e){case"up":case"down":return{right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:10};case"left":case"right":return{bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:10}}}(i);return(0,a.jsx)("div",{className:n.tkx("absolute"),style:{...l,opacity:h?1:0,animation:h?"none":"tkxSpeedDialIn 180ms ease forwards",animationDelay:C(o)},children:(0,a.jsxs)("div",{className:n.tkx("relative inline-flex"),children:[(0,a.jsx)("span",{className:n.tkx("absolute z-10 whitespace-nowrap text-xs py-1 px-2 rounded-md pointer-events-none"),style:{...s,backgroundColor:p.surfaceAlt,color:p.text,border:`1px solid ${p.border}`,boxShadow:"0 2px 8px rgba(0,0,0,0.15)"},role:"tooltip",children:r}),(0,a.jsx)("button",{ref:e=>{e?v.current.set(o,e):v.current.delete(o)},type:"button","aria-label":r,tabIndex:m?0:-1,onClick:()=>{t.onClick?.(),k()},onKeyDown:t=>((t,n)=>{switch(t.key){case"ArrowUp":case"ArrowLeft":t.preventDefault(),b(n>0?n-1:e.length-1);break;case"ArrowDown":case"ArrowRight":t.preventDefault(),b(n<e.length-1?n+1:0);break;case"Enter":case" ":t.preventDefault(),e[n].onClick?.(),k();break;case"Escape":k();break;case"Home":t.preventDefault(),b(0);break;case"End":t.preventDefault(),b(e.length-1)}})(t,o),className:n.tkx("inline-flex items-center justify-center rounded-full border-none cursor-pointer","outline-none focus-visible:ring-2 focus-visible:ring-offset-2","shadow-lg"),style:{width:48,height:48,backgroundColor:p.surface,color:p.text,border:`1px solid ${p.border}`,boxShadow:"0 4px 12px rgba(0,0,0,0.15)",transition:h?"none":"all 150ms ease"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=p.surfaceAlt,e.currentTarget.style.transform="scale(1.1)"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=p.surface,e.currentTarget.style.transform="scale(1)"},children:t.icon})]})},t.id)}),(0,a.jsx)("button",{type:"button","aria-label":m?"Close actions menu":"Open actions menu","aria-expanded":m,"aria-controls":f,"aria-haspopup":"true",onClick:w,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),w()),m&&("ArrowUp"!==e.key&&"ArrowLeft"!==e.key||(e.preventDefault(),b(0)),"ArrowDown"!==e.key&&"ArrowRight"!==e.key||(e.preventDefault(),b(0)))},className:n.tkx("inline-flex items-center justify-center rounded-full border-none cursor-pointer","outline-none focus-visible:ring-2 focus-visible:ring-offset-2"),style:{width:56,height:56,backgroundColor:p.primary,color:p.bg,boxShadow:`0 6px 20px ${p.primary}40`,transition:h?"none":"all 200ms ease",position:"relative",zIndex:1},onMouseEnter:e=>{e.currentTarget.style.boxShadow=`0 8px 28px ${p.primary}60`,h||(e.currentTarget.style.transform="scale(1.05)")},onMouseLeave:e=>{e.currentTarget.style.boxShadow=`0 6px 20px ${p.primary}40`,e.currentTarget.style.transform="scale(1)"},children:r??(0,a.jsx)(gn,{color:p.bg,rotated:m,reducedMotion:h})}),(0,a.jsx)("div",{id:f,role:"menu","aria-label":"Speed dial actions",style:{display:"none"},children:e.map(e=>(0,a.jsx)("div",{role:"menuitem",children:n.sanitizeString(e.label)},e.id))})]}),m&&!h&&(0,a.jsx)("style",{children:"\n @keyframes tkxSpeedDialIn {\n from { opacity: 0; transform: translateX(-50%) scale(0.5); }\n to { opacity: 1; transform: translateX(-50%) scale(1); }\n }\n "})]})},exports.TkxSpin=function({spinning:e=!0,size:r="md",tip:i,indicator:a,children:s,fullscreen:d=!1,delay:c=0,style:u}){const p=t.useTheme(),h=o.useReducedMotion(),[f,m]=(0,l.useState)(0===c&&e),x=(0,l.useRef)(null);if((0,l.useEffect)(()=>(e&&c>0?x.current=setTimeout(()=>m(!0),c):m(e),()=>{null!==x.current&&clearTimeout(x.current)}),[e,c]),!f)return s?(0,l.createElement)("div",{style:u},s):null;const g=wo[r],b=i?n.sanitizeString(i):void 0,y=(0,l.createElement)("div",{role:"status","aria-live":"polite","aria-label":b??"Loading",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"8px"}},a??(0,l.createElement)(So,{size:g.dimension,borderWidth:g.borderWidth,color:p.primary,reducedMotion:h}),b&&(0,l.createElement)("span",{style:{color:p.primary,fontSize:g.fontSize,marginTop:"4px"}},b));return d?(0,l.createElement)("div",{style:{position:"fixed",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${p.bg}cc`,zIndex:9999,...u}},y):s?(0,l.createElement)("div",{style:{position:"relative",...u}},(0,l.createElement)("div",{style:{filter:"blur(1px)",opacity:.5,pointerEvents:"none",userSelect:"none",transition:h?"none":"opacity 0.2s, filter 0.2s"}},s),(0,l.createElement)("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:`${p.bg}66`,borderRadius:"4px"}},y)):(0,l.createElement)("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",...u}},y)},exports.TkxStatistic=function({title:e,value:r,prefix:i,suffix:a,precision:s,groupSeparator:d=",",valueStyle:c,loading:u=!1,trend:p,trendValue:h,style:f}){const m=t.useTheme(),x=o.useReducedMotion(),g=n.sanitizeString(e),b=h?n.sanitizeString(h):void 0,y="up"===p?m.success:"down"===p?m.danger:void 0;return(0,l.createElement)("div",{style:{display:"flex",flexDirection:"column",gap:"4px",...f}},(0,l.createElement)("div",{style:{color:m.textMuted,fontSize:"0.875rem",lineHeight:"1.4"}},g),u?(0,l.createElement)(Io,{w:"120px",h:"32px",alt:m.surfaceAlt,bdr:m.border,rm:x}):(0,l.createElement)("div",{style:{display:"flex",alignItems:"baseline",gap:"4px",fontSize:"1.75rem",fontWeight:700,lineHeight:"1.2",color:m.text,fontVariantNumeric:"tabular-nums",...c}},i&&(0,l.createElement)("span",{style:{fontSize:"0.75em",fontWeight:400}},i),(0,l.createElement)("span",null,function(e,t,n=","){if("string"==typeof e)return e;const[o,r]=(void 0!==t?e.toFixed(t):String(e)).split("."),i=o.replace(/\B(?=(\d{3})+(?!\d))/g,n);return void 0!==r?`${i}.${r}`:i}(r,s,d)),a&&(0,l.createElement)("span",{style:{fontSize:"0.6em",fontWeight:400,color:m.textMuted}},a)),p&&(0,l.createElement)("div",{style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"0.8125rem",color:y,marginTop:"2px"}},(0,l.createElement)(No,{direction:p,color:y}),b&&(0,l.createElement)("span",null,b)))},exports.TkxStepper=Dt,exports.TkxTab=function({index:e,children:o,disabled:r=!1,className:i,style:s}){const d=t.useTheme(),{activeIndex:c,setActiveIndex:u,baseId:p,tabCount:h}=W(),f=(0,l.useRef)(null),m=c===e;return(0,a.jsx)("button",{ref:f,role:"tab",id:`${p}-tab-${e}`,"aria-controls":`${p}-panel-${e}`,"aria-selected":m,tabIndex:m?0:-1,disabled:r,className:n.cx(n.tkx("border-none bg-transparent font-sans text-sm rounded-t cursor-pointer select-none","py-2.5 px-4 transition-colors duration-150 focus-visible:focus-ring",r?"opacity-50 cursor-not-allowed":""),i),style:{color:m?d.primary:d.textMuted,fontWeight:m?600:400,borderBottom:m?`2px solid ${d.primary}`:"2px solid transparent",marginBottom:"-2px",...s},onClick:()=>!r&&u(e),onKeyDown:n=>t.handleTabsKeyboard(n,e,h,e=>{u(e),document.getElementById(`${p}-tab-${e}`)?.focus()}),children:o})},exports.TkxTabList=function({children:e,className:o,style:r,...i}){const l=t.useTheme();return(0,a.jsx)("div",{role:"tablist",className:n.cx(n.tkx("flex gap-1"),o),style:{borderBottom:`2px solid ${l.border}`,...r},...i,children:e})},exports.TkxTabPanel=function({index:e,children:t,style:o,className:r}){const{activeIndex:i,baseId:l}=W();return i!==e?null:(0,a.jsx)("div",{role:"tabpanel",id:`${l}-panel-${e}`,"aria-labelledby":`${l}-tab-${e}`,tabIndex:0,className:n.cx(n.tkx("pt-4"),r),style:o,children:t})},exports.TkxTabPanels=function({children:e,className:t,...n}){return(0,a.jsx)("div",{className:t,...n,children:e})},exports.TkxTable=function({columns:e,data:o,caption:r,sortable:i,stickyHeader:s,isLoading:d,emptyState:c,style:u,className:p,striped:h,maxHeight:f,rowHeight:m=44,virtualScroll:x,onLoadMore:g,hasMore:b,loadingMore:y=!1,onRowClick:v,selectedRows:w,bordered:k,compact:C}){const S=t.useTheme(),[$,z]=(0,l.useState)(null),[N,M]=(0,l.useState)("asc"),I=(0,l.useMemo)(()=>$&&i?[...o].sort((e,t)=>{const n=e[$],o=t[$];let r=0;return"string"==typeof n&&"string"==typeof o?r=n.localeCompare(o):"number"==typeof n&&"number"==typeof o&&(r=n-o),"asc"===N?r:-r}):o,[o,$,N,i]),L=(0,l.useCallback)(e=>{$===e?M(e=>"asc"===e?"desc":"asc"):(z(e),M("asc"))},[$]),W=void 0!==x?x:void 0!==f&&I.length>=50,D=(0,l.useRef)(null),[R,B]=(0,l.useState)(0),[A,F]=(0,l.useState)(400),E=(0,l.useCallback)(()=>{D.current&&B(D.current.scrollTop)},[]);(0,l.useEffect)(()=>{if(!W||!D.current)return;const e=D.current;F(e.clientHeight);const t=new ResizeObserver(()=>F(e.clientHeight));return t.observe(e),()=>t.disconnect()},[W]);const j=W?Math.max(0,Math.floor(R/m)-5):0,O=W?Math.min(I.length,Math.ceil((R+A)/m)+5):I.length,P=W?I.slice(j,O):I,V=(0,l.useRef)(null),Y=(0,l.useRef)(!1);(0,l.useEffect)(()=>{Y.current=!1},[o.length]),(0,l.useEffect)(()=>{if(!g)return;const e=V.current;if(!e)return;const t=new IntersectionObserver(e=>{e[0].isIntersecting&&!Y.current&&!1!==b&&(Y.current=!0,g())},{root:D.current,rootMargin:"0px 0px 200px 0px",threshold:0});return t.observe(e),()=>t.disconnect()},[g,b]);const U=C?"4px":"12px",K=C?"8px":"16px",X=k?`1px solid ${S.border}`:"none",q=(0,l.useMemo)(()=>new Set(w??[]),[w]);return(0,a.jsx)("div",{className:n.tkx("w-full rounded-lg",p??""),style:{border:`1px solid ${S.border}`,overflow:"hidden",...u},children:(0,a.jsxs)("div",{ref:D,onScroll:W?E:void 0,style:{overflowX:"auto",overflowY:f?"auto":"visible",maxHeight:f??"none"},children:[(0,a.jsxs)("table",{className:n.tkx("w-full font-sans text-sm"),style:{borderCollapse:"collapse",color:S.text},children:[r&&(0,a.jsx)("caption",{className:n.tkx("text-sm text-left p-2"),style:{color:S.textMuted},children:n.sanitizeString(r)}),(0,a.jsx)("thead",{style:s?{position:"sticky",top:0,backgroundColor:S.surfaceAlt,zIndex:1}:{backgroundColor:S.surfaceAlt},children:(0,a.jsx)("tr",{children:e.map(e=>{const t=i&&!1!==e.sortable,o=(r=e.key,$!==r?"none":N);var r;return(0,a.jsx)("th",{scope:"col","aria-sort":t?"none"===o?"none":"asc"===o?"ascending":"descending":void 0,className:n.tkx("text-left font-semibold whitespace-nowrap",t?"cursor-pointer select-none":""),style:{padding:`${U} ${K}`,color:S.textMuted,borderBottom:`2px solid ${S.border}`,borderRight:X,width:e.width},onClick:()=>t&&L(e.key),onKeyDown:n=>{!t||"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),L(e.key))},tabIndex:t?0:void 0,children:(0,a.jsxs)("span",{className:n.tkx("inline-flex items-center gap-1.5"),children:[n.sanitizeString(e.header),t&&(0,a.jsx)(H,{dir:o})]})},String(e.key))})})}),(0,a.jsx)("tbody",{children:d?Array.from({length:5},(t,n)=>(0,a.jsx)("tr",{children:e.map(e=>(0,a.jsx)("td",{style:{padding:`${U} ${K}`},children:(0,a.jsx)(T,{variant:"text",height:"16px"})},String(e.key)))},n)):0===I.length?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:e.length,className:n.tkx("text-center"),style:{padding:"32px 16px",color:S.textMuted},children:c??"No data available"})}):(0,a.jsxs)(a.Fragment,{children:[W&&j>0&&(0,a.jsx)("tr",{"aria-hidden":"true",style:{height:j*m},children:(0,a.jsx)("td",{colSpan:e.length,style:{padding:0,border:"none"}})}),P.map((t,o)=>{const r=j+o,i=q.has(r);return(0,a.jsx)("tr",{"aria-rowindex":r+1,"aria-selected":i||void 0,onClick:v?()=>v(t,r):void 0,onKeyDown:v?e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),v(t,r))}:void 0,tabIndex:v?0:void 0,className:n.tkx(v?"cursor-pointer":""),style:{backgroundColor:i?`${S.primary}22`:h&&r%2==1?S.surfaceAlt:"transparent",borderBottom:`1px solid ${S.border}`,...W?{height:m,boxSizing:"border-box"}:{}},children:e.map(e=>{const o=t[e.key],r=e.render?e.render(o,t):"string"==typeof o?n.sanitizeString(o):String(o??"");return(0,a.jsx)("td",{style:{padding:`${U} ${K}`,color:S.text,borderRight:X},children:r},String(e.key))})},r)}),W&&O<I.length&&(0,a.jsx)("tr",{"aria-hidden":"true",style:{height:(I.length-O)*m},children:(0,a.jsx)("td",{colSpan:e.length,style:{padding:0,border:"none"}})})]})})]}),(b||y)&&(0,a.jsx)("div",{ref:V,style:{height:1,width:"100%"},children:y&&(0,a.jsx)("table",{style:{width:"100%",borderCollapse:"collapse"},children:(0,a.jsx)("tbody",{children:Array.from({length:3},(t,n)=>(0,a.jsx)("tr",{children:e.map(e=>(0,a.jsx)("td",{style:{padding:"10px 16px"},children:(0,a.jsx)(T,{variant:"text",height:"16px"})},String(e.key)))},n))})})}),!b&&g&&(0,a.jsx)("div",{style:{padding:"16px",textAlign:"center",fontSize:13,color:S.textMuted},children:"✓ All rows loaded"})]})})},exports.TkxTabs=function({defaultIndex:e=0,activeIndex:t,onChange:n,children:o,tabCount:r=0,style:i,className:s}){const[d,c]=(0,l.useState)(e),u=(0,l.useId)(),p=void 0!==t?t:d;return(0,a.jsx)(L.Provider,{value:{activeIndex:p,setActiveIndex:e=>{void 0===t&&c(e),n?.(e)},baseId:u,tabCount:r},children:(0,a.jsx)("div",{className:s,style:i,children:o})})},exports.TkxTag=nt,exports.TkxTagInput=function({value:e,defaultValue:r=[],onChange:i,placeholder:s="Add tag…",maxTags:d,allowDuplicates:c=!1,validate:u,colorScheme:p="primary",size:h="md",label:f,hint:m,isDisabled:x=!1}){const g=t.useTheme(),b=o.useReducedMotion(),[y,v]=(0,l.useState)(r),[w,k]=(0,l.useState)(""),[C,S]=(0,l.useState)(null),$=(0,l.useRef)(null),z=void 0!==e,N=z?e:y,M=(0,l.useCallback)(e=>{z||v(e),i?.(e)},[z,i]),I=(0,l.useCallback)(e=>{const t=e.trim();if(t)if(void 0!==d&&N.length>=d)S(`Maximum ${d} tags allowed`);else if(c||!N.includes(t)){if(u){const e=u(t);if(!1===e)return void S("Invalid tag");if("string"==typeof e)return void S(e)}S(null),M([...N,t]),k("")}else S("Duplicate tags are not allowed")},[N,d,c,u,M]),L=(0,l.useCallback)(e=>{M(N.filter((t,n)=>n!==e)),S(null)},[N,M]),W=(0,l.useCallback)(e=>{"Enter"===e.key||","===e.key?(e.preventDefault(),I(w)):"Backspace"===e.key&&""===w&&N.length>0&&L(N.length-1)},[w,N,I,L]),D=(0,l.useCallback)(e=>{const t=e.target.value;t.endsWith(",")?I(t.slice(0,-1)):(k(t),C&&S(null))},[I,C]),R="sm"===h?"6px 8px":"lg"===h?"10px 12px":"8px 10px",T="sm"===h?11:"lg"===h?14:12;return(0,a.jsxs)("div",{className:n.tkx("flex flex-col gap-1.5"),children:[f&&(0,a.jsx)("label",{className:n.tkx("text-sm font-medium"),style:{color:g.text},onClick:()=>$.current?.focus(),children:n.sanitizeString(f)}),(0,a.jsxs)("div",{className:n.tkx("flex flex-wrap items-center gap-1.5 rounded-lg cursor-text",!b&&"transition-colors duration-150"),style:{padding:R,backgroundColor:g.surface,border:`1.5px solid ${C?g.danger:g.border}`,opacity:x?.55:1,minHeight:"sm"===h?36:"lg"===h?48:40},onClick:()=>!x&&$.current?.focus(),children:[N.map((e,t)=>(0,a.jsx)(nt,{size:h,variant:"subtle",colorScheme:p,onRemove:x?void 0:()=>L(t),isDisabled:x,children:e},`${e}-${t}`)),(!d||N.length<d)&&!x&&(0,a.jsx)("input",{ref:$,type:"text",value:w,onChange:D,onKeyDown:W,placeholder:0===N.length?n.sanitizeString(s):"",disabled:x,className:n.tkx("flex-1 bg-transparent outline-none min-w-[80px]"),style:{fontSize:T,color:g.text,caretColor:g.primary},"aria-label":f??"Tag input"})]}),C&&(0,a.jsx)("p",{className:n.tkx("text-xs"),style:{color:g.danger},role:"alert",children:C}),m&&!C&&(0,a.jsx)("p",{className:n.tkx("text-xs"),style:{color:g.textMuted},children:n.sanitizeString(m)})]})},exports.TkxText=function({children:e,type:o="default",strong:r=!1,italic:i=!1,underline:a=!1,delete:s=!1,code:d=!1,mark:c=!1,copyable:u=!1,style:p}){const h=yo(o),f=t.useTheme(),m=go(e),x="string"==typeof e?n.sanitizeString(e):e,g=[];a&&g.push("underline"),s&&g.push("line-through");let b=x;return d&&(b=(0,l.createElement)("code",{style:{padding:"0.15em 0.4em",fontSize:"0.875em",backgroundColor:f.surfaceAlt,border:`1px solid ${f.border}`,borderRadius:"4px",fontFamily:"monospace"}},b)),c&&(b=(0,l.createElement)("mark",{style:{backgroundColor:`${f.warning}33`,color:h,padding:"0 2px",borderRadius:"2px"}},b)),(0,l.createElement)(r?"strong":i?"em":"span",{style:{color:h,fontStyle:i?"italic":"normal",textDecoration:g.length>0?g.join(" "):"none",...p}},b,u&&(0,l.createElement)(bo,{text:m}))},exports.TkxThinkingIndicator=Ze,exports.TkxTimeline=function({items:e,variant:r="default",orientation:i="vertical",connectorStyle:s="solid"}){const d=t.useTheme(),c=o.useReducedMotion(),u=(0,l.useRef)(!1);(0,l.useEffect)(()=>{!function(){if(ot||"undefined"==typeof document)return;ot=!0;const e=document.createElement("style");e.textContent="\n @keyframes tkx-pulse-dot { 0%,100% { box-shadow:0 0 0 0 currentColor; opacity:1; } 70% { box-shadow:0 0 0 8px transparent; opacity:0.7; } }\n @keyframes tkx-draw-line { from { transform:scaleY(0); transform-origin:top center; } to { transform:scaleY(1); } }\n @keyframes tkx-draw-line-h { from { transform:scaleX(0); transform-origin:left center; } to { transform:scaleX(1); } }\n .tkx-pulse-dot { animation: tkx-pulse-dot 1.5s ease-in-out infinite; }\n .tkx-draw-v { animation: tkx-draw-line 0.6s ease forwards; }\n .tkx-draw-h { animation: tkx-draw-line-h 0.6s ease forwards; }\n ",document.head.appendChild(e)}(),u.current=!0},[]);const p=!c,h="compact"===r,f="alternating"===r&&"vertical"===i;return"horizontal"===i?(0,a.jsx)("div",{role:"list","aria-label":"Timeline",className:n.tkx("flex items-start w-full overflow-x-auto"),children:e.map((t,o)=>{const r=t.status??"pending",i="completed"===r?d.success:d.border,l=o===e.length-1;return(0,a.jsx)("div",{role:"listitem",className:n.tkx("flex items-start flex-1 min-w-0"),children:(0,a.jsxs)("div",{className:n.tkx("flex flex-col items-center flex-1 min-w-0"),children:[(0,a.jsxs)("div",{className:n.tkx("flex items-center w-full"),children:[o>0&&(0,a.jsx)(lt,{style:s,color:i,animate:p}),(0,a.jsx)(rt,{status:r,icon:t.icon,size:24}),!l&&(0,a.jsx)(lt,{style:s,color:i,animate:p})]}),(0,a.jsxs)("div",{className:n.tkx("mt-2 px-1 text-center min-w-0 w-full"),children:[(0,a.jsx)("div",{className:n.tkx("text-xs font-semibold truncate"),style:{color:d.text},children:"string"==typeof t.title?n.sanitizeString(t.title):t.title}),t.timestamp&&(0,a.jsx)("div",{className:n.tkx("text-[10px] mt-0.5"),style:{color:d.textMuted},children:n.sanitizeString(t.timestamp)})]})]})},t.id)})}):(0,a.jsx)("div",{role:"list","aria-label":"Timeline",className:n.tkx("flex flex-col"),children:e.map((t,o)=>{const r=t.status??"pending",i=o===e.length-1,l="completed"===r?d.success:d.border,c=f&&o%2==0;return f?(0,a.jsxs)("div",{role:"listitem",className:n.tkx("flex items-stretch gap-0"),children:[(0,a.jsx)("div",{className:n.tkx("flex-1 flex flex-col items-end pr-4",c?"":"invisible"),children:c&&(0,a.jsx)(at,{item:t,compact:h})}),(0,a.jsxs)("div",{className:n.tkx("flex flex-col items-center"),children:[(0,a.jsx)(rt,{status:r,icon:t.icon,size:28}),!i&&(0,a.jsx)(it,{style:s,color:l,animate:p})]}),(0,a.jsx)("div",{className:n.tkx("flex-1 flex flex-col items-start pl-4",c?"invisible":""),children:!c&&(0,a.jsx)(at,{item:t,compact:h})})]},t.id):(0,a.jsxs)("div",{role:"listitem",className:n.tkx("flex gap-3 items-stretch"),children:[(0,a.jsxs)("div",{className:n.tkx("flex flex-col items-center"),children:[(0,a.jsx)(rt,{status:r,icon:t.icon,size:h?22:28}),!i&&(0,a.jsx)(it,{style:s,color:l,animate:p})]}),(0,a.jsx)("div",{className:n.tkx("flex-1 min-w-0 pt-0.5"),children:(0,a.jsx)(at,{item:t,compact:h})})]},t.id)})})},exports.TkxTitle=function({level:e=1,children:o,copyable:r=!1,type:i="default",style:a}){const s=yo(i);t.useTheme();const d=vo[e],c=`h${e}`,u="string"==typeof o?n.sanitizeString(o):o,p=go(o);return(0,l.createElement)(c,{style:{color:s,fontSize:d.fontSize,lineHeight:d.lineHeight,fontWeight:d.fontWeight,margin:"0 0 0.5em 0",fontFamily:"inherit",...a}},u,r&&(0,l.createElement)(bo,{text:p}))},exports.TkxToastProvider=function({position:e="top-right",children:t}){const[r,i]=(0,l.useState)([...Z]),d=o.useReducedMotion();(0,l.useEffect)(()=>{i([...Z]);const e=e=>i([...e]);return _.add(e),()=>{_.delete(e)}},[]);const c=e.startsWith("bottom"),u=oe[e],p=(0,l.useRef)(!1);if((0,l.useEffect)(()=>{if(!p.current&&"undefined"!=typeof document&&(p.current=!0,!document.getElementById("tkx-toast-kf"))){const e=document.createElement("style");e.id="tkx-toast-kf",e.textContent="\n @keyframes tkx-toast-slide-down {\n from { opacity: 0; transform: translateY(-16px); }\n to { opacity: 1; transform: translateY(0); }\n }\n @keyframes tkx-toast-slide-up {\n from { opacity: 0; transform: translateY(16px); }\n to { opacity: 1; transform: translateY(0); }\n }\n ",document.head.appendChild(e)}},[]),"undefined"==typeof document)return(0,a.jsx)(a.Fragment,{children:t});const h=c?[...r].reverse():r;return(0,a.jsxs)(a.Fragment,{children:[t,(0,s.createPortal)((0,a.jsx)("div",{"aria-label":"Notifications",className:n.tkx("fixed z-[9999] flex flex-col gap-2 pointer-events-none"),style:u,children:h.map(t=>(0,a.jsx)("div",{className:n.tkx("pointer-events-auto"),children:(0,a.jsx)(ie,{toast:t,position:e,onDismiss:te,reduced:d})},t.id))}),document.body)]})},exports.TkxToggle=$,exports.TkxToolbar=function({items:e,orientation:r="horizontal",size:i="md",variant:s="default",ariaLabel:d="Toolbar",className:c,style:u}){const p=t.useTheme(),h=o.useReducedMotion(),f=un[i],m="horizontal"===r,x=(0,l.useRef)(new Map),g=e.filter(e=>"separator"!==e.type&&!e.disabled).map(e=>e.id),b=(0,l.useCallback)(e=>{x.current.get(e)?.focus()},[]),y=(0,l.useCallback)((e,t)=>{const n=g.indexOf(t);if(n<0)return;const o=m?"ArrowRight":"ArrowDown",r=m?"ArrowLeft":"ArrowUp";switch(e.key){case o:e.preventDefault(),b(g[n+1<g.length?n+1:0]);break;case r:e.preventDefault(),b(g[n-1>=0?n-1:g.length-1]);break;case"Home":e.preventDefault(),b(g[0]);break;case"End":e.preventDefault(),b(g[g.length-1])}},[g,b,m]),v=e=>{e.type;const t=e.active;return{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:4,padding:`${f.buttonPy}px ${f.buttonPx}px`,fontSize:f.fontSize,borderRadius:6,border:"none",cursor:e.disabled?"not-allowed":"pointer",backgroundColor:t?`${p.primary}20`:"transparent",color:t?p.primary:e.disabled?p.textMuted:p.text,opacity:e.disabled?.5:1,outline:"none",transition:h?"none":"all 100ms ease",whiteSpace:"nowrap",lineHeight:1}};return(0,a.jsx)("div",{role:"toolbar","aria-label":d,"aria-orientation":r,className:n.tkx("inline-flex items-center rounded-lg font-sans",m?"flex-row":"flex-col",c??""),style:{...(()=>{switch(s){case"outlined":return{backgroundColor:"transparent",border:`1px solid ${p.border}`};case"filled":return{backgroundColor:p.surfaceAlt,border:"none"};default:return{backgroundColor:p.surface,border:`1px solid ${p.border}`}}})(),padding:f.gap,gap:f.gap,...u},children:e.map((e,t)=>{if("separator"===e.type)return(0,a.jsx)("div",{role:"separator","aria-orientation":m?"vertical":"horizontal",className:n.tkx("flex-shrink-0"),style:{...m?{width:1,height:f.separatorSize,marginLeft:2,marginRight:2}:{height:1,width:f.separatorSize,marginTop:2,marginBottom:2},backgroundColor:p.border}},e.id);const o=n.sanitizeString(e.label),r=!e.disabled,i=g[0]===e.id;return(0,a.jsxs)("button",{ref:t=>{t?x.current.set(e.id,t):x.current.delete(e.id)},type:"button",role:void e.type,"aria-pressed":"toggle"===e.type?e.active:void 0,"aria-label":o,"aria-disabled":e.disabled||void 0,tabIndex:r&&i?0:-1,disabled:e.disabled,onClick:()=>{e.disabled||e.onClick?.()},onKeyDown:t=>{y(t,e.id),"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.disabled||e.onClick?.())},className:n.tkx("focus-visible:ring-2 focus-visible:ring-offset-1"),style:v(e),onMouseEnter:t=>{e.disabled||e.active||(t.currentTarget.style.backgroundColor=p.surfaceAlt)},onMouseLeave:t=>{e.disabled||(t.currentTarget.style.backgroundColor=e.active?`${p.primary}20`:"transparent")},children:[e.icon&&(0,a.jsx)("span",{"aria-hidden":"true",style:{width:f.iconSize,height:f.iconSize,display:"flex",alignItems:"center",justifyContent:"center"},children:e.icon}),!e.icon&&o]},e.id)})})},exports.TkxTooltip=function({content:e,children:r,placement:i="top",delay:s=300}){const d=t.useTheme(),[c,u]=(0,l.useState)(!1),p=(0,l.useRef)(null),h=(0,l.useId)(),f=(0,l.useRef)(null),m=o.useReducedMotion(),x=n.sanitizeString(e),g=t.getAccessibleForeground(d.surfaceAlt,[d.text,"#ffffff","#000000"]);function b(){f.current=setTimeout(()=>u(!0),s)}function y(){f.current&&clearTimeout(f.current),u(!1)}o.useEscapeKey(y,c),o.useClickOutside(p,y),(0,l.useEffect)(()=>()=>{f.current&&(clearTimeout(f.current),f.current=null)},[]);const v=r,w=(0,l.cloneElement)(v,{"aria-describedby":c?h:void 0,onMouseEnter:e=>{v.props.onMouseEnter?.(e),b()},onMouseLeave:e=>{v.props.onMouseLeave?.(e),y()},onFocus:e=>{v.props.onFocus?.(e),b()},onBlur:e=>{v.props.onBlur?.(e),y()}});return(0,a.jsxs)("span",{ref:p,className:n.tkx("relative inline-flex"),children:[w,c&&(0,a.jsx)("span",{id:h,role:"tooltip",className:n.tkx("absolute z-[9000] text-xs font-sans py-1.5 px-2.5 rounded-md whitespace-nowrap pointer-events-none",!m&&"animate-fade-in"),style:{backgroundColor:d.surfaceAlt,color:g,border:`1px solid ${d.border}`,boxShadow:`0 4px 12px ${d.bg}40`,maxWidth:280,...D[i]},children:x})]})},exports.TkxTour=function({steps:e,isOpen:r=!1,onClose:i,current:d,onChange:c}){const u=t.useTheme(),p=o.useReducedMotion(),[h,f]=(0,l.useState)(0),m=d??h,x=(0,l.useRef)(null),[g,b]=(0,l.useState)({top:0,left:0}),[y,v]=(0,l.useState)(null),w=e[m],k=(0,l.useCallback)(()=>{if(!w)return;const e=function(e){const t=document.querySelector(e);return t?t.getBoundingClientRect():null}(w.target);if(v(e),e&&x.current){const t=x.current.offsetWidth,n=x.current.offsetHeight;b(function(e,t,n,o){switch(t){case"top":return{top:e.top-o-12+window.scrollY,left:e.left+e.width/2-n/2+window.scrollX};case"bottom":return{top:e.bottom+12+window.scrollY,left:e.left+e.width/2-n/2+window.scrollX};case"left":return{top:e.top+e.height/2-o/2+window.scrollY,left:e.left-n-12+window.scrollX};case"right":return{top:e.top+e.height/2-o/2+window.scrollY,left:e.right+12+window.scrollX};default:return{top:e.bottom+12+window.scrollY,left:e.left+window.scrollX}}}(e,w.placement??"bottom",t,n))}},[w]);(0,l.useEffect)(()=>{if(r)return k(),window.addEventListener("resize",k),window.addEventListener("scroll",k,!0),()=>{window.removeEventListener("resize",k),window.removeEventListener("scroll",k,!0)}},[r,m,k]),(0,l.useEffect)(()=>{r&&x.current?.focus()},[r,m]);const C=(0,l.useCallback)(e=>{f(e),c?.(e)},[c]),S=(0,l.useCallback)(()=>{m<e.length-1?C(m+1):i?.()},[m,e.length,C,i]),$=(0,l.useCallback)(()=>{m>0&&C(m-1)},[m,C]);if(!r||!w)return null;const z=n.sanitizeString(w.title),N=n.sanitizeString(w.description);return(0,s.createPortal)((0,a.jsxs)("div",{"aria-hidden":"true",children:[(0,a.jsx)("div",{style:{position:"fixed",inset:0,zIndex:9998,backgroundColor:"rgba(0,0,0,0.55)",clipPath:y?`polygon(0% 0%, 0% 100%, ${y.left-6}px 100%, ${y.left-6}px ${y.top-6}px, ${y.right+6}px ${y.top-6}px, ${y.right+6}px ${y.bottom+6}px, ${y.left-6}px ${y.bottom+6}px, ${y.left-6}px 100%, 100% 100%, 100% 0%)`:void 0,transition:p?"none":"clip-path 0.25s ease"},onClick:i}),(0,a.jsxs)("div",{ref:x,role:"dialog","aria-modal":"true","aria-label":`Tour step ${m+1} of ${e.length}`,tabIndex:-1,style:{position:"absolute",zIndex:9999,top:g.top,left:g.left,width:300,backgroundColor:u.surface,border:`1px solid ${u.border}`,borderRadius:10,padding:20,boxShadow:`0 8px 24px ${u.bg}80`,animation:p?"none":"tkxFadeIn 0.2s ease",fontFamily:"inherit"},onKeyDown:e=>{"Escape"===e.key&&i?.()},children:[(0,a.jsx)("h3",{className:n.tkx("m-0 mb-2 text-base font-semibold"),style:{color:u.text},children:z}),(0,a.jsx)("p",{className:n.tkx("m-0 mb-4 text-sm leading-relaxed"),style:{color:u.textMuted},children:N}),(0,a.jsx)("div",{className:n.tkx("flex items-center gap-1 mb-4"),"aria-label":"Tour progress",children:e.map((e,t)=>(0,a.jsx)("span",{"aria-hidden":"true",style:{width:8,height:8,borderRadius:"50%",backgroundColor:t===m?u.primary:u.border,transition:p?"none":"background-color 0.2s"}},t))}),(0,a.jsxs)("div",{className:n.tkx("flex items-center justify-between gap-2"),children:[(0,a.jsx)("button",{type:"button","aria-label":"Skip tour",onClick:i,className:n.tkx("border-0 bg-transparent cursor-pointer text-sm px-2 py-1"),style:{color:u.textMuted},children:"Skip"}),(0,a.jsxs)("div",{className:n.tkx("flex gap-2"),children:[m>0&&(0,a.jsx)("button",{type:"button","aria-label":"Previous step",onClick:$,className:n.tkx("rounded-md border px-3 py-1 text-sm cursor-pointer bg-transparent"),style:{borderColor:u.border,color:u.text},children:"Prev"}),(0,a.jsx)("button",{type:"button","aria-label":m===e.length-1?"Finish tour":"Next step",onClick:S,className:n.tkx("rounded-md border-0 px-4 py-1 text-sm cursor-pointer font-medium"),style:{backgroundColor:u.primary,color:"#fff"},children:m===e.length-1?"Finish":"Next"})]})]})]})]}),document.body)},exports.TkxTransferList=function({sourceItems:e,targetItems:r,onTransfer:i,sourceTitle:s="Available",targetTitle:d="Selected",searchable:c=!1,height:u=300,className:p,style:h}){const f=t.useTheme(),m=o.useReducedMotion(),x=(0,l.useId)(),g=(0,l.useId)(),[b,y]=(0,l.useState)(new Set),[v,w]=(0,l.useState)(new Set),[k,C]=(0,l.useState)(""),[S,$]=(0,l.useState)(""),z=(0,l.useCallback)(e=>{y(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),N=(0,l.useCallback)(e=>{w(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),M=(0,l.useCallback)(()=>{const t=e.filter(e=>!e.disabled).map(e=>e.value);t.every(e=>b.has(e))?y(new Set):y(new Set(t))},[e,b]),I=(0,l.useCallback)(()=>{const e=r.filter(e=>!e.disabled).map(e=>e.value);e.every(e=>v.has(e))?w(new Set):w(new Set(e))},[r,v]),L=(0,l.useCallback)(()=>{if(0===b.size)return;const t=e.filter(e=>b.has(e.value)&&!e.disabled);i(e.filter(e=>!b.has(e.value)||e.disabled),[...r,...t]),y(new Set)},[e,r,b,i]),W=(0,l.useCallback)(()=>{if(0===v.size)return;const t=r.filter(e=>v.has(e.value)&&!e.disabled),n=r.filter(e=>!v.has(e.value)||e.disabled);i([...e,...t],n),w(new Set)},[e,r,v,i]),D=e=>({display:"inline-flex",alignItems:"center",justifyContent:"center",width:36,height:36,borderRadius:8,border:`1px solid ${f.border}`,backgroundColor:e?f.surface:f.surfaceAlt,cursor:e?"not-allowed":"pointer",opacity:e?.5:1,transition:m?"none":"all 100ms ease",outline:"none"});return(0,a.jsxs)("div",{className:n.tkx("flex gap-3 font-sans","flex-col sm:flex-row",p??""),style:{color:f.text,...h},children:[(0,a.jsx)(xn,{title:s,items:e,selected:b,onToggle:z,onToggleAll:M,search:k,onSearchChange:C,searchable:c,height:u,listId:x}),(0,a.jsxs)("div",{className:n.tkx("flex items-center justify-center gap-2","flex-row sm:flex-col"),style:{padding:"8px 0"},children:[(0,a.jsx)("button",{type:"button","aria-label":"Move selected items to target list",disabled:0===b.size,onClick:L,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),L())},className:n.tkx("focus-visible:ring-2 focus-visible:ring-offset-1"),style:D(0===b.size),onMouseEnter:e=>{b.size>0&&(e.currentTarget.style.backgroundColor=f.primary,e.currentTarget.style.borderColor=f.primary)},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=0===b.size?f.surface:f.surfaceAlt,e.currentTarget.style.borderColor=f.border},children:(0,a.jsx)(fn,{color:f.text})}),(0,a.jsx)("button",{type:"button","aria-label":"Move selected items to source list",disabled:0===v.size,onClick:W,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),W())},className:n.tkx("focus-visible:ring-2 focus-visible:ring-offset-1"),style:D(0===v.size),onMouseEnter:e=>{v.size>0&&(e.currentTarget.style.backgroundColor=f.primary,e.currentTarget.style.borderColor=f.primary)},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=0===v.size?f.surface:f.surfaceAlt,e.currentTarget.style.borderColor=f.border},children:(0,a.jsx)(mn,{color:f.text})})]}),(0,a.jsx)(xn,{title:d,items:r,selected:v,onToggle:N,onToggleAll:I,search:S,onSearchChange:$,searchable:c,height:u,listId:g})]})},exports.TkxTreeView=function({data:e,selected:r,onSelect:i,expanded:s,onExpand:d,multiSelect:c=!1,showCheckboxes:u=!1,showLines:p=!1,className:h,style:f}){const m=t.useTheme(),x=o.useReducedMotion();(0,l.useId)();const[g,b]=(0,l.useState)([]),[y,v]=(0,l.useState)([]),w=new Set(r??g),k=new Set(s??y),C=(0,l.useCallback)(e=>{void 0===s&&v(e),d?.(e)},[s,d]),S=(0,l.useCallback)(e=>{void 0===r&&b(e),i?.(e)},[r,i]),$=(0,l.useCallback)(e=>{const t=Array.from(k);k.has(e)?C(t.filter(t=>t!==e)):C([...t,e])},[k,C]),z=(0,l.useCallback)(e=>{if(c){const t=Array.from(w);w.has(e)?S(t.filter(t=>t!==e)):S([...t,e])}else S(w.has(e)?[]:[e])},[c,w,S]),N=function(e,t){const n=[];return function e(o,r){for(const i of o)n.push({node:i,depth:r}),i.children?.length&&t.has(i.id)&&e(i.children,r+1)}(e,0),n}(e,k),M=(0,l.useRef)(0),I=(0,l.useRef)(new Map),L=e=>{M.current=e,I.current.get(e)?.focus()};return(0,a.jsx)("ul",{role:"tree","aria-label":"Tree view","aria-multiselectable":c||void 0,className:n.tkx("list-none m-0 p-0 font-sans select-none",h??""),style:{color:m.text,...f},children:N.map(({node:e,depth:t},o)=>{const r=(e.children?.length??0)>0,i=k.has(e.id),l=w.has(e.id),s=n.sanitizeString(e.label);return(0,a.jsxs)("li",{role:"treeitem","aria-selected":l,"aria-expanded":r?i:void 0,"aria-disabled":e.disabled||void 0,"aria-level":t+1,"aria-setsize":N.filter(e=>e.depth===t).length,tabIndex:0===o?0:-1,ref:e=>{e?I.current.set(o,e):I.current.delete(o)},onKeyDown:e=>((e,t)=>{const n=N[t];if(!n)return;const{node:o}=n,r=(o.children?.length??0)>0;switch(e.key){case"ArrowDown":e.preventDefault(),t<N.length-1&&L(t+1);break;case"ArrowUp":e.preventDefault(),t>0&&L(t-1);break;case"ArrowRight":e.preventDefault(),r&&!k.has(o.id)?$(o.id):r&&k.has(o.id)&&t<N.length-1&&L(t+1);break;case"ArrowLeft":if(e.preventDefault(),r&&k.has(o.id))$(o.id);else for(let e=t-1;e>=0;e--)if(N[e].depth<n.depth){L(e);break}break;case"Enter":case" ":e.preventDefault(),o.disabled||z(o.id);break;case"Home":e.preventDefault(),L(0);break;case"End":e.preventDefault(),L(N.length-1)}})(e,o),onClick:()=>{e.disabled||(r&&$(e.id),z(e.id))},className:n.tkx("relative flex items-center gap-1.5 py-1 px-2 rounded-md cursor-pointer","outline-none focus-visible:ring-2 focus-visible:ring-offset-1",e.disabled?"opacity-50 cursor-not-allowed":""),style:{paddingLeft:24*t+8,backgroundColor:l?`${m.primary}18`:"transparent",transition:x?"none":"background-color 100ms ease",minHeight:32},onMouseEnter:t=>{l||e.disabled||(t.currentTarget.style.backgroundColor=m.surfaceAlt)},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=l?`${m.primary}18`:"transparent"},children:[p&&t>0&&(0,a.jsx)("span",{"aria-hidden":"true",style:{position:"absolute",left:24*(t-1)+16,top:0,bottom:0,width:1,backgroundColor:m.border}}),r?(0,a.jsx)("span",{role:"presentation",onClick:t=>{t.stopPropagation(),$(e.id)},className:n.tkx("inline-flex items-center justify-center cursor-pointer"),style:{width:20,height:20},children:(0,a.jsx)(dn,{expanded:i,color:m.textMuted,reducedMotion:x})}):(0,a.jsx)("span",{style:{width:20,height:20},"aria-hidden":"true"}),u&&(0,a.jsx)(cn,{checked:l,color:m.primary,borderColor:m.border}),e.icon&&(0,a.jsx)("span",{"aria-hidden":"true",className:n.tkx("flex-shrink-0"),children:e.icon}),(0,a.jsx)("span",{className:n.tkx("text-sm truncate"),style:{color:e.disabled?m.textMuted:m.text},children:s})]},e.id)})})},exports.TkxVideoPlayer=zt,exports.TkxWatermark=function({text:e,children:r,rotate:i=-22,gap:s=[100,100],fontSize:d=14,color:c,zIndex:u=10}){const p=t.useTheme(),h=o.useReducedMotion(),f=(0,l.useRef)(null),[m,x]=(0,l.useState)(""),g=(0,l.useMemo)(()=>(Array.isArray(e)?e:[e]).map(e=>n.sanitizeString(e)),[e]),b=c??`${p.textMuted}22`,y=(0,l.useCallback)(()=>function(e,t,n,o,r){const i=document.createElement("canvas"),l=i.getContext("2d");if(!l)return"";const a=1.5*o,s=e.length*a,d=Math.max(...e.map(e=>e.length))*o*.6,c=n[0]+d,u=n[1]+s;return i.width=2*c,i.height=2*u,l.scale(2,2),l.translate(c/2,u/2),l.rotate(t*Math.PI/180),l.font=`${o}px sans-serif`,l.fillStyle=r,l.textAlign="center",l.textBaseline="middle",e.forEach((t,n)=>{const o=(n-(e.length-1)/2)*a;l.fillText(t,0,o)}),i.toDataURL()}(g,i,s,d,b),[g,i,s,d,b]);return(0,l.useEffect)(()=>{const e=y();e&&x(`url(${e})`)},[y]),(0,l.useEffect)(()=>{const e=f.current?.querySelector("[data-watermark]");if(!e)return;const t=new MutationObserver(()=>{const t=y();t&&(e.style.backgroundImage=`url(${t})`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>t.disconnect()},[y]),(0,a.jsxs)("div",{ref:f,className:n.tkx("relative"),style:{overflow:"hidden"},children:[r,(0,a.jsx)("div",{"data-watermark":!0,"aria-hidden":"true",className:n.tkx("absolute inset-0 pointer-events-none"),style:{zIndex:u,backgroundImage:m,backgroundRepeat:"repeat",animation:h?"none":"tkxFadeIn 0.3s ease"}})]})},exports.VisuallyHidden=function({as:e,children:t,...n}){return(0,a.jsx)(e??"span",{className:"tkx-sr-only",...n,children:t})},exports.WCAGEngine=t.WCAGEngine,exports.audit=n.audit,exports.auroraLight=t.auroraLight,exports.batchUpdate=t.batchUpdate,exports.breakpoints=t.breakpoints,exports.buildTkxCSP=n.buildTkxCSP,exports.contrastRatio=t.contrastRatio,exports.createFocusTrap=t.createFocusTrap,exports.createRateLimiter=n.createRateLimiter,exports.createTheme=t.createTheme,exports.css=t.css,exports.cssVar=t.cssVar,exports.cx=n.cx,exports.deepFreeze=n.deepFreeze,exports.extractAtomicCSS=n.extractAtomicCSS,exports.extractCSS=t.extractCSS,exports.fnv1aHash=t.fnv1aHash,exports.fromObject=t.fromObject,exports.generatePalette=t.generatePalette,exports.getAccessibleForeground=t.getAccessibleForeground,exports.getAuditLog=n.getAuditLog,exports.getLocaleDisplayName=function(e){if(mo[e])return mo[e];if("undefined"!=typeof Intl&&Intl.DisplayNames)try{return new Intl.DisplayNames(["en"],{type:"language"}).of(e)??e}catch{return e}return e},exports.injectStyles=t.injectStyles,exports.installFrameBuster=n.installFrameBuster,exports.installTrustedTypes=n.installTrustedTypes,exports.isFramed=n.isFramed,exports.isRTL=i.isRTL,exports.isRtlLocale=function(e){return xo.has(e)||xo.has(e.split("-")[0])},exports.isSafeAttrName=n.isSafeAttrName,exports.keyframes=t.keyframes,exports.meetsAA=t.meetsAA,exports.meetsAAA=t.meetsAAA,exports.memoize=t.memoize,exports.prefersHighContrast=t.prefersHighContrast,exports.prefersReducedMotion=t.prefersReducedMotion,exports.quantumDark=t.quantumDark,exports.radii=t.radii,exports.resetAtomicCSS=n.resetAtomicCSS,exports.resolvePluginUtility=n.resolvePluginUtility,exports.responsive=t.responsive,exports.sanitizeCSS=n.sanitizeCSS,exports.sanitizeHTML=n.sanitizeHTML,exports.sanitizeHref=n.sanitizeHref,exports.sanitizeJSON=n.sanitizeJSON,exports.sanitizeProps=n.sanitizeProps,exports.sanitizeString=n.sanitizeString,exports.sanitizeUnicode=n.sanitizeUnicode,exports.scrubPII=n.scrubPII,exports.shadows=t.shadows,exports.sniffMimeType=n.sniffMimeType,exports.spacing=t.spacing,exports.tkx=n.tkx,exports.tkxListPlugins=n.tkxListPlugins,exports.tkxPlugin=n.tkxPlugin,exports.tkxRemovePlugin=n.tkxRemovePlugin,exports.tx=n.tx,exports.typography=t.typography,exports.useAnnounce=o.useAnnounce,exports.useClickOutside=o.useClickOutside,exports.useComponentSize=function(e,t){const{getSize:n}=fo();return n(e,t)},exports.useConfig=fo,exports.useDirection=i.useDirection,exports.useEscapeKey=o.useEscapeKey,exports.useFocusTrap=o.useFocusTrap,exports.useHighContrast=o.useHighContrast,exports.useI18n=i.useI18n,exports.useLocale=i.useLocale,exports.useLogicalSpacing=function(e,t=0){const{direction:n}=fo(),o="number"==typeof e?`${e}px`:e,r="number"==typeof t?`${t}px`:t;return"rtl"===n?{marginRight:o,marginLeft:r}:{marginLeft:o,marginRight:r}},exports.usePrefixCls=function(e,t){const{prefixCls:n}=fo();return`${t??n}-${e}`},exports.useReducedMotion=o.useReducedMotion,exports.useRtlFlip=function(){const{direction:e}=fo();if("rtl"===e)return{transform:"scaleX(-1)"}},exports.useTheme=t.useTheme,exports.useTkxCommand=function(){const[e,t]=(0,l.useState)(!1);return{isOpen:e,open:(0,l.useCallback)(()=>t(!0),[]),close:(0,l.useCallback)(()=>t(!1),[]),toggle:(0,l.useCallback)(()=>t(e=>!e),[])}},exports.useTkxForm=r.useTkxForm,exports.useToast=function(){return{toast:(0,l.useCallback)(e=>function(e){const t=`tkx-toast-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,n={...e,id:t,duration:e.duration??4e3};return Z.length<5?(Z=[...Z,n],ee(t,n.duration)):G=[...G,n],Q(),t}(e),[]),dismiss:(0,l.useCallback)(e=>te(e),[]),dismissAll:(0,l.useCallback)(()=>(J.forEach(e=>clearTimeout(e)),J.clear(),Z=[],G=[],void Q()),[])}},exports.validateProps=n.validateProps,exports.verifyAuditIntegrity=n.verifyAuditIntegrity,exports.zIndex=t.zIndex;