@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(`../../components/badge/index.cjs.js`),r=require(`../../components/button/index.cjs.js`),i=require(`../../components/card/index.cjs.js`),a=require(`../../components/select/index.cjs.js`),o=require(`../../components/progress/index.cjs.js`);let s=require(`react`);s=e.__toESM(s);let c=require(`lucide-react`),l=require(`react/jsx-runtime`);var u={default:`text-foreground`,blue:`text-blue-500`,green:`text-green-500`,yellow:`text-yellow-500`,red:`text-red-500`,purple:`text-purple-500`},d={default:`bg-muted`,blue:`bg-blue-500/10`,green:`bg-green-500/10`,yellow:`bg-yellow-500/10`,red:`bg-red-500/10`,purple:`bg-purple-500/10`};function f({data:e,color:n=`blue`}){let r=Math.max(...e),i=Math.min(...e),a=r-i||1;return(0,l.jsx)(`svg`,{className:`w-16 h-8`,viewBox:`0 0 100 100`,preserveAspectRatio:`none`,children:(0,l.jsx)(`polyline`,{points:e.map((t,n)=>`${n/(e.length-1)*100},${100-(t-i)/a*100}`).join(` `),fill:`none`,stroke:`currentColor`,strokeWidth:`3`,className:t.cn(`opacity-60`,u[n]||u.blue)})})}function p({metric:e}){let n=e.icon,r=e.trend===`up`?`text-green-500`:e.trend===`down`?`text-red-500`:`text-muted-foreground`,a=e.trend===`up`?c.TrendingUp:e.trend===`down`?c.TrendingDown:null;return(0,l.jsxs)(i.Card,{className:`relative overflow-hidden`,children:[(0,l.jsxs)(i.CardHeader,{className:`flex flex-row items-center justify-between pb-2`,children:[(0,l.jsx)(i.CardTitle,{className:`text-sm font-medium text-muted-foreground`,children:e.label}),n&&(0,l.jsx)(`div`,{className:t.cn(`p-2 rounded-lg`,d[e.color||`default`]),children:(0,l.jsx)(`span`,{className:t.cn(`h-4 w-4`,u[e.color||`default`]),children:n})})]}),(0,l.jsxs)(i.CardContent,{children:[(0,l.jsxs)(`div`,{className:`flex items-end justify-between`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`div`,{className:`text-2xl font-bold`,children:e.value}),e.change!==void 0&&(0,l.jsxs)(`div`,{className:t.cn(`flex items-center gap-1 text-sm`,r),children:[a&&(0,l.jsx)(a,{className:`h-3 w-3`}),(0,l.jsxs)(`span`,{children:[e.change>0?`+`:``,e.change,`%`]}),e.changeLabel&&(0,l.jsx)(`span`,{className:`text-muted-foreground`,children:e.changeLabel})]})]}),e.sparkline&&(0,l.jsx)(f,{data:e.sparkline,color:e.color})]}),e.target!==void 0&&e.current!==void 0&&(0,l.jsxs)(`div`,{className:`mt-4`,children:[(0,l.jsxs)(`div`,{className:`flex justify-between text-xs text-muted-foreground mb-1`,children:[(0,l.jsx)(`span`,{children:`Progress`}),(0,l.jsxs)(`span`,{children:[Math.round(e.current/e.target*100),`%`]})]}),(0,l.jsx)(o.Progress,{value:e.current/e.target*100,className:`h-1.5`})]})]})]})}function m({goal:e}){let r=e.current/e.target*100,i=r>=100;return(0,l.jsxs)(`div`,{className:`flex items-center gap-4 p-4 rounded-lg border bg-card`,children:[(0,l.jsx)(`div`,{className:t.cn(`h-10 w-10 rounded-full flex items-center justify-center`,i?`bg-green-500/10 text-green-500`:`bg-muted text-muted-foreground`),children:(0,l.jsx)(c.Target,{className:`h-5 w-5`})}),(0,l.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,l.jsx)(`span`,{className:`font-medium truncate`,children:e.label}),(0,l.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[e.current,e.unit,` / `,e.target,e.unit]})]}),(0,l.jsx)(o.Progress,{value:Math.min(r,100),className:`h-2`})]}),i&&(0,l.jsx)(n.Badge,{variant:`default`,className:`bg-green-500`,children:`Complete`})]})}function h({title:e=`Dashboard`,description:o,metrics:s,periods:u=[{value:`7d`,label:`7 days`},{value:`30d`,label:`30 days`},{value:`90d`,label:`90 days`},{value:`12m`,label:`12 months`}],selectedPeriod:d=`30d`,onPeriodChange:f,onRefresh:h,onExport:g,chart:_,secondaryMetrics:v,goals:y,isLoading:b=!1,lastUpdated:x,className:S}){return(0,l.jsxs)(`div`,{className:t.cn(`space-y-6`,S),children:[(0,l.jsxs)(`div`,{className:`flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`h1`,{className:`text-2xl font-bold tracking-tight`,children:e}),o&&(0,l.jsx)(`p`,{className:`text-muted-foreground`,children:o})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[u.length>0&&(0,l.jsxs)(a.Select,{value:d,onValueChange:f,children:[(0,l.jsxs)(a.SelectTrigger,{className:`w-[140px]`,children:[(0,l.jsx)(c.Calendar,{className:`h-4 w-4 mr-2`}),(0,l.jsx)(a.SelectValue,{})]}),(0,l.jsx)(a.SelectContent,{children:u.map(e=>(0,l.jsx)(a.SelectItem,{value:e.value,children:e.label},e.value))})]}),h&&(0,l.jsx)(r.Button,{variant:`outline`,size:`icon`,onClick:h,disabled:b,children:(0,l.jsx)(c.RefreshCw,{className:t.cn(`h-4 w-4`,b&&`animate-spin`)})}),g&&(0,l.jsx)(r.Button,{variant:`outline`,size:`icon`,onClick:g,children:(0,l.jsx)(c.Download,{className:`h-4 w-4`})})]})]}),x&&(0,l.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,l.jsx)(c.Clock,{className:`h-4 w-4`}),(0,l.jsxs)(`span`,{children:[`Last updated: `,typeof x==`string`?x:x.toLocaleString()]})]}),(0,l.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2 lg:grid-cols-4`,children:s.slice(0,4).map(e=>(0,l.jsx)(p,{metric:e},e.id))}),_&&(0,l.jsxs)(i.Card,{children:[(0,l.jsxs)(i.CardHeader,{children:[(0,l.jsx)(i.CardTitle,{children:`Overview`}),(0,l.jsx)(i.CardDescription,{children:`Performance metrics over time`})]}),(0,l.jsx)(i.CardContent,{children:_})]}),v&&v.length>0&&(0,l.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2 lg:grid-cols-3`,children:v.map(e=>(0,l.jsx)(i.Card,{children:(0,l.jsx)(i.CardContent,{className:`pt-6`,children:(0,l.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.label}),(0,l.jsx)(`p`,{className:`text-xl font-bold`,children:e.value})]}),e.change!==void 0&&(0,l.jsxs)(n.Badge,{variant:e.trend===`up`?`default`:e.trend===`down`?`destructive`:`secondary`,className:`gap-1`,children:[e.trend===`up`?(0,l.jsx)(c.ArrowUpRight,{className:`h-3 w-3`}):e.trend===`down`?(0,l.jsx)(c.ArrowDownRight,{className:`h-3 w-3`}):null,e.change>0?`+`:``,e.change,`%`]})]})})},e.id))}),y&&y.length>0&&(0,l.jsxs)(i.Card,{children:[(0,l.jsxs)(i.CardHeader,{children:[(0,l.jsxs)(i.CardTitle,{className:`flex items-center gap-2`,children:[(0,l.jsx)(c.Target,{className:`h-5 w-5`}),`Goals & Targets`]}),(0,l.jsx)(i.CardDescription,{children:`Track your progress towards key objectives`})]}),(0,l.jsx)(i.CardContent,{className:`space-y-4`,children:y.map(e=>(0,l.jsx)(m,{goal:e},e.id))})]})]})}var g=[{id:`revenue`,label:`Total Revenue`,value:`$45,231.89`,change:20.1,changeLabel:`from last month`,trend:`up`,icon:(0,l.jsx)(c.DollarSign,{className:`h-4 w-4`}),color:`green`,sparkline:[30,40,35,50,49,60,70,91,125]},{id:`subscriptions`,label:`Subscriptions`,value:`+2,350`,change:180.1,changeLabel:`from last month`,trend:`up`,icon:(0,l.jsx)(c.Users,{className:`h-4 w-4`}),color:`blue`,sparkline:[10,20,30,40,50,60,70,80,90]},{id:`sales`,label:`Sales`,value:`+12,234`,change:19,changeLabel:`from last month`,trend:`up`,icon:(0,l.jsx)(c.ShoppingCart,{className:`h-4 w-4`}),color:`purple`,sparkline:[65,59,80,81,56,55,70,80,95]},{id:`active`,label:`Active Now`,value:`+573`,change:-2.5,changeLabel:`from last hour`,trend:`down`,icon:(0,l.jsx)(c.Activity,{className:`h-4 w-4`}),color:`yellow`,sparkline:[100,90,85,88,70,65,60,58,55]}],_=[{id:`revenue-goal`,label:`Monthly Revenue Target`,current:45231,target:5e4,unit:`$`},{id:`users-goal`,label:`New User Signups`,current:2350,target:2e3,unit:``},{id:`conversion-goal`,label:`Conversion Rate`,current:3.2,target:5,unit:`%`}];exports.default=h,exports.defaultGoals=_,exports.defaultKPIMetrics=g;
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js"),n=require("../../components/badge/index.cjs.js"),r=require("../../components/button/index.cjs.js"),i=require("../../components/card/index.cjs.js"),a=require("../../components/select/index.cjs.js"),o=require("../../components/progress/index.cjs.js");let s=require("react");s=e.__toESM(s);let c=require("lucide-react"),l=require("react/jsx-runtime");var u={default:`text-foreground`,blue:`text-blue-500`,green:`text-green-500`,yellow:`text-yellow-500`,red:`text-red-500`,purple:`text-purple-500`},d={default:`bg-muted`,blue:`bg-blue-500/10`,green:`bg-green-500/10`,yellow:`bg-yellow-500/10`,red:`bg-red-500/10`,purple:`bg-purple-500/10`};function f({data:e,color:n=`blue`}){let r=Math.max(...e),i=Math.min(...e),a=r-i||1;return(0,l.jsx)(`svg`,{className:`w-16 h-8`,viewBox:`0 0 100 100`,preserveAspectRatio:`none`,children:(0,l.jsx)(`polyline`,{points:e.map((t,n)=>`${n/(e.length-1)*100},${100-(t-i)/a*100}`).join(` `),fill:`none`,stroke:`currentColor`,strokeWidth:`3`,className:t.cn(`opacity-60`,u[n]||u.blue)})})}function p({metric:e}){let n=e.icon,r=e.trend===`up`?`text-green-500`:e.trend===`down`?`text-red-500`:`text-muted-foreground`,a=e.trend===`up`?c.TrendingUp:e.trend===`down`?c.TrendingDown:null;return(0,l.jsxs)(i.Card,{className:`relative overflow-hidden`,children:[(0,l.jsxs)(i.CardHeader,{className:`flex flex-row items-center justify-between pb-2`,children:[(0,l.jsx)(i.CardTitle,{className:`text-sm font-medium text-muted-foreground`,children:e.label}),n&&(0,l.jsx)(`div`,{className:t.cn(`p-2 rounded-lg`,d[e.color||`default`]),children:(0,l.jsx)(`span`,{className:t.cn(`h-4 w-4`,u[e.color||`default`]),children:n})})]}),(0,l.jsxs)(i.CardContent,{children:[(0,l.jsxs)(`div`,{className:`flex items-end justify-between`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`div`,{className:`text-2xl font-bold`,children:e.value}),e.change!==void 0&&(0,l.jsxs)(`div`,{className:t.cn(`flex items-center gap-1 text-sm`,r),children:[a&&(0,l.jsx)(a,{className:`h-3 w-3`}),(0,l.jsxs)(`span`,{children:[e.change>0?`+`:``,e.change,`%`]}),e.changeLabel&&(0,l.jsx)(`span`,{className:`text-muted-foreground`,children:e.changeLabel})]})]}),e.sparkline&&(0,l.jsx)(f,{data:e.sparkline,color:e.color})]}),e.target!==void 0&&e.current!==void 0&&(0,l.jsxs)(`div`,{className:`mt-4`,children:[(0,l.jsxs)(`div`,{className:`flex justify-between text-xs text-muted-foreground mb-1`,children:[(0,l.jsx)(`span`,{children:`Progress`}),(0,l.jsxs)(`span`,{children:[Math.round(e.current/e.target*100),`%`]})]}),(0,l.jsx)(o.Progress,{value:e.current/e.target*100,className:`h-1.5`})]})]})]})}function m({goal:e}){let r=e.current/e.target*100,i=r>=100;return(0,l.jsxs)(`div`,{className:`flex items-center gap-4 p-4 rounded-lg border bg-card`,children:[(0,l.jsx)(`div`,{className:t.cn(`h-10 w-10 rounded-full flex items-center justify-center`,i?`bg-green-500/10 text-green-500`:`bg-muted text-muted-foreground`),children:(0,l.jsx)(c.Target,{className:`h-5 w-5`})}),(0,l.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,l.jsx)(`span`,{className:`font-medium truncate`,children:e.label}),(0,l.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[e.current,e.unit,` / `,e.target,e.unit]})]}),(0,l.jsx)(o.Progress,{value:Math.min(r,100),className:`h-2`})]}),i&&(0,l.jsx)(n.Badge,{variant:`default`,className:`bg-green-500`,children:`Complete`})]})}function h({title:e=`Dashboard`,description:o,metrics:s,periods:u=[{value:`7d`,label:`7 days`},{value:`30d`,label:`30 days`},{value:`90d`,label:`90 days`},{value:`12m`,label:`12 months`}],selectedPeriod:d=`30d`,onPeriodChange:f,onRefresh:h,onExport:g,chart:_,secondaryMetrics:v,goals:y,isLoading:b=!1,lastUpdated:x,className:S}){return(0,l.jsxs)(`div`,{className:t.cn(`space-y-6`,S),children:[(0,l.jsxs)(`div`,{className:`flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`h1`,{className:`text-2xl font-bold tracking-tight`,children:e}),o&&(0,l.jsx)(`p`,{className:`text-muted-foreground`,children:o})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[u.length>0&&(0,l.jsxs)(a.Select,{value:d,onValueChange:f,children:[(0,l.jsxs)(a.SelectTrigger,{className:`w-[140px]`,children:[(0,l.jsx)(c.Calendar,{className:`h-4 w-4 mr-2`}),(0,l.jsx)(a.SelectValue,{})]}),(0,l.jsx)(a.SelectContent,{children:u.map(e=>(0,l.jsx)(a.SelectItem,{value:e.value,children:e.label},e.value))})]}),h&&(0,l.jsx)(r.Button,{variant:`outline`,size:`icon`,onClick:h,disabled:b,children:(0,l.jsx)(c.RefreshCw,{className:t.cn(`h-4 w-4`,b&&`animate-spin`)})}),g&&(0,l.jsx)(r.Button,{variant:`outline`,size:`icon`,onClick:g,children:(0,l.jsx)(c.Download,{className:`h-4 w-4`})})]})]}),x&&(0,l.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,l.jsx)(c.Clock,{className:`h-4 w-4`}),(0,l.jsxs)(`span`,{children:[`Last updated: `,typeof x==`string`?x:x.toLocaleString()]})]}),(0,l.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2 lg:grid-cols-4`,children:s.slice(0,4).map(e=>(0,l.jsx)(p,{metric:e},e.id))}),_&&(0,l.jsxs)(i.Card,{children:[(0,l.jsxs)(i.CardHeader,{children:[(0,l.jsx)(i.CardTitle,{children:`Overview`}),(0,l.jsx)(i.CardDescription,{children:`Performance metrics over time`})]}),(0,l.jsx)(i.CardContent,{children:_})]}),v&&v.length>0&&(0,l.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2 lg:grid-cols-3`,children:v.map(e=>(0,l.jsx)(i.Card,{children:(0,l.jsx)(i.CardContent,{className:`pt-6`,children:(0,l.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.label}),(0,l.jsx)(`p`,{className:`text-xl font-bold`,children:e.value})]}),e.change!==void 0&&(0,l.jsxs)(n.Badge,{variant:e.trend===`up`?`default`:e.trend===`down`?`destructive`:`secondary`,className:`gap-1`,children:[e.trend===`up`?(0,l.jsx)(c.ArrowUpRight,{className:`h-3 w-3`}):e.trend===`down`?(0,l.jsx)(c.ArrowDownRight,{className:`h-3 w-3`}):null,e.change>0?`+`:``,e.change,`%`]})]})})},e.id))}),y&&y.length>0&&(0,l.jsxs)(i.Card,{children:[(0,l.jsxs)(i.CardHeader,{children:[(0,l.jsxs)(i.CardTitle,{className:`flex items-center gap-2`,children:[(0,l.jsx)(c.Target,{className:`h-5 w-5`}),`Goals & Targets`]}),(0,l.jsx)(i.CardDescription,{children:`Track your progress towards key objectives`})]}),(0,l.jsx)(i.CardContent,{className:`space-y-4`,children:y.map(e=>(0,l.jsx)(m,{goal:e},e.id))})]})]})}var g=[{id:`revenue`,label:`Total Revenue`,value:`$45,231.89`,change:20.1,changeLabel:`from last month`,trend:`up`,icon:(0,l.jsx)(c.DollarSign,{className:`h-4 w-4`}),color:`green`,sparkline:[30,40,35,50,49,60,70,91,125]},{id:`subscriptions`,label:`Subscriptions`,value:`+2,350`,change:180.1,changeLabel:`from last month`,trend:`up`,icon:(0,l.jsx)(c.Users,{className:`h-4 w-4`}),color:`blue`,sparkline:[10,20,30,40,50,60,70,80,90]},{id:`sales`,label:`Sales`,value:`+12,234`,change:19,changeLabel:`from last month`,trend:`up`,icon:(0,l.jsx)(c.ShoppingCart,{className:`h-4 w-4`}),color:`purple`,sparkline:[65,59,80,81,56,55,70,80,95]},{id:`active`,label:`Active Now`,value:`+573`,change:-2.5,changeLabel:`from last hour`,trend:`down`,icon:(0,l.jsx)(c.Activity,{className:`h-4 w-4`}),color:`yellow`,sparkline:[100,90,85,88,70,65,60,58,55]}],_=[{id:`revenue-goal`,label:`Monthly Revenue Target`,current:45231,target:5e4,unit:`$`},{id:`users-goal`,label:`New User Signups`,current:2350,target:2e3,unit:``},{id:`conversion-goal`,label:`Conversion Rate`,current:3.2,target:5,unit:`%`}];exports.DashboardKPI=h,exports.default=h,exports.defaultGoals=_,exports.defaultKPIMetrics=g;
@@ -342,4 +342,4 @@ var F = [
342
342
  }
343
343
  ];
344
344
  //#endregion
345
- export { P as default, I as defaultGoals, F as defaultKPIMetrics };
345
+ export { P as DashboardKPI, P as default, I as defaultGoals, F as defaultKPIMetrics };
@@ -1 +1 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`),n=require(`../../components/badge/index.cjs.js`),r=require(`../../components/button/index.cjs.js`),i=require(`../../components/card/index.cjs.js`),a=require(`../../components/select/index.cjs.js`),o=require(`../../components/progress/index.cjs.js`),s=require(`../../components/scroll-area/index.cjs.js`),c=require(`../../components/tabs/index.cjs.js`),l=require(`../../components/textarea/index.cjs.js`);let u=require(`react`);u=e.__toESM(u);let d=require(`lucide-react`),f=require(`react/jsx-runtime`);var p={healthy:{color:`text-green-500`,bgColor:`bg-green-500`,label:`Healthy`},warning:{color:`text-yellow-500`,bgColor:`bg-yellow-500`,label:`Warning`},critical:{color:`text-red-500`,bgColor:`bg-red-500`,label:`Critical`},offline:{color:`text-gray-500`,bgColor:`bg-gray-500`,label:`Offline`}},m={active:{color:`text-green-500`,label:`Active`},idle:{color:`text-gray-500`,label:`Idle`},idle_in_transaction:{color:`text-yellow-500`,label:`Idle in Transaction`},waiting:{color:`text-orange-500`,label:`Waiting`}};function h(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(1)} GB`}function g(e){return e<60?`${e.toFixed(0)}s`:e<3600?`${Math.floor(e/60)}m ${Math.floor(e%60)}s`:`${Math.floor(e/3600)}h ${Math.floor(e%3600/60)}m`}function _(e){return e<1?`${(e*1e3).toFixed(0)}µs`:e<1e3?`${e.toFixed(2)}ms`:`${(e/1e3).toFixed(2)}s`}function v({metrics:e,status:r}){let a=p[r],s=e.connections.active/e.connections.max*100,c=e.storage.used/e.storage.total*100;return(0,f.jsxs)(`div`,{className:`grid grid-cols-4 gap-4`,children:[(0,f.jsx)(i.Card,{children:(0,f.jsxs)(i.CardContent,{className:`p-4`,children:[(0,f.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,f.jsx)(d.Users,{className:`h-4 w-4 text-muted-foreground`}),(0,f.jsx)(`div`,{className:t.cn(`w-2 h-2 rounded-full`,a.bgColor)})]}),(0,f.jsx)(`div`,{className:`text-2xl font-bold`,children:e.connections.active}),(0,f.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Active Connections`}),(0,f.jsxs)(`div`,{className:`mt-2`,children:[(0,f.jsxs)(`div`,{className:`flex justify-between text-xs mb-1`,children:[(0,f.jsxs)(`span`,{children:[e.connections.idle,` idle`]}),(0,f.jsxs)(`span`,{children:[`max `,e.connections.max]})]}),(0,f.jsx)(o.Progress,{value:s,className:t.cn(`h-1.5`,s>80&&`[&>div]:bg-red-500`)})]})]})}),(0,f.jsx)(i.Card,{children:(0,f.jsxs)(i.CardContent,{className:`p-4`,children:[(0,f.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,f.jsx)(d.Zap,{className:`h-4 w-4 text-muted-foreground`}),(0,f.jsxs)(n.Badge,{variant:`secondary`,className:`text-xs`,children:[e.transactions.perSecond,`/s`]})]}),(0,f.jsx)(`div`,{className:`text-2xl font-bold`,children:e.transactions.committed}),(0,f.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Transactions`}),(0,f.jsxs)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:[(0,f.jsx)(`span`,{className:`text-red-500`,children:e.transactions.rolledBack}),` rolled back`]})]})}),(0,f.jsx)(i.Card,{children:(0,f.jsxs)(i.CardContent,{className:`p-4`,children:[(0,f.jsx)(`div`,{className:`flex items-center justify-between mb-2`,children:(0,f.jsx)(d.Activity,{className:`h-4 w-4 text-muted-foreground`})}),(0,f.jsxs)(`div`,{className:t.cn(`text-2xl font-bold`,e.cache.hitRatio<90&&`text-yellow-500`,e.cache.hitRatio<80&&`text-red-500`),children:[e.cache.hitRatio.toFixed(1),`%`]}),(0,f.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Cache Hit Ratio`}),(0,f.jsxs)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:[`Buffer: `,e.cache.bufferHit,` • Disk: `,e.cache.diskRead]})]})}),(0,f.jsx)(i.Card,{children:(0,f.jsxs)(i.CardContent,{className:`p-4`,children:[(0,f.jsx)(`div`,{className:`flex items-center justify-between mb-2`,children:(0,f.jsx)(d.HardDrive,{className:`h-4 w-4 text-muted-foreground`})}),(0,f.jsx)(`div`,{className:`text-2xl font-bold`,children:h(e.storage.used)}),(0,f.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Storage Used`}),(0,f.jsxs)(`div`,{className:`mt-2`,children:[(0,f.jsx)(o.Progress,{value:c,className:t.cn(`h-1.5`,c>80&&`[&>div]:bg-red-500`)}),(0,f.jsxs)(`div`,{className:`text-xs text-muted-foreground mt-1`,children:[`of `,h(e.storage.total)]})]})]})})]})}function y({connections:e,onKill:a}){return(0,f.jsxs)(i.Card,{children:[(0,f.jsx)(i.CardHeader,{className:`pb-2`,children:(0,f.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,f.jsxs)(i.CardTitle,{className:`text-base flex items-center gap-2`,children:[(0,f.jsx)(d.Users,{className:`h-4 w-4`}),`Active Connections`]}),(0,f.jsx)(n.Badge,{variant:`secondary`,children:e.length})]})}),(0,f.jsx)(i.CardContent,{children:(0,f.jsx)(s.ScrollArea,{className:`h-[300px]`,children:(0,f.jsx)(`div`,{className:`space-y-2`,children:e.map(e=>{let i=m[e.state];return(0,f.jsxs)(`div`,{className:t.cn(`flex items-center gap-3 p-2 rounded-lg border`,e.state===`idle_in_transaction`&&`border-yellow-500/30`,e.duration>60&&`bg-yellow-500/5`),children:[(0,f.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,f.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,f.jsx)(`span`,{className:`font-medium`,children:e.user}),(0,f.jsx)(n.Badge,{variant:`outline`,className:t.cn(`text-xs`,i.color),children:i.label}),(0,f.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`@ `,e.database]})]}),e.query&&(0,f.jsx)(`code`,{className:`text-xs text-muted-foreground block truncate mt-1`,children:e.query})]}),(0,f.jsxs)(`div`,{className:`text-right shrink-0`,children:[(0,f.jsx)(`div`,{className:t.cn(`text-sm font-medium`,e.duration>60&&`text-yellow-500`,e.duration>300&&`text-red-500`),children:g(e.duration)}),(0,f.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e.client})]}),a&&e.state!==`idle`&&(0,f.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-8 w-8 p-0 text-red-500`,onClick:()=>a(e),children:(0,f.jsx)(d.XCircle,{className:`h-4 w-4`})})]},e.id)})})})})]})}function b({backups:e,onRestore:t,onCreate:a}){return(0,f.jsxs)(i.Card,{children:[(0,f.jsx)(i.CardHeader,{className:`pb-2`,children:(0,f.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,f.jsxs)(i.CardTitle,{className:`text-base flex items-center gap-2`,children:[(0,f.jsx)(d.Download,{className:`h-4 w-4`}),`Backups`]}),a&&(0,f.jsxs)(r.Button,{size:`sm`,onClick:a,children:[(0,f.jsx)(d.Upload,{className:`h-4 w-4 mr-1`}),`Create Backup`]})]})}),(0,f.jsx)(i.CardContent,{children:(0,f.jsx)(s.ScrollArea,{className:`h-[200px]`,children:(0,f.jsx)(`div`,{className:`space-y-2`,children:e.map(e=>(0,f.jsxs)(`div`,{className:`flex items-center gap-3 p-2 rounded-lg border`,children:[e.status===`completed`?(0,f.jsx)(d.CheckCircle2,{className:`h-4 w-4 text-green-500 shrink-0`}):e.status===`failed`?(0,f.jsx)(d.XCircle,{className:`h-4 w-4 text-red-500 shrink-0`}):e.status===`running`?(0,f.jsx)(d.RefreshCw,{className:`h-4 w-4 text-blue-500 animate-spin shrink-0`}):(0,f.jsx)(d.Clock,{className:`h-4 w-4 text-muted-foreground shrink-0`}),(0,f.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,f.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,f.jsx)(`span`,{className:`font-medium`,children:e.name}),(0,f.jsx)(n.Badge,{variant:`outline`,className:`text-xs`,children:e.type})]}),(0,f.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[e.startedAt.toLocaleString(),e.duration&&` • ${g(e.duration)}`]})]}),(0,f.jsx)(`div`,{className:`text-right shrink-0`,children:e.size&&(0,f.jsx)(`div`,{className:`text-sm font-medium`,children:h(e.size)})}),t&&e.status===`completed`&&(0,f.jsx)(r.Button,{variant:`ghost`,size:`sm`,onClick:()=>t(e),children:(0,f.jsx)(d.RotateCcw,{className:`h-4 w-4`})})]},e.id))})})})]})}function x({queries:e}){let[t,n]=u.useState(null),a=e=>{navigator.clipboard.writeText(e.query),n(e.id),setTimeout(()=>n(null),2e3)};return(0,f.jsxs)(i.Card,{children:[(0,f.jsx)(i.CardHeader,{className:`pb-2`,children:(0,f.jsxs)(i.CardTitle,{className:`text-base flex items-center gap-2`,children:[(0,f.jsx)(d.AlertTriangle,{className:`h-4 w-4 text-yellow-500`}),`Slow Queries`]})}),(0,f.jsx)(i.CardContent,{children:(0,f.jsx)(s.ScrollArea,{className:`h-[300px]`,children:(0,f.jsx)(`div`,{className:`space-y-2`,children:e.map(e=>(0,f.jsxs)(`div`,{className:`p-2 rounded-lg border bg-muted/30`,children:[(0,f.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,f.jsx)(`code`,{className:`text-xs font-mono line-clamp-2 flex-1`,children:e.query}),(0,f.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-6 w-6 p-0 shrink-0`,onClick:()=>a(e),children:t===e.id?(0,f.jsx)(d.CheckCircle2,{className:`h-3 w-3 text-green-500`}):(0,f.jsx)(d.Copy,{className:`h-3 w-3`})})]}),(0,f.jsxs)(`div`,{className:`flex items-center gap-4 mt-2 text-xs text-muted-foreground`,children:[(0,f.jsxs)(`span`,{children:[`Calls: `,(0,f.jsx)(`strong`,{children:e.calls})]}),(0,f.jsxs)(`span`,{children:[`Mean: `,(0,f.jsx)(`strong`,{className:`text-yellow-500`,children:_(e.meanTime)})]}),(0,f.jsxs)(`span`,{children:[`Max: `,(0,f.jsx)(`strong`,{className:`text-red-500`,children:_(e.maxTime)})]}),(0,f.jsxs)(`span`,{children:[`Total: `,(0,f.jsx)(`strong`,{children:_(e.totalTime)})]}),(0,f.jsxs)(`span`,{children:[`Rows: `,(0,f.jsx)(`strong`,{children:e.rows})]})]})]},e.id))})})})]})}function S({onExecute:e}){let[t,n]=u.useState(``),[o,s]=u.useState([]);return(0,f.jsxs)(i.Card,{children:[(0,f.jsx)(i.CardHeader,{className:`pb-2`,children:(0,f.jsxs)(i.CardTitle,{className:`text-base flex items-center gap-2`,children:[(0,f.jsx)(d.Terminal,{className:`h-4 w-4`}),`Query Editor`]})}),(0,f.jsxs)(i.CardContent,{className:`space-y-3`,children:[(0,f.jsx)(l.Textarea,{value:t,onChange:e=>n(e.target.value),placeholder:`SELECT * FROM users LIMIT 10;`,className:`font-mono text-sm min-h-[120px]`}),(0,f.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,f.jsx)(`div`,{className:`flex items-center gap-2`,children:o.length>0&&(0,f.jsxs)(a.Select,{onValueChange:e=>n(e),children:[(0,f.jsxs)(a.SelectTrigger,{className:`w-40`,children:[(0,f.jsx)(d.History,{className:`h-4 w-4 mr-2`}),`History`]}),(0,f.jsx)(a.SelectContent,{children:o.map((e,t)=>(0,f.jsx)(a.SelectItem,{value:e,children:(0,f.jsx)(`span`,{className:`truncate max-w-[300px]`,children:e})},t))})]})}),(0,f.jsxs)(r.Button,{onClick:()=>{t.trim()&&(e?.(t),s(e=>[t,...e.slice(0,9)]))},disabled:!t.trim(),children:[(0,f.jsx)(d.Play,{className:`h-4 w-4 mr-1`}),`Execute`]})]})]})]})}function C({instance:e,onExecuteQuery:a,onCreateBackup:o,onRestoreBackup:s,onKillConnection:l,onRefresh:u,className:m}){let h=p[e.status];return(0,f.jsxs)(`div`,{className:t.cn(`space-y-6`,m),children:[(0,f.jsx)(i.Card,{children:(0,f.jsx)(i.CardHeader,{children:(0,f.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,f.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,f.jsx)(d.Database,{className:`h-6 w-6`}),(0,f.jsxs)(`div`,{children:[(0,f.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,f.jsx)(i.CardTitle,{children:e.name}),(0,f.jsx)(n.Badge,{className:t.cn(`text-white`,h.bgColor),children:h.label}),(0,f.jsx)(n.Badge,{variant:`outline`,children:e.role})]}),(0,f.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[e.type,` `,e.version,` • `,e.host,`:`,e.port]})]})]}),(0,f.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.metrics.replication&&(0,f.jsxs)(n.Badge,{variant:`outline`,className:t.cn(e.metrics.replication.lag>1e3?`text-red-500`:e.metrics.replication.lag>100?`text-yellow-500`:`text-green-500`),children:[`Replication: `,_(e.metrics.replication.lag),` lag`]}),u&&(0,f.jsx)(r.Button,{variant:`outline`,onClick:u,children:(0,f.jsx)(d.RefreshCw,{className:`h-4 w-4`})})]})]})})}),(0,f.jsx)(v,{metrics:e.metrics,status:e.status}),(0,f.jsxs)(c.Tabs,{defaultValue:`connections`,children:[(0,f.jsxs)(c.TabsList,{children:[(0,f.jsxs)(c.TabsTrigger,{value:`connections`,children:[(0,f.jsx)(d.Users,{className:`h-4 w-4 mr-1`}),`Connections`]}),(0,f.jsxs)(c.TabsTrigger,{value:`queries`,children:[(0,f.jsx)(d.Terminal,{className:`h-4 w-4 mr-1`}),`Query`]}),(0,f.jsxs)(c.TabsTrigger,{value:`slow`,children:[(0,f.jsx)(d.AlertTriangle,{className:`h-4 w-4 mr-1`}),`Slow Queries`]}),(0,f.jsxs)(c.TabsTrigger,{value:`backups`,children:[(0,f.jsx)(d.Download,{className:`h-4 w-4 mr-1`}),`Backups`]})]}),(0,f.jsx)(c.TabsContent,{value:`connections`,className:`mt-4`,children:(0,f.jsx)(y,{connections:e.connections,onKill:l})}),(0,f.jsx)(c.TabsContent,{value:`queries`,className:`mt-4`,children:(0,f.jsx)(S,{onExecute:a})}),(0,f.jsx)(c.TabsContent,{value:`slow`,className:`mt-4`,children:(0,f.jsx)(x,{queries:e.slowQueries})}),(0,f.jsx)(c.TabsContent,{value:`backups`,className:`mt-4`,children:(0,f.jsx)(b,{backups:e.backups,onRestore:s,onCreate:o})})]})]})}var w={id:`1`,name:`production-db`,type:`postgresql`,version:`15.4`,host:`db.example.com`,port:5432,status:`healthy`,role:`primary`,metrics:{connections:{active:45,idle:25,max:100},transactions:{committed:125e3,rolledBack:15,perSecond:250},cache:{hitRatio:98.5,bufferHit:15e3,diskRead:250},storage:{used:85*1024*1024*1024,total:200*1024*1024*1024,tablespace:75*1024*1024*1024,indexes:10*1024*1024*1024},replication:{lag:25,state:`streaming`,replicas:2}},connections:[{id:`1`,user:`api_user`,database:`production`,state:`active`,query:`SELECT * FROM users WHERE id = $1`,duration:.5,client:`192.168.1.10`},{id:`2`,user:`api_user`,database:`production`,state:`active`,query:`UPDATE orders SET status = $1 WHERE id = $2`,duration:1.2,client:`192.168.1.11`},{id:`3`,user:`analytics`,database:`production`,state:`idle_in_transaction`,query:`SELECT COUNT(*) FROM events WHERE...`,duration:125,client:`192.168.1.20`},{id:`4`,user:`admin`,database:`production`,state:`idle`,duration:300,client:`192.168.1.5`},{id:`5`,user:`api_user`,database:`production`,state:`active`,duration:.1,client:`192.168.1.12`}],backups:[{id:`1`,name:`daily-backup-20240110`,type:`full`,status:`completed`,size:45*1024*1024*1024,startedAt:new Date(Date.now()-4*36e5),completedAt:new Date(Date.now()-2*36e5),duration:7200},{id:`2`,name:`hourly-backup-20240110-12`,type:`incremental`,status:`completed`,size:250*1024*1024,startedAt:new Date(Date.now()-1*36e5),completedAt:new Date(Date.now()-50*6e4),duration:600},{id:`3`,name:`hourly-backup-20240110-13`,type:`incremental`,status:`running`,startedAt:new Date(Date.now()-5*6e4)},{id:`4`,name:`daily-backup-20240111`,type:`full`,status:`scheduled`,startedAt:new Date(Date.now()+8*36e5)}],slowQueries:[{id:`1`,query:`SELECT * FROM orders o JOIN order_items oi ON o.id = oi.order_id WHERE o.created_at > $1 AND o.status = $2`,calls:1250,totalTime:45e3,meanTime:36,maxTime:520,rows:15e3},{id:`2`,query:`SELECT u.*, COUNT(o.id) as order_count FROM users u LEFT JOIN orders o ON u.id = o.user_id GROUP BY u.id ORDER BY order_count DESC LIMIT 100`,calls:500,totalTime:85e3,meanTime:170,maxTime:1200,rows:100},{id:`3`,query:`UPDATE products SET view_count = view_count + 1 WHERE id = $1`,calls:5e4,totalTime:25e3,meanTime:.5,maxTime:15,rows:1},{id:`4`,query:`SELECT * FROM analytics_events WHERE event_type = $1 AND created_at BETWEEN $2 AND $3`,calls:250,totalTime:125e3,meanTime:500,maxTime:3500,rows:5e4}]};exports.DatabaseAdmin=C,exports.defaultDatabaseInstance=w;
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js"),n=require("../../components/badge/index.cjs.js"),r=require("../../components/button/index.cjs.js"),i=require("../../components/card/index.cjs.js"),a=require("../../components/select/index.cjs.js"),o=require("../../components/progress/index.cjs.js"),s=require("../../components/scroll-area/index.cjs.js"),c=require("../../components/tabs/index.cjs.js"),l=require("../../components/textarea/index.cjs.js");let u=require("react");u=e.__toESM(u);let d=require("lucide-react"),f=require("react/jsx-runtime");var p={healthy:{color:`text-green-500`,bgColor:`bg-green-500`,label:`Healthy`},warning:{color:`text-yellow-500`,bgColor:`bg-yellow-500`,label:`Warning`},critical:{color:`text-red-500`,bgColor:`bg-red-500`,label:`Critical`},offline:{color:`text-gray-500`,bgColor:`bg-gray-500`,label:`Offline`}},m={active:{color:`text-green-500`,label:`Active`},idle:{color:`text-gray-500`,label:`Idle`},idle_in_transaction:{color:`text-yellow-500`,label:`Idle in Transaction`},waiting:{color:`text-orange-500`,label:`Waiting`}};function h(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(1)} GB`}function g(e){return e<60?`${e.toFixed(0)}s`:e<3600?`${Math.floor(e/60)}m ${Math.floor(e%60)}s`:`${Math.floor(e/3600)}h ${Math.floor(e%3600/60)}m`}function _(e){return e<1?`${(e*1e3).toFixed(0)}µs`:e<1e3?`${e.toFixed(2)}ms`:`${(e/1e3).toFixed(2)}s`}function v({metrics:e,status:r}){let a=p[r],s=e.connections.active/e.connections.max*100,c=e.storage.used/e.storage.total*100;return(0,f.jsxs)(`div`,{className:`grid grid-cols-4 gap-4`,children:[(0,f.jsx)(i.Card,{children:(0,f.jsxs)(i.CardContent,{className:`p-4`,children:[(0,f.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,f.jsx)(d.Users,{className:`h-4 w-4 text-muted-foreground`}),(0,f.jsx)(`div`,{className:t.cn(`w-2 h-2 rounded-full`,a.bgColor)})]}),(0,f.jsx)(`div`,{className:`text-2xl font-bold`,children:e.connections.active}),(0,f.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Active Connections`}),(0,f.jsxs)(`div`,{className:`mt-2`,children:[(0,f.jsxs)(`div`,{className:`flex justify-between text-xs mb-1`,children:[(0,f.jsxs)(`span`,{children:[e.connections.idle,` idle`]}),(0,f.jsxs)(`span`,{children:[`max `,e.connections.max]})]}),(0,f.jsx)(o.Progress,{value:s,className:t.cn(`h-1.5`,s>80&&`[&>div]:bg-red-500`)})]})]})}),(0,f.jsx)(i.Card,{children:(0,f.jsxs)(i.CardContent,{className:`p-4`,children:[(0,f.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,f.jsx)(d.Zap,{className:`h-4 w-4 text-muted-foreground`}),(0,f.jsxs)(n.Badge,{variant:`secondary`,className:`text-xs`,children:[e.transactions.perSecond,`/s`]})]}),(0,f.jsx)(`div`,{className:`text-2xl font-bold`,children:e.transactions.committed}),(0,f.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Transactions`}),(0,f.jsxs)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:[(0,f.jsx)(`span`,{className:`text-red-500`,children:e.transactions.rolledBack}),` rolled back`]})]})}),(0,f.jsx)(i.Card,{children:(0,f.jsxs)(i.CardContent,{className:`p-4`,children:[(0,f.jsx)(`div`,{className:`flex items-center justify-between mb-2`,children:(0,f.jsx)(d.Activity,{className:`h-4 w-4 text-muted-foreground`})}),(0,f.jsxs)(`div`,{className:t.cn(`text-2xl font-bold`,e.cache.hitRatio<90&&`text-yellow-500`,e.cache.hitRatio<80&&`text-red-500`),children:[e.cache.hitRatio.toFixed(1),`%`]}),(0,f.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Cache Hit Ratio`}),(0,f.jsxs)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:[`Buffer: `,e.cache.bufferHit,` • Disk: `,e.cache.diskRead]})]})}),(0,f.jsx)(i.Card,{children:(0,f.jsxs)(i.CardContent,{className:`p-4`,children:[(0,f.jsx)(`div`,{className:`flex items-center justify-between mb-2`,children:(0,f.jsx)(d.HardDrive,{className:`h-4 w-4 text-muted-foreground`})}),(0,f.jsx)(`div`,{className:`text-2xl font-bold`,children:h(e.storage.used)}),(0,f.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Storage Used`}),(0,f.jsxs)(`div`,{className:`mt-2`,children:[(0,f.jsx)(o.Progress,{value:c,className:t.cn(`h-1.5`,c>80&&`[&>div]:bg-red-500`)}),(0,f.jsxs)(`div`,{className:`text-xs text-muted-foreground mt-1`,children:[`of `,h(e.storage.total)]})]})]})})]})}function y({connections:e,onKill:a}){return(0,f.jsxs)(i.Card,{children:[(0,f.jsx)(i.CardHeader,{className:`pb-2`,children:(0,f.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,f.jsxs)(i.CardTitle,{className:`text-base flex items-center gap-2`,children:[(0,f.jsx)(d.Users,{className:`h-4 w-4`}),`Active Connections`]}),(0,f.jsx)(n.Badge,{variant:`secondary`,children:e.length})]})}),(0,f.jsx)(i.CardContent,{children:(0,f.jsx)(s.ScrollArea,{className:`h-[300px]`,children:(0,f.jsx)(`div`,{className:`space-y-2`,children:e.map(e=>{let i=m[e.state];return(0,f.jsxs)(`div`,{className:t.cn(`flex items-center gap-3 p-2 rounded-lg border`,e.state===`idle_in_transaction`&&`border-yellow-500/30`,e.duration>60&&`bg-yellow-500/5`),children:[(0,f.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,f.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,f.jsx)(`span`,{className:`font-medium`,children:e.user}),(0,f.jsx)(n.Badge,{variant:`outline`,className:t.cn(`text-xs`,i.color),children:i.label}),(0,f.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`@ `,e.database]})]}),e.query&&(0,f.jsx)(`code`,{className:`text-xs text-muted-foreground block truncate mt-1`,children:e.query})]}),(0,f.jsxs)(`div`,{className:`text-right shrink-0`,children:[(0,f.jsx)(`div`,{className:t.cn(`text-sm font-medium`,e.duration>60&&`text-yellow-500`,e.duration>300&&`text-red-500`),children:g(e.duration)}),(0,f.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e.client})]}),a&&e.state!==`idle`&&(0,f.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-8 w-8 p-0 text-red-500`,onClick:()=>a(e),children:(0,f.jsx)(d.XCircle,{className:`h-4 w-4`})})]},e.id)})})})})]})}function b({backups:e,onRestore:t,onCreate:a}){return(0,f.jsxs)(i.Card,{children:[(0,f.jsx)(i.CardHeader,{className:`pb-2`,children:(0,f.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,f.jsxs)(i.CardTitle,{className:`text-base flex items-center gap-2`,children:[(0,f.jsx)(d.Download,{className:`h-4 w-4`}),`Backups`]}),a&&(0,f.jsxs)(r.Button,{size:`sm`,onClick:a,children:[(0,f.jsx)(d.Upload,{className:`h-4 w-4 mr-1`}),`Create Backup`]})]})}),(0,f.jsx)(i.CardContent,{children:(0,f.jsx)(s.ScrollArea,{className:`h-[200px]`,children:(0,f.jsx)(`div`,{className:`space-y-2`,children:e.map(e=>(0,f.jsxs)(`div`,{className:`flex items-center gap-3 p-2 rounded-lg border`,children:[e.status===`completed`?(0,f.jsx)(d.CheckCircle2,{className:`h-4 w-4 text-green-500 shrink-0`}):e.status===`failed`?(0,f.jsx)(d.XCircle,{className:`h-4 w-4 text-red-500 shrink-0`}):e.status===`running`?(0,f.jsx)(d.RefreshCw,{className:`h-4 w-4 text-blue-500 animate-spin shrink-0`}):(0,f.jsx)(d.Clock,{className:`h-4 w-4 text-muted-foreground shrink-0`}),(0,f.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,f.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,f.jsx)(`span`,{className:`font-medium`,children:e.name}),(0,f.jsx)(n.Badge,{variant:`outline`,className:`text-xs`,children:e.type})]}),(0,f.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[e.startedAt.toLocaleString(),e.duration&&` • ${g(e.duration)}`]})]}),(0,f.jsx)(`div`,{className:`text-right shrink-0`,children:e.size&&(0,f.jsx)(`div`,{className:`text-sm font-medium`,children:h(e.size)})}),t&&e.status===`completed`&&(0,f.jsx)(r.Button,{variant:`ghost`,size:`sm`,onClick:()=>t(e),children:(0,f.jsx)(d.RotateCcw,{className:`h-4 w-4`})})]},e.id))})})})]})}function x({queries:e}){let[t,n]=u.useState(null),a=e=>{navigator.clipboard.writeText(e.query),n(e.id),setTimeout(()=>n(null),2e3)};return(0,f.jsxs)(i.Card,{children:[(0,f.jsx)(i.CardHeader,{className:`pb-2`,children:(0,f.jsxs)(i.CardTitle,{className:`text-base flex items-center gap-2`,children:[(0,f.jsx)(d.AlertTriangle,{className:`h-4 w-4 text-yellow-500`}),`Slow Queries`]})}),(0,f.jsx)(i.CardContent,{children:(0,f.jsx)(s.ScrollArea,{className:`h-[300px]`,children:(0,f.jsx)(`div`,{className:`space-y-2`,children:e.map(e=>(0,f.jsxs)(`div`,{className:`p-2 rounded-lg border bg-muted/30`,children:[(0,f.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,f.jsx)(`code`,{className:`text-xs font-mono line-clamp-2 flex-1`,children:e.query}),(0,f.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-6 w-6 p-0 shrink-0`,onClick:()=>a(e),children:t===e.id?(0,f.jsx)(d.CheckCircle2,{className:`h-3 w-3 text-green-500`}):(0,f.jsx)(d.Copy,{className:`h-3 w-3`})})]}),(0,f.jsxs)(`div`,{className:`flex items-center gap-4 mt-2 text-xs text-muted-foreground`,children:[(0,f.jsxs)(`span`,{children:[`Calls: `,(0,f.jsx)(`strong`,{children:e.calls})]}),(0,f.jsxs)(`span`,{children:[`Mean: `,(0,f.jsx)(`strong`,{className:`text-yellow-500`,children:_(e.meanTime)})]}),(0,f.jsxs)(`span`,{children:[`Max: `,(0,f.jsx)(`strong`,{className:`text-red-500`,children:_(e.maxTime)})]}),(0,f.jsxs)(`span`,{children:[`Total: `,(0,f.jsx)(`strong`,{children:_(e.totalTime)})]}),(0,f.jsxs)(`span`,{children:[`Rows: `,(0,f.jsx)(`strong`,{children:e.rows})]})]})]},e.id))})})})]})}function S({onExecute:e}){let[t,n]=u.useState(``),[o,s]=u.useState([]);return(0,f.jsxs)(i.Card,{children:[(0,f.jsx)(i.CardHeader,{className:`pb-2`,children:(0,f.jsxs)(i.CardTitle,{className:`text-base flex items-center gap-2`,children:[(0,f.jsx)(d.Terminal,{className:`h-4 w-4`}),`Query Editor`]})}),(0,f.jsxs)(i.CardContent,{className:`space-y-3`,children:[(0,f.jsx)(l.Textarea,{value:t,onChange:e=>n(e.target.value),placeholder:`SELECT * FROM users LIMIT 10;`,className:`font-mono text-sm min-h-[120px]`}),(0,f.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,f.jsx)(`div`,{className:`flex items-center gap-2`,children:o.length>0&&(0,f.jsxs)(a.Select,{onValueChange:e=>n(e),children:[(0,f.jsxs)(a.SelectTrigger,{className:`w-40`,children:[(0,f.jsx)(d.History,{className:`h-4 w-4 mr-2`}),`History`]}),(0,f.jsx)(a.SelectContent,{children:o.map((e,t)=>(0,f.jsx)(a.SelectItem,{value:e,children:(0,f.jsx)(`span`,{className:`truncate max-w-[300px]`,children:e})},t))})]})}),(0,f.jsxs)(r.Button,{onClick:()=>{t.trim()&&(e?.(t),s(e=>[t,...e.slice(0,9)]))},disabled:!t.trim(),children:[(0,f.jsx)(d.Play,{className:`h-4 w-4 mr-1`}),`Execute`]})]})]})]})}function C({instance:e,onExecuteQuery:a,onCreateBackup:o,onRestoreBackup:s,onKillConnection:l,onRefresh:u,className:m}){let h=p[e.status];return(0,f.jsxs)(`div`,{className:t.cn(`space-y-6`,m),children:[(0,f.jsx)(i.Card,{children:(0,f.jsx)(i.CardHeader,{children:(0,f.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,f.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,f.jsx)(d.Database,{className:`h-6 w-6`}),(0,f.jsxs)(`div`,{children:[(0,f.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,f.jsx)(i.CardTitle,{children:e.name}),(0,f.jsx)(n.Badge,{className:t.cn(`text-white`,h.bgColor),children:h.label}),(0,f.jsx)(n.Badge,{variant:`outline`,children:e.role})]}),(0,f.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[e.type,` `,e.version,` • `,e.host,`:`,e.port]})]})]}),(0,f.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.metrics.replication&&(0,f.jsxs)(n.Badge,{variant:`outline`,className:t.cn(e.metrics.replication.lag>1e3?`text-red-500`:e.metrics.replication.lag>100?`text-yellow-500`:`text-green-500`),children:[`Replication: `,_(e.metrics.replication.lag),` lag`]}),u&&(0,f.jsx)(r.Button,{variant:`outline`,onClick:u,children:(0,f.jsx)(d.RefreshCw,{className:`h-4 w-4`})})]})]})})}),(0,f.jsx)(v,{metrics:e.metrics,status:e.status}),(0,f.jsxs)(c.Tabs,{defaultValue:`connections`,children:[(0,f.jsxs)(c.TabsList,{children:[(0,f.jsxs)(c.TabsTrigger,{value:`connections`,children:[(0,f.jsx)(d.Users,{className:`h-4 w-4 mr-1`}),`Connections`]}),(0,f.jsxs)(c.TabsTrigger,{value:`queries`,children:[(0,f.jsx)(d.Terminal,{className:`h-4 w-4 mr-1`}),`Query`]}),(0,f.jsxs)(c.TabsTrigger,{value:`slow`,children:[(0,f.jsx)(d.AlertTriangle,{className:`h-4 w-4 mr-1`}),`Slow Queries`]}),(0,f.jsxs)(c.TabsTrigger,{value:`backups`,children:[(0,f.jsx)(d.Download,{className:`h-4 w-4 mr-1`}),`Backups`]})]}),(0,f.jsx)(c.TabsContent,{value:`connections`,className:`mt-4`,children:(0,f.jsx)(y,{connections:e.connections,onKill:l})}),(0,f.jsx)(c.TabsContent,{value:`queries`,className:`mt-4`,children:(0,f.jsx)(S,{onExecute:a})}),(0,f.jsx)(c.TabsContent,{value:`slow`,className:`mt-4`,children:(0,f.jsx)(x,{queries:e.slowQueries})}),(0,f.jsx)(c.TabsContent,{value:`backups`,className:`mt-4`,children:(0,f.jsx)(b,{backups:e.backups,onRestore:s,onCreate:o})})]})]})}var w={id:`1`,name:`production-db`,type:`postgresql`,version:`15.4`,host:`db.example.com`,port:5432,status:`healthy`,role:`primary`,metrics:{connections:{active:45,idle:25,max:100},transactions:{committed:125e3,rolledBack:15,perSecond:250},cache:{hitRatio:98.5,bufferHit:15e3,diskRead:250},storage:{used:85*1024*1024*1024,total:200*1024*1024*1024,tablespace:75*1024*1024*1024,indexes:10*1024*1024*1024},replication:{lag:25,state:`streaming`,replicas:2}},connections:[{id:`1`,user:`api_user`,database:`production`,state:`active`,query:`SELECT * FROM users WHERE id = $1`,duration:.5,client:`192.168.1.10`},{id:`2`,user:`api_user`,database:`production`,state:`active`,query:`UPDATE orders SET status = $1 WHERE id = $2`,duration:1.2,client:`192.168.1.11`},{id:`3`,user:`analytics`,database:`production`,state:`idle_in_transaction`,query:`SELECT COUNT(*) FROM events WHERE...`,duration:125,client:`192.168.1.20`},{id:`4`,user:`admin`,database:`production`,state:`idle`,duration:300,client:`192.168.1.5`},{id:`5`,user:`api_user`,database:`production`,state:`active`,duration:.1,client:`192.168.1.12`}],backups:[{id:`1`,name:`daily-backup-20240110`,type:`full`,status:`completed`,size:45*1024*1024*1024,startedAt:new Date(Date.now()-4*36e5),completedAt:new Date(Date.now()-2*36e5),duration:7200},{id:`2`,name:`hourly-backup-20240110-12`,type:`incremental`,status:`completed`,size:250*1024*1024,startedAt:new Date(Date.now()-1*36e5),completedAt:new Date(Date.now()-50*6e4),duration:600},{id:`3`,name:`hourly-backup-20240110-13`,type:`incremental`,status:`running`,startedAt:new Date(Date.now()-5*6e4)},{id:`4`,name:`daily-backup-20240111`,type:`full`,status:`scheduled`,startedAt:new Date(Date.now()+8*36e5)}],slowQueries:[{id:`1`,query:`SELECT * FROM orders o JOIN order_items oi ON o.id = oi.order_id WHERE o.created_at > $1 AND o.status = $2`,calls:1250,totalTime:45e3,meanTime:36,maxTime:520,rows:15e3},{id:`2`,query:`SELECT u.*, COUNT(o.id) as order_count FROM users u LEFT JOIN orders o ON u.id = o.user_id GROUP BY u.id ORDER BY order_count DESC LIMIT 100`,calls:500,totalTime:85e3,meanTime:170,maxTime:1200,rows:100},{id:`3`,query:`UPDATE products SET view_count = view_count + 1 WHERE id = $1`,calls:5e4,totalTime:25e3,meanTime:.5,maxTime:15,rows:1},{id:`4`,query:`SELECT * FROM analytics_events WHERE event_type = $1 AND created_at BETWEEN $2 AND $3`,calls:250,totalTime:125e3,meanTime:500,maxTime:3500,rows:5e4}]};exports.DatabaseAdmin=C,exports.defaultDatabaseInstance=w;
@@ -1 +1 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`),n=require(`../../components/avatar/index.cjs.js`),r=require(`../../components/badge/index.cjs.js`),i=require(`../../components/button/index.cjs.js`),a=require(`../../components/card/index.cjs.js`),o=require(`../../components/select/index.cjs.js`),s=require(`../../components/progress/index.cjs.js`),c=require(`../../components/tabs/index.cjs.js`);let l=require(`react`);l=e.__toESM(l);let u=require(`lucide-react`),d=require(`react/jsx-runtime`);var f={pending:{color:`text-yellow-500 bg-yellow-500/10`,icon:(0,d.jsx)(u.Clock,{className:`h-4 w-4`}),label:`Pending`},building:{color:`text-blue-500 bg-blue-500/10`,icon:(0,d.jsx)(u.Loader2,{className:`h-4 w-4 animate-spin`}),label:`Building`},deploying:{color:`text-purple-500 bg-purple-500/10`,icon:(0,d.jsx)(u.Rocket,{className:`h-4 w-4 animate-pulse`}),label:`Deploying`},success:{color:`text-green-500 bg-green-500/10`,icon:(0,d.jsx)(u.CheckCircle,{className:`h-4 w-4`}),label:`Success`},failed:{color:`text-red-500 bg-red-500/10`,icon:(0,d.jsx)(u.XCircle,{className:`h-4 w-4`}),label:`Failed`},cancelled:{color:`text-gray-500 bg-gray-500/10`,icon:(0,d.jsx)(u.XCircle,{className:`h-4 w-4`}),label:`Cancelled`},rollback:{color:`text-orange-500 bg-orange-500/10`,icon:(0,d.jsx)(u.RotateCcw,{className:`h-4 w-4`}),label:`Rollback`}},p={development:{color:`text-blue-500 border-blue-500/30 bg-blue-500/10`,icon:(0,d.jsx)(u.Terminal,{className:`h-4 w-4`})},staging:{color:`text-yellow-500 border-yellow-500/30 bg-yellow-500/10`,icon:(0,d.jsx)(u.Server,{className:`h-4 w-4`})},production:{color:`text-green-500 border-green-500/30 bg-green-500/10`,icon:(0,d.jsx)(u.Globe,{className:`h-4 w-4`})}};function m({status:e}){let n=f[e];return(0,d.jsxs)(r.Badge,{variant:`outline`,className:t.cn(`gap-1`,n.color),children:[n.icon,n.label]})}function h({environment:e}){let n=p[e];return(0,d.jsxs)(r.Badge,{variant:`outline`,className:t.cn(`gap-1 capitalize`,n.color),children:[n.icon,e]})}function g({deployment:e,onRollback:t,onCancel:r,onRetry:a}){let o=e.status===`building`||e.status===`deploying`,s=e.status===`success`&&e.environment===`production`,c=e.status===`failed`,l=o;return(0,d.jsx)(`div`,{className:`p-4 rounded-lg border bg-card hover:bg-muted/50 transition-colors`,children:(0,d.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,d.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,d.jsxs)(n.Avatar,{className:`h-10 w-10`,children:[(0,d.jsx)(n.AvatarImage,{src:e.author.avatar}),(0,d.jsx)(n.AvatarFallback,{children:e.author.name.slice(0,2).toUpperCase()})]}),(0,d.jsxs)(`div`,{children:[(0,d.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,d.jsx)(m,{status:e.status}),(0,d.jsx)(h,{environment:e.environment})]}),(0,d.jsx)(`p`,{className:`text-sm mt-1 line-clamp-1`,children:e.commitMessage}),(0,d.jsxs)(`div`,{className:`flex items-center gap-3 mt-2 text-xs text-muted-foreground`,children:[(0,d.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,d.jsx)(u.GitBranch,{className:`h-3 w-3`}),e.branch]}),(0,d.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,d.jsx)(u.GitCommit,{className:`h-3 w-3`}),e.commit.slice(0,7)]}),(0,d.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,d.jsx)(u.Clock,{className:`h-3 w-3`}),typeof e.startedAt==`string`?e.startedAt:y(e.startedAt)]}),e.duration&&(0,d.jsx)(`span`,{children:e.duration})]})]})]}),(0,d.jsxs)(`div`,{className:`flex items-center gap-1`,children:[e.url&&(0,d.jsx)(i.Button,{variant:`ghost`,size:`icon`,asChild:!0,children:(0,d.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:(0,d.jsx)(u.ExternalLink,{className:`h-4 w-4`})})}),l&&(0,d.jsx)(i.Button,{variant:`ghost`,size:`icon`,onClick:r,children:(0,d.jsx)(u.Pause,{className:`h-4 w-4`})}),c&&(0,d.jsx)(i.Button,{variant:`ghost`,size:`icon`,onClick:a,children:(0,d.jsx)(u.RefreshCw,{className:`h-4 w-4`})}),s&&(0,d.jsx)(i.Button,{variant:`ghost`,size:`icon`,onClick:t,children:(0,d.jsx)(u.RotateCcw,{className:`h-4 w-4`})})]})]})})}function _({pipeline:e}){let n=e.stages.filter(e=>e.status===`success`).length/e.stages.length*100;return(0,d.jsxs)(a.Card,{children:[(0,d.jsxs)(a.CardHeader,{className:`pb-2`,children:[(0,d.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,d.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,d.jsx)(m,{status:e.status}),(0,d.jsx)(`span`,{className:`font-medium`,children:e.name})]}),(0,d.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:typeof e.startedAt==`string`?e.startedAt:y(e.startedAt)})]}),(0,d.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,d.jsx)(u.GitBranch,{className:`h-3 w-3`}),e.branch,(0,d.jsx)(`span`,{className:`mx-1`,children:`•`}),`Triggered by `,e.trigger]})]}),(0,d.jsx)(a.CardContent,{children:(0,d.jsxs)(`div`,{className:`space-y-3`,children:[(0,d.jsx)(s.Progress,{value:n,className:`h-2`}),(0,d.jsx)(`div`,{className:`flex items-center justify-between`,children:e.stages.map((n,r)=>(0,d.jsxs)(l.Fragment,{children:[(0,d.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,d.jsx)(`div`,{className:t.cn(`h-8 w-8 rounded-full flex items-center justify-center`,f[n.status].color),children:f[n.status].icon}),(0,d.jsx)(`span`,{className:`text-xs`,children:n.name}),n.duration&&(0,d.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n.duration})]}),r<e.stages.length-1&&(0,d.jsx)(u.ChevronRight,{className:`h-4 w-4 text-muted-foreground`})]},n.id))})]})})]})}function v({env:e}){let n={healthy:`text-green-500`,degraded:`text-yellow-500`,down:`text-red-500`},r={healthy:(0,d.jsx)(u.CheckCircle,{className:`h-5 w-5`}),degraded:(0,d.jsx)(u.AlertCircle,{className:`h-5 w-5`}),down:(0,d.jsx)(u.XCircle,{className:`h-5 w-5`})};return(0,d.jsxs)(a.Card,{children:[(0,d.jsx)(a.CardHeader,{className:`pb-2`,children:(0,d.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,d.jsxs)(a.CardTitle,{className:`capitalize flex items-center gap-2`,children:[p[e.name].icon,e.name]}),(0,d.jsxs)(`div`,{className:t.cn(`flex items-center gap-1`,n[e.status]),children:[r[e.status],(0,d.jsx)(`span`,{className:`text-sm capitalize`,children:e.status})]})]})}),(0,d.jsxs)(a.CardContent,{className:`space-y-4`,children:[(0,d.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,d.jsx)(u.ExternalLink,{className:`h-4 w-4 text-muted-foreground`}),(0,d.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-primary hover:underline truncate`,children:e.url})]}),(0,d.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 text-sm`,children:[e.uptime&&(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`Uptime`}),(0,d.jsx)(`p`,{className:`font-medium`,children:e.uptime})]}),e.responseTime&&(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`Response Time`}),(0,d.jsx)(`p`,{className:`font-medium`,children:e.responseTime})]})]}),e.lastDeployment&&(0,d.jsxs)(`div`,{className:`pt-2 border-t`,children:[(0,d.jsx)(`p`,{className:`text-xs text-muted-foreground mb-1`,children:`Last Deployment`}),(0,d.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,d.jsx)(m,{status:e.lastDeployment.status}),(0,d.jsx)(`span`,{className:`text-muted-foreground`,children:typeof e.lastDeployment.startedAt==`string`?e.lastDeployment.startedAt:y(e.lastDeployment.startedAt)})]})]})]})]})}function y(e){let t=new Date().getTime()-e.getTime(),n=Math.floor(t/6e4),r=Math.floor(n/60),i=Math.floor(r/24);return n<1?`just now`:n<60?`${n}m ago`:r<24?`${r}h ago`:`${i}d ago`}function b({deployments:e=[],pipelines:n=[],environments:r=[],onDeploy:s,onRollback:f,onCancel:p,onRetry:m,branches:h=[`main`,`develop`,`staging`],className:y}){let[b,x]=l.useState(h[0]),[S,C]=l.useState(`staging`),w=e.filter(e=>e.status===`building`||e.status===`deploying`);return(0,d.jsxs)(`div`,{className:t.cn(`space-y-6`,y),children:[(0,d.jsxs)(`div`,{className:`flex flex-col sm:flex-row gap-4 justify-between`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Deployments`}),(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`Manage and monitor your deployments`})]}),(0,d.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,d.jsxs)(o.Select,{value:b,onValueChange:x,children:[(0,d.jsxs)(o.SelectTrigger,{className:`w-[160px]`,children:[(0,d.jsx)(u.GitBranch,{className:`h-4 w-4 mr-2`}),(0,d.jsx)(o.SelectValue,{})]}),(0,d.jsx)(o.SelectContent,{children:h.map(e=>(0,d.jsx)(o.SelectItem,{value:e,children:e},e))})]}),(0,d.jsxs)(o.Select,{value:S,onValueChange:e=>C(e),children:[(0,d.jsxs)(o.SelectTrigger,{className:`w-[160px]`,children:[(0,d.jsx)(u.Server,{className:`h-4 w-4 mr-2`}),(0,d.jsx)(o.SelectValue,{})]}),(0,d.jsxs)(o.SelectContent,{children:[(0,d.jsx)(o.SelectItem,{value:`development`,children:`Development`}),(0,d.jsx)(o.SelectItem,{value:`staging`,children:`Staging`}),(0,d.jsx)(o.SelectItem,{value:`production`,children:`Production`})]})]}),(0,d.jsxs)(i.Button,{onClick:()=>s?.(S,b),children:[(0,d.jsx)(u.Rocket,{className:`h-4 w-4 mr-2`}),`Deploy`]})]})]}),w.length>0&&(0,d.jsx)(a.Card,{className:`border-blue-500/50 bg-blue-500/5`,children:(0,d.jsx)(a.CardContent,{className:`py-4`,children:(0,d.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,d.jsx)(`div`,{className:`h-10 w-10 rounded-full bg-blue-500/10 flex items-center justify-center`,children:(0,d.jsx)(u.Rocket,{className:`h-5 w-5 text-blue-500 animate-pulse`})}),(0,d.jsxs)(`div`,{children:[(0,d.jsxs)(`p`,{className:`font-medium`,children:[w.length,` deployment`,w.length>1?`s`:``,` in progress`]}),(0,d.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:w.map(e=>e.environment).join(`, `)})]})]})})}),(0,d.jsx)(`div`,{className:`grid gap-4 md:grid-cols-3`,children:r.map(e=>(0,d.jsx)(v,{env:e},e.name))}),(0,d.jsxs)(c.Tabs,{defaultValue:`deployments`,className:`w-full`,children:[(0,d.jsxs)(c.TabsList,{children:[(0,d.jsx)(c.TabsTrigger,{value:`deployments`,children:`Recent Deployments`}),(0,d.jsx)(c.TabsTrigger,{value:`pipelines`,children:`Pipelines`})]}),(0,d.jsx)(c.TabsContent,{value:`deployments`,className:`mt-4 space-y-3`,children:e.length>0?e.map(e=>(0,d.jsx)(g,{deployment:e,onRollback:()=>f?.(e.id),onCancel:()=>p?.(e.id),onRetry:()=>m?.(e.id)},e.id)):(0,d.jsx)(a.Card,{children:(0,d.jsxs)(a.CardContent,{className:`py-12 text-center`,children:[(0,d.jsx)(u.Rocket,{className:`h-12 w-12 mx-auto text-muted-foreground mb-4`}),(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`No deployments yet`}),(0,d.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Deploy your first version to get started`})]})})}),(0,d.jsx)(c.TabsContent,{value:`pipelines`,className:`mt-4 space-y-4`,children:n.length>0?n.map(e=>(0,d.jsx)(_,{pipeline:e},e.id)):(0,d.jsx)(a.Card,{children:(0,d.jsxs)(a.CardContent,{className:`py-12 text-center`,children:[(0,d.jsx)(u.Activity,{className:`h-12 w-12 mx-auto text-muted-foreground mb-4`}),(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`No active pipelines`}),(0,d.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Pipelines will appear here when triggered`})]})})})]})]})}var x=[{id:`d1`,status:`success`,environment:`production`,branch:`main`,commit:`a1b2c3d4e5f6`,commitMessage:`feat: Add new dashboard component`,author:{name:`John Doe`},startedAt:new Date(Date.now()-36e5),finishedAt:new Date(Date.now()-33e5),duration:`5m 12s`,url:`https://app.example.com`},{id:`d2`,status:`building`,environment:`staging`,branch:`develop`,commit:`f6e5d4c3b2a1`,commitMessage:`fix: Resolve login issue`,author:{name:`Jane Smith`},startedAt:new Date(Date.now()-18e4)},{id:`d3`,status:`failed`,environment:`development`,branch:`feature/new-api`,commit:`1a2b3c4d5e6f`,commitMessage:`wip: New API endpoints`,author:{name:`Bob Wilson`},startedAt:new Date(Date.now()-72e5),finishedAt:new Date(Date.now()-7e6),duration:`3m 20s`}],S=[{id:`p1`,name:`CI/CD Pipeline`,status:`building`,trigger:`push to main`,branch:`main`,startedAt:new Date(Date.now()-3e5),stages:[{id:`s1`,name:`Build`,status:`success`,duration:`1m 30s`},{id:`s2`,name:`Test`,status:`success`,duration:`2m 45s`},{id:`s3`,name:`Deploy`,status:`building`},{id:`s4`,name:`Verify`,status:`pending`}]}],C=[{name:`production`,status:`healthy`,url:`https://app.example.com`,uptime:`99.9%`,responseTime:`120ms`,lastDeployment:x[0]},{name:`staging`,status:`degraded`,url:`https://staging.example.com`,uptime:`98.5%`,responseTime:`250ms`},{name:`development`,status:`healthy`,url:`https://dev.example.com`,uptime:`95.0%`,responseTime:`180ms`}];exports.default=b,exports.defaultDeployments=x,exports.defaultEnvironments=C,exports.defaultPipelines=S;
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js"),n=require("../../components/avatar/index.cjs.js"),r=require("../../components/badge/index.cjs.js"),i=require("../../components/button/index.cjs.js"),a=require("../../components/card/index.cjs.js"),o=require("../../components/select/index.cjs.js"),s=require("../../components/progress/index.cjs.js"),c=require("../../components/tabs/index.cjs.js");let l=require("react");l=e.__toESM(l);let u=require("lucide-react"),d=require("react/jsx-runtime");var f={pending:{color:`text-yellow-500 bg-yellow-500/10`,icon:(0,d.jsx)(u.Clock,{className:`h-4 w-4`}),label:`Pending`},building:{color:`text-blue-500 bg-blue-500/10`,icon:(0,d.jsx)(u.Loader2,{className:`h-4 w-4 animate-spin`}),label:`Building`},deploying:{color:`text-purple-500 bg-purple-500/10`,icon:(0,d.jsx)(u.Rocket,{className:`h-4 w-4 animate-pulse`}),label:`Deploying`},success:{color:`text-green-500 bg-green-500/10`,icon:(0,d.jsx)(u.CheckCircle,{className:`h-4 w-4`}),label:`Success`},failed:{color:`text-red-500 bg-red-500/10`,icon:(0,d.jsx)(u.XCircle,{className:`h-4 w-4`}),label:`Failed`},cancelled:{color:`text-gray-500 bg-gray-500/10`,icon:(0,d.jsx)(u.XCircle,{className:`h-4 w-4`}),label:`Cancelled`},rollback:{color:`text-orange-500 bg-orange-500/10`,icon:(0,d.jsx)(u.RotateCcw,{className:`h-4 w-4`}),label:`Rollback`}},p={development:{color:`text-blue-500 border-blue-500/30 bg-blue-500/10`,icon:(0,d.jsx)(u.Terminal,{className:`h-4 w-4`})},staging:{color:`text-yellow-500 border-yellow-500/30 bg-yellow-500/10`,icon:(0,d.jsx)(u.Server,{className:`h-4 w-4`})},production:{color:`text-green-500 border-green-500/30 bg-green-500/10`,icon:(0,d.jsx)(u.Globe,{className:`h-4 w-4`})}};function m({status:e}){let n=f[e];return(0,d.jsxs)(r.Badge,{variant:`outline`,className:t.cn(`gap-1`,n.color),children:[n.icon,n.label]})}function h({environment:e}){let n=p[e];return(0,d.jsxs)(r.Badge,{variant:`outline`,className:t.cn(`gap-1 capitalize`,n.color),children:[n.icon,e]})}function g({deployment:e,onRollback:t,onCancel:r,onRetry:a}){let o=e.status===`building`||e.status===`deploying`,s=e.status===`success`&&e.environment===`production`,c=e.status===`failed`,l=o;return(0,d.jsx)(`div`,{className:`p-4 rounded-lg border bg-card hover:bg-muted/50 transition-colors`,children:(0,d.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,d.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,d.jsxs)(n.Avatar,{className:`h-10 w-10`,children:[(0,d.jsx)(n.AvatarImage,{src:e.author.avatar}),(0,d.jsx)(n.AvatarFallback,{children:e.author.name.slice(0,2).toUpperCase()})]}),(0,d.jsxs)(`div`,{children:[(0,d.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,d.jsx)(m,{status:e.status}),(0,d.jsx)(h,{environment:e.environment})]}),(0,d.jsx)(`p`,{className:`text-sm mt-1 line-clamp-1`,children:e.commitMessage}),(0,d.jsxs)(`div`,{className:`flex items-center gap-3 mt-2 text-xs text-muted-foreground`,children:[(0,d.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,d.jsx)(u.GitBranch,{className:`h-3 w-3`}),e.branch]}),(0,d.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,d.jsx)(u.GitCommit,{className:`h-3 w-3`}),e.commit.slice(0,7)]}),(0,d.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,d.jsx)(u.Clock,{className:`h-3 w-3`}),typeof e.startedAt==`string`?e.startedAt:y(e.startedAt)]}),e.duration&&(0,d.jsx)(`span`,{children:e.duration})]})]})]}),(0,d.jsxs)(`div`,{className:`flex items-center gap-1`,children:[e.url&&(0,d.jsx)(i.Button,{variant:`ghost`,size:`icon`,asChild:!0,children:(0,d.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:(0,d.jsx)(u.ExternalLink,{className:`h-4 w-4`})})}),l&&(0,d.jsx)(i.Button,{variant:`ghost`,size:`icon`,onClick:r,children:(0,d.jsx)(u.Pause,{className:`h-4 w-4`})}),c&&(0,d.jsx)(i.Button,{variant:`ghost`,size:`icon`,onClick:a,children:(0,d.jsx)(u.RefreshCw,{className:`h-4 w-4`})}),s&&(0,d.jsx)(i.Button,{variant:`ghost`,size:`icon`,onClick:t,children:(0,d.jsx)(u.RotateCcw,{className:`h-4 w-4`})})]})]})})}function _({pipeline:e}){let n=e.stages.filter(e=>e.status===`success`).length/e.stages.length*100;return(0,d.jsxs)(a.Card,{children:[(0,d.jsxs)(a.CardHeader,{className:`pb-2`,children:[(0,d.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,d.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,d.jsx)(m,{status:e.status}),(0,d.jsx)(`span`,{className:`font-medium`,children:e.name})]}),(0,d.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:typeof e.startedAt==`string`?e.startedAt:y(e.startedAt)})]}),(0,d.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,d.jsx)(u.GitBranch,{className:`h-3 w-3`}),e.branch,(0,d.jsx)(`span`,{className:`mx-1`,children:`•`}),`Triggered by `,e.trigger]})]}),(0,d.jsx)(a.CardContent,{children:(0,d.jsxs)(`div`,{className:`space-y-3`,children:[(0,d.jsx)(s.Progress,{value:n,className:`h-2`}),(0,d.jsx)(`div`,{className:`flex items-center justify-between`,children:e.stages.map((n,r)=>(0,d.jsxs)(l.Fragment,{children:[(0,d.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,d.jsx)(`div`,{className:t.cn(`h-8 w-8 rounded-full flex items-center justify-center`,f[n.status].color),children:f[n.status].icon}),(0,d.jsx)(`span`,{className:`text-xs`,children:n.name}),n.duration&&(0,d.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n.duration})]}),r<e.stages.length-1&&(0,d.jsx)(u.ChevronRight,{className:`h-4 w-4 text-muted-foreground`})]},n.id))})]})})]})}function v({env:e}){let n={healthy:`text-green-500`,degraded:`text-yellow-500`,down:`text-red-500`},r={healthy:(0,d.jsx)(u.CheckCircle,{className:`h-5 w-5`}),degraded:(0,d.jsx)(u.AlertCircle,{className:`h-5 w-5`}),down:(0,d.jsx)(u.XCircle,{className:`h-5 w-5`})};return(0,d.jsxs)(a.Card,{children:[(0,d.jsx)(a.CardHeader,{className:`pb-2`,children:(0,d.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,d.jsxs)(a.CardTitle,{className:`capitalize flex items-center gap-2`,children:[p[e.name].icon,e.name]}),(0,d.jsxs)(`div`,{className:t.cn(`flex items-center gap-1`,n[e.status]),children:[r[e.status],(0,d.jsx)(`span`,{className:`text-sm capitalize`,children:e.status})]})]})}),(0,d.jsxs)(a.CardContent,{className:`space-y-4`,children:[(0,d.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,d.jsx)(u.ExternalLink,{className:`h-4 w-4 text-muted-foreground`}),(0,d.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-primary hover:underline truncate`,children:e.url})]}),(0,d.jsxs)(`div`,{className:`grid grid-cols-2 gap-4 text-sm`,children:[e.uptime&&(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`Uptime`}),(0,d.jsx)(`p`,{className:`font-medium`,children:e.uptime})]}),e.responseTime&&(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`Response Time`}),(0,d.jsx)(`p`,{className:`font-medium`,children:e.responseTime})]})]}),e.lastDeployment&&(0,d.jsxs)(`div`,{className:`pt-2 border-t`,children:[(0,d.jsx)(`p`,{className:`text-xs text-muted-foreground mb-1`,children:`Last Deployment`}),(0,d.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,d.jsx)(m,{status:e.lastDeployment.status}),(0,d.jsx)(`span`,{className:`text-muted-foreground`,children:typeof e.lastDeployment.startedAt==`string`?e.lastDeployment.startedAt:y(e.lastDeployment.startedAt)})]})]})]})]})}function y(e){let t=new Date().getTime()-e.getTime(),n=Math.floor(t/6e4),r=Math.floor(n/60),i=Math.floor(r/24);return n<1?`just now`:n<60?`${n}m ago`:r<24?`${r}h ago`:`${i}d ago`}function b({deployments:e=[],pipelines:n=[],environments:r=[],onDeploy:s,onRollback:f,onCancel:p,onRetry:m,branches:h=[`main`,`develop`,`staging`],className:y}){let[b,x]=l.useState(h[0]),[S,C]=l.useState(`staging`),w=e.filter(e=>e.status===`building`||e.status===`deploying`);return(0,d.jsxs)(`div`,{className:t.cn(`space-y-6`,y),children:[(0,d.jsxs)(`div`,{className:`flex flex-col sm:flex-row gap-4 justify-between`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`h1`,{className:`text-2xl font-bold`,children:`Deployments`}),(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`Manage and monitor your deployments`})]}),(0,d.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,d.jsxs)(o.Select,{value:b,onValueChange:x,children:[(0,d.jsxs)(o.SelectTrigger,{className:`w-[160px]`,children:[(0,d.jsx)(u.GitBranch,{className:`h-4 w-4 mr-2`}),(0,d.jsx)(o.SelectValue,{})]}),(0,d.jsx)(o.SelectContent,{children:h.map(e=>(0,d.jsx)(o.SelectItem,{value:e,children:e},e))})]}),(0,d.jsxs)(o.Select,{value:S,onValueChange:e=>C(e),children:[(0,d.jsxs)(o.SelectTrigger,{className:`w-[160px]`,children:[(0,d.jsx)(u.Server,{className:`h-4 w-4 mr-2`}),(0,d.jsx)(o.SelectValue,{})]}),(0,d.jsxs)(o.SelectContent,{children:[(0,d.jsx)(o.SelectItem,{value:`development`,children:`Development`}),(0,d.jsx)(o.SelectItem,{value:`staging`,children:`Staging`}),(0,d.jsx)(o.SelectItem,{value:`production`,children:`Production`})]})]}),(0,d.jsxs)(i.Button,{onClick:()=>s?.(S,b),children:[(0,d.jsx)(u.Rocket,{className:`h-4 w-4 mr-2`}),`Deploy`]})]})]}),w.length>0&&(0,d.jsx)(a.Card,{className:`border-blue-500/50 bg-blue-500/5`,children:(0,d.jsx)(a.CardContent,{className:`py-4`,children:(0,d.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,d.jsx)(`div`,{className:`h-10 w-10 rounded-full bg-blue-500/10 flex items-center justify-center`,children:(0,d.jsx)(u.Rocket,{className:`h-5 w-5 text-blue-500 animate-pulse`})}),(0,d.jsxs)(`div`,{children:[(0,d.jsxs)(`p`,{className:`font-medium`,children:[w.length,` deployment`,w.length>1?`s`:``,` in progress`]}),(0,d.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:w.map(e=>e.environment).join(`, `)})]})]})})}),(0,d.jsx)(`div`,{className:`grid gap-4 md:grid-cols-3`,children:r.map(e=>(0,d.jsx)(v,{env:e},e.name))}),(0,d.jsxs)(c.Tabs,{defaultValue:`deployments`,className:`w-full`,children:[(0,d.jsxs)(c.TabsList,{children:[(0,d.jsx)(c.TabsTrigger,{value:`deployments`,children:`Recent Deployments`}),(0,d.jsx)(c.TabsTrigger,{value:`pipelines`,children:`Pipelines`})]}),(0,d.jsx)(c.TabsContent,{value:`deployments`,className:`mt-4 space-y-3`,children:e.length>0?e.map(e=>(0,d.jsx)(g,{deployment:e,onRollback:()=>f?.(e.id),onCancel:()=>p?.(e.id),onRetry:()=>m?.(e.id)},e.id)):(0,d.jsx)(a.Card,{children:(0,d.jsxs)(a.CardContent,{className:`py-12 text-center`,children:[(0,d.jsx)(u.Rocket,{className:`h-12 w-12 mx-auto text-muted-foreground mb-4`}),(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`No deployments yet`}),(0,d.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Deploy your first version to get started`})]})})}),(0,d.jsx)(c.TabsContent,{value:`pipelines`,className:`mt-4 space-y-4`,children:n.length>0?n.map(e=>(0,d.jsx)(_,{pipeline:e},e.id)):(0,d.jsx)(a.Card,{children:(0,d.jsxs)(a.CardContent,{className:`py-12 text-center`,children:[(0,d.jsx)(u.Activity,{className:`h-12 w-12 mx-auto text-muted-foreground mb-4`}),(0,d.jsx)(`p`,{className:`text-muted-foreground`,children:`No active pipelines`}),(0,d.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Pipelines will appear here when triggered`})]})})})]})]})}var x=[{id:`d1`,status:`success`,environment:`production`,branch:`main`,commit:`a1b2c3d4e5f6`,commitMessage:`feat: Add new dashboard component`,author:{name:`John Doe`},startedAt:new Date(Date.now()-36e5),finishedAt:new Date(Date.now()-33e5),duration:`5m 12s`,url:`https://app.example.com`},{id:`d2`,status:`building`,environment:`staging`,branch:`develop`,commit:`f6e5d4c3b2a1`,commitMessage:`fix: Resolve login issue`,author:{name:`Jane Smith`},startedAt:new Date(Date.now()-18e4)},{id:`d3`,status:`failed`,environment:`development`,branch:`feature/new-api`,commit:`1a2b3c4d5e6f`,commitMessage:`wip: New API endpoints`,author:{name:`Bob Wilson`},startedAt:new Date(Date.now()-72e5),finishedAt:new Date(Date.now()-7e6),duration:`3m 20s`}],S=[{id:`p1`,name:`CI/CD Pipeline`,status:`building`,trigger:`push to main`,branch:`main`,startedAt:new Date(Date.now()-3e5),stages:[{id:`s1`,name:`Build`,status:`success`,duration:`1m 30s`},{id:`s2`,name:`Test`,status:`success`,duration:`2m 45s`},{id:`s3`,name:`Deploy`,status:`building`},{id:`s4`,name:`Verify`,status:`pending`}]}],C=[{name:`production`,status:`healthy`,url:`https://app.example.com`,uptime:`99.9%`,responseTime:`120ms`,lastDeployment:x[0]},{name:`staging`,status:`degraded`,url:`https://staging.example.com`,uptime:`98.5%`,responseTime:`250ms`},{name:`development`,status:`healthy`,url:`https://dev.example.com`,uptime:`95.0%`,responseTime:`180ms`}];exports.DeploymentDashboard=b,exports.default=b,exports.defaultDeployments=x,exports.defaultEnvironments=C,exports.defaultPipelines=S;
@@ -520,4 +520,4 @@ var Y = [
520
520
  }
521
521
  ];
522
522
  //#endregion
523
- export { J as default, Y as defaultDeployments, Z as defaultEnvironments, X as defaultPipelines };
523
+ export { J as DeploymentDashboard, J as default, Y as defaultDeployments, Z as defaultEnvironments, X as defaultPipelines };
@@ -1 +1 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`),n=require(`../../components/button/index.cjs.js`);let r=require(`react`);r=e.__toESM(r);let i=require(`lucide-react`),a=require(`react/jsx-runtime`);var o={"no-data":{title:`Aucune donnée`,description:`Il n'y a pas encore de données à afficher.`,icon:i.Inbox,actionLabel:`Ajouter`,actionIcon:i.Plus},"no-results":{title:`Aucun résultat`,description:`Aucun élément ne correspond à votre recherche.`,icon:i.Search,actionLabel:`Effacer les filtres`,actionIcon:i.Filter},"no-messages":{title:`Aucun message`,description:`Votre boîte de réception est vide.`,icon:i.MessageSquare,actionLabel:`Nouveau message`,actionIcon:i.Plus},"no-files":{title:`Aucun fichier`,description:`Vous n'avez pas encore de fichiers.`,icon:i.FolderOpen,actionLabel:`Importer un fichier`,actionIcon:i.Upload},"no-users":{title:`Aucun utilisateur`,description:`Il n'y a pas encore d'utilisateurs.`,icon:i.Users,actionLabel:`Inviter des utilisateurs`,actionIcon:i.Plus},"no-cart":{title:`Panier vide`,description:`Votre panier est vide.`,icon:i.ShoppingCart,actionLabel:`Parcourir les produits`,actionIcon:i.ArrowRight},"no-notifications":{title:`Aucune notification`,description:`Vous êtes à jour !`,icon:i.Bell},"no-events":{title:`Aucun événement`,description:`Aucun événement prévu.`,icon:i.Calendar,actionLabel:`Créer un événement`,actionIcon:i.Plus},"no-images":{title:`Aucune image`,description:`Vous n'avez pas encore d'images.`,icon:i.Image,actionLabel:`Importer des images`,actionIcon:i.Upload},"no-bookmarks":{title:`Aucun favori`,description:`Vous n'avez pas encore de favoris.`,icon:i.Bookmark,actionLabel:`Parcourir`,actionIcon:i.ArrowRight},"no-favorites":{title:`Aucun favori`,description:`Vous n'avez pas encore aimé de contenu.`,icon:i.Heart},error:{title:`Une erreur est survenue`,description:`Impossible de charger les données.`,icon:i.FileQuestion,actionLabel:`Réessayer`,actionIcon:i.RefreshCw},custom:{title:`Aucun élément`,description:`Il n'y a rien à afficher.`,icon:i.Inbox}};function s({type:e,size:n,className:r}){let i=o[e].icon,s={sm:{container:`h-24 w-24`,icon:`h-8 w-8`,circles:{outer:`h-20 w-20`,inner:`h-14 w-14`}},md:{container:`h-32 w-32`,icon:`h-10 w-10`,circles:{outer:`h-28 w-28`,inner:`h-20 w-20`}},lg:{container:`h-40 w-40`,icon:`h-12 w-12`,circles:{outer:`h-36 w-36`,inner:`h-28 w-28`}}}[n];return(0,a.jsxs)(`div`,{className:t.cn(`relative flex items-center justify-center`,s.container,r),children:[(0,a.jsx)(`div`,{className:t.cn(`absolute rounded-full bg-muted/50`,s.circles.outer)}),(0,a.jsx)(`div`,{className:t.cn(`absolute rounded-full bg-muted`,s.circles.inner)}),(0,a.jsx)(`div`,{className:`relative z-10 flex items-center justify-center rounded-full bg-background p-4 shadow-sm`,children:(0,a.jsx)(i,{className:t.cn(s.icon,`text-muted-foreground`)})}),(0,a.jsx)(`div`,{className:`absolute -right-1 top-2 h-2 w-2 rounded-full bg-primary/20`}),(0,a.jsx)(`div`,{className:`absolute -left-1 bottom-4 h-1.5 w-1.5 rounded-full bg-primary/30`}),(0,a.jsx)(`div`,{className:`absolute right-4 bottom-0 h-2.5 w-2.5 rounded-full bg-primary/10`})]})}function c({type:e=`no-data`,title:i,description:c,icon:l,actions:u,illustration:d,showIllustration:f=!0,size:p=`md`,layout:m=`vertical`,centered:h=!0,children:g,className:_,LinkComponent:v}){let y=o[e],b=i??y.title,x=c??y.description;y.icon;let S={sm:{container:`py-8 px-4`,title:`text-base`,description:`text-sm`,icon:`h-8 w-8`},md:{container:`py-12 px-6`,title:`text-lg`,description:`text-sm`,icon:`h-10 w-10`},lg:{container:`py-16 px-8`,title:`text-xl`,description:`text-base`,icon:`h-12 w-12`}},C=[];if(y.actionLabel&&!u){let e=y.actionIcon;C.push({label:y.actionLabel,variant:`default`,icon:e?(0,a.jsx)(e,{className:`h-4 w-4`}):void 0})}let w=u||(C.length>0?C:void 0);return m===`horizontal`?(0,a.jsxs)(`div`,{className:t.cn(`flex items-center gap-6`,S[p].container,h&&`justify-center`,_),children:[f&&(0,a.jsx)(`div`,{className:`flex-shrink-0`,children:d||(l?(0,a.jsx)(`div`,{className:`flex items-center justify-center rounded-full bg-muted p-4`,children:l}):(0,a.jsx)(s,{type:e,size:p}))}),(0,a.jsxs)(`div`,{className:`flex flex-col`,children:[(0,a.jsx)(`h3`,{className:t.cn(`font-semibold`,S[p].title),children:b}),(0,a.jsx)(`p`,{className:t.cn(`text-muted-foreground mt-1`,S[p].description),children:x}),g&&(0,a.jsx)(`div`,{className:`mt-4`,children:g}),w&&w.length>0&&(0,a.jsx)(`div`,{className:`flex gap-3 mt-4`,children:w.map((e,t)=>(0,a.jsx)(n.Button,{variant:e.variant||`default`,size:`sm`,onClick:e.onClick,asChild:!!e.href,children:e.href?v?(0,a.jsxs)(v,{href:e.href,children:[e.icon&&(0,a.jsx)(`span`,{className:`mr-2`,children:e.icon}),e.label]}):(0,a.jsxs)(`a`,{href:e.href,children:[e.icon&&(0,a.jsx)(`span`,{className:`mr-2`,children:e.icon}),e.label]}):(0,a.jsxs)(a.Fragment,{children:[e.icon&&(0,a.jsx)(`span`,{className:`mr-2`,children:e.icon}),e.label]})},t))})]})]}):(0,a.jsxs)(`div`,{className:t.cn(`flex flex-col items-center`,h&&`text-center`,S[p].container,_),children:[f&&(0,a.jsx)(`div`,{className:`mb-6`,children:d||(l?(0,a.jsx)(`div`,{className:`flex items-center justify-center rounded-full bg-muted p-6`,children:r.cloneElement(l,{className:t.cn(S[p].icon,`text-muted-foreground`)})}):(0,a.jsx)(s,{type:e,size:p}))}),(0,a.jsx)(`h3`,{className:t.cn(`font-semibold`,S[p].title),children:b}),(0,a.jsx)(`p`,{className:t.cn(`text-muted-foreground mt-2 max-w-sm`,S[p].description),children:x}),g&&(0,a.jsx)(`div`,{className:`mt-4`,children:g}),w&&w.length>0&&(0,a.jsx)(`div`,{className:`flex flex-wrap gap-3 mt-6 justify-center`,children:w.map((e,t)=>(0,a.jsx)(n.Button,{variant:e.variant||`default`,onClick:e.onClick,asChild:!!e.href,children:e.href?v?(0,a.jsxs)(v,{href:e.href,children:[e.icon&&(0,a.jsx)(`span`,{className:`mr-2`,children:e.icon}),e.label]}):(0,a.jsxs)(`a`,{href:e.href,children:[e.icon&&(0,a.jsx)(`span`,{className:`mr-2`,children:e.icon}),e.label]}):(0,a.jsxs)(a.Fragment,{children:[e.icon&&(0,a.jsx)(`span`,{className:`mr-2`,children:e.icon}),e.label]})},t))})]})}function l(e){return(0,a.jsx)(c,{type:`no-data`,...e})}function u(e){return(0,a.jsx)(c,{type:`no-results`,...e})}function d(e){return(0,a.jsx)(c,{type:`no-messages`,...e})}function f(e){return(0,a.jsx)(c,{type:`no-files`,...e})}function p(e){return(0,a.jsx)(c,{type:`no-cart`,...e})}function m(e){return(0,a.jsx)(c,{type:`no-notifications`,...e})}function h(e){return(0,a.jsx)(c,{type:`error`,...e})}exports.EmptyCartState=p,exports.ErrorState=h,exports.NoDataState=l,exports.NoFilesState=f,exports.NoMessagesState=d,exports.NoNotificationsState=m,exports.NoResultsState=u,exports.default=c;
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js"),n=require("../../components/button/index.cjs.js");let r=require("react");r=e.__toESM(r);let i=require("lucide-react"),a=require("react/jsx-runtime");var o={"no-data":{title:`Aucune donnée`,description:`Il n'y a pas encore de données à afficher.`,icon:i.Inbox,actionLabel:`Ajouter`,actionIcon:i.Plus},"no-results":{title:`Aucun résultat`,description:`Aucun élément ne correspond à votre recherche.`,icon:i.Search,actionLabel:`Effacer les filtres`,actionIcon:i.Filter},"no-messages":{title:`Aucun message`,description:`Votre boîte de réception est vide.`,icon:i.MessageSquare,actionLabel:`Nouveau message`,actionIcon:i.Plus},"no-files":{title:`Aucun fichier`,description:`Vous n'avez pas encore de fichiers.`,icon:i.FolderOpen,actionLabel:`Importer un fichier`,actionIcon:i.Upload},"no-users":{title:`Aucun utilisateur`,description:`Il n'y a pas encore d'utilisateurs.`,icon:i.Users,actionLabel:`Inviter des utilisateurs`,actionIcon:i.Plus},"no-cart":{title:`Panier vide`,description:`Votre panier est vide.`,icon:i.ShoppingCart,actionLabel:`Parcourir les produits`,actionIcon:i.ArrowRight},"no-notifications":{title:`Aucune notification`,description:`Vous êtes à jour !`,icon:i.Bell},"no-events":{title:`Aucun événement`,description:`Aucun événement prévu.`,icon:i.Calendar,actionLabel:`Créer un événement`,actionIcon:i.Plus},"no-images":{title:`Aucune image`,description:`Vous n'avez pas encore d'images.`,icon:i.Image,actionLabel:`Importer des images`,actionIcon:i.Upload},"no-bookmarks":{title:`Aucun favori`,description:`Vous n'avez pas encore de favoris.`,icon:i.Bookmark,actionLabel:`Parcourir`,actionIcon:i.ArrowRight},"no-favorites":{title:`Aucun favori`,description:`Vous n'avez pas encore aimé de contenu.`,icon:i.Heart},error:{title:`Une erreur est survenue`,description:`Impossible de charger les données.`,icon:i.FileQuestion,actionLabel:`Réessayer`,actionIcon:i.RefreshCw},custom:{title:`Aucun élément`,description:`Il n'y a rien à afficher.`,icon:i.Inbox}};function s({type:e,size:n,className:r}){let i=o[e].icon,s={sm:{container:`h-24 w-24`,icon:`h-8 w-8`,circles:{outer:`h-20 w-20`,inner:`h-14 w-14`}},md:{container:`h-32 w-32`,icon:`h-10 w-10`,circles:{outer:`h-28 w-28`,inner:`h-20 w-20`}},lg:{container:`h-40 w-40`,icon:`h-12 w-12`,circles:{outer:`h-36 w-36`,inner:`h-28 w-28`}}}[n];return(0,a.jsxs)(`div`,{className:t.cn(`relative flex items-center justify-center`,s.container,r),children:[(0,a.jsx)(`div`,{className:t.cn(`absolute rounded-full bg-muted/50`,s.circles.outer)}),(0,a.jsx)(`div`,{className:t.cn(`absolute rounded-full bg-muted`,s.circles.inner)}),(0,a.jsx)(`div`,{className:`relative z-10 flex items-center justify-center rounded-full bg-background p-4 shadow-sm`,children:(0,a.jsx)(i,{className:t.cn(s.icon,`text-muted-foreground`)})}),(0,a.jsx)(`div`,{className:`absolute -right-1 top-2 h-2 w-2 rounded-full bg-primary/20`}),(0,a.jsx)(`div`,{className:`absolute -left-1 bottom-4 h-1.5 w-1.5 rounded-full bg-primary/30`}),(0,a.jsx)(`div`,{className:`absolute right-4 bottom-0 h-2.5 w-2.5 rounded-full bg-primary/10`})]})}function c({type:e=`no-data`,title:i,description:c,icon:l,actions:u,illustration:d,showIllustration:f=!0,size:p=`md`,layout:m=`vertical`,centered:h=!0,children:g,className:_,LinkComponent:v}){let y=o[e],b=i??y.title,x=c??y.description;y.icon;let S={sm:{container:`py-8 px-4`,title:`text-base`,description:`text-sm`,icon:`h-8 w-8`},md:{container:`py-12 px-6`,title:`text-lg`,description:`text-sm`,icon:`h-10 w-10`},lg:{container:`py-16 px-8`,title:`text-xl`,description:`text-base`,icon:`h-12 w-12`}},C=[];if(y.actionLabel&&!u){let e=y.actionIcon;C.push({label:y.actionLabel,variant:`default`,icon:e?(0,a.jsx)(e,{className:`h-4 w-4`}):void 0})}let w=u||(C.length>0?C:void 0);return m===`horizontal`?(0,a.jsxs)(`div`,{className:t.cn(`flex items-center gap-6`,S[p].container,h&&`justify-center`,_),children:[f&&(0,a.jsx)(`div`,{className:`flex-shrink-0`,children:d||(l?(0,a.jsx)(`div`,{className:`flex items-center justify-center rounded-full bg-muted p-4`,children:l}):(0,a.jsx)(s,{type:e,size:p}))}),(0,a.jsxs)(`div`,{className:`flex flex-col`,children:[(0,a.jsx)(`h3`,{className:t.cn(`font-semibold`,S[p].title),children:b}),(0,a.jsx)(`p`,{className:t.cn(`text-muted-foreground mt-1`,S[p].description),children:x}),g&&(0,a.jsx)(`div`,{className:`mt-4`,children:g}),w&&w.length>0&&(0,a.jsx)(`div`,{className:`flex gap-3 mt-4`,children:w.map((e,t)=>(0,a.jsx)(n.Button,{variant:e.variant||`default`,size:`sm`,onClick:e.onClick,asChild:!!e.href,children:e.href?v?(0,a.jsxs)(v,{href:e.href,children:[e.icon&&(0,a.jsx)(`span`,{className:`mr-2`,children:e.icon}),e.label]}):(0,a.jsxs)(`a`,{href:e.href,children:[e.icon&&(0,a.jsx)(`span`,{className:`mr-2`,children:e.icon}),e.label]}):(0,a.jsxs)(a.Fragment,{children:[e.icon&&(0,a.jsx)(`span`,{className:`mr-2`,children:e.icon}),e.label]})},t))})]})]}):(0,a.jsxs)(`div`,{className:t.cn(`flex flex-col items-center`,h&&`text-center`,S[p].container,_),children:[f&&(0,a.jsx)(`div`,{className:`mb-6`,children:d||(l?(0,a.jsx)(`div`,{className:`flex items-center justify-center rounded-full bg-muted p-6`,children:r.cloneElement(l,{className:t.cn(S[p].icon,`text-muted-foreground`)})}):(0,a.jsx)(s,{type:e,size:p}))}),(0,a.jsx)(`h3`,{className:t.cn(`font-semibold`,S[p].title),children:b}),(0,a.jsx)(`p`,{className:t.cn(`text-muted-foreground mt-2 max-w-sm`,S[p].description),children:x}),g&&(0,a.jsx)(`div`,{className:`mt-4`,children:g}),w&&w.length>0&&(0,a.jsx)(`div`,{className:`flex flex-wrap gap-3 mt-6 justify-center`,children:w.map((e,t)=>(0,a.jsx)(n.Button,{variant:e.variant||`default`,onClick:e.onClick,asChild:!!e.href,children:e.href?v?(0,a.jsxs)(v,{href:e.href,children:[e.icon&&(0,a.jsx)(`span`,{className:`mr-2`,children:e.icon}),e.label]}):(0,a.jsxs)(`a`,{href:e.href,children:[e.icon&&(0,a.jsx)(`span`,{className:`mr-2`,children:e.icon}),e.label]}):(0,a.jsxs)(a.Fragment,{children:[e.icon&&(0,a.jsx)(`span`,{className:`mr-2`,children:e.icon}),e.label]})},t))})]})}function l(e){return(0,a.jsx)(c,{type:`no-data`,...e})}function u(e){return(0,a.jsx)(c,{type:`no-results`,...e})}function d(e){return(0,a.jsx)(c,{type:`no-messages`,...e})}function f(e){return(0,a.jsx)(c,{type:`no-files`,...e})}function p(e){return(0,a.jsx)(c,{type:`no-cart`,...e})}function m(e){return(0,a.jsx)(c,{type:`no-notifications`,...e})}function h(e){return(0,a.jsx)(c,{type:`error`,...e})}exports.EmptyCartState=p,exports.ErrorState=h,exports.NoDataState=l,exports.NoFilesState=f,exports.NoMessagesState=d,exports.NoNotificationsState=m,exports.NoResultsState=u,exports.WakaEmptyState=c,exports.default=c;
@@ -303,4 +303,4 @@ function M(e) {
303
303
  });
304
304
  }
305
305
  //#endregion
306
- export { A as EmptyCartState, M as ErrorState, E as NoDataState, k as NoFilesState, O as NoMessagesState, j as NoNotificationsState, D as NoResultsState, T as default };
306
+ export { A as EmptyCartState, M as ErrorState, E as NoDataState, k as NoFilesState, O as NoMessagesState, j as NoNotificationsState, D as NoResultsState, T as WakaEmptyState, T as default };
@@ -1 +1 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`),n=require(`../../components/button/index.cjs.js`);let r=require(`react`);r=e.__toESM(r);let i=require(`lucide-react`),a=require(`react/jsx-runtime`);var o={404:{code:`404`,title:`Page non trouvée`,description:`Désolé, la page que vous recherchez n'existe pas ou a été déplacée.`,icon:i.FileQuestion},500:{code:`500`,title:`Erreur serveur`,description:`Une erreur inattendue s'est produite. Notre équipe a été notifiée.`,icon:i.ServerCrash},403:{code:`403`,title:`Accès refusé`,description:`Vous n'avez pas les permissions nécessaires pour accéder à cette page.`,icon:i.ShieldX},503:{code:`503`,title:`Service indisponible`,description:`Le service est temporairement indisponible. Veuillez réessayer plus tard.`,icon:i.ServerCrash},offline:{code:`Hors ligne`,title:`Vous êtes hors ligne`,description:`Vérifiez votre connexion internet et réessayez.`,icon:i.Wifi},maintenance:{code:`Maintenance`,title:`Maintenance en cours`,description:`Nous effectuons une maintenance. Nous serons bientôt de retour.`,icon:i.Construction},custom:{code:``,title:`Erreur`,description:`Une erreur s'est produite.`,icon:i.FileQuestion}};function s({type:e,className:n}){let r=o[e].icon;return(0,a.jsxs)(`div`,{className:t.cn(`relative flex items-center justify-center`,n),children:[(0,a.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center`,children:(0,a.jsx)(`div`,{className:`h-48 w-48 rounded-full bg-muted/50`})}),(0,a.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center`,children:(0,a.jsx)(`div`,{className:`h-32 w-32 rounded-full bg-muted`})}),(0,a.jsx)(`div`,{className:`relative z-10 flex h-20 w-20 items-center justify-center rounded-full bg-background shadow-lg`,children:(0,a.jsx)(r,{className:`h-10 w-10 text-muted-foreground`})}),(0,a.jsx)(`div`,{className:`absolute -right-4 top-4 h-3 w-3 rounded-full bg-primary/20`}),(0,a.jsx)(`div`,{className:`absolute -left-2 bottom-8 h-2 w-2 rounded-full bg-primary/30`}),(0,a.jsx)(`div`,{className:`absolute right-8 bottom-2 h-4 w-4 rounded-full bg-primary/10`})]})}function c({type:e=`404`,code:r,title:c,description:l,actions:u,illustration:d,showCode:f=!0,showIllustration:p=!0,showBackButton:m=!0,onBack:h,showHomeButton:g=!0,homeUrl:_=`/`,showRefreshButton:v=!1,children:y,layout:b=`centered`,size:x=`md`,className:S,LinkComponent:C}){let w=o[e],T=r??w.code,E=c??w.title,D=l??w.description,O={sm:{container:`py-12 px-4`,code:`text-6xl`,title:`text-xl`,description:`text-sm`,illustration:`h-32 w-32`},md:{container:`py-16 px-6`,code:`text-8xl`,title:`text-2xl`,description:`text-base`,illustration:`h-48 w-48`},lg:{container:`py-24 px-8`,code:`text-9xl`,title:`text-3xl`,description:`text-lg`,illustration:`h-64 w-64`}},k=[];m&&k.push({label:`Retour`,onClick:h||(()=>window.history.back()),variant:`outline`,icon:(0,a.jsx)(i.ArrowLeft,{className:`h-4 w-4`})}),g&&k.push({label:`Accueil`,href:_,variant:`default`,icon:(0,a.jsx)(i.Home,{className:`h-4 w-4`})}),v&&k.push({label:`Réessayer`,onClick:()=>window.location.reload(),variant:`secondary`,icon:(0,a.jsx)(i.RefreshCw,{className:`h-4 w-4`})});let A=u||k;return b===`split`?(0,a.jsxs)(`div`,{className:t.cn(`min-h-screen flex flex-col lg:flex-row`,S),children:[(0,a.jsx)(`div`,{className:`flex-1 bg-muted/30 flex items-center justify-center p-8 lg:p-16`,children:(0,a.jsx)(`div`,{className:O[x].illustration,children:d||(0,a.jsx)(s,{type:e})})}),(0,a.jsx)(`div`,{className:`flex-1 flex items-center justify-center p-8 lg:p-16`,children:(0,a.jsxs)(`div`,{className:`max-w-md`,children:[f&&T&&(0,a.jsx)(`div`,{className:t.cn(`font-bold text-primary mb-4`,x===`sm`?`text-4xl`:x===`md`?`text-5xl`:`text-6xl`),children:T}),(0,a.jsx)(`h1`,{className:t.cn(`font-bold tracking-tight mb-4`,O[x].title),children:E}),(0,a.jsx)(`p`,{className:t.cn(`text-muted-foreground mb-8`,O[x].description),children:D}),y&&(0,a.jsx)(`div`,{className:`mb-8`,children:y}),A.length>0&&(0,a.jsx)(`div`,{className:`flex flex-wrap gap-3`,children:A.map((e,t)=>(0,a.jsx)(n.Button,{variant:e.variant||`default`,onClick:e.onClick,asChild:!!e.href,children:e.href?C?(0,a.jsxs)(C,{href:e.href,children:[e.icon&&(0,a.jsx)(`span`,{className:`mr-2`,children:e.icon}),e.label]}):(0,a.jsxs)(`a`,{href:e.href,children:[e.icon&&(0,a.jsx)(`span`,{className:`mr-2`,children:e.icon}),e.label]}):(0,a.jsxs)(a.Fragment,{children:[e.icon&&(0,a.jsx)(`span`,{className:`mr-2`,children:e.icon}),e.label]})},t))})]})})]}):(0,a.jsx)(`div`,{className:t.cn(`min-h-screen flex items-center justify-center`,O[x].container,S),children:(0,a.jsxs)(`div`,{className:`flex flex-col items-center text-center`,children:[p&&(0,a.jsx)(`div`,{className:t.cn(`mb-8`,O[x].illustration),children:d||(0,a.jsx)(s,{type:e})}),f&&T&&(0,a.jsx)(`div`,{className:t.cn(`font-bold text-muted-foreground/20 mb-4`,O[x].code),children:T}),(0,a.jsx)(`h1`,{className:t.cn(`font-bold tracking-tight mb-4`,O[x].title),children:E}),(0,a.jsx)(`p`,{className:t.cn(`text-muted-foreground max-w-md mb-8`,O[x].description),children:D}),y&&(0,a.jsx)(`div`,{className:`mb-8`,children:y}),A.length>0&&(0,a.jsx)(`div`,{className:`flex flex-wrap gap-3 justify-center`,children:A.map((e,t)=>(0,a.jsx)(n.Button,{variant:e.variant||`default`,onClick:e.onClick,asChild:!!e.href,children:e.href?C?(0,a.jsxs)(C,{href:e.href,children:[e.icon&&(0,a.jsx)(`span`,{className:`mr-2`,children:e.icon}),e.label]}):(0,a.jsxs)(`a`,{href:e.href,children:[e.icon&&(0,a.jsx)(`span`,{className:`mr-2`,children:e.icon}),e.label]}):(0,a.jsxs)(a.Fragment,{children:[e.icon&&(0,a.jsx)(`span`,{className:`mr-2`,children:e.icon}),e.label]})},t))})]})})}function l(e){return(0,a.jsx)(c,{type:`404`,...e})}function u(e){return(0,a.jsx)(c,{type:`500`,showRefreshButton:!0,...e})}function d(e){return(0,a.jsx)(c,{type:`403`,...e})}function f(e){return(0,a.jsx)(c,{type:`maintenance`,showBackButton:!1,showHomeButton:!1,...e})}function p(e){return(0,a.jsx)(c,{type:`offline`,showRefreshButton:!0,...e})}exports.Error403Page=d,exports.Error404Page=l,exports.Error500Page=u,exports.MaintenancePage=f,exports.OfflinePage=p,exports.default=c;
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js"),n=require("../../components/button/index.cjs.js");let r=require("react");r=e.__toESM(r);let i=require("lucide-react"),a=require("react/jsx-runtime");var o={404:{code:`404`,title:`Page non trouvée`,description:`Désolé, la page que vous recherchez n'existe pas ou a été déplacée.`,icon:i.FileQuestion},500:{code:`500`,title:`Erreur serveur`,description:`Une erreur inattendue s'est produite. Notre équipe a été notifiée.`,icon:i.ServerCrash},403:{code:`403`,title:`Accès refusé`,description:`Vous n'avez pas les permissions nécessaires pour accéder à cette page.`,icon:i.ShieldX},503:{code:`503`,title:`Service indisponible`,description:`Le service est temporairement indisponible. Veuillez réessayer plus tard.`,icon:i.ServerCrash},offline:{code:`Hors ligne`,title:`Vous êtes hors ligne`,description:`Vérifiez votre connexion internet et réessayez.`,icon:i.Wifi},maintenance:{code:`Maintenance`,title:`Maintenance en cours`,description:`Nous effectuons une maintenance. Nous serons bientôt de retour.`,icon:i.Construction},custom:{code:``,title:`Erreur`,description:`Une erreur s'est produite.`,icon:i.FileQuestion}};function s({type:e,className:n}){let r=o[e].icon;return(0,a.jsxs)(`div`,{className:t.cn(`relative flex items-center justify-center`,n),children:[(0,a.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center`,children:(0,a.jsx)(`div`,{className:`h-48 w-48 rounded-full bg-muted/50`})}),(0,a.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center`,children:(0,a.jsx)(`div`,{className:`h-32 w-32 rounded-full bg-muted`})}),(0,a.jsx)(`div`,{className:`relative z-10 flex h-20 w-20 items-center justify-center rounded-full bg-background shadow-lg`,children:(0,a.jsx)(r,{className:`h-10 w-10 text-muted-foreground`})}),(0,a.jsx)(`div`,{className:`absolute -right-4 top-4 h-3 w-3 rounded-full bg-primary/20`}),(0,a.jsx)(`div`,{className:`absolute -left-2 bottom-8 h-2 w-2 rounded-full bg-primary/30`}),(0,a.jsx)(`div`,{className:`absolute right-8 bottom-2 h-4 w-4 rounded-full bg-primary/10`})]})}function c({type:e=`404`,code:r,title:c,description:l,actions:u,illustration:d,showCode:f=!0,showIllustration:p=!0,showBackButton:m=!0,onBack:h,showHomeButton:g=!0,homeUrl:_=`/`,showRefreshButton:v=!1,children:y,layout:b=`centered`,size:x=`md`,className:S,LinkComponent:C}){let w=o[e],T=r??w.code,E=c??w.title,D=l??w.description,O={sm:{container:`py-12 px-4`,code:`text-6xl`,title:`text-xl`,description:`text-sm`,illustration:`h-32 w-32`},md:{container:`py-16 px-6`,code:`text-8xl`,title:`text-2xl`,description:`text-base`,illustration:`h-48 w-48`},lg:{container:`py-24 px-8`,code:`text-9xl`,title:`text-3xl`,description:`text-lg`,illustration:`h-64 w-64`}},k=[];m&&k.push({label:`Retour`,onClick:h||(()=>window.history.back()),variant:`outline`,icon:(0,a.jsx)(i.ArrowLeft,{className:`h-4 w-4`})}),g&&k.push({label:`Accueil`,href:_,variant:`default`,icon:(0,a.jsx)(i.Home,{className:`h-4 w-4`})}),v&&k.push({label:`Réessayer`,onClick:()=>window.location.reload(),variant:`secondary`,icon:(0,a.jsx)(i.RefreshCw,{className:`h-4 w-4`})});let A=u||k;return b===`split`?(0,a.jsxs)(`div`,{className:t.cn(`min-h-screen flex flex-col lg:flex-row`,S),children:[(0,a.jsx)(`div`,{className:`flex-1 bg-muted/30 flex items-center justify-center p-8 lg:p-16`,children:(0,a.jsx)(`div`,{className:O[x].illustration,children:d||(0,a.jsx)(s,{type:e})})}),(0,a.jsx)(`div`,{className:`flex-1 flex items-center justify-center p-8 lg:p-16`,children:(0,a.jsxs)(`div`,{className:`max-w-md`,children:[f&&T&&(0,a.jsx)(`div`,{className:t.cn(`font-bold text-primary mb-4`,x===`sm`?`text-4xl`:x===`md`?`text-5xl`:`text-6xl`),children:T}),(0,a.jsx)(`h1`,{className:t.cn(`font-bold tracking-tight mb-4`,O[x].title),children:E}),(0,a.jsx)(`p`,{className:t.cn(`text-muted-foreground mb-8`,O[x].description),children:D}),y&&(0,a.jsx)(`div`,{className:`mb-8`,children:y}),A.length>0&&(0,a.jsx)(`div`,{className:`flex flex-wrap gap-3`,children:A.map((e,t)=>(0,a.jsx)(n.Button,{variant:e.variant||`default`,onClick:e.onClick,asChild:!!e.href,children:e.href?C?(0,a.jsxs)(C,{href:e.href,children:[e.icon&&(0,a.jsx)(`span`,{className:`mr-2`,children:e.icon}),e.label]}):(0,a.jsxs)(`a`,{href:e.href,children:[e.icon&&(0,a.jsx)(`span`,{className:`mr-2`,children:e.icon}),e.label]}):(0,a.jsxs)(a.Fragment,{children:[e.icon&&(0,a.jsx)(`span`,{className:`mr-2`,children:e.icon}),e.label]})},t))})]})})]}):(0,a.jsx)(`div`,{className:t.cn(`min-h-screen flex items-center justify-center`,O[x].container,S),children:(0,a.jsxs)(`div`,{className:`flex flex-col items-center text-center`,children:[p&&(0,a.jsx)(`div`,{className:t.cn(`mb-8`,O[x].illustration),children:d||(0,a.jsx)(s,{type:e})}),f&&T&&(0,a.jsx)(`div`,{className:t.cn(`font-bold text-muted-foreground/20 mb-4`,O[x].code),children:T}),(0,a.jsx)(`h1`,{className:t.cn(`font-bold tracking-tight mb-4`,O[x].title),children:E}),(0,a.jsx)(`p`,{className:t.cn(`text-muted-foreground max-w-md mb-8`,O[x].description),children:D}),y&&(0,a.jsx)(`div`,{className:`mb-8`,children:y}),A.length>0&&(0,a.jsx)(`div`,{className:`flex flex-wrap gap-3 justify-center`,children:A.map((e,t)=>(0,a.jsx)(n.Button,{variant:e.variant||`default`,onClick:e.onClick,asChild:!!e.href,children:e.href?C?(0,a.jsxs)(C,{href:e.href,children:[e.icon&&(0,a.jsx)(`span`,{className:`mr-2`,children:e.icon}),e.label]}):(0,a.jsxs)(`a`,{href:e.href,children:[e.icon&&(0,a.jsx)(`span`,{className:`mr-2`,children:e.icon}),e.label]}):(0,a.jsxs)(a.Fragment,{children:[e.icon&&(0,a.jsx)(`span`,{className:`mr-2`,children:e.icon}),e.label]})},t))})]})})}function l(e){return(0,a.jsx)(c,{type:`404`,...e})}function u(e){return(0,a.jsx)(c,{type:`500`,showRefreshButton:!0,...e})}function d(e){return(0,a.jsx)(c,{type:`403`,...e})}function f(e){return(0,a.jsx)(c,{type:`maintenance`,showBackButton:!1,showHomeButton:!1,...e})}function p(e){return(0,a.jsx)(c,{type:`offline`,showRefreshButton:!0,...e})}exports.Error403Page=d,exports.Error404Page=l,exports.Error500Page=u,exports.MaintenancePage=f,exports.OfflinePage=p,exports.WakaErrorPage=c,exports.default=c;
@@ -246,4 +246,4 @@ function b(e) {
246
246
  });
247
247
  }
248
248
  //#endregion
249
- export { v as Error403Page, g as Error404Page, _ as Error500Page, y as MaintenancePage, b as OfflinePage, h as default };
249
+ export { v as Error403Page, g as Error404Page, _ as Error500Page, y as MaintenancePage, b as OfflinePage, h as WakaErrorPage, h as default };
@@ -1 +1 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`),n=require(`../../components/accordion/index.cjs.js`),r=require(`../../components/badge/index.cjs.js`),i=require(`../../components/input/index.cjs.js`);let a=require(`react`);a=e.__toESM(a);let o=require(`lucide-react`),s=require(`react/jsx-runtime`);function c({value:e,onChange:t,placeholder:n}){return(0,s.jsxs)(`div`,{className:`relative`,children:[(0,s.jsx)(o.Search,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground`}),(0,s.jsx)(i.Input,{type:`text`,placeholder:n,value:e,onChange:e=>t(e.target.value),className:`pl-10`})]})}function l({categories:e,activeCategory:n,onCategoryChange:i,itemCounts:a}){return(0,s.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,s.jsxs)(`button`,{type:`button`,onClick:()=>i(null),className:t.cn(`inline-flex items-center gap-2 px-3 py-1.5 rounded-full text-sm font-medium transition-colors`,n===null?`bg-primary text-primary-foreground`:`bg-muted hover:bg-muted/80`),children:[`Tous`,(0,s.jsx)(r.Badge,{variant:`secondary`,className:`ml-1`,children:Object.values(a).reduce((e,t)=>e+t,0)})]}),e.map(e=>(0,s.jsxs)(`button`,{type:`button`,onClick:()=>i(e.id),className:t.cn(`inline-flex items-center gap-2 px-3 py-1.5 rounded-full text-sm font-medium transition-colors`,n===e.id?`bg-primary text-primary-foreground`:`bg-muted hover:bg-muted/80`),children:[e.icon,e.name,(0,s.jsx)(r.Badge,{variant:`secondary`,className:`ml-1`,children:a[e.id]||0})]},e.id))]})}function u({itemId:e,helpful:n=0,notHelpful:r=0,onFeedback:i}){let[o,c]=a.useState(null),l=t=>{o===null&&(c(t),i(e,t))};return(0,s.jsxs)(`div`,{className:`flex items-center gap-4 mt-4 pt-4 border-t`,children:[(0,s.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Cette réponse vous a-t-elle aidé ?`}),(0,s.jsxs)(`div`,{className:`flex gap-2`,children:[(0,s.jsxs)(`button`,{type:`button`,onClick:()=>l(!0),disabled:o!==null,className:t.cn(`inline-flex items-center gap-1 px-2 py-1 text-sm rounded transition-colors`,o===!0?`bg-green-100 text-green-700`:o===null?`hover:bg-muted`:`opacity-50`),children:[`👍 `,n+ +(o===!0)]}),(0,s.jsxs)(`button`,{type:`button`,onClick:()=>l(!1),disabled:o!==null,className:t.cn(`inline-flex items-center gap-1 px-2 py-1 text-sm rounded transition-colors`,o===!1?`bg-red-100 text-red-700`:o===null?`hover:bg-muted`:`opacity-50`),children:[`👎 `,r+ +(o===!1)]})]})]})}function d({items:e,categories:i=[],title:d=`Questions fréquentes`,description:f,showSearch:p=!0,searchPlaceholder:m=`Rechercher une question...`,showCategoryFilter:h=!0,activeCategory:g,onCategoryChange:_,allowMultiple:v=!1,defaultOpen:y=[],showFeedback:b=!1,onFeedback:x,layout:S=`default`,size:C=`md`,className:w}){let[T,E]=a.useState(``),[D,O]=a.useState(null),k=g??D,A=e=>{_?_(e):O(e)},j=a.useMemo(()=>e.filter(e=>{if(T){let t=T.toLowerCase();if(!(e.question.toLowerCase().includes(t)||typeof e.answer==`string`&&e.answer.toLowerCase().includes(t)||e.tags?.some(e=>e.toLowerCase().includes(t))))return!1}return!(k&&e.category!==k)}),[e,T,k]),M=a.useMemo(()=>{let t={};return e.forEach(e=>{e.category&&(t[e.category]=(t[e.category]||0)+1)}),t},[e]),N=a.useMemo(()=>{if(S!==`grouped`)return null;let e={};return j.forEach(t=>{let n=t.category||`other`;e[n]||(e[n]=[]),e[n].push(t)}),e},[j,S]),P={sm:{title:`text-xl`,question:`text-sm`,answer:`text-sm`},md:{title:`text-2xl`,question:`text-base`,answer:`text-sm`},lg:{title:`text-3xl`,question:`text-lg`,answer:`text-base`}},F=e=>(0,s.jsx)(s.Fragment,{children:e.map(e=>(0,s.jsxs)(n.AccordionItem,{value:e.id,className:t.cn(S===`cards`&&`border rounded-lg px-4 bg-card`),children:[(0,s.jsx)(n.AccordionTrigger,{className:t.cn(`hover:no-underline`,P[C].question),children:(0,s.jsx)(`span`,{className:`text-left`,children:e.question})}),(0,s.jsxs)(n.AccordionContent,{children:[(0,s.jsx)(`div`,{className:t.cn(`text-muted-foreground`,P[C].answer),children:typeof e.answer==`string`?(0,s.jsx)(`p`,{children:e.answer}):e.answer}),e.tags&&e.tags.length>0&&(0,s.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-3`,children:e.tags.map(e=>(0,s.jsx)(r.Badge,{variant:`outline`,className:`text-xs`,children:e},e))}),b&&x&&(0,s.jsx)(u,{itemId:e.id,helpful:e.helpful,notHelpful:e.notHelpful,onFeedback:x})]})]},e.id))}),I=e=>v?(0,s.jsx)(n.Accordion,{type:`multiple`,defaultValue:y,className:`space-y-2`,children:F(e)}):(0,s.jsx)(n.Accordion,{type:`single`,defaultValue:y[0],collapsible:!0,className:`space-y-2`,children:F(e)});return(0,s.jsxs)(`div`,{className:t.cn(`space-y-6`,w),children:[(0,s.jsxs)(`div`,{className:`text-center`,children:[(0,s.jsx)(`h2`,{className:t.cn(`font-bold tracking-tight`,P[C].title),children:d}),f&&(0,s.jsx)(`p`,{className:`text-muted-foreground mt-2 max-w-2xl mx-auto`,children:f})]}),p&&(0,s.jsx)(`div`,{className:`max-w-md mx-auto`,children:(0,s.jsx)(c,{value:T,onChange:E,placeholder:m})}),h&&i.length>0&&(0,s.jsx)(`div`,{className:`flex justify-center`,children:(0,s.jsx)(l,{categories:i,activeCategory:k,onCategoryChange:A,itemCounts:M})}),j.length===0?(0,s.jsxs)(`div`,{className:`text-center py-12`,children:[(0,s.jsx)(o.HelpCircle,{className:`h-12 w-12 text-muted-foreground mx-auto mb-4`}),(0,s.jsx)(`p`,{className:`text-muted-foreground`,children:`Aucune question ne correspond à votre recherche.`})]}):S===`grouped`&&N?(0,s.jsx)(`div`,{className:`space-y-8`,children:Object.entries(N).map(([e,t])=>{let n=i.find(t=>t.id===e);return(0,s.jsxs)(`div`,{children:[(0,s.jsxs)(`h3`,{className:`text-lg font-semibold mb-4 flex items-center gap-2`,children:[n?.icon,n?.name||e]}),I(t)]},e)})}):(0,s.jsx)(`div`,{className:`max-w-3xl mx-auto`,children:I(j)})]})}var f=[{id:`general`,name:`Général`,icon:(0,s.jsx)(o.HelpCircle,{className:`h-4 w-4`})},{id:`billing`,name:`Facturation`,icon:(0,s.jsx)(o.MessageCircle,{className:`h-4 w-4`})},{id:`technical`,name:`Technique`,icon:(0,s.jsx)(o.MessageCircle,{className:`h-4 w-4`})}],p=[{id:`1`,question:`Comment créer un compte ?`,answer:`Pour créer un compte, cliquez sur le bouton 'S'inscrire' en haut à droite de la page, puis remplissez le formulaire avec vos informations personnelles.`,category:`general`,tags:[`compte`,`inscription`]},{id:`2`,question:`Comment réinitialiser mon mot de passe ?`,answer:`Cliquez sur 'Mot de passe oublié' sur la page de connexion, entrez votre email et suivez les instructions envoyées par email.`,category:`general`,tags:[`mot de passe`,`sécurité`]},{id:`3`,question:`Quels moyens de paiement acceptez-vous ?`,answer:`Nous acceptons les cartes de crédit (Visa, Mastercard, Amex), PayPal et les virements bancaires pour les entreprises.`,category:`billing`,tags:[`paiement`,`carte`]},{id:`4`,question:`Comment annuler mon abonnement ?`,answer:`Vous pouvez annuler votre abonnement à tout moment depuis les paramètres de votre compte, section 'Abonnement'.`,category:`billing`,tags:[`abonnement`,`annulation`]},{id:`5`,question:`L'API est-elle disponible ?`,answer:`Oui, notre API REST est disponible pour tous les plans payants. Consultez notre documentation développeur pour plus d'informations.`,category:`technical`,tags:[`API`,`développeur`]}];exports.default=d,exports.defaultFAQCategories=f,exports.defaultFAQItems=p;
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js"),n=require("../../components/accordion/index.cjs.js"),r=require("../../components/badge/index.cjs.js"),i=require("../../components/input/index.cjs.js");let a=require("react");a=e.__toESM(a);let o=require("lucide-react"),s=require("react/jsx-runtime");function c({value:e,onChange:t,placeholder:n}){return(0,s.jsxs)(`div`,{className:`relative`,children:[(0,s.jsx)(o.Search,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground`}),(0,s.jsx)(i.Input,{type:`text`,placeholder:n,value:e,onChange:e=>t(e.target.value),className:`pl-10`})]})}function l({categories:e,activeCategory:n,onCategoryChange:i,itemCounts:a}){return(0,s.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,s.jsxs)(`button`,{type:`button`,onClick:()=>i(null),className:t.cn(`inline-flex items-center gap-2 px-3 py-1.5 rounded-full text-sm font-medium transition-colors`,n===null?`bg-primary text-primary-foreground`:`bg-muted hover:bg-muted/80`),children:[`Tous`,(0,s.jsx)(r.Badge,{variant:`secondary`,className:`ml-1`,children:Object.values(a).reduce((e,t)=>e+t,0)})]}),e.map(e=>(0,s.jsxs)(`button`,{type:`button`,onClick:()=>i(e.id),className:t.cn(`inline-flex items-center gap-2 px-3 py-1.5 rounded-full text-sm font-medium transition-colors`,n===e.id?`bg-primary text-primary-foreground`:`bg-muted hover:bg-muted/80`),children:[e.icon,e.name,(0,s.jsx)(r.Badge,{variant:`secondary`,className:`ml-1`,children:a[e.id]||0})]},e.id))]})}function u({itemId:e,helpful:n=0,notHelpful:r=0,onFeedback:i}){let[o,c]=a.useState(null),l=t=>{o===null&&(c(t),i(e,t))};return(0,s.jsxs)(`div`,{className:`flex items-center gap-4 mt-4 pt-4 border-t`,children:[(0,s.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Cette réponse vous a-t-elle aidé ?`}),(0,s.jsxs)(`div`,{className:`flex gap-2`,children:[(0,s.jsxs)(`button`,{type:`button`,onClick:()=>l(!0),disabled:o!==null,className:t.cn(`inline-flex items-center gap-1 px-2 py-1 text-sm rounded transition-colors`,o===!0?`bg-green-100 text-green-700`:o===null?`hover:bg-muted`:`opacity-50`),children:[`👍 `,n+ +(o===!0)]}),(0,s.jsxs)(`button`,{type:`button`,onClick:()=>l(!1),disabled:o!==null,className:t.cn(`inline-flex items-center gap-1 px-2 py-1 text-sm rounded transition-colors`,o===!1?`bg-red-100 text-red-700`:o===null?`hover:bg-muted`:`opacity-50`),children:[`👎 `,r+ +(o===!1)]})]})]})}function d({items:e,categories:i=[],title:d=`Questions fréquentes`,description:f,showSearch:p=!0,searchPlaceholder:m=`Rechercher une question...`,showCategoryFilter:h=!0,activeCategory:g,onCategoryChange:_,allowMultiple:v=!1,defaultOpen:y=[],showFeedback:b=!1,onFeedback:x,layout:S=`default`,size:C=`md`,className:w}){let[T,E]=a.useState(``),[D,O]=a.useState(null),k=g??D,A=e=>{_?_(e):O(e)},j=a.useMemo(()=>e.filter(e=>{if(T){let t=T.toLowerCase();if(!(e.question.toLowerCase().includes(t)||typeof e.answer==`string`&&e.answer.toLowerCase().includes(t)||e.tags?.some(e=>e.toLowerCase().includes(t))))return!1}return!(k&&e.category!==k)}),[e,T,k]),M=a.useMemo(()=>{let t={};return e.forEach(e=>{e.category&&(t[e.category]=(t[e.category]||0)+1)}),t},[e]),N=a.useMemo(()=>{if(S!==`grouped`)return null;let e={};return j.forEach(t=>{let n=t.category||`other`;e[n]||(e[n]=[]),e[n].push(t)}),e},[j,S]),P={sm:{title:`text-xl`,question:`text-sm`,answer:`text-sm`},md:{title:`text-2xl`,question:`text-base`,answer:`text-sm`},lg:{title:`text-3xl`,question:`text-lg`,answer:`text-base`}},F=e=>(0,s.jsx)(s.Fragment,{children:e.map(e=>(0,s.jsxs)(n.AccordionItem,{value:e.id,className:t.cn(S===`cards`&&`border rounded-lg px-4 bg-card`),children:[(0,s.jsx)(n.AccordionTrigger,{className:t.cn(`hover:no-underline`,P[C].question),children:(0,s.jsx)(`span`,{className:`text-left`,children:e.question})}),(0,s.jsxs)(n.AccordionContent,{children:[(0,s.jsx)(`div`,{className:t.cn(`text-muted-foreground`,P[C].answer),children:typeof e.answer==`string`?(0,s.jsx)(`p`,{children:e.answer}):e.answer}),e.tags&&e.tags.length>0&&(0,s.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-3`,children:e.tags.map(e=>(0,s.jsx)(r.Badge,{variant:`outline`,className:`text-xs`,children:e},e))}),b&&x&&(0,s.jsx)(u,{itemId:e.id,helpful:e.helpful,notHelpful:e.notHelpful,onFeedback:x})]})]},e.id))}),I=e=>v?(0,s.jsx)(n.Accordion,{type:`multiple`,defaultValue:y,className:`space-y-2`,children:F(e)}):(0,s.jsx)(n.Accordion,{type:`single`,defaultValue:y[0],collapsible:!0,className:`space-y-2`,children:F(e)});return(0,s.jsxs)(`div`,{className:t.cn(`space-y-6`,w),children:[(0,s.jsxs)(`div`,{className:`text-center`,children:[(0,s.jsx)(`h2`,{className:t.cn(`font-bold tracking-tight`,P[C].title),children:d}),f&&(0,s.jsx)(`p`,{className:`text-muted-foreground mt-2 max-w-2xl mx-auto`,children:f})]}),p&&(0,s.jsx)(`div`,{className:`max-w-md mx-auto`,children:(0,s.jsx)(c,{value:T,onChange:E,placeholder:m})}),h&&i.length>0&&(0,s.jsx)(`div`,{className:`flex justify-center`,children:(0,s.jsx)(l,{categories:i,activeCategory:k,onCategoryChange:A,itemCounts:M})}),j.length===0?(0,s.jsxs)(`div`,{className:`text-center py-12`,children:[(0,s.jsx)(o.HelpCircle,{className:`h-12 w-12 text-muted-foreground mx-auto mb-4`}),(0,s.jsx)(`p`,{className:`text-muted-foreground`,children:`Aucune question ne correspond à votre recherche.`})]}):S===`grouped`&&N?(0,s.jsx)(`div`,{className:`space-y-8`,children:Object.entries(N).map(([e,t])=>{let n=i.find(t=>t.id===e);return(0,s.jsxs)(`div`,{children:[(0,s.jsxs)(`h3`,{className:`text-lg font-semibold mb-4 flex items-center gap-2`,children:[n?.icon,n?.name||e]}),I(t)]},e)})}):(0,s.jsx)(`div`,{className:`max-w-3xl mx-auto`,children:I(j)})]})}var f=[{id:`general`,name:`Général`,icon:(0,s.jsx)(o.HelpCircle,{className:`h-4 w-4`})},{id:`billing`,name:`Facturation`,icon:(0,s.jsx)(o.MessageCircle,{className:`h-4 w-4`})},{id:`technical`,name:`Technique`,icon:(0,s.jsx)(o.MessageCircle,{className:`h-4 w-4`})}],p=[{id:`1`,question:`Comment créer un compte ?`,answer:`Pour créer un compte, cliquez sur le bouton 'S'inscrire' en haut à droite de la page, puis remplissez le formulaire avec vos informations personnelles.`,category:`general`,tags:[`compte`,`inscription`]},{id:`2`,question:`Comment réinitialiser mon mot de passe ?`,answer:`Cliquez sur 'Mot de passe oublié' sur la page de connexion, entrez votre email et suivez les instructions envoyées par email.`,category:`general`,tags:[`mot de passe`,`sécurité`]},{id:`3`,question:`Quels moyens de paiement acceptez-vous ?`,answer:`Nous acceptons les cartes de crédit (Visa, Mastercard, Amex), PayPal et les virements bancaires pour les entreprises.`,category:`billing`,tags:[`paiement`,`carte`]},{id:`4`,question:`Comment annuler mon abonnement ?`,answer:`Vous pouvez annuler votre abonnement à tout moment depuis les paramètres de votre compte, section 'Abonnement'.`,category:`billing`,tags:[`abonnement`,`annulation`]},{id:`5`,question:`L'API est-elle disponible ?`,answer:`Oui, notre API REST est disponible pour tous les plans payants. Consultez notre documentation développeur pour plus d'informations.`,category:`technical`,tags:[`API`,`développeur`]}];exports.WakaFAQ=d,exports.default=d,exports.defaultFAQCategories=f,exports.defaultFAQItems=p;
@@ -263,4 +263,4 @@ var v = [
263
263
  }
264
264
  ];
265
265
  //#endregion
266
- export { _ as default, v as defaultFAQCategories, y as defaultFAQItems };
266
+ export { _ as WakaFAQ, _ as default, v as defaultFAQCategories, y as defaultFAQItems };
@@ -1 +1 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`),n=require(`../../components/alert-dialog/index.cjs.js`),r=require(`../../components/badge/index.cjs.js`),i=require(`../../components/button/index.cjs.js`),a=require(`../../components/checkbox/index.cjs.js`),o=require(`../../components/dialog/index.cjs.js`),s=require(`../../components/dropdown-menu/index.cjs.js`),c=require(`../../components/input/index.cjs.js`),l=require(`../../components/table/index.cjs.js`);let u=require(`react`);u=e.__toESM(u);let d=require(`lucide-react`),f=require(`react/jsx-runtime`);var p={folder:{icon:d.Folder,color:`text-yellow-500`},document:{icon:d.FileText,color:`text-blue-500`},image:{icon:d.FileImage,color:`text-green-500`},video:{icon:d.FileVideo,color:`text-purple-500`},audio:{icon:d.FileAudio,color:`text-pink-500`},archive:{icon:d.FileArchive,color:`text-orange-500`},code:{icon:d.FileCode,color:`text-cyan-500`},other:{icon:d.File,color:`text-gray-500`}};function m(e){if(!e)return`-`;let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=0,r=e;for(;r>=1024&&n<t.length-1;)r/=1024,n++;return`${r.toFixed(1)} ${t[n]}`}function h({breadcrumbs:e,viewMode:n,onViewModeChange:r,onNavigate:a,onCreateFolder:o,onUpload:s,onRefresh:l,showSearch:p,onSearch:m,selectedCount:h,onDeleteSelected:g,onDownloadSelected:_}){let[v,y]=u.useState(``);return(0,f.jsxs)(`div`,{className:`space-y-4`,children:[(0,f.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,f.jsxs)(`div`,{className:`flex items-center gap-2`,children:[l&&(0,f.jsx)(i.Button,{variant:`outline`,size:`icon`,onClick:l,children:(0,f.jsx)(d.RefreshCw,{className:`h-4 w-4`})}),s&&(0,f.jsxs)(i.Button,{variant:`outline`,onClick:s,children:[(0,f.jsx)(d.Upload,{className:`h-4 w-4 mr-2`}),`Importer`]}),o&&(0,f.jsxs)(i.Button,{variant:`outline`,onClick:o,children:[(0,f.jsx)(d.FolderPlus,{className:`h-4 w-4 mr-2`}),`Nouveau dossier`]})]}),(0,f.jsxs)(`div`,{className:`flex items-center gap-2`,children:[p&&m&&(0,f.jsxs)(`div`,{className:`relative w-64`,children:[(0,f.jsx)(d.Search,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground`}),(0,f.jsx)(c.Input,{placeholder:`Rechercher...`,value:v,onChange:e=>{y(e.target.value),m(e.target.value)},className:`pl-9`})]}),(0,f.jsx)(i.Button,{variant:n===`grid`?`secondary`:`ghost`,size:`icon`,onClick:()=>r(`grid`),children:(0,f.jsx)(d.Grid,{className:`h-4 w-4`})}),(0,f.jsx)(i.Button,{variant:n===`list`?`secondary`:`ghost`,size:`icon`,onClick:()=>r(`list`),children:(0,f.jsx)(d.List,{className:`h-4 w-4`})})]})]}),(0,f.jsxs)(`div`,{className:`flex items-center gap-1 text-sm`,children:[(0,f.jsx)(`button`,{onClick:()=>a(`/`),className:`flex items-center gap-1 hover:text-primary`,children:(0,f.jsx)(d.Home,{className:`h-4 w-4`})}),e.map((n,r)=>(0,f.jsxs)(u.Fragment,{children:[(0,f.jsx)(d.ChevronRight,{className:`h-4 w-4 text-muted-foreground`}),(0,f.jsx)(`button`,{onClick:()=>a(n.path),className:t.cn(`hover:text-primary`,r===e.length-1&&`font-medium`),children:n.name})]},n.id))]}),h>0&&(0,f.jsxs)(`div`,{className:`flex items-center gap-4 p-3 bg-muted rounded-lg`,children:[(0,f.jsxs)(`span`,{className:`text-sm font-medium`,children:[h,` élément(s) sélectionné(s)`]}),_&&(0,f.jsxs)(i.Button,{variant:`outline`,size:`sm`,onClick:_,children:[(0,f.jsx)(d.Download,{className:`h-4 w-4 mr-2`}),`Télécharger`]}),g&&(0,f.jsxs)(i.Button,{variant:`destructive`,size:`sm`,onClick:g,children:[(0,f.jsx)(d.Trash2,{className:`h-4 w-4 mr-2`}),`Supprimer`]})]})]})}function g({file:e,viewMode:n,isSelected:o,onSelect:c,onOpen:u,onRename:h,onDelete:g,onDownload:_,onShare:v,onToggleStar:y}){let b=p[e.type],x=b.icon,ee=typeof e.modifiedAt==`string`?new Date(e.modifiedAt):e.modifiedAt,S=()=>{e.type===`folder`&&u()};return n===`grid`?(0,f.jsxs)(`div`,{className:t.cn(`relative group p-4 rounded-lg border cursor-pointer transition-colors`,o?`bg-primary/10 border-primary`:`hover:bg-muted`),onClick:()=>c(!o),onDoubleClick:S,children:[(0,f.jsx)(`div`,{className:`absolute top-2 left-2 opacity-0 group-hover:opacity-100 transition-opacity`,children:(0,f.jsx)(a.Checkbox,{checked:o,onCheckedChange:e=>c(e),onClick:e=>e.stopPropagation()})}),e.starred&&(0,f.jsx)(d.Star,{className:`absolute top-2 right-2 h-4 w-4 text-yellow-500 fill-yellow-500`}),(0,f.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[e.thumbnail&&e.type===`image`?(0,f.jsx)(`img`,{src:e.thumbnail,alt:e.name,className:`w-16 h-16 object-cover rounded`}):(0,f.jsx)(x,{className:t.cn(`h-12 w-12`,b.color)}),(0,f.jsx)(`span`,{className:`text-sm font-medium text-center line-clamp-2`,children:e.name}),e.type!==`folder`&&(0,f.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:m(e.size)})]}),(0,f.jsx)(`div`,{className:`absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity`,children:(0,f.jsxs)(s.DropdownMenu,{children:[(0,f.jsx)(s.DropdownMenuTrigger,{asChild:!0,onClick:e=>e.stopPropagation(),children:(0,f.jsx)(i.Button,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,children:(0,f.jsx)(d.MoreHorizontal,{className:`h-4 w-4`})})}),(0,f.jsxs)(s.DropdownMenuContent,{align:`end`,children:[(0,f.jsxs)(s.DropdownMenuItem,{onClick:u,children:[(0,f.jsx)(d.Eye,{className:`mr-2 h-4 w-4`}),`Ouvrir`]}),h&&(0,f.jsxs)(s.DropdownMenuItem,{onClick:h,children:[(0,f.jsx)(d.Edit,{className:`mr-2 h-4 w-4`}),`Renommer`]}),_&&e.type!==`folder`&&(0,f.jsxs)(s.DropdownMenuItem,{onClick:_,children:[(0,f.jsx)(d.Download,{className:`mr-2 h-4 w-4`}),`Télécharger`]}),v&&(0,f.jsxs)(s.DropdownMenuItem,{onClick:v,children:[(0,f.jsx)(d.Share2,{className:`mr-2 h-4 w-4`}),`Partager`]}),y&&(0,f.jsx)(s.DropdownMenuItem,{onClick:y,children:e.starred?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(d.StarOff,{className:`mr-2 h-4 w-4`}),`Retirer des favoris`]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(d.Star,{className:`mr-2 h-4 w-4`}),`Ajouter aux favoris`]})}),g&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(s.DropdownMenuSeparator,{}),(0,f.jsxs)(s.DropdownMenuItem,{onClick:g,className:`text-destructive`,children:[(0,f.jsx)(d.Trash2,{className:`mr-2 h-4 w-4`}),`Supprimer`]})]})]})]})})]}):(0,f.jsxs)(l.TableRow,{className:t.cn(`cursor-pointer`,o&&`bg-primary/10`),onClick:()=>c(!o),onDoubleClick:S,children:[(0,f.jsx)(l.TableCell,{className:`w-12`,children:(0,f.jsx)(a.Checkbox,{checked:o,onCheckedChange:e=>c(e),onClick:e=>e.stopPropagation()})}),(0,f.jsx)(l.TableCell,{children:(0,f.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,f.jsx)(x,{className:t.cn(`h-5 w-5`,b.color)}),(0,f.jsx)(`span`,{className:`font-medium`,children:e.name}),e.starred&&(0,f.jsx)(d.Star,{className:`h-4 w-4 text-yellow-500 fill-yellow-500`}),e.shared&&(0,f.jsx)(r.Badge,{variant:`secondary`,className:`text-xs`,children:`Partagé`})]})}),(0,f.jsx)(l.TableCell,{className:`text-muted-foreground`,children:m(e.size)}),(0,f.jsx)(l.TableCell,{className:`text-muted-foreground`,children:ee.toLocaleDateString(`fr-FR`)}),(0,f.jsx)(l.TableCell,{children:(0,f.jsxs)(s.DropdownMenu,{children:[(0,f.jsx)(s.DropdownMenuTrigger,{asChild:!0,onClick:e=>e.stopPropagation(),children:(0,f.jsx)(i.Button,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,children:(0,f.jsx)(d.MoreHorizontal,{className:`h-4 w-4`})})}),(0,f.jsxs)(s.DropdownMenuContent,{align:`end`,children:[(0,f.jsxs)(s.DropdownMenuItem,{onClick:u,children:[(0,f.jsx)(d.Eye,{className:`mr-2 h-4 w-4`}),`Ouvrir`]}),h&&(0,f.jsxs)(s.DropdownMenuItem,{onClick:h,children:[(0,f.jsx)(d.Edit,{className:`mr-2 h-4 w-4`}),`Renommer`]}),_&&e.type!==`folder`&&(0,f.jsxs)(s.DropdownMenuItem,{onClick:_,children:[(0,f.jsx)(d.Download,{className:`mr-2 h-4 w-4`}),`Télécharger`]}),g&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(s.DropdownMenuSeparator,{}),(0,f.jsxs)(s.DropdownMenuItem,{onClick:g,className:`text-destructive`,children:[(0,f.jsx)(d.Trash2,{className:`mr-2 h-4 w-4`}),`Supprimer`]})]})]})]})})]})}function _({files:e,currentPath:r=`/`,breadcrumbs:s=[],selectedFiles:p=[],onSelectionChange:m,onNavigate:_,onFileOpen:v,onDownload:y,onDelete:b,onRename:x,onCopy:ee,onMove:S,onCreateFolder:C,onUpload:te,onShare:w,onToggleStar:T,onRefresh:ne,viewMode:re,onViewModeChange:E,showSearch:ie=!0,onSearch:D,showHeader:O=!0,showActions:ae=!0,loading:k=!1,className:A}){let[j,M]=u.useState(`grid`),[N,P]=u.useState(!1),[F,I]=u.useState(null),[L,R]=u.useState(``),[oe,z]=u.useState(!1),[B,V]=u.useState([]),[H,U]=u.useState(!1),[W,G]=u.useState(``),K=re??j,q=e=>{E?E(e):M(e)},J=(e,t)=>{t?m?.([...p,e]):m?.(p.filter(t=>t!==e))},Y=e=>{e.type===`folder`?_?.(e.path,e.id):v?.(e)},X=e=>{I(e),R(e.name),P(!0)},Z=()=>{F&&L.trim()&&L!==F.name&&x?.(F.id,L.trim()),P(!1),I(null)},se=()=>{V(p),z(!0)},ce=()=>{b?.(B),z(!1),V([]),m?.([])},Q=()=>{W.trim()&&(C?.(W.trim(),r),U(!1),G(``))},$=[...e].sort((e,t)=>e.type===`folder`&&t.type!==`folder`?-1:e.type!==`folder`&&t.type===`folder`?1:e.name.localeCompare(t.name));return(0,f.jsxs)(`div`,{className:t.cn(`space-y-4`,A),children:[O&&(0,f.jsx)(h,{breadcrumbs:s,viewMode:K,onViewModeChange:q,onNavigate:e=>_?.(e),onCreateFolder:C?()=>U(!0):void 0,onUpload:te?()=>{}:void 0,onRefresh:ne,showSearch:ie,onSearch:D,selectedCount:p.length,onDeleteSelected:b?se:void 0,onDownloadSelected:y?()=>y(p):void 0}),k?(0,f.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,f.jsx)(d.RefreshCw,{className:`h-6 w-6 animate-spin text-muted-foreground`})}):$.length===0?(0,f.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 text-muted-foreground`,children:[(0,f.jsx)(d.Folder,{className:`h-12 w-12 mb-4`}),(0,f.jsx)(`p`,{children:`Ce dossier est vide`})]}):K===`grid`?(0,f.jsx)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-4`,children:$.map(e=>(0,f.jsx)(g,{file:e,viewMode:`grid`,isSelected:p.includes(e.id),onSelect:t=>J(e.id,t),onOpen:()=>Y(e),onRename:x?()=>X(e):void 0,onDelete:b?()=>{V([e.id]),z(!0)}:void 0,onDownload:y?()=>y([e.id]):void 0,onShare:w?()=>w(e.id):void 0,onToggleStar:T?()=>T(e.id):void 0},e.id))}):(0,f.jsxs)(l.Table,{children:[(0,f.jsx)(l.TableHeader,{children:(0,f.jsxs)(l.TableRow,{children:[(0,f.jsx)(l.TableHead,{className:`w-12`,children:(0,f.jsx)(a.Checkbox,{checked:p.length===e.length&&e.length>0,onCheckedChange:t=>{t?m?.(e.map(e=>e.id)):m?.([])}})}),(0,f.jsx)(l.TableHead,{children:`Nom`}),(0,f.jsx)(l.TableHead,{children:`Taille`}),(0,f.jsx)(l.TableHead,{children:`Modifié`}),(0,f.jsx)(l.TableHead,{className:`w-12`})]})}),(0,f.jsx)(l.TableBody,{children:$.map(e=>(0,f.jsx)(g,{file:e,viewMode:`list`,isSelected:p.includes(e.id),onSelect:t=>J(e.id,t),onOpen:()=>Y(e),onRename:x?()=>X(e):void 0,onDelete:b?()=>{V([e.id]),z(!0)}:void 0,onDownload:y?()=>y([e.id]):void 0,onShare:w?()=>w(e.id):void 0,onToggleStar:T?()=>T(e.id):void 0},e.id))})]}),(0,f.jsx)(o.Dialog,{open:N,onOpenChange:P,children:(0,f.jsxs)(o.DialogContent,{children:[(0,f.jsx)(o.DialogHeader,{children:(0,f.jsx)(o.DialogTitle,{children:`Renommer`})}),(0,f.jsx)(c.Input,{value:L,onChange:e=>R(e.target.value),placeholder:`Nouveau nom`,onKeyDown:e=>e.key===`Enter`&&Z()}),(0,f.jsxs)(o.DialogFooter,{children:[(0,f.jsx)(i.Button,{variant:`outline`,onClick:()=>P(!1),children:`Annuler`}),(0,f.jsx)(i.Button,{onClick:Z,children:`Renommer`})]})]})}),(0,f.jsx)(n.AlertDialog,{open:oe,onOpenChange:z,children:(0,f.jsxs)(n.AlertDialogContent,{children:[(0,f.jsxs)(n.AlertDialogHeader,{children:[(0,f.jsx)(n.AlertDialogTitle,{children:`Supprimer ?`}),(0,f.jsxs)(n.AlertDialogDescription,{children:[`Êtes-vous sûr de vouloir supprimer `,B.length,` élément(s) ? Cette action est irréversible.`]})]}),(0,f.jsxs)(n.AlertDialogFooter,{children:[(0,f.jsx)(n.AlertDialogCancel,{children:`Annuler`}),(0,f.jsx)(n.AlertDialogAction,{onClick:ce,children:`Supprimer`})]})]})}),(0,f.jsx)(o.Dialog,{open:H,onOpenChange:U,children:(0,f.jsxs)(o.DialogContent,{children:[(0,f.jsx)(o.DialogHeader,{children:(0,f.jsx)(o.DialogTitle,{children:`Nouveau dossier`})}),(0,f.jsx)(c.Input,{value:W,onChange:e=>G(e.target.value),placeholder:`Nom du dossier`,onKeyDown:e=>e.key===`Enter`&&Q()}),(0,f.jsxs)(o.DialogFooter,{children:[(0,f.jsx)(i.Button,{variant:`outline`,onClick:()=>U(!1),children:`Annuler`}),(0,f.jsx)(i.Button,{onClick:Q,children:`Créer`})]})]})})]})}var v=[{id:`1`,name:`Documents`,type:`folder`,path:`/Documents`,createdAt:new Date(`2024-01-01`),modifiedAt:new Date(`2024-01-15`)},{id:`2`,name:`Images`,type:`folder`,path:`/Images`,createdAt:new Date(`2024-01-01`),modifiedAt:new Date(`2024-01-10`),starred:!0},{id:`3`,name:`Rapport Q4.pdf`,type:`document`,path:`/Rapport Q4.pdf`,size:2456e3,createdAt:new Date(`2024-01-05`),modifiedAt:new Date(`2024-01-05`)},{id:`4`,name:`Photo vacances.jpg`,type:`image`,path:`/Photo vacances.jpg`,size:567e4,createdAt:new Date(`2024-01-08`),modifiedAt:new Date(`2024-01-08`)},{id:`5`,name:`Présentation.pptx`,type:`document`,path:`/Présentation.pptx`,size:89e5,createdAt:new Date(`2024-01-12`),modifiedAt:new Date(`2024-01-14`),shared:!0}],y=[{id:`root`,name:`Mes fichiers`,path:`/`}];exports.default=_,exports.defaultBreadcrumbs=y,exports.defaultFiles=v;
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js"),n=require("../../components/alert-dialog/index.cjs.js"),r=require("../../components/badge/index.cjs.js"),i=require("../../components/button/index.cjs.js"),a=require("../../components/checkbox/index.cjs.js"),o=require("../../components/dialog/index.cjs.js"),s=require("../../components/dropdown-menu/index.cjs.js"),c=require("../../components/input/index.cjs.js"),l=require("../../components/table/index.cjs.js");let u=require("react");u=e.__toESM(u);let d=require("lucide-react"),f=require("react/jsx-runtime");var p={folder:{icon:d.Folder,color:`text-yellow-500`},document:{icon:d.FileText,color:`text-blue-500`},image:{icon:d.FileImage,color:`text-green-500`},video:{icon:d.FileVideo,color:`text-purple-500`},audio:{icon:d.FileAudio,color:`text-pink-500`},archive:{icon:d.FileArchive,color:`text-orange-500`},code:{icon:d.FileCode,color:`text-cyan-500`},other:{icon:d.File,color:`text-gray-500`}};function m(e){if(!e)return`-`;let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=0,r=e;for(;r>=1024&&n<t.length-1;)r/=1024,n++;return`${r.toFixed(1)} ${t[n]}`}function h({breadcrumbs:e,viewMode:n,onViewModeChange:r,onNavigate:a,onCreateFolder:o,onUpload:s,onRefresh:l,showSearch:p,onSearch:m,selectedCount:h,onDeleteSelected:g,onDownloadSelected:_}){let[v,y]=u.useState(``);return(0,f.jsxs)(`div`,{className:`space-y-4`,children:[(0,f.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,f.jsxs)(`div`,{className:`flex items-center gap-2`,children:[l&&(0,f.jsx)(i.Button,{variant:`outline`,size:`icon`,onClick:l,children:(0,f.jsx)(d.RefreshCw,{className:`h-4 w-4`})}),s&&(0,f.jsxs)(i.Button,{variant:`outline`,onClick:s,children:[(0,f.jsx)(d.Upload,{className:`h-4 w-4 mr-2`}),`Importer`]}),o&&(0,f.jsxs)(i.Button,{variant:`outline`,onClick:o,children:[(0,f.jsx)(d.FolderPlus,{className:`h-4 w-4 mr-2`}),`Nouveau dossier`]})]}),(0,f.jsxs)(`div`,{className:`flex items-center gap-2`,children:[p&&m&&(0,f.jsxs)(`div`,{className:`relative w-64`,children:[(0,f.jsx)(d.Search,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground`}),(0,f.jsx)(c.Input,{placeholder:`Rechercher...`,value:v,onChange:e=>{y(e.target.value),m(e.target.value)},className:`pl-9`})]}),(0,f.jsx)(i.Button,{variant:n===`grid`?`secondary`:`ghost`,size:`icon`,onClick:()=>r(`grid`),children:(0,f.jsx)(d.Grid,{className:`h-4 w-4`})}),(0,f.jsx)(i.Button,{variant:n===`list`?`secondary`:`ghost`,size:`icon`,onClick:()=>r(`list`),children:(0,f.jsx)(d.List,{className:`h-4 w-4`})})]})]}),(0,f.jsxs)(`div`,{className:`flex items-center gap-1 text-sm`,children:[(0,f.jsx)(`button`,{onClick:()=>a(`/`),className:`flex items-center gap-1 hover:text-primary`,children:(0,f.jsx)(d.Home,{className:`h-4 w-4`})}),e.map((n,r)=>(0,f.jsxs)(u.Fragment,{children:[(0,f.jsx)(d.ChevronRight,{className:`h-4 w-4 text-muted-foreground`}),(0,f.jsx)(`button`,{onClick:()=>a(n.path),className:t.cn(`hover:text-primary`,r===e.length-1&&`font-medium`),children:n.name})]},n.id))]}),h>0&&(0,f.jsxs)(`div`,{className:`flex items-center gap-4 p-3 bg-muted rounded-lg`,children:[(0,f.jsxs)(`span`,{className:`text-sm font-medium`,children:[h,` élément(s) sélectionné(s)`]}),_&&(0,f.jsxs)(i.Button,{variant:`outline`,size:`sm`,onClick:_,children:[(0,f.jsx)(d.Download,{className:`h-4 w-4 mr-2`}),`Télécharger`]}),g&&(0,f.jsxs)(i.Button,{variant:`destructive`,size:`sm`,onClick:g,children:[(0,f.jsx)(d.Trash2,{className:`h-4 w-4 mr-2`}),`Supprimer`]})]})]})}function g({file:e,viewMode:n,isSelected:o,onSelect:c,onOpen:u,onRename:h,onDelete:g,onDownload:_,onShare:v,onToggleStar:y}){let b=p[e.type],x=b.icon,ee=typeof e.modifiedAt==`string`?new Date(e.modifiedAt):e.modifiedAt,S=()=>{e.type===`folder`&&u()};return n===`grid`?(0,f.jsxs)(`div`,{className:t.cn(`relative group p-4 rounded-lg border cursor-pointer transition-colors`,o?`bg-primary/10 border-primary`:`hover:bg-muted`),onClick:()=>c(!o),onDoubleClick:S,children:[(0,f.jsx)(`div`,{className:`absolute top-2 left-2 opacity-0 group-hover:opacity-100 transition-opacity`,children:(0,f.jsx)(a.Checkbox,{checked:o,onCheckedChange:e=>c(e),onClick:e=>e.stopPropagation()})}),e.starred&&(0,f.jsx)(d.Star,{className:`absolute top-2 right-2 h-4 w-4 text-yellow-500 fill-yellow-500`}),(0,f.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[e.thumbnail&&e.type===`image`?(0,f.jsx)(`img`,{src:e.thumbnail,alt:e.name,className:`w-16 h-16 object-cover rounded`}):(0,f.jsx)(x,{className:t.cn(`h-12 w-12`,b.color)}),(0,f.jsx)(`span`,{className:`text-sm font-medium text-center line-clamp-2`,children:e.name}),e.type!==`folder`&&(0,f.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:m(e.size)})]}),(0,f.jsx)(`div`,{className:`absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity`,children:(0,f.jsxs)(s.DropdownMenu,{children:[(0,f.jsx)(s.DropdownMenuTrigger,{asChild:!0,onClick:e=>e.stopPropagation(),children:(0,f.jsx)(i.Button,{variant:`ghost`,size:`icon`,className:`h-7 w-7`,children:(0,f.jsx)(d.MoreHorizontal,{className:`h-4 w-4`})})}),(0,f.jsxs)(s.DropdownMenuContent,{align:`end`,children:[(0,f.jsxs)(s.DropdownMenuItem,{onClick:u,children:[(0,f.jsx)(d.Eye,{className:`mr-2 h-4 w-4`}),`Ouvrir`]}),h&&(0,f.jsxs)(s.DropdownMenuItem,{onClick:h,children:[(0,f.jsx)(d.Edit,{className:`mr-2 h-4 w-4`}),`Renommer`]}),_&&e.type!==`folder`&&(0,f.jsxs)(s.DropdownMenuItem,{onClick:_,children:[(0,f.jsx)(d.Download,{className:`mr-2 h-4 w-4`}),`Télécharger`]}),v&&(0,f.jsxs)(s.DropdownMenuItem,{onClick:v,children:[(0,f.jsx)(d.Share2,{className:`mr-2 h-4 w-4`}),`Partager`]}),y&&(0,f.jsx)(s.DropdownMenuItem,{onClick:y,children:e.starred?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(d.StarOff,{className:`mr-2 h-4 w-4`}),`Retirer des favoris`]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(d.Star,{className:`mr-2 h-4 w-4`}),`Ajouter aux favoris`]})}),g&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(s.DropdownMenuSeparator,{}),(0,f.jsxs)(s.DropdownMenuItem,{onClick:g,className:`text-destructive`,children:[(0,f.jsx)(d.Trash2,{className:`mr-2 h-4 w-4`}),`Supprimer`]})]})]})]})})]}):(0,f.jsxs)(l.TableRow,{className:t.cn(`cursor-pointer`,o&&`bg-primary/10`),onClick:()=>c(!o),onDoubleClick:S,children:[(0,f.jsx)(l.TableCell,{className:`w-12`,children:(0,f.jsx)(a.Checkbox,{checked:o,onCheckedChange:e=>c(e),onClick:e=>e.stopPropagation()})}),(0,f.jsx)(l.TableCell,{children:(0,f.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,f.jsx)(x,{className:t.cn(`h-5 w-5`,b.color)}),(0,f.jsx)(`span`,{className:`font-medium`,children:e.name}),e.starred&&(0,f.jsx)(d.Star,{className:`h-4 w-4 text-yellow-500 fill-yellow-500`}),e.shared&&(0,f.jsx)(r.Badge,{variant:`secondary`,className:`text-xs`,children:`Partagé`})]})}),(0,f.jsx)(l.TableCell,{className:`text-muted-foreground`,children:m(e.size)}),(0,f.jsx)(l.TableCell,{className:`text-muted-foreground`,children:ee.toLocaleDateString(`fr-FR`)}),(0,f.jsx)(l.TableCell,{children:(0,f.jsxs)(s.DropdownMenu,{children:[(0,f.jsx)(s.DropdownMenuTrigger,{asChild:!0,onClick:e=>e.stopPropagation(),children:(0,f.jsx)(i.Button,{variant:`ghost`,size:`icon`,className:`h-8 w-8`,children:(0,f.jsx)(d.MoreHorizontal,{className:`h-4 w-4`})})}),(0,f.jsxs)(s.DropdownMenuContent,{align:`end`,children:[(0,f.jsxs)(s.DropdownMenuItem,{onClick:u,children:[(0,f.jsx)(d.Eye,{className:`mr-2 h-4 w-4`}),`Ouvrir`]}),h&&(0,f.jsxs)(s.DropdownMenuItem,{onClick:h,children:[(0,f.jsx)(d.Edit,{className:`mr-2 h-4 w-4`}),`Renommer`]}),_&&e.type!==`folder`&&(0,f.jsxs)(s.DropdownMenuItem,{onClick:_,children:[(0,f.jsx)(d.Download,{className:`mr-2 h-4 w-4`}),`Télécharger`]}),g&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(s.DropdownMenuSeparator,{}),(0,f.jsxs)(s.DropdownMenuItem,{onClick:g,className:`text-destructive`,children:[(0,f.jsx)(d.Trash2,{className:`mr-2 h-4 w-4`}),`Supprimer`]})]})]})]})})]})}function _({files:e,currentPath:r=`/`,breadcrumbs:s=[],selectedFiles:p=[],onSelectionChange:m,onNavigate:_,onFileOpen:v,onDownload:y,onDelete:b,onRename:x,onCopy:ee,onMove:S,onCreateFolder:C,onUpload:te,onShare:w,onToggleStar:T,onRefresh:ne,viewMode:re,onViewModeChange:E,showSearch:ie=!0,onSearch:D,showHeader:O=!0,showActions:ae=!0,loading:k=!1,className:A}){let[j,M]=u.useState(`grid`),[N,P]=u.useState(!1),[F,I]=u.useState(null),[L,R]=u.useState(``),[oe,z]=u.useState(!1),[B,V]=u.useState([]),[H,U]=u.useState(!1),[W,G]=u.useState(``),K=re??j,q=e=>{E?E(e):M(e)},J=(e,t)=>{t?m?.([...p,e]):m?.(p.filter(t=>t!==e))},Y=e=>{e.type===`folder`?_?.(e.path,e.id):v?.(e)},X=e=>{I(e),R(e.name),P(!0)},Z=()=>{F&&L.trim()&&L!==F.name&&x?.(F.id,L.trim()),P(!1),I(null)},se=()=>{V(p),z(!0)},ce=()=>{b?.(B),z(!1),V([]),m?.([])},Q=()=>{W.trim()&&(C?.(W.trim(),r),U(!1),G(``))},$=[...e].sort((e,t)=>e.type===`folder`&&t.type!==`folder`?-1:e.type!==`folder`&&t.type===`folder`?1:e.name.localeCompare(t.name));return(0,f.jsxs)(`div`,{className:t.cn(`space-y-4`,A),children:[O&&(0,f.jsx)(h,{breadcrumbs:s,viewMode:K,onViewModeChange:q,onNavigate:e=>_?.(e),onCreateFolder:C?()=>U(!0):void 0,onUpload:te?()=>{}:void 0,onRefresh:ne,showSearch:ie,onSearch:D,selectedCount:p.length,onDeleteSelected:b?se:void 0,onDownloadSelected:y?()=>y(p):void 0}),k?(0,f.jsx)(`div`,{className:`flex items-center justify-center py-12`,children:(0,f.jsx)(d.RefreshCw,{className:`h-6 w-6 animate-spin text-muted-foreground`})}):$.length===0?(0,f.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 text-muted-foreground`,children:[(0,f.jsx)(d.Folder,{className:`h-12 w-12 mb-4`}),(0,f.jsx)(`p`,{children:`Ce dossier est vide`})]}):K===`grid`?(0,f.jsx)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-4`,children:$.map(e=>(0,f.jsx)(g,{file:e,viewMode:`grid`,isSelected:p.includes(e.id),onSelect:t=>J(e.id,t),onOpen:()=>Y(e),onRename:x?()=>X(e):void 0,onDelete:b?()=>{V([e.id]),z(!0)}:void 0,onDownload:y?()=>y([e.id]):void 0,onShare:w?()=>w(e.id):void 0,onToggleStar:T?()=>T(e.id):void 0},e.id))}):(0,f.jsxs)(l.Table,{children:[(0,f.jsx)(l.TableHeader,{children:(0,f.jsxs)(l.TableRow,{children:[(0,f.jsx)(l.TableHead,{className:`w-12`,children:(0,f.jsx)(a.Checkbox,{checked:p.length===e.length&&e.length>0,onCheckedChange:t=>{t?m?.(e.map(e=>e.id)):m?.([])}})}),(0,f.jsx)(l.TableHead,{children:`Nom`}),(0,f.jsx)(l.TableHead,{children:`Taille`}),(0,f.jsx)(l.TableHead,{children:`Modifié`}),(0,f.jsx)(l.TableHead,{className:`w-12`})]})}),(0,f.jsx)(l.TableBody,{children:$.map(e=>(0,f.jsx)(g,{file:e,viewMode:`list`,isSelected:p.includes(e.id),onSelect:t=>J(e.id,t),onOpen:()=>Y(e),onRename:x?()=>X(e):void 0,onDelete:b?()=>{V([e.id]),z(!0)}:void 0,onDownload:y?()=>y([e.id]):void 0,onShare:w?()=>w(e.id):void 0,onToggleStar:T?()=>T(e.id):void 0},e.id))})]}),(0,f.jsx)(o.Dialog,{open:N,onOpenChange:P,children:(0,f.jsxs)(o.DialogContent,{children:[(0,f.jsx)(o.DialogHeader,{children:(0,f.jsx)(o.DialogTitle,{children:`Renommer`})}),(0,f.jsx)(c.Input,{value:L,onChange:e=>R(e.target.value),placeholder:`Nouveau nom`,onKeyDown:e=>e.key===`Enter`&&Z()}),(0,f.jsxs)(o.DialogFooter,{children:[(0,f.jsx)(i.Button,{variant:`outline`,onClick:()=>P(!1),children:`Annuler`}),(0,f.jsx)(i.Button,{onClick:Z,children:`Renommer`})]})]})}),(0,f.jsx)(n.AlertDialog,{open:oe,onOpenChange:z,children:(0,f.jsxs)(n.AlertDialogContent,{children:[(0,f.jsxs)(n.AlertDialogHeader,{children:[(0,f.jsx)(n.AlertDialogTitle,{children:`Supprimer ?`}),(0,f.jsxs)(n.AlertDialogDescription,{children:[`Êtes-vous sûr de vouloir supprimer `,B.length,` élément(s) ? Cette action est irréversible.`]})]}),(0,f.jsxs)(n.AlertDialogFooter,{children:[(0,f.jsx)(n.AlertDialogCancel,{children:`Annuler`}),(0,f.jsx)(n.AlertDialogAction,{onClick:ce,children:`Supprimer`})]})]})}),(0,f.jsx)(o.Dialog,{open:H,onOpenChange:U,children:(0,f.jsxs)(o.DialogContent,{children:[(0,f.jsx)(o.DialogHeader,{children:(0,f.jsx)(o.DialogTitle,{children:`Nouveau dossier`})}),(0,f.jsx)(c.Input,{value:W,onChange:e=>G(e.target.value),placeholder:`Nom du dossier`,onKeyDown:e=>e.key===`Enter`&&Q()}),(0,f.jsxs)(o.DialogFooter,{children:[(0,f.jsx)(i.Button,{variant:`outline`,onClick:()=>U(!1),children:`Annuler`}),(0,f.jsx)(i.Button,{onClick:Q,children:`Créer`})]})]})})]})}var v=[{id:`1`,name:`Documents`,type:`folder`,path:`/Documents`,createdAt:new Date(`2024-01-01`),modifiedAt:new Date(`2024-01-15`)},{id:`2`,name:`Images`,type:`folder`,path:`/Images`,createdAt:new Date(`2024-01-01`),modifiedAt:new Date(`2024-01-10`),starred:!0},{id:`3`,name:`Rapport Q4.pdf`,type:`document`,path:`/Rapport Q4.pdf`,size:2456e3,createdAt:new Date(`2024-01-05`),modifiedAt:new Date(`2024-01-05`)},{id:`4`,name:`Photo vacances.jpg`,type:`image`,path:`/Photo vacances.jpg`,size:567e4,createdAt:new Date(`2024-01-08`),modifiedAt:new Date(`2024-01-08`)},{id:`5`,name:`Présentation.pptx`,type:`document`,path:`/Présentation.pptx`,size:89e5,createdAt:new Date(`2024-01-12`),modifiedAt:new Date(`2024-01-14`),shared:!0}],y=[{id:`root`,name:`Mes fichiers`,path:`/`}];exports.WakaFileManager=_,exports.default=_,exports.defaultBreadcrumbs=y,exports.defaultFiles=v;
@@ -495,4 +495,4 @@ var me = [
495
495
  path: "/"
496
496
  }];
497
497
  //#endregion
498
- export { q as default, J as defaultBreadcrumbs, me as defaultFiles };
498
+ export { q as WakaFileManager, q as default, J as defaultBreadcrumbs, me as defaultFiles };
@@ -1 +1 @@
1
- "use client";"use client";require(`../../_virtual/_rolldown/runtime.cjs.js`);const e=require(`../../utils/cn.cjs.js`),t=require(`../../components/badge/index.cjs.js`),n=require(`../../components/button/index.cjs.js`),r=require(`../../components/card/index.cjs.js`),i=require(`../../components/progress/index.cjs.js`);let a=require(`react`),o=require(`lucide-react`),s=require(`react/jsx-runtime`);var c=e=>{if(e===0)return`0 Bytes`;let t=1024,n=[`Bytes`,`KB`,`MB`,`GB`],r=Math.floor(Math.log(e)/Math.log(t));return Math.round(e/t**+r*100)/100+` `+n[r]},l=e=>{switch(e){case`pending`:return(0,s.jsx)(o.Shield,{className:`h-4 w-4 text-muted-foreground`});case`scanning`:return(0,s.jsx)(o.Scan,{className:`h-4 w-4 text-blue-500 animate-pulse`});case`clean`:return(0,s.jsx)(o.CheckCircle2,{className:`h-4 w-4 text-green-500`});case`infected`:return(0,s.jsx)(o.ShieldAlert,{className:`h-4 w-4 text-red-500`});case`error`:return(0,s.jsx)(o.AlertCircle,{className:`h-4 w-4 text-orange-500`})}},u=e=>{switch(e){case`pending`:return(0,s.jsx)(t.Badge,{variant:`outline`,children:`En attente`});case`scanning`:return(0,s.jsx)(t.Badge,{variant:`outline`,className:`border-blue-500 text-blue-500`,children:`Scan en cours`});case`clean`:return(0,s.jsx)(t.Badge,{variant:`outline`,className:`border-green-500 text-green-500`,children:`Sain`});case`infected`:return(0,s.jsx)(t.Badge,{variant:`destructive`,children:`Infecté`});case`error`:return(0,s.jsx)(t.Badge,{variant:`outline`,className:`border-orange-500 text-orange-500`,children:`Erreur`})}};function d({files:d=[],maxFileSize:f=100*1024*1024,acceptedTypes:p=[`*/*`],maxConcurrentScans:m=3,onFilesAdded:h,onScanStart:g,onScanComplete:_,onFileRemove:v,onScanAll:y,className:b}){let[x,S]=(0,a.useState)(!1),C=(0,a.useRef)(null),w=(0,a.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),S(!0)},[]),T=(0,a.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),S(!1)},[]),E=(0,a.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),S(!1);let t=Array.from(e.dataTransfer.files);h&&h(t)},[h]),D=(0,a.useCallback)(e=>{let t=e.target.files?Array.from(e.target.files):[];h&&h(t)},[h]),O=()=>{C.current?.click()},k=d.filter(e=>e.status===`pending`).length,A=d.filter(e=>e.status===`scanning`).length,j=d.filter(e=>e.status===`clean`).length,M=d.filter(e=>e.status===`infected`).length,N=d.filter(e=>e.status===`error`).length;return(0,s.jsxs)(r.Card,{className:e.cn(`w-full`,b),children:[(0,s.jsx)(r.CardHeader,{children:(0,s.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,s.jsxs)(`div`,{children:[(0,s.jsx)(r.CardTitle,{children:`Scan Antivirus (ClamAV)`}),(0,s.jsx)(r.CardDescription,{children:`Uploadez vos fichiers pour analyse de sécurité`})]}),d.length>0&&(0,s.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,s.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[d.length,` fichier`,d.length>1?`s`:``]}),k>0&&(0,s.jsxs)(n.Button,{size:`sm`,variant:`outline`,onClick:y,className:`gap-2`,children:[(0,s.jsx)(o.Scan,{className:`h-4 w-4`}),`Scanner tout`]}),(0,s.jsx)(n.Button,{size:`sm`,variant:`ghost`,onClick:()=>d.forEach(e=>v?.(e.id)),children:`Tout supprimer`})]})]})}),(0,s.jsxs)(r.CardContent,{className:`space-y-4`,children:[(0,s.jsxs)(`div`,{onDragOver:w,onDragLeave:T,onDrop:E,onClick:O,className:e.cn(`relative flex min-h-[200px] cursor-pointer flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed p-8 transition-colors`,x?`border-primary bg-primary/5`:`border-muted-foreground/25 hover:border-primary/50 hover:bg-muted/50`),children:[(0,s.jsx)(o.Upload,{className:`h-10 w-10 text-muted-foreground`}),(0,s.jsxs)(`div`,{className:`text-center`,children:[(0,s.jsx)(`p`,{className:`text-sm font-medium`,children:`Glissez vos fichiers ici ou cliquez pour parcourir`}),(0,s.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[`Taille max: `,c(f)]})]}),(0,s.jsx)(`input`,{ref:C,type:`file`,multiple:!0,accept:p.join(`,`),onChange:D,className:`hidden`})]}),d.length>0&&(0,s.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[j>0&&(0,s.jsxs)(t.Badge,{variant:`outline`,className:`border-green-500 text-green-500`,children:[(0,s.jsx)(o.CheckCircle2,{className:`mr-1 h-3 w-3`}),j,` sain`,j>1?`s`:``]}),M>0&&(0,s.jsxs)(t.Badge,{variant:`destructive`,children:[(0,s.jsx)(o.ShieldAlert,{className:`mr-1 h-3 w-3`}),M,` infecté`,M>1?`s`:``]}),A>0&&(0,s.jsxs)(t.Badge,{variant:`outline`,className:`border-blue-500 text-blue-500`,children:[(0,s.jsx)(o.Scan,{className:`mr-1 h-3 w-3`}),A,` en cours`]}),k>0&&(0,s.jsxs)(t.Badge,{variant:`outline`,children:[(0,s.jsx)(o.Shield,{className:`mr-1 h-3 w-3`}),k,` en attente`]}),N>0&&(0,s.jsxs)(t.Badge,{variant:`outline`,className:`border-orange-500 text-orange-500`,children:[(0,s.jsx)(o.AlertCircle,{className:`mr-1 h-3 w-3`}),N,` erreur`,N>1?`s`:``]})]}),d.length>0&&(0,s.jsx)(`div`,{className:`space-y-2`,children:d.map(t=>(0,s.jsx)(`div`,{className:e.cn(`rounded-lg border p-4 transition-colors`,t.status===`infected`&&`border-red-500/50 bg-red-50/50 dark:bg-red-950/20`,t.status===`clean`&&`border-green-500/50 bg-green-50/50 dark:bg-green-950/20`),children:(0,s.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,s.jsxs)(`div`,{className:`flex flex-1 items-start gap-3`,children:[(0,s.jsx)(`div`,{className:`mt-1`,children:l(t.status)}),(0,s.jsxs)(`div`,{className:`flex-1 space-y-1`,children:[(0,s.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,s.jsx)(`span`,{className:`font-medium text-sm`,children:t.file.name}),u(t.status)]}),(0,s.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[c(t.file.size),t.scanDuration&&(0,s.jsxs)(s.Fragment,{children:[` • Scanné en `,t.scanDuration,`ms`]})]}),t.status===`scanning`&&(0,s.jsxs)(`div`,{className:`mt-2`,children:[(0,s.jsx)(i.Progress,{value:t.progress,className:`h-1.5`}),(0,s.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[`Scan en cours... `,t.progress,`%`]})]}),t.status===`infected`&&t.threatName&&(0,s.jsxs)(`div`,{className:`mt-2 flex items-center gap-2 rounded-md bg-red-100 px-2 py-1 dark:bg-red-950/50`,children:[(0,s.jsx)(o.ShieldAlert,{className:`h-3 w-3 text-red-600 dark:text-red-400`}),(0,s.jsxs)(`span`,{className:`text-xs font-medium text-red-600 dark:text-red-400`,children:[`Menace détectée: `,t.threatName]})]}),t.status===`clean`&&t.scannedAt&&(0,s.jsxs)(`div`,{className:`mt-2 flex items-center gap-2`,children:[(0,s.jsx)(o.CheckCircle2,{className:`h-3 w-3 text-green-600 dark:text-green-400`}),(0,s.jsx)(`span`,{className:`text-xs text-green-600 dark:text-green-400`,children:`Fichier sain, aucune menace détectée`})]})]})]}),(0,s.jsx)(n.Button,{size:`sm`,variant:`ghost`,onClick:()=>v?.(t.id),className:`h-8 w-8 p-0`,children:(0,s.jsx)(o.X,{className:`h-4 w-4`})})]})},t.id))})]})]})}exports.default=d;
1
+ "use client";"use client";const e=require("../../utils/cn.cjs.js"),t=require("../../components/badge/index.cjs.js"),n=require("../../components/button/index.cjs.js"),r=require("../../components/card/index.cjs.js"),i=require("../../components/progress/index.cjs.js");let a=require("react"),o=require("lucide-react"),s=require("react/jsx-runtime");var c=e=>{if(e===0)return`0 Bytes`;let t=1024,n=[`Bytes`,`KB`,`MB`,`GB`],r=Math.floor(Math.log(e)/Math.log(t));return Math.round(e/t**r*100)/100+` `+n[r]},l=e=>{switch(e){case`pending`:return(0,s.jsx)(o.Shield,{className:`h-4 w-4 text-muted-foreground`});case`scanning`:return(0,s.jsx)(o.Scan,{className:`h-4 w-4 text-blue-500 animate-pulse`});case`clean`:return(0,s.jsx)(o.CheckCircle2,{className:`h-4 w-4 text-green-500`});case`infected`:return(0,s.jsx)(o.ShieldAlert,{className:`h-4 w-4 text-red-500`});case`error`:return(0,s.jsx)(o.AlertCircle,{className:`h-4 w-4 text-orange-500`})}},u=e=>{switch(e){case`pending`:return(0,s.jsx)(t.Badge,{variant:`outline`,children:`En attente`});case`scanning`:return(0,s.jsx)(t.Badge,{variant:`outline`,className:`border-blue-500 text-blue-500`,children:`Scan en cours`});case`clean`:return(0,s.jsx)(t.Badge,{variant:`outline`,className:`border-green-500 text-green-500`,children:`Sain`});case`infected`:return(0,s.jsx)(t.Badge,{variant:`destructive`,children:`Infecté`});case`error`:return(0,s.jsx)(t.Badge,{variant:`outline`,className:`border-orange-500 text-orange-500`,children:`Erreur`})}};function d({files:d=[],maxFileSize:f=100*1024*1024,acceptedTypes:p=[`*/*`],maxConcurrentScans:m=3,onFilesAdded:h,onScanStart:g,onScanComplete:_,onFileRemove:v,onScanAll:y,className:b}){let[x,S]=(0,a.useState)(!1),C=(0,a.useRef)(null),w=(0,a.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),S(!0)},[]),T=(0,a.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),S(!1)},[]),E=(0,a.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),S(!1);let t=Array.from(e.dataTransfer.files);h&&h(t)},[h]),D=(0,a.useCallback)(e=>{let t=e.target.files?Array.from(e.target.files):[];h&&h(t)},[h]),O=()=>{C.current?.click()},k=d.filter(e=>e.status===`pending`).length,A=d.filter(e=>e.status===`scanning`).length,j=d.filter(e=>e.status===`clean`).length,M=d.filter(e=>e.status===`infected`).length,N=d.filter(e=>e.status===`error`).length;return(0,s.jsxs)(r.Card,{className:e.cn(`w-full`,b),children:[(0,s.jsx)(r.CardHeader,{children:(0,s.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,s.jsxs)(`div`,{children:[(0,s.jsx)(r.CardTitle,{children:`Scan Antivirus (ClamAV)`}),(0,s.jsx)(r.CardDescription,{children:`Uploadez vos fichiers pour analyse de sécurité`})]}),d.length>0&&(0,s.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,s.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[d.length,` fichier`,d.length>1?`s`:``]}),k>0&&(0,s.jsxs)(n.Button,{size:`sm`,variant:`outline`,onClick:y,className:`gap-2`,children:[(0,s.jsx)(o.Scan,{className:`h-4 w-4`}),`Scanner tout`]}),(0,s.jsx)(n.Button,{size:`sm`,variant:`ghost`,onClick:()=>d.forEach(e=>v?.(e.id)),children:`Tout supprimer`})]})]})}),(0,s.jsxs)(r.CardContent,{className:`space-y-4`,children:[(0,s.jsxs)(`div`,{onDragOver:w,onDragLeave:T,onDrop:E,onClick:O,className:e.cn(`relative flex min-h-[200px] cursor-pointer flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed p-8 transition-colors`,x?`border-primary bg-primary/5`:`border-muted-foreground/25 hover:border-primary/50 hover:bg-muted/50`),children:[(0,s.jsx)(o.Upload,{className:`h-10 w-10 text-muted-foreground`}),(0,s.jsxs)(`div`,{className:`text-center`,children:[(0,s.jsx)(`p`,{className:`text-sm font-medium`,children:`Glissez vos fichiers ici ou cliquez pour parcourir`}),(0,s.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[`Taille max: `,c(f)]})]}),(0,s.jsx)(`input`,{ref:C,type:`file`,multiple:!0,accept:p.join(`,`),onChange:D,className:`hidden`})]}),d.length>0&&(0,s.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[j>0&&(0,s.jsxs)(t.Badge,{variant:`outline`,className:`border-green-500 text-green-500`,children:[(0,s.jsx)(o.CheckCircle2,{className:`mr-1 h-3 w-3`}),j,` sain`,j>1?`s`:``]}),M>0&&(0,s.jsxs)(t.Badge,{variant:`destructive`,children:[(0,s.jsx)(o.ShieldAlert,{className:`mr-1 h-3 w-3`}),M,` infecté`,M>1?`s`:``]}),A>0&&(0,s.jsxs)(t.Badge,{variant:`outline`,className:`border-blue-500 text-blue-500`,children:[(0,s.jsx)(o.Scan,{className:`mr-1 h-3 w-3`}),A,` en cours`]}),k>0&&(0,s.jsxs)(t.Badge,{variant:`outline`,children:[(0,s.jsx)(o.Shield,{className:`mr-1 h-3 w-3`}),k,` en attente`]}),N>0&&(0,s.jsxs)(t.Badge,{variant:`outline`,className:`border-orange-500 text-orange-500`,children:[(0,s.jsx)(o.AlertCircle,{className:`mr-1 h-3 w-3`}),N,` erreur`,N>1?`s`:``]})]}),d.length>0&&(0,s.jsx)(`div`,{className:`space-y-2`,children:d.map(t=>(0,s.jsx)(`div`,{className:e.cn(`rounded-lg border p-4 transition-colors`,t.status===`infected`&&`border-red-500/50 bg-red-50/50 dark:bg-red-950/20`,t.status===`clean`&&`border-green-500/50 bg-green-50/50 dark:bg-green-950/20`),children:(0,s.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,s.jsxs)(`div`,{className:`flex flex-1 items-start gap-3`,children:[(0,s.jsx)(`div`,{className:`mt-1`,children:l(t.status)}),(0,s.jsxs)(`div`,{className:`flex-1 space-y-1`,children:[(0,s.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,s.jsx)(`span`,{className:`font-medium text-sm`,children:t.file.name}),u(t.status)]}),(0,s.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[c(t.file.size),t.scanDuration&&(0,s.jsxs)(s.Fragment,{children:[` • Scanné en `,t.scanDuration,`ms`]})]}),t.status===`scanning`&&(0,s.jsxs)(`div`,{className:`mt-2`,children:[(0,s.jsx)(i.Progress,{value:t.progress,className:`h-1.5`}),(0,s.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[`Scan en cours... `,t.progress,`%`]})]}),t.status===`infected`&&t.threatName&&(0,s.jsxs)(`div`,{className:`mt-2 flex items-center gap-2 rounded-md bg-red-100 px-2 py-1 dark:bg-red-950/50`,children:[(0,s.jsx)(o.ShieldAlert,{className:`h-3 w-3 text-red-600 dark:text-red-400`}),(0,s.jsxs)(`span`,{className:`text-xs font-medium text-red-600 dark:text-red-400`,children:[`Menace détectée: `,t.threatName]})]}),t.status===`clean`&&t.scannedAt&&(0,s.jsxs)(`div`,{className:`mt-2 flex items-center gap-2`,children:[(0,s.jsx)(o.CheckCircle2,{className:`h-3 w-3 text-green-600 dark:text-green-400`}),(0,s.jsx)(`span`,{className:`text-xs text-green-600 dark:text-green-400`,children:`Fichier sain, aucune menace détectée`})]})]})]}),(0,s.jsx)(n.Button,{size:`sm`,variant:`ghost`,onClick:()=>v?.(t.id),className:`h-8 w-8 p-0`,children:(0,s.jsx)(o.X,{className:`h-4 w-4`})})]})},t.id))})]})]})}exports.FileScanUploader=d,exports.default=d;
@@ -17,7 +17,7 @@ var S = (e) => {
17
17
  "MB",
18
18
  "GB"
19
19
  ], r = Math.floor(Math.log(e) / Math.log(t));
20
- return Math.round(e / t ** +r * 100) / 100 + " " + n[r];
20
+ return Math.round(e / t ** r * 100) / 100 + " " + n[r];
21
21
  }, C = (e) => {
22
22
  switch (e) {
23
23
  case "pending": return /* @__PURE__ */ b(h, { className: "h-4 w-4 text-muted-foreground" });
@@ -254,4 +254,4 @@ function T({ files: T = [], maxFileSize: E = 100 * 1024 * 1024, acceptedTypes: D
254
254
  });
255
255
  }
256
256
  //#endregion
257
- export { T as default };
257
+ export { T as FileScanUploader, T as default };
@@ -1 +1 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`),n=require(`../../components/button/index.cjs.js`),r=require(`../../components/separator/index.cjs.js`);let i=require(`react`);i=e.__toESM(i);let a=require(`lucide-react`),o=require(`react/jsx-runtime`);var s={github:a.Globe,twitter:a.Share2,linkedin:a.ExternalLink,email:a.Mail};function c({columns:e=[],socialLinks:i=[],copyright:a=`© 2024 Tous droits réservés.`,className:c}){return(0,o.jsx)(`footer`,{className:t.cn(`bg-muted/40`,c),children:(0,o.jsxs)(`div`,{className:`container mx-auto px-4 py-12`,children:[(0,o.jsxs)(`div`,{className:`grid grid-cols-1 gap-8 md:grid-cols-2 lg:grid-cols-4`,children:[e.map((e,t)=>(0,o.jsxs)(`div`,{className:`space-y-4`,children:[(0,o.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:e.title}),(0,o.jsx)(`ul`,{className:`space-y-2`,children:e.links.map((e,t)=>(0,o.jsx)(`li`,{children:(0,o.jsx)(`a`,{href:e.href,className:`text-sm text-muted-foreground hover:text-foreground transition-colors`,children:e.label})},t))})]},t)),i.length>0&&(0,o.jsxs)(`div`,{className:`space-y-4`,children:[(0,o.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Suivez-nous`}),(0,o.jsx)(`div`,{className:`flex space-x-4`,children:i.map((e,t)=>{let r=s[e.platform];return(0,o.jsx)(n.Button,{variant:`ghost`,size:`icon`,asChild:!0,className:`h-8 w-8`,children:(0,o.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":e.platform,children:(0,o.jsx)(r,{className:`h-4 w-4`})})},t)})})]})]}),(0,o.jsx)(r.Separator,{className:`my-8`}),(0,o.jsxs)(`div`,{className:`flex flex-col items-center justify-between space-y-4 md:flex-row md:space-y-0`,children:[(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:a}),(0,o.jsxs)(`div`,{className:`flex space-x-6`,children:[(0,o.jsx)(`a`,{href:`/privacy`,className:`text-sm text-muted-foreground hover:text-foreground transition-colors`,children:`Politique de confidentialité`}),(0,o.jsx)(`a`,{href:`/terms`,className:`text-sm text-muted-foreground hover:text-foreground transition-colors`,children:`Conditions d'utilisation`})]})]})]})})}exports.Footer=c;
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js"),n=require("../../components/button/index.cjs.js"),r=require("../../components/separator/index.cjs.js");let i=require("react");i=e.__toESM(i);let a=require("lucide-react"),o=require("react/jsx-runtime");var s={github:a.Globe,twitter:a.Share2,linkedin:a.ExternalLink,email:a.Mail};function c({columns:e=[],socialLinks:i=[],copyright:a=`© 2024 Tous droits réservés.`,className:c}){return(0,o.jsx)(`footer`,{className:t.cn(`bg-muted/40`,c),children:(0,o.jsxs)(`div`,{className:`container mx-auto px-4 py-12`,children:[(0,o.jsxs)(`div`,{className:`grid grid-cols-1 gap-8 md:grid-cols-2 lg:grid-cols-4`,children:[e.map((e,t)=>(0,o.jsxs)(`div`,{className:`space-y-4`,children:[(0,o.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:e.title}),(0,o.jsx)(`ul`,{className:`space-y-2`,children:e.links.map((e,t)=>(0,o.jsx)(`li`,{children:(0,o.jsx)(`a`,{href:e.href,className:`text-sm text-muted-foreground hover:text-foreground transition-colors`,children:e.label})},t))})]},t)),i.length>0&&(0,o.jsxs)(`div`,{className:`space-y-4`,children:[(0,o.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Suivez-nous`}),(0,o.jsx)(`div`,{className:`flex space-x-4`,children:i.map((e,t)=>{let r=s[e.platform];return(0,o.jsx)(n.Button,{variant:`ghost`,size:`icon`,asChild:!0,className:`h-8 w-8`,children:(0,o.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":e.platform,children:(0,o.jsx)(r,{className:`h-4 w-4`})})},t)})})]})]}),(0,o.jsx)(r.Separator,{className:`my-8`}),(0,o.jsxs)(`div`,{className:`flex flex-col items-center justify-between space-y-4 md:flex-row md:space-y-0`,children:[(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:a}),(0,o.jsxs)(`div`,{className:`flex space-x-6`,children:[(0,o.jsx)(`a`,{href:`/privacy`,className:`text-sm text-muted-foreground hover:text-foreground transition-colors`,children:`Politique de confidentialité`}),(0,o.jsx)(`a`,{href:`/terms`,className:`text-sm text-muted-foreground hover:text-foreground transition-colors`,children:`Conditions d'utilisation`})]})]})]})})}exports.Footer=c;
@@ -1 +1 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`),n=require(`../../components/badge/index.cjs.js`),r=require(`../../components/button/index.cjs.js`),i=require(`../../components/card/index.cjs.js`),a=require(`../../components/progress/index.cjs.js`),o=require(`../../components/scroll-area/index.cjs.js`);let s=require(`react`);s=e.__toESM(s);let c=require(`lucide-react`),l=require(`react/jsx-runtime`);var u={synced:{icon:c.CheckCircle2,color:`text-green-500`,bgColor:`bg-green-500`,label:`Synced`},out_of_sync:{icon:c.AlertTriangle,color:`text-yellow-500`,bgColor:`bg-yellow-500`,label:`Out of Sync`},syncing:{icon:c.Loader2,color:`text-blue-500`,bgColor:`bg-blue-500`,label:`Syncing`},failed:{icon:c.XCircle,color:`text-red-500`,bgColor:`bg-red-500`,label:`Failed`},unknown:{icon:c.Clock,color:`text-gray-500`,bgColor:`bg-gray-500`,label:`Unknown`},suspended:{icon:c.Pause,color:`text-orange-500`,bgColor:`bg-orange-500`,label:`Suspended`}},d={healthy:{color:`text-green-500`,bgColor:`bg-green-500`,label:`Healthy`},degraded:{color:`text-red-500`,bgColor:`bg-red-500`,label:`Degraded`},progressing:{color:`text-blue-500`,bgColor:`bg-blue-500`,label:`Progressing`},missing:{color:`text-yellow-500`,bgColor:`bg-yellow-500`,label:`Missing`},unknown:{color:`text-gray-500`,bgColor:`bg-gray-500`,label:`Unknown`}};function f(e){let t=Math.floor((Date.now()-e.getTime())/1e3);if(t<60)return`${t}s ago`;let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function p(e){return e.slice(0,7)}function m({status:e}){let r=u[e],i=r.icon;return(0,l.jsxs)(n.Badge,{variant:`outline`,className:t.cn(`gap-1`,r.color),children:[(0,l.jsx)(i,{className:t.cn(`h-3 w-3`,e===`syncing`&&`animate-spin`)}),r.label]})}function h({status:e}){let n=d[e];return(0,l.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,l.jsx)(`div`,{className:t.cn(`w-2 h-2 rounded-full`,n.bgColor)}),(0,l.jsx)(`span`,{className:t.cn(`text-sm`,n.color),children:n.label})]})}function g({app:e,onSync:o,onSuspend:g,onResume:_,onViewDetails:v}){let y=u[e.syncStatus];d[e.healthStatus];let b=y.icon,x=s.useMemo(()=>({synced:e.resources.filter(e=>e.syncStatus===`synced`).length,healthy:e.resources.filter(e=>e.healthStatus===`healthy`).length,total:e.resources.length}),[e.resources]);return(0,l.jsx)(i.Card,{className:t.cn(e.syncStatus===`failed`&&`border-red-500/50`,e.syncStatus===`out_of_sync`&&`border-yellow-500/30`,e.healthStatus===`degraded`&&`border-red-500/30`),children:(0,l.jsx)(i.CardContent,{className:`p-4`,children:(0,l.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,l.jsx)(`div`,{className:t.cn(`w-12 h-12 rounded-lg flex items-center justify-center shrink-0`,`${y.bgColor}/10`),children:(0,l.jsx)(b,{className:t.cn(`h-6 w-6`,y.color,e.syncStatus===`syncing`&&`animate-spin`)})}),(0,l.jsxs)(`div`,{className:`flex-1 min-w-0 space-y-3`,children:[(0,l.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,l.jsx)(`h3`,{className:`font-semibold`,children:e.name}),(0,l.jsx)(n.Badge,{variant:`secondary`,className:`text-xs`,children:e.project})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-2 mt-1 text-sm text-muted-foreground`,children:[(0,l.jsx)(c.Server,{className:`h-3 w-3`}),(0,l.jsx)(`span`,{children:e.destination.namespace}),(0,l.jsx)(`span`,{children:`@`}),(0,l.jsx)(`span`,{className:`truncate max-w-[200px]`,children:e.destination.server})]})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,l.jsx)(m,{status:e.syncStatus}),(0,l.jsx)(h,{status:e.healthStatus})]})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-4 text-sm`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-1.5 text-muted-foreground`,children:[(0,l.jsx)(c.GitBranch,{className:`h-4 w-4`}),(0,l.jsx)(`span`,{children:e.repo.branch})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-1.5 text-muted-foreground`,children:[(0,l.jsx)(c.Folder,{className:`h-4 w-4`}),(0,l.jsx)(`span`,{className:`truncate max-w-[150px]`,children:e.repo.path})]}),e.lastSyncedRevision&&(0,l.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,l.jsx)(c.GitCommit,{className:`h-4 w-4 text-muted-foreground`}),(0,l.jsx)(`code`,{className:`text-xs bg-muted px-1.5 py-0.5 rounded`,children:p(e.lastSyncedRevision)}),e.targetRevision&&e.lastSyncedRevision!==e.targetRevision&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.ArrowRight,{className:`h-3 w-3 text-muted-foreground`}),(0,l.jsx)(`code`,{className:`text-xs bg-yellow-500/20 text-yellow-600 px-1.5 py-0.5 rounded`,children:p(e.targetRevision)})]})]})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,l.jsxs)(`div`,{className:`flex-1`,children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between text-xs mb-1`,children:[(0,l.jsx)(`span`,{className:`text-muted-foreground`,children:`Resources Synced`}),(0,l.jsxs)(`span`,{children:[x.synced,`/`,x.total]})]}),(0,l.jsx)(a.Progress,{value:x.synced/x.total*100,className:`h-1.5`})]}),(0,l.jsxs)(`div`,{className:`flex-1`,children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between text-xs mb-1`,children:[(0,l.jsx)(`span`,{className:`text-muted-foreground`,children:`Resources Healthy`}),(0,l.jsxs)(`span`,{children:[x.healthy,`/`,x.total]})]}),(0,l.jsx)(a.Progress,{value:x.healthy/x.total*100,className:t.cn(`h-1.5`,x.healthy<x.total&&`[&>div]:bg-yellow-500`)})]})]}),e.message&&(e.syncStatus===`failed`||e.healthStatus===`degraded`)&&(0,l.jsx)(`div`,{className:`text-sm text-red-500 bg-red-500/10 p-2 rounded`,children:e.message}),(0,l.jsxs)(`div`,{className:`flex items-center justify-between pt-2 border-t`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[e.lastSyncedAt&&(0,l.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,l.jsx)(c.Clock,{className:`h-3 w-3`}),`Last synced `,f(e.lastSyncedAt)]}),e.autoSync&&(0,l.jsxs)(n.Badge,{variant:`outline`,className:`text-xs`,children:[(0,l.jsx)(c.RefreshCw,{className:`h-3 w-3 mr-1`}),`Auto-sync`]})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-1`,children:[v&&(0,l.jsxs)(r.Button,{variant:`ghost`,size:`sm`,onClick:v,children:[(0,l.jsx)(c.Eye,{className:`h-4 w-4 mr-1`}),`Details`]}),e.syncStatus===`suspended`&&_?(0,l.jsxs)(r.Button,{variant:`outline`,size:`sm`,onClick:_,children:[(0,l.jsx)(c.Play,{className:`h-4 w-4 mr-1`}),`Resume`]}):(0,l.jsxs)(l.Fragment,{children:[g&&e.syncStatus!==`suspended`&&(0,l.jsx)(r.Button,{variant:`ghost`,size:`sm`,onClick:g,children:(0,l.jsx)(c.Pause,{className:`h-4 w-4`})}),o&&e.syncStatus!==`syncing`&&(0,l.jsxs)(r.Button,{variant:`outline`,size:`sm`,onClick:o,children:[(0,l.jsx)(c.RefreshCw,{className:`h-4 w-4 mr-1`}),`Sync`]})]})]})]})]})]})})})}function _({applications:e}){let t=s.useMemo(()=>({total:e.length,synced:e.filter(e=>e.syncStatus===`synced`).length,outOfSync:e.filter(e=>e.syncStatus===`out_of_sync`).length,failed:e.filter(e=>e.syncStatus===`failed`).length,healthy:e.filter(e=>e.healthStatus===`healthy`).length,degraded:e.filter(e=>e.healthStatus===`degraded`).length}),[e]);return(0,l.jsxs)(`div`,{className:`grid grid-cols-6 gap-4`,children:[(0,l.jsx)(i.Card,{children:(0,l.jsxs)(i.CardContent,{className:`p-4 text-center`,children:[(0,l.jsx)(`div`,{className:`text-2xl font-bold`,children:t.total}),(0,l.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Total Apps`})]})}),(0,l.jsx)(i.Card,{children:(0,l.jsxs)(i.CardContent,{className:`p-4 text-center`,children:[(0,l.jsx)(`div`,{className:`text-2xl font-bold text-green-500`,children:t.synced}),(0,l.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Synced`})]})}),(0,l.jsx)(i.Card,{children:(0,l.jsxs)(i.CardContent,{className:`p-4 text-center`,children:[(0,l.jsx)(`div`,{className:`text-2xl font-bold text-yellow-500`,children:t.outOfSync}),(0,l.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Out of Sync`})]})}),(0,l.jsx)(i.Card,{children:(0,l.jsxs)(i.CardContent,{className:`p-4 text-center`,children:[(0,l.jsx)(`div`,{className:`text-2xl font-bold text-red-500`,children:t.failed}),(0,l.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Failed`})]})}),(0,l.jsx)(i.Card,{children:(0,l.jsxs)(i.CardContent,{className:`p-4 text-center`,children:[(0,l.jsx)(`div`,{className:`text-2xl font-bold text-green-500`,children:t.healthy}),(0,l.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Healthy`})]})}),(0,l.jsx)(i.Card,{children:(0,l.jsxs)(i.CardContent,{className:`p-4 text-center`,children:[(0,l.jsx)(`div`,{className:`text-2xl font-bold text-red-500`,children:t.degraded}),(0,l.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Degraded`})]})})]})}function v({applications:e,onSync:n,onRefresh:a,onSuspend:d,onResume:f,onViewDetails:p,className:m}){let[h,v]=s.useState(`all`),y=s.useMemo(()=>h===`all`?e:e.filter(e=>e.syncStatus===h),[e,h]);return(0,l.jsxs)(`div`,{className:t.cn(`space-y-6`,m),children:[(0,l.jsx)(i.Card,{children:(0,l.jsx)(i.CardHeader,{children:(0,l.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,l.jsx)(c.GitBranch,{className:`h-6 w-6`}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(i.CardTitle,{children:`GitOps Sync Status`}),(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Monitor application synchronization with Git`})]})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[[`all`,`synced`,`out_of_sync`,`failed`,`syncing`].map(e=>(0,l.jsx)(r.Button,{variant:h===e?`default`:`ghost`,size:`sm`,onClick:()=>v(e),children:e===`all`?`All`:u[e].label},e)),a&&(0,l.jsxs)(r.Button,{variant:`outline`,onClick:a,children:[(0,l.jsx)(c.RefreshCw,{className:`h-4 w-4 mr-1`}),`Refresh All`]})]})]})})}),(0,l.jsx)(_,{applications:e}),(0,l.jsx)(o.ScrollArea,{className:`h-[500px]`,children:(0,l.jsx)(`div`,{className:`space-y-4 pr-4`,children:y.length===0?(0,l.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-48 text-muted-foreground`,children:[(0,l.jsx)(c.Cloud,{className:`h-12 w-12 mb-4`}),(0,l.jsx)(`p`,{className:`text-lg font-medium`,children:`No applications found`}),(0,l.jsx)(`p`,{className:`text-sm`,children:`Adjust your filters or add new applications`})]}):y.map(e=>(0,l.jsx)(g,{app:e,onSync:n?()=>n(e):void 0,onSuspend:d?()=>d(e):void 0,onResume:f?()=>f(e):void 0,onViewDetails:p?()=>p(e):void 0},e.id))})})]})}var y=[{id:`1`,name:`api-gateway`,project:`production`,repo:{url:`https://github.com/example/infra`,branch:`main`,path:`apps/api-gateway`},destination:{server:`https://kubernetes.default.svc`,namespace:`production`},syncStatus:`synced`,healthStatus:`healthy`,lastSyncedAt:new Date(Date.now()-5*6e4),lastSyncedRevision:`a1b2c3d4e5f6789`,autoSync:!0,resources:[{kind:`Deployment`,name:`api-gateway`,namespace:`production`,syncStatus:`synced`,healthStatus:`healthy`},{kind:`Service`,name:`api-gateway`,namespace:`production`,syncStatus:`synced`,healthStatus:`healthy`},{kind:`ConfigMap`,name:`api-gateway-config`,namespace:`production`,syncStatus:`synced`,healthStatus:`healthy`},{kind:`Ingress`,name:`api-gateway`,namespace:`production`,syncStatus:`synced`,healthStatus:`healthy`}]},{id:`2`,name:`user-service`,project:`production`,repo:{url:`https://github.com/example/infra`,branch:`main`,path:`apps/user-service`},destination:{server:`https://kubernetes.default.svc`,namespace:`production`},syncStatus:`out_of_sync`,healthStatus:`healthy`,lastSyncedAt:new Date(Date.now()-2*36e5),lastSyncedRevision:`old123456789`,targetRevision:`new987654321`,autoSync:!1,resources:[{kind:`Deployment`,name:`user-service`,namespace:`production`,syncStatus:`out_of_sync`,healthStatus:`healthy`},{kind:`Service`,name:`user-service`,namespace:`production`,syncStatus:`synced`,healthStatus:`healthy`},{kind:`Secret`,name:`user-service-secrets`,namespace:`production`,syncStatus:`out_of_sync`,healthStatus:`healthy`}]},{id:`3`,name:`payment-service`,project:`production`,repo:{url:`https://github.com/example/infra`,branch:`main`,path:`apps/payment-service`},destination:{server:`https://kubernetes.default.svc`,namespace:`production`},syncStatus:`failed`,healthStatus:`degraded`,lastSyncedAt:new Date(Date.now()-30*6e4),lastSyncedRevision:`abc123def456`,message:`Failed to apply resource: Deployment/payment-service: ImagePullBackOff`,autoSync:!0,resources:[{kind:`Deployment`,name:`payment-service`,namespace:`production`,syncStatus:`failed`,healthStatus:`degraded`,message:`ImagePullBackOff`},{kind:`Service`,name:`payment-service`,namespace:`production`,syncStatus:`synced`,healthStatus:`healthy`},{kind:`Secret`,name:`payment-service-secrets`,namespace:`production`,syncStatus:`synced`,healthStatus:`healthy`}]},{id:`4`,name:`notification-service`,project:`staging`,repo:{url:`https://github.com/example/infra`,branch:`develop`,path:`apps/notification-service`},destination:{server:`https://staging.k8s.example.com`,namespace:`staging`},syncStatus:`syncing`,healthStatus:`progressing`,lastSyncedAt:new Date(Date.now()-6e4),lastSyncedRevision:`syncing123`,autoSync:!0,resources:[{kind:`Deployment`,name:`notification-service`,namespace:`staging`,syncStatus:`syncing`,healthStatus:`progressing`},{kind:`Service`,name:`notification-service`,namespace:`staging`,syncStatus:`synced`,healthStatus:`healthy`}]}];exports.GitOpsSyncStatus=v,exports.defaultGitOpsApplications=y;
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js"),n=require("../../components/badge/index.cjs.js"),r=require("../../components/button/index.cjs.js"),i=require("../../components/card/index.cjs.js"),a=require("../../components/progress/index.cjs.js"),o=require("../../components/scroll-area/index.cjs.js");let s=require("react");s=e.__toESM(s);let c=require("lucide-react"),l=require("react/jsx-runtime");var u={synced:{icon:c.CheckCircle2,color:`text-green-500`,bgColor:`bg-green-500`,label:`Synced`},out_of_sync:{icon:c.AlertTriangle,color:`text-yellow-500`,bgColor:`bg-yellow-500`,label:`Out of Sync`},syncing:{icon:c.Loader2,color:`text-blue-500`,bgColor:`bg-blue-500`,label:`Syncing`},failed:{icon:c.XCircle,color:`text-red-500`,bgColor:`bg-red-500`,label:`Failed`},unknown:{icon:c.Clock,color:`text-gray-500`,bgColor:`bg-gray-500`,label:`Unknown`},suspended:{icon:c.Pause,color:`text-orange-500`,bgColor:`bg-orange-500`,label:`Suspended`}},d={healthy:{color:`text-green-500`,bgColor:`bg-green-500`,label:`Healthy`},degraded:{color:`text-red-500`,bgColor:`bg-red-500`,label:`Degraded`},progressing:{color:`text-blue-500`,bgColor:`bg-blue-500`,label:`Progressing`},missing:{color:`text-yellow-500`,bgColor:`bg-yellow-500`,label:`Missing`},unknown:{color:`text-gray-500`,bgColor:`bg-gray-500`,label:`Unknown`}};function f(e){let t=Math.floor((Date.now()-e.getTime())/1e3);if(t<60)return`${t}s ago`;let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function p(e){return e.slice(0,7)}function m({status:e}){let r=u[e],i=r.icon;return(0,l.jsxs)(n.Badge,{variant:`outline`,className:t.cn(`gap-1`,r.color),children:[(0,l.jsx)(i,{className:t.cn(`h-3 w-3`,e===`syncing`&&`animate-spin`)}),r.label]})}function h({status:e}){let n=d[e];return(0,l.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,l.jsx)(`div`,{className:t.cn(`w-2 h-2 rounded-full`,n.bgColor)}),(0,l.jsx)(`span`,{className:t.cn(`text-sm`,n.color),children:n.label})]})}function g({app:e,onSync:o,onSuspend:g,onResume:_,onViewDetails:v}){let y=u[e.syncStatus];d[e.healthStatus];let b=y.icon,x=s.useMemo(()=>({synced:e.resources.filter(e=>e.syncStatus===`synced`).length,healthy:e.resources.filter(e=>e.healthStatus===`healthy`).length,total:e.resources.length}),[e.resources]);return(0,l.jsx)(i.Card,{className:t.cn(e.syncStatus===`failed`&&`border-red-500/50`,e.syncStatus===`out_of_sync`&&`border-yellow-500/30`,e.healthStatus===`degraded`&&`border-red-500/30`),children:(0,l.jsx)(i.CardContent,{className:`p-4`,children:(0,l.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,l.jsx)(`div`,{className:t.cn(`w-12 h-12 rounded-lg flex items-center justify-center shrink-0`,`${y.bgColor}/10`),children:(0,l.jsx)(b,{className:t.cn(`h-6 w-6`,y.color,e.syncStatus===`syncing`&&`animate-spin`)})}),(0,l.jsxs)(`div`,{className:`flex-1 min-w-0 space-y-3`,children:[(0,l.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,l.jsx)(`h3`,{className:`font-semibold`,children:e.name}),(0,l.jsx)(n.Badge,{variant:`secondary`,className:`text-xs`,children:e.project})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-2 mt-1 text-sm text-muted-foreground`,children:[(0,l.jsx)(c.Server,{className:`h-3 w-3`}),(0,l.jsx)(`span`,{children:e.destination.namespace}),(0,l.jsx)(`span`,{children:`@`}),(0,l.jsx)(`span`,{className:`truncate max-w-[200px]`,children:e.destination.server})]})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,l.jsx)(m,{status:e.syncStatus}),(0,l.jsx)(h,{status:e.healthStatus})]})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-4 text-sm`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-1.5 text-muted-foreground`,children:[(0,l.jsx)(c.GitBranch,{className:`h-4 w-4`}),(0,l.jsx)(`span`,{children:e.repo.branch})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-1.5 text-muted-foreground`,children:[(0,l.jsx)(c.Folder,{className:`h-4 w-4`}),(0,l.jsx)(`span`,{className:`truncate max-w-[150px]`,children:e.repo.path})]}),e.lastSyncedRevision&&(0,l.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,l.jsx)(c.GitCommit,{className:`h-4 w-4 text-muted-foreground`}),(0,l.jsx)(`code`,{className:`text-xs bg-muted px-1.5 py-0.5 rounded`,children:p(e.lastSyncedRevision)}),e.targetRevision&&e.lastSyncedRevision!==e.targetRevision&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.ArrowRight,{className:`h-3 w-3 text-muted-foreground`}),(0,l.jsx)(`code`,{className:`text-xs bg-yellow-500/20 text-yellow-600 px-1.5 py-0.5 rounded`,children:p(e.targetRevision)})]})]})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,l.jsxs)(`div`,{className:`flex-1`,children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between text-xs mb-1`,children:[(0,l.jsx)(`span`,{className:`text-muted-foreground`,children:`Resources Synced`}),(0,l.jsxs)(`span`,{children:[x.synced,`/`,x.total]})]}),(0,l.jsx)(a.Progress,{value:x.synced/x.total*100,className:`h-1.5`})]}),(0,l.jsxs)(`div`,{className:`flex-1`,children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between text-xs mb-1`,children:[(0,l.jsx)(`span`,{className:`text-muted-foreground`,children:`Resources Healthy`}),(0,l.jsxs)(`span`,{children:[x.healthy,`/`,x.total]})]}),(0,l.jsx)(a.Progress,{value:x.healthy/x.total*100,className:t.cn(`h-1.5`,x.healthy<x.total&&`[&>div]:bg-yellow-500`)})]})]}),e.message&&(e.syncStatus===`failed`||e.healthStatus===`degraded`)&&(0,l.jsx)(`div`,{className:`text-sm text-red-500 bg-red-500/10 p-2 rounded`,children:e.message}),(0,l.jsxs)(`div`,{className:`flex items-center justify-between pt-2 border-t`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[e.lastSyncedAt&&(0,l.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,l.jsx)(c.Clock,{className:`h-3 w-3`}),`Last synced `,f(e.lastSyncedAt)]}),e.autoSync&&(0,l.jsxs)(n.Badge,{variant:`outline`,className:`text-xs`,children:[(0,l.jsx)(c.RefreshCw,{className:`h-3 w-3 mr-1`}),`Auto-sync`]})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-1`,children:[v&&(0,l.jsxs)(r.Button,{variant:`ghost`,size:`sm`,onClick:v,children:[(0,l.jsx)(c.Eye,{className:`h-4 w-4 mr-1`}),`Details`]}),e.syncStatus===`suspended`&&_?(0,l.jsxs)(r.Button,{variant:`outline`,size:`sm`,onClick:_,children:[(0,l.jsx)(c.Play,{className:`h-4 w-4 mr-1`}),`Resume`]}):(0,l.jsxs)(l.Fragment,{children:[g&&e.syncStatus!==`suspended`&&(0,l.jsx)(r.Button,{variant:`ghost`,size:`sm`,onClick:g,children:(0,l.jsx)(c.Pause,{className:`h-4 w-4`})}),o&&e.syncStatus!==`syncing`&&(0,l.jsxs)(r.Button,{variant:`outline`,size:`sm`,onClick:o,children:[(0,l.jsx)(c.RefreshCw,{className:`h-4 w-4 mr-1`}),`Sync`]})]})]})]})]})]})})})}function _({applications:e}){let t=s.useMemo(()=>({total:e.length,synced:e.filter(e=>e.syncStatus===`synced`).length,outOfSync:e.filter(e=>e.syncStatus===`out_of_sync`).length,failed:e.filter(e=>e.syncStatus===`failed`).length,healthy:e.filter(e=>e.healthStatus===`healthy`).length,degraded:e.filter(e=>e.healthStatus===`degraded`).length}),[e]);return(0,l.jsxs)(`div`,{className:`grid grid-cols-6 gap-4`,children:[(0,l.jsx)(i.Card,{children:(0,l.jsxs)(i.CardContent,{className:`p-4 text-center`,children:[(0,l.jsx)(`div`,{className:`text-2xl font-bold`,children:t.total}),(0,l.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Total Apps`})]})}),(0,l.jsx)(i.Card,{children:(0,l.jsxs)(i.CardContent,{className:`p-4 text-center`,children:[(0,l.jsx)(`div`,{className:`text-2xl font-bold text-green-500`,children:t.synced}),(0,l.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Synced`})]})}),(0,l.jsx)(i.Card,{children:(0,l.jsxs)(i.CardContent,{className:`p-4 text-center`,children:[(0,l.jsx)(`div`,{className:`text-2xl font-bold text-yellow-500`,children:t.outOfSync}),(0,l.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Out of Sync`})]})}),(0,l.jsx)(i.Card,{children:(0,l.jsxs)(i.CardContent,{className:`p-4 text-center`,children:[(0,l.jsx)(`div`,{className:`text-2xl font-bold text-red-500`,children:t.failed}),(0,l.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Failed`})]})}),(0,l.jsx)(i.Card,{children:(0,l.jsxs)(i.CardContent,{className:`p-4 text-center`,children:[(0,l.jsx)(`div`,{className:`text-2xl font-bold text-green-500`,children:t.healthy}),(0,l.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Healthy`})]})}),(0,l.jsx)(i.Card,{children:(0,l.jsxs)(i.CardContent,{className:`p-4 text-center`,children:[(0,l.jsx)(`div`,{className:`text-2xl font-bold text-red-500`,children:t.degraded}),(0,l.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:`Degraded`})]})})]})}function v({applications:e,onSync:n,onRefresh:a,onSuspend:d,onResume:f,onViewDetails:p,className:m}){let[h,v]=s.useState(`all`),y=s.useMemo(()=>h===`all`?e:e.filter(e=>e.syncStatus===h),[e,h]);return(0,l.jsxs)(`div`,{className:t.cn(`space-y-6`,m),children:[(0,l.jsx)(i.Card,{children:(0,l.jsx)(i.CardHeader,{children:(0,l.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,l.jsx)(c.GitBranch,{className:`h-6 w-6`}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(i.CardTitle,{children:`GitOps Sync Status`}),(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Monitor application synchronization with Git`})]})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[[`all`,`synced`,`out_of_sync`,`failed`,`syncing`].map(e=>(0,l.jsx)(r.Button,{variant:h===e?`default`:`ghost`,size:`sm`,onClick:()=>v(e),children:e===`all`?`All`:u[e].label},e)),a&&(0,l.jsxs)(r.Button,{variant:`outline`,onClick:a,children:[(0,l.jsx)(c.RefreshCw,{className:`h-4 w-4 mr-1`}),`Refresh All`]})]})]})})}),(0,l.jsx)(_,{applications:e}),(0,l.jsx)(o.ScrollArea,{className:`h-[500px]`,children:(0,l.jsx)(`div`,{className:`space-y-4 pr-4`,children:y.length===0?(0,l.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-48 text-muted-foreground`,children:[(0,l.jsx)(c.Cloud,{className:`h-12 w-12 mb-4`}),(0,l.jsx)(`p`,{className:`text-lg font-medium`,children:`No applications found`}),(0,l.jsx)(`p`,{className:`text-sm`,children:`Adjust your filters or add new applications`})]}):y.map(e=>(0,l.jsx)(g,{app:e,onSync:n?()=>n(e):void 0,onSuspend:d?()=>d(e):void 0,onResume:f?()=>f(e):void 0,onViewDetails:p?()=>p(e):void 0},e.id))})})]})}var y=[{id:`1`,name:`api-gateway`,project:`production`,repo:{url:`https://github.com/example/infra`,branch:`main`,path:`apps/api-gateway`},destination:{server:`https://kubernetes.default.svc`,namespace:`production`},syncStatus:`synced`,healthStatus:`healthy`,lastSyncedAt:new Date(Date.now()-5*6e4),lastSyncedRevision:`a1b2c3d4e5f6789`,autoSync:!0,resources:[{kind:`Deployment`,name:`api-gateway`,namespace:`production`,syncStatus:`synced`,healthStatus:`healthy`},{kind:`Service`,name:`api-gateway`,namespace:`production`,syncStatus:`synced`,healthStatus:`healthy`},{kind:`ConfigMap`,name:`api-gateway-config`,namespace:`production`,syncStatus:`synced`,healthStatus:`healthy`},{kind:`Ingress`,name:`api-gateway`,namespace:`production`,syncStatus:`synced`,healthStatus:`healthy`}]},{id:`2`,name:`user-service`,project:`production`,repo:{url:`https://github.com/example/infra`,branch:`main`,path:`apps/user-service`},destination:{server:`https://kubernetes.default.svc`,namespace:`production`},syncStatus:`out_of_sync`,healthStatus:`healthy`,lastSyncedAt:new Date(Date.now()-2*36e5),lastSyncedRevision:`old123456789`,targetRevision:`new987654321`,autoSync:!1,resources:[{kind:`Deployment`,name:`user-service`,namespace:`production`,syncStatus:`out_of_sync`,healthStatus:`healthy`},{kind:`Service`,name:`user-service`,namespace:`production`,syncStatus:`synced`,healthStatus:`healthy`},{kind:`Secret`,name:`user-service-secrets`,namespace:`production`,syncStatus:`out_of_sync`,healthStatus:`healthy`}]},{id:`3`,name:`payment-service`,project:`production`,repo:{url:`https://github.com/example/infra`,branch:`main`,path:`apps/payment-service`},destination:{server:`https://kubernetes.default.svc`,namespace:`production`},syncStatus:`failed`,healthStatus:`degraded`,lastSyncedAt:new Date(Date.now()-30*6e4),lastSyncedRevision:`abc123def456`,message:`Failed to apply resource: Deployment/payment-service: ImagePullBackOff`,autoSync:!0,resources:[{kind:`Deployment`,name:`payment-service`,namespace:`production`,syncStatus:`failed`,healthStatus:`degraded`,message:`ImagePullBackOff`},{kind:`Service`,name:`payment-service`,namespace:`production`,syncStatus:`synced`,healthStatus:`healthy`},{kind:`Secret`,name:`payment-service-secrets`,namespace:`production`,syncStatus:`synced`,healthStatus:`healthy`}]},{id:`4`,name:`notification-service`,project:`staging`,repo:{url:`https://github.com/example/infra`,branch:`develop`,path:`apps/notification-service`},destination:{server:`https://staging.k8s.example.com`,namespace:`staging`},syncStatus:`syncing`,healthStatus:`progressing`,lastSyncedAt:new Date(Date.now()-6e4),lastSyncedRevision:`syncing123`,autoSync:!0,resources:[{kind:`Deployment`,name:`notification-service`,namespace:`staging`,syncStatus:`syncing`,healthStatus:`progressing`},{kind:`Service`,name:`notification-service`,namespace:`staging`,syncStatus:`synced`,healthStatus:`healthy`}]}];exports.GitOpsSyncStatus=v,exports.defaultGitOpsApplications=y;
@@ -1 +1 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`),n=require(`../../components/avatar/index.cjs.js`),r=require(`../../components/badge/index.cjs.js`),i=require(`../../components/button/index.cjs.js`),a=require(`../../components/dropdown-menu/index.cjs.js`),o=require(`../../components/input/index.cjs.js`),s=require(`../../components/select/index.cjs.js`);let c=require(`react`);c=e.__toESM(c);let l=require(`lucide-react`),u=require(`react/jsx-runtime`);function d({title:e,subtitle:d,showSearch:f=!0,searchPlaceholder:p=`Rechercher...`,searchValue:m,onSearchChange:h,onSearchSubmit:g,primaryAction:_,secondaryActions:v,filters:y,notifications:b,unreadCount:x=0,onNotificationsClick:S,userMenu:C,leftContent:w,rightContent:T,filterContent:E,className:D,mainBarClassName:O,filterBarClassName:k,sticky:A=!0}){let[j,M]=c.useState(m||``),N=e=>{let t=e.target.value;M(t),h?.(t)},P=e=>{e.key===`Enter`&&g?.(j)},F=y&&y.length>0||E;return(0,u.jsxs)(`header`,{className:t.cn(`w-full bg-background border-b`,A&&`sticky top-0 z-50`,D),children:[(0,u.jsxs)(`div`,{className:t.cn(`flex items-center gap-4 px-4 py-2 min-h-[56px]`,O),children:[(0,u.jsxs)(`div`,{className:`flex items-center gap-3 flex-shrink-0`,children:[_&&(0,u.jsxs)(i.Button,{variant:_.variant||`default`,size:`sm`,onClick:_.onClick,className:`gap-2`,children:[_.icon||(0,u.jsx)(l.Plus,{className:`h-4 w-4`}),_.label]}),f&&(0,u.jsxs)(`div`,{className:`relative`,children:[(0,u.jsx)(l.Search,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground`}),(0,u.jsx)(o.Input,{type:`search`,placeholder:p,value:j,onChange:N,onKeyDown:P,className:`pl-9 w-[200px] h-9 bg-muted/50`})]}),w]}),(e||d)&&(0,u.jsxs)(`div`,{className:`flex-1 text-center`,children:[e&&(0,u.jsx)(`h1`,{className:`text-lg font-semibold leading-none`,children:e}),d&&(0,u.jsx)(`p`,{className:`text-sm text-muted-foreground mt-0.5`,children:d})]}),(0,u.jsxs)(`div`,{className:`flex items-center gap-2 flex-shrink-0 ml-auto`,children:[v?.map(e=>(0,u.jsxs)(i.Button,{variant:e.variant||`ghost`,size:`sm`,onClick:e.onClick,className:`gap-2`,children:[e.icon,e.label]},e.id)),T,(b||S)&&(0,u.jsxs)(a.DropdownMenu,{children:[(0,u.jsx)(a.DropdownMenuTrigger,{asChild:!0,children:(0,u.jsxs)(i.Button,{variant:`ghost`,size:`icon`,className:`relative`,onClick:b?void 0:S,children:[(0,u.jsx)(l.Bell,{className:`h-5 w-5`}),x>0&&(0,u.jsx)(r.Badge,{variant:`destructive`,className:`absolute -top-1 -right-1 h-5 w-5 p-0 flex items-center justify-center text-xs`,children:x>9?`9+`:x})]})}),b&&b.length>0&&(0,u.jsxs)(a.DropdownMenuContent,{align:`end`,className:`w-80`,children:[(0,u.jsx)(`div`,{className:`p-2 font-semibold border-b`,children:`Notifications`}),b.slice(0,5).map(e=>(0,u.jsxs)(a.DropdownMenuItem,{onClick:e.onClick,className:t.cn(`flex flex-col items-start gap-1 p-3`,!e.read&&`bg-muted/50`),children:[(0,u.jsx)(`div`,{className:`font-medium`,children:e.title}),e.description&&(0,u.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:e.description}),e.time&&(0,u.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e.time})]},e.id))]})]}),C&&(0,u.jsxs)(a.DropdownMenu,{children:[(0,u.jsx)(a.DropdownMenuTrigger,{asChild:!0,children:(0,u.jsxs)(i.Button,{variant:`ghost`,size:`sm`,className:`gap-2`,children:[(0,u.jsxs)(n.Avatar,{className:`h-7 w-7`,children:[C.avatar&&(0,u.jsx)(n.AvatarImage,{src:C.avatar,alt:C.name}),(0,u.jsx)(n.AvatarFallback,{className:`text-xs`,children:C.initials||C.name.slice(0,2).toUpperCase()})]}),(0,u.jsx)(l.ChevronDown,{className:`h-4 w-4`})]})}),(0,u.jsxs)(a.DropdownMenuContent,{align:`end`,className:`w-56`,children:[(0,u.jsxs)(`div`,{className:`p-2`,children:[(0,u.jsx)(`p`,{className:`font-medium`,children:C.name}),C.email&&(0,u.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:C.email})]}),(0,u.jsx)(a.DropdownMenuSeparator,{}),C.items.map((e,t)=>e.separator?(0,u.jsx)(a.DropdownMenuSeparator,{},t):(0,u.jsxs)(a.DropdownMenuItem,{onClick:e.onClick,children:[e.icon&&(0,u.jsx)(`span`,{className:`mr-2`,children:e.icon}),e.label]},t))]})]})]})]}),F&&(0,u.jsxs)(`div`,{className:t.cn(`flex items-center gap-2 px-4 py-2 border-t bg-muted/30`,k),children:[y?.map(e=>(0,u.jsxs)(s.Select,{value:e.value,onValueChange:e.onChange,children:[(0,u.jsxs)(s.SelectTrigger,{className:`w-auto h-8 gap-2 bg-muted/50 border-0`,children:[e.icon,(0,u.jsx)(s.SelectValue,{placeholder:e.placeholder||e.label})]}),(0,u.jsx)(s.SelectContent,{children:e.options.map(e=>(0,u.jsx)(s.SelectItem,{value:e.value,children:e.label},e.value))})]},e.id)),E]})]})}exports.default=d;
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js"),n=require("../../components/avatar/index.cjs.js"),r=require("../../components/badge/index.cjs.js"),i=require("../../components/button/index.cjs.js"),a=require("../../components/dropdown-menu/index.cjs.js"),o=require("../../components/input/index.cjs.js"),s=require("../../components/select/index.cjs.js");let c=require("react");c=e.__toESM(c);let l=require("lucide-react"),u=require("react/jsx-runtime");function d({title:e,subtitle:d,showSearch:f=!0,searchPlaceholder:p=`Rechercher...`,searchValue:m,onSearchChange:h,onSearchSubmit:g,primaryAction:_,secondaryActions:v,filters:y,notifications:b,unreadCount:x=0,onNotificationsClick:S,userMenu:C,leftContent:w,rightContent:T,filterContent:E,className:D,mainBarClassName:O,filterBarClassName:k,sticky:A=!0}){let[j,M]=c.useState(m||``),N=e=>{let t=e.target.value;M(t),h?.(t)},P=e=>{e.key===`Enter`&&g?.(j)},F=y&&y.length>0||E;return(0,u.jsxs)(`header`,{className:t.cn(`w-full bg-background border-b`,A&&`sticky top-0 z-50`,D),children:[(0,u.jsxs)(`div`,{className:t.cn(`flex items-center gap-4 px-4 py-2 min-h-[56px]`,O),children:[(0,u.jsxs)(`div`,{className:`flex items-center gap-3 flex-shrink-0`,children:[_&&(0,u.jsxs)(i.Button,{variant:_.variant||`default`,size:`sm`,onClick:_.onClick,className:`gap-2`,children:[_.icon||(0,u.jsx)(l.Plus,{className:`h-4 w-4`}),_.label]}),f&&(0,u.jsxs)(`div`,{className:`relative`,children:[(0,u.jsx)(l.Search,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground`}),(0,u.jsx)(o.Input,{type:`search`,placeholder:p,value:j,onChange:N,onKeyDown:P,className:`pl-9 w-[200px] h-9 bg-muted/50`})]}),w]}),(e||d)&&(0,u.jsxs)(`div`,{className:`flex-1 text-center`,children:[e&&(0,u.jsx)(`h1`,{className:`text-lg font-semibold leading-none`,children:e}),d&&(0,u.jsx)(`p`,{className:`text-sm text-muted-foreground mt-0.5`,children:d})]}),(0,u.jsxs)(`div`,{className:`flex items-center gap-2 flex-shrink-0 ml-auto`,children:[v?.map(e=>(0,u.jsxs)(i.Button,{variant:e.variant||`ghost`,size:`sm`,onClick:e.onClick,className:`gap-2`,children:[e.icon,e.label]},e.id)),T,(b||S)&&(0,u.jsxs)(a.DropdownMenu,{children:[(0,u.jsx)(a.DropdownMenuTrigger,{asChild:!0,children:(0,u.jsxs)(i.Button,{variant:`ghost`,size:`icon`,className:`relative`,onClick:b?void 0:S,children:[(0,u.jsx)(l.Bell,{className:`h-5 w-5`}),x>0&&(0,u.jsx)(r.Badge,{variant:`destructive`,className:`absolute -top-1 -right-1 h-5 w-5 p-0 flex items-center justify-center text-xs`,children:x>9?`9+`:x})]})}),b&&b.length>0&&(0,u.jsxs)(a.DropdownMenuContent,{align:`end`,className:`w-80`,children:[(0,u.jsx)(`div`,{className:`p-2 font-semibold border-b`,children:`Notifications`}),b.slice(0,5).map(e=>(0,u.jsxs)(a.DropdownMenuItem,{onClick:e.onClick,className:t.cn(`flex flex-col items-start gap-1 p-3`,!e.read&&`bg-muted/50`),children:[(0,u.jsx)(`div`,{className:`font-medium`,children:e.title}),e.description&&(0,u.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:e.description}),e.time&&(0,u.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e.time})]},e.id))]})]}),C&&(0,u.jsxs)(a.DropdownMenu,{children:[(0,u.jsx)(a.DropdownMenuTrigger,{asChild:!0,children:(0,u.jsxs)(i.Button,{variant:`ghost`,size:`sm`,className:`gap-2`,children:[(0,u.jsxs)(n.Avatar,{className:`h-7 w-7`,children:[C.avatar&&(0,u.jsx)(n.AvatarImage,{src:C.avatar,alt:C.name}),(0,u.jsx)(n.AvatarFallback,{className:`text-xs`,children:C.initials||C.name.slice(0,2).toUpperCase()})]}),(0,u.jsx)(l.ChevronDown,{className:`h-4 w-4`})]})}),(0,u.jsxs)(a.DropdownMenuContent,{align:`end`,className:`w-56`,children:[(0,u.jsxs)(`div`,{className:`p-2`,children:[(0,u.jsx)(`p`,{className:`font-medium`,children:C.name}),C.email&&(0,u.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:C.email})]}),(0,u.jsx)(a.DropdownMenuSeparator,{}),C.items.map((e,t)=>e.separator?(0,u.jsx)(a.DropdownMenuSeparator,{},t):(0,u.jsxs)(a.DropdownMenuItem,{onClick:e.onClick,children:[e.icon&&(0,u.jsx)(`span`,{className:`mr-2`,children:e.icon}),e.label]},t))]})]})]})]}),F&&(0,u.jsxs)(`div`,{className:t.cn(`flex items-center gap-2 px-4 py-2 border-t bg-muted/30`,k),children:[y?.map(e=>(0,u.jsxs)(s.Select,{value:e.value,onValueChange:e.onChange,children:[(0,u.jsxs)(s.SelectTrigger,{className:`w-auto h-8 gap-2 bg-muted/50 border-0`,children:[e.icon,(0,u.jsx)(s.SelectValue,{placeholder:e.placeholder||e.label})]}),(0,u.jsx)(s.SelectContent,{children:e.options.map(e=>(0,u.jsx)(s.SelectItem,{value:e.value,children:e.label},e.value))})]},e.id)),E]})]})}exports.WakaHeader=d,exports.default=d;
@@ -167,4 +167,4 @@ function w({ title: w, subtitle: T, showSearch: E = !0, searchPlaceholder: D = "
167
167
  });
168
168
  }
169
169
  //#endregion
170
- export { w as default };
170
+ export { w as WakaHeader, w as default };
@@ -1 +1 @@
1
- "use client";"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs.js`),t=require(`../../utils/cn.cjs.js`),n=require(`../../components/tabs/index.cjs.js`);let r=require(`react`);r=e.__toESM(r);let i=require(`react/jsx-runtime`);function a({items:e,defaultActiveId:a,variant:o=`default`,size:s=`md`,className:c,onTabChange:l}){let[u,d]=r.useState(a||e[0]?.id||``),f=e=>{d(e),l?.(e)},p={sm:`h-8 px-3 text-sm`,md:`h-10 px-4 text-sm`,lg:`h-12 px-6 text-base`};return(0,i.jsx)(`div`,{className:t.cn(`w-full`,c),children:(0,i.jsxs)(n.Tabs,{value:u,onValueChange:f,children:[(0,i.jsx)(n.TabsList,{className:t.cn(`grid w-full`,o===`pills`&&`grid-cols-auto`,o!==`pills`&&`grid-cols-${e.length}`,{default:`bg-background`,pills:`bg-muted rounded-full`,underline:`bg-transparent border-b-2 border-transparent data-[state=active]:border-primary`}[o]),children:e.map(e=>(0,i.jsx)(n.TabsTrigger,{value:e.id,disabled:e.disabled,className:t.cn(p[s],o===`underline`&&`rounded-none border-b-2 border-transparent data-[state=active]:border-primary`,o===`pills`&&`rounded-full`),children:e.label},e.id))}),e.map(e=>(0,i.jsx)(n.TabsContent,{value:e.id,className:`mt-6`,children:e.content},e.id))]})})}function o({items:e,separator:n=`/`,className:a}){return(0,i.jsx)(`nav`,{className:t.cn(`flex items-center space-x-1 text-sm text-muted-foreground`,a),children:e.map((e,t)=>(0,i.jsxs)(r.Fragment,{children:[t>0&&(0,i.jsx)(`span`,{className:`mx-2 text-muted-foreground`,children:n}),e.href?(0,i.jsx)(`a`,{href:e.href,className:`hover:text-foreground transition-colors`,children:e.label}):(0,i.jsx)(`span`,{className:`text-foreground font-medium`,children:e.label})]},t))})}exports.Breadcrumb=o,exports.Headtab=a;
1
+ "use client";"use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("../../utils/cn.cjs.js"),n=require("../../components/tabs/index.cjs.js");let r=require("react");r=e.__toESM(r);let i=require("react/jsx-runtime");function a({items:e,defaultActiveId:a,variant:o=`default`,size:s=`md`,className:c,onTabChange:l}){let[u,d]=r.useState(a||e[0]?.id||``),f=e=>{d(e),l?.(e)},p={sm:`h-8 px-3 text-sm`,md:`h-10 px-4 text-sm`,lg:`h-12 px-6 text-base`};return(0,i.jsx)(`div`,{className:t.cn(`w-full`,c),children:(0,i.jsxs)(n.Tabs,{value:u,onValueChange:f,children:[(0,i.jsx)(n.TabsList,{className:t.cn(`grid w-full`,o===`pills`&&`grid-cols-auto`,o!==`pills`&&`grid-cols-${e.length}`,{default:`bg-background`,pills:`bg-muted rounded-full`,underline:`bg-transparent border-b-2 border-transparent data-[state=active]:border-primary`}[o]),children:e.map(e=>(0,i.jsx)(n.TabsTrigger,{value:e.id,disabled:e.disabled,className:t.cn(p[s],o===`underline`&&`rounded-none border-b-2 border-transparent data-[state=active]:border-primary`,o===`pills`&&`rounded-full`),children:e.label},e.id))}),e.map(e=>(0,i.jsx)(n.TabsContent,{value:e.id,className:`mt-6`,children:e.content},e.id))]})})}function o({items:e,separator:n=`/`,className:a}){return(0,i.jsx)(`nav`,{className:t.cn(`flex items-center space-x-1 text-sm text-muted-foreground`,a),children:e.map((e,t)=>(0,i.jsxs)(r.Fragment,{children:[t>0&&(0,i.jsx)(`span`,{className:`mx-2 text-muted-foreground`,children:n}),e.href?(0,i.jsx)(`a`,{href:e.href,className:`hover:text-foreground transition-colors`,children:e.label}):(0,i.jsx)(`span`,{className:`text-foreground font-medium`,children:e.label})]},t))})}exports.Breadcrumb=o,exports.Headtab=a;