@wakastellar/ui 4.0.1 → 4.1.1

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 (622) hide show
  1. package/dist/blocks/_shared/identity/InviteUserPanel.cjs.js +1 -1
  2. package/dist/blocks/_shared/identity/RoleSelect.cjs.js +1 -1
  3. package/dist/blocks/_shared/identity/SidePushLayout.cjs.js +1 -1
  4. package/dist/blocks/activity-timeline/index.cjs.js +1 -1
  5. package/dist/blocks/activity-timeline/index.es.js +1 -1
  6. package/dist/blocks/antivirus-dashboard/index.cjs.js +1 -1
  7. package/dist/blocks/antivirus-dashboard/index.es.js +1 -1
  8. package/dist/blocks/api-keys-manager/index.cjs.js +1 -1
  9. package/dist/blocks/apm-overview/index.cjs.js +1 -1
  10. package/dist/blocks/auth-2fa/index.cjs.js +2 -2
  11. package/dist/blocks/auth-2fa/index.es.js +1 -1
  12. package/dist/blocks/avatar-upload/index.cjs.js +1 -1
  13. package/dist/blocks/avatar-upload/index.es.js +13 -13
  14. package/dist/blocks/calendar-view/index.cjs.js +1 -1
  15. package/dist/blocks/calendar-view/index.es.js +1 -1
  16. package/dist/blocks/chat/index.cjs.js +1 -1
  17. package/dist/blocks/chat/index.es.js +162 -162
  18. package/dist/blocks/chat/widget.cjs.js +1 -1
  19. package/dist/blocks/chat/widget.es.js +19 -13
  20. package/dist/blocks/chat-interface/index.cjs.js +1 -1
  21. package/dist/blocks/chat-interface/index.es.js +1 -1
  22. package/dist/blocks/checkout-flow/index.cjs.js +1 -1
  23. package/dist/blocks/checkout-flow/index.es.js +1 -1
  24. package/dist/blocks/cicd-builder/index.cjs.js +1 -1
  25. package/dist/blocks/clamav-service-status/index.cjs.js +1 -1
  26. package/dist/blocks/cloud-cost-dashboard/index.cjs.js +1 -1
  27. package/dist/blocks/container-orchestrator/index.cjs.js +1 -1
  28. package/dist/blocks/container-orchestrator/index.es.js +2 -1
  29. package/dist/blocks/dashboard/index.cjs.js +1 -1
  30. package/dist/blocks/dashboard/index.es.js +2 -2
  31. package/dist/blocks/dashboard-kpi/index.cjs.js +1 -1
  32. package/dist/blocks/dashboard-kpi/index.es.js +1 -1
  33. package/dist/blocks/database-admin/index.cjs.js +1 -1
  34. package/dist/blocks/deployment-dashboard/index.cjs.js +1 -1
  35. package/dist/blocks/deployment-dashboard/index.es.js +1 -1
  36. package/dist/blocks/empty-states/index.cjs.js +1 -1
  37. package/dist/blocks/empty-states/index.es.js +1 -1
  38. package/dist/blocks/error-pages/index.cjs.js +1 -1
  39. package/dist/blocks/error-pages/index.es.js +1 -1
  40. package/dist/blocks/faq/index.cjs.js +1 -1
  41. package/dist/blocks/faq/index.es.js +1 -1
  42. package/dist/blocks/file-manager/index.cjs.js +1 -1
  43. package/dist/blocks/file-manager/index.es.js +1 -1
  44. package/dist/blocks/file-scan-uploader/index.cjs.js +1 -1
  45. package/dist/blocks/file-scan-uploader/index.es.js +2 -2
  46. package/dist/blocks/footer/index.cjs.js +1 -1
  47. package/dist/blocks/gitops-sync-status/index.cjs.js +1 -1
  48. package/dist/blocks/header/index.cjs.js +1 -1
  49. package/dist/blocks/header/index.es.js +1 -1
  50. package/dist/blocks/headtab/index.cjs.js +1 -1
  51. package/dist/blocks/i18n-editor/index.cjs.js +1 -1
  52. package/dist/blocks/i18n-editor/index.es.js +127 -127
  53. package/dist/blocks/incident-manager/index.cjs.js +1 -1
  54. package/dist/blocks/infrastructure-map/index.cjs.js +1 -1
  55. package/dist/blocks/kanban-board/index.cjs.js +1 -1
  56. package/dist/blocks/kanban-board/index.es.js +1 -1
  57. package/dist/blocks/landing/index.cjs.js +1 -1
  58. package/dist/blocks/landing/index.es.js +1 -1
  59. package/dist/blocks/language-selector/index.cjs.js +1 -1
  60. package/dist/blocks/layout/index.cjs.js +1 -1
  61. package/dist/blocks/login/index.cjs.js +1 -1
  62. package/dist/blocks/on-call-schedule/index.cjs.js +1 -1
  63. package/dist/blocks/player-profile/index.cjs.js +1 -1
  64. package/dist/blocks/player-profile/index.es.js +1 -1
  65. package/dist/blocks/pricing/index.cjs.js +1 -1
  66. package/dist/blocks/pricing/index.es.js +1 -1
  67. package/dist/blocks/profile/index.cjs.js +1 -1
  68. package/dist/blocks/profile/index.es.js +1 -1
  69. package/dist/blocks/profile-list/index.cjs.js +1 -1
  70. package/dist/blocks/quarantine-manager/index.cjs.js +1 -1
  71. package/dist/blocks/quarantine-manager/index.es.js +1 -1
  72. package/dist/blocks/release-notes/index.cjs.js +1 -1
  73. package/dist/blocks/scan-history-log/index.cjs.js +1 -1
  74. package/dist/blocks/scan-history-log/index.es.js +1 -1
  75. package/dist/blocks/scan-policy-editor/index.cjs.js +1 -1
  76. package/dist/blocks/scan-report-generator/index.cjs.js +1 -1
  77. package/dist/blocks/settings/index.cjs.js +1 -1
  78. package/dist/blocks/settings/index.es.js +1 -1
  79. package/dist/blocks/sidebar/index.cjs.js +1 -1
  80. package/dist/blocks/sidebar/index.es.js +1 -1
  81. package/dist/blocks/signature-database-manager/index.cjs.js +1 -1
  82. package/dist/blocks/team-form/index.cjs.js +1 -1
  83. package/dist/blocks/threat-alert-banner/index.cjs.js +1 -1
  84. package/dist/blocks/user-management/index.cjs.js +1 -1
  85. package/dist/blocks/waka-doc-shell/index.cjs.js +1 -1
  86. package/dist/blocks/wizard/index.cjs.js +1 -1
  87. package/dist/blocks/wizard/index.es.js +37 -37
  88. package/dist/charts.cjs.js +1 -1
  89. package/dist/charts.es.js +8 -8
  90. package/dist/cli/index.cjs +5 -1
  91. package/dist/components/DataTable/DataTable.cjs.js +1 -1
  92. package/dist/components/DataTable/DataTable.es.js +68 -66
  93. package/dist/components/DataTable/DataTableAdvanced.cjs.js +1 -1
  94. package/dist/components/DataTable/DataTableColumnResizer.cjs.js +1 -1
  95. package/dist/components/DataTable/DataTableContextMenu.cjs.js +1 -1
  96. package/dist/components/DataTable/DataTableEditCell.cjs.js +1 -1
  97. package/dist/components/DataTable/DataTableFilters.cjs.js +1 -1
  98. package/dist/components/DataTable/DataTableGrouping.cjs.js +1 -1
  99. package/dist/components/DataTable/DataTablePagination.cjs.js +1 -1
  100. package/dist/components/DataTable/DataTablePagination.d.ts +3 -1
  101. package/dist/components/DataTable/DataTablePagination.es.js +38 -27
  102. package/dist/components/DataTable/DataTableSelection.cjs.js +1 -1
  103. package/dist/components/DataTable/DataTableToolbar.cjs.js +1 -1
  104. package/dist/components/DataTable/hooks/useDataTable.cjs.js +1 -1
  105. package/dist/components/DataTable/hooks/useDataTable.es.js +5 -1
  106. package/dist/components/DataTable/hooks/useDataTableAdvanced.cjs.js +1 -1
  107. package/dist/components/DataTable/hooks/useDataTableEdit.cjs.js +1 -1
  108. package/dist/components/DataTable/hooks/useDataTableExport.cjs.js +2 -2
  109. package/dist/components/DataTable/hooks/useDataTableImport.cjs.js +2 -2
  110. package/dist/components/DataTable/hooks/useDataTableImport.es.js +2 -1
  111. package/dist/components/DataTable/hooks/useDataTableTheme.cjs.js +1 -1
  112. package/dist/components/DataTable/hooks/useDataTableVirtualization.cjs.js +1 -1
  113. package/dist/components/DataTable/hooks/useTableLayout.cjs.js +1 -1
  114. package/dist/components/DataTable/utils.cjs.js +1 -1
  115. package/dist/components/accordion/index.cjs.js +1 -1
  116. package/dist/components/alert/index.cjs.js +1 -1
  117. package/dist/components/alert-dialog/index.cjs.js +1 -1
  118. package/dist/components/aspect-ratio/index.cjs.js +1 -1
  119. package/dist/components/avatar/index.cjs.js +1 -1
  120. package/dist/components/badge/index.cjs.js +1 -1
  121. package/dist/components/button/index.cjs.js +1 -1
  122. package/dist/components/calendar/index.cjs.js +1 -1
  123. package/dist/components/card/index.cjs.js +1 -1
  124. package/dist/components/checkbox/index.cjs.js +1 -1
  125. package/dist/components/code/index.cjs.js +2 -2
  126. package/dist/components/code/index.es.js +3 -2
  127. package/dist/components/collapsible/index.cjs.js +1 -1
  128. package/dist/components/command/index.cjs.js +1 -1
  129. package/dist/components/context-menu/index.cjs.js +1 -1
  130. package/dist/components/dialog/index.cjs.js +1 -1
  131. package/dist/components/dropdown-menu/index.cjs.js +1 -1
  132. package/dist/components/editor/blocks/index.cjs.js +1 -1
  133. package/dist/components/editor/blocks/index.es.js +12 -12
  134. package/dist/components/editor/blocks/waka-acceptance-criteria-block.cjs.js +1 -1
  135. package/dist/components/editor/blocks/waka-ai-assist-block.cjs.js +1 -1
  136. package/dist/components/editor/blocks/waka-api-endpoint-block.cjs.js +1 -1
  137. package/dist/components/editor/blocks/waka-code-playground-block.cjs.js +1 -1
  138. package/dist/components/editor/blocks/waka-comment-thread-block.cjs.js +1 -1
  139. package/dist/components/editor/blocks/waka-diagram-block.cjs.js +3 -3
  140. package/dist/components/editor/blocks/waka-diagram-block.es.js +21 -40
  141. package/dist/components/editor/blocks/waka-embed-block.cjs.js +1 -1
  142. package/dist/components/editor/blocks/waka-slash-menu-block.cjs.js +1 -1
  143. package/dist/components/editor/blocks/waka-user-story-block.cjs.js +1 -1
  144. package/dist/components/editor/blocks/waka-version-diff-block.cjs.js +1 -1
  145. package/dist/components/editor/waka-ai-writer.cjs.js +1 -1
  146. package/dist/components/editor/waka-collaborative-editor.cjs.js +1 -1
  147. package/dist/components/editor/waka-diff-viewer.cjs.js +1 -1
  148. package/dist/components/editor/waka-dnd-editor.cjs.js +1 -1
  149. package/dist/components/editor/waka-document-editor.cjs.js +1 -1
  150. package/dist/components/editor/waka-document-editor.es.js +1 -1
  151. package/dist/components/editor/waka-editor-elements.cjs.js +1 -1
  152. package/dist/components/editor/waka-editor-leaves.cjs.js +1 -1
  153. package/dist/components/editor/waka-editor-toolbar.cjs.js +1 -1
  154. package/dist/components/editor/waka-editor.cjs.js +1 -1
  155. package/dist/components/editor/waka-floating-toolbar.cjs.js +1 -1
  156. package/dist/components/editor/waka-markdown-editor.cjs.js +1 -1
  157. package/dist/components/editor/waka-mention-editor.cjs.js +1 -1
  158. package/dist/components/editor/waka-mention-editor.es.js +2 -2
  159. package/dist/components/editor/waka-slash-menu.cjs.js +1 -1
  160. package/dist/components/editor/waka-spec-editor.cjs.js +1 -1
  161. package/dist/components/form/index.cjs.js +1 -1
  162. package/dist/components/hover-card/index.cjs.js +1 -1
  163. package/dist/components/input/index.cjs.js +1 -1
  164. package/dist/components/input-otp/index.cjs.js +1 -1
  165. package/dist/components/input-otp/index.es.js +2 -1
  166. package/dist/components/label/index.cjs.js +1 -1
  167. package/dist/components/language-selector/index.cjs.js +1 -1
  168. package/dist/components/menubar/index.cjs.js +1 -1
  169. package/dist/components/navigation-menu/index.cjs.js +1 -1
  170. package/dist/components/popover/index.cjs.js +1 -1
  171. package/dist/components/progress/index.cjs.js +1 -1
  172. package/dist/components/radio-group/index.cjs.js +1 -1
  173. package/dist/components/resizable/index.cjs.js +1 -1
  174. package/dist/components/resizable/index.es.js +9 -9
  175. package/dist/components/scroll-area/index.cjs.js +1 -1
  176. package/dist/components/select/index.cjs.js +1 -1
  177. package/dist/components/separator/index.cjs.js +1 -1
  178. package/dist/components/sheet/index.cjs.js +1 -1
  179. package/dist/components/skeleton/index.cjs.js +1 -1
  180. package/dist/components/slider/index.cjs.js +1 -1
  181. package/dist/components/switch/index.cjs.js +1 -1
  182. package/dist/components/table/index.cjs.js +1 -1
  183. package/dist/components/tabs/index.cjs.js +1 -1
  184. package/dist/components/textarea/index.cjs.js +1 -1
  185. package/dist/components/theme-selector/index.cjs.js +1 -1
  186. package/dist/components/toast/index.cjs.js +1 -1
  187. package/dist/components/toaster/index.cjs.js +1 -1
  188. package/dist/components/toggle/index.cjs.js +1 -1
  189. package/dist/components/toggle-group/index.cjs.js +1 -1
  190. package/dist/components/tooltip/index.cjs.js +1 -1
  191. package/dist/components/typography/index.cjs.js +1 -1
  192. package/dist/components/waka-3d-pie-chart/index.cjs.js +1 -1
  193. package/dist/components/waka-3d-pie-chart/index.es.js +1 -1
  194. package/dist/components/waka-achievement-unlock/index.cjs.js +1 -1
  195. package/dist/components/waka-achievement-unlock/index.es.js +1 -1
  196. package/dist/components/waka-activity-feed/index.cjs.js +2 -2
  197. package/dist/components/waka-activity-feed/index.es.js +1 -1
  198. package/dist/components/waka-ad-banner/index.cjs.js +1 -1
  199. package/dist/components/waka-ad-banner/index.es.js +18 -15
  200. package/dist/components/waka-ad-fallback/index.cjs.js +1 -1
  201. package/dist/components/waka-ad-fallback/index.es.js +1 -1
  202. package/dist/components/waka-ad-inline/index.cjs.js +1 -1
  203. package/dist/components/waka-ad-inline/index.es.js +2 -2
  204. package/dist/components/waka-ad-interstitial/index.cjs.js +1 -1
  205. package/dist/components/waka-ad-interstitial/index.es.js +3 -3
  206. package/dist/components/waka-ad-placeholder/index.cjs.js +2 -2
  207. package/dist/components/waka-ad-placeholder/index.es.js +1 -1
  208. package/dist/components/waka-ad-provider/index.cjs.js +1 -1
  209. package/dist/components/waka-ad-provider/index.es.js +1 -1
  210. package/dist/components/waka-ad-sidebar/index.cjs.js +1 -1
  211. package/dist/components/waka-ad-sidebar/index.es.js +2 -2
  212. package/dist/components/waka-ad-sticky-footer/index.cjs.js +1 -1
  213. package/dist/components/waka-ad-sticky-footer/index.es.js +2 -2
  214. package/dist/components/waka-address-autocomplete/index.cjs.js +2 -2
  215. package/dist/components/waka-address-autocomplete/index.es.js +10 -6
  216. package/dist/components/waka-admincrumb/index.cjs.js +1 -1
  217. package/dist/components/waka-alert-panel/index.cjs.js +1 -1
  218. package/dist/components/waka-alert-stack/index.cjs.js +1 -1
  219. package/dist/components/waka-alert-stack/index.es.js +1 -1
  220. package/dist/components/waka-allocation-matrix/index.cjs.js +2 -2
  221. package/dist/components/waka-allocation-matrix/index.es.js +1 -1
  222. package/dist/components/waka-approval-chain/index.cjs.js +1 -1
  223. package/dist/components/waka-approval-chain/index.es.js +1 -1
  224. package/dist/components/waka-artifact-list/index.cjs.js +1 -1
  225. package/dist/components/waka-artifact-list/index.es.js +1 -1
  226. package/dist/components/waka-audit-log/index.cjs.js +2 -2
  227. package/dist/components/waka-audit-log/index.es.js +1 -1
  228. package/dist/components/waka-autocomplete/index.cjs.js +1 -1
  229. package/dist/components/waka-autocomplete/index.es.js +3 -2
  230. package/dist/components/waka-badge-showcase/index.cjs.js +1 -1
  231. package/dist/components/waka-barcode/index.cjs.js +1 -1
  232. package/dist/components/waka-barcode/index.es.js +1 -1
  233. package/dist/components/waka-biometric-prompt/index.cjs.js +2 -2
  234. package/dist/components/waka-biometric-prompt/index.es.js +1 -1
  235. package/dist/components/waka-bottom-sheet/index.cjs.js +1 -1
  236. package/dist/components/waka-bottom-sheet/index.es.js +12 -7
  237. package/dist/components/waka-breadcrumb/index.cjs.js +1 -1
  238. package/dist/components/waka-breadcrumb/index.es.js +1 -1
  239. package/dist/components/waka-breadcrumb-path/index.cjs.js +1 -1
  240. package/dist/components/waka-breadcrumb-path/index.es.js +1 -1
  241. package/dist/components/waka-budget-burn/index.cjs.js +2 -2
  242. package/dist/components/waka-budget-burn/index.es.js +3 -3
  243. package/dist/components/waka-build-matrix/index.cjs.js +1 -1
  244. package/dist/components/waka-capacity-planner/index.cjs.js +2 -2
  245. package/dist/components/waka-capacity-planner/index.es.js +1 -1
  246. package/dist/components/waka-carousel/index.cjs.js +1 -1
  247. package/dist/components/waka-carousel/index.es.js +2 -2
  248. package/dist/components/waka-cart-summary/index.cjs.js +1 -1
  249. package/dist/components/waka-cart-summary/index.es.js +2 -2
  250. package/dist/components/waka-challenge-timer/index.cjs.js +1 -1
  251. package/dist/components/waka-charts/WakaAreaChart.cjs.js +1 -1
  252. package/dist/components/waka-charts/WakaAreaChart.es.js +2 -2
  253. package/dist/components/waka-charts/WakaBarChart.cjs.js +1 -1
  254. package/dist/components/waka-charts/WakaBarChart.es.js +2 -2
  255. package/dist/components/waka-charts/WakaChart.cjs.js +1 -1
  256. package/dist/components/waka-charts/WakaChart.es.js +1 -1
  257. package/dist/components/waka-charts/WakaLineChart.cjs.js +1 -1
  258. package/dist/components/waka-charts/WakaLineChart.es.js +2 -2
  259. package/dist/components/waka-charts/WakaMiniChart.cjs.js +1 -1
  260. package/dist/components/waka-charts/WakaMiniChart.es.js +2 -2
  261. package/dist/components/waka-charts/WakaPieChart.cjs.js +1 -1
  262. package/dist/components/waka-charts/WakaPieChart.es.js +2 -2
  263. package/dist/components/waka-charts/WakaSparkline.cjs.js +1 -1
  264. package/dist/components/waka-charts/WakaSparkline.es.js +1 -1
  265. package/dist/components/waka-charts/dataTableHelpers.cjs.js +1 -1
  266. package/dist/components/waka-charts/dataTableHelpers.es.js +1 -1
  267. package/dist/components/waka-charts/hooks/useChartTheme.cjs.js +1 -1
  268. package/dist/components/waka-charts/hooks/useChartTheme.es.js +1 -1
  269. package/dist/components/waka-charts/hooks/useRechartsLoader.cjs.js +1 -1
  270. package/dist/components/waka-charts/hooks/useRechartsLoader.es.js +1 -1
  271. package/dist/components/waka-chat-bubble/index.cjs.js +1 -1
  272. package/dist/components/waka-checklist/index.cjs.js +2 -2
  273. package/dist/components/waka-checklist/index.es.js +1 -1
  274. package/dist/components/waka-checkout-stepper/index.cjs.js +1 -1
  275. package/dist/components/waka-checkout-stepper/index.es.js +1 -1
  276. package/dist/components/waka-cohort-table/index.cjs.js +2 -2
  277. package/dist/components/waka-cohort-table/index.es.js +1 -1
  278. package/dist/components/waka-color-picker/index.cjs.js +2 -2
  279. package/dist/components/waka-color-picker/index.es.js +1 -1
  280. package/dist/components/waka-combo-counter/index.cjs.js +1 -1
  281. package/dist/components/waka-combobox/index.cjs.js +1 -1
  282. package/dist/components/waka-combobox/index.es.js +3 -2
  283. package/dist/components/waka-command-bar/index.cjs.js +1 -1
  284. package/dist/components/waka-compare-period/index.cjs.js +2 -2
  285. package/dist/components/waka-compare-period/index.es.js +7 -5
  286. package/dist/components/waka-config-comparator/index.cjs.js +1 -1
  287. package/dist/components/waka-config-comparator/index.es.js +1 -1
  288. package/dist/components/waka-connection-matrix/index.cjs.js +1 -1
  289. package/dist/components/waka-connection-matrix/index.es.js +1 -1
  290. package/dist/components/waka-container-list/index.cjs.js +1 -1
  291. package/dist/components/waka-container-list/index.es.js +1 -1
  292. package/dist/components/waka-content-recommendation/index.cjs.js +1 -1
  293. package/dist/components/waka-content-recommendation/index.es.js +2 -2
  294. package/dist/components/waka-contribution-graph/index.cjs.js +1 -1
  295. package/dist/components/waka-contribution-graph/index.es.js +4 -4
  296. package/dist/components/waka-cost-breakdown/index.cjs.js +1 -1
  297. package/dist/components/waka-cost-breakdown/index.es.js +7 -7
  298. package/dist/components/waka-coupon-input/index.cjs.js +2 -2
  299. package/dist/components/waka-coupon-input/index.es.js +1 -1
  300. package/dist/components/waka-credit-activity-feed/index.cjs.js +2 -2
  301. package/dist/components/waka-credit-activity-feed/index.es.js +1 -1
  302. package/dist/components/waka-credit-alert/index.cjs.js +1 -1
  303. package/dist/components/waka-credit-alert/index.es.js +1 -1
  304. package/dist/components/waka-credit-balance/index.cjs.js +1 -1
  305. package/dist/components/waka-credit-balance/index.es.js +3 -3
  306. package/dist/components/waka-credit-breakdown/index.cjs.js +1 -1
  307. package/dist/components/waka-credit-breakdown/index.es.js +1 -1
  308. package/dist/components/waka-credit-burn-rate/index.cjs.js +1 -1
  309. package/dist/components/waka-credit-burn-rate/index.es.js +1 -1
  310. package/dist/components/waka-credit-card-input/index.cjs.js +1 -1
  311. package/dist/components/waka-credit-card-input/index.es.js +1 -1
  312. package/dist/components/waka-credit-history/index.cjs.js +1 -1
  313. package/dist/components/waka-credit-history/index.es.js +1 -1
  314. package/dist/components/waka-credit-meter/index.cjs.js +2 -2
  315. package/dist/components/waka-credit-meter/index.es.js +3 -3
  316. package/dist/components/waka-credit-pricing-pack/index.cjs.js +1 -1
  317. package/dist/components/waka-credit-pricing-pack/index.es.js +1 -1
  318. package/dist/components/waka-credit-projection/index.cjs.js +1 -1
  319. package/dist/components/waka-credit-projection/index.es.js +1 -1
  320. package/dist/components/waka-credit-quota/index.cjs.js +1 -1
  321. package/dist/components/waka-credit-quota/index.es.js +3 -3
  322. package/dist/components/waka-credit-receipt/index.cjs.js +1 -1
  323. package/dist/components/waka-credit-receipt/index.es.js +1 -1
  324. package/dist/components/waka-credit-top-up/index.cjs.js +1 -1
  325. package/dist/components/waka-credit-top-up/index.es.js +1 -1
  326. package/dist/components/waka-credit-transaction/index.cjs.js +1 -1
  327. package/dist/components/waka-credit-transaction/index.es.js +1 -1
  328. package/dist/components/waka-credit-transfer-form/index.cjs.js +1 -1
  329. package/dist/components/waka-credit-transfer-form/index.es.js +1 -1
  330. package/dist/components/waka-credit-usage-chart/index.cjs.js +1 -1
  331. package/dist/components/waka-credit-usage-chart/index.es.js +1 -1
  332. package/dist/components/waka-daily-reward/index.cjs.js +1 -1
  333. package/dist/components/waka-database-card/index.cjs.js +1 -1
  334. package/dist/components/waka-database-card/index.es.js +1 -1
  335. package/dist/components/waka-date-range-picker/index.cjs.js +1 -1
  336. package/dist/components/waka-date-range-picker/index.es.js +3 -2
  337. package/dist/components/waka-datetime-picker/index.cjs.js +1 -1
  338. package/dist/components/waka-datetime-picker/index.es.js +4 -1
  339. package/dist/components/waka-datetime-picker.form-integration/index.cjs.js +1 -1
  340. package/dist/components/waka-dependency-tree/index.cjs.js +1 -1
  341. package/dist/components/waka-dependency-tree/index.es.js +1 -1
  342. package/dist/components/waka-deployment-lane/index.cjs.js +1 -1
  343. package/dist/components/waka-deployment-lane/index.es.js +1 -1
  344. package/dist/components/waka-device-trust/index.cjs.js +2 -2
  345. package/dist/components/waka-device-trust/index.es.js +1 -1
  346. package/dist/components/waka-doc-breadcrumb/index.cjs.js +1 -1
  347. package/dist/components/waka-doc-callout/index.cjs.js +1 -1
  348. package/dist/components/waka-doc-code-block/index.cjs.js +1 -1
  349. package/dist/components/waka-doc-nav/index.cjs.js +1 -1
  350. package/dist/components/waka-doc-renderer/index.cjs.js +1 -1
  351. package/dist/components/waka-doc-search/index.cjs.js +1 -1
  352. package/dist/components/waka-doc-table/index.cjs.js +1 -1
  353. package/dist/components/waka-doc-toc/index.cjs.js +1 -1
  354. package/dist/components/waka-doc-toolbar/index.cjs.js +1 -1
  355. package/dist/components/waka-doc-version/index.cjs.js +1 -1
  356. package/dist/components/waka-dock/index.cjs.js +1 -1
  357. package/dist/components/waka-dock/index.es.js +2 -2
  358. package/dist/components/waka-drawer/index.cjs.js +1 -1
  359. package/dist/components/waka-drawer/index.es.js +1 -1
  360. package/dist/components/waka-empty-state/index.cjs.js +1 -1
  361. package/dist/components/waka-env-var-editor/index.cjs.js +1 -1
  362. package/dist/components/waka-error-shake/index.cjs.js +1 -1
  363. package/dist/components/waka-feature-announcement/index.cjs.js +2 -2
  364. package/dist/components/waka-feature-announcement/index.es.js +1 -1
  365. package/dist/components/waka-feature-flag-row/index.cjs.js +1 -1
  366. package/dist/components/waka-file-upload/index.cjs.js +1 -1
  367. package/dist/components/waka-file-upload/index.es.js +2 -2
  368. package/dist/components/waka-floating-nav/index.cjs.js +1 -1
  369. package/dist/components/waka-floating-nav/index.es.js +1 -1
  370. package/dist/components/waka-flow-diagram/index.cjs.js +1 -1
  371. package/dist/components/waka-funnel-chart/index.cjs.js +2 -2
  372. package/dist/components/waka-funnel-chart/index.es.js +1 -1
  373. package/dist/components/waka-glow-card/index.cjs.js +1 -1
  374. package/dist/components/waka-glow-card/index.es.js +3 -3
  375. package/dist/components/waka-goal-progress/index.cjs.js +3 -3
  376. package/dist/components/waka-goal-progress/index.es.js +3 -3
  377. package/dist/components/waka-haptic-button/index.cjs.js +1 -1
  378. package/dist/components/waka-health-pulse/index.cjs.js +2 -2
  379. package/dist/components/waka-health-pulse/index.es.js +1 -1
  380. package/dist/components/waka-heatmap/index.cjs.js +1 -1
  381. package/dist/components/waka-heatmap/index.es.js +3 -3
  382. package/dist/components/waka-hotspot/index.cjs.js +1 -1
  383. package/dist/components/waka-image/index.cjs.js +1 -1
  384. package/dist/components/waka-image/index.es.js +1 -1
  385. package/dist/components/waka-incident-timeline/index.cjs.js +1 -1
  386. package/dist/components/waka-incident-timeline/index.es.js +3 -2
  387. package/dist/components/waka-invoice-preview/index.cjs.js +1 -1
  388. package/dist/components/waka-invoice-preview/index.es.js +1 -1
  389. package/dist/components/waka-kanban/index.cjs.js +1 -1
  390. package/dist/components/waka-kanban/index.es.js +1 -1
  391. package/dist/components/waka-kpi-dashboard/index.cjs.js +1 -1
  392. package/dist/components/waka-kpi-dashboard/index.es.js +6 -4
  393. package/dist/components/waka-kubernetes-overview/index.cjs.js +1 -1
  394. package/dist/components/waka-kubernetes-overview/index.es.js +1 -1
  395. package/dist/components/waka-leaderboard/index.cjs.js +1 -1
  396. package/dist/components/waka-level-progress/index.cjs.js +2 -2
  397. package/dist/components/waka-level-progress/index.es.js +2 -2
  398. package/dist/components/waka-liquid-button/index.cjs.js +1 -1
  399. package/dist/components/waka-loading-orbit/index.cjs.js +1 -1
  400. package/dist/components/waka-log-viewer/index.cjs.js +1 -1
  401. package/dist/components/waka-loot-box/index.cjs.js +2 -2
  402. package/dist/components/waka-loot-box/index.es.js +1 -1
  403. package/dist/components/waka-magic-link/index.cjs.js +2 -2
  404. package/dist/components/waka-magnetic-button/index.cjs.js +1 -1
  405. package/dist/components/waka-mention-input/index.cjs.js +1 -1
  406. package/dist/components/waka-mention-input/index.es.js +52 -40
  407. package/dist/components/waka-metric-sparkline/index.cjs.js +1 -1
  408. package/dist/components/waka-metric-sparkline/index.es.js +1 -1
  409. package/dist/components/waka-migration-list/index.cjs.js +1 -1
  410. package/dist/components/waka-milestone-road/index.cjs.js +2 -2
  411. package/dist/components/waka-milestone-road/index.es.js +5 -5
  412. package/dist/components/waka-modal/index.cjs.js +1 -1
  413. package/dist/components/waka-modal/index.es.js +1 -1
  414. package/dist/components/waka-morph-button/index.cjs.js +2 -2
  415. package/dist/components/waka-morph-button/index.es.js +6 -2
  416. package/dist/components/waka-network-topology/index.cjs.js +1 -1
  417. package/dist/components/waka-network-topology/index.es.js +4 -2
  418. package/dist/components/waka-notifications/index.cjs.js +1 -1
  419. package/dist/components/waka-number-input/index.cjs.js +1 -1
  420. package/dist/components/waka-number-input/index.es.js +1 -1
  421. package/dist/components/waka-orbital-menu/index.cjs.js +1 -1
  422. package/dist/components/waka-orbital-menu/index.es.js +1 -1
  423. package/dist/components/waka-order-tracker/index.cjs.js +1 -1
  424. package/dist/components/waka-order-tracker/index.es.js +3 -2
  425. package/dist/components/waka-outstream-video/index.cjs.js +1 -1
  426. package/dist/components/waka-outstream-video/index.es.js +2 -2
  427. package/dist/components/waka-pagination/index.cjs.js +1 -1
  428. package/dist/components/waka-pagination/index.es.js +1 -1
  429. package/dist/components/waka-password-strength/index.cjs.js +2 -2
  430. package/dist/components/waka-password-strength/index.es.js +3 -3
  431. package/dist/components/waka-payment-method-picker/index.cjs.js +1 -1
  432. package/dist/components/waka-payment-method-picker/index.es.js +1 -1
  433. package/dist/components/waka-permission-matrix/index.cjs.js +2 -2
  434. package/dist/components/waka-permission-matrix/index.es.js +3 -2
  435. package/dist/components/waka-phone-input/index.cjs.js +1 -1
  436. package/dist/components/waka-phone-input/index.es.js +5 -3
  437. package/dist/components/waka-pipeline-view/index.cjs.js +2 -2
  438. package/dist/components/waka-pipeline-view/index.es.js +1 -1
  439. package/dist/components/waka-player-card/index.cjs.js +2 -2
  440. package/dist/components/waka-player-card/index.es.js +4 -4
  441. package/dist/components/waka-pod-card/index.cjs.js +1 -1
  442. package/dist/components/waka-pod-card/index.es.js +1 -1
  443. package/dist/components/waka-points-popup/index.cjs.js +1 -1
  444. package/dist/components/waka-points-popup/index.es.js +5 -1
  445. package/dist/components/waka-power-up/index.cjs.js +1 -1
  446. package/dist/components/waka-presence-indicator/index.cjs.js +2 -2
  447. package/dist/components/waka-presence-indicator/index.es.js +1 -1
  448. package/dist/components/waka-pricing-table/index.cjs.js +2 -2
  449. package/dist/components/waka-pricing-table/index.es.js +1 -1
  450. package/dist/components/waka-product-card/index.cjs.js +1 -1
  451. package/dist/components/waka-progress-onboarding/index.cjs.js +3 -3
  452. package/dist/components/waka-progress-onboarding/index.es.js +1 -1
  453. package/dist/components/waka-pull-to-refresh/index.cjs.js +1 -1
  454. package/dist/components/waka-qrcode/index.cjs.js +1 -1
  455. package/dist/components/waka-qrcode/index.es.js +1 -1
  456. package/dist/components/waka-query-explain/index.cjs.js +1 -1
  457. package/dist/components/waka-quest-card/index.cjs.js +2 -2
  458. package/dist/components/waka-quest-card/index.es.js +4 -1
  459. package/dist/components/waka-quota-bar/index.cjs.js +2 -2
  460. package/dist/components/waka-quota-bar/index.es.js +11 -4
  461. package/dist/components/waka-radar-score/index.cjs.js +1 -1
  462. package/dist/components/waka-radar-score/index.es.js +6 -6
  463. package/dist/components/waka-rank-badge/index.cjs.js +2 -2
  464. package/dist/components/waka-rank-badge/index.es.js +1 -1
  465. package/dist/components/waka-rating-input/index.cjs.js +2 -2
  466. package/dist/components/waka-rating-input/index.es.js +1 -1
  467. package/dist/components/waka-reaction-picker/index.cjs.js +1 -1
  468. package/dist/components/waka-reaction-picker/index.es.js +7 -4
  469. package/dist/components/waka-region-map/index.cjs.js +1 -1
  470. package/dist/components/waka-region-map/index.es.js +1 -1
  471. package/dist/components/waka-resource-gauge/index.cjs.js +2 -2
  472. package/dist/components/waka-resource-gauge/index.es.js +3 -3
  473. package/dist/components/waka-resource-pool/index.cjs.js +2 -2
  474. package/dist/components/waka-resource-pool/index.es.js +1 -1
  475. package/dist/components/waka-rich-text-editor/index.cjs.js +1 -1
  476. package/dist/components/waka-rich-text-editor/index.es.js +1 -1
  477. package/dist/components/waka-rollback-slider/index.cjs.js +2 -2
  478. package/dist/components/waka-rollback-slider/index.es.js +5 -3
  479. package/dist/components/waka-sankey-diagram/index.cjs.js +2 -2
  480. package/dist/components/waka-sankey-diagram/index.es.js +5 -5
  481. package/dist/components/waka-schedule-picker/index.cjs.js +1 -1
  482. package/dist/components/waka-schedule-picker/index.es.js +3 -2
  483. package/dist/components/waka-scratch-card/index.cjs.js +2 -2
  484. package/dist/components/waka-scratch-card/index.es.js +1 -1
  485. package/dist/components/waka-season-pass/index.cjs.js +1 -1
  486. package/dist/components/waka-secret-card/index.cjs.js +1 -1
  487. package/dist/components/waka-security-scan-result/index.cjs.js +1 -1
  488. package/dist/components/waka-security-score/index.cjs.js +2 -2
  489. package/dist/components/waka-security-score/index.es.js +5 -5
  490. package/dist/components/waka-segmented-control/index.cjs.js +1 -1
  491. package/dist/components/waka-segmented-control/index.es.js +1 -1
  492. package/dist/components/waka-server-rack/index.cjs.js +1 -1
  493. package/dist/components/waka-service-graph/index.cjs.js +1 -1
  494. package/dist/components/waka-session-manager/index.cjs.js +1 -1
  495. package/dist/components/waka-session-manager/index.es.js +3 -2
  496. package/dist/components/waka-signature-pad/index.cjs.js +1 -1
  497. package/dist/components/waka-signature-pad/index.es.js +1 -1
  498. package/dist/components/waka-skeleton-wave/index.cjs.js +1 -1
  499. package/dist/components/waka-skill-tree/index.cjs.js +2 -2
  500. package/dist/components/waka-skill-tree/index.es.js +32 -32
  501. package/dist/components/waka-sla-tracker/index.cjs.js +1 -1
  502. package/dist/components/waka-sla-tracker/index.es.js +1 -1
  503. package/dist/components/waka-slider-range/index.cjs.js +1 -1
  504. package/dist/components/waka-slider-range/index.es.js +3 -3
  505. package/dist/components/waka-spin-wheel/index.cjs.js +2 -2
  506. package/dist/components/waka-spin-wheel/index.es.js +6 -6
  507. package/dist/components/waka-spinner/index.cjs.js +1 -1
  508. package/dist/components/waka-sponsored-badge/index.cjs.js +1 -1
  509. package/dist/components/waka-sponsored-badge/index.es.js +1 -1
  510. package/dist/components/waka-sponsored-card/index.cjs.js +1 -1
  511. package/dist/components/waka-sponsored-card/index.es.js +2 -2
  512. package/dist/components/waka-sponsored-feed/index.cjs.js +1 -1
  513. package/dist/components/waka-sponsored-feed/index.es.js +2 -2
  514. package/dist/components/waka-spotlight/index.cjs.js +1 -1
  515. package/dist/components/waka-spotlight/index.es.js +2 -1
  516. package/dist/components/waka-stat/index.cjs.js +1 -1
  517. package/dist/components/waka-stat/index.es.js +1 -1
  518. package/dist/components/waka-stats-hexagon/index.cjs.js +1 -1
  519. package/dist/components/waka-stats-hexagon/index.es.js +9 -9
  520. package/dist/components/waka-status-matrix/index.cjs.js +1 -1
  521. package/dist/components/waka-status-matrix/index.es.js +1 -1
  522. package/dist/components/waka-stepper/index.cjs.js +1 -1
  523. package/dist/components/waka-stepper/index.es.js +1 -1
  524. package/dist/components/waka-streak-counter/index.cjs.js +1 -1
  525. package/dist/components/waka-success-explosion/index.cjs.js +1 -1
  526. package/dist/components/waka-swipe-card/index.cjs.js +1 -1
  527. package/dist/components/waka-swipe-card/index.es.js +2 -2
  528. package/dist/components/waka-tabs-morph/index.cjs.js +1 -1
  529. package/dist/components/waka-tabs-morph/index.es.js +1 -1
  530. package/dist/components/waka-tag-input/index.cjs.js +1 -1
  531. package/dist/components/waka-tag-input/index.es.js +3 -2
  532. package/dist/components/waka-team-banner/index.cjs.js +2 -2
  533. package/dist/components/waka-team-banner/index.es.js +1 -1
  534. package/dist/components/waka-terminal-output/index.cjs.js +2 -2
  535. package/dist/components/waka-terminal-output/index.es.js +5 -3
  536. package/dist/components/waka-test-report/index.cjs.js +1 -1
  537. package/dist/components/waka-theme-creator/index.cjs.js +1 -1
  538. package/dist/components/waka-theme-manager/index.cjs.js +1 -1
  539. package/dist/components/waka-theme-manager/index.es.js +5 -2
  540. package/dist/components/waka-thread-view/index.cjs.js +2 -2
  541. package/dist/components/waka-thread-view/index.es.js +1 -1
  542. package/dist/components/waka-tilt-card/index.cjs.js +1 -1
  543. package/dist/components/waka-tilt-card/index.es.js +8 -6
  544. package/dist/components/waka-time-picker/index.cjs.js +1 -1
  545. package/dist/components/waka-time-picker/index.es.js +10 -6
  546. package/dist/components/waka-timeline/index.cjs.js +1 -1
  547. package/dist/components/waka-timeline/index.es.js +1 -1
  548. package/dist/components/waka-tooltip-tour/index.cjs.js +3 -3
  549. package/dist/components/waka-tooltip-tour/index.es.js +53 -51
  550. package/dist/components/waka-tour-guide/index.cjs.js +2 -2
  551. package/dist/components/waka-tour-guide/index.es.js +1 -1
  552. package/dist/components/waka-tournament-bracket/index.cjs.js +2 -2
  553. package/dist/components/waka-tournament-bracket/index.es.js +1 -1
  554. package/dist/components/waka-trace-viewer/index.cjs.js +1 -1
  555. package/dist/components/waka-tree/index.cjs.js +1 -1
  556. package/dist/components/waka-tree/index.es.js +1 -1
  557. package/dist/components/waka-treemap-chart/index.cjs.js +1 -1
  558. package/dist/components/waka-treemap-chart/index.es.js +1 -1
  559. package/dist/components/waka-two-factor-setup/index.cjs.js +2 -2
  560. package/dist/components/waka-two-factor-setup/index.es.js +5 -4
  561. package/dist/components/waka-typewriter/index.cjs.js +1 -1
  562. package/dist/components/waka-typewriter/index.es.js +7 -2
  563. package/dist/components/waka-typing-indicator/index.cjs.js +2 -2
  564. package/dist/components/waka-typing-indicator/index.es.js +1 -1
  565. package/dist/components/waka-versus-card/index.cjs.js +3 -3
  566. package/dist/components/waka-versus-card/index.es.js +5 -4
  567. package/dist/components/waka-video/index.cjs.js +1 -1
  568. package/dist/components/waka-video/index.es.js +1 -1
  569. package/dist/components/waka-video-ad/index.cjs.js +1 -1
  570. package/dist/components/waka-video-ad/index.es.js +3 -3
  571. package/dist/components/waka-video-call/index.cjs.js +2 -2
  572. package/dist/components/waka-video-call/index.es.js +1 -1
  573. package/dist/components/waka-video-overlay/index.cjs.js +1 -1
  574. package/dist/components/waka-video-overlay/index.es.js +2 -2
  575. package/dist/components/waka-virtual-list/index.cjs.js +1 -1
  576. package/dist/components/waka-virtual-list/index.es.js +1 -1
  577. package/dist/components/waka-voice-message/index.cjs.js +1 -1
  578. package/dist/components/waka-voice-message/index.es.js +6 -5
  579. package/dist/components/waka-welcome-modal/index.cjs.js +2 -2
  580. package/dist/components/waka-welcome-modal/index.es.js +1 -1
  581. package/dist/components/waka-xp-bar/index.cjs.js +1 -1
  582. package/dist/components/waka-xp-bar/index.es.js +2 -2
  583. package/dist/context/admincrumb-context.cjs.js +1 -1
  584. package/dist/context/language-context.cjs.js +1 -1
  585. package/dist/context/language-context.es.js +2 -2
  586. package/dist/context/theme-context.cjs.js +1 -1
  587. package/dist/context/theme-provider.cjs.js +1 -1
  588. package/dist/context/theme-provider.es.js +9 -6
  589. package/dist/context/waka-provider.cjs.js +1 -1
  590. package/dist/context/waka-provider.es.js +57 -53
  591. package/dist/doc.cjs.js +1 -1
  592. package/dist/editor.cjs.js +1 -1
  593. package/dist/export.cjs.js +1 -1
  594. package/dist/hooks/use-toast.cjs.js +1 -1
  595. package/dist/hooks/use-translation.cjs.js +1 -1
  596. package/dist/index.cjs.js +1 -1
  597. package/dist/index.d.ts +2 -0
  598. package/dist/index.es.js +279 -278
  599. package/dist/lib/i18n.cjs.js +1 -1
  600. package/dist/lib/i18n.es.js +11 -9
  601. package/dist/locales/default-resources.cjs.js +1 -0
  602. package/dist/locales/default-resources.d.ts +155 -0
  603. package/dist/locales/default-resources.es.js +150 -0
  604. package/dist/node_modules/.pnpm/exceljs@4.4.0/node_modules/exceljs/dist/exceljs.min.cjs.js +13 -13
  605. package/dist/node_modules/.pnpm/exceljs@4.4.0/node_modules/exceljs/dist/exceljs.min.es.js +13 -13
  606. package/dist/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-docker.cjs.js +1 -1
  607. package/dist/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-docker.es.js +19 -19
  608. package/dist/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-markdown.cjs.js +1 -1
  609. package/dist/node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-markdown.es.js +24 -25
  610. package/dist/node_modules/.pnpm/react-resizable-panels@4.11.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-resizable-panels/dist/react-resizable-panels.cjs.js +1 -1
  611. package/dist/node_modules/.pnpm/react-resizable-panels@4.11.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-resizable-panels/dist/react-resizable-panels.es.js +26 -23
  612. package/dist/rich-text.cjs.js +1 -1
  613. package/dist/ui.css +1 -1
  614. package/dist/utils/cn.cjs.js +1 -1
  615. package/dist/utils/datetime-helpers.cjs.js +1 -1
  616. package/dist/utils/theme-loader.cjs.js +1 -1
  617. package/dist/utils/tweak.cjs.js +1 -1
  618. package/package.json +28 -27
  619. package/src/components/DataTable/DataTable.tsx +2 -0
  620. package/src/components/DataTable/DataTablePagination.tsx +28 -8
  621. package/src/components/DataTable/hooks/useDataTable.ts +13 -0
  622. package/src/components/editor/blocks/waka-diagram-block.tsx +7 -36
@@ -1 +1 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`),n=require(`../badge/index.cjs.js`),r=require(`../button/index.cjs.js`),i=require(`../card/index.cjs.js`);let a=require(`react`);a=e.__toESM(a);let o=require(`lucide-react`),s=require(`react/jsx-runtime`);var c={"api-key":{icon:o.Key,label:`API Key`,color:`text-blue-500`},password:{icon:o.Shield,label:`Password`,color:`text-purple-500`},certificate:{icon:o.Shield,label:`Certificate`,color:`text-green-500`},token:{icon:o.Key,label:`Token`,color:`text-orange-500`},other:{icon:o.Key,label:`Secret`,color:`text-gray-500`}};function l(e){return e.toLocaleDateString(`fr-FR`,{day:`2-digit`,month:`short`,year:`numeric`})}function u(e){let t=Date.now()-e.getTime(),n=Math.floor(t/6e4),r=Math.floor(n/60),i=Math.floor(r/24);return i>30?l(e):i>0?`${i}d ago`:r>0?`${r}h ago`:`${n}m ago`}function d(e){if(!e)return!1;let t=e.getTime()-Date.now();return t>0&&t<10080*60*1e3}function f(e){return e?e.getTime()<Date.now():!1}function p(e){return!e.rotationPeriod||!e.rotatedAt?!1:Math.floor((Date.now()-e.rotatedAt.getTime())/(1440*60*1e3))>=e.rotationPeriod}function m({secret:e,onRotate:m,onDelete:h,onCopy:g,onView:_,isValueVisible:v=!1,showHistory:y=!1,compact:b=!1,className:x}){let[S,C]=a.useState(!1),w=c[e.type],T=w.icon,E=f(e.expiresAt),D=d(e.expiresAt),O=p(e),k=()=>{g?.(),C(!0),setTimeout(()=>C(!1),2e3)};return b?(0,s.jsxs)(`div`,{className:t.cn(`flex items-center gap-3 p-3 border rounded-lg hover:bg-muted/30 transition-colors`,E&&`border-red-500/50 bg-red-500/5`,D&&!E&&`border-yellow-500/50 bg-yellow-500/5`,O&&`border-orange-500/50`,x),children:[(0,s.jsx)(T,{className:t.cn(`h-5 w-5 shrink-0`,w.color)}),(0,s.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,s.jsx)(`div`,{className:`font-medium truncate`,children:e.name}),(0,s.jsxs)(`div`,{className:`text-xs text-muted-foreground flex items-center gap-2`,children:[(0,s.jsx)(`span`,{children:w.label}),e.lastAccessedAt&&(0,s.jsxs)(`span`,{children:[`Last used `,u(e.lastAccessedAt)]})]})]}),E&&(0,s.jsx)(n.Badge,{className:`bg-red-500 text-xs`,children:`Expired`}),D&&!E&&(0,s.jsx)(n.Badge,{className:`bg-yellow-500 text-xs`,children:`Expiring Soon`}),O&&(0,s.jsxs)(n.Badge,{variant:`outline`,className:`text-orange-500 text-xs`,children:[(0,s.jsx)(o.RotateCcw,{className:`h-3 w-3 mr-1`}),`Rotate`]}),(0,s.jsxs)(`div`,{className:`flex items-center gap-1`,children:[_&&(0,s.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-8 w-8 p-0`,onClick:_,children:v?(0,s.jsx)(o.EyeOff,{className:`h-4 w-4`}):(0,s.jsx)(o.Eye,{className:`h-4 w-4`})}),g&&(0,s.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-8 w-8 p-0`,onClick:k,children:S?(0,s.jsx)(o.CheckCircle2,{className:`h-4 w-4 text-green-500`}):(0,s.jsx)(o.Copy,{className:`h-4 w-4`})}),m&&(0,s.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-8 w-8 p-0`,onClick:m,children:(0,s.jsx)(o.RotateCcw,{className:`h-4 w-4`})})]})]}):(0,s.jsxs)(i.Card,{className:t.cn(E&&`border-red-500/50`,D&&!E&&`border-yellow-500/50`,x),children:[(0,s.jsx)(i.CardHeader,{className:`pb-3`,children:(0,s.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,s.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,s.jsx)(`div`,{className:t.cn(`w-10 h-10 rounded-lg flex items-center justify-center`,`bg-muted`),children:(0,s.jsx)(T,{className:t.cn(`h-5 w-5`,w.color)})}),(0,s.jsxs)(`div`,{children:[(0,s.jsx)(i.CardTitle,{className:`text-base`,children:e.name}),(0,s.jsxs)(`div`,{className:`flex items-center gap-2 mt-1`,children:[(0,s.jsx)(n.Badge,{variant:`outline`,className:`text-xs`,children:w.label}),e.tags?.map(e=>(0,s.jsx)(n.Badge,{variant:`secondary`,className:`text-xs`,children:e},e))]})]})]}),(0,s.jsxs)(`div`,{className:`flex items-center gap-1`,children:[E&&(0,s.jsxs)(n.Badge,{className:`bg-red-500`,children:[(0,s.jsx)(o.AlertTriangle,{className:`h-3 w-3 mr-1`}),`Expired`]}),D&&!E&&(0,s.jsxs)(n.Badge,{className:`bg-yellow-500`,children:[(0,s.jsx)(o.Clock,{className:`h-3 w-3 mr-1`}),`Expires `,l(e.expiresAt)]}),O&&(0,s.jsxs)(n.Badge,{variant:`outline`,className:`text-orange-500`,children:[(0,s.jsx)(o.RotateCcw,{className:`h-3 w-3 mr-1`}),`Needs Rotation`]})]})]})}),(0,s.jsxs)(i.CardContent,{className:`space-y-4`,children:[e.description&&(0,s.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.description}),e.value&&(0,s.jsxs)(`div`,{className:`flex items-center gap-2 p-2 bg-muted/50 rounded-lg font-mono text-sm`,children:[(0,s.jsx)(`span`,{className:`flex-1 truncate`,children:v?e.value:`•`.repeat(24)}),_&&(0,s.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-7 w-7 p-0 shrink-0`,onClick:_,children:v?(0,s.jsx)(o.EyeOff,{className:`h-4 w-4`}):(0,s.jsx)(o.Eye,{className:`h-4 w-4`})}),g&&(0,s.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-7 w-7 p-0 shrink-0`,onClick:k,children:S?(0,s.jsx)(o.CheckCircle2,{className:`h-4 w-4 text-green-500`}):(0,s.jsx)(o.Copy,{className:`h-4 w-4`})})]}),(0,s.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 text-sm`,children:[(0,s.jsxs)(`div`,{className:`flex items-center gap-2 text-muted-foreground`,children:[(0,s.jsx)(o.Calendar,{className:`h-4 w-4`}),(0,s.jsxs)(`span`,{children:[`Created `,l(e.createdAt)]})]}),(0,s.jsxs)(`div`,{className:`flex items-center gap-2 text-muted-foreground`,children:[(0,s.jsx)(o.Clock,{className:`h-4 w-4`}),(0,s.jsxs)(`span`,{children:[`Updated `,u(e.updatedAt)]})]}),e.rotatedAt&&(0,s.jsxs)(`div`,{className:`flex items-center gap-2 text-muted-foreground`,children:[(0,s.jsx)(o.RotateCcw,{className:`h-4 w-4`}),(0,s.jsxs)(`span`,{children:[`Rotated `,u(e.rotatedAt)]})]}),e.lastAccessedAt&&(0,s.jsxs)(`div`,{className:`flex items-center gap-2 text-muted-foreground`,children:[(0,s.jsx)(o.User,{className:`h-4 w-4`}),(0,s.jsxs)(`span`,{children:[`Used `,u(e.lastAccessedAt),e.lastAccessedBy&&` by ${e.lastAccessedBy}`]})]})]}),y&&e.accessHistory&&e.accessHistory.length>0&&(0,s.jsxs)(`div`,{className:`border-t pt-4`,children:[(0,s.jsxs)(`div`,{className:`flex items-center gap-2 mb-2 text-sm font-medium`,children:[(0,s.jsx)(o.History,{className:`h-4 w-4`}),`Recent Access`]}),(0,s.jsx)(`div`,{className:`space-y-1`,children:e.accessHistory.slice(0,5).map((e,t)=>(0,s.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,s.jsxs)(`span`,{children:[e.user,` - `,e.action]}),(0,s.jsx)(`span`,{children:u(e.timestamp)})]},t))})]}),(0,s.jsxs)(`div`,{className:`flex items-center gap-2 pt-2 border-t`,children:[m&&(0,s.jsxs)(r.Button,{variant:`outline`,size:`sm`,onClick:m,children:[(0,s.jsx)(o.RotateCcw,{className:`h-4 w-4 mr-2`}),`Rotate`]}),h&&(0,s.jsxs)(r.Button,{variant:`outline`,size:`sm`,className:`text-destructive hover:text-destructive`,onClick:h,children:[(0,s.jsx)(o.Trash2,{className:`h-4 w-4 mr-2`}),`Delete`]})]})]})]})}var h={id:`1`,name:`Production API Key`,description:`Main API key for production services`,type:`api-key`,value:`sk_live_1234567890abcdefghijklmnopqrstuvwxyz`,createdAt:new Date(Date.now()-2160*36e5),updatedAt:new Date(Date.now()-168*36e5),rotatedAt:new Date(Date.now()-720*36e5),rotationPeriod:30,expiresAt:new Date(Date.now()+552*36e5),lastAccessedAt:new Date(Date.now()-2*36e5),lastAccessedBy:`api-gateway`,tags:[`production`,`critical`],accessHistory:[{user:`api-gateway`,action:`read`,timestamp:new Date(Date.now()-2*36e5)},{user:`john.doe`,action:`rotate`,timestamp:new Date(Date.now()-720*36e5)},{user:`api-gateway`,action:`read`,timestamp:new Date(Date.now()-24*36e5)}]};exports.WakaSecretCard=m,exports.defaultSecret=h;
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js"),n=require("../badge/index.cjs.js"),r=require("../button/index.cjs.js"),i=require("../card/index.cjs.js");let a=require("react");a=e.__toESM(a);let o=require("lucide-react"),s=require("react/jsx-runtime");var c={"api-key":{icon:o.Key,label:`API Key`,color:`text-blue-500`},password:{icon:o.Shield,label:`Password`,color:`text-purple-500`},certificate:{icon:o.Shield,label:`Certificate`,color:`text-green-500`},token:{icon:o.Key,label:`Token`,color:`text-orange-500`},other:{icon:o.Key,label:`Secret`,color:`text-gray-500`}};function l(e){return e.toLocaleDateString(`fr-FR`,{day:`2-digit`,month:`short`,year:`numeric`})}function u(e){let t=Date.now()-e.getTime(),n=Math.floor(t/6e4),r=Math.floor(n/60),i=Math.floor(r/24);return i>30?l(e):i>0?`${i}d ago`:r>0?`${r}h ago`:`${n}m ago`}function d(e){if(!e)return!1;let t=e.getTime()-Date.now();return t>0&&t<10080*60*1e3}function f(e){return e?e.getTime()<Date.now():!1}function p(e){return!e.rotationPeriod||!e.rotatedAt?!1:Math.floor((Date.now()-e.rotatedAt.getTime())/(1440*60*1e3))>=e.rotationPeriod}function m({secret:e,onRotate:m,onDelete:h,onCopy:g,onView:_,isValueVisible:v=!1,showHistory:y=!1,compact:b=!1,className:x}){let[S,C]=a.useState(!1),w=c[e.type],T=w.icon,E=f(e.expiresAt),D=d(e.expiresAt),O=p(e),k=()=>{g?.(),C(!0),setTimeout(()=>C(!1),2e3)};return b?(0,s.jsxs)(`div`,{className:t.cn(`flex items-center gap-3 p-3 border rounded-lg hover:bg-muted/30 transition-colors`,E&&`border-red-500/50 bg-red-500/5`,D&&!E&&`border-yellow-500/50 bg-yellow-500/5`,O&&`border-orange-500/50`,x),children:[(0,s.jsx)(T,{className:t.cn(`h-5 w-5 shrink-0`,w.color)}),(0,s.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,s.jsx)(`div`,{className:`font-medium truncate`,children:e.name}),(0,s.jsxs)(`div`,{className:`text-xs text-muted-foreground flex items-center gap-2`,children:[(0,s.jsx)(`span`,{children:w.label}),e.lastAccessedAt&&(0,s.jsxs)(`span`,{children:[`Last used `,u(e.lastAccessedAt)]})]})]}),E&&(0,s.jsx)(n.Badge,{className:`bg-red-500 text-xs`,children:`Expired`}),D&&!E&&(0,s.jsx)(n.Badge,{className:`bg-yellow-500 text-xs`,children:`Expiring Soon`}),O&&(0,s.jsxs)(n.Badge,{variant:`outline`,className:`text-orange-500 text-xs`,children:[(0,s.jsx)(o.RotateCcw,{className:`h-3 w-3 mr-1`}),`Rotate`]}),(0,s.jsxs)(`div`,{className:`flex items-center gap-1`,children:[_&&(0,s.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-8 w-8 p-0`,onClick:_,children:v?(0,s.jsx)(o.EyeOff,{className:`h-4 w-4`}):(0,s.jsx)(o.Eye,{className:`h-4 w-4`})}),g&&(0,s.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-8 w-8 p-0`,onClick:k,children:S?(0,s.jsx)(o.CheckCircle2,{className:`h-4 w-4 text-green-500`}):(0,s.jsx)(o.Copy,{className:`h-4 w-4`})}),m&&(0,s.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-8 w-8 p-0`,onClick:m,children:(0,s.jsx)(o.RotateCcw,{className:`h-4 w-4`})})]})]}):(0,s.jsxs)(i.Card,{className:t.cn(E&&`border-red-500/50`,D&&!E&&`border-yellow-500/50`,x),children:[(0,s.jsx)(i.CardHeader,{className:`pb-3`,children:(0,s.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,s.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,s.jsx)(`div`,{className:t.cn(`w-10 h-10 rounded-lg flex items-center justify-center`,`bg-muted`),children:(0,s.jsx)(T,{className:t.cn(`h-5 w-5`,w.color)})}),(0,s.jsxs)(`div`,{children:[(0,s.jsx)(i.CardTitle,{className:`text-base`,children:e.name}),(0,s.jsxs)(`div`,{className:`flex items-center gap-2 mt-1`,children:[(0,s.jsx)(n.Badge,{variant:`outline`,className:`text-xs`,children:w.label}),e.tags?.map(e=>(0,s.jsx)(n.Badge,{variant:`secondary`,className:`text-xs`,children:e},e))]})]})]}),(0,s.jsxs)(`div`,{className:`flex items-center gap-1`,children:[E&&(0,s.jsxs)(n.Badge,{className:`bg-red-500`,children:[(0,s.jsx)(o.AlertTriangle,{className:`h-3 w-3 mr-1`}),`Expired`]}),D&&!E&&(0,s.jsxs)(n.Badge,{className:`bg-yellow-500`,children:[(0,s.jsx)(o.Clock,{className:`h-3 w-3 mr-1`}),`Expires `,l(e.expiresAt)]}),O&&(0,s.jsxs)(n.Badge,{variant:`outline`,className:`text-orange-500`,children:[(0,s.jsx)(o.RotateCcw,{className:`h-3 w-3 mr-1`}),`Needs Rotation`]})]})]})}),(0,s.jsxs)(i.CardContent,{className:`space-y-4`,children:[e.description&&(0,s.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.description}),e.value&&(0,s.jsxs)(`div`,{className:`flex items-center gap-2 p-2 bg-muted/50 rounded-lg font-mono text-sm`,children:[(0,s.jsx)(`span`,{className:`flex-1 truncate`,children:v?e.value:`•`.repeat(24)}),_&&(0,s.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-7 w-7 p-0 shrink-0`,onClick:_,children:v?(0,s.jsx)(o.EyeOff,{className:`h-4 w-4`}):(0,s.jsx)(o.Eye,{className:`h-4 w-4`})}),g&&(0,s.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-7 w-7 p-0 shrink-0`,onClick:k,children:S?(0,s.jsx)(o.CheckCircle2,{className:`h-4 w-4 text-green-500`}):(0,s.jsx)(o.Copy,{className:`h-4 w-4`})})]}),(0,s.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 text-sm`,children:[(0,s.jsxs)(`div`,{className:`flex items-center gap-2 text-muted-foreground`,children:[(0,s.jsx)(o.Calendar,{className:`h-4 w-4`}),(0,s.jsxs)(`span`,{children:[`Created `,l(e.createdAt)]})]}),(0,s.jsxs)(`div`,{className:`flex items-center gap-2 text-muted-foreground`,children:[(0,s.jsx)(o.Clock,{className:`h-4 w-4`}),(0,s.jsxs)(`span`,{children:[`Updated `,u(e.updatedAt)]})]}),e.rotatedAt&&(0,s.jsxs)(`div`,{className:`flex items-center gap-2 text-muted-foreground`,children:[(0,s.jsx)(o.RotateCcw,{className:`h-4 w-4`}),(0,s.jsxs)(`span`,{children:[`Rotated `,u(e.rotatedAt)]})]}),e.lastAccessedAt&&(0,s.jsxs)(`div`,{className:`flex items-center gap-2 text-muted-foreground`,children:[(0,s.jsx)(o.User,{className:`h-4 w-4`}),(0,s.jsxs)(`span`,{children:[`Used `,u(e.lastAccessedAt),e.lastAccessedBy&&` by ${e.lastAccessedBy}`]})]})]}),y&&e.accessHistory&&e.accessHistory.length>0&&(0,s.jsxs)(`div`,{className:`border-t pt-4`,children:[(0,s.jsxs)(`div`,{className:`flex items-center gap-2 mb-2 text-sm font-medium`,children:[(0,s.jsx)(o.History,{className:`h-4 w-4`}),`Recent Access`]}),(0,s.jsx)(`div`,{className:`space-y-1`,children:e.accessHistory.slice(0,5).map((e,t)=>(0,s.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,s.jsxs)(`span`,{children:[e.user,` - `,e.action]}),(0,s.jsx)(`span`,{children:u(e.timestamp)})]},t))})]}),(0,s.jsxs)(`div`,{className:`flex items-center gap-2 pt-2 border-t`,children:[m&&(0,s.jsxs)(r.Button,{variant:`outline`,size:`sm`,onClick:m,children:[(0,s.jsx)(o.RotateCcw,{className:`h-4 w-4 mr-2`}),`Rotate`]}),h&&(0,s.jsxs)(r.Button,{variant:`outline`,size:`sm`,className:`text-destructive hover:text-destructive`,onClick:h,children:[(0,s.jsx)(o.Trash2,{className:`h-4 w-4 mr-2`}),`Delete`]})]})]})]})}var h={id:`1`,name:`Production API Key`,description:`Main API key for production services`,type:`api-key`,value:`sk_live_1234567890abcdefghijklmnopqrstuvwxyz`,createdAt:new Date(Date.now()-2160*36e5),updatedAt:new Date(Date.now()-168*36e5),rotatedAt:new Date(Date.now()-720*36e5),rotationPeriod:30,expiresAt:new Date(Date.now()+552*36e5),lastAccessedAt:new Date(Date.now()-2*36e5),lastAccessedBy:`api-gateway`,tags:[`production`,`critical`],accessHistory:[{user:`api-gateway`,action:`read`,timestamp:new Date(Date.now()-2*36e5)},{user:`john.doe`,action:`rotate`,timestamp:new Date(Date.now()-720*36e5)},{user:`api-gateway`,action:`read`,timestamp:new Date(Date.now()-24*36e5)}]};exports.WakaSecretCard=m,exports.defaultSecret=h;
@@ -1 +1 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`),n=require(`../badge/index.cjs.js`),r=require(`../button/index.cjs.js`),i=require(`../input/index.cjs.js`),a=require(`../scroll-area/index.cjs.js`);let o=require(`react`);o=e.__toESM(o);let s=require(`lucide-react`),c=require(`react/jsx-runtime`);var l={critical:{icon:s.ShieldAlert,color:`text-red-600`,bgColor:`bg-red-500`,label:`Critical`,score:`9.0-10.0`},high:{icon:s.AlertCircle,color:`text-orange-500`,bgColor:`bg-orange-500`,label:`High`,score:`7.0-8.9`},medium:{icon:s.AlertTriangle,color:`text-yellow-500`,bgColor:`bg-yellow-500`,label:`Medium`,score:`4.0-6.9`},low:{icon:s.Info,color:`text-blue-500`,bgColor:`bg-blue-500`,label:`Low`,score:`0.1-3.9`},info:{icon:s.Info,color:`text-gray-500`,bgColor:`bg-gray-500`,label:`Info`,score:`0`}},u={sast:{icon:s.FileCode,label:`SAST`,description:`Static Application Security Testing`},dast:{icon:s.Link,label:`DAST`,description:`Dynamic Application Security Testing`},sca:{icon:s.Package,label:`SCA`,description:`Software Composition Analysis`},secret:{icon:s.Shield,label:`Secrets`,description:`Secret Detection`},container:{icon:s.Package,label:`Container`,description:`Container Image Scanning`}};function d({severity:e}){let r=l[e];return(0,c.jsx)(n.Badge,{className:t.cn(`text-white`,r.bgColor),children:r.label})}function f({vulnerability:e,isExpanded:i,onToggle:a,onViewCVE:o}){let f=l[e.severity],p=u[e.type],m=f.icon,h=p.icon;return(0,c.jsxs)(`div`,{className:t.cn(`border rounded-lg overflow-hidden`,e.severity===`critical`&&`border-red-500/50`,e.severity===`high`&&`border-orange-500/50`),children:[(0,c.jsxs)(`button`,{className:t.cn(`w-full flex items-start gap-3 p-4 text-left hover:bg-muted/50 transition-colors`,e.severity===`critical`&&`bg-red-500/5`,e.severity===`high`&&`bg-orange-500/5`),onClick:a,children:[i?(0,c.jsx)(s.ChevronDown,{className:`h-4 w-4 mt-1 text-muted-foreground shrink-0`}):(0,c.jsx)(s.ChevronRight,{className:`h-4 w-4 mt-1 text-muted-foreground shrink-0`}),(0,c.jsx)(m,{className:t.cn(`h-5 w-5 mt-0.5 shrink-0`,f.color)}),(0,c.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,c.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,c.jsx)(`span`,{className:`font-medium`,children:e.title}),(0,c.jsx)(d,{severity:e.severity}),(0,c.jsxs)(n.Badge,{variant:`outline`,className:`text-xs`,children:[(0,c.jsx)(h,{className:`h-3 w-3 mr-1`}),p.label]})]}),(0,c.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1 line-clamp-2`,children:e.description}),(0,c.jsxs)(`div`,{className:`flex items-center gap-3 mt-2 text-xs text-muted-foreground`,children:[e.cveId&&(0,c.jsxs)(`span`,{role:`button`,tabIndex:0,className:`text-primary hover:underline flex items-center gap-1 cursor-pointer`,onClick:t=>{t.stopPropagation(),o?.(e.cveId)},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),t.stopPropagation(),o?.(e.cveId))},children:[e.cveId,(0,c.jsx)(s.ExternalLink,{className:`h-3 w-3`})]}),e.cvssScore&&(0,c.jsxs)(`span`,{children:[`CVSS: `,e.cvssScore.toFixed(1)]}),e.package&&(0,c.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,c.jsx)(s.Package,{className:`h-3 w-3`}),e.package,`@`,e.version]}),e.file&&(0,c.jsxs)(`span`,{className:`truncate max-w-[200px]`,children:[e.file,`:`,e.line]})]})]})]}),i&&(0,c.jsxs)(`div`,{className:`border-t bg-muted/20 p-4 space-y-4`,children:[(0,c.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4 text-sm`,children:[e.cveId&&(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`span`,{className:`text-muted-foreground`,children:`CVE ID:`}),` `,(0,c.jsx)(`span`,{className:`font-mono`,children:e.cveId})]}),e.cweId&&(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`span`,{className:`text-muted-foreground`,children:`CWE ID:`}),` `,(0,c.jsx)(`span`,{className:`font-mono`,children:e.cweId})]}),e.cvssScore&&(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`span`,{className:`text-muted-foreground`,children:`CVSS Score:`}),` `,(0,c.jsx)(`span`,{className:`font-medium`,children:e.cvssScore.toFixed(1)})]}),e.package&&(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`span`,{className:`text-muted-foreground`,children:`Package:`}),` `,(0,c.jsxs)(`span`,{className:`font-mono`,children:[e.package,`@`,e.version]})]}),e.fixedVersion&&(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`span`,{className:`text-muted-foreground`,children:`Fixed in:`}),` `,(0,c.jsx)(`span`,{className:`font-mono text-green-500`,children:e.fixedVersion})]}),e.file&&(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`span`,{className:`text-muted-foreground`,children:`Location:`}),` `,(0,c.jsxs)(`span`,{className:`font-mono`,children:[e.file,`:`,e.line]})]})]}),e.remediation&&(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`div`,{className:`text-sm font-medium mb-1`,children:`Remediation`}),(0,c.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.remediation})]}),e.url&&(0,c.jsxs)(r.Button,{variant:`outline`,size:`sm`,onClick:()=>window.open(e.url,`_blank`),children:[(0,c.jsx)(s.ExternalLink,{className:`h-4 w-4 mr-2`}),`Learn More`]})]})]})}function p({vulnerabilities:e,scanType:n=`all`,scannedAt:r,onVulnerabilityClick:u,onViewCVE:d,title:p=`Security Scan Results`,className:m}){let[h,g]=o.useState(``),[_,v]=o.useState(`all`),[y,b]=o.useState(new Set),x=e=>{b(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},S=o.useMemo(()=>e.reduce((e,t)=>(e[t.severity]++,e.total++,e),{critical:0,high:0,medium:0,low:0,info:0,total:0}),[e]),C=o.useMemo(()=>e.filter(e=>{if(_!==`all`&&e.severity!==_)return!1;if(h){let t=h.toLowerCase();return e.title.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)||e.cveId?.toLowerCase().includes(t)||e.package?.toLowerCase().includes(t)}return!0}),[e,_,h]),w=o.useMemo(()=>{let e={critical:40,high:20,medium:5,low:1,info:0},t=Object.entries(S).reduce((t,[n,r])=>n===`total`?t:t+(e[n]||0)*r,0);return Math.max(0,100-t)},[S]),T=w>=80?`text-green-500`:w>=50?`text-yellow-500`:`text-red-500`;return(0,c.jsxs)(`div`,{className:t.cn(`flex flex-col border rounded-lg bg-background`,m),children:[(0,c.jsxs)(`div`,{className:`flex items-center justify-between gap-4 p-3 border-b`,children:[(0,c.jsxs)(`div`,{className:`flex items-center gap-3`,children:[S.critical>0||S.high>0?(0,c.jsx)(s.ShieldAlert,{className:`h-5 w-5 text-red-500`}):(0,c.jsx)(s.ShieldCheck,{className:`h-5 w-5 text-green-500`}),(0,c.jsx)(`h3`,{className:`font-semibold`,children:p})]}),(0,c.jsx)(`div`,{className:`flex items-center gap-3`,children:(0,c.jsxs)(`div`,{className:`text-right`,children:[(0,c.jsx)(`div`,{className:t.cn(`text-2xl font-bold`,T),children:w}),(0,c.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Security Score`})]})})]}),(0,c.jsx)(`div`,{className:`grid grid-cols-5 gap-2 p-3 border-b bg-muted/30`,children:[`critical`,`high`,`medium`,`low`,`info`].map(e=>{let n=l[e],r=S[e];return(0,c.jsxs)(`button`,{className:t.cn(`flex flex-col items-center p-2 rounded-lg transition-colors`,_===e?`bg-background ring-1 ring-primary`:`hover:bg-background/50`,r>0&&e===`critical`&&`bg-red-500/10`,r>0&&e===`high`&&`bg-orange-500/10`),onClick:()=>v(_===e?`all`:e),children:[(0,c.jsx)(`span`,{className:t.cn(`text-2xl font-bold`,n.color),children:r}),(0,c.jsx)(`span`,{className:`text-xs text-muted-foreground capitalize`,children:e})]},e)})}),(0,c.jsxs)(`div`,{className:`flex items-center gap-2 p-2 border-b`,children:[(0,c.jsxs)(`div`,{className:`relative flex-1 max-w-sm`,children:[(0,c.jsx)(s.Search,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground`}),(0,c.jsx)(i.Input,{placeholder:`Search vulnerabilities...`,value:h,onChange:e=>g(e.target.value),className:`pl-8 h-8`})]}),r&&(0,c.jsxs)(`span`,{className:`text-xs text-muted-foreground flex items-center gap-1`,children:[(0,c.jsx)(s.Clock,{className:`h-3 w-3`}),`Scanned `,r.toLocaleString()]})]}),(0,c.jsx)(a.ScrollArea,{className:`flex-1 max-h-[500px]`,children:(0,c.jsx)(`div`,{className:`p-3 space-y-2`,children:C.length===0?(0,c.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-32 text-muted-foreground`,children:[(0,c.jsx)(s.ShieldCheck,{className:`h-8 w-8 mb-2 text-green-500`}),(0,c.jsx)(`span`,{children:`No vulnerabilities found`})]}):C.map(e=>(0,c.jsx)(f,{vulnerability:e,isExpanded:y.has(e.id),onToggle:()=>x(e.id),onViewCVE:d},e.id))})}),(0,c.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 border-t bg-muted/30 text-sm`,children:[(0,c.jsxs)(`span`,{className:`text-muted-foreground`,children:[C.length,` of `,e.length,` vulnerabilities`]}),S.critical>0&&(0,c.jsxs)(`span`,{className:`text-red-500 font-medium`,children:[S.critical,` critical issues require immediate attention`]})]})]})}var m=[{id:`1`,title:`SQL Injection in login endpoint`,description:`User input is directly concatenated into SQL query without proper sanitization, allowing attackers to execute arbitrary SQL commands.`,severity:`critical`,type:`sast`,cweId:`CWE-89`,cvssScore:9.8,file:`src/auth/login.ts`,line:45,remediation:`Use parameterized queries or prepared statements to prevent SQL injection attacks.`},{id:`2`,title:`Prototype Pollution in lodash`,description:`Versions of lodash prior to 4.17.21 are vulnerable to prototype pollution via the template function.`,severity:`high`,type:`sca`,cveId:`CVE-2021-23337`,cvssScore:7.2,package:`lodash`,version:`4.17.19`,fixedVersion:`4.17.21`,url:`https://nvd.nist.gov/vuln/detail/CVE-2021-23337`,remediation:`Upgrade lodash to version 4.17.21 or later.`},{id:`3`,title:`Hardcoded API Key`,description:`AWS API key found hardcoded in source code. This exposes the key to anyone with access to the repository.`,severity:`high`,type:`secret`,file:`config/aws.ts`,line:12,remediation:`Remove the hardcoded key and use environment variables or a secrets manager.`},{id:`4`,title:`Cross-Site Scripting (XSS)`,description:`User-provided content is rendered without proper escaping, allowing script injection.`,severity:`medium`,type:`dast`,cweId:`CWE-79`,cvssScore:6.1,url:`https://owasp.org/www-community/attacks/xss/`,remediation:`Sanitize and escape all user-provided content before rendering.`},{id:`5`,title:`Outdated base image`,description:`Container uses node:14 base image which has known vulnerabilities.`,severity:`low`,type:`container`,package:`node`,version:`14.0.0`,fixedVersion:`18.0.0`,remediation:`Update to a more recent Node.js LTS version.`}];exports.WakaSecurityScanResult=p,exports.defaultVulnerabilities=m;
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js"),n=require("../badge/index.cjs.js"),r=require("../button/index.cjs.js"),i=require("../input/index.cjs.js"),a=require("../scroll-area/index.cjs.js");let o=require("react");o=e.__toESM(o);let s=require("lucide-react"),c=require("react/jsx-runtime");var l={critical:{icon:s.ShieldAlert,color:`text-red-600`,bgColor:`bg-red-500`,label:`Critical`,score:`9.0-10.0`},high:{icon:s.AlertCircle,color:`text-orange-500`,bgColor:`bg-orange-500`,label:`High`,score:`7.0-8.9`},medium:{icon:s.AlertTriangle,color:`text-yellow-500`,bgColor:`bg-yellow-500`,label:`Medium`,score:`4.0-6.9`},low:{icon:s.Info,color:`text-blue-500`,bgColor:`bg-blue-500`,label:`Low`,score:`0.1-3.9`},info:{icon:s.Info,color:`text-gray-500`,bgColor:`bg-gray-500`,label:`Info`,score:`0`}},u={sast:{icon:s.FileCode,label:`SAST`,description:`Static Application Security Testing`},dast:{icon:s.Link,label:`DAST`,description:`Dynamic Application Security Testing`},sca:{icon:s.Package,label:`SCA`,description:`Software Composition Analysis`},secret:{icon:s.Shield,label:`Secrets`,description:`Secret Detection`},container:{icon:s.Package,label:`Container`,description:`Container Image Scanning`}};function d({severity:e}){let r=l[e];return(0,c.jsx)(n.Badge,{className:t.cn(`text-white`,r.bgColor),children:r.label})}function f({vulnerability:e,isExpanded:i,onToggle:a,onViewCVE:o}){let f=l[e.severity],p=u[e.type],m=f.icon,h=p.icon;return(0,c.jsxs)(`div`,{className:t.cn(`border rounded-lg overflow-hidden`,e.severity===`critical`&&`border-red-500/50`,e.severity===`high`&&`border-orange-500/50`),children:[(0,c.jsxs)(`button`,{className:t.cn(`w-full flex items-start gap-3 p-4 text-left hover:bg-muted/50 transition-colors`,e.severity===`critical`&&`bg-red-500/5`,e.severity===`high`&&`bg-orange-500/5`),onClick:a,children:[i?(0,c.jsx)(s.ChevronDown,{className:`h-4 w-4 mt-1 text-muted-foreground shrink-0`}):(0,c.jsx)(s.ChevronRight,{className:`h-4 w-4 mt-1 text-muted-foreground shrink-0`}),(0,c.jsx)(m,{className:t.cn(`h-5 w-5 mt-0.5 shrink-0`,f.color)}),(0,c.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,c.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,c.jsx)(`span`,{className:`font-medium`,children:e.title}),(0,c.jsx)(d,{severity:e.severity}),(0,c.jsxs)(n.Badge,{variant:`outline`,className:`text-xs`,children:[(0,c.jsx)(h,{className:`h-3 w-3 mr-1`}),p.label]})]}),(0,c.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1 line-clamp-2`,children:e.description}),(0,c.jsxs)(`div`,{className:`flex items-center gap-3 mt-2 text-xs text-muted-foreground`,children:[e.cveId&&(0,c.jsxs)(`span`,{role:`button`,tabIndex:0,className:`text-primary hover:underline flex items-center gap-1 cursor-pointer`,onClick:t=>{t.stopPropagation(),o?.(e.cveId)},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),t.stopPropagation(),o?.(e.cveId))},children:[e.cveId,(0,c.jsx)(s.ExternalLink,{className:`h-3 w-3`})]}),e.cvssScore&&(0,c.jsxs)(`span`,{children:[`CVSS: `,e.cvssScore.toFixed(1)]}),e.package&&(0,c.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,c.jsx)(s.Package,{className:`h-3 w-3`}),e.package,`@`,e.version]}),e.file&&(0,c.jsxs)(`span`,{className:`truncate max-w-[200px]`,children:[e.file,`:`,e.line]})]})]})]}),i&&(0,c.jsxs)(`div`,{className:`border-t bg-muted/20 p-4 space-y-4`,children:[(0,c.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4 text-sm`,children:[e.cveId&&(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`span`,{className:`text-muted-foreground`,children:`CVE ID:`}),` `,(0,c.jsx)(`span`,{className:`font-mono`,children:e.cveId})]}),e.cweId&&(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`span`,{className:`text-muted-foreground`,children:`CWE ID:`}),` `,(0,c.jsx)(`span`,{className:`font-mono`,children:e.cweId})]}),e.cvssScore&&(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`span`,{className:`text-muted-foreground`,children:`CVSS Score:`}),` `,(0,c.jsx)(`span`,{className:`font-medium`,children:e.cvssScore.toFixed(1)})]}),e.package&&(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`span`,{className:`text-muted-foreground`,children:`Package:`}),` `,(0,c.jsxs)(`span`,{className:`font-mono`,children:[e.package,`@`,e.version]})]}),e.fixedVersion&&(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`span`,{className:`text-muted-foreground`,children:`Fixed in:`}),` `,(0,c.jsx)(`span`,{className:`font-mono text-green-500`,children:e.fixedVersion})]}),e.file&&(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`span`,{className:`text-muted-foreground`,children:`Location:`}),` `,(0,c.jsxs)(`span`,{className:`font-mono`,children:[e.file,`:`,e.line]})]})]}),e.remediation&&(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`div`,{className:`text-sm font-medium mb-1`,children:`Remediation`}),(0,c.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.remediation})]}),e.url&&(0,c.jsxs)(r.Button,{variant:`outline`,size:`sm`,onClick:()=>window.open(e.url,`_blank`),children:[(0,c.jsx)(s.ExternalLink,{className:`h-4 w-4 mr-2`}),`Learn More`]})]})]})}function p({vulnerabilities:e,scanType:n=`all`,scannedAt:r,onVulnerabilityClick:u,onViewCVE:d,title:p=`Security Scan Results`,className:m}){let[h,g]=o.useState(``),[_,v]=o.useState(`all`),[y,b]=o.useState(new Set),x=e=>{b(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},S=o.useMemo(()=>e.reduce((e,t)=>(e[t.severity]++,e.total++,e),{critical:0,high:0,medium:0,low:0,info:0,total:0}),[e]),C=o.useMemo(()=>e.filter(e=>{if(_!==`all`&&e.severity!==_)return!1;if(h){let t=h.toLowerCase();return e.title.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)||e.cveId?.toLowerCase().includes(t)||e.package?.toLowerCase().includes(t)}return!0}),[e,_,h]),w=o.useMemo(()=>{let e={critical:40,high:20,medium:5,low:1,info:0},t=Object.entries(S).reduce((t,[n,r])=>n===`total`?t:t+(e[n]||0)*r,0);return Math.max(0,100-t)},[S]),T=w>=80?`text-green-500`:w>=50?`text-yellow-500`:`text-red-500`;return(0,c.jsxs)(`div`,{className:t.cn(`flex flex-col border rounded-lg bg-background`,m),children:[(0,c.jsxs)(`div`,{className:`flex items-center justify-between gap-4 p-3 border-b`,children:[(0,c.jsxs)(`div`,{className:`flex items-center gap-3`,children:[S.critical>0||S.high>0?(0,c.jsx)(s.ShieldAlert,{className:`h-5 w-5 text-red-500`}):(0,c.jsx)(s.ShieldCheck,{className:`h-5 w-5 text-green-500`}),(0,c.jsx)(`h3`,{className:`font-semibold`,children:p})]}),(0,c.jsx)(`div`,{className:`flex items-center gap-3`,children:(0,c.jsxs)(`div`,{className:`text-right`,children:[(0,c.jsx)(`div`,{className:t.cn(`text-2xl font-bold`,T),children:w}),(0,c.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Security Score`})]})})]}),(0,c.jsx)(`div`,{className:`grid grid-cols-5 gap-2 p-3 border-b bg-muted/30`,children:[`critical`,`high`,`medium`,`low`,`info`].map(e=>{let n=l[e],r=S[e];return(0,c.jsxs)(`button`,{className:t.cn(`flex flex-col items-center p-2 rounded-lg transition-colors`,_===e?`bg-background ring-1 ring-primary`:`hover:bg-background/50`,r>0&&e===`critical`&&`bg-red-500/10`,r>0&&e===`high`&&`bg-orange-500/10`),onClick:()=>v(_===e?`all`:e),children:[(0,c.jsx)(`span`,{className:t.cn(`text-2xl font-bold`,n.color),children:r}),(0,c.jsx)(`span`,{className:`text-xs text-muted-foreground capitalize`,children:e})]},e)})}),(0,c.jsxs)(`div`,{className:`flex items-center gap-2 p-2 border-b`,children:[(0,c.jsxs)(`div`,{className:`relative flex-1 max-w-sm`,children:[(0,c.jsx)(s.Search,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground`}),(0,c.jsx)(i.Input,{placeholder:`Search vulnerabilities...`,value:h,onChange:e=>g(e.target.value),className:`pl-8 h-8`})]}),r&&(0,c.jsxs)(`span`,{className:`text-xs text-muted-foreground flex items-center gap-1`,children:[(0,c.jsx)(s.Clock,{className:`h-3 w-3`}),`Scanned `,r.toLocaleString()]})]}),(0,c.jsx)(a.ScrollArea,{className:`flex-1 max-h-[500px]`,children:(0,c.jsx)(`div`,{className:`p-3 space-y-2`,children:C.length===0?(0,c.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-32 text-muted-foreground`,children:[(0,c.jsx)(s.ShieldCheck,{className:`h-8 w-8 mb-2 text-green-500`}),(0,c.jsx)(`span`,{children:`No vulnerabilities found`})]}):C.map(e=>(0,c.jsx)(f,{vulnerability:e,isExpanded:y.has(e.id),onToggle:()=>x(e.id),onViewCVE:d},e.id))})}),(0,c.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 border-t bg-muted/30 text-sm`,children:[(0,c.jsxs)(`span`,{className:`text-muted-foreground`,children:[C.length,` of `,e.length,` vulnerabilities`]}),S.critical>0&&(0,c.jsxs)(`span`,{className:`text-red-500 font-medium`,children:[S.critical,` critical issues require immediate attention`]})]})]})}var m=[{id:`1`,title:`SQL Injection in login endpoint`,description:`User input is directly concatenated into SQL query without proper sanitization, allowing attackers to execute arbitrary SQL commands.`,severity:`critical`,type:`sast`,cweId:`CWE-89`,cvssScore:9.8,file:`src/auth/login.ts`,line:45,remediation:`Use parameterized queries or prepared statements to prevent SQL injection attacks.`},{id:`2`,title:`Prototype Pollution in lodash`,description:`Versions of lodash prior to 4.17.21 are vulnerable to prototype pollution via the template function.`,severity:`high`,type:`sca`,cveId:`CVE-2021-23337`,cvssScore:7.2,package:`lodash`,version:`4.17.19`,fixedVersion:`4.17.21`,url:`https://nvd.nist.gov/vuln/detail/CVE-2021-23337`,remediation:`Upgrade lodash to version 4.17.21 or later.`},{id:`3`,title:`Hardcoded API Key`,description:`AWS API key found hardcoded in source code. This exposes the key to anyone with access to the repository.`,severity:`high`,type:`secret`,file:`config/aws.ts`,line:12,remediation:`Remove the hardcoded key and use environment variables or a secrets manager.`},{id:`4`,title:`Cross-Site Scripting (XSS)`,description:`User-provided content is rendered without proper escaping, allowing script injection.`,severity:`medium`,type:`dast`,cweId:`CWE-79`,cvssScore:6.1,url:`https://owasp.org/www-community/attacks/xss/`,remediation:`Sanitize and escape all user-provided content before rendering.`},{id:`5`,title:`Outdated base image`,description:`Container uses node:14 base image which has known vulnerabilities.`,severity:`low`,type:`container`,package:`node`,version:`14.0.0`,fixedVersion:`18.0.0`,remediation:`Update to a more recent Node.js LTS version.`}];exports.WakaSecurityScanResult=p,exports.defaultVulnerabilities=m;
@@ -1,4 +1,4 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`);let n=require(`react`);n=e.__toESM(n);let r=require(`lucide-react`),i=require(`react/jsx-runtime`);var a={critical:{color:`#dc2626`,bgColor:`bg-red-500/10`,borderColor:`border-red-500/30`,label:`Critical Risk`,icon:(0,i.jsx)(r.ShieldX,{className:`h-5 w-5`})},low:{color:`#f97316`,bgColor:`bg-orange-500/10`,borderColor:`border-orange-500/30`,label:`Low Security`,icon:(0,i.jsx)(r.ShieldAlert,{className:`h-5 w-5`})},medium:{color:`#eab308`,bgColor:`bg-yellow-500/10`,borderColor:`border-yellow-500/30`,label:`Medium Security`,icon:(0,i.jsx)(r.Shield,{className:`h-5 w-5`})},high:{color:`#22c55e`,bgColor:`bg-green-500/10`,borderColor:`border-green-500/30`,label:`High Security`,icon:(0,i.jsx)(r.ShieldCheck,{className:`h-5 w-5`})},excellent:{color:`#10b981`,bgColor:`bg-emerald-500/10`,borderColor:`border-emerald-500/30`,label:`Excellent`,icon:(0,i.jsx)(r.ShieldCheck,{className:`h-5 w-5`})}},o={critical:{color:`text-red-600`,bgColor:`bg-red-500/10`,label:`Critical`},high:{color:`text-orange-600`,bgColor:`bg-orange-500/10`,label:`High`},medium:{color:`text-yellow-600`,bgColor:`bg-yellow-500/10`,label:`Medium`},low:{color:`text-blue-600`,bgColor:`bg-blue-500/10`,label:`Low`}},s={pending:{color:`text-muted-foreground`,bgColor:`bg-muted`,label:`Pending`,icon:(0,i.jsx)(r.Minus,{className:`h-3.5 w-3.5`})},in_progress:{color:`text-blue-600`,bgColor:`bg-blue-500/10`,label:`In Progress`,icon:(0,i.jsx)(r.TrendingUp,{className:`h-3.5 w-3.5`})},completed:{color:`text-green-600`,bgColor:`bg-green-500/10`,label:`Completed`,icon:(0,i.jsx)(r.Check,{className:`h-3.5 w-3.5`})},dismissed:{color:`text-muted-foreground`,bgColor:`bg-muted/50`,label:`Dismissed`,icon:(0,i.jsx)(r.X,{className:`h-3.5 w-3.5`})}},c={sm:{gaugeSize:140,strokeWidth:10,fontSize:`text-2xl`,labelSize:`text-xs`,padding:`p-4`,gap:`gap-4`},md:{gaugeSize:180,strokeWidth:14,fontSize:`text-4xl`,labelSize:`text-sm`,padding:`p-6`,gap:`gap-6`},lg:{gaugeSize:220,strokeWidth:18,fontSize:`text-5xl`,labelSize:`text-base`,padding:`p-8`,gap:`gap-8`}},l={authentication:(0,i.jsx)(r.KeyRound,{className:`h-4 w-4`}),authorization:(0,i.jsx)(r.Lock,{className:`h-4 w-4`}),encryption:(0,i.jsx)(r.Lock,{className:`h-4 w-4`}),vulnerabilities:(0,i.jsx)(r.Bug,{className:`h-4 w-4`}),infrastructure:(0,i.jsx)(r.Server,{className:`h-4 w-4`}),network:(0,i.jsx)(r.Globe,{className:`h-4 w-4`}),compliance:(0,i.jsx)(r.FileWarning,{className:`h-4 w-4`}),access:(0,i.jsx)(r.Eye,{className:`h-4 w-4`})};function u(e){return e>=90?`excellent`:e>=70?`high`:e>=50?`medium`:e>=30?`low`:`critical`}function d(e,t,n,r){let i=(r-90)*Math.PI/180;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function f(e,t,n,r,i){let a=d(e,t,n,i),o=d(e,t,n,r),s=i-r<=180?`0`:`1`;return[`M`,a.x,a.y,`A`,n,n,0,s,0,o.x,o.y].join(` `)}function p(e){return e>=90?`#10b981`:e>=70?`#22c55e`:e>=50?`#eab308`:e>=30?`#f97316`:`#dc2626`}function m({initialScore:e=0,initialCategories:t=[],initialRecommendations:r=[],onScoreUpdate:i}={}){let[a,o]=n.useState(e),[s,c]=n.useState(t),[l,d]=n.useState(r),[f,p]=n.useState([{timestamp:new Date,score:e}]),m=n.useRef(a),h=n.useCallback(e=>{if(e.length===0)return 0;let t=e.reduce((e,t)=>e+(t.weight??1),0),n=e.reduce((e,t)=>e+t.score*(t.weight??1),0);return Math.round(n/t)},[]),g=n.useCallback(e=>{let t=Math.max(0,Math.min(100,e));o(t),p(e=>[...e.slice(-19),{timestamp:new Date,score:t}])},[]),_=n.useCallback((e,t)=>{c(n=>{let r=n.map(n=>n.id===e?{...n,...t}:n);return g(h(r)),r})},[h,g]),v=n.useCallback((e,t)=>{d(n=>n.map(n=>n.id===e?{...n,...t}:n))},[]),y=n.useCallback(e=>{let t=l.find(t=>t.id===e);t&&t.impact&&g(Math.min(100,a+t.impact)),v(e,{status:`completed`})},[l,a,g,v]);return n.useEffect(()=>{a!==m.current&&(i?.(a,m.current),m.current=a)},[a,i]),{score:a,setScore:g,categories:s,setCategories:c,recommendations:l,setRecommendations:d,history:f,setHistory:p,updateCategory:_,updateRecommendation:v,completeRecommendation:y,calculateScore:h,completedCount:l.filter(e=>e.status===`completed`).length,pendingCount:l.filter(e=>e.status===`pending`||e.status===`in_progress`).length,level:u(a)}}function h({score:e,displayScore:r,size:o,strokeWidth:s,animated:l}){let m=o/2,h=(o-s)/2;2*Math.PI*h;let g=a[u(e)],_=p(r),v=135+r/100*270,y=f(m,m,h,135,405),b=f(m,m,h,135,Math.max(135.1,v)),x=n.useId();return(0,i.jsxs)(`div`,{className:`relative`,style:{width:o,height:o},children:[(0,i.jsx)(`div`,{className:t.cn(`absolute inset-0 rounded-full blur-2xl opacity-30 transition-all duration-500`),style:{background:`radial-gradient(circle, ${_} 0%, transparent 70%)`}}),(0,i.jsxs)(`svg`,{width:o,height:o,viewBox:`0 0 ${o} ${o}`,className:`overflow-visible`,children:[(0,i.jsxs)(`defs`,{children:[(0,i.jsxs)(`linearGradient`,{id:`security-gradient-${x}`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`100%`,children:[(0,i.jsx)(`stop`,{offset:`0%`,stopColor:_,stopOpacity:`0.8`}),(0,i.jsx)(`stop`,{offset:`100%`,stopColor:_,stopOpacity:`1`})]}),(0,i.jsx)(`filter`,{id:`security-glow-${x}`,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`,children:(0,i.jsx)(`feDropShadow`,{dx:`0`,dy:`0`,stdDeviation:`4`,floodColor:_,floodOpacity:`0.6`})})]}),(0,i.jsx)(`path`,{d:y,fill:`none`,stroke:`currentColor`,strokeWidth:s,strokeLinecap:`round`,className:`text-muted opacity-20`}),(0,i.jsx)(`path`,{d:b,fill:`none`,stroke:`url(#security-gradient-${x})`,strokeWidth:s,strokeLinecap:`round`,filter:`url(#security-glow-${x})`,className:t.cn(l&&`transition-all duration-700 ease-out`)}),r>0&&(0,i.jsx)(`circle`,{cx:d(m,m,h,v).x,cy:d(m,m,h,v).y,r:s/3,fill:`white`,className:`transition-all duration-300`})]}),(0,i.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center`,children:[(0,i.jsx)(`div`,{className:`flex items-baseline gap-0.5`,children:(0,i.jsx)(`span`,{className:t.cn(`font-bold tabular-nums transition-colors duration-300`,c.md.fontSize),style:{color:_},children:Math.round(r)})}),(0,i.jsxs)(`div`,{className:t.cn(`flex items-center gap-1 px-2 py-0.5 rounded-full mt-1`,g.bgColor),style:{color:_},children:[g.icon,(0,i.jsx)(`span`,{className:`text-xs font-medium`,children:g.label})]})]})]})}function g({categories:e,size:t}){return(0,i.jsxs)(`div`,{className:`space-y-3`,children:[(0,i.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Score Breakdown`}),(0,i.jsx)(`div`,{className:`space-y-2`,children:e.map(e=>{let t=p(e.score),n=e.icon||l[e.id.toLowerCase()]||(0,i.jsx)(r.Shield,{className:`h-4 w-4`});return(0,i.jsxs)(`div`,{className:`space-y-1`,children:[(0,i.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,i.jsx)(`span`,{style:{color:t},children:n}),(0,i.jsx)(`span`,{className:`text-sm font-medium`,children:e.name})]}),(0,i.jsx)(`span`,{className:`text-sm font-semibold tabular-nums`,style:{color:t},children:e.score})]}),(0,i.jsx)(`div`,{className:`h-1.5 w-full rounded-full bg-muted overflow-hidden`,children:(0,i.jsx)(`div`,{className:`h-full rounded-full transition-all duration-500 ease-out`,style:{width:`${e.score}%`,backgroundColor:t}})}),e.description&&(0,i.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description})]},e.id)})})]})}function _({recommendations:e,maxItems:a,onAction:c}){let l=n.useMemo(()=>{let t=[`critical`,`high`,`medium`,`low`],n=[`pending`,`in_progress`,`completed`,`dismissed`];return[...e].sort((e,r)=>{let i=n.indexOf(e.status)-n.indexOf(r.status);return i===0?t.indexOf(e.priority)-t.indexOf(r.priority):i}).slice(0,a)},[e,a]),u=e.filter(e=>e.status===`completed`).length,d=e.length;return(0,i.jsxs)(`div`,{className:`space-y-3`,children:[(0,i.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,i.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Recommendations`}),(0,i.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[u,`/`,d,` completed`]})]}),(0,i.jsx)(`div`,{className:`h-1.5 w-full rounded-full bg-muted overflow-hidden`,children:(0,i.jsx)(`div`,{className:`h-full rounded-full bg-green-500 transition-all duration-500`,style:{width:`${u/d*100}%`}})}),(0,i.jsx)(`div`,{className:`space-y-2`,children:l.map(e=>{let n=o[e.priority],a=s[e.status],l=e.status===`pending`||e.status===`in_progress`;return(0,i.jsx)(`div`,{className:t.cn(`p-3 rounded-lg border transition-all duration-200`,e.status===`completed`&&`opacity-60`,e.status===`dismissed`&&`opacity-40`,l&&`hover:border-primary/50`),children:(0,i.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,i.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,i.jsx)(`span`,{className:t.cn(`px-1.5 py-0.5 rounded text-xs font-medium`,n.bgColor,n.color),children:n.label}),(0,i.jsxs)(`span`,{className:t.cn(`flex items-center gap-1 px-1.5 py-0.5 rounded text-xs`,a.bgColor,a.color),children:[a.icon,a.label]}),e.impact&&l&&(0,i.jsxs)(`span`,{className:`text-xs text-green-600 font-medium`,children:[`+`,e.impact,` pts`]})]}),(0,i.jsx)(`h4`,{className:`text-sm font-medium text-foreground truncate`,children:e.title}),(0,i.jsx)(`p`,{className:`text-xs text-muted-foreground line-clamp-2 mt-0.5`,children:e.description}),e.estimatedTime&&l&&(0,i.jsxs)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:[`Est. time: `,e.estimatedTime]})]}),l&&(0,i.jsxs)(`button`,{onClick:()=>{e.onAction?.(),c?.(e)},className:t.cn(`flex items-center gap-1 px-3 py-1.5 rounded-md text-xs font-medium`,`bg-primary text-primary-foreground`,`hover:bg-primary/90 transition-colors`,`focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2`),children:[e.actionLabel||`Fix`,(0,i.jsx)(r.ChevronRight,{className:`h-3 w-3`})]})]})},e.id)})})]})}function v({history:e,width:t=300,height:a=80}){if(e.length<2)return null;let o={top:10,right:10,bottom:20,left:30},s=t-o.left-o.right,c=a-o.top-o.bottom,l=e.map(e=>e.score),u=Math.min(...l,0),d=Math.max(...l,100)-u||1,f=e.map((t,n)=>({x:o.left+n/(e.length-1)*s,y:o.top+c-(t.score-u)/d*c,score:t.score})),m=f.map((e,t)=>`${t===0?`M`:`L`} ${e.x} ${e.y}`).join(` `),h=`${m} L ${f[f.length-1].x} ${o.top+c} L ${f[0].x} ${o.top+c} Z`,g=l[l.length-1],_=g-(l.length>1?l[l.length-2]:g),v=n.useId();return(0,i.jsxs)(`div`,{className:`space-y-2`,children:[(0,i.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,i.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Score History`}),(0,i.jsx)(`div`,{className:`flex items-center gap-1 text-xs`,children:_>0?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.TrendingUp,{className:`h-3.5 w-3.5 text-green-500`}),(0,i.jsxs)(`span`,{className:`text-green-600 font-medium`,children:[`+`,_]})]}):_<0?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.TrendingDown,{className:`h-3.5 w-3.5 text-red-500`}),(0,i.jsx)(`span`,{className:`text-red-600 font-medium`,children:_})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Minus,{className:`h-3.5 w-3.5 text-muted-foreground`}),(0,i.jsx)(`span`,{className:`text-muted-foreground font-medium`,children:`No change`})]})})]}),(0,i.jsxs)(`svg`,{width:t,height:a,className:`overflow-visible`,children:[(0,i.jsx)(`defs`,{children:(0,i.jsxs)(`linearGradient`,{id:`history-gradient-${v}`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,i.jsx)(`stop`,{offset:`0%`,stopColor:p(g),stopOpacity:`0.3`}),(0,i.jsx)(`stop`,{offset:`100%`,stopColor:p(g),stopOpacity:`0`})]})}),[0,25,50,75,100].map(e=>{let n=o.top+c-(e-u)/d*c;return(0,i.jsxs)(`g`,{children:[(0,i.jsx)(`line`,{x1:o.left,y1:n,x2:t-o.right,y2:n,stroke:`currentColor`,strokeWidth:`0.5`,strokeDasharray:`2 4`,className:`text-muted opacity-30`}),(0,i.jsx)(`text`,{x:o.left-5,y:n,textAnchor:`end`,dominantBaseline:`middle`,className:`text-[10px] fill-muted-foreground`,children:e})]},e)}),(0,i.jsx)(`path`,{d:h,fill:`url(#history-gradient-${v})`}),(0,i.jsx)(`path`,{d:m,fill:`none`,stroke:p(g),strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`}),f.map((e,t)=>(0,i.jsx)(`circle`,{cx:e.x,cy:e.y,r:t===f.length-1?4:2,fill:p(e.score),stroke:`white`,strokeWidth:t===f.length-1?2:1},t))]})]})}function y({score:e,categories:r=[],recommendations:o=[],history:s=[],size:l=`md`,showCategories:d=!0,showRecommendations:f=!0,showHistory:p=!1,animated:m=!0,animationDuration:y=1e3,maxRecommendations:b=5,className:x,onRecommendationAction:S,onScoreChange:C}){let[w,T]=n.useState(m?0:e),E=n.useRef(e),D=c[l];return n.useEffect(()=>{if(!m){T(e);return}let t=w,n=e-t,r=Date.now(),i=()=>{let e=Date.now()-r,a=Math.min(e/y,1);T(t+n*(1-(1-a)**3)),a<1&&requestAnimationFrame(i)};requestAnimationFrame(i)},[e,m,y]),n.useEffect(()=>{e!==E.current&&(C?.(e),E.current=e)},[e,C]),a[u(e)],(0,i.jsxs)(`div`,{className:t.cn(`rounded-xl border bg-card text-card-foreground shadow-sm`,D.padding,x),children:[(0,i.jsxs)(`div`,{className:t.cn(`flex flex-col lg:flex-row`,D.gap),children:[(0,i.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[(0,i.jsx)(h,{score:e,displayScore:w,size:D.gaugeSize,strokeWidth:D.strokeWidth,animated:m}),(0,i.jsxs)(`div`,{className:`text-center`,children:[(0,i.jsx)(`p`,{className:t.cn(`font-semibold`,D.labelSize),children:`Security Score`}),(0,i.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[o.filter(e=>e.status===`completed`).length,` of`,` `,o.length,` items addressed`]})]})]}),(0,i.jsxs)(`div`,{className:`flex-1 space-y-6`,children:[d&&r.length>0&&(0,i.jsx)(g,{categories:r,size:l}),p&&s.length>1&&(0,i.jsx)(v,{history:s}),f&&o.length>0&&(0,i.jsx)(_,{recommendations:o,maxItems:b,onAction:S})]})]}),(0,i.jsx)(`style`,{children:`
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js");let n=require("react");n=e.__toESM(n);let r=require("lucide-react"),i=require("react/jsx-runtime");var a={critical:{color:`#dc2626`,bgColor:`bg-red-500/10`,borderColor:`border-red-500/30`,label:`Critical Risk`,icon:(0,i.jsx)(r.ShieldX,{className:`h-5 w-5`})},low:{color:`#f97316`,bgColor:`bg-orange-500/10`,borderColor:`border-orange-500/30`,label:`Low Security`,icon:(0,i.jsx)(r.ShieldAlert,{className:`h-5 w-5`})},medium:{color:`#eab308`,bgColor:`bg-yellow-500/10`,borderColor:`border-yellow-500/30`,label:`Medium Security`,icon:(0,i.jsx)(r.Shield,{className:`h-5 w-5`})},high:{color:`#22c55e`,bgColor:`bg-green-500/10`,borderColor:`border-green-500/30`,label:`High Security`,icon:(0,i.jsx)(r.ShieldCheck,{className:`h-5 w-5`})},excellent:{color:`#10b981`,bgColor:`bg-emerald-500/10`,borderColor:`border-emerald-500/30`,label:`Excellent`,icon:(0,i.jsx)(r.ShieldCheck,{className:`h-5 w-5`})}},o={critical:{color:`text-red-600`,bgColor:`bg-red-500/10`,label:`Critical`},high:{color:`text-orange-600`,bgColor:`bg-orange-500/10`,label:`High`},medium:{color:`text-yellow-600`,bgColor:`bg-yellow-500/10`,label:`Medium`},low:{color:`text-blue-600`,bgColor:`bg-blue-500/10`,label:`Low`}},s={pending:{color:`text-muted-foreground`,bgColor:`bg-muted`,label:`Pending`,icon:(0,i.jsx)(r.Minus,{className:`h-3.5 w-3.5`})},in_progress:{color:`text-blue-600`,bgColor:`bg-blue-500/10`,label:`In Progress`,icon:(0,i.jsx)(r.TrendingUp,{className:`h-3.5 w-3.5`})},completed:{color:`text-green-600`,bgColor:`bg-green-500/10`,label:`Completed`,icon:(0,i.jsx)(r.Check,{className:`h-3.5 w-3.5`})},dismissed:{color:`text-muted-foreground`,bgColor:`bg-muted/50`,label:`Dismissed`,icon:(0,i.jsx)(r.X,{className:`h-3.5 w-3.5`})}},c={sm:{gaugeSize:140,strokeWidth:10,fontSize:`text-2xl`,labelSize:`text-xs`,padding:`p-4`,gap:`gap-4`},md:{gaugeSize:180,strokeWidth:14,fontSize:`text-4xl`,labelSize:`text-sm`,padding:`p-6`,gap:`gap-6`},lg:{gaugeSize:220,strokeWidth:18,fontSize:`text-5xl`,labelSize:`text-base`,padding:`p-8`,gap:`gap-8`}},l={authentication:(0,i.jsx)(r.KeyRound,{className:`h-4 w-4`}),authorization:(0,i.jsx)(r.Lock,{className:`h-4 w-4`}),encryption:(0,i.jsx)(r.Lock,{className:`h-4 w-4`}),vulnerabilities:(0,i.jsx)(r.Bug,{className:`h-4 w-4`}),infrastructure:(0,i.jsx)(r.Server,{className:`h-4 w-4`}),network:(0,i.jsx)(r.Globe,{className:`h-4 w-4`}),compliance:(0,i.jsx)(r.FileWarning,{className:`h-4 w-4`}),access:(0,i.jsx)(r.Eye,{className:`h-4 w-4`})};function u(e){return e>=90?`excellent`:e>=70?`high`:e>=50?`medium`:e>=30?`low`:`critical`}function d(e,t,n,r){let i=(r-90)*Math.PI/180;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function f(e,t,n,r,i){let a=d(e,t,n,i),o=d(e,t,n,r),s=i-r<=180?`0`:`1`;return[`M`,a.x,a.y,`A`,n,n,0,s,0,o.x,o.y].join(` `)}function p(e){return e>=90?`#10b981`:e>=70?`#22c55e`:e>=50?`#eab308`:e>=30?`#f97316`:`#dc2626`}function m({initialScore:e=0,initialCategories:t=[],initialRecommendations:r=[],onScoreUpdate:i}={}){let[a,o]=n.useState(e),[s,c]=n.useState(t),[l,d]=n.useState(r),[f,p]=n.useState([{timestamp:new Date,score:e}]),m=n.useRef(a),h=n.useCallback(e=>{if(e.length===0)return 0;let t=e.reduce((e,t)=>e+(t.weight??1),0),n=e.reduce((e,t)=>e+t.score*(t.weight??1),0);return Math.round(n/t)},[]),g=n.useCallback(e=>{let t=Math.max(0,Math.min(100,e));o(t),p(e=>[...e.slice(-19),{timestamp:new Date,score:t}])},[]),_=n.useCallback((e,t)=>{c(n=>{let r=n.map(n=>n.id===e?{...n,...t}:n),i=h(r);return g(i),r})},[h,g]),v=n.useCallback((e,t)=>{d(n=>n.map(n=>n.id===e?{...n,...t}:n))},[]),y=n.useCallback(e=>{let t=l.find(t=>t.id===e);t&&t.impact&&g(Math.min(100,a+t.impact)),v(e,{status:`completed`})},[l,a,g,v]);return n.useEffect(()=>{a!==m.current&&(i?.(a,m.current),m.current=a)},[a,i]),{score:a,setScore:g,categories:s,setCategories:c,recommendations:l,setRecommendations:d,history:f,setHistory:p,updateCategory:_,updateRecommendation:v,completeRecommendation:y,calculateScore:h,completedCount:l.filter(e=>e.status===`completed`).length,pendingCount:l.filter(e=>e.status===`pending`||e.status===`in_progress`).length,level:u(a)}}function h({score:e,displayScore:r,size:o,strokeWidth:s,animated:l}){let m=o/2,h=(o-s)/2;2*Math.PI*h;let g=a[u(e)],_=p(r),v=135+r/100*270,y=f(m,m,h,135,405),b=f(m,m,h,135,Math.max(135.1,v)),x=n.useId();return(0,i.jsxs)(`div`,{className:`relative`,style:{width:o,height:o},children:[(0,i.jsx)(`div`,{className:t.cn(`absolute inset-0 rounded-full blur-2xl opacity-30 transition-all duration-500`),style:{background:`radial-gradient(circle, ${_} 0%, transparent 70%)`}}),(0,i.jsxs)(`svg`,{width:o,height:o,viewBox:`0 0 ${o} ${o}`,className:`overflow-visible`,children:[(0,i.jsxs)(`defs`,{children:[(0,i.jsxs)(`linearGradient`,{id:`security-gradient-${x}`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`100%`,children:[(0,i.jsx)(`stop`,{offset:`0%`,stopColor:_,stopOpacity:`0.8`}),(0,i.jsx)(`stop`,{offset:`100%`,stopColor:_,stopOpacity:`1`})]}),(0,i.jsx)(`filter`,{id:`security-glow-${x}`,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`,children:(0,i.jsx)(`feDropShadow`,{dx:`0`,dy:`0`,stdDeviation:`4`,floodColor:_,floodOpacity:`0.6`})})]}),(0,i.jsx)(`path`,{d:y,fill:`none`,stroke:`currentColor`,strokeWidth:s,strokeLinecap:`round`,className:`text-muted opacity-20`}),(0,i.jsx)(`path`,{d:b,fill:`none`,stroke:`url(#security-gradient-${x})`,strokeWidth:s,strokeLinecap:`round`,filter:`url(#security-glow-${x})`,className:t.cn(l&&`transition-all duration-700 ease-out`)}),r>0&&(0,i.jsx)(`circle`,{cx:d(m,m,h,v).x,cy:d(m,m,h,v).y,r:s/3,fill:`white`,className:`transition-all duration-300`})]}),(0,i.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center`,children:[(0,i.jsx)(`div`,{className:`flex items-baseline gap-0.5`,children:(0,i.jsx)(`span`,{className:t.cn(`font-bold tabular-nums transition-colors duration-300`,c.md.fontSize),style:{color:_},children:Math.round(r)})}),(0,i.jsxs)(`div`,{className:t.cn(`flex items-center gap-1 px-2 py-0.5 rounded-full mt-1`,g.bgColor),style:{color:_},children:[g.icon,(0,i.jsx)(`span`,{className:`text-xs font-medium`,children:g.label})]})]})]})}function g({categories:e,size:t}){return(0,i.jsxs)(`div`,{className:`space-y-3`,children:[(0,i.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Score Breakdown`}),(0,i.jsx)(`div`,{className:`space-y-2`,children:e.map(e=>{let t=p(e.score),n=e.icon||l[e.id.toLowerCase()]||(0,i.jsx)(r.Shield,{className:`h-4 w-4`});return(0,i.jsxs)(`div`,{className:`space-y-1`,children:[(0,i.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,i.jsx)(`span`,{style:{color:t},children:n}),(0,i.jsx)(`span`,{className:`text-sm font-medium`,children:e.name})]}),(0,i.jsx)(`span`,{className:`text-sm font-semibold tabular-nums`,style:{color:t},children:e.score})]}),(0,i.jsx)(`div`,{className:`h-1.5 w-full rounded-full bg-muted overflow-hidden`,children:(0,i.jsx)(`div`,{className:`h-full rounded-full transition-all duration-500 ease-out`,style:{width:`${e.score}%`,backgroundColor:t}})}),e.description&&(0,i.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description})]},e.id)})})]})}function _({recommendations:e,maxItems:a,onAction:c}){let l=n.useMemo(()=>{let t=[`critical`,`high`,`medium`,`low`],n=[`pending`,`in_progress`,`completed`,`dismissed`];return[...e].sort((e,r)=>{let i=n.indexOf(e.status)-n.indexOf(r.status);return i===0?t.indexOf(e.priority)-t.indexOf(r.priority):i}).slice(0,a)},[e,a]),u=e.filter(e=>e.status===`completed`).length,d=e.length;return(0,i.jsxs)(`div`,{className:`space-y-3`,children:[(0,i.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,i.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Recommendations`}),(0,i.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[u,`/`,d,` completed`]})]}),(0,i.jsx)(`div`,{className:`h-1.5 w-full rounded-full bg-muted overflow-hidden`,children:(0,i.jsx)(`div`,{className:`h-full rounded-full bg-green-500 transition-all duration-500`,style:{width:`${u/d*100}%`}})}),(0,i.jsx)(`div`,{className:`space-y-2`,children:l.map(e=>{let n=o[e.priority],a=s[e.status],l=e.status===`pending`||e.status===`in_progress`;return(0,i.jsx)(`div`,{className:t.cn(`p-3 rounded-lg border transition-all duration-200`,e.status===`completed`&&`opacity-60`,e.status===`dismissed`&&`opacity-40`,l&&`hover:border-primary/50`),children:(0,i.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,i.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,i.jsx)(`span`,{className:t.cn(`px-1.5 py-0.5 rounded text-xs font-medium`,n.bgColor,n.color),children:n.label}),(0,i.jsxs)(`span`,{className:t.cn(`flex items-center gap-1 px-1.5 py-0.5 rounded text-xs`,a.bgColor,a.color),children:[a.icon,a.label]}),e.impact&&l&&(0,i.jsxs)(`span`,{className:`text-xs text-green-600 font-medium`,children:[`+`,e.impact,` pts`]})]}),(0,i.jsx)(`h4`,{className:`text-sm font-medium text-foreground truncate`,children:e.title}),(0,i.jsx)(`p`,{className:`text-xs text-muted-foreground line-clamp-2 mt-0.5`,children:e.description}),e.estimatedTime&&l&&(0,i.jsxs)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:[`Est. time: `,e.estimatedTime]})]}),l&&(0,i.jsxs)(`button`,{onClick:()=>{e.onAction?.(),c?.(e)},className:t.cn(`flex items-center gap-1 px-3 py-1.5 rounded-md text-xs font-medium`,`bg-primary text-primary-foreground`,`hover:bg-primary/90 transition-colors`,`focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2`),children:[e.actionLabel||`Fix`,(0,i.jsx)(r.ChevronRight,{className:`h-3 w-3`})]})]})},e.id)})})]})}function v({history:e,width:t=300,height:a=80}){if(e.length<2)return null;let o={top:10,right:10,bottom:20,left:30},s=t-o.left-o.right,c=a-o.top-o.bottom,l=e.map(e=>e.score),u=Math.min(...l,0),d=Math.max(...l,100)-u||1,f=e.map((t,n)=>({x:o.left+n/(e.length-1)*s,y:o.top+c-(t.score-u)/d*c,score:t.score})),m=f.map((e,t)=>`${t===0?`M`:`L`} ${e.x} ${e.y}`).join(` `),h=`${m} L ${f[f.length-1].x} ${o.top+c} L ${f[0].x} ${o.top+c} Z`,g=l[l.length-1],_=g-(l.length>1?l[l.length-2]:g),v=n.useId();return(0,i.jsxs)(`div`,{className:`space-y-2`,children:[(0,i.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,i.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Score History`}),(0,i.jsx)(`div`,{className:`flex items-center gap-1 text-xs`,children:_>0?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.TrendingUp,{className:`h-3.5 w-3.5 text-green-500`}),(0,i.jsxs)(`span`,{className:`text-green-600 font-medium`,children:[`+`,_]})]}):_<0?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.TrendingDown,{className:`h-3.5 w-3.5 text-red-500`}),(0,i.jsx)(`span`,{className:`text-red-600 font-medium`,children:_})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Minus,{className:`h-3.5 w-3.5 text-muted-foreground`}),(0,i.jsx)(`span`,{className:`text-muted-foreground font-medium`,children:`No change`})]})})]}),(0,i.jsxs)(`svg`,{width:t,height:a,className:`overflow-visible`,children:[(0,i.jsx)(`defs`,{children:(0,i.jsxs)(`linearGradient`,{id:`history-gradient-${v}`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,i.jsx)(`stop`,{offset:`0%`,stopColor:p(g),stopOpacity:`0.3`}),(0,i.jsx)(`stop`,{offset:`100%`,stopColor:p(g),stopOpacity:`0`})]})}),[0,25,50,75,100].map(e=>{let n=o.top+c-(e-u)/d*c;return(0,i.jsxs)(`g`,{children:[(0,i.jsx)(`line`,{x1:o.left,y1:n,x2:t-o.right,y2:n,stroke:`currentColor`,strokeWidth:`0.5`,strokeDasharray:`2 4`,className:`text-muted opacity-30`}),(0,i.jsx)(`text`,{x:o.left-5,y:n,textAnchor:`end`,dominantBaseline:`middle`,className:`text-[10px] fill-muted-foreground`,children:e})]},e)}),(0,i.jsx)(`path`,{d:h,fill:`url(#history-gradient-${v})`}),(0,i.jsx)(`path`,{d:m,fill:`none`,stroke:p(g),strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`}),f.map((e,t)=>(0,i.jsx)(`circle`,{cx:e.x,cy:e.y,r:t===f.length-1?4:2,fill:p(e.score),stroke:`white`,strokeWidth:t===f.length-1?2:1},t))]})]})}function y({score:e,categories:r=[],recommendations:o=[],history:s=[],size:l=`md`,showCategories:d=!0,showRecommendations:f=!0,showHistory:p=!1,animated:m=!0,animationDuration:y=1e3,maxRecommendations:b=5,className:x,onRecommendationAction:S,onScoreChange:C}){let[w,T]=n.useState(m?0:e),E=n.useRef(e),D=c[l];return n.useEffect(()=>{if(!m){T(e);return}let t=w,n=e-t,r=Date.now(),i=()=>{let e=Date.now()-r,a=Math.min(e/y,1),o=1-(1-a)**3;T(t+n*o),a<1&&requestAnimationFrame(i)};requestAnimationFrame(i)},[e,m,y]),n.useEffect(()=>{e!==E.current&&(C?.(e),E.current=e)},[e,C]),a[u(e)],(0,i.jsxs)(`div`,{className:t.cn(`rounded-xl border bg-card text-card-foreground shadow-sm`,D.padding,x),children:[(0,i.jsxs)(`div`,{className:t.cn(`flex flex-col lg:flex-row`,D.gap),children:[(0,i.jsxs)(`div`,{className:`flex flex-col items-center gap-4`,children:[(0,i.jsx)(h,{score:e,displayScore:w,size:D.gaugeSize,strokeWidth:D.strokeWidth,animated:m}),(0,i.jsxs)(`div`,{className:`text-center`,children:[(0,i.jsx)(`p`,{className:t.cn(`font-semibold`,D.labelSize),children:`Security Score`}),(0,i.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[o.filter(e=>e.status===`completed`).length,` of`,` `,o.length,` items addressed`]})]})]}),(0,i.jsxs)(`div`,{className:`flex-1 space-y-6`,children:[d&&r.length>0&&(0,i.jsx)(g,{categories:r,size:l}),p&&s.length>1&&(0,i.jsx)(v,{history:s}),f&&o.length>0&&(0,i.jsx)(_,{recommendations:o,maxItems:b,onAction:S})]})]}),(0,i.jsx)(`style`,{children:`
2
2
  @keyframes security-pulse {
3
3
  0%, 100% { opacity: 0.3; }
4
4
  50% { opacity: 0.6; }
@@ -7,4 +7,4 @@
7
7
  0%, 100% { filter: drop-shadow(0 0 8px currentColor); }
8
8
  50% { filter: drop-shadow(0 0 16px currentColor); }
9
9
  }
10
- `})]})}y.displayName=`WakaSecurityScore`;function b({score:e,showTrend:n=!1,previousScore:o,className:s}){let c=a[u(e)],l=p(e),d=o===void 0?0:e-o;return(0,i.jsxs)(`div`,{className:t.cn(`inline-flex items-center gap-2 px-3 py-1.5 rounded-lg border`,c.bgColor,c.borderColor,s),children:[(0,i.jsx)(`span`,{style:{color:l},children:c.icon}),(0,i.jsx)(`span`,{className:`font-bold tabular-nums`,style:{color:l},children:e}),n&&d!==0&&(0,i.jsxs)(`span`,{className:t.cn(`flex items-center text-xs font-medium`,d>0?`text-green-600`:`text-red-600`),children:[d>0?(0,i.jsx)(r.TrendingUp,{className:`h-3 w-3`}):(0,i.jsx)(r.TrendingDown,{className:`h-3 w-3`}),Math.abs(d)]})]})}b.displayName=`WakaSecurityScoreCompact`,exports.WakaSecurityScoreCompact=b,exports.default=y,exports.useSecurityScore=m;
10
+ `})]})}y.displayName=`WakaSecurityScore`;function b({score:e,showTrend:n=!1,previousScore:o,className:s}){let c=a[u(e)],l=p(e),d=o===void 0?0:e-o;return(0,i.jsxs)(`div`,{className:t.cn(`inline-flex items-center gap-2 px-3 py-1.5 rounded-lg border`,c.bgColor,c.borderColor,s),children:[(0,i.jsx)(`span`,{style:{color:l},children:c.icon}),(0,i.jsx)(`span`,{className:`font-bold tabular-nums`,style:{color:l},children:e}),n&&d!==0&&(0,i.jsxs)(`span`,{className:t.cn(`flex items-center text-xs font-medium`,d>0?`text-green-600`:`text-red-600`),children:[d>0?(0,i.jsx)(r.TrendingUp,{className:`h-3 w-3`}):(0,i.jsx)(r.TrendingDown,{className:`h-3 w-3`}),Math.abs(d)]})]})}b.displayName=`WakaSecurityScoreCompact`,exports.WakaSecurityScore=y,exports.default=y,exports.WakaSecurityScoreCompact=b,exports.useSecurityScore=m;
@@ -170,8 +170,8 @@ function j({ initialScore: e = 0, initialCategories: n = [], initialRecommendati
170
170
  let r = n.map((n) => n.id === e ? {
171
171
  ...n,
172
172
  ...t
173
- } : n);
174
- return h(m(r)), r;
173
+ } : n), i = m(r);
174
+ return h(i), r;
175
175
  });
176
176
  }, [m, h]), _ = t.useCallback((e, t) => {
177
177
  u((n) => n.map((n) => n.id === e ? {
@@ -567,8 +567,8 @@ function I({ score: n, categories: r = [], recommendations: i = [], history: a =
567
567
  return;
568
568
  }
569
569
  let e = g, t = n - e, r = Date.now(), i = () => {
570
- let n = Date.now() - r, a = Math.min(n / d, 1);
571
- _(e + t * (1 - (1 - a) ** 3)), a < 1 && requestAnimationFrame(i);
570
+ let n = Date.now() - r, a = Math.min(n / d, 1), o = 1 - (1 - a) ** 3;
571
+ _(e + t * o), a < 1 && requestAnimationFrame(i);
572
572
  };
573
573
  requestAnimationFrame(i);
574
574
  }, [
@@ -647,4 +647,4 @@ function L({ score: t, showTrend: n = !1, previousScore: r, className: i }) {
647
647
  }
648
648
  L.displayName = "WakaSecurityScoreCompact";
649
649
  //#endregion
650
- export { L as WakaSecurityScoreCompact, I as default, j as useSecurityScore };
650
+ export { I as WakaSecurityScore, I as default, L as WakaSecurityScoreCompact, j as useSecurityScore };
@@ -1 +1 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`);let n=require(`react`);n=e.__toESM(n);let r=require(`react/jsx-runtime`);function i({options:e,value:i,onChange:a,size:o=`md`,variant:s=`default`,fullWidth:c=!1,disabled:l=!1,name:u,className:d}){let[f,p]=n.useState({}),m=n.useRef(null),h=n.useRef(new Map),g={sm:`h-7 text-xs px-2`,md:`h-9 text-sm px-3`,lg:`h-11 text-base px-4`},_={sm:`p-0.5`,md:`p-1`,lg:`p-1`},v={sm:`h-3 w-3`,md:`h-4 w-4`,lg:`h-5 w-5`};n.useEffect(()=>{if(i===void 0)return;let e=h.current.get(i),t=m.current;if(e&&t){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();p({left:r.left-n.left,width:r.width,height:r.height})}},[i,e]);let y=e=>{l||a?.(e)},b=e=>t=>{t?h.current.set(e,t):h.current.delete(e)};return(0,r.jsxs)(`div`,{ref:m,role:`radiogroup`,className:t.cn(`relative inline-flex items-center bg-muted rounded-lg`,_[o],c&&`w-full`,l&&`opacity-50`,d),children:[i!==void 0&&s===`default`&&(0,r.jsx)(`div`,{className:`absolute bg-background rounded-md shadow-sm transition-all duration-200 ease-out`,style:f}),e.map(e=>{let n=e.value===i,a=l||e.disabled;return(0,r.jsxs)(`button`,{ref:b(e.value),type:`button`,role:`radio`,"aria-checked":n,disabled:a,onClick:()=>y(e.value),className:t.cn(`relative z-10 inline-flex items-center justify-center gap-1.5 font-medium transition-colors rounded-md`,g[o],c&&`flex-1`,s===`default`&&[n?`text-foreground`:`text-muted-foreground hover:text-foreground`],s===`pills`&&[n?`bg-primary text-primary-foreground`:`text-muted-foreground hover:text-foreground hover:bg-background/50`],a&&`cursor-not-allowed opacity-50`),children:[e.icon&&(0,r.jsx)(`span`,{className:v[o],children:e.icon}),e.label]},String(e.value))}),u&&(0,r.jsx)(`input`,{type:`hidden`,name:u,value:String(i??``)})]})}function a(e,t){let[r,i]=n.useState(t??e[0]?.value);return{value:r,onChange:i,selectNext:()=>{let t=e[(e.findIndex(e=>e.value===r)+1)%e.length];t.disabled||i(t.value)},selectPrevious:()=>{let t=e.findIndex(e=>e.value===r),n=e[t===0?e.length-1:t-1];n.disabled||i(n.value)},selectFirst:()=>{let t=e.find(e=>!e.disabled);t&&i(t.value)},selectLast:()=>{let t=[...e].reverse().find(e=>!e.disabled);t&&i(t.value)},options:e}}exports.default=i,exports.useSegmentedControl=a;
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js");let n=require("react");n=e.__toESM(n);let r=require("react/jsx-runtime");function i({options:e,value:i,onChange:a,size:o=`md`,variant:s=`default`,fullWidth:c=!1,disabled:l=!1,name:u,className:d}){let[f,p]=n.useState({}),m=n.useRef(null),h=n.useRef(new Map),g={sm:`h-7 text-xs px-2`,md:`h-9 text-sm px-3`,lg:`h-11 text-base px-4`},_={sm:`p-0.5`,md:`p-1`,lg:`p-1`},v={sm:`h-3 w-3`,md:`h-4 w-4`,lg:`h-5 w-5`};n.useEffect(()=>{if(i===void 0)return;let e=h.current.get(i),t=m.current;if(e&&t){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();p({left:r.left-n.left,width:r.width,height:r.height})}},[i,e]);let y=e=>{l||a?.(e)},b=e=>t=>{t?h.current.set(e,t):h.current.delete(e)};return(0,r.jsxs)(`div`,{ref:m,role:`radiogroup`,className:t.cn(`relative inline-flex items-center bg-muted rounded-lg`,_[o],c&&`w-full`,l&&`opacity-50`,d),children:[i!==void 0&&s==="default"&&(0,r.jsx)(`div`,{className:`absolute bg-background rounded-md shadow-sm transition-all duration-200 ease-out`,style:f}),e.map(e=>{let n=e.value===i,a=l||e.disabled;return(0,r.jsxs)(`button`,{ref:b(e.value),type:`button`,role:`radio`,"aria-checked":n,disabled:a,onClick:()=>y(e.value),className:t.cn(`relative z-10 inline-flex items-center justify-center gap-1.5 font-medium transition-colors rounded-md`,g[o],c&&`flex-1`,s==="default"&&[n?`text-foreground`:`text-muted-foreground hover:text-foreground`],s===`pills`&&[n?`bg-primary text-primary-foreground`:`text-muted-foreground hover:text-foreground hover:bg-background/50`],a&&`cursor-not-allowed opacity-50`),children:[e.icon&&(0,r.jsx)(`span`,{className:v[o],children:e.icon}),e.label]},String(e.value))}),u&&(0,r.jsx)(`input`,{type:`hidden`,name:u,value:String(i??``)})]})}function a(e,t){let[r,i]=n.useState(t??e[0]?.value);return{value:r,onChange:i,selectNext:()=>{let t=e[(e.findIndex(e=>e.value===r)+1)%e.length];t.disabled||i(t.value)},selectPrevious:()=>{let t=e.findIndex(e=>e.value===r),n=e[t===0?e.length-1:t-1];n.disabled||i(n.value)},selectFirst:()=>{let t=e.find(e=>!e.disabled);t&&i(t.value)},selectLast:()=>{let t=[...e].reverse().find(e=>!e.disabled);t&&i(t.value)},options:e}}exports.WakaSegmentedControl=i,exports.default=i,exports.useSegmentedControl=a;
@@ -93,4 +93,4 @@ function a(e, n) {
93
93
  };
94
94
  }
95
95
  //#endregion
96
- export { i as default, a as useSegmentedControl };
96
+ export { i as WakaSegmentedControl, i as default, a as useSegmentedControl };
@@ -1,4 +1,4 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`);let n=require(`react`);n=e.__toESM(n);let r=require(`react/jsx-runtime`);var i={online:{led:`hsl(var(--success))`,glow:`hsl(var(--success) / 0.6)`,bg:`hsl(var(--success) / 0.1)`},warning:{led:`hsl(var(--warning))`,glow:`hsl(var(--warning) / 0.6)`,bg:`hsl(var(--warning) / 0.1)`},offline:{led:`hsl(var(--destructive))`,glow:`hsl(var(--destructive) / 0.6)`,bg:`hsl(var(--destructive) / 0.1)`},maintenance:{led:`hsl(var(--info))`,glow:`hsl(var(--info) / 0.6)`,bg:`hsl(var(--info) / 0.1)`}},a=24;function o({value:e,label:n,color:i,animated:a}){let o=()=>e>=90?`hsl(var(--destructive))`:e>=70?`hsl(var(--warning))`:i;return(0,r.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,r.jsx)(`span`,{className:`text-[8px] font-medium text-zinc-400 w-6`,children:n}),(0,r.jsx)(`div`,{className:`relative h-1.5 flex-1 rounded-full bg-zinc-800/80 overflow-hidden`,children:(0,r.jsx)(`div`,{className:t.cn(`absolute inset-y-0 left-0 rounded-full`,a&&`transition-all duration-500 ease-out`),style:{width:`${e}%`,backgroundColor:o(),boxShadow:`0 0 6px ${o()}40`}})}),(0,r.jsxs)(`span`,{className:`text-[8px] font-mono text-zinc-500 w-7 text-right`,children:[e,`%`]})]})}function s({status:e,animated:n}){let a=i[e];return(0,r.jsxs)(`div`,{className:`relative flex items-center justify-center`,children:[(0,r.jsx)(`div`,{className:t.cn(`absolute w-4 h-4 rounded-full blur-sm`,n&&e!==`offline`&&`animate-pulse`),style:{backgroundColor:a.glow}}),(0,r.jsx)(`div`,{className:`relative w-2.5 h-2.5 rounded-full border border-zinc-600`,style:{backgroundColor:a.led,boxShadow:`0 0 8px ${a.glow}, inset 0 -1px 2px rgba(0,0,0,0.3), inset 0 1px 1px rgba(255,255,255,0.2)`}})]})}function c({server:e,isSelected:c,showMetrics:l,animated:u,onClick:d}){let[f,p]=n.useState(!1),m=i[e.status],h=e.height*a;return(0,r.jsxs)(`div`,{className:t.cn(`group relative cursor-pointer select-none`,u&&`transition-all duration-200`),style:{height:h},onClick:d,onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[(0,r.jsxs)(`div`,{className:t.cn(`absolute inset-0 rounded-sm`,u&&`transition-all duration-200`),style:{background:c?`linear-gradient(180deg, #3f3f46 0%, #27272a 50%, #18181b 100%)`:`linear-gradient(180deg, #2a2a2e 0%, #1f1f23 50%, #18181b 100%)`,boxShadow:c?`inset 0 1px 0 rgba(255,255,255,0.1),
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js");let n=require("react");n=e.__toESM(n);let r=require("react/jsx-runtime");var i={online:{led:`hsl(var(--success))`,glow:`hsl(var(--success) / 0.6)`,bg:`hsl(var(--success) / 0.1)`},warning:{led:`hsl(var(--warning))`,glow:`hsl(var(--warning) / 0.6)`,bg:`hsl(var(--warning) / 0.1)`},offline:{led:`hsl(var(--destructive))`,glow:`hsl(var(--destructive) / 0.6)`,bg:`hsl(var(--destructive) / 0.1)`},maintenance:{led:`hsl(var(--info))`,glow:`hsl(var(--info) / 0.6)`,bg:`hsl(var(--info) / 0.1)`}},a=24;function o({value:e,label:n,color:i,animated:a}){let o=()=>e>=90?`hsl(var(--destructive))`:e>=70?`hsl(var(--warning))`:i;return(0,r.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,r.jsx)(`span`,{className:`text-[8px] font-medium text-zinc-400 w-6`,children:n}),(0,r.jsx)(`div`,{className:`relative h-1.5 flex-1 rounded-full bg-zinc-800/80 overflow-hidden`,children:(0,r.jsx)(`div`,{className:t.cn(`absolute inset-y-0 left-0 rounded-full`,a&&`transition-all duration-500 ease-out`),style:{width:`${e}%`,backgroundColor:o(),boxShadow:`0 0 6px ${o()}40`}})}),(0,r.jsxs)(`span`,{className:`text-[8px] font-mono text-zinc-500 w-7 text-right`,children:[e,`%`]})]})}function s({status:e,animated:n}){let a=i[e];return(0,r.jsxs)(`div`,{className:`relative flex items-center justify-center`,children:[(0,r.jsx)(`div`,{className:t.cn(`absolute w-4 h-4 rounded-full blur-sm`,n&&e!==`offline`&&`animate-pulse`),style:{backgroundColor:a.glow}}),(0,r.jsx)(`div`,{className:`relative w-2.5 h-2.5 rounded-full border border-zinc-600`,style:{backgroundColor:a.led,boxShadow:`0 0 8px ${a.glow}, inset 0 -1px 2px rgba(0,0,0,0.3), inset 0 1px 1px rgba(255,255,255,0.2)`}})]})}function c({server:e,isSelected:c,showMetrics:l,animated:u,onClick:d}){let[f,p]=n.useState(!1),m=i[e.status],h=e.height*a;return(0,r.jsxs)(`div`,{className:t.cn(`group relative cursor-pointer select-none`,u&&`transition-all duration-200`),style:{height:h},onClick:d,onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[(0,r.jsxs)(`div`,{className:t.cn(`absolute inset-0 rounded-sm`,u&&`transition-all duration-200`),style:{background:c?`linear-gradient(180deg, #3f3f46 0%, #27272a 50%, #18181b 100%)`:`linear-gradient(180deg, #2a2a2e 0%, #1f1f23 50%, #18181b 100%)`,boxShadow:c?`inset 0 1px 0 rgba(255,255,255,0.1),
2
2
  inset 0 -1px 0 rgba(0,0,0,0.5),
3
3
  0 0 20px ${m.glow},
4
4
  0 4px 12px rgba(0,0,0,0.4)`:`inset 0 1px 0 rgba(255,255,255,0.05),
@@ -1 +1 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`),n=require(`../badge/index.cjs.js`),r=require(`../button/index.cjs.js`),i=require(`../tooltip/index.cjs.js`);let a=require(`react`);a=e.__toESM(a);let o=require(`lucide-react`),s=require(`react/jsx-runtime`);var c={api:{icon:o.Server,color:`bg-blue-500`},database:{icon:o.Database,color:`bg-purple-500`},cache:{icon:o.Zap,color:`bg-yellow-500`},queue:{icon:o.MessageSquare,color:`bg-orange-500`},gateway:{icon:o.Globe,color:`bg-green-500`},external:{icon:o.Network,color:`bg-gray-500`}},l={healthy:{color:`text-green-500`,borderColor:`border-green-500`,icon:o.CheckCircle2},degraded:{color:`text-yellow-500`,borderColor:`border-yellow-500`,icon:o.AlertTriangle},unhealthy:{color:`text-red-500`,borderColor:`border-red-500`,icon:o.XCircle},unknown:{color:`text-gray-500`,borderColor:`border-gray-500`,icon:o.AlertTriangle}};function u({service:e,isSelected:n,onClick:r,showMetrics:a,position:o}){let u=c[e.type],d=l[e.health],f=u.icon,p=d.icon;return(0,s.jsx)(i.TooltipProvider,{children:(0,s.jsxs)(i.Tooltip,{children:[(0,s.jsx)(i.TooltipTrigger,{asChild:!0,children:(0,s.jsx)(`div`,{className:t.cn(`absolute transform -translate-x-1/2 -translate-y-1/2 cursor-pointer`,`transition-all duration-200 hover:scale-110`),style:{left:o.x,top:o.y},onClick:r,children:(0,s.jsxs)(`div`,{className:t.cn(`relative bg-background border-2 rounded-xl p-3 shadow-lg`,d.borderColor,n&&`ring-2 ring-primary ring-offset-2`),children:[(0,s.jsx)(`div`,{className:t.cn(`absolute -top-2 -right-2`,d.color),children:(0,s.jsx)(p,{className:`h-4 w-4`})}),(0,s.jsx)(`div`,{className:t.cn(`w-10 h-10 rounded-lg flex items-center justify-center text-white`,u.color),children:(0,s.jsx)(f,{className:`h-5 w-5`})}),(0,s.jsxs)(`div`,{className:`mt-2 text-center`,children:[(0,s.jsx)(`div`,{className:`font-medium text-sm truncate max-w-[100px]`,children:e.name}),e.namespace&&(0,s.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e.namespace})]}),a&&(0,s.jsxs)(`div`,{className:`mt-2 text-xs text-center space-y-0.5`,children:[e.requestsPerSec!==void 0&&(0,s.jsxs)(`div`,{className:`text-muted-foreground`,children:[e.requestsPerSec,` req/s`]}),e.errorRate!==void 0&&e.errorRate>0&&(0,s.jsxs)(`div`,{className:`text-red-500`,children:[(e.errorRate*100).toFixed(1),`% errors`]})]})]})})}),(0,s.jsx)(i.TooltipContent,{side:`right`,className:`max-w-xs`,children:(0,s.jsxs)(`div`,{className:`space-y-2`,children:[(0,s.jsx)(`div`,{className:`font-semibold`,children:e.name}),(0,s.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-4 gap-y-1 text-xs`,children:[(0,s.jsx)(`span`,{className:`text-muted-foreground`,children:`Type:`}),(0,s.jsx)(`span`,{className:`capitalize`,children:e.type}),(0,s.jsx)(`span`,{className:`text-muted-foreground`,children:`Health:`}),(0,s.jsx)(`span`,{className:d.color,children:e.health}),e.version&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`span`,{className:`text-muted-foreground`,children:`Version:`}),(0,s.jsx)(`span`,{children:e.version})]}),e.replicas!==void 0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`span`,{className:`text-muted-foreground`,children:`Replicas:`}),(0,s.jsx)(`span`,{children:e.replicas})]}),e.latencyP50!==void 0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`span`,{className:`text-muted-foreground`,children:`Latency P50:`}),(0,s.jsxs)(`span`,{children:[e.latencyP50,`ms`]})]}),e.latencyP99!==void 0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`span`,{className:`text-muted-foreground`,children:`Latency P99:`}),(0,s.jsxs)(`span`,{children:[e.latencyP99,`ms`]})]})]})]})})]})})}function d({start:e,end:t,connection:n,onClick:r}){let i=(e.x+t.x)/2,a=(e.y+t.y)/2,o=t.x-e.x,c=t.y-e.y,l=Math.sqrt(o*o+c*c),u=.2,d=-c/l*u*l,f=o/l*u*l,p=i+d,m=a+f,h=`M ${e.x} ${e.y} Q ${p} ${m} ${t.x} ${t.y}`,g=n.errorRate||0;return(0,s.jsxs)(`g`,{className:`cursor-pointer hover:opacity-70`,onClick:r,children:[(0,s.jsx)(`path`,{d:h,fill:`none`,stroke:g>.05?`#ef4444`:g>.01?`#eab308`:`#6b7280`,strokeWidth:Math.min(Math.max((n.requestsPerSec||1)/100,1),4),strokeOpacity:.6,markerEnd:`url(#arrowhead)`}),n.requestsPerSec!==void 0&&(0,s.jsxs)(`text`,{x:p,y:m,textAnchor:`middle`,dy:-8,className:`fill-muted-foreground text-xs`,children:[n.requestsPerSec,` req/s`]})]})}function f({services:e,connections:i,selectedService:l,onServiceClick:f,onConnectionClick:p,onRefresh:m,showMetrics:h=!0,className:g}){let[_,v]=a.useState(1),y=a.useRef(null),b=a.useMemo(()=>{let t={},n=2*Math.PI/e.length;return e.forEach((e,r)=>{let i=r*n-Math.PI/2;t[e.id]={x:300+140*Math.cos(i),y:200+140*Math.sin(i)}}),t},[e]),x=a.useMemo(()=>e.reduce((e,t)=>(e[t.health]=(e[t.health]||0)+1,e),{}),[e]);return(0,s.jsxs)(`div`,{className:t.cn(`flex flex-col border rounded-lg bg-background`,g),children:[(0,s.jsxs)(`div`,{className:`flex items-center justify-between gap-4 p-3 border-b`,children:[(0,s.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,s.jsx)(o.Network,{className:`h-5 w-5`}),(0,s.jsx)(`h3`,{className:`font-semibold`,children:`Service Mesh`}),(0,s.jsxs)(n.Badge,{variant:`secondary`,children:[e.length,` services`]}),(0,s.jsxs)(`div`,{className:`hidden md:flex items-center gap-1`,children:[x.healthy>0&&(0,s.jsxs)(n.Badge,{className:`bg-green-500 text-xs`,children:[x.healthy,` healthy`]}),x.degraded>0&&(0,s.jsxs)(n.Badge,{className:`bg-yellow-500 text-xs`,children:[x.degraded,` degraded`]}),x.unhealthy>0&&(0,s.jsxs)(n.Badge,{className:`bg-red-500 text-xs`,children:[x.unhealthy,` unhealthy`]})]})]}),(0,s.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,s.jsx)(r.Button,{variant:`ghost`,size:`sm`,onClick:()=>v(e=>Math.max(.5,e-.1)),children:(0,s.jsx)(o.ZoomOut,{className:`h-4 w-4`})}),(0,s.jsxs)(`span`,{className:`text-xs text-muted-foreground w-12 text-center`,children:[(_*100).toFixed(0),`%`]}),(0,s.jsx)(r.Button,{variant:`ghost`,size:`sm`,onClick:()=>v(e=>Math.min(2,e+.1)),children:(0,s.jsx)(o.ZoomIn,{className:`h-4 w-4`})}),(0,s.jsx)(r.Button,{variant:`ghost`,size:`sm`,onClick:()=>v(1),children:(0,s.jsx)(o.Maximize2,{className:`h-4 w-4`})}),m&&(0,s.jsx)(r.Button,{variant:`ghost`,size:`sm`,onClick:m,children:(0,s.jsx)(o.RefreshCw,{className:`h-4 w-4`})})]})]}),(0,s.jsx)(`div`,{className:`flex items-center gap-4 px-3 py-2 border-b bg-muted/30 text-xs flex-wrap`,children:Object.entries(c).map(([e,n])=>(n.icon,(0,s.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,s.jsx)(`div`,{className:t.cn(`w-3 h-3 rounded`,n.color)}),(0,s.jsx)(`span`,{className:`capitalize`,children:e})]},e)))}),(0,s.jsx)(`div`,{ref:y,className:`flex-1 relative overflow-hidden min-h-[400px]`,style:{cursor:`grab`},children:(0,s.jsxs)(`div`,{className:`absolute inset-0 transition-transform duration-200`,style:{transform:`scale(${_})`,transformOrigin:`center center`},children:[(0,s.jsxs)(`svg`,{className:`absolute inset-0 w-full h-full pointer-events-none`,"aria-hidden":`true`,focusable:`false`,children:[(0,s.jsx)(`defs`,{children:(0,s.jsx)(`marker`,{id:`arrowhead`,markerWidth:`10`,markerHeight:`7`,refX:`9`,refY:`3.5`,orient:`auto`,children:(0,s.jsx)(`polygon`,{points:`0 0, 10 3.5, 0 7`,fill:`#6b7280`})})}),i.map((e,t)=>{let n=b[e.source],r=b[e.target];return!n||!r?null:(0,s.jsx)(d,{start:n,end:r,connection:e,onClick:()=>p?.(e)},t)})]}),e.map(e=>(0,s.jsx)(u,{service:e,isSelected:l===e.id,onClick:()=>f?.(e),showMetrics:h,position:b[e.id]},e.id))]})})]})}var p=[{id:`gateway`,name:`API Gateway`,type:`gateway`,health:`healthy`,namespace:`ingress`,version:`v2.1.0`,replicas:3,requestsPerSec:1250,errorRate:.001},{id:`auth`,name:`Auth Service`,type:`api`,health:`healthy`,namespace:`auth`,version:`v1.5.2`,replicas:2,requestsPerSec:450,errorRate:.002},{id:`users`,name:`User Service`,type:`api`,health:`healthy`,namespace:`users`,version:`v3.0.1`,replicas:3,requestsPerSec:320,errorRate:.001},{id:`orders`,name:`Order Service`,type:`api`,health:`degraded`,namespace:`commerce`,version:`v2.8.0`,replicas:4,requestsPerSec:180,errorRate:.05},{id:`postgres`,name:`PostgreSQL`,type:`database`,health:`healthy`,version:`15.2`,replicas:1},{id:`redis`,name:`Redis Cache`,type:`cache`,health:`healthy`,version:`7.0`,replicas:3},{id:`rabbitmq`,name:`RabbitMQ`,type:`queue`,health:`healthy`,version:`3.12`,replicas:3},{id:`stripe`,name:`Stripe API`,type:`external`,health:`healthy`}],m=[{source:`gateway`,target:`auth`,protocol:`gRPC`,requestsPerSec:450,errorRate:.001},{source:`gateway`,target:`users`,protocol:`gRPC`,requestsPerSec:320,errorRate:.001},{source:`gateway`,target:`orders`,protocol:`gRPC`,requestsPerSec:180,errorRate:.03},{source:`auth`,target:`postgres`,protocol:`PostgreSQL`,requestsPerSec:200},{source:`auth`,target:`redis`,protocol:`Redis`,requestsPerSec:800},{source:`users`,target:`postgres`,protocol:`PostgreSQL`,requestsPerSec:150},{source:`orders`,target:`postgres`,protocol:`PostgreSQL`,requestsPerSec:100},{source:`orders`,target:`rabbitmq`,protocol:`AMQP`,requestsPerSec:50},{source:`orders`,target:`stripe`,protocol:`HTTPS`,requestsPerSec:30}];exports.WakaServiceGraph=f,exports.defaultConnections=m,exports.defaultServices=p;
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js"),n=require("../badge/index.cjs.js"),r=require("../button/index.cjs.js"),i=require("../tooltip/index.cjs.js");let a=require("react");a=e.__toESM(a);let o=require("lucide-react"),s=require("react/jsx-runtime");var c={api:{icon:o.Server,color:`bg-blue-500`},database:{icon:o.Database,color:`bg-purple-500`},cache:{icon:o.Zap,color:`bg-yellow-500`},queue:{icon:o.MessageSquare,color:`bg-orange-500`},gateway:{icon:o.Globe,color:`bg-green-500`},external:{icon:o.Network,color:`bg-gray-500`}},l={healthy:{color:`text-green-500`,borderColor:`border-green-500`,icon:o.CheckCircle2},degraded:{color:`text-yellow-500`,borderColor:`border-yellow-500`,icon:o.AlertTriangle},unhealthy:{color:`text-red-500`,borderColor:`border-red-500`,icon:o.XCircle},unknown:{color:`text-gray-500`,borderColor:`border-gray-500`,icon:o.AlertTriangle}};function u({service:e,isSelected:n,onClick:r,showMetrics:a,position:o}){let u=c[e.type],d=l[e.health],f=u.icon,p=d.icon;return(0,s.jsx)(i.TooltipProvider,{children:(0,s.jsxs)(i.Tooltip,{children:[(0,s.jsx)(i.TooltipTrigger,{asChild:!0,children:(0,s.jsx)(`div`,{className:t.cn(`absolute transform -translate-x-1/2 -translate-y-1/2 cursor-pointer`,`transition-all duration-200 hover:scale-110`),style:{left:o.x,top:o.y},onClick:r,children:(0,s.jsxs)(`div`,{className:t.cn(`relative bg-background border-2 rounded-xl p-3 shadow-lg`,d.borderColor,n&&`ring-2 ring-primary ring-offset-2`),children:[(0,s.jsx)(`div`,{className:t.cn(`absolute -top-2 -right-2`,d.color),children:(0,s.jsx)(p,{className:`h-4 w-4`})}),(0,s.jsx)(`div`,{className:t.cn(`w-10 h-10 rounded-lg flex items-center justify-center text-white`,u.color),children:(0,s.jsx)(f,{className:`h-5 w-5`})}),(0,s.jsxs)(`div`,{className:`mt-2 text-center`,children:[(0,s.jsx)(`div`,{className:`font-medium text-sm truncate max-w-[100px]`,children:e.name}),e.namespace&&(0,s.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e.namespace})]}),a&&(0,s.jsxs)(`div`,{className:`mt-2 text-xs text-center space-y-0.5`,children:[e.requestsPerSec!==void 0&&(0,s.jsxs)(`div`,{className:`text-muted-foreground`,children:[e.requestsPerSec,` req/s`]}),e.errorRate!==void 0&&e.errorRate>0&&(0,s.jsxs)(`div`,{className:`text-red-500`,children:[(e.errorRate*100).toFixed(1),`% errors`]})]})]})})}),(0,s.jsx)(i.TooltipContent,{side:`right`,className:`max-w-xs`,children:(0,s.jsxs)(`div`,{className:`space-y-2`,children:[(0,s.jsx)(`div`,{className:`font-semibold`,children:e.name}),(0,s.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-4 gap-y-1 text-xs`,children:[(0,s.jsx)(`span`,{className:`text-muted-foreground`,children:`Type:`}),(0,s.jsx)(`span`,{className:`capitalize`,children:e.type}),(0,s.jsx)(`span`,{className:`text-muted-foreground`,children:`Health:`}),(0,s.jsx)(`span`,{className:d.color,children:e.health}),e.version&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`span`,{className:`text-muted-foreground`,children:`Version:`}),(0,s.jsx)(`span`,{children:e.version})]}),e.replicas!==void 0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`span`,{className:`text-muted-foreground`,children:`Replicas:`}),(0,s.jsx)(`span`,{children:e.replicas})]}),e.latencyP50!==void 0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`span`,{className:`text-muted-foreground`,children:`Latency P50:`}),(0,s.jsxs)(`span`,{children:[e.latencyP50,`ms`]})]}),e.latencyP99!==void 0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`span`,{className:`text-muted-foreground`,children:`Latency P99:`}),(0,s.jsxs)(`span`,{children:[e.latencyP99,`ms`]})]})]})]})})]})})}function d({start:e,end:t,connection:n,onClick:r}){let i=(e.x+t.x)/2,a=(e.y+t.y)/2,o=t.x-e.x,c=t.y-e.y,l=Math.sqrt(o*o+c*c),u=.2,d=-c/l*u*l,f=o/l*u*l,p=i+d,m=a+f,h=`M ${e.x} ${e.y} Q ${p} ${m} ${t.x} ${t.y}`,g=n.errorRate||0;return(0,s.jsxs)(`g`,{className:`cursor-pointer hover:opacity-70`,onClick:r,children:[(0,s.jsx)(`path`,{d:h,fill:`none`,stroke:g>.05?`#ef4444`:g>.01?`#eab308`:`#6b7280`,strokeWidth:Math.min(Math.max((n.requestsPerSec||1)/100,1),4),strokeOpacity:.6,markerEnd:`url(#arrowhead)`}),n.requestsPerSec!==void 0&&(0,s.jsxs)(`text`,{x:p,y:m,textAnchor:`middle`,dy:-8,className:`fill-muted-foreground text-xs`,children:[n.requestsPerSec,` req/s`]})]})}function f({services:e,connections:i,selectedService:l,onServiceClick:f,onConnectionClick:p,onRefresh:m,showMetrics:h=!0,className:g}){let[_,v]=a.useState(1),y=a.useRef(null),b=a.useMemo(()=>{let t={},n=2*Math.PI/e.length;return e.forEach((e,r)=>{let i=r*n-Math.PI/2;t[e.id]={x:300+140*Math.cos(i),y:200+140*Math.sin(i)}}),t},[e]),x=a.useMemo(()=>e.reduce((e,t)=>(e[t.health]=(e[t.health]||0)+1,e),{}),[e]);return(0,s.jsxs)(`div`,{className:t.cn(`flex flex-col border rounded-lg bg-background`,g),children:[(0,s.jsxs)(`div`,{className:`flex items-center justify-between gap-4 p-3 border-b`,children:[(0,s.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,s.jsx)(o.Network,{className:`h-5 w-5`}),(0,s.jsx)(`h3`,{className:`font-semibold`,children:`Service Mesh`}),(0,s.jsxs)(n.Badge,{variant:`secondary`,children:[e.length,` services`]}),(0,s.jsxs)(`div`,{className:`hidden md:flex items-center gap-1`,children:[x.healthy>0&&(0,s.jsxs)(n.Badge,{className:`bg-green-500 text-xs`,children:[x.healthy,` healthy`]}),x.degraded>0&&(0,s.jsxs)(n.Badge,{className:`bg-yellow-500 text-xs`,children:[x.degraded,` degraded`]}),x.unhealthy>0&&(0,s.jsxs)(n.Badge,{className:`bg-red-500 text-xs`,children:[x.unhealthy,` unhealthy`]})]})]}),(0,s.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,s.jsx)(r.Button,{variant:`ghost`,size:`sm`,onClick:()=>v(e=>Math.max(.5,e-.1)),children:(0,s.jsx)(o.ZoomOut,{className:`h-4 w-4`})}),(0,s.jsxs)(`span`,{className:`text-xs text-muted-foreground w-12 text-center`,children:[(_*100).toFixed(0),`%`]}),(0,s.jsx)(r.Button,{variant:`ghost`,size:`sm`,onClick:()=>v(e=>Math.min(2,e+.1)),children:(0,s.jsx)(o.ZoomIn,{className:`h-4 w-4`})}),(0,s.jsx)(r.Button,{variant:`ghost`,size:`sm`,onClick:()=>v(1),children:(0,s.jsx)(o.Maximize2,{className:`h-4 w-4`})}),m&&(0,s.jsx)(r.Button,{variant:`ghost`,size:`sm`,onClick:m,children:(0,s.jsx)(o.RefreshCw,{className:`h-4 w-4`})})]})]}),(0,s.jsx)(`div`,{className:`flex items-center gap-4 px-3 py-2 border-b bg-muted/30 text-xs flex-wrap`,children:Object.entries(c).map(([e,n])=>(n.icon,(0,s.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,s.jsx)(`div`,{className:t.cn(`w-3 h-3 rounded`,n.color)}),(0,s.jsx)(`span`,{className:`capitalize`,children:e})]},e)))}),(0,s.jsx)(`div`,{ref:y,className:`flex-1 relative overflow-hidden min-h-[400px]`,style:{cursor:`grab`},children:(0,s.jsxs)(`div`,{className:`absolute inset-0 transition-transform duration-200`,style:{transform:`scale(${_})`,transformOrigin:`center center`},children:[(0,s.jsxs)(`svg`,{className:`absolute inset-0 w-full h-full pointer-events-none`,"aria-hidden":`true`,focusable:`false`,children:[(0,s.jsx)(`defs`,{children:(0,s.jsx)(`marker`,{id:`arrowhead`,markerWidth:`10`,markerHeight:`7`,refX:`9`,refY:`3.5`,orient:`auto`,children:(0,s.jsx)(`polygon`,{points:`0 0, 10 3.5, 0 7`,fill:`#6b7280`})})}),i.map((e,t)=>{let n=b[e.source],r=b[e.target];return!n||!r?null:(0,s.jsx)(d,{start:n,end:r,connection:e,onClick:()=>p?.(e)},t)})]}),e.map(e=>(0,s.jsx)(u,{service:e,isSelected:l===e.id,onClick:()=>f?.(e),showMetrics:h,position:b[e.id]},e.id))]})})]})}var p=[{id:`gateway`,name:`API Gateway`,type:`gateway`,health:`healthy`,namespace:`ingress`,version:`v2.1.0`,replicas:3,requestsPerSec:1250,errorRate:.001},{id:`auth`,name:`Auth Service`,type:`api`,health:`healthy`,namespace:`auth`,version:`v1.5.2`,replicas:2,requestsPerSec:450,errorRate:.002},{id:`users`,name:`User Service`,type:`api`,health:`healthy`,namespace:`users`,version:`v3.0.1`,replicas:3,requestsPerSec:320,errorRate:.001},{id:`orders`,name:`Order Service`,type:`api`,health:`degraded`,namespace:`commerce`,version:`v2.8.0`,replicas:4,requestsPerSec:180,errorRate:.05},{id:`postgres`,name:`PostgreSQL`,type:`database`,health:`healthy`,version:`15.2`,replicas:1},{id:`redis`,name:`Redis Cache`,type:`cache`,health:`healthy`,version:`7.0`,replicas:3},{id:`rabbitmq`,name:`RabbitMQ`,type:`queue`,health:`healthy`,version:`3.12`,replicas:3},{id:`stripe`,name:`Stripe API`,type:`external`,health:`healthy`}],m=[{source:`gateway`,target:`auth`,protocol:`gRPC`,requestsPerSec:450,errorRate:.001},{source:`gateway`,target:`users`,protocol:`gRPC`,requestsPerSec:320,errorRate:.001},{source:`gateway`,target:`orders`,protocol:`gRPC`,requestsPerSec:180,errorRate:.03},{source:`auth`,target:`postgres`,protocol:`PostgreSQL`,requestsPerSec:200},{source:`auth`,target:`redis`,protocol:`Redis`,requestsPerSec:800},{source:`users`,target:`postgres`,protocol:`PostgreSQL`,requestsPerSec:150},{source:`orders`,target:`postgres`,protocol:`PostgreSQL`,requestsPerSec:100},{source:`orders`,target:`rabbitmq`,protocol:`AMQP`,requestsPerSec:50},{source:`orders`,target:`stripe`,protocol:`HTTPS`,requestsPerSec:30}];exports.WakaServiceGraph=f,exports.defaultConnections=m,exports.defaultServices=p;
@@ -1 +1 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`);let n=require(`react`);n=e.__toESM(n);let r=require(`lucide-react`),i=require(`react/jsx-runtime`);var a={desktop:r.Monitor,mobile:r.Smartphone,tablet:r.Tablet,unknown:r.Globe},o={desktop:`Desktop`,mobile:`Mobile`,tablet:`Tablet`,unknown:`Unknown Device`};function s(e){let t=new Date().getTime()-e.getTime(),n=Math.floor(t/1e3),r=Math.floor(n/60),i=Math.floor(r/60),a=Math.floor(i/24);return n<60?`Just now`:r<60?`${r} minute${r===1?``:`s`} ago`:i<24?`${i} hour${i===1?``:`s`} ago`:a<7?`${a} day${a===1?``:`s`} ago`:e.toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:a>365?`numeric`:void 0})}function c(e){return e.toLocaleString(void 0,{month:`short`,day:`numeric`,year:`numeric`,hour:`2-digit`,minute:`2-digit`})}function l(e){if(!e)return null;let t=[e.city,e.region,e.country].filter(Boolean);return t.length>0?t.join(`, `):null}function u(e){let t=[];return e.browser&&t.push(e.browserVersion?`${e.browser} ${e.browserVersion}`:e.browser),e.os&&t.push(e.osVersion?`${e.os} ${e.osVersion}`:e.os),t.length>0?t.join(` on `):o[e.type]}function d({isOpen:e,onClose:n,onConfirm:a,title:o,description:s,isLoading:c=!1,variant:l=`danger`}){return e?(0,i.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center`,children:[(0,i.jsx)(`div`,{className:`absolute inset-0 bg-black/60 backdrop-blur-sm animate-in fade-in duration-200`,onClick:n}),(0,i.jsxs)(`div`,{className:`relative z-10 w-full max-w-md mx-4 bg-background rounded-lg shadow-xl border animate-in zoom-in-95 fade-in duration-200`,children:[(0,i.jsxs)(`div`,{className:`p-6`,children:[(0,i.jsx)(`div`,{className:t.cn(`mx-auto mb-4 h-12 w-12 rounded-full flex items-center justify-center`,l===`danger`?`bg-destructive/10`:`bg-yellow-500/10`),children:(0,i.jsx)(r.AlertTriangle,{className:t.cn(`h-6 w-6`,l===`danger`?`text-destructive`:`text-yellow-500`)})}),(0,i.jsx)(`h3`,{className:`text-lg font-semibold text-center mb-2`,children:o}),(0,i.jsx)(`p`,{className:`text-sm text-muted-foreground text-center mb-6`,children:s}),(0,i.jsxs)(`div`,{className:`flex gap-3`,children:[(0,i.jsx)(`button`,{type:`button`,onClick:n,disabled:c,className:t.cn(`flex-1 px-4 py-2 rounded-md border font-medium text-sm`,`bg-background hover:bg-muted transition-colors`,`disabled:opacity-50 disabled:cursor-not-allowed`),children:`Cancel`}),(0,i.jsx)(`button`,{type:`button`,onClick:a,disabled:c,className:t.cn(`flex-1 px-4 py-2 rounded-md font-medium text-sm`,`transition-colors flex items-center justify-center gap-2`,`disabled:opacity-50 disabled:cursor-not-allowed`,l===`danger`?`bg-destructive text-destructive-foreground hover:bg-destructive/90`:`bg-yellow-500 text-white hover:bg-yellow-600`),children:c?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Loader2,{className:`h-4 w-4 animate-spin`}),(0,i.jsx)(`span`,{children:`Revoking...`})]}):`Confirm`})]})]}),(0,i.jsx)(`button`,{type:`button`,onClick:n,className:`absolute top-4 right-4 p-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors`,children:(0,i.jsx)(r.X,{className:`h-4 w-4`})})]})]}):null}function f({session:e,showIpAddress:n,timeFormat:d,onRevoke:f,isRevoking:p,expanded:m,onToggleExpand:h}){let g=a[e.device.type],_=l(e.location),v=u(e.device),y=d===`relative`?s(e.lastActive):c(e.lastActive);return(0,i.jsx)(`div`,{className:t.cn(`group relative rounded-lg border p-4 transition-all duration-200`,e.isCurrent?`bg-primary/5 border-primary/30 ring-1 ring-primary/20`:`bg-card hover:bg-accent/50 hover:border-accent`,p&&`opacity-50 pointer-events-none`),children:(0,i.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,i.jsx)(`div`,{className:t.cn(`flex-shrink-0 h-10 w-10 rounded-lg flex items-center justify-center`,e.isCurrent?`bg-primary/10 text-primary`:`bg-muted text-muted-foreground`),children:(0,i.jsx)(g,{className:`h-5 w-5`})}),(0,i.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,i.jsx)(`span`,{className:`font-medium text-sm truncate`,children:e.device.name||o[e.device.type]}),e.status&&(0,i.jsx)(`span`,{className:t.cn(`h-2 w-2 rounded-full flex-shrink-0`,{active:`bg-green-500`,idle:`bg-yellow-500`,expired:`bg-red-500`}[e.status]),title:`Status: ${e.status}`}),e.isCurrent&&(0,i.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium bg-primary/10 text-primary`,children:[(0,i.jsx)(r.ShieldCheck,{className:`h-3 w-3`}),`Current`]})]}),(0,i.jsx)(`p`,{className:`text-sm text-muted-foreground truncate mb-2`,children:v}),(0,i.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:[(0,i.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,i.jsx)(r.Clock,{className:`h-3 w-3`}),y]}),_&&(0,i.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,i.jsx)(r.MapPin,{className:`h-3 w-3`}),_]})]}),m&&(0,i.jsxs)(`div`,{className:`mt-3 pt-3 border-t border-dashed space-y-2 text-xs animate-in slide-in-from-top-2 duration-200`,children:[n&&e.ipAddress&&(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,i.jsx)(r.Globe,{className:`h-3 w-3 text-muted-foreground`}),(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:`IP Address:`}),(0,i.jsx)(`code`,{className:`px-1.5 py-0.5 bg-muted rounded font-mono`,children:e.ipAddress})]}),e.createdAt&&(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,i.jsx)(r.Shield,{className:`h-3 w-3 text-muted-foreground`}),(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:`Session started:`}),(0,i.jsx)(`span`,{children:c(e.createdAt)})]}),e.device.browser&&(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,i.jsx)(r.Globe,{className:`h-3 w-3 text-muted-foreground`}),(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:`Browser:`}),(0,i.jsxs)(`span`,{children:[e.device.browser,e.device.browserVersion&&` v${e.device.browserVersion}`]})]}),e.device.os&&(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,i.jsx)(r.Monitor,{className:`h-3 w-3 text-muted-foreground`}),(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:`OS:`}),(0,i.jsxs)(`span`,{children:[e.device.os,e.device.osVersion&&` ${e.device.osVersion}`]})]})]})]}),(0,i.jsxs)(`div`,{className:`flex items-center gap-2 flex-shrink-0`,children:[(0,i.jsx)(`button`,{type:`button`,onClick:h,className:t.cn(`p-2 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors`,`opacity-0 group-hover:opacity-100 focus:opacity-100`),title:m?`Show less`:`Show more`,children:m?(0,i.jsx)(r.ChevronUp,{className:`h-4 w-4`}):(0,i.jsx)(r.ChevronDown,{className:`h-4 w-4`})}),!e.isCurrent&&(0,i.jsx)(`button`,{type:`button`,onClick:()=>f(e.id),disabled:p,className:t.cn(`p-2 rounded-md text-muted-foreground transition-colors`,`hover:text-destructive hover:bg-destructive/10`,`disabled:opacity-50 disabled:cursor-not-allowed`),title:`Revoke session`,children:p?(0,i.jsx)(r.Loader2,{className:`h-4 w-4 animate-spin`}):(0,i.jsx)(r.LogOut,{className:`h-4 w-4`})})]})]})})}function p({sessions:e,showIpAddress:a=!1,onRevokeSession:o,onRevokeAllOtherSessions:s,renderConfirmDialog:c,timeFormat:l=`relative`,defaultExpanded:u=!1,className:p,isLoading:m=!1,title:h=`Active Sessions`,description:g}){let[_,v]=n.useState({isOpen:!1}),[y,b]=n.useState(null),[x,S]=n.useState(!1),[C,w]=n.useState(()=>new Set(u?e.map(e=>e.id):[])),T=n.useMemo(()=>[...e].sort((e,t)=>e.isCurrent&&!t.isCurrent?-1:!e.isCurrent&&t.isCurrent?1:t.lastActive.getTime()-e.lastActive.getTime()),[e]),E=e.filter(e=>!e.isCurrent).length,D=e=>{v({isOpen:!0,sessionId:e})},O=()=>{v({isOpen:!0,isRevokeAll:!0})},k=async()=>{if(_.isRevokeAll){S(!0);try{await s?.()}finally{S(!1),v({isOpen:!1})}}else if(_.sessionId){b(_.sessionId);try{await o?.(_.sessionId)}finally{b(null),v({isOpen:!1})}}},A=()=>{!y&&!x&&v({isOpen:!1})},j=e=>{w(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},M={isOpen:_.isOpen,onClose:A,onConfirm:k,title:_.isRevokeAll?`Revoke All Other Sessions`:`Revoke Session`,description:_.isRevokeAll?`This will sign out all ${E} other session${E===1?``:`s`}. You will remain signed in on this device.`:`This will sign out the selected session. The device will need to sign in again to access the account.`,isLoading:y!==null||x,variant:_.isRevokeAll?`danger`:`warning`};return(0,i.jsxs)(`div`,{className:t.cn(`space-y-4`,p),children:[(0,i.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,i.jsxs)(`div`,{children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,i.jsx)(r.Shield,{className:`h-5 w-5 text-muted-foreground`}),(0,i.jsx)(`h3`,{className:`text-lg font-semibold`,children:h})]}),g&&(0,i.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:g})]}),E>0&&s&&(0,i.jsxs)(`button`,{type:`button`,onClick:O,disabled:m||x,className:t.cn(`inline-flex items-center gap-2 px-3 py-1.5 rounded-md text-sm font-medium`,`border border-destructive/30 text-destructive`,`hover:bg-destructive/10 transition-colors`,`disabled:opacity-50 disabled:cursor-not-allowed`),children:[(0,i.jsx)(r.LogOut,{className:`h-4 w-4`}),(0,i.jsx)(`span`,{className:`hidden sm:inline`,children:`Sign out all other sessions`}),(0,i.jsx)(`span`,{className:`sm:hidden`,children:`Sign out all`})]})]}),m?(0,i.jsx)(`div`,{className:`space-y-3`,children:[1,2,3].map(e=>(0,i.jsx)(`div`,{className:`h-24 rounded-lg border bg-muted/50 animate-pulse`},e))}):e.length===0?(0,i.jsxs)(`div`,{className:`text-center py-12 text-muted-foreground`,children:[(0,i.jsx)(r.Shield,{className:`h-12 w-12 mx-auto mb-4 opacity-50`}),(0,i.jsx)(`p`,{children:`No active sessions found`})]}):(0,i.jsx)(`div`,{className:`space-y-3`,children:T.map(e=>(0,i.jsx)(f,{session:e,showIpAddress:a,timeFormat:l,onRevoke:D,isRevoking:y===e.id,expanded:C.has(e.id),onToggleExpand:()=>j(e.id)},e.id))}),!m&&e.length>0&&(0,i.jsxs)(`p`,{className:`text-xs text-muted-foreground text-center`,children:[e.length,` active session`,e.length===1?``:`s`,E>0&&` (${E} on other devices)`]}),c?c(M):(0,i.jsx)(d,{...M})]})}function m({initialSessions:e=[],currentSessionId:t,fetchSessions:r,revokeSession:i,revokeAllOtherSessions:a,autoRefreshInterval:o}={}){let[s,c]=n.useState(()=>e.map(e=>({...e,isCurrent:e.isCurrent??e.id===t}))),[l,u]=n.useState(!1),[d,f]=n.useState(null),p=n.useCallback(async()=>{if(r){u(!0),f(null);try{c((await r()).map(e=>({...e,isCurrent:e.isCurrent??e.id===t})))}catch(e){f(e instanceof Error?e:Error(`Failed to fetch sessions`))}finally{u(!1)}}},[r,t]),m=n.useCallback(async e=>{if(i)try{await i(e),c(t=>t.filter(t=>t.id!==e))}catch(e){throw f(e instanceof Error?e:Error(`Failed to revoke session`)),e}},[i]),h=n.useCallback(async()=>{if(a)try{await a(),c(e=>e.filter(e=>e.isCurrent))}catch(e){throw f(e instanceof Error?e:Error(`Failed to revoke sessions`)),e}},[a]);n.useEffect(()=>{if(!o||!r)return;let e=setInterval(p,o);return()=>clearInterval(e)},[o,p,r]),n.useEffect(()=>{r&&e.length===0&&p()},[]);let g=n.useMemo(()=>s.find(e=>e.isCurrent),[s]),_=n.useMemo(()=>s.filter(e=>!e.isCurrent),[s]);return{sessions:s,isLoading:l,error:d,refresh:p,onRevokeSession:m,onRevokeAllOtherSessions:h,currentSession:g,otherSessions:_,sessionsByDevice:n.useMemo(()=>{let e={desktop:[],mobile:[],tablet:[],unknown:[]};return s.forEach(t=>{e[t.device.type].push(t)}),e},[s]),totalSessions:s.length,otherSessionsCount:_.length}}exports.DefaultConfirmDialog=d,exports.SessionCard=f,exports.default=p,exports.useSessionManager=m;
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js");let n=require("react");n=e.__toESM(n);let r=require("lucide-react"),i=require("react/jsx-runtime");var a={desktop:r.Monitor,mobile:r.Smartphone,tablet:r.Tablet,unknown:r.Globe},o={desktop:`Desktop`,mobile:`Mobile`,tablet:`Tablet`,unknown:`Unknown Device`};function s(e){let t=new Date().getTime()-e.getTime(),n=Math.floor(t/1e3),r=Math.floor(n/60),i=Math.floor(r/60),a=Math.floor(i/24);return n<60?`Just now`:r<60?`${r} minute${r===1?``:`s`} ago`:i<24?`${i} hour${i===1?``:`s`} ago`:a<7?`${a} day${a===1?``:`s`} ago`:e.toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:a>365?`numeric`:void 0})}function c(e){return e.toLocaleString(void 0,{month:`short`,day:`numeric`,year:`numeric`,hour:`2-digit`,minute:`2-digit`})}function l(e){if(!e)return null;let t=[e.city,e.region,e.country].filter(Boolean);return t.length>0?t.join(`, `):null}function u(e){let t=[];return e.browser&&t.push(e.browserVersion?`${e.browser} ${e.browserVersion}`:e.browser),e.os&&t.push(e.osVersion?`${e.os} ${e.osVersion}`:e.os),t.length>0?t.join(` on `):o[e.type]}function d({isOpen:e,onClose:n,onConfirm:a,title:o,description:s,isLoading:c=!1,variant:l=`danger`}){return e?(0,i.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center`,children:[(0,i.jsx)(`div`,{className:`absolute inset-0 bg-black/60 backdrop-blur-sm animate-in fade-in duration-200`,onClick:n}),(0,i.jsxs)(`div`,{className:`relative z-10 w-full max-w-md mx-4 bg-background rounded-lg shadow-xl border animate-in zoom-in-95 fade-in duration-200`,children:[(0,i.jsxs)(`div`,{className:`p-6`,children:[(0,i.jsx)(`div`,{className:t.cn(`mx-auto mb-4 h-12 w-12 rounded-full flex items-center justify-center`,l===`danger`?`bg-destructive/10`:`bg-yellow-500/10`),children:(0,i.jsx)(r.AlertTriangle,{className:t.cn(`h-6 w-6`,l===`danger`?`text-destructive`:`text-yellow-500`)})}),(0,i.jsx)(`h3`,{className:`text-lg font-semibold text-center mb-2`,children:o}),(0,i.jsx)(`p`,{className:`text-sm text-muted-foreground text-center mb-6`,children:s}),(0,i.jsxs)(`div`,{className:`flex gap-3`,children:[(0,i.jsx)(`button`,{type:`button`,onClick:n,disabled:c,className:t.cn(`flex-1 px-4 py-2 rounded-md border font-medium text-sm`,`bg-background hover:bg-muted transition-colors`,`disabled:opacity-50 disabled:cursor-not-allowed`),children:`Cancel`}),(0,i.jsx)(`button`,{type:`button`,onClick:a,disabled:c,className:t.cn(`flex-1 px-4 py-2 rounded-md font-medium text-sm`,`transition-colors flex items-center justify-center gap-2`,`disabled:opacity-50 disabled:cursor-not-allowed`,l===`danger`?`bg-destructive text-destructive-foreground hover:bg-destructive/90`:`bg-yellow-500 text-white hover:bg-yellow-600`),children:c?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Loader2,{className:`h-4 w-4 animate-spin`}),(0,i.jsx)(`span`,{children:`Revoking...`})]}):`Confirm`})]})]}),(0,i.jsx)(`button`,{type:`button`,onClick:n,className:`absolute top-4 right-4 p-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors`,children:(0,i.jsx)(r.X,{className:`h-4 w-4`})})]})]}):null}function f({session:e,showIpAddress:n,timeFormat:d,onRevoke:f,isRevoking:p,expanded:m,onToggleExpand:h}){let g=a[e.device.type],_=l(e.location),v=u(e.device),y=d===`relative`?s(e.lastActive):c(e.lastActive);return(0,i.jsx)(`div`,{className:t.cn(`group relative rounded-lg border p-4 transition-all duration-200`,e.isCurrent?`bg-primary/5 border-primary/30 ring-1 ring-primary/20`:`bg-card hover:bg-accent/50 hover:border-accent`,p&&`opacity-50 pointer-events-none`),children:(0,i.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,i.jsx)(`div`,{className:t.cn(`flex-shrink-0 h-10 w-10 rounded-lg flex items-center justify-center`,e.isCurrent?`bg-primary/10 text-primary`:`bg-muted text-muted-foreground`),children:(0,i.jsx)(g,{className:`h-5 w-5`})}),(0,i.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,i.jsx)(`span`,{className:`font-medium text-sm truncate`,children:e.device.name||o[e.device.type]}),e.status&&(0,i.jsx)(`span`,{className:t.cn(`h-2 w-2 rounded-full flex-shrink-0`,{active:`bg-green-500`,idle:`bg-yellow-500`,expired:`bg-red-500`}[e.status]),title:`Status: ${e.status}`}),e.isCurrent&&(0,i.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium bg-primary/10 text-primary`,children:[(0,i.jsx)(r.ShieldCheck,{className:`h-3 w-3`}),`Current`]})]}),(0,i.jsx)(`p`,{className:`text-sm text-muted-foreground truncate mb-2`,children:v}),(0,i.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground`,children:[(0,i.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,i.jsx)(r.Clock,{className:`h-3 w-3`}),y]}),_&&(0,i.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,i.jsx)(r.MapPin,{className:`h-3 w-3`}),_]})]}),m&&(0,i.jsxs)(`div`,{className:`mt-3 pt-3 border-t border-dashed space-y-2 text-xs animate-in slide-in-from-top-2 duration-200`,children:[n&&e.ipAddress&&(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,i.jsx)(r.Globe,{className:`h-3 w-3 text-muted-foreground`}),(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:`IP Address:`}),(0,i.jsx)(`code`,{className:`px-1.5 py-0.5 bg-muted rounded font-mono`,children:e.ipAddress})]}),e.createdAt&&(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,i.jsx)(r.Shield,{className:`h-3 w-3 text-muted-foreground`}),(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:`Session started:`}),(0,i.jsx)(`span`,{children:c(e.createdAt)})]}),e.device.browser&&(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,i.jsx)(r.Globe,{className:`h-3 w-3 text-muted-foreground`}),(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:`Browser:`}),(0,i.jsxs)(`span`,{children:[e.device.browser,e.device.browserVersion&&` v${e.device.browserVersion}`]})]}),e.device.os&&(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,i.jsx)(r.Monitor,{className:`h-3 w-3 text-muted-foreground`}),(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:`OS:`}),(0,i.jsxs)(`span`,{children:[e.device.os,e.device.osVersion&&` ${e.device.osVersion}`]})]})]})]}),(0,i.jsxs)(`div`,{className:`flex items-center gap-2 flex-shrink-0`,children:[(0,i.jsx)(`button`,{type:`button`,onClick:h,className:t.cn(`p-2 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors`,`opacity-0 group-hover:opacity-100 focus:opacity-100`),title:m?`Show less`:`Show more`,children:m?(0,i.jsx)(r.ChevronUp,{className:`h-4 w-4`}):(0,i.jsx)(r.ChevronDown,{className:`h-4 w-4`})}),!e.isCurrent&&(0,i.jsx)(`button`,{type:`button`,onClick:()=>f(e.id),disabled:p,className:t.cn(`p-2 rounded-md text-muted-foreground transition-colors`,`hover:text-destructive hover:bg-destructive/10`,`disabled:opacity-50 disabled:cursor-not-allowed`),title:`Revoke session`,children:p?(0,i.jsx)(r.Loader2,{className:`h-4 w-4 animate-spin`}):(0,i.jsx)(r.LogOut,{className:`h-4 w-4`})})]})]})})}function p({sessions:e,showIpAddress:a=!1,onRevokeSession:o,onRevokeAllOtherSessions:s,renderConfirmDialog:c,timeFormat:l=`relative`,defaultExpanded:u=!1,className:p,isLoading:m=!1,title:h=`Active Sessions`,description:g}){let[_,v]=n.useState({isOpen:!1}),[y,b]=n.useState(null),[x,S]=n.useState(!1),[C,w]=n.useState(()=>new Set(u?e.map(e=>e.id):[])),T=n.useMemo(()=>[...e].sort((e,t)=>e.isCurrent&&!t.isCurrent?-1:!e.isCurrent&&t.isCurrent?1:t.lastActive.getTime()-e.lastActive.getTime()),[e]),E=e.filter(e=>!e.isCurrent).length,D=e=>{v({isOpen:!0,sessionId:e})},O=()=>{v({isOpen:!0,isRevokeAll:!0})},k=async()=>{if(_.isRevokeAll){S(!0);try{await s?.()}finally{S(!1),v({isOpen:!1})}}else if(_.sessionId){b(_.sessionId);try{await o?.(_.sessionId)}finally{b(null),v({isOpen:!1})}}},A=()=>{!y&&!x&&v({isOpen:!1})},j=e=>{w(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},M={isOpen:_.isOpen,onClose:A,onConfirm:k,title:_.isRevokeAll?`Revoke All Other Sessions`:`Revoke Session`,description:_.isRevokeAll?`This will sign out all ${E} other session${E===1?``:`s`}. You will remain signed in on this device.`:`This will sign out the selected session. The device will need to sign in again to access the account.`,isLoading:y!==null||x,variant:_.isRevokeAll?`danger`:`warning`};return(0,i.jsxs)(`div`,{className:t.cn(`space-y-4`,p),children:[(0,i.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,i.jsxs)(`div`,{children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,i.jsx)(r.Shield,{className:`h-5 w-5 text-muted-foreground`}),(0,i.jsx)(`h3`,{className:`text-lg font-semibold`,children:h})]}),g&&(0,i.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:g})]}),E>0&&s&&(0,i.jsxs)(`button`,{type:`button`,onClick:O,disabled:m||x,className:t.cn(`inline-flex items-center gap-2 px-3 py-1.5 rounded-md text-sm font-medium`,`border border-destructive/30 text-destructive`,`hover:bg-destructive/10 transition-colors`,`disabled:opacity-50 disabled:cursor-not-allowed`),children:[(0,i.jsx)(r.LogOut,{className:`h-4 w-4`}),(0,i.jsx)(`span`,{className:`hidden sm:inline`,children:`Sign out all other sessions`}),(0,i.jsx)(`span`,{className:`sm:hidden`,children:`Sign out all`})]})]}),m?(0,i.jsx)(`div`,{className:`space-y-3`,children:[1,2,3].map(e=>(0,i.jsx)(`div`,{className:`h-24 rounded-lg border bg-muted/50 animate-pulse`},e))}):e.length===0?(0,i.jsxs)(`div`,{className:`text-center py-12 text-muted-foreground`,children:[(0,i.jsx)(r.Shield,{className:`h-12 w-12 mx-auto mb-4 opacity-50`}),(0,i.jsx)(`p`,{children:`No active sessions found`})]}):(0,i.jsx)(`div`,{className:`space-y-3`,children:T.map(e=>(0,i.jsx)(f,{session:e,showIpAddress:a,timeFormat:l,onRevoke:D,isRevoking:y===e.id,expanded:C.has(e.id),onToggleExpand:()=>j(e.id)},e.id))}),!m&&e.length>0&&(0,i.jsxs)(`p`,{className:`text-xs text-muted-foreground text-center`,children:[e.length,` active session`,e.length===1?``:`s`,E>0&&` (${E} on other devices)`]}),c?c(M):(0,i.jsx)(d,{...M})]})}function m({initialSessions:e=[],currentSessionId:t,fetchSessions:r,revokeSession:i,revokeAllOtherSessions:a,autoRefreshInterval:o}={}){let[s,c]=n.useState(()=>e.map(e=>({...e,isCurrent:e.isCurrent??e.id===t}))),[l,u]=n.useState(!1),[d,f]=n.useState(null),p=n.useCallback(async()=>{if(r){u(!0),f(null);try{let e=await r();c(e.map(e=>({...e,isCurrent:e.isCurrent??e.id===t})))}catch(e){f(e instanceof Error?e:Error(`Failed to fetch sessions`))}finally{u(!1)}}},[r,t]),m=n.useCallback(async e=>{if(i)try{await i(e),c(t=>t.filter(t=>t.id!==e))}catch(e){throw f(e instanceof Error?e:Error(`Failed to revoke session`)),e}},[i]),h=n.useCallback(async()=>{if(a)try{await a(),c(e=>e.filter(e=>e.isCurrent))}catch(e){throw f(e instanceof Error?e:Error(`Failed to revoke sessions`)),e}},[a]);n.useEffect(()=>{if(!o||!r)return;let e=setInterval(p,o);return()=>clearInterval(e)},[o,p,r]),n.useEffect(()=>{r&&e.length===0&&p()},[]);let g=n.useMemo(()=>s.find(e=>e.isCurrent),[s]),_=n.useMemo(()=>s.filter(e=>!e.isCurrent),[s]);return{sessions:s,isLoading:l,error:d,refresh:p,onRevokeSession:m,onRevokeAllOtherSessions:h,currentSession:g,otherSessions:_,sessionsByDevice:n.useMemo(()=>{let e={desktop:[],mobile:[],tablet:[],unknown:[]};return s.forEach(t=>{e[t.device.type].push(t)}),e},[s]),totalSessions:s.length,otherSessionsCount:_.length}}exports.SessionCard=f,exports.SessionConfirmDialog=d,exports.WakaSessionManager=p,exports.default=p,exports.useSessionManager=m;
@@ -337,7 +337,8 @@ function O({ initialSessions: e = [], currentSessionId: n, fetchSessions: r, rev
337
337
  if (r) {
338
338
  u(!0), f(null);
339
339
  try {
340
- c((await r()).map((e) => ({
340
+ let e = await r();
341
+ c(e.map((e) => ({
341
342
  ...e,
342
343
  isCurrent: e.isCurrent ?? e.id === n
343
344
  })));
@@ -397,4 +398,4 @@ function O({ initialSessions: e = [], currentSessionId: n, fetchSessions: r, rev
397
398
  };
398
399
  }
399
400
  //#endregion
400
- export { T as DefaultConfirmDialog, E as SessionCard, D as default, O as useSessionManager };
401
+ export { E as SessionCard, T as SessionConfirmDialog, D as WakaSessionManager, D as default, O as useSessionManager };
@@ -1 +1 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`);let n=require(`react`);n=e.__toESM(n);let r=require(`lucide-react`),i=require(`react/jsx-runtime`);function a(e={}){let{penColor:t=`#000000`,penSize:r=2,onChange:i}=e,a=n.useRef(null),[o,s]=n.useState([]),[c,l]=n.useState(null),[u,d]=n.useState(!1),[f,p]=n.useState(t),[m,h]=n.useState(r),g=o.length===0&&!c;n.useEffect(()=>{i?.(g)},[g,i]);let _=n.useCallback((e,t)=>{if(t.points.length<2)return;e.beginPath(),e.strokeStyle=t.color,e.lineWidth=t.size,e.lineCap=`round`,e.lineJoin=`round`;let n=t.points;e.moveTo(n[0].x,n[0].y);for(let t=1;t<n.length-1;t++){let r=(n[t].x+n[t+1].x)/2,i=(n[t].y+n[t+1].y)/2;e.quadraticCurveTo(n[t].x,n[t].y,r,i)}if(n.length>1){let t=n[n.length-1];e.lineTo(t.x,t.y)}e.stroke()},[]);n.useCallback(e=>{let t=a.current;if(!t)return;let n=t.getContext(`2d`);n&&(n.clearRect(0,0,t.width,t.height),e&&(n.fillStyle=e,n.fillRect(0,0,t.width,t.height)),o.forEach(e=>_(n,e)),c&&_(n,c))},[o,c,_]);let v=n.useCallback(e=>{d(!0),l({points:[e],color:f,size:m})},[f,m]),y=n.useCallback(e=>{!u||!c||l(t=>t?{...t,points:[...t.points,e]}:null)},[u,c]),b=n.useCallback(()=>{c&&c.points.length>1&&s(e=>[...e,c]),l(null),d(!1)},[c]);return{canvasRef:a,strokes:o,currentStroke:c,isDrawing:u,isEmpty:g,penColor:f,penSize:m,setPenColor:p,setPenSize:h,clear:n.useCallback(()=>{s([]),l(null),d(!1)},[]),undo:n.useCallback(()=>{s(e=>e.slice(0,-1))},[]),toDataURL:n.useCallback((e=`png`,t)=>{let n=a.current;if(!n)return``;if(t){let r=document.createElement(`canvas`);r.width=n.width,r.height=n.height;let i=r.getContext(`2d`);return i?(i.fillStyle=t,i.fillRect(0,0,r.width,r.height),i.drawImage(n,0,0),r.toDataURL(`image/${e}`)):``}return n.toDataURL(`image/${e}`)},[]),toSVG:n.useCallback(e=>{let t=a.current;if(!t)return``;let n=`<svg xmlns="http://www.w3.org/2000/svg" width="${t.width}" height="${t.height}" aria-hidden="true" focusable="false">`;return e&&(n+=`<rect width="100%" height="100%" fill="${e}"/>`),o.forEach(e=>{if(e.points.length<2)return;let t=`M ${e.points[0].x} ${e.points[0].y}`;for(let n=1;n<e.points.length-1;n++){let r=(e.points[n].x+e.points[n+1].x)/2,i=(e.points[n].y+e.points[n+1].y)/2;t+=` Q ${e.points[n].x} ${e.points[n].y} ${r} ${i}`}if(e.points.length>1){let n=e.points[e.points.length-1];t+=` L ${n.x} ${n.y}`}n+=`<path d="${t}" stroke="${e.color}" stroke-width="${e.size}" fill="none" stroke-linecap="round" stroke-linejoin="round"/>`}),n+=`</svg>`,`data:image/svg+xml;base64,${btoa(n)}`},[o]),fromDataURL:n.useCallback(e=>{let t=a.current;if(!t)return;let n=t.getContext(`2d`);if(!n)return;let r=new Image;r.onload=()=>{n.clearRect(0,0,t.width,t.height),n.drawImage(r,0,0),s([{points:[{x:0,y:0},{x:1,y:1}],color:`#000`,size:1}])},r.src=e},[]),fromStrokes:n.useCallback(e=>{s(e)},[]),startDrawing:v,draw:y,stopDrawing:b}}var o=[`#000000`,`#1e40af`,`#dc2626`,`#16a34a`,`#9333ea`],s=[1,2,3,5,8],c=n.forwardRef(({width:e=400,height:c=200,aspectRatio:l,penColor:u=`#000000`,penSize:d=2,backgroundColor:f=`transparent`,showGuideLine:p=!0,guideLineColor:m=`#d1d5db`,placeholder:h=`Sign here`,placeholderColor:g=`#9ca3af`,readOnly:_=!1,initialValue:v,onChange:y,onSave:b,showToolbar:x=!0,penColors:S=o,penSizes:C=s,className:w,canvasClassName:T,toolbarClassName:E,disabled:D=!1},ee)=>{let O=n.useRef(null),[k,A]=n.useState({width:e,height:c}),j=a({penColor:u,penSize:d,onChange:y}),{canvasRef:M,strokes:N,currentStroke:P,isEmpty:F,penColor:I,penSize:L,setPenColor:R,setPenSize:z,clear:B,undo:te,toDataURL:V,toSVG:H,fromDataURL:U,fromStrokes:W,startDrawing:G,draw:K,stopDrawing:q}=j;n.useImperativeHandle(ee,()=>j,[j]),n.useEffect(()=>{if(l&&O.current){let t=O.current.clientWidth||e;A({width:t,height:t/l})}else A({width:e,height:c})},[l,e,c]),n.useEffect(()=>{v&&(typeof v==`string`?U(v):W(v))},[v,U,W]),n.useEffect(()=>{let e=M.current;if(!e)return;let t=e.getContext(`2d`);if(t&&(t.clearRect(0,0,e.width,e.height),f!==`transparent`&&(t.fillStyle=f,t.fillRect(0,0,e.width,e.height)),N.forEach(e=>{if(e.points.length<2)return;t.beginPath(),t.strokeStyle=e.color,t.lineWidth=e.size,t.lineCap=`round`,t.lineJoin=`round`;let n=e.points;t.moveTo(n[0].x,n[0].y);for(let e=1;e<n.length-1;e++){let r=(n[e].x+n[e+1].x)/2,i=(n[e].y+n[e+1].y)/2;t.quadraticCurveTo(n[e].x,n[e].y,r,i)}if(n.length>1){let e=n[n.length-1];t.lineTo(e.x,e.y)}t.stroke()}),P&&P.points.length>=2)){t.beginPath(),t.strokeStyle=P.color,t.lineWidth=P.size,t.lineCap=`round`,t.lineJoin=`round`;let e=P.points;t.moveTo(e[0].x,e[0].y);for(let n=1;n<e.length-1;n++){let r=(e[n].x+e[n+1].x)/2,i=(e[n].y+e[n+1].y)/2;t.quadraticCurveTo(e[n].x,e[n].y,r,i)}if(e.length>1){let n=e[e.length-1];t.lineTo(n.x,n.y)}t.stroke()}},[N,P,f,M]);let J=n.useCallback(e=>{let t=M.current;if(!t)return null;let n=t.getBoundingClientRect(),r=t.width/n.width,i=t.height/n.height;if(`touches`in e){let t=e.touches[0];if(!t)return null;let a=t;return{x:(t.clientX-n.left)*r,y:(t.clientY-n.top)*i,pressure:a.force??.5}}return{x:(e.clientX-n.left)*r,y:(e.clientY-n.top)*i,pressure:.5}},[M]),Y=n.useCallback(e=>{if(_||D)return;e.preventDefault();let t=J(e);t&&G(t)},[_,D,J,G]),X=n.useCallback(e=>{if(_||D)return;e.preventDefault();let t=J(e);t&&K(t)},[_,D,J,K]),Z=n.useCallback(()=>{_||D||q()},[_,D,q]),Q=n.useCallback(e=>{let t=e===`svg`?H(f):V(e,f===`transparent`?void 0:f);b?.(t,e)},[V,H,f,b]),$=_||D;return(0,i.jsxs)(`div`,{ref:O,className:t.cn(`flex flex-col gap-2`,w),children:[(0,i.jsxs)(`div`,{className:t.cn(`relative rounded-lg border bg-background overflow-hidden`,$&&`opacity-50 cursor-not-allowed`,T),style:{width:k.width,height:k.height},children:[p&&(0,i.jsx)(`div`,{className:`absolute left-4 right-4 pointer-events-none`,style:{bottom:`20%`,borderBottom:`1px dashed ${m}`}}),F&&h&&(0,i.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center pointer-events-none`,style:{color:g},children:(0,i.jsx)(`span`,{className:`text-sm`,children:h})}),(0,i.jsx)(`canvas`,{ref:M,width:k.width,height:k.height,className:t.cn(`touch-none`,!$&&`cursor-crosshair`),style:{width:k.width,height:k.height},onMouseDown:Y,onMouseMove:X,onMouseUp:Z,onMouseLeave:Z,onTouchStart:Y,onTouchMove:X,onTouchEnd:Z})]}),x&&!_&&(0,i.jsxs)(`div`,{className:t.cn(`flex items-center justify-between gap-2 flex-wrap`,E),children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,i.jsx)(r.Pen,{className:`h-4 w-4 text-muted-foreground`}),S.map(e=>(0,i.jsx)(`button`,{type:`button`,disabled:D,className:t.cn(`w-6 h-6 rounded-full border-2 transition-transform hover:scale-110`,I===e?`border-primary ring-2 ring-primary/30`:`border-transparent`),style:{backgroundColor:e},onClick:()=>R(e),title:`Color: ${e}`},e))]}),(0,i.jsx)(`div`,{className:`flex items-center gap-1 ml-2`,children:C.map(e=>(0,i.jsx)(`button`,{type:`button`,disabled:D,className:t.cn(`w-7 h-7 rounded flex items-center justify-center border transition-colors`,L===e?`border-primary bg-primary/10`:`border-border hover:bg-muted`),onClick:()=>z(e),title:`Size: ${e}px`,children:(0,i.jsx)(`div`,{className:`rounded-full bg-current`,style:{width:Math.min(e*2,16),height:Math.min(e*2,16)}})},e))})]}),(0,i.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,i.jsx)(`button`,{type:`button`,disabled:D||N.length===0,className:t.cn(`p-2 rounded hover:bg-muted transition-colors`,`disabled:opacity-50 disabled:cursor-not-allowed`),onClick:te,title:`Undo last stroke`,children:(0,i.jsx)(r.Undo,{className:`h-4 w-4`})}),(0,i.jsx)(`button`,{type:`button`,disabled:D||F,className:t.cn(`p-2 rounded hover:bg-muted transition-colors text-destructive`,`disabled:opacity-50 disabled:cursor-not-allowed`),onClick:B,title:`Clear signature`,children:(0,i.jsx)(r.Trash2,{className:`h-4 w-4`})}),(0,i.jsx)(`div`,{className:`w-px h-6 bg-border mx-1`}),(0,i.jsx)(`button`,{type:`button`,disabled:D||F,className:t.cn(`p-2 rounded hover:bg-muted transition-colors`,`disabled:opacity-50 disabled:cursor-not-allowed`),onClick:()=>Q(`png`),title:`Save as PNG`,children:(0,i.jsx)(r.Download,{className:`h-4 w-4`})}),b&&(0,i.jsx)(`button`,{type:`button`,disabled:D||F,className:t.cn(`p-2 rounded hover:bg-muted transition-colors text-primary`,`disabled:opacity-50 disabled:cursor-not-allowed`),onClick:()=>Q(`png`),title:`Confirm signature`,children:(0,i.jsx)(r.Check,{className:`h-4 w-4`})})]})]})]})});c.displayName=`WakaSignaturePad`,exports.default=c,exports.useSignaturePad=a;
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js");let n=require("react");n=e.__toESM(n);let r=require("lucide-react"),i=require("react/jsx-runtime");function a(e={}){let{penColor:t=`#000000`,penSize:r=2,onChange:i}=e,a=n.useRef(null),[o,s]=n.useState([]),[c,l]=n.useState(null),[u,d]=n.useState(!1),[f,p]=n.useState(t),[m,h]=n.useState(r),g=o.length===0&&!c;n.useEffect(()=>{i?.(g)},[g,i]);let _=n.useCallback((e,t)=>{if(t.points.length<2)return;e.beginPath(),e.strokeStyle=t.color,e.lineWidth=t.size,e.lineCap=`round`,e.lineJoin=`round`;let n=t.points;e.moveTo(n[0].x,n[0].y);for(let t=1;t<n.length-1;t++){let r=(n[t].x+n[t+1].x)/2,i=(n[t].y+n[t+1].y)/2;e.quadraticCurveTo(n[t].x,n[t].y,r,i)}if(n.length>1){let t=n[n.length-1];e.lineTo(t.x,t.y)}e.stroke()},[]);n.useCallback(e=>{let t=a.current;if(!t)return;let n=t.getContext(`2d`);n&&(n.clearRect(0,0,t.width,t.height),e&&(n.fillStyle=e,n.fillRect(0,0,t.width,t.height)),o.forEach(e=>_(n,e)),c&&_(n,c))},[o,c,_]);let v=n.useCallback(e=>{d(!0),l({points:[e],color:f,size:m})},[f,m]),y=n.useCallback(e=>{!u||!c||l(t=>t?{...t,points:[...t.points,e]}:null)},[u,c]),b=n.useCallback(()=>{c&&c.points.length>1&&s(e=>[...e,c]),l(null),d(!1)},[c]);return{canvasRef:a,strokes:o,currentStroke:c,isDrawing:u,isEmpty:g,penColor:f,penSize:m,setPenColor:p,setPenSize:h,clear:n.useCallback(()=>{s([]),l(null),d(!1)},[]),undo:n.useCallback(()=>{s(e=>e.slice(0,-1))},[]),toDataURL:n.useCallback((e=`png`,t)=>{let n=a.current;if(!n)return``;if(t){let r=document.createElement(`canvas`);r.width=n.width,r.height=n.height;let i=r.getContext(`2d`);return i?(i.fillStyle=t,i.fillRect(0,0,r.width,r.height),i.drawImage(n,0,0),r.toDataURL(`image/${e}`)):``}return n.toDataURL(`image/${e}`)},[]),toSVG:n.useCallback(e=>{let t=a.current;if(!t)return``;let n=`<svg xmlns="http://www.w3.org/2000/svg" width="${t.width}" height="${t.height}" aria-hidden="true" focusable="false">`;return e&&(n+=`<rect width="100%" height="100%" fill="${e}"/>`),o.forEach(e=>{if(e.points.length<2)return;let t=`M ${e.points[0].x} ${e.points[0].y}`;for(let n=1;n<e.points.length-1;n++){let r=(e.points[n].x+e.points[n+1].x)/2,i=(e.points[n].y+e.points[n+1].y)/2;t+=` Q ${e.points[n].x} ${e.points[n].y} ${r} ${i}`}if(e.points.length>1){let n=e.points[e.points.length-1];t+=` L ${n.x} ${n.y}`}n+=`<path d="${t}" stroke="${e.color}" stroke-width="${e.size}" fill="none" stroke-linecap="round" stroke-linejoin="round"/>`}),n+=`</svg>`,`data:image/svg+xml;base64,${btoa(n)}`},[o]),fromDataURL:n.useCallback(e=>{let t=a.current;if(!t)return;let n=t.getContext(`2d`);if(!n)return;let r=new Image;r.onload=()=>{n.clearRect(0,0,t.width,t.height),n.drawImage(r,0,0),s([{points:[{x:0,y:0},{x:1,y:1}],color:`#000`,size:1}])},r.src=e},[]),fromStrokes:n.useCallback(e=>{s(e)},[]),startDrawing:v,draw:y,stopDrawing:b}}var o=[`#000000`,`#1e40af`,`#dc2626`,`#16a34a`,`#9333ea`],s=[1,2,3,5,8],c=n.forwardRef(({width:e=400,height:c=200,aspectRatio:l,penColor:u=`#000000`,penSize:d=2,backgroundColor:f=`transparent`,showGuideLine:p=!0,guideLineColor:m=`#d1d5db`,placeholder:h=`Sign here`,placeholderColor:g=`#9ca3af`,readOnly:_=!1,initialValue:v,onChange:y,onSave:b,showToolbar:x=!0,penColors:S=o,penSizes:C=s,className:w,canvasClassName:T,toolbarClassName:E,disabled:D=!1},ee)=>{let O=n.useRef(null),[k,A]=n.useState({width:e,height:c}),j=a({penColor:u,penSize:d,onChange:y}),{canvasRef:M,strokes:N,currentStroke:P,isEmpty:F,penColor:I,penSize:L,setPenColor:R,setPenSize:z,clear:B,undo:te,toDataURL:V,toSVG:H,fromDataURL:U,fromStrokes:W,startDrawing:G,draw:K,stopDrawing:q}=j;n.useImperativeHandle(ee,()=>j,[j]),n.useEffect(()=>{if(l&&O.current){let t=O.current.clientWidth||e;A({width:t,height:t/l})}else A({width:e,height:c})},[l,e,c]),n.useEffect(()=>{v&&(typeof v==`string`?U(v):W(v))},[v,U,W]),n.useEffect(()=>{let e=M.current;if(!e)return;let t=e.getContext(`2d`);if(t&&(t.clearRect(0,0,e.width,e.height),f!==`transparent`&&(t.fillStyle=f,t.fillRect(0,0,e.width,e.height)),N.forEach(e=>{if(e.points.length<2)return;t.beginPath(),t.strokeStyle=e.color,t.lineWidth=e.size,t.lineCap=`round`,t.lineJoin=`round`;let n=e.points;t.moveTo(n[0].x,n[0].y);for(let e=1;e<n.length-1;e++){let r=(n[e].x+n[e+1].x)/2,i=(n[e].y+n[e+1].y)/2;t.quadraticCurveTo(n[e].x,n[e].y,r,i)}if(n.length>1){let e=n[n.length-1];t.lineTo(e.x,e.y)}t.stroke()}),P&&P.points.length>=2)){t.beginPath(),t.strokeStyle=P.color,t.lineWidth=P.size,t.lineCap=`round`,t.lineJoin=`round`;let e=P.points;t.moveTo(e[0].x,e[0].y);for(let n=1;n<e.length-1;n++){let r=(e[n].x+e[n+1].x)/2,i=(e[n].y+e[n+1].y)/2;t.quadraticCurveTo(e[n].x,e[n].y,r,i)}if(e.length>1){let n=e[e.length-1];t.lineTo(n.x,n.y)}t.stroke()}},[N,P,f,M]);let J=n.useCallback(e=>{let t=M.current;if(!t)return null;let n=t.getBoundingClientRect(),r=t.width/n.width,i=t.height/n.height;if(`touches`in e){let t=e.touches[0];if(!t)return null;let a=t;return{x:(t.clientX-n.left)*r,y:(t.clientY-n.top)*i,pressure:a.force??.5}}return{x:(e.clientX-n.left)*r,y:(e.clientY-n.top)*i,pressure:.5}},[M]),Y=n.useCallback(e=>{if(_||D)return;e.preventDefault();let t=J(e);t&&G(t)},[_,D,J,G]),X=n.useCallback(e=>{if(_||D)return;e.preventDefault();let t=J(e);t&&K(t)},[_,D,J,K]),Z=n.useCallback(()=>{_||D||q()},[_,D,q]),Q=n.useCallback(e=>{let t=e===`svg`?H(f):V(e,f===`transparent`?void 0:f);b?.(t,e)},[V,H,f,b]),$=_||D;return(0,i.jsxs)(`div`,{ref:O,className:t.cn(`flex flex-col gap-2`,w),children:[(0,i.jsxs)(`div`,{className:t.cn(`relative rounded-lg border bg-background overflow-hidden`,$&&`opacity-50 cursor-not-allowed`,T),style:{width:k.width,height:k.height},children:[p&&(0,i.jsx)(`div`,{className:`absolute left-4 right-4 pointer-events-none`,style:{bottom:`20%`,borderBottom:`1px dashed ${m}`}}),F&&h&&(0,i.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center pointer-events-none`,style:{color:g},children:(0,i.jsx)(`span`,{className:`text-sm`,children:h})}),(0,i.jsx)(`canvas`,{ref:M,width:k.width,height:k.height,className:t.cn(`touch-none`,!$&&`cursor-crosshair`),style:{width:k.width,height:k.height},onMouseDown:Y,onMouseMove:X,onMouseUp:Z,onMouseLeave:Z,onTouchStart:Y,onTouchMove:X,onTouchEnd:Z})]}),x&&!_&&(0,i.jsxs)(`div`,{className:t.cn(`flex items-center justify-between gap-2 flex-wrap`,E),children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,i.jsx)(r.Pen,{className:`h-4 w-4 text-muted-foreground`}),S.map(e=>(0,i.jsx)(`button`,{type:`button`,disabled:D,className:t.cn(`w-6 h-6 rounded-full border-2 transition-transform hover:scale-110`,I===e?`border-primary ring-2 ring-primary/30`:`border-transparent`),style:{backgroundColor:e},onClick:()=>R(e),title:`Color: ${e}`},e))]}),(0,i.jsx)(`div`,{className:`flex items-center gap-1 ml-2`,children:C.map(e=>(0,i.jsx)(`button`,{type:`button`,disabled:D,className:t.cn(`w-7 h-7 rounded flex items-center justify-center border transition-colors`,L===e?`border-primary bg-primary/10`:`border-border hover:bg-muted`),onClick:()=>z(e),title:`Size: ${e}px`,children:(0,i.jsx)(`div`,{className:`rounded-full bg-current`,style:{width:Math.min(e*2,16),height:Math.min(e*2,16)}})},e))})]}),(0,i.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,i.jsx)(`button`,{type:`button`,disabled:D||N.length===0,className:t.cn(`p-2 rounded hover:bg-muted transition-colors`,`disabled:opacity-50 disabled:cursor-not-allowed`),onClick:te,title:`Undo last stroke`,children:(0,i.jsx)(r.Undo,{className:`h-4 w-4`})}),(0,i.jsx)(`button`,{type:`button`,disabled:D||F,className:t.cn(`p-2 rounded hover:bg-muted transition-colors text-destructive`,`disabled:opacity-50 disabled:cursor-not-allowed`),onClick:B,title:`Clear signature`,children:(0,i.jsx)(r.Trash2,{className:`h-4 w-4`})}),(0,i.jsx)(`div`,{className:`w-px h-6 bg-border mx-1`}),(0,i.jsx)(`button`,{type:`button`,disabled:D||F,className:t.cn(`p-2 rounded hover:bg-muted transition-colors`,`disabled:opacity-50 disabled:cursor-not-allowed`),onClick:()=>Q(`png`),title:`Save as PNG`,children:(0,i.jsx)(r.Download,{className:`h-4 w-4`})}),b&&(0,i.jsx)(`button`,{type:`button`,disabled:D||F,className:t.cn(`p-2 rounded hover:bg-muted transition-colors text-primary`,`disabled:opacity-50 disabled:cursor-not-allowed`),onClick:()=>Q(`png`),title:`Confirm signature`,children:(0,i.jsx)(r.Check,{className:`h-4 w-4`})})]})]})]})});c.displayName=`WakaSignaturePad`,exports.WakaSignaturePad=c,exports.default=c,exports.useSignaturePad=a;
@@ -373,4 +373,4 @@ var u = [
373
373
  });
374
374
  f.displayName = "WakaSignaturePad";
375
375
  //#endregion
376
- export { f as default, l as useSignaturePad };
376
+ export { f as WakaSignaturePad, f as default, l as useSignaturePad };
@@ -1,4 +1,4 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`);let n=require(`react`);n=e.__toESM(n);let r=require(`class-variance-authority`),i=require(`react/jsx-runtime`);var a=(0,r.cva)(`relative overflow-hidden`,{variants:{rounded:{none:`rounded-none`,sm:`rounded-sm`,md:`rounded-md`,lg:`rounded-lg`,xl:`rounded-xl`,full:`rounded-full`}},defaultVariants:{rounded:`md`}}),o={text:{width:`100%`,height:16,rounded:`sm`},avatar:{width:40,height:40,rounded:`full`},card:{width:`100%`,height:200,rounded:`lg`},list:{width:`100%`,height:60,rounded:`md`},thumbnail:{width:80,height:80,rounded:`md`},button:{width:120,height:40,rounded:`md`}};function s({baseColor:e,highlightColor:t,speed:n,animated:r}){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`div`,{className:`absolute inset-0`,style:{backgroundColor:e}}),r&&(0,i.jsx)(`div`,{className:`absolute inset-0`,style:{background:`linear-gradient(
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js");let n=require("react");n=e.__toESM(n);let r=require("class-variance-authority"),i=require("react/jsx-runtime");var a=(0,r.cva)(`relative overflow-hidden`,{variants:{rounded:{none:`rounded-none`,sm:`rounded-sm`,md:`rounded-md`,lg:`rounded-lg`,xl:`rounded-xl`,full:`rounded-full`}},defaultVariants:{rounded:`md`}}),o={text:{width:`100%`,height:16,rounded:`sm`},avatar:{width:40,height:40,rounded:`full`},card:{width:`100%`,height:200,rounded:`lg`},list:{width:`100%`,height:60,rounded:`md`},thumbnail:{width:80,height:80,rounded:`md`},button:{width:120,height:40,rounded:`md`}};function s({baseColor:e,highlightColor:t,speed:n,animated:r}){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`div`,{className:`absolute inset-0`,style:{backgroundColor:e}}),r&&(0,i.jsx)(`div`,{className:`absolute inset-0`,style:{background:`linear-gradient(
2
2
  90deg,
3
3
  transparent 0%,
4
4
  ${t} 50%,
@@ -1,4 +1,4 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`);let n=require(`react`);n=e.__toESM(n);let r=require(`lucide-react`),i=require(`react/jsx-runtime`);function a(e,t){return e.find(e=>e.id===t)}function o(e,t){let n=e.filter(e=>e.branch===t);if(n.length===0)return 0;let r=n.filter(e=>e.unlocked).length;return Math.round(r/n.length*100)}function s(e){let t=[`#ef4444`,`#3b82f6`,`#22c55e`,`#a855f7`,`#f59e0b`,`#06b6d4`,`#ec4899`,`#8b5cf6`];return t[e%t.length]}function c({from:e,to:n,color:r,unlocked:a,available:o,animated:s}){let c=n.x-e.x,l=n.y-e.y,u=(e.x+n.x)/2,d=(e.y+n.y)/2,f;f=Math.abs(l)>Math.abs(c)?`M ${e.x} ${e.y} C ${e.x} ${d}, ${n.x} ${d}, ${n.x} ${n.y}`:`M ${e.x} ${e.y} C ${u} ${e.y}, ${u} ${n.y}, ${n.x} ${n.y}`;let p=a?r:o?`${r}80`:`rgba(128, 128, 128, 0.3)`;return(0,i.jsxs)(`g`,{children:[a&&(0,i.jsx)(`path`,{d:f,fill:`none`,stroke:r,strokeWidth:8,strokeLinecap:`round`,opacity:.3,className:s?`animate-pulse`:``}),(0,i.jsx)(`path`,{d:f,fill:`none`,stroke:p,strokeWidth:a?4:2,strokeLinecap:`round`,strokeDasharray:!a&&o?`8 4`:`none`,className:t.cn(`transition-all duration-500`,s&&a&&`animate-flow`)}),(0,i.jsx)(`polygon`,{points:`-5,-4 0,0 -5,4`,fill:p,transform:`translate(${n.x}, ${n.y}) rotate(${Math.atan2(l,c)*180/Math.PI})`})]})}function l({skill:e,branchColor:a,onUnlock:o,onHover:s,isHovered:c,animated:l,canAfford:u}){let[d,f]=n.useState(!1),p=()=>{e.available&&!e.unlocked&&u&&(f(!0),setTimeout(()=>{o(),f(!1)},500))},m=e.available&&!e.unlocked&&u;return(0,i.jsxs)(`g`,{transform:`translate(${e.position.x}, ${e.position.y})`,onMouseEnter:()=>s(e),onMouseLeave:()=>s(null),onClick:p,className:t.cn(`cursor-pointer transition-transform duration-300`,m&&`hover:scale-110`),style:{cursor:m?`pointer`:e.unlocked?`default`:`not-allowed`},children:[e.unlocked&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`circle`,{r:42,fill:`none`,stroke:a,strokeWidth:2,opacity:.3,className:l?`animate-pulse`:``}),(0,i.jsx)(`circle`,{r:38,fill:`${a}20`,className:l?`animate-glow`:``})]}),e.available&&!e.unlocked&&(0,i.jsx)(`circle`,{r:36,fill:`none`,stroke:a,strokeWidth:2,strokeDasharray:`4 4`,className:l?`animate-spin-slow`:``}),d&&(0,i.jsx)(`circle`,{r:60/2,fill:`none`,stroke:a,strokeWidth:4,className:`animate-unlock-ring`}),(0,i.jsx)(`circle`,{r:60/2,fill:e.unlocked?`url(#gradient-${e.branch||`default`})`:e.available?`hsl(var(--background))`:`hsl(var(--muted))`,stroke:e.unlocked||e.available?a:`hsl(var(--border))`,strokeWidth:e.unlocked?3:2,className:t.cn(`transition-all duration-300`,c&&`filter drop-shadow-lg`,d&&`animate-unlock-pulse`)}),e.unlocked&&(0,i.jsx)(`circle`,{r:60/2-6,fill:`none`,stroke:`rgba(255,255,255,0.3)`,strokeWidth:1}),(0,i.jsx)(`g`,{transform:`translate(-12, -12)`,children:e.unlocked?(0,i.jsx)(`g`,{className:`text-white`,children:e.icon||(0,i.jsx)(r.Star,{className:`h-6 w-6`,fill:`currentColor`})}):e.available?(0,i.jsx)(`g`,{className:`text-${e.unlocked?`white`:`muted-foreground`}`,children:u?(0,i.jsx)(r.Unlock,{className:`h-6 w-6`,stroke:a}):(0,i.jsx)(r.Lock,{className:`h-6 w-6`,stroke:`hsl(var(--muted-foreground))`})}):(0,i.jsx)(r.Lock,{className:`h-6 w-6`,stroke:`hsl(var(--muted-foreground))`,opacity:.5})}),e.maxLevel&&e.maxLevel>1&&e.unlocked&&(0,i.jsxs)(`g`,{transform:`translate(${60/2-8}, ${60/2-8})`,children:[(0,i.jsx)(`circle`,{r:10,fill:a,stroke:`white`,strokeWidth:2}),(0,i.jsxs)(`text`,{textAnchor:`middle`,dominantBaseline:`central`,className:`fill-white text-xs font-bold`,style:{fontSize:10},children:[e.level||1,`/`,e.maxLevel]})]}),e.available&&!e.unlocked&&e.cost&&(0,i.jsxs)(`g`,{transform:`translate(0, 46)`,children:[(0,i.jsx)(`rect`,{x:-20,y:-10,width:40,height:20,rx:10,fill:u?a:`hsl(var(--muted))`,className:`transition-colors duration-300`}),(0,i.jsx)(`g`,{transform:`translate(-8, -6)`,children:(0,i.jsx)(r.Zap,{className:`h-3 w-3`,fill:`white`,stroke:`white`})}),(0,i.jsx)(`text`,{x:6,textAnchor:`middle`,dominantBaseline:`central`,className:`fill-white text-xs font-bold`,style:{fontSize:11},children:e.cost})]}),(0,i.jsx)(`text`,{y:e.available&&!e.unlocked&&e.cost?68:46,textAnchor:`middle`,className:t.cn(`text-xs font-medium pointer-events-none`,e.unlocked?`fill-foreground`:e.available?`fill-muted-foreground`:`fill-muted-foreground/50`),style:{fontSize:11},children:e.name}),d&&(0,i.jsx)(`g`,{className:`particles`,children:[...Array(8)].map((e,t)=>(0,i.jsx)(`circle`,{r:3,fill:a,className:`animate-particle`,style:{"--angle":`${t*45}deg`,animationDelay:`${t*.05}s`}},t))})]})}function u({skill:e,branchColor:n,canAfford:a}){return(0,i.jsxs)(`div`,{className:`fixed z-50 w-64 rounded-lg border bg-popover p-4 shadow-xl animate-tooltip-in`,style:{left:e.position.x+80,top:e.position.y-40,borderColor:e.unlocked?n:void 0},children:[(0,i.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,i.jsx)(`div`,{className:t.cn(`flex h-8 w-8 items-center justify-center rounded-full`,e.unlocked?`text-white`:`text-muted-foreground`),style:{backgroundColor:e.unlocked?n:`hsl(var(--muted))`},children:e.icon||(0,i.jsx)(r.Star,{className:`h-4 w-4`,fill:e.unlocked?`currentColor`:`none`})}),(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`h4`,{className:`font-semibold`,children:e.name}),e.maxLevel&&e.maxLevel>1&&(0,i.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`Level `,e.level||+!!e.unlocked,`/`,e.maxLevel]})]})]}),(0,i.jsx)(`p`,{className:`mb-3 text-sm text-muted-foreground`,children:e.description}),(0,i.jsxs)(`div`,{className:`flex items-center justify-between text-sm`,children:[e.unlocked?(0,i.jsxs)(`span`,{className:`flex items-center gap-1 text-green-500`,children:[(0,i.jsx)(r.Unlock,{className:`h-4 w-4`}),`Unlocked`]}):e.available?(0,i.jsx)(`span`,{className:`flex items-center gap-1`,style:{color:a?n:`hsl(var(--muted-foreground))`},children:a?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Unlock,{className:`h-4 w-4`}),`Click to unlock`]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Lock,{className:`h-4 w-4`}),`Not enough points`]})}):(0,i.jsxs)(`span`,{className:`flex items-center gap-1 text-muted-foreground`,children:[(0,i.jsx)(r.Lock,{className:`h-4 w-4`}),`Locked`]}),!e.unlocked&&e.cost&&(0,i.jsxs)(`span`,{className:`flex items-center gap-1 font-medium`,children:[(0,i.jsx)(r.Zap,{className:`h-4 w-4 text-amber-500`}),e.cost,` points`]})]}),e.prerequisites&&e.prerequisites.length>0&&!e.unlocked&&(0,i.jsxs)(`div`,{className:`mt-3 border-t pt-3`,children:[(0,i.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:`Requires:`}),(0,i.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1`,children:e.prerequisites.map(e=>(0,i.jsx)(`span`,{className:`rounded-full bg-muted px-2 py-0.5 text-xs`,children:e},e))})]})]})}function d({branch:e,progress:t,expanded:n,onToggle:a,skills:o}){let s=o.filter(t=>t.branch===e.id),c=s.filter(e=>e.unlocked).length;return(0,i.jsxs)(`div`,{className:`rounded-lg border bg-card p-3 transition-all duration-300`,children:[(0,i.jsxs)(`button`,{type:`button`,onClick:a,className:`flex w-full items-center justify-between`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,i.jsx)(`div`,{className:`h-3 w-3 rounded-full`,style:{backgroundColor:e.color}}),(0,i.jsx)(`span`,{className:`font-medium`,children:e.name})]}),(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,i.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[c,`/`,s.length]}),n?(0,i.jsx)(r.ChevronUp,{className:`h-4 w-4 text-muted-foreground`}):(0,i.jsx)(r.ChevronDown,{className:`h-4 w-4 text-muted-foreground`})]})]}),(0,i.jsx)(`div`,{className:`mt-2 h-2 w-full overflow-hidden rounded-full bg-muted`,children:(0,i.jsx)(`div`,{className:`h-full rounded-full transition-all duration-500`,style:{width:`${t}%`,backgroundColor:e.color}})}),n&&(0,i.jsx)(`div`,{className:`mt-3 space-y-1`,children:s.map(t=>(0,i.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[t.unlocked?(0,i.jsx)(r.Star,{className:`h-3 w-3`,style:{color:e.color},fill:e.color}):(0,i.jsx)(r.Lock,{className:`h-3 w-3 text-muted-foreground`}),(0,i.jsx)(`span`,{className:t.unlocked?``:`text-muted-foreground`,children:t.name})]},t.id))})]})}function f({skills:e,skillPoints:f=0,onUnlock:p,onReset:m,branches:h=[],showConnections:g=!0,zoomable:_=!0,animated:v=!0,showResetButton:y=!0,showCategoryFilters:b=!0,className:x}){let S=n.useRef(null),[C,w]=n.useState(null),[T,E]=n.useState(1),[D,O]=n.useState({x:0,y:0}),[k,A]=n.useState(!1),[j,M]=n.useState({x:0,y:0}),[N,P]=n.useState(new Set),[F,I]=n.useState(new Set),[L,R]=n.useState(!1),[z,B]=n.useState(!1),V=n.useMemo(()=>e.length===0?{minX:0,maxX:800,minY:0,maxY:600}:{minX:Math.min(...e.map(e=>e.position.x))-100,maxX:Math.max(...e.map(e=>e.position.x))+100,minY:Math.min(...e.map(e=>e.position.y))-100,maxY:Math.max(...e.map(e=>e.position.y))+100},[e]),H=V.maxX-V.minX,U=V.maxY-V.minY,W=n.useMemo(()=>{if(h.length>0)return h;let t=new Set(e.map(e=>e.branch).filter(Boolean));return Array.from(t).map((e,t)=>({id:e,name:e.charAt(0).toUpperCase()+e.slice(1),color:s(t)}))},[h,e]),G=e=>W.find(t=>t.id===e.branch)?.color||`#6366f1`,K=e=>{E(t=>Math.max(.5,Math.min(2,t+e)))},q=e=>{e.button===0&&(A(!0),M({x:e.clientX-D.x,y:e.clientY-D.y}))},J=e=>{k&&O({x:e.clientX-j.x,y:e.clientY-j.y})},Y=()=>{A(!1)},X=e=>{_&&e.ctrlKey&&(e.preventDefault(),K(e.deltaY>0?-.1:.1))},Z=e=>{P(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},Q=n.useMemo(()=>{let t=[];return e.forEach(n=>{n.prerequisites&&n.prerequisites.forEach(r=>{let i=a(e,r);i&&t.push({from:i,to:n,color:G(n)})})}),t},[e,W]);return(0,i.jsxs)(`div`,{className:t.cn(`relative flex gap-4`,x),children:[(0,i.jsxs)(`div`,{className:`flex-1`,children:[(0,i.jsxs)(`div`,{className:`mb-4 flex items-center justify-between rounded-lg border bg-card p-4`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,i.jsx)(`div`,{className:`flex h-10 w-10 items-center justify-center rounded-full bg-gradient-to-br from-amber-400 to-orange-500`,children:(0,i.jsx)(r.Zap,{className:`h-5 w-5 text-white`,fill:`white`})}),(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Available Points`}),(0,i.jsx)(`div`,{className:`text-2xl font-bold`,children:f})]})]}),_&&(0,i.jsxs)(`div`,{className:`flex items-center gap-2 rounded-full border bg-background px-3 py-1`,children:[(0,i.jsx)(`button`,{type:`button`,onClick:()=>K(-.1),className:`rounded-full p-1 hover:bg-muted transition-colors`,disabled:T<=.5,children:(0,i.jsx)(r.ZoomOut,{className:`h-4 w-4`})}),(0,i.jsxs)(`span`,{className:`min-w-[3rem] text-center text-sm`,children:[Math.round(T*100),`%`]}),(0,i.jsx)(`button`,{type:`button`,onClick:()=>K(.1),className:`rounded-full p-1 hover:bg-muted transition-colors`,disabled:T>=2,children:(0,i.jsx)(r.ZoomIn,{className:`h-4 w-4`})})]})]}),(0,i.jsxs)(`div`,{ref:S,className:`relative overflow-hidden rounded-lg border bg-gradient-to-br from-background to-muted/20`,style:{height:500},onMouseDown:q,onMouseMove:J,onMouseUp:Y,onMouseLeave:Y,onWheel:X,children:[(0,i.jsx)(`div`,{className:`pointer-events-none absolute inset-0 opacity-20`,style:{backgroundImage:`radial-gradient(circle at 1px 1px, hsl(var(--border)) 1px, transparent 0)`,backgroundSize:`${20*T}px ${20*T}px`}}),(0,i.jsxs)(`svg`,{className:`absolute inset-0`,style:{width:H*T,height:U*T,transform:`translate(${D.x}px, ${D.y}px) translate(${-V.minX*T}px, ${-V.minY*T}px)`,transformOrigin:`top left`},viewBox:`${V.minX} ${V.minY} ${H} ${U}`,"aria-hidden":`true`,focusable:`false`,children:[(0,i.jsxs)(`defs`,{children:[W.map(e=>(0,i.jsxs)(`radialGradient`,{id:`gradient-${e.id}`,cx:`30%`,cy:`30%`,r:`70%`,children:[(0,i.jsx)(`stop`,{offset:`0%`,stopColor:`${e.color}ff`}),(0,i.jsx)(`stop`,{offset:`100%`,stopColor:`${e.color}aa`})]},`gradient-${e.id}`)),(0,i.jsxs)(`radialGradient`,{id:`gradient-default`,cx:`30%`,cy:`30%`,r:`70%`,children:[(0,i.jsx)(`stop`,{offset:`0%`,stopColor:`#6366f1`}),(0,i.jsx)(`stop`,{offset:`100%`,stopColor:`#4f46e5`})]})]}),g&&Q.map((e,t)=>(0,i.jsx)(c,{from:e.from.position,to:e.to.position,color:e.color,unlocked:e.from.unlocked&&e.to.unlocked,available:e.from.unlocked&&e.to.available,animated:v},`${e.from.id}-${e.to.id}-${t}`)),e.map(e=>(0,i.jsx)(l,{skill:e,branchColor:G(e),onUnlock:()=>p?.(e.id),onHover:w,isHovered:C?.id===e.id,animated:v,canAfford:f>=(e.cost||1)},e.id))]}),C&&(0,i.jsx)(u,{skill:C,branchColor:G(C),canAfford:f>=(C.cost||1)}),(0,i.jsxs)(`div`,{className:`absolute bottom-4 left-4 text-xs text-muted-foreground/60`,children:[`Drag to pan `,_&&`| Ctrl+Scroll to zoom`]})]})]}),W.length>0&&(0,i.jsxs)(`div`,{className:`w-64 space-y-2`,children:[(0,i.jsx)(`h3`,{className:`mb-3 font-semibold`,children:`Skill Branches`}),W.map(t=>(0,i.jsx)(d,{branch:t,progress:o(e,t.id),expanded:N.has(t.id),onToggle:()=>Z(t.id),skills:e},t.id)),(0,i.jsxs)(`div`,{className:`mt-4 rounded-lg border bg-card p-3`,children:[(0,i.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,i.jsx)(`span`,{className:`font-medium`,children:`Total Progress`}),(0,i.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[e.filter(e=>e.unlocked).length,`/`,e.length]})]}),(0,i.jsx)(`div`,{className:`mt-2 h-3 w-full overflow-hidden rounded-full bg-muted`,children:(0,i.jsx)(`div`,{className:`h-full rounded-full bg-gradient-to-r from-green-400 to-emerald-500 transition-all duration-500`,style:{width:`${e.filter(e=>e.unlocked).length/e.length*100}%`}})}),(0,i.jsxs)(`div`,{className:`mt-1 text-center text-sm font-medium`,children:[Math.round(e.filter(e=>e.unlocked).length/e.length*100),`%`]})]})]}),(0,i.jsx)(`style`,{children:`
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js");let n=require("react");n=e.__toESM(n);let r=require("lucide-react"),i=require("react/jsx-runtime");function a(e,t){return e.find(e=>e.id===t)}function o(e,t){let n=e.filter(e=>e.branch===t);if(n.length===0)return 0;let r=n.filter(e=>e.unlocked).length;return Math.round(r/n.length*100)}function s(e){let t=[`#ef4444`,`#3b82f6`,`#22c55e`,`#a855f7`,`#f59e0b`,`#06b6d4`,`#ec4899`,`#8b5cf6`];return t[e%t.length]}function c({from:e,to:n,color:r,unlocked:a,available:o,animated:s}){let c=n.x-e.x,l=n.y-e.y,u=(e.x+n.x)/2,d=(e.y+n.y)/2,f;f=Math.abs(l)>Math.abs(c)?`M ${e.x} ${e.y} C ${e.x} ${d}, ${n.x} ${d}, ${n.x} ${n.y}`:`M ${e.x} ${e.y} C ${u} ${e.y}, ${u} ${n.y}, ${n.x} ${n.y}`;let p=a?r:o?`${r}80`:`rgba(128, 128, 128, 0.3)`;return(0,i.jsxs)(`g`,{children:[a&&(0,i.jsx)(`path`,{d:f,fill:`none`,stroke:r,strokeWidth:8,strokeLinecap:`round`,opacity:.3,className:s?`animate-pulse`:``}),(0,i.jsx)(`path`,{d:f,fill:`none`,stroke:p,strokeWidth:a?4:2,strokeLinecap:`round`,strokeDasharray:!a&&o?`8 4`:`none`,className:t.cn(`transition-all duration-500`,s&&a&&`animate-flow`)}),(0,i.jsx)(`polygon`,{points:`-5,-4 0,0 -5,4`,fill:p,transform:`translate(${n.x}, ${n.y}) rotate(${Math.atan2(l,c)*180/Math.PI})`})]})}function l({skill:e,branchColor:a,onUnlock:o,onHover:s,isHovered:c,animated:l,canAfford:u}){let[d,f]=n.useState(!1),p=()=>{e.available&&!e.unlocked&&u&&(f(!0),setTimeout(()=>{o(),f(!1)},500))},m=e.available&&!e.unlocked&&u;return(0,i.jsxs)(`g`,{transform:`translate(${e.position.x}, ${e.position.y})`,onMouseEnter:()=>s(e),onMouseLeave:()=>s(null),onClick:p,className:t.cn(`cursor-pointer transition-transform duration-300`,m&&`hover:scale-110`),style:{cursor:m?`pointer`:e.unlocked?`default`:`not-allowed`},children:[e.unlocked&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(`circle`,{r:42,fill:`none`,stroke:a,strokeWidth:2,opacity:.3,className:l?`animate-pulse`:``}),(0,i.jsx)(`circle`,{r:38,fill:`${a}20`,className:l?`animate-glow`:``})]}),e.available&&!e.unlocked&&(0,i.jsx)(`circle`,{r:36,fill:`none`,stroke:a,strokeWidth:2,strokeDasharray:`4 4`,className:l?`animate-spin-slow`:``}),d&&(0,i.jsx)(`circle`,{r:60/2,fill:`none`,stroke:a,strokeWidth:4,className:`animate-unlock-ring`}),(0,i.jsx)(`circle`,{r:60/2,fill:e.unlocked?`url(#gradient-${e.branch||`default`})`:e.available?`hsl(var(--background))`:`hsl(var(--muted))`,stroke:e.unlocked||e.available?a:`hsl(var(--border))`,strokeWidth:e.unlocked?3:2,className:t.cn(`transition-all duration-300`,c&&`filter drop-shadow-lg`,d&&`animate-unlock-pulse`)}),e.unlocked&&(0,i.jsx)(`circle`,{r:60/2-6,fill:`none`,stroke:`rgba(255,255,255,0.3)`,strokeWidth:1}),(0,i.jsx)(`g`,{transform:`translate(-12, -12)`,children:e.unlocked?(0,i.jsx)(`g`,{className:`text-white`,children:e.icon||(0,i.jsx)(r.Star,{className:`h-6 w-6`,fill:`currentColor`})}):e.available?(0,i.jsx)(`g`,{className:`text-${e.unlocked?`white`:`muted-foreground`}`,children:u?(0,i.jsx)(r.Unlock,{className:`h-6 w-6`,stroke:a}):(0,i.jsx)(r.Lock,{className:`h-6 w-6`,stroke:`hsl(var(--muted-foreground))`})}):(0,i.jsx)(r.Lock,{className:`h-6 w-6`,stroke:`hsl(var(--muted-foreground))`,opacity:.5})}),e.maxLevel&&e.maxLevel>1&&e.unlocked&&(0,i.jsxs)(`g`,{transform:`translate(${60/2-8}, ${60/2-8})`,children:[(0,i.jsx)(`circle`,{r:10,fill:a,stroke:`white`,strokeWidth:2}),(0,i.jsxs)(`text`,{textAnchor:`middle`,dominantBaseline:`central`,className:`fill-white text-xs font-bold`,style:{fontSize:10},children:[e.level||1,`/`,e.maxLevel]})]}),e.available&&!e.unlocked&&e.cost&&(0,i.jsxs)(`g`,{transform:`translate(0, 46)`,children:[(0,i.jsx)(`rect`,{x:-20,y:-10,width:40,height:20,rx:10,fill:u?a:`hsl(var(--muted))`,className:`transition-colors duration-300`}),(0,i.jsx)(`g`,{transform:`translate(-8, -6)`,children:(0,i.jsx)(r.Zap,{className:`h-3 w-3`,fill:`white`,stroke:`white`})}),(0,i.jsx)(`text`,{x:6,textAnchor:`middle`,dominantBaseline:`central`,className:`fill-white text-xs font-bold`,style:{fontSize:11},children:e.cost})]}),(0,i.jsx)(`text`,{y:e.available&&!e.unlocked&&e.cost?68:46,textAnchor:`middle`,className:t.cn(`text-xs font-medium pointer-events-none`,e.unlocked?`fill-foreground`:e.available?`fill-muted-foreground`:`fill-muted-foreground/50`),style:{fontSize:11},children:e.name}),d&&(0,i.jsx)(`g`,{className:`particles`,children:[...Array(8)].map((e,t)=>(0,i.jsx)(`circle`,{r:3,fill:a,className:`animate-particle`,style:{"--angle":`${t*45}deg`,animationDelay:`${t*.05}s`}},t))})]})}function u({skill:e,branchColor:n,canAfford:a}){return(0,i.jsxs)(`div`,{className:`fixed z-50 w-64 rounded-lg border bg-popover p-4 shadow-xl animate-tooltip-in`,style:{left:e.position.x+80,top:e.position.y-40,borderColor:e.unlocked?n:void 0},children:[(0,i.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,i.jsx)(`div`,{className:t.cn(`flex h-8 w-8 items-center justify-center rounded-full`,e.unlocked?`text-white`:`text-muted-foreground`),style:{backgroundColor:e.unlocked?n:`hsl(var(--muted))`},children:e.icon||(0,i.jsx)(r.Star,{className:`h-4 w-4`,fill:e.unlocked?`currentColor`:`none`})}),(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`h4`,{className:`font-semibold`,children:e.name}),e.maxLevel&&e.maxLevel>1&&(0,i.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`Level `,e.level||+!!e.unlocked,`/`,e.maxLevel]})]})]}),(0,i.jsx)(`p`,{className:`mb-3 text-sm text-muted-foreground`,children:e.description}),(0,i.jsxs)(`div`,{className:`flex items-center justify-between text-sm`,children:[e.unlocked?(0,i.jsxs)(`span`,{className:`flex items-center gap-1 text-green-500`,children:[(0,i.jsx)(r.Unlock,{className:`h-4 w-4`}),`Unlocked`]}):e.available?(0,i.jsx)(`span`,{className:`flex items-center gap-1`,style:{color:a?n:`hsl(var(--muted-foreground))`},children:a?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Unlock,{className:`h-4 w-4`}),`Click to unlock`]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Lock,{className:`h-4 w-4`}),`Not enough points`]})}):(0,i.jsxs)(`span`,{className:`flex items-center gap-1 text-muted-foreground`,children:[(0,i.jsx)(r.Lock,{className:`h-4 w-4`}),`Locked`]}),!e.unlocked&&e.cost&&(0,i.jsxs)(`span`,{className:`flex items-center gap-1 font-medium`,children:[(0,i.jsx)(r.Zap,{className:`h-4 w-4 text-amber-500`}),e.cost,` points`]})]}),e.prerequisites&&e.prerequisites.length>0&&!e.unlocked&&(0,i.jsxs)(`div`,{className:`mt-3 border-t pt-3`,children:[(0,i.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:`Requires:`}),(0,i.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1`,children:e.prerequisites.map(e=>(0,i.jsx)(`span`,{className:`rounded-full bg-muted px-2 py-0.5 text-xs`,children:e},e))})]})]})}function d({branch:e,progress:t,expanded:n,onToggle:a,skills:o}){let s=o.filter(t=>t.branch===e.id),c=s.filter(e=>e.unlocked).length;return(0,i.jsxs)(`div`,{className:`rounded-lg border bg-card p-3 transition-all duration-300`,children:[(0,i.jsxs)(`button`,{type:`button`,onClick:a,className:`flex w-full items-center justify-between`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,i.jsx)(`div`,{className:`h-3 w-3 rounded-full`,style:{backgroundColor:e.color}}),(0,i.jsx)(`span`,{className:`font-medium`,children:e.name})]}),(0,i.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,i.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[c,`/`,s.length]}),n?(0,i.jsx)(r.ChevronUp,{className:`h-4 w-4 text-muted-foreground`}):(0,i.jsx)(r.ChevronDown,{className:`h-4 w-4 text-muted-foreground`})]})]}),(0,i.jsx)(`div`,{className:`mt-2 h-2 w-full overflow-hidden rounded-full bg-muted`,children:(0,i.jsx)(`div`,{className:`h-full rounded-full transition-all duration-500`,style:{width:`${t}%`,backgroundColor:e.color}})}),n&&(0,i.jsx)(`div`,{className:`mt-3 space-y-1`,children:s.map(t=>(0,i.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[t.unlocked?(0,i.jsx)(r.Star,{className:`h-3 w-3`,style:{color:e.color},fill:e.color}):(0,i.jsx)(r.Lock,{className:`h-3 w-3 text-muted-foreground`}),(0,i.jsx)(`span`,{className:t.unlocked?``:`text-muted-foreground`,children:t.name})]},t.id))})]})}function f({skills:e,skillPoints:f=0,onUnlock:p,onReset:m,branches:h=[],showConnections:g=!0,zoomable:_=!0,animated:v=!0,showResetButton:y=!0,showCategoryFilters:b=!0,className:x}){let S=n.useRef(null),[C,w]=n.useState(null),[T,E]=n.useState(1),[D,O]=n.useState({x:0,y:0}),[k,A]=n.useState(!1),[j,M]=n.useState({x:0,y:0}),[N,P]=n.useState(new Set),[F,I]=n.useState(new Set),[L,R]=n.useState(!1),[z,B]=n.useState(!1),V=n.useMemo(()=>e.length===0?{minX:0,maxX:800,minY:0,maxY:600}:{minX:Math.min(...e.map(e=>e.position.x))-100,maxX:Math.max(...e.map(e=>e.position.x))+100,minY:Math.min(...e.map(e=>e.position.y))-100,maxY:Math.max(...e.map(e=>e.position.y))+100},[e]),H=V.maxX-V.minX,U=V.maxY-V.minY,W=n.useMemo(()=>{if(h.length>0)return h;let t=new Set(e.map(e=>e.branch).filter(Boolean));return Array.from(t).map((e,t)=>({id:e,name:e.charAt(0).toUpperCase()+e.slice(1),color:s(t)}))},[h,e]),G=e=>W.find(t=>t.id===e.branch)?.color||`#6366f1`,K=e=>{E(t=>Math.max(.5,Math.min(2,t+e)))},q=e=>{e.button===0&&(A(!0),M({x:e.clientX-D.x,y:e.clientY-D.y}))},J=e=>{k&&O({x:e.clientX-j.x,y:e.clientY-j.y})},Y=()=>{A(!1)},X=e=>{_&&e.ctrlKey&&(e.preventDefault(),K(e.deltaY>0?-.1:.1))},Z=e=>{P(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},Q=n.useMemo(()=>{let t=[];return e.forEach(n=>{n.prerequisites&&n.prerequisites.forEach(r=>{let i=a(e,r);i&&t.push({from:i,to:n,color:G(n)})})}),t},[e,W]);return(0,i.jsxs)(`div`,{className:t.cn(`relative flex gap-4`,x),children:[(0,i.jsxs)(`div`,{className:`flex-1`,children:[(0,i.jsxs)(`div`,{className:`mb-4 flex items-center justify-between rounded-lg border bg-card p-4`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,i.jsx)(`div`,{className:`flex h-10 w-10 items-center justify-center rounded-full bg-gradient-to-br from-amber-400 to-orange-500`,children:(0,i.jsx)(r.Zap,{className:`h-5 w-5 text-white`,fill:`white`})}),(0,i.jsxs)(`div`,{children:[(0,i.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Available Points`}),(0,i.jsx)(`div`,{className:`text-2xl font-bold`,children:f})]})]}),_&&(0,i.jsxs)(`div`,{className:`flex items-center gap-2 rounded-full border bg-background px-3 py-1`,children:[(0,i.jsx)(`button`,{type:`button`,onClick:()=>K(-.1),className:`rounded-full p-1 hover:bg-muted transition-colors`,disabled:T<=.5,children:(0,i.jsx)(r.ZoomOut,{className:`h-4 w-4`})}),(0,i.jsxs)(`span`,{className:`min-w-[3rem] text-center text-sm`,children:[Math.round(T*100),`%`]}),(0,i.jsx)(`button`,{type:`button`,onClick:()=>K(.1),className:`rounded-full p-1 hover:bg-muted transition-colors`,disabled:T>=2,children:(0,i.jsx)(r.ZoomIn,{className:`h-4 w-4`})})]})]}),(0,i.jsxs)(`div`,{ref:S,className:`relative overflow-hidden rounded-lg border bg-gradient-to-br from-background to-muted/20`,style:{height:500},onMouseDown:q,onMouseMove:J,onMouseUp:Y,onMouseLeave:Y,onWheel:X,children:[(0,i.jsx)(`div`,{className:`pointer-events-none absolute inset-0 opacity-20`,style:{backgroundImage:`radial-gradient(circle at 1px 1px, hsl(var(--border)) 1px, transparent 0)`,backgroundSize:`${20*T}px ${20*T}px`}}),(0,i.jsxs)(`svg`,{className:`absolute inset-0`,style:{width:H*T,height:U*T,transform:`translate(${D.x}px, ${D.y}px) translate(${-V.minX*T}px, ${-V.minY*T}px)`,transformOrigin:`top left`},viewBox:`${V.minX} ${V.minY} ${H} ${U}`,"aria-hidden":`true`,focusable:`false`,children:[(0,i.jsxs)(`defs`,{children:[W.map(e=>(0,i.jsxs)(`radialGradient`,{id:`gradient-${e.id}`,cx:`30%`,cy:`30%`,r:`70%`,children:[(0,i.jsx)(`stop`,{offset:`0%`,stopColor:`${e.color}ff`}),(0,i.jsx)(`stop`,{offset:`100%`,stopColor:`${e.color}aa`})]},`gradient-${e.id}`)),(0,i.jsxs)(`radialGradient`,{id:`gradient-default`,cx:`30%`,cy:`30%`,r:`70%`,children:[(0,i.jsx)(`stop`,{offset:`0%`,stopColor:`#6366f1`}),(0,i.jsx)(`stop`,{offset:`100%`,stopColor:`#4f46e5`})]})]}),g&&Q.map((e,t)=>(0,i.jsx)(c,{from:e.from.position,to:e.to.position,color:e.color,unlocked:e.from.unlocked&&e.to.unlocked,available:e.from.unlocked&&e.to.available,animated:v},`${e.from.id}-${e.to.id}-${t}`)),e.map(e=>(0,i.jsx)(l,{skill:e,branchColor:G(e),onUnlock:()=>p?.(e.id),onHover:w,isHovered:C?.id===e.id,animated:v,canAfford:f>=(e.cost||1)},e.id))]}),C&&(0,i.jsx)(u,{skill:C,branchColor:G(C),canAfford:f>=(C.cost||1)}),(0,i.jsxs)(`div`,{className:`absolute bottom-4 left-4 text-xs text-muted-foreground/60`,children:[`Drag to pan `,_&&`| Ctrl+Scroll to zoom`]})]})]}),W.length>0&&(0,i.jsxs)(`div`,{className:`w-64 space-y-2`,children:[(0,i.jsx)(`h3`,{className:`mb-3 font-semibold`,children:`Skill Branches`}),W.map(t=>(0,i.jsx)(d,{branch:t,progress:o(e,t.id),expanded:N.has(t.id),onToggle:()=>Z(t.id),skills:e},t.id)),(0,i.jsxs)(`div`,{className:`mt-4 rounded-lg border bg-card p-3`,children:[(0,i.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,i.jsx)(`span`,{className:`font-medium`,children:`Total Progress`}),(0,i.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[e.filter(e=>e.unlocked).length,`/`,e.length]})]}),(0,i.jsx)(`div`,{className:`mt-2 h-3 w-full overflow-hidden rounded-full bg-muted`,children:(0,i.jsx)(`div`,{className:`h-full rounded-full bg-gradient-to-r from-green-400 to-emerald-500 transition-all duration-500`,style:{width:`${e.filter(e=>e.unlocked).length/e.length*100}%`}})}),(0,i.jsxs)(`div`,{className:`mt-1 text-center text-sm font-medium`,children:[Math.round(e.filter(e=>e.unlocked).length/e.length*100),`%`]})]})]}),(0,i.jsx)(`style`,{children:`
2
2
  @keyframes spin-slow {
3
3
  from { transform: rotate(0deg); }
4
4
  to { transform: rotate(360deg); }
@@ -62,4 +62,4 @@
62
62
  .animate-tooltip-in {
63
63
  animation: tooltip-in 0.2s ease-out;
64
64
  }
65
- `})]})}function p({initialSkills:e,initialPoints:t=0,onSkillUnlock:r}){let[i,a]=n.useState(e),[o,s]=n.useState(t),c=n.useCallback(e=>e.map(t=>{if(t.unlocked)return t;let n=!t.prerequisites||t.prerequisites.every(t=>e.find(e=>e.id===t)?.unlocked);return{...t,available:n}}),[]),l=n.useCallback(e=>{a(t=>{let n=t.find(t=>t.id===e);if(!n||n.unlocked||!n.available)return t;let i=n.cost||1;if(o<i)return t;s(e=>e-i);let a=c(t.map(t=>t.id===e?{...t,unlocked:!0,level:1}:t));return r?.(n,o-i),a})},[o,c,r]),u=n.useCallback(e=>{s(t=>t+e)},[]),d=n.useCallback(()=>{let t=i.filter(e=>e.unlocked).reduce((e,t)=>e+(t.cost||1),0);a(c(e.map(e=>({...e,unlocked:!1,level:0})))),s(e=>e+t)},[i,e,c]);return n.useEffect(()=>{a(e=>c(e))},[c]),{skills:i,skillPoints:o,unlockSkill:l,addPoints:u,resetSkills:d,totalUnlocked:i.filter(e=>e.unlocked).length,totalSkills:i.length,progress:i.length>0?i.filter(e=>e.unlocked).length/i.length*100:0}}exports.WakaSkillTree=f,exports.useSkillTree=p;
65
+ `})]})}function p({initialSkills:e,initialPoints:t=0,onSkillUnlock:r}){let[i,a]=n.useState(e),[o,s]=n.useState(t),c=n.useCallback(e=>e.map(t=>{if(t.unlocked)return t;let n=!t.prerequisites||t.prerequisites.every(t=>e.find(e=>e.id===t)?.unlocked);return{...t,available:n}}),[]),l=n.useCallback(e=>{a(t=>{let n=t.find(t=>t.id===e);if(!n||n.unlocked||!n.available)return t;let i=n.cost||1;if(o<i)return t;s(e=>e-i);let a=t.map(t=>t.id===e?{...t,unlocked:!0,level:1}:t),l=c(a);return r?.(n,o-i),l})},[o,c,r]),u=n.useCallback(e=>{s(t=>t+e)},[]),d=n.useCallback(()=>{let t=i.filter(e=>e.unlocked).reduce((e,t)=>e+(t.cost||1),0);a(c(e.map(e=>({...e,unlocked:!1,level:0})))),s(e=>e+t)},[i,e,c]);return n.useEffect(()=>{a(e=>c(e))},[c]),{skills:i,skillPoints:o,unlockSkill:l,addPoints:u,resetSkills:d,totalUnlocked:i.filter(e=>e.unlocked).length,totalSkills:i.length,progress:i.length>0?i.filter(e=>e.unlocked).length/i.length*100:0}}exports.WakaSkillTree=f,exports.useSkillTree=p;