@wakastellar/ui 3.5.0 → 4.0.0-dev.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1052) hide show
  1. package/dist/badge-B2Kw7ew3.js +1 -0
  2. package/dist/{badge-BfiocODp.mjs → badge-BvqcaobM.mjs} +9 -9
  3. package/dist/blocks/activity-timeline/index.d.ts +73 -0
  4. package/dist/blocks/antivirus-dashboard/index.d.ts +44 -0
  5. package/dist/blocks/apm-overview/index.d.ts +58 -0
  6. package/dist/blocks/auth-2fa/index.d.ts +38 -0
  7. package/dist/blocks/calendar-view/index.d.ts +56 -0
  8. package/dist/blocks/chat/index.d.ts +112 -0
  9. package/dist/blocks/chat/widget.d.ts +100 -0
  10. package/dist/blocks/chat-interface/index.d.ts +66 -0
  11. package/dist/blocks/checkout-flow/index.d.ts +76 -0
  12. package/dist/blocks/cicd-builder/index.d.ts +47 -0
  13. package/dist/blocks/clamav-service-status/index.d.ts +35 -0
  14. package/dist/blocks/cloud-cost-dashboard/index.d.ts +49 -0
  15. package/dist/blocks/container-orchestrator/index.d.ts +63 -0
  16. package/dist/blocks/dashboard/index.d.ts +95 -0
  17. package/dist/blocks/dashboard-kpi/index.d.ts +69 -0
  18. package/dist/blocks/database-admin/index.d.ts +84 -0
  19. package/dist/blocks/deployment-dashboard/index.d.ts +68 -0
  20. package/dist/blocks/empty-states/index.d.ts +47 -0
  21. package/dist/blocks/error-pages/index.d.ts +55 -0
  22. package/dist/blocks/faq/index.d.ts +54 -0
  23. package/dist/blocks/file-manager/index.d.ts +81 -0
  24. package/dist/blocks/file-scan-uploader/index.d.ts +29 -0
  25. package/dist/blocks/footer/index.d.ts +19 -0
  26. package/dist/blocks/gitops-sync-status/index.d.ts +45 -0
  27. package/dist/blocks/header/index.d.ts +86 -0
  28. package/dist/blocks/headtab/index.d.ts +27 -0
  29. package/dist/blocks/i18n-editor/index.d.ts +63 -0
  30. package/dist/blocks/incident-manager/index.d.ts +44 -0
  31. package/dist/blocks/index.d.ts +58 -0
  32. package/dist/blocks/infrastructure-map/index.d.ts +32 -0
  33. package/dist/blocks/kanban-board/index.d.ts +77 -0
  34. package/dist/blocks/landing/index.d.ts +104 -0
  35. package/dist/blocks/language-selector/index.d.ts +6 -0
  36. package/dist/blocks/layout/index.d.ts +28 -0
  37. package/dist/blocks/login/index.d.ts +42 -0
  38. package/dist/blocks/login/types.d.ts +126 -0
  39. package/dist/blocks/on-call-schedule/index.d.ts +43 -0
  40. package/dist/blocks/player-profile/index.d.ts +78 -0
  41. package/dist/blocks/pricing/index.d.ts +64 -0
  42. package/dist/blocks/profile/index.d.ts +98 -0
  43. package/dist/blocks/quarantine-manager/index.d.ts +27 -0
  44. package/dist/blocks/release-notes/index.d.ts +49 -0
  45. package/dist/blocks/scan-history-log/index.d.ts +28 -0
  46. package/dist/blocks/scan-policy-editor/index.d.ts +27 -0
  47. package/dist/blocks/scan-report-generator/index.d.ts +47 -0
  48. package/dist/blocks/settings/index.d.ts +62 -0
  49. package/dist/blocks/sidebar/index.d.ts +155 -0
  50. package/dist/blocks/signature-database-manager/index.d.ts +39 -0
  51. package/dist/blocks/threat-alert-banner/index.d.ts +26 -0
  52. package/dist/blocks/user-management/index.d.ts +95 -0
  53. package/dist/blocks/waka-doc-shell/index.d.ts +3 -0
  54. package/dist/blocks/waka-doc-shell/types.d.ts +32 -0
  55. package/dist/blocks/wizard/index.d.ts +88 -0
  56. package/dist/charts.cjs.js +1 -1
  57. package/dist/charts.d.ts +17 -1
  58. package/dist/charts.es.js +2 -1
  59. package/dist/{chunk-Cr9pTUWm.mjs → chunk-BJivcVNn.mjs} +6 -5
  60. package/dist/chunk-FDd1SASZ.js +1 -0
  61. package/dist/cli/index.cjs +54 -3
  62. package/dist/cn-Bpd_xIzI.mjs +23 -0
  63. package/dist/cn-DEeiGoUV.js +1 -0
  64. package/dist/components/DataTable/DataTable.d.ts +17 -0
  65. package/dist/components/DataTable/DataTableAdvanced.d.ts +27 -0
  66. package/dist/components/DataTable/DataTableColumnResizer.d.ts +8 -0
  67. package/dist/components/DataTable/DataTableContextMenu.d.ts +47 -0
  68. package/dist/components/DataTable/DataTableEditCell.d.ts +29 -0
  69. package/dist/components/DataTable/DataTableFilters.d.ts +14 -0
  70. package/dist/components/DataTable/DataTableGrouping.d.ts +25 -0
  71. package/dist/components/DataTable/DataTablePagination.d.ts +8 -0
  72. package/dist/components/DataTable/DataTableSelection.d.ts +46 -0
  73. package/dist/components/DataTable/DataTableToolbar.d.ts +14 -0
  74. package/dist/components/DataTable/examples/EditExample.d.ts +2 -0
  75. package/dist/components/DataTable/hooks/useDataTable.d.ts +24 -0
  76. package/dist/components/DataTable/hooks/useDataTableAdvanced.d.ts +38 -0
  77. package/dist/components/DataTable/hooks/useDataTableEdit.d.ts +22 -0
  78. package/dist/components/DataTable/hooks/useDataTableExport.d.ts +15 -0
  79. package/dist/components/DataTable/hooks/useDataTableImport.d.ts +12 -0
  80. package/dist/components/DataTable/hooks/useDataTableTheme.d.ts +16 -0
  81. package/dist/components/DataTable/hooks/useDataTableVirtualization.d.ts +19 -0
  82. package/dist/components/DataTable/hooks/useTableLayout.d.ts +26 -0
  83. package/dist/components/DataTable/index.d.ts +37 -0
  84. package/dist/components/DataTable/types.d.ts +461 -0
  85. package/dist/components/DataTable/utils.d.ts +37 -0
  86. package/dist/components/accordion/index.d.ts +7 -0
  87. package/dist/components/alert/index.d.ts +8 -0
  88. package/dist/components/alert-dialog/index.d.ts +20 -0
  89. package/dist/components/aspect-ratio/index.d.ts +3 -0
  90. package/dist/components/avatar/index.d.ts +6 -0
  91. package/dist/components/badge/index.d.ts +9 -0
  92. package/dist/components/button/index.d.ts +11 -0
  93. package/dist/components/calendar/index.d.ts +18 -0
  94. package/dist/components/card/index.d.ts +46 -0
  95. package/dist/components/checkbox/index.d.ts +4 -0
  96. package/dist/components/code/index.d.ts +49 -0
  97. package/dist/components/collapsible/index.d.ts +5 -0
  98. package/dist/components/command/index.d.ts +83 -0
  99. package/dist/components/context-menu/index.d.ts +27 -0
  100. package/dist/components/dialog/index.d.ts +19 -0
  101. package/dist/components/dropdown-menu/index.d.ts +27 -0
  102. package/dist/components/error-boundary/ErrorBoundary.d.ts +102 -0
  103. package/dist/components/error-boundary/index.d.ts +2 -0
  104. package/dist/components/form/index.d.ts +23 -0
  105. package/dist/components/hover-card/index.d.ts +6 -0
  106. package/dist/components/index.d.ts +257 -0
  107. package/dist/components/input/index.d.ts +19 -0
  108. package/dist/components/input-otp/index.d.ts +51 -0
  109. package/dist/components/label/index.d.ts +5 -0
  110. package/dist/components/language-selector/index.d.ts +40 -0
  111. package/dist/components/menubar/index.d.ts +28 -0
  112. package/dist/components/navigation-menu/index.d.ts +12 -0
  113. package/dist/components/popover/index.d.ts +6 -0
  114. package/dist/components/progress/index.d.ts +4 -0
  115. package/dist/components/radio-group/index.d.ts +5 -0
  116. package/dist/components/scroll-area/index.d.ts +5 -0
  117. package/dist/components/select/index.d.ts +13 -0
  118. package/dist/components/separator/index.d.ts +4 -0
  119. package/dist/components/sheet/index.d.ts +27 -0
  120. package/dist/components/skeleton/index.d.ts +13 -0
  121. package/dist/components/slider/index.d.ts +4 -0
  122. package/dist/components/switch/index.d.ts +4 -0
  123. package/dist/components/table/index.d.ts +21 -0
  124. package/dist/components/tabs/index.d.ts +7 -0
  125. package/dist/components/textarea/index.d.ts +14 -0
  126. package/dist/components/theme-selector/index.d.ts +8 -0
  127. package/dist/components/toast/index.d.ts +15 -0
  128. package/dist/components/toaster/index.d.ts +1 -0
  129. package/dist/components/toggle/index.d.ts +12 -0
  130. package/dist/components/tooltip/index.d.ts +7 -0
  131. package/dist/components/typography/index.d.ts +85 -0
  132. package/dist/components/waka-3d-pie-chart/index.d.ts +67 -0
  133. package/dist/components/waka-achievement-unlock/index.d.ts +83 -0
  134. package/dist/components/waka-activity-feed/index.d.ts +78 -0
  135. package/dist/components/waka-ad-banner/index.d.ts +36 -0
  136. package/dist/components/waka-ad-fallback/index.d.ts +33 -0
  137. package/dist/components/waka-ad-inline/index.d.ts +15 -0
  138. package/dist/components/waka-ad-interstitial/index.d.ts +26 -0
  139. package/dist/components/waka-ad-placeholder/index.d.ts +17 -0
  140. package/dist/components/waka-ad-provider/index.d.ts +103 -0
  141. package/dist/components/waka-ad-sidebar/index.d.ts +18 -0
  142. package/dist/components/waka-ad-sticky-footer/index.d.ts +17 -0
  143. package/dist/components/waka-address-autocomplete/index.d.ts +129 -0
  144. package/dist/components/waka-admincrumb/index.d.ts +55 -0
  145. package/dist/components/waka-alert-panel/index.d.ts +45 -0
  146. package/dist/components/waka-alert-stack/index.d.ts +58 -0
  147. package/dist/components/waka-allocation-matrix/index.d.ts +193 -0
  148. package/dist/components/waka-approval-chain/index.d.ts +43 -0
  149. package/dist/components/waka-artifact-list/index.d.ts +32 -0
  150. package/dist/components/waka-audit-log/index.d.ts +142 -0
  151. package/dist/components/waka-autocomplete/index.d.ts +59 -0
  152. package/dist/components/waka-badge-showcase/index.d.ts +51 -0
  153. package/dist/components/waka-barcode/index.d.ts +27 -0
  154. package/dist/components/waka-biometric-prompt/index.d.ts +84 -0
  155. package/dist/components/waka-bottom-sheet/index.d.ts +61 -0
  156. package/dist/components/waka-breadcrumb/index.d.ts +43 -0
  157. package/dist/components/waka-breadcrumb-path/index.d.ts +46 -0
  158. package/dist/components/waka-budget-burn/index.d.ts +154 -0
  159. package/dist/components/waka-build-matrix/index.d.ts +36 -0
  160. package/dist/components/waka-capacity-planner/index.d.ts +132 -0
  161. package/dist/components/waka-carousel/index.d.ts +105 -0
  162. package/dist/components/waka-cart-summary/index.d.ts +154 -0
  163. package/dist/components/waka-challenge-timer/index.d.ts +86 -0
  164. package/dist/components/waka-charts/WakaAreaChart.d.ts +12 -0
  165. package/dist/components/waka-charts/WakaBarChart.d.ts +12 -0
  166. package/dist/components/waka-charts/WakaChart.d.ts +17 -0
  167. package/dist/components/waka-charts/WakaLineChart.d.ts +12 -0
  168. package/dist/components/waka-charts/WakaMiniChart.d.ts +13 -0
  169. package/dist/components/waka-charts/WakaPieChart.d.ts +12 -0
  170. package/dist/components/waka-charts/WakaSparkline.d.ts +13 -0
  171. package/dist/components/waka-charts/dataTableHelpers.d.ts +37 -0
  172. package/dist/components/waka-charts/hooks/useChartTheme.d.ts +27 -0
  173. package/dist/components/waka-charts/hooks/useRechartsLoader.d.ts +161 -0
  174. package/dist/components/waka-charts/index.d.ts +57 -0
  175. package/dist/components/waka-charts/types.d.ts +302 -0
  176. package/dist/components/waka-chat-bubble/index.d.ts +127 -0
  177. package/dist/components/waka-checklist/index.d.ts +123 -0
  178. package/dist/components/waka-checkout-stepper/index.d.ts +154 -0
  179. package/dist/components/waka-cohort-table/index.d.ts +130 -0
  180. package/dist/components/waka-color-picker/index.d.ts +40 -0
  181. package/dist/components/waka-combo-counter/index.d.ts +53 -0
  182. package/dist/components/waka-combobox/index.d.ts +81 -0
  183. package/dist/components/waka-command-bar/index.d.ts +45 -0
  184. package/dist/components/waka-compare-period/index.d.ts +122 -0
  185. package/dist/components/waka-config-comparator/index.d.ts +37 -0
  186. package/dist/components/waka-connection-matrix/index.d.ts +117 -0
  187. package/dist/components/waka-container-list/index.d.ts +51 -0
  188. package/dist/components/waka-content-recommendation/index.d.ts +23 -0
  189. package/dist/components/waka-contribution-graph/index.d.ts +34 -0
  190. package/dist/components/waka-cost-breakdown/index.d.ts +50 -0
  191. package/dist/components/waka-coupon-input/index.d.ts +105 -0
  192. package/dist/components/waka-credit-activity-feed/index.d.ts +21 -0
  193. package/dist/components/waka-credit-alert/index.d.ts +24 -0
  194. package/dist/components/waka-credit-balance/index.d.ts +30 -0
  195. package/dist/components/waka-credit-balance/types.d.ts +34 -0
  196. package/dist/components/waka-credit-breakdown/index.d.ts +32 -0
  197. package/dist/components/waka-credit-burn-rate/index.d.ts +25 -0
  198. package/dist/components/waka-credit-card-input/index.d.ts +95 -0
  199. package/dist/components/waka-credit-history/index.d.ts +31 -0
  200. package/dist/components/waka-credit-meter/index.d.ts +27 -0
  201. package/dist/components/waka-credit-pricing-pack/index.d.ts +17 -0
  202. package/dist/components/waka-credit-projection/index.d.ts +21 -0
  203. package/dist/components/waka-credit-quota/index.d.ts +25 -0
  204. package/dist/components/waka-credit-receipt/index.d.ts +23 -0
  205. package/dist/components/waka-credit-top-up/index.d.ts +26 -0
  206. package/dist/components/waka-credit-transaction/index.d.ts +22 -0
  207. package/dist/components/waka-credit-transfer-form/index.d.ts +27 -0
  208. package/dist/components/waka-credit-usage-chart/index.d.ts +34 -0
  209. package/dist/components/waka-daily-reward/index.d.ts +76 -0
  210. package/dist/components/waka-database-card/index.d.ts +46 -0
  211. package/dist/components/waka-date-range-picker/index.d.ts +68 -0
  212. package/dist/components/waka-datetime-picker/index.d.ts +135 -0
  213. package/dist/components/waka-datetime-picker.form-integration/index.d.ts +79 -0
  214. package/dist/components/waka-dependency-tree/index.d.ts +38 -0
  215. package/dist/components/waka-deployment-lane/index.d.ts +43 -0
  216. package/dist/components/waka-device-trust/index.d.ts +95 -0
  217. package/dist/components/waka-doc-breadcrumb/index.d.ts +11 -0
  218. package/dist/components/waka-doc-callout/index.d.ts +9 -0
  219. package/dist/components/waka-doc-code-block/index.d.ts +23 -0
  220. package/dist/components/waka-doc-nav/index.d.ts +16 -0
  221. package/dist/components/waka-doc-renderer/index.d.ts +7 -0
  222. package/dist/components/waka-doc-search/index.d.ts +23 -0
  223. package/dist/components/waka-doc-table/index.d.ts +8 -0
  224. package/dist/components/waka-doc-toc/index.d.ts +11 -0
  225. package/dist/components/waka-doc-toolbar/index.d.ts +15 -0
  226. package/dist/components/waka-doc-version/index.d.ts +13 -0
  227. package/dist/components/waka-dock/index.d.ts +49 -0
  228. package/dist/components/waka-drawer/index.d.ts +59 -0
  229. package/dist/components/waka-empty-state/index.d.ts +85 -0
  230. package/dist/components/waka-env-var-editor/index.d.ts +30 -0
  231. package/dist/components/waka-error-shake/index.d.ts +49 -0
  232. package/dist/components/waka-feature-announcement/index.d.ts +112 -0
  233. package/dist/components/waka-feature-flag-row/index.d.ts +45 -0
  234. package/dist/components/waka-file-upload/index.d.ts +49 -0
  235. package/dist/components/waka-floating-nav/index.d.ts +51 -0
  236. package/dist/components/waka-flow-diagram/index.d.ts +71 -0
  237. package/dist/components/waka-funnel-chart/index.d.ts +108 -0
  238. package/dist/components/waka-glow-card/index.d.ts +32 -0
  239. package/dist/components/waka-goal-progress/index.d.ts +139 -0
  240. package/dist/components/waka-haptic-button/index.d.ts +50 -0
  241. package/dist/components/waka-health-pulse/index.d.ts +28 -0
  242. package/dist/components/waka-heatmap/index.d.ts +135 -0
  243. package/dist/components/waka-hotspot/index.d.ts +111 -0
  244. package/dist/components/waka-image/index.d.ts +59 -0
  245. package/dist/components/waka-incident-timeline/index.d.ts +38 -0
  246. package/dist/components/waka-invoice-preview/index.d.ts +137 -0
  247. package/dist/components/waka-kanban/index.d.ts +68 -0
  248. package/dist/components/waka-kpi-dashboard/index.d.ts +80 -0
  249. package/dist/components/waka-kubernetes-overview/index.d.ts +98 -0
  250. package/dist/components/waka-leaderboard/index.d.ts +85 -0
  251. package/dist/components/waka-level-progress/index.d.ts +89 -0
  252. package/dist/components/waka-liquid-button/index.d.ts +46 -0
  253. package/dist/components/waka-loading-orbit/index.d.ts +90 -0
  254. package/dist/components/waka-log-viewer/index.d.ts +38 -0
  255. package/dist/components/waka-loot-box/index.d.ts +87 -0
  256. package/dist/components/waka-magic-link/index.d.ts +34 -0
  257. package/dist/components/waka-magnetic-button/index.d.ts +61 -0
  258. package/dist/components/waka-mention-input/index.d.ts +106 -0
  259. package/dist/components/waka-metric-sparkline/index.d.ts +46 -0
  260. package/dist/components/waka-migration-list/index.d.ts +36 -0
  261. package/dist/components/waka-milestone-road/index.d.ts +91 -0
  262. package/dist/components/waka-modal/index.d.ts +87 -0
  263. package/dist/components/waka-morph-button/index.d.ts +62 -0
  264. package/dist/components/waka-network-topology/index.d.ts +35 -0
  265. package/dist/components/waka-notifications/index.d.ts +40 -0
  266. package/dist/components/waka-number-input/index.d.ts +60 -0
  267. package/dist/components/waka-orbital-menu/index.d.ts +61 -0
  268. package/dist/components/waka-order-tracker/index.d.ts +121 -0
  269. package/dist/components/waka-outstream-video/index.d.ts +24 -0
  270. package/dist/components/waka-pagination/index.d.ts +67 -0
  271. package/dist/components/waka-password-strength/index.d.ts +98 -0
  272. package/dist/components/waka-payment-method-picker/index.d.ts +88 -0
  273. package/dist/components/waka-permission-matrix/index.d.ts +197 -0
  274. package/dist/components/waka-phone-input/index.d.ts +93 -0
  275. package/dist/components/waka-pipeline-view/index.d.ts +49 -0
  276. package/dist/components/waka-player-card/index.d.ts +36 -0
  277. package/dist/components/waka-pod-card/index.d.ts +73 -0
  278. package/dist/components/waka-points-popup/index.d.ts +75 -0
  279. package/dist/components/waka-power-up/index.d.ts +103 -0
  280. package/dist/components/waka-presence-indicator/index.d.ts +188 -0
  281. package/dist/components/waka-pricing-table/index.d.ts +77 -0
  282. package/dist/components/waka-product-card/index.d.ts +81 -0
  283. package/dist/components/waka-progress-onboarding/index.d.ts +97 -0
  284. package/dist/components/waka-pull-to-refresh/index.d.ts +45 -0
  285. package/dist/components/waka-qrcode/index.d.ts +32 -0
  286. package/dist/components/waka-query-explain/index.d.ts +48 -0
  287. package/dist/components/waka-quest-card/index.d.ts +110 -0
  288. package/dist/components/waka-quota-bar/index.d.ts +100 -0
  289. package/dist/components/waka-radar-score/index.d.ts +95 -0
  290. package/dist/components/waka-rank-badge/index.d.ts +58 -0
  291. package/dist/components/waka-rating-input/index.d.ts +110 -0
  292. package/dist/components/waka-reaction-picker/index.d.ts +77 -0
  293. package/dist/components/waka-region-map/index.d.ts +27 -0
  294. package/dist/components/waka-resource-gauge/index.d.ts +78 -0
  295. package/dist/components/waka-resource-pool/index.d.ts +81 -0
  296. package/dist/components/waka-rich-text-editor/index.d.ts +36 -0
  297. package/dist/components/waka-rollback-slider/index.d.ts +79 -0
  298. package/dist/components/waka-sankey-diagram/index.d.ts +120 -0
  299. package/dist/components/waka-schedule-picker/index.d.ts +100 -0
  300. package/dist/components/waka-scratch-card/index.d.ts +87 -0
  301. package/dist/components/waka-season-pass/index.d.ts +65 -0
  302. package/dist/components/waka-secret-card/index.d.ts +43 -0
  303. package/dist/components/waka-security-scan-result/index.d.ts +45 -0
  304. package/dist/components/waka-security-score/index.d.ts +124 -0
  305. package/dist/components/waka-segmented-control/index.d.ts +42 -0
  306. package/dist/components/waka-server-rack/index.d.ts +44 -0
  307. package/dist/components/waka-service-graph/index.d.ts +44 -0
  308. package/dist/components/waka-session-manager/index.d.ts +116 -0
  309. package/dist/components/waka-signature-pad/index.d.ts +87 -0
  310. package/dist/components/waka-skeleton-wave/index.d.ts +79 -0
  311. package/dist/components/waka-skill-tree/index.d.ts +78 -0
  312. package/dist/components/waka-sla-tracker/index.d.ts +65 -0
  313. package/dist/components/waka-slider-range/index.d.ts +88 -0
  314. package/dist/components/waka-spin-wheel/index.d.ts +51 -0
  315. package/dist/components/waka-spinner/index.d.ts +46 -0
  316. package/dist/components/waka-sponsored-badge/index.d.ts +20 -0
  317. package/dist/components/waka-sponsored-card/index.d.ts +25 -0
  318. package/dist/components/waka-sponsored-feed/index.d.ts +31 -0
  319. package/dist/components/waka-spotlight/index.d.ts +47 -0
  320. package/dist/components/waka-stat/index.d.ts +57 -0
  321. package/dist/components/waka-stats-hexagon/index.d.ts +149 -0
  322. package/dist/components/waka-status-matrix/index.d.ts +38 -0
  323. package/dist/components/waka-stepper/index.d.ts +76 -0
  324. package/dist/components/waka-streak-counter/index.d.ts +27 -0
  325. package/dist/components/waka-success-explosion/index.d.ts +51 -0
  326. package/dist/components/waka-swipe-card/index.d.ts +64 -0
  327. package/dist/components/waka-tabs-morph/index.d.ts +66 -0
  328. package/dist/components/waka-tag-input/index.d.ts +134 -0
  329. package/dist/components/waka-team-banner/index.d.ts +122 -0
  330. package/dist/components/waka-terminal-output/index.d.ts +48 -0
  331. package/dist/components/waka-test-report/index.d.ts +60 -0
  332. package/dist/components/waka-theme-creator/index.d.ts +59 -0
  333. package/dist/components/waka-theme-manager/index.d.ts +62 -0
  334. package/dist/components/waka-thread-view/index.d.ts +101 -0
  335. package/dist/components/waka-tilt-card/index.d.ts +36 -0
  336. package/dist/components/waka-time-picker/index.d.ts +51 -0
  337. package/dist/components/waka-timeline/index.d.ts +46 -0
  338. package/dist/components/waka-tooltip-tour/index.d.ts +123 -0
  339. package/dist/components/waka-tour-guide/index.d.ts +127 -0
  340. package/dist/components/waka-tournament-bracket/index.d.ts +101 -0
  341. package/dist/components/waka-trace-viewer/index.d.ts +36 -0
  342. package/dist/components/waka-tree/index.d.ts +67 -0
  343. package/dist/components/waka-treemap-chart/index.d.ts +104 -0
  344. package/dist/components/waka-two-factor-setup/index.d.ts +93 -0
  345. package/dist/components/waka-typewriter/index.d.ts +98 -0
  346. package/dist/components/waka-typing-indicator/index.d.ts +64 -0
  347. package/dist/components/waka-versus-card/index.d.ts +117 -0
  348. package/dist/components/waka-video/index.d.ts +66 -0
  349. package/dist/components/waka-video-ad/index.d.ts +32 -0
  350. package/dist/components/waka-video-call/index.d.ts +170 -0
  351. package/dist/components/waka-video-overlay/index.d.ts +26 -0
  352. package/dist/components/waka-virtual-list/index.d.ts +54 -0
  353. package/dist/components/waka-voice-message/index.d.ts +117 -0
  354. package/dist/components/waka-welcome-modal/index.d.ts +120 -0
  355. package/dist/components/waka-xp-bar/index.d.ts +54 -0
  356. package/dist/context/admincrumb-context.d.ts +34 -0
  357. package/dist/context/index.d.ts +8 -0
  358. package/dist/context/language-context.d.ts +57 -0
  359. package/dist/context/theme-context.d.ts +39 -0
  360. package/dist/context/theme-provider.d.ts +74 -0
  361. package/dist/context/waka-provider.d.ts +50 -0
  362. package/dist/doc.cjs.js +1 -1
  363. package/dist/doc.d.ts +33 -1
  364. package/dist/doc.es.js +5 -4
  365. package/dist/editor.cjs.js +9 -9
  366. package/dist/editor.es.js +1934 -2016
  367. package/dist/exceljs.min-BQi0sACt.js +28 -0
  368. package/dist/{exceljs.min-DL1XYDll.mjs → exceljs.min-M0HhQgNK.mjs} +42 -33
  369. package/dist/export.cjs.js +1 -1
  370. package/dist/export.d.ts +30 -1
  371. package/dist/export.es.js +2 -1
  372. package/dist/hooks/index.d.ts +1 -0
  373. package/dist/hooks/use-toast.d.ts +44 -0
  374. package/dist/hooks/use-translation.d.ts +15 -0
  375. package/dist/hooks/useToast.d.ts +44 -0
  376. package/dist/index.cjs.js +96 -96
  377. package/dist/index.d.ts +38 -1
  378. package/dist/index.es.js +25926 -26088
  379. package/dist/input-B8pxqKEs.mjs +14 -0
  380. package/dist/input-vHHUMve1.js +1 -0
  381. package/dist/lib/i18n.d.ts +4 -0
  382. package/dist/rich-text.cjs.js +1 -1
  383. package/dist/rich-text.d.ts +21 -1
  384. package/dist/rich-text.es.js +2 -1
  385. package/dist/security-ClfRkelC.mjs +120 -0
  386. package/dist/security-DwyLk9h1.js +1 -0
  387. package/dist/{separator-ibN2mycs.mjs → separator-DDQs13_a.mjs} +19 -19
  388. package/dist/separator-DviMy-io.js +1 -0
  389. package/dist/src/blocks/login/index.d.ts +4 -4
  390. package/dist/src/blocks/waka-doc-shell/types.d.ts +3 -3
  391. package/dist/src/cli/utils/remote.d.ts +49 -0
  392. package/dist/src/components/calendar/index.d.ts +10 -0
  393. package/dist/src/components/card/index.d.ts +44 -6
  394. package/dist/src/components/editor/index.d.ts +14 -0
  395. package/dist/src/components/editor/waka-floating-toolbar.d.ts +6 -0
  396. package/dist/src/components/input/index.d.ts +14 -0
  397. package/dist/src/components/skeleton/index.d.ts +12 -1
  398. package/dist/src/components/table/index.d.ts +12 -1
  399. package/dist/src/components/textarea/index.d.ts +9 -0
  400. package/dist/src/components/waka-address-autocomplete/index.d.ts +5 -0
  401. package/dist/src/components/waka-admincrumb/index.d.ts +14 -0
  402. package/dist/src/components/waka-datetime-picker.form-integration/index.d.ts +4 -0
  403. package/dist/src/components/waka-doc-breadcrumb/index.d.ts +3 -3
  404. package/dist/src/components/waka-doc-search/index.d.ts +5 -0
  405. package/dist/src/components/waka-doc-toolbar/index.d.ts +5 -0
  406. package/dist/src/components/waka-dock/index.d.ts +5 -0
  407. package/dist/src/components/waka-haptic-button/index.d.ts +5 -0
  408. package/dist/src/components/waka-hotspot/index.d.ts +5 -0
  409. package/dist/src/components/waka-liquid-button/index.d.ts +5 -0
  410. package/dist/src/components/waka-magnetic-button/index.d.ts +5 -0
  411. package/dist/src/components/waka-modal/index.d.ts +5 -0
  412. package/dist/src/components/waka-tooltip-tour/index.d.ts +5 -0
  413. package/dist/src/components/waka-tour-guide/index.d.ts +5 -0
  414. package/dist/src/stories/editor/EditorStoryWrapper.d.ts +11 -0
  415. package/dist/textarea-C4AbqFOT.mjs +23 -0
  416. package/dist/textarea-jycisJkk.js +1 -0
  417. package/dist/types/index.d.ts +1 -0
  418. package/dist/types/link.d.ts +23 -0
  419. package/dist/types/provider.d.ts +108 -0
  420. package/dist/types-CUCT8Mwf.js +1 -0
  421. package/dist/{types-JnqoLyuv.mjs → types-DXkPQFit.mjs} +212 -214
  422. package/dist/{useDataTableImport-T7ddpN5k.js → useDataTableImport-DNU1m8NO.js} +3 -3
  423. package/dist/{useDataTableImport-BWUFesPi.mjs → useDataTableImport-z5avsB21.mjs} +4 -3
  424. package/dist/utils/cn.d.ts +1 -0
  425. package/dist/utils/datetime-helpers.d.ts +147 -0
  426. package/dist/utils/error-handling.d.ts +190 -0
  427. package/dist/utils/index.d.ts +6 -0
  428. package/dist/utils/logger.d.ts +9 -0
  429. package/dist/utils/security.d.ts +96 -0
  430. package/dist/utils/theme-loader.d.ts +101 -0
  431. package/dist/utils/tweak.d.ts +18 -0
  432. package/dist/waka-doc-renderer-22MUZbyl.js +3 -0
  433. package/dist/{waka-doc-renderer-Cw-Xnyen.mjs → waka-doc-renderer-BZ3DtCzv.mjs} +192 -176
  434. package/dist/waka-editor-plugins-DO4BF3o_.js +1 -0
  435. package/dist/{waka-editor-plugins-DR6tpsUC.mjs → waka-editor-plugins-_0WFrkKK.mjs} +3 -2
  436. package/dist/{waka-rich-text-editor-DgSWiXMW.mjs → waka-rich-text-editor-BbEpfD5b.mjs} +22 -18
  437. package/dist/waka-rich-text-editor-C4b30Ik-.js +1 -0
  438. package/package.json +84 -26
  439. package/src/blocks/activity-timeline/ActivityTimeline.mdx +117 -0
  440. package/src/blocks/activity-timeline/ActivityTimeline.stories.tsx +18 -1
  441. package/src/blocks/antivirus-dashboard/AntivirusDashboard.stories.tsx +8 -0
  442. package/src/blocks/antivirus-dashboard/index.tsx +14 -0
  443. package/src/blocks/apm-overview/APMOverview.stories.tsx +8 -0
  444. package/src/blocks/apm-overview/index.tsx +14 -0
  445. package/src/blocks/auth-2fa/Auth2FA.mdx +85 -0
  446. package/src/blocks/auth-2fa/Auth2FA.stories.tsx +8 -1
  447. package/src/blocks/calendar-view/CalendarView.mdx +101 -0
  448. package/src/blocks/calendar-view/CalendarView.stories.tsx +15 -1
  449. package/src/blocks/chat/Chat.mdx +121 -0
  450. package/src/blocks/chat/Chat.stories.tsx +45 -51
  451. package/src/blocks/chat-interface/ChatInterface.mdx +109 -0
  452. package/src/blocks/chat-interface/ChatInterface.stories.tsx +54 -65
  453. package/src/blocks/checkout-flow/CheckoutFlow.mdx +89 -0
  454. package/src/blocks/checkout-flow/CheckoutFlow.stories.tsx +9 -1
  455. package/src/blocks/cicd-builder/CICDBuilder.stories.tsx +8 -0
  456. package/src/blocks/cicd-builder/index.tsx +14 -0
  457. package/src/blocks/clamav-service-status/ClamAVServiceStatus.stories.tsx +8 -0
  458. package/src/blocks/clamav-service-status/index.tsx +14 -0
  459. package/src/blocks/cloud-cost-dashboard/CloudCostDashboard.stories.tsx +8 -0
  460. package/src/blocks/cloud-cost-dashboard/index.tsx +14 -0
  461. package/src/blocks/container-orchestrator/ContainerOrchestrator.stories.tsx +8 -0
  462. package/src/blocks/container-orchestrator/index.tsx +14 -0
  463. package/src/blocks/dashboard/Dashboard.mdx +105 -0
  464. package/src/blocks/dashboard/Dashboard.stories.tsx +14 -1
  465. package/src/blocks/dashboard-kpi/DashboardKPI.mdx +97 -0
  466. package/src/blocks/dashboard-kpi/DashboardKPI.stories.tsx +11 -1
  467. package/src/blocks/database-admin/DatabaseAdmin.stories.tsx +8 -0
  468. package/src/blocks/database-admin/index.tsx +14 -0
  469. package/src/blocks/deployment-dashboard/DeploymentDashboard.stories.tsx +8 -0
  470. package/src/blocks/deployment-dashboard/index.tsx +14 -0
  471. package/src/blocks/empty-states/EmptyStates.mdx +129 -0
  472. package/src/blocks/empty-states/EmptyStates.stories.tsx +15 -1
  473. package/src/blocks/error-pages/ErrorPages.mdx +129 -0
  474. package/src/blocks/error-pages/ErrorPages.stories.tsx +82 -100
  475. package/src/blocks/faq/FAQ.mdx +113 -0
  476. package/src/blocks/faq/FAQ.stories.tsx +16 -1
  477. package/src/blocks/file-manager/FileManager.mdx +105 -0
  478. package/src/blocks/file-manager/FileManager.stories.tsx +15 -1
  479. package/src/blocks/file-scan-uploader/FileScanUploader.stories.tsx +8 -0
  480. package/src/blocks/file-scan-uploader/index.tsx +14 -0
  481. package/src/blocks/footer/Footer.mdx +101 -0
  482. package/src/blocks/footer/Footer.stories.tsx +38 -46
  483. package/src/blocks/footer/index.tsx +4 -4
  484. package/src/blocks/gitops-sync-status/GitOpsSyncStatus.stories.tsx +8 -0
  485. package/src/blocks/gitops-sync-status/index.tsx +14 -0
  486. package/src/blocks/header/WakaHeader.mdx +97 -0
  487. package/src/blocks/header/WakaHeader.stories.tsx +12 -1
  488. package/src/blocks/headtab/Headtab.mdx +105 -0
  489. package/src/blocks/headtab/Headtab.stories.tsx +12 -1
  490. package/src/blocks/i18n-editor/I18nEditor.mdx +85 -0
  491. package/src/blocks/i18n-editor/I18nEditor.stories.tsx +8 -1
  492. package/src/blocks/incident-manager/IncidentManager.stories.tsx +8 -0
  493. package/src/blocks/incident-manager/index.tsx +14 -0
  494. package/src/blocks/infrastructure-map/InfrastructureMap.stories.tsx +8 -0
  495. package/src/blocks/infrastructure-map/index.tsx +14 -0
  496. package/src/blocks/kanban-board/KanbanBoard.stories.tsx +32 -37
  497. package/src/blocks/kanban-board/WakaKanbanBoard.mdx +93 -0
  498. package/src/blocks/landing/WakaLanding.mdx +85 -0
  499. package/src/blocks/landing/WakaLanding.stories.tsx +49 -57
  500. package/src/blocks/language-selector/LanguageSelector.mdx +89 -0
  501. package/src/blocks/language-selector/LanguageSelector.stories.tsx +12 -1
  502. package/src/blocks/layout/Layout.mdx +85 -0
  503. package/src/blocks/layout/Layout.stories.tsx +11 -1
  504. package/src/blocks/login/Login.mdx +105 -0
  505. package/src/blocks/login/Login.stories.tsx +11 -1
  506. package/src/blocks/login/index.tsx +14 -14
  507. package/src/blocks/on-call-schedule/OnCallSchedule.stories.tsx +8 -0
  508. package/src/blocks/on-call-schedule/index.tsx +14 -0
  509. package/src/blocks/player-profile/PlayerProfile.stories.tsx +8 -0
  510. package/src/blocks/player-profile/index.tsx +14 -0
  511. package/src/blocks/pricing/WakaPricing.mdx +101 -0
  512. package/src/blocks/pricing/WakaPricing.stories.tsx +27 -31
  513. package/src/blocks/profile/Profile.stories.tsx +15 -1
  514. package/src/blocks/profile/WakaProfile.mdx +109 -0
  515. package/src/blocks/profile/index.tsx +5 -6
  516. package/src/blocks/quarantine-manager/QuarantineManager.stories.tsx +8 -0
  517. package/src/blocks/quarantine-manager/index.tsx +14 -0
  518. package/src/blocks/release-notes/ReleaseNotes.mdx +101 -0
  519. package/src/blocks/release-notes/ReleaseNotes.stories.tsx +11 -1
  520. package/src/blocks/scan-history-log/ScanHistoryLog.stories.tsx +8 -0
  521. package/src/blocks/scan-history-log/index.tsx +14 -0
  522. package/src/blocks/scan-policy-editor/ScanPolicyEditor.stories.tsx +8 -0
  523. package/src/blocks/scan-policy-editor/index.tsx +14 -0
  524. package/src/blocks/scan-report-generator/ScanReportGenerator.stories.tsx +8 -0
  525. package/src/blocks/scan-report-generator/index.tsx +14 -0
  526. package/src/blocks/settings/Settings.stories.tsx +13 -1
  527. package/src/blocks/settings/WakaSettings.mdx +89 -0
  528. package/src/blocks/sidebar/WakaSidebar.mdx +101 -0
  529. package/src/blocks/sidebar/WakaSidebar.stories.tsx +12 -1
  530. package/src/blocks/sidebar/index.tsx +0 -2
  531. package/src/blocks/signature-database-manager/SignatureDatabaseManager.stories.tsx +8 -0
  532. package/src/blocks/signature-database-manager/index.tsx +14 -0
  533. package/src/blocks/theme-creator-block/ThemeCreatorBlock.stories.tsx +8 -0
  534. package/src/blocks/theme-creator-block/index.tsx +14 -0
  535. package/src/blocks/threat-alert-banner/ThreatAlertBanner.stories.tsx +8 -0
  536. package/src/blocks/threat-alert-banner/index.tsx +14 -0
  537. package/src/blocks/user-management/UserManagement.stories.tsx +13 -0
  538. package/src/blocks/user-management/index.tsx +14 -0
  539. package/src/blocks/waka-doc-shell/WakaDocShell.mdx +61 -0
  540. package/src/blocks/waka-doc-shell/WakaDocShell.stories.tsx +21 -24
  541. package/src/blocks/waka-doc-shell/types.ts +3 -3
  542. package/src/blocks/wizard/WakaWizard.mdx +117 -0
  543. package/src/blocks/wizard/Wizard.stories.tsx +19 -1
  544. package/src/components/DataTable/DataTable.mdx +87 -0
  545. package/src/components/DataTable/DataTable.stories.tsx +0 -1
  546. package/src/components/MDX_DOCS_GUIDELINE.md +69 -0
  547. package/src/components/accordion/Accordion.mdx +73 -0
  548. package/src/components/accordion/Accordion.stories.tsx +83 -1
  549. package/src/components/alert/Alert.mdx +85 -0
  550. package/src/components/alert/Alert.stories.tsx +78 -7
  551. package/src/components/alert-dialog/AlertDialog.mdx +77 -0
  552. package/src/components/alert-dialog/AlertDialog.stories.tsx +81 -4
  553. package/src/components/aspect-ratio/AspectRatio.mdx +81 -0
  554. package/src/components/aspect-ratio/AspectRatio.stories.tsx +53 -1
  555. package/src/components/avatar/Avatar.mdx +81 -0
  556. package/src/components/avatar/Avatar.stories.tsx +83 -4
  557. package/src/components/badge/Badge.mdx +85 -0
  558. package/src/components/badge/Badge.stories.tsx +106 -5
  559. package/src/components/button/Button.mdx +85 -0
  560. package/src/components/button/Button.stories.tsx +0 -1
  561. package/src/components/calendar/Calendar.mdx +81 -0
  562. package/src/components/calendar/Calendar.stories.tsx +73 -1
  563. package/src/components/calendar/index.tsx +10 -0
  564. package/src/components/card/Card.mdx +85 -0
  565. package/src/components/card/Card.stories.tsx +147 -6
  566. package/src/components/card/index.tsx +51 -24
  567. package/src/components/checkbox/Checkbox.mdx +77 -0
  568. package/src/components/checkbox/Checkbox.stories.tsx +75 -1
  569. package/src/components/code/Code.mdx +103 -0
  570. package/src/components/code/Code.stories.tsx +16 -1
  571. package/src/components/collapsible/Collapsible.mdx +73 -0
  572. package/src/components/collapsible/Collapsible.stories.tsx +86 -1
  573. package/src/components/command/Command.mdx +77 -0
  574. package/src/components/command/Command.stories.tsx +100 -6
  575. package/src/components/context-menu/ContextMenu.mdx +77 -0
  576. package/src/components/context-menu/ContextMenu.stories.tsx +35 -1
  577. package/src/components/dialog/Dialog.mdx +81 -0
  578. package/src/components/dialog/Dialog.stories.tsx +139 -4
  579. package/src/components/dropdown-menu/DropdownMenu.mdx +77 -0
  580. package/src/components/dropdown-menu/DropdownMenu.stories.tsx +62 -3
  581. package/src/components/editor/blocks/waka-slash-menu-block.tsx +39 -74
  582. package/src/components/editor/index.ts +14 -0
  583. package/src/components/editor/waka-dnd-editor.tsx +1 -1
  584. package/src/components/editor/waka-document-editor.tsx +1 -1
  585. package/src/components/editor/waka-editor-plugins.ts +1 -1
  586. package/src/components/editor/waka-floating-toolbar.tsx +116 -58
  587. package/src/components/error-boundary/ErrorBoundary.mdx +61 -0
  588. package/src/components/error-boundary/ErrorBoundary.stories.tsx +1 -2
  589. package/src/components/form/Form.mdx +77 -0
  590. package/src/components/form/Form.stories.tsx +166 -1
  591. package/src/components/hover-card/HoverCard.mdx +77 -0
  592. package/src/components/hover-card/HoverCard.stories.tsx +101 -4
  593. package/src/components/input/Input.mdx +77 -0
  594. package/src/components/input/Input.stories.tsx +4 -3
  595. package/src/components/input/index.tsx +16 -1
  596. package/src/components/input-otp/InputOTP.mdx +91 -0
  597. package/src/components/input-otp/InputOTP.stories.tsx +6 -4
  598. package/src/components/label/Label.mdx +81 -0
  599. package/src/components/label/Label.stories.tsx +41 -1
  600. package/src/components/language-selector/LanguageSelector.mdx +73 -0
  601. package/src/components/language-selector/LanguageSelector.stories.tsx +0 -1
  602. package/src/components/menubar/Menubar.mdx +77 -0
  603. package/src/components/menubar/Menubar.stories.tsx +76 -1
  604. package/src/components/navigation-menu/NavigationMenu.mdx +73 -0
  605. package/src/components/navigation-menu/NavigationMenu.stories.tsx +98 -1
  606. package/src/components/popover/Popover.mdx +81 -0
  607. package/src/components/popover/Popover.stories.tsx +110 -4
  608. package/src/components/progress/Progress.mdx +81 -0
  609. package/src/components/progress/Progress.stories.tsx +53 -2
  610. package/src/components/progress/index.tsx +1 -0
  611. package/src/components/radio-group/RadioGroup.mdx +77 -0
  612. package/src/components/radio-group/RadioGroup.stories.tsx +54 -1
  613. package/src/components/scroll-area/ScrollArea.mdx +77 -0
  614. package/src/components/scroll-area/ScrollArea.stories.tsx +57 -1
  615. package/src/components/select/Select.mdx +81 -0
  616. package/src/components/select/Select.stories.tsx +100 -4
  617. package/src/components/separator/Separator.mdx +81 -0
  618. package/src/components/separator/Separator.stories.tsx +45 -1
  619. package/src/components/sheet/Sheet.mdx +73 -0
  620. package/src/components/sheet/Sheet.stories.tsx +97 -4
  621. package/src/components/skeleton/Skeleton.mdx +77 -0
  622. package/src/components/skeleton/Skeleton.stories.tsx +0 -1
  623. package/src/components/skeleton/index.tsx +13 -4
  624. package/src/components/slider/Slider.mdx +73 -0
  625. package/src/components/slider/Slider.stories.tsx +10 -11
  626. package/src/components/slider/index.tsx +30 -15
  627. package/src/components/switch/Switch.mdx +81 -0
  628. package/src/components/switch/Switch.stories.tsx +66 -7
  629. package/src/components/table/Table.mdx +77 -0
  630. package/src/components/table/Table.stories.tsx +107 -6
  631. package/src/components/table/index.tsx +13 -4
  632. package/src/components/tabs/Tabs.mdx +81 -0
  633. package/src/components/tabs/Tabs.stories.tsx +156 -7
  634. package/src/components/textarea/Textarea.mdx +77 -0
  635. package/src/components/textarea/Textarea.stories.tsx +9 -10
  636. package/src/components/textarea/index.tsx +11 -1
  637. package/src/components/theme-selector/ThemeSelector.mdx +67 -0
  638. package/src/components/theme-selector/ThemeSelector.stories.tsx +0 -1
  639. package/src/components/toast/Toast.mdx +77 -0
  640. package/src/components/toast/Toast.stories.tsx +62 -1
  641. package/src/components/toaster/Toaster.mdx +57 -0
  642. package/src/components/toaster/Toaster.stories.tsx +1 -2
  643. package/src/components/toggle/Toggle.mdx +77 -0
  644. package/src/components/toggle/Toggle.stories.tsx +0 -1
  645. package/src/components/tooltip/Tooltip.mdx +81 -0
  646. package/src/components/tooltip/Tooltip.stories.tsx +48 -1
  647. package/src/components/typography/Typography.mdx +97 -0
  648. package/src/components/typography/Typography.stories.tsx +0 -1
  649. package/src/components/waka-3d-pie-chart/Waka3DPieChart.stories.tsx +24 -14
  650. package/src/components/waka-3d-pie-chart/index.tsx +17 -2
  651. package/src/components/waka-achievement-unlock/WakaAchievementUnlock.stories.tsx +9 -10
  652. package/src/components/waka-achievement-unlock/index.tsx +14 -0
  653. package/src/components/waka-activity-feed/index.tsx +14 -0
  654. package/src/components/waka-ad-banner/WakaAdBanner.stories.tsx +1 -1
  655. package/src/components/waka-ad-banner/index.tsx +14 -0
  656. package/src/components/waka-ad-fallback/index.tsx +14 -0
  657. package/src/components/waka-ad-inline/index.tsx +14 -0
  658. package/src/components/waka-ad-interstitial/index.tsx +14 -0
  659. package/src/components/waka-ad-placeholder/index.tsx +14 -0
  660. package/src/components/waka-ad-provider/index.tsx +15 -1
  661. package/src/components/waka-ad-sidebar/index.tsx +14 -0
  662. package/src/components/waka-ad-sticky-footer/index.tsx +14 -0
  663. package/src/components/waka-address-autocomplete/WakaAddressAutocomplete.mdx +63 -0
  664. package/src/components/waka-address-autocomplete/WakaAddressAutocomplete.stories.tsx +0 -1
  665. package/src/components/waka-address-autocomplete/index.tsx +5 -0
  666. package/src/components/waka-admincrumb/WakaAdmincrumb.stories.tsx +52 -30
  667. package/src/components/waka-admincrumb/index.tsx +14 -0
  668. package/src/components/waka-alert-panel/index.tsx +14 -0
  669. package/src/components/waka-alert-stack/index.tsx +14 -0
  670. package/src/components/waka-allocation-matrix/index.tsx +23 -0
  671. package/src/components/waka-approval-chain/WakaApprovalChain.stories.tsx +15 -17
  672. package/src/components/waka-approval-chain/index.tsx +14 -0
  673. package/src/components/waka-artifact-list/index.tsx +14 -0
  674. package/src/components/waka-audit-log/index.tsx +28 -0
  675. package/src/components/waka-autocomplete/WakaAutocomplete.mdx +83 -0
  676. package/src/components/waka-autocomplete/WakaAutocomplete.stories.tsx +0 -1
  677. package/src/components/waka-badge-showcase/index.tsx +14 -0
  678. package/src/components/waka-barcode/WakaBarcode.mdx +93 -0
  679. package/src/components/waka-barcode/WakaBarcode.stories.tsx +13 -1
  680. package/src/components/waka-biometric-prompt/index.tsx +14 -0
  681. package/src/components/waka-bottom-sheet/WakaBottomSheet.mdx +77 -0
  682. package/src/components/waka-bottom-sheet/WakaBottomSheet.stories.tsx +0 -1
  683. package/src/components/waka-breadcrumb/WakaBreadcrumb.mdx +77 -0
  684. package/src/components/waka-breadcrumb/WakaBreadcrumb.stories.tsx +0 -1
  685. package/src/components/waka-breadcrumb-path/WakaBreadcrumbPath.mdx +63 -0
  686. package/src/components/waka-breadcrumb-path/WakaBreadcrumbPath.stories.tsx +0 -1
  687. package/src/components/waka-budget-burn/index.tsx +15 -1
  688. package/src/components/waka-build-matrix/index.tsx +14 -0
  689. package/src/components/waka-capacity-planner/index.tsx +18 -1
  690. package/src/components/waka-carousel/WakaCarousel.mdx +101 -0
  691. package/src/components/waka-carousel/WakaCarousel.stories.tsx +16 -1
  692. package/src/components/waka-cart-summary/index.tsx +14 -0
  693. package/src/components/waka-challenge-timer/index.tsx +14 -0
  694. package/src/components/waka-charts/WakaAreaChart.stories.tsx +116 -0
  695. package/src/components/waka-charts/WakaBarChart.stories.tsx +137 -0
  696. package/src/components/waka-charts/WakaChart.stories.tsx +135 -0
  697. package/src/components/waka-charts/WakaCharts.mdx +137 -0
  698. package/src/components/waka-charts/WakaCharts.stories.tsx +0 -1
  699. package/src/components/waka-charts/WakaLineChart.stories.tsx +135 -0
  700. package/src/components/waka-charts/WakaMiniChart.stories.tsx +101 -0
  701. package/src/components/waka-charts/WakaPieChart.stories.tsx +114 -0
  702. package/src/components/waka-charts/WakaSparkline.stories.tsx +99 -0
  703. package/src/components/waka-chat-bubble/WakaChatBubble.mdx +69 -0
  704. package/src/components/waka-chat-bubble/WakaChatBubble.stories.tsx +0 -15
  705. package/src/components/waka-checklist/WakaChecklist.mdx +65 -0
  706. package/src/components/waka-checklist/WakaChecklist.stories.tsx +0 -1
  707. package/src/components/waka-checkout-stepper/index.tsx +14 -0
  708. package/src/components/waka-cohort-table/WakaCohortTable.mdx +65 -0
  709. package/src/components/waka-cohort-table/WakaCohortTable.stories.tsx +4 -7
  710. package/src/components/waka-color-picker/WakaColorPicker.mdx +85 -0
  711. package/src/components/waka-color-picker/WakaColorPicker.stories.tsx +0 -1
  712. package/src/components/waka-combo-counter/WakaComboCounter.stories.tsx +1 -1
  713. package/src/components/waka-combo-counter/index.tsx +14 -0
  714. package/src/components/waka-combobox/WakaCombobox.mdx +85 -0
  715. package/src/components/waka-combobox/WakaCombobox.stories.tsx +15 -1
  716. package/src/components/waka-command-bar/WakaCommandBar.mdx +57 -0
  717. package/src/components/waka-command-bar/WakaCommandBar.stories.tsx +2 -6
  718. package/src/components/waka-compare-period/WakaComparePeriod.mdx +65 -0
  719. package/src/components/waka-compare-period/WakaComparePeriod.stories.tsx +35 -20
  720. package/src/components/waka-config-comparator/WakaConfigComparator.mdx +73 -0
  721. package/src/components/waka-config-comparator/WakaConfigComparator.stories.tsx +0 -1
  722. package/src/components/waka-connection-matrix/WakaConnectionMatrix.mdx +61 -0
  723. package/src/components/waka-connection-matrix/WakaConnectionMatrix.stories.tsx +0 -1
  724. package/src/components/waka-container-list/index.tsx +14 -0
  725. package/src/components/waka-content-recommendation/WakaContentRecommendation.stories.tsx +18 -5
  726. package/src/components/waka-content-recommendation/index.tsx +14 -0
  727. package/src/components/waka-contribution-graph/WakaContributionGraph.mdx +101 -0
  728. package/src/components/waka-contribution-graph/WakaContributionGraph.stories.tsx +38 -44
  729. package/src/components/waka-cost-breakdown/WakaCostBreakdown.mdx +101 -0
  730. package/src/components/waka-cost-breakdown/WakaCostBreakdown.stories.tsx +43 -51
  731. package/src/components/waka-coupon-input/WakaCouponInput.mdx +69 -0
  732. package/src/components/waka-coupon-input/WakaCouponInput.stories.tsx +0 -1
  733. package/src/components/waka-credit-activity-feed/WakaCreditActivityFeed.mdx +77 -0
  734. package/src/components/waka-credit-activity-feed/WakaCreditActivityFeed.stories.tsx +15 -1
  735. package/src/components/waka-credit-alert/WakaCreditAlert.mdx +73 -0
  736. package/src/components/waka-credit-alert/WakaCreditAlert.stories.tsx +16 -1
  737. package/src/components/waka-credit-balance/WakaCreditBalance.mdx +81 -0
  738. package/src/components/waka-credit-balance/WakaCreditBalance.stories.tsx +15 -1
  739. package/src/components/waka-credit-breakdown/WakaCreditBreakdown.mdx +73 -0
  740. package/src/components/waka-credit-breakdown/WakaCreditBreakdown.stories.tsx +15 -1
  741. package/src/components/waka-credit-burn-rate/WakaCreditBurnRate.mdx +73 -0
  742. package/src/components/waka-credit-burn-rate/WakaCreditBurnRate.stories.tsx +17 -1
  743. package/src/components/waka-credit-card-input/WakaCreditCardInput.mdx +73 -0
  744. package/src/components/waka-credit-card-input/WakaCreditCardInput.stories.tsx +0 -1
  745. package/src/components/waka-credit-history/WakaCreditHistory.mdx +85 -0
  746. package/src/components/waka-credit-history/WakaCreditHistory.stories.tsx +14 -1
  747. package/src/components/waka-credit-meter/WakaCreditMeter.mdx +81 -0
  748. package/src/components/waka-credit-meter/WakaCreditMeter.stories.tsx +14 -17
  749. package/src/components/waka-credit-pricing-pack/WakaCreditPricingPack.mdx +69 -0
  750. package/src/components/waka-credit-pricing-pack/WakaCreditPricingPack.stories.tsx +13 -1
  751. package/src/components/waka-credit-projection/WakaCreditProjection.mdx +69 -0
  752. package/src/components/waka-credit-projection/WakaCreditProjection.stories.tsx +14 -1
  753. package/src/components/waka-credit-quota/WakaCreditQuota.mdx +73 -0
  754. package/src/components/waka-credit-quota/WakaCreditQuota.stories.tsx +16 -1
  755. package/src/components/waka-credit-receipt/WakaCreditReceipt.mdx +65 -0
  756. package/src/components/waka-credit-receipt/WakaCreditReceipt.stories.tsx +11 -1
  757. package/src/components/waka-credit-top-up/WakaCreditTopUp.mdx +69 -0
  758. package/src/components/waka-credit-top-up/WakaCreditTopUp.stories.tsx +9 -11
  759. package/src/components/waka-credit-transaction/WakaCreditTransaction.mdx +85 -0
  760. package/src/components/waka-credit-transaction/WakaCreditTransaction.stories.tsx +13 -1
  761. package/src/components/waka-credit-transfer-form/WakaCreditTransferForm.mdx +65 -0
  762. package/src/components/waka-credit-transfer-form/WakaCreditTransferForm.stories.tsx +12 -1
  763. package/src/components/waka-credit-usage-chart/WakaCreditUsageChart.mdx +73 -0
  764. package/src/components/waka-credit-usage-chart/WakaCreditUsageChart.stories.tsx +8 -10
  765. package/src/components/waka-daily-reward/WakaDailyReward.stories.tsx +7 -9
  766. package/src/components/waka-daily-reward/index.tsx +16 -0
  767. package/src/components/waka-database-card/index.tsx +14 -0
  768. package/src/components/waka-date-range-picker/WakaDateRangePicker.mdx +97 -0
  769. package/src/components/waka-date-range-picker/WakaDateRangePicker.stories.tsx +15 -1
  770. package/src/components/waka-datetime-picker/WakaDateTimePicker.mdx +109 -0
  771. package/src/components/waka-datetime-picker/WakaDateTimePicker.stories.tsx +15 -1
  772. package/src/components/waka-datetime-picker.form-integration/index.tsx +7 -3
  773. package/src/components/waka-dependency-tree/index.tsx +14 -0
  774. package/src/components/waka-deployment-lane/WakaDeploymentLane.stories.tsx +17 -20
  775. package/src/components/waka-deployment-lane/index.tsx +17 -0
  776. package/src/components/waka-device-trust/index.tsx +14 -0
  777. package/src/components/waka-doc-breadcrumb/WakaDocBreadcrumb.mdx +61 -0
  778. package/src/components/waka-doc-breadcrumb/WakaDocBreadcrumb.stories.tsx +12 -10
  779. package/src/components/waka-doc-breadcrumb/index.tsx +3 -3
  780. package/src/components/waka-doc-callout/WakaDocCallout.mdx +61 -0
  781. package/src/components/waka-doc-callout/WakaDocCallout.stories.tsx +17 -6
  782. package/src/components/waka-doc-code-block/WakaDocCodeBlock.mdx +81 -0
  783. package/src/components/waka-doc-code-block/WakaDocCodeBlock.stories.tsx +56 -1
  784. package/src/components/waka-doc-nav/WakaDocNav.mdx +73 -0
  785. package/src/components/waka-doc-nav/WakaDocNav.stories.tsx +82 -1
  786. package/src/components/waka-doc-nav/index.tsx +26 -16
  787. package/src/components/waka-doc-renderer/WakaDocRenderer.mdx +73 -0
  788. package/src/components/waka-doc-renderer/WakaDocRenderer.stories.tsx +73 -1
  789. package/src/components/waka-doc-search/WakaDocSearch.mdx +75 -0
  790. package/src/components/waka-doc-search/WakaDocSearch.stories.tsx +80 -1
  791. package/src/components/waka-doc-search/index.tsx +6 -0
  792. package/src/components/waka-doc-table/WakaDocTable.mdx +73 -0
  793. package/src/components/waka-doc-table/WakaDocTable.stories.tsx +128 -1
  794. package/src/components/waka-doc-toc/WakaDocToc.mdx +73 -0
  795. package/src/components/waka-doc-toc/WakaDocToc.stories.tsx +84 -10
  796. package/src/components/waka-doc-toolbar/WakaDocToolbar.mdx +75 -0
  797. package/src/components/waka-doc-toolbar/WakaDocToolbar.stories.tsx +13 -1
  798. package/src/components/waka-doc-toolbar/index.tsx +5 -0
  799. package/src/components/waka-doc-version/WakaDocVersion.mdx +73 -0
  800. package/src/components/waka-doc-version/WakaDocVersion.stories.tsx +86 -1
  801. package/src/components/waka-dock/WakaDock.mdx +95 -0
  802. package/src/components/waka-dock/WakaDock.stories.tsx +14 -1
  803. package/src/components/waka-dock/index.tsx +6 -0
  804. package/src/components/waka-drawer/WakaDrawer.mdx +85 -0
  805. package/src/components/waka-drawer/WakaDrawer.stories.tsx +0 -1
  806. package/src/components/waka-empty-state/WakaEmptyState.mdx +69 -0
  807. package/src/components/waka-empty-state/WakaEmptyState.stories.tsx +0 -1
  808. package/src/components/waka-env-var-editor/index.tsx +14 -0
  809. package/src/components/waka-error-shake/WakaErrorShake.mdx +89 -0
  810. package/src/components/waka-error-shake/WakaErrorShake.stories.tsx +0 -1
  811. package/src/components/waka-feature-announcement/WakaFeatureAnnouncement.mdx +61 -0
  812. package/src/components/waka-feature-announcement/WakaFeatureAnnouncement.stories.tsx +0 -1
  813. package/src/components/waka-feature-flag-row/index.tsx +14 -0
  814. package/src/components/waka-file-upload/WakaFileUpload.mdx +81 -0
  815. package/src/components/waka-file-upload/WakaFileUpload.stories.tsx +0 -1
  816. package/src/components/waka-floating-nav/WakaFloatingNav.mdx +61 -0
  817. package/src/components/waka-floating-nav/WakaFloatingNav.stories.tsx +0 -1
  818. package/src/components/waka-flow-diagram/index.tsx +3 -1
  819. package/src/components/waka-funnel-chart/WakaFunnelChart.mdx +97 -0
  820. package/src/components/waka-funnel-chart/WakaFunnelChart.stories.tsx +20 -13
  821. package/src/components/waka-funnel-chart/index.tsx +1 -1
  822. package/src/components/waka-glow-card/WakaGlowCard.mdx +93 -0
  823. package/src/components/waka-glow-card/WakaGlowCard.stories.tsx +0 -1
  824. package/src/components/waka-goal-progress/WakaGoalProgress.mdx +69 -0
  825. package/src/components/waka-goal-progress/WakaGoalProgress.stories.tsx +0 -1
  826. package/src/components/waka-haptic-button/WakaHapticButton.mdx +127 -0
  827. package/src/components/waka-haptic-button/WakaHapticButton.stories.tsx +0 -1
  828. package/src/components/waka-haptic-button/index.tsx +5 -0
  829. package/src/components/waka-health-pulse/WakaHealthPulse.mdx +89 -0
  830. package/src/components/waka-health-pulse/WakaHealthPulse.stories.tsx +27 -30
  831. package/src/components/waka-heatmap/WakaHeatmap.mdx +101 -0
  832. package/src/components/waka-heatmap/WakaHeatmap.stories.tsx +23 -27
  833. package/src/components/waka-heatmap/index.tsx +6 -1
  834. package/src/components/waka-hotspot/WakaHotspot.mdx +67 -0
  835. package/src/components/waka-hotspot/WakaHotspot.stories.tsx +0 -1
  836. package/src/components/waka-hotspot/index.tsx +5 -0
  837. package/src/components/waka-image/WakaImage.mdx +93 -0
  838. package/src/components/waka-image/WakaImage.stories.tsx +6 -4
  839. package/src/components/waka-incident-timeline/WakaIncidentTimeline.mdx +93 -0
  840. package/src/components/waka-incident-timeline/WakaIncidentTimeline.stories.tsx +0 -1
  841. package/src/components/waka-invoice-preview/WakaInvoicePreview.mdx +69 -0
  842. package/src/components/waka-invoice-preview/WakaInvoicePreview.stories.tsx +55 -75
  843. package/src/components/waka-kubernetes-overview/index.tsx +14 -0
  844. package/src/components/waka-leaderboard/WakaLeaderboard.mdx +101 -0
  845. package/src/components/waka-leaderboard/WakaLeaderboard.stories.tsx +0 -1
  846. package/src/components/waka-level-progress/WakaLevelProgress.mdx +85 -0
  847. package/src/components/waka-level-progress/WakaLevelProgress.stories.tsx +0 -1
  848. package/src/components/waka-liquid-button/WakaLiquidButton.mdx +71 -0
  849. package/src/components/waka-liquid-button/WakaLiquidButton.stories.tsx +0 -1
  850. package/src/components/waka-liquid-button/index.tsx +5 -0
  851. package/src/components/waka-loading-orbit/WakaLoadingOrbit.mdx +113 -0
  852. package/src/components/waka-loading-orbit/WakaLoadingOrbit.stories.tsx +0 -1
  853. package/src/components/waka-loading-orbit/index.tsx +1 -1
  854. package/src/components/waka-log-viewer/index.tsx +14 -0
  855. package/src/components/waka-loot-box/index.tsx +20 -0
  856. package/src/components/waka-magic-link/WakaMagicLink.mdx +61 -0
  857. package/src/components/waka-magic-link/WakaMagicLink.stories.tsx +0 -1
  858. package/src/components/waka-magnetic-button/WakaMagneticButton.mdx +67 -0
  859. package/src/components/waka-magnetic-button/WakaMagneticButton.stories.tsx +0 -1
  860. package/src/components/waka-magnetic-button/index.tsx +5 -0
  861. package/src/components/waka-mention-input/WakaMentionInput.mdx +65 -0
  862. package/src/components/waka-mention-input/WakaMentionInput.stories.tsx +1 -3
  863. package/src/components/waka-metric-sparkline/WakaMetricSparkline.mdx +105 -0
  864. package/src/components/waka-metric-sparkline/WakaMetricSparkline.stories.tsx +27 -18
  865. package/src/components/waka-metric-sparkline/index.tsx +3 -3
  866. package/src/components/waka-migration-list/index.tsx +14 -0
  867. package/src/components/waka-milestone-road/index.tsx +15 -1
  868. package/src/components/waka-modal/WakaModal.mdx +95 -0
  869. package/src/components/waka-modal/WakaModal.stories.tsx +0 -1
  870. package/src/components/waka-modal/index.tsx +5 -0
  871. package/src/components/waka-morph-button/WakaMorphButton.mdx +105 -0
  872. package/src/components/waka-morph-button/WakaMorphButton.stories.tsx +0 -1
  873. package/src/components/waka-network-topology/index.tsx +14 -0
  874. package/src/components/waka-notifications/WakaNotifications.mdx +77 -0
  875. package/src/components/waka-notifications/WakaNotifications.stories.tsx +0 -1
  876. package/src/components/waka-number-input/WakaNumberInput.mdx +97 -0
  877. package/src/components/waka-number-input/WakaNumberInput.stories.tsx +14 -1
  878. package/src/components/waka-orbital-menu/index.tsx +21 -3
  879. package/src/components/waka-order-tracker/WakaOrderTracker.stories.tsx +64 -39
  880. package/src/components/waka-order-tracker/index.tsx +14 -0
  881. package/src/components/waka-outstream-video/index.tsx +17 -0
  882. package/src/components/waka-pagination/WakaPagination.mdx +81 -0
  883. package/src/components/waka-pagination/WakaPagination.stories.tsx +0 -1
  884. package/src/components/waka-password-strength/WakaPasswordStrength.mdx +81 -0
  885. package/src/components/waka-password-strength/WakaPasswordStrength.stories.tsx +11 -35
  886. package/src/components/waka-payment-method-picker/index.tsx +14 -0
  887. package/src/components/waka-permission-matrix/index.tsx +28 -0
  888. package/src/components/waka-phone-input/WakaPhoneInput.mdx +65 -0
  889. package/src/components/waka-phone-input/WakaPhoneInput.stories.tsx +0 -1
  890. package/src/components/waka-pipeline-view/WakaPipelineView.stories.tsx +27 -32
  891. package/src/components/waka-pipeline-view/index.tsx +14 -0
  892. package/src/components/waka-player-card/WakaPlayerCard.stories.tsx +0 -3
  893. package/src/components/waka-player-card/index.tsx +17 -3
  894. package/src/components/waka-pod-card/index.tsx +14 -0
  895. package/src/components/waka-points-popup/WakaPointsPopup.stories.tsx +1 -1
  896. package/src/components/waka-points-popup/index.tsx +14 -0
  897. package/src/components/waka-power-up/index.tsx +14 -0
  898. package/src/components/waka-presence-indicator/WakaPresenceIndicator.mdx +73 -0
  899. package/src/components/waka-presence-indicator/WakaPresenceIndicator.stories.tsx +0 -1
  900. package/src/components/waka-pricing-table/WakaPricingTable.mdx +69 -0
  901. package/src/components/waka-pricing-table/WakaPricingTable.stories.tsx +0 -1
  902. package/src/components/waka-product-card/WakaProductCard.stories.tsx +0 -8
  903. package/src/components/waka-product-card/index.tsx +14 -0
  904. package/src/components/waka-progress-onboarding/WakaProgressOnboarding.mdx +69 -0
  905. package/src/components/waka-progress-onboarding/WakaProgressOnboarding.stories.tsx +50 -18
  906. package/src/components/waka-pull-to-refresh/WakaPullToRefresh.stories.tsx +3 -4
  907. package/src/components/waka-pull-to-refresh/index.tsx +16 -2
  908. package/src/components/waka-qrcode/WakaQRCode.mdx +91 -0
  909. package/src/components/waka-qrcode/WakaQRCode.stories.tsx +7 -5
  910. package/src/components/waka-query-explain/index.tsx +14 -0
  911. package/src/components/waka-quest-card/index.tsx +14 -0
  912. package/src/components/waka-quota-bar/WakaQuotaBar.mdx +105 -0
  913. package/src/components/waka-quota-bar/WakaQuotaBar.stories.tsx +0 -1
  914. package/src/components/waka-radar-score/WakaRadarScore.stories.tsx +41 -43
  915. package/src/components/waka-radar-score/index.tsx +16 -1
  916. package/src/components/waka-rank-badge/index.tsx +15 -1
  917. package/src/components/waka-rating-input/WakaRatingInput.mdx +73 -0
  918. package/src/components/waka-rating-input/WakaRatingInput.stories.tsx +0 -1
  919. package/src/components/waka-reaction-picker/index.tsx +14 -0
  920. package/src/components/waka-region-map/index.tsx +14 -0
  921. package/src/components/waka-resource-gauge/WakaResourceGauge.mdx +117 -0
  922. package/src/components/waka-resource-gauge/WakaResourceGauge.stories.tsx +31 -25
  923. package/src/components/waka-resource-gauge/index.tsx +2 -2
  924. package/src/components/waka-resource-pool/WakaResourcePool.mdx +65 -0
  925. package/src/components/waka-resource-pool/WakaResourcePool.stories.tsx +0 -1
  926. package/src/components/waka-resource-pool/index.tsx +3 -1
  927. package/src/components/waka-rich-text-editor/WakaRichTextEditor.mdx +77 -0
  928. package/src/components/waka-rich-text-editor/WakaRichTextEditor.stories.tsx +0 -1
  929. package/src/components/waka-rollback-slider/index.tsx +14 -0
  930. package/src/components/waka-sankey-diagram/WakaSankeyDiagram.stories.tsx +32 -36
  931. package/src/components/waka-sankey-diagram/index.tsx +15 -1
  932. package/src/components/waka-schedule-picker/WakaSchedulePicker.mdx +69 -0
  933. package/src/components/waka-schedule-picker/WakaSchedulePicker.stories.tsx +0 -1
  934. package/src/components/waka-scratch-card/WakaScratchCard.stories.tsx +6 -7
  935. package/src/components/waka-scratch-card/index.tsx +15 -1
  936. package/src/components/waka-season-pass/index.tsx +17 -0
  937. package/src/components/waka-secret-card/WakaSecretCard.mdx +93 -0
  938. package/src/components/waka-secret-card/WakaSecretCard.stories.tsx +0 -1
  939. package/src/components/waka-security-scan-result/index.tsx +26 -3
  940. package/src/components/waka-security-score/index.tsx +14 -0
  941. package/src/components/waka-segmented-control/WakaSegmentedControl.mdx +93 -0
  942. package/src/components/waka-segmented-control/WakaSegmentedControl.stories.tsx +0 -1
  943. package/src/components/waka-server-rack/WakaServerRack.stories.tsx +1 -1
  944. package/src/components/waka-server-rack/index.tsx +14 -0
  945. package/src/components/waka-service-graph/index.tsx +15 -1
  946. package/src/components/waka-session-manager/WakaSessionManager.mdx +65 -0
  947. package/src/components/waka-session-manager/WakaSessionManager.stories.tsx +57 -23
  948. package/src/components/waka-signature-pad/WakaSignaturePad.mdx +89 -0
  949. package/src/components/waka-signature-pad/WakaSignaturePad.stories.tsx +0 -1
  950. package/src/components/waka-signature-pad/index.tsx +1 -1
  951. package/src/components/waka-skeleton-wave/WakaSkeletonWave.mdx +113 -0
  952. package/src/components/waka-skeleton-wave/WakaSkeletonWave.stories.tsx +0 -1
  953. package/src/components/waka-skill-tree/index.tsx +18 -1
  954. package/src/components/waka-slider-range/WakaSliderRange.mdx +69 -0
  955. package/src/components/waka-slider-range/WakaSliderRange.stories.tsx +0 -1
  956. package/src/components/waka-spin-wheel/WakaSpinWheel.stories.tsx +17 -16
  957. package/src/components/waka-spin-wheel/index.tsx +14 -0
  958. package/src/components/waka-spinner/WakaSpinner.stories.tsx +3 -2
  959. package/src/components/waka-spinner/index.tsx +14 -0
  960. package/src/components/waka-sponsored-badge/WakaSponsoredBadge.mdx +81 -0
  961. package/src/components/waka-sponsored-badge/WakaSponsoredBadge.stories.tsx +0 -1
  962. package/src/components/waka-sponsored-card/WakaSponsoredCard.mdx +69 -0
  963. package/src/components/waka-sponsored-card/WakaSponsoredCard.stories.tsx +8 -1
  964. package/src/components/waka-sponsored-feed/WakaSponsoredFeed.mdx +65 -0
  965. package/src/components/waka-sponsored-feed/WakaSponsoredFeed.stories.tsx +8 -1
  966. package/src/components/waka-spotlight/WakaSpotlight.mdx +61 -0
  967. package/src/components/waka-spotlight/WakaSpotlight.stories.tsx +0 -1
  968. package/src/components/waka-stat/WakaStat.mdx +89 -0
  969. package/src/components/waka-stat/WakaStat.stories.tsx +7 -7
  970. package/src/components/waka-stats-hexagon/index.tsx +16 -1
  971. package/src/components/waka-status-matrix/WakaStatusMatrix.mdx +97 -0
  972. package/src/components/waka-status-matrix/WakaStatusMatrix.stories.tsx +12 -7
  973. package/src/components/waka-stepper/WakaStepper.mdx +89 -0
  974. package/src/components/waka-stepper/WakaStepper.stories.tsx +0 -1
  975. package/src/components/waka-streak-counter/WakaStreakCounter.stories.tsx +35 -30
  976. package/src/components/waka-streak-counter/index.tsx +14 -0
  977. package/src/components/waka-success-explosion/WakaSuccessExplosion.mdx +93 -0
  978. package/src/components/waka-success-explosion/WakaSuccessExplosion.stories.tsx +0 -1
  979. package/src/components/waka-success-explosion/index.tsx +2 -2
  980. package/src/components/waka-swipe-card/WakaSwipeCard.stories.tsx +36 -12
  981. package/src/components/waka-swipe-card/index.tsx +14 -0
  982. package/src/components/waka-tabs-morph/WakaTabsMorph.mdx +113 -0
  983. package/src/components/waka-tabs-morph/WakaTabsMorph.stories.tsx +0 -1
  984. package/src/components/waka-tag-input/WakaTagInput.mdx +89 -0
  985. package/src/components/waka-tag-input/WakaTagInput.stories.tsx +0 -1
  986. package/src/components/waka-team-banner/WakaTeamBanner.stories.tsx +49 -20
  987. package/src/components/waka-team-banner/index.tsx +15 -0
  988. package/src/components/waka-terminal-output/WakaTerminalOutput.mdx +93 -0
  989. package/src/components/waka-terminal-output/WakaTerminalOutput.stories.tsx +0 -1
  990. package/src/components/waka-test-report/WakaTestReport.mdx +93 -0
  991. package/src/components/waka-test-report/WakaTestReport.stories.tsx +0 -1
  992. package/src/components/waka-theme-creator/index.tsx +14 -0
  993. package/src/components/waka-theme-manager/index.tsx +14 -0
  994. package/src/components/waka-thread-view/WakaThreadView.mdx +65 -0
  995. package/src/components/waka-thread-view/WakaThreadView.stories.tsx +0 -1
  996. package/src/components/waka-tilt-card/WakaTiltCard.mdx +97 -0
  997. package/src/components/waka-tilt-card/WakaTiltCard.stories.tsx +10 -14
  998. package/src/components/waka-time-picker/WakaTimePicker.mdx +89 -0
  999. package/src/components/waka-time-picker/WakaTimePicker.stories.tsx +14 -1
  1000. package/src/components/waka-timeline/WakaTimeline.mdx +77 -0
  1001. package/src/components/waka-timeline/WakaTimeline.stories.tsx +0 -1
  1002. package/src/components/waka-tooltip-tour/WakaTooltipTour.mdx +59 -0
  1003. package/src/components/waka-tooltip-tour/WakaTooltipTour.stories.tsx +0 -1
  1004. package/src/components/waka-tooltip-tour/index.tsx +5 -0
  1005. package/src/components/waka-tour-guide/WakaTourGuide.mdx +59 -0
  1006. package/src/components/waka-tour-guide/WakaTourGuide.stories.tsx +0 -1
  1007. package/src/components/waka-tour-guide/index.tsx +5 -0
  1008. package/src/components/waka-tournament-bracket/index.tsx +14 -0
  1009. package/src/components/waka-trace-viewer/WakaTraceViewer.mdx +85 -0
  1010. package/src/components/waka-trace-viewer/WakaTraceViewer.stories.tsx +0 -1
  1011. package/src/components/waka-tree/WakaTree.mdx +85 -0
  1012. package/src/components/waka-tree/WakaTree.stories.tsx +6 -4
  1013. package/src/components/waka-treemap-chart/WakaTreemapChart.stories.tsx +22 -11
  1014. package/src/components/waka-treemap-chart/index.tsx +14 -0
  1015. package/src/components/waka-two-factor-setup/WakaTwoFactorSetup.mdx +77 -0
  1016. package/src/components/waka-two-factor-setup/WakaTwoFactorSetup.stories.tsx +0 -1
  1017. package/src/components/waka-typewriter/WakaTypewriter.stories.tsx +7 -8
  1018. package/src/components/waka-typewriter/index.tsx +14 -0
  1019. package/src/components/waka-typing-indicator/WakaTypingIndicator.mdx +77 -0
  1020. package/src/components/waka-typing-indicator/WakaTypingIndicator.stories.tsx +0 -1
  1021. package/src/components/waka-versus-card/index.tsx +14 -0
  1022. package/src/components/waka-video/WakaVideo.mdx +93 -0
  1023. package/src/components/waka-video/WakaVideo.stories.tsx +16 -1
  1024. package/src/components/waka-video-ad/WakaVideoAd.mdx +69 -0
  1025. package/src/components/waka-video-ad/WakaVideoAd.stories.tsx +0 -1
  1026. package/src/components/waka-video-call/WakaVideoCall.mdx +73 -0
  1027. package/src/components/waka-video-call/WakaVideoCall.stories.tsx +0 -1
  1028. package/src/components/waka-video-overlay/WakaVideoOverlay.mdx +61 -0
  1029. package/src/components/waka-video-overlay/WakaVideoOverlay.stories.tsx +0 -1
  1030. package/src/components/waka-voice-message/WakaVoiceMessage.mdx +77 -0
  1031. package/src/components/waka-voice-message/WakaVoiceMessage.stories.tsx +0 -1
  1032. package/src/components/waka-welcome-modal/WakaWelcomeModal.mdx +57 -0
  1033. package/src/components/waka-welcome-modal/WakaWelcomeModal.stories.tsx +1 -2
  1034. package/src/components/waka-xp-bar/index.tsx +14 -0
  1035. package/dist/badge-BbwO7QeZ.js +0 -1
  1036. package/dist/chunk-14q5BKub.js +0 -1
  1037. package/dist/cn-DEtaFQsA.js +0 -1
  1038. package/dist/cn-DUn6aSIQ.mjs +0 -24
  1039. package/dist/exceljs.min-qeIfSCbF.js +0 -28
  1040. package/dist/input-BfaSAGVw.js +0 -1
  1041. package/dist/input-DVr_Qkl8.mjs +0 -14
  1042. package/dist/security-CyBpuklN.mjs +0 -122
  1043. package/dist/security-bFWwDrlg.js +0 -1
  1044. package/dist/separator-NrkltulH.js +0 -1
  1045. package/dist/textarea-CdQWggYG.js +0 -1
  1046. package/dist/textarea-DJDXJ3nd.mjs +0 -23
  1047. package/dist/types-C2St0wOW.js +0 -1
  1048. package/dist/waka-doc-renderer-CTxC7Trf.js +0 -3
  1049. package/dist/waka-editor-plugins-sGSh9hn2.js +0 -1
  1050. package/dist/waka-rich-text-editor-BlIdtknG.js +0 -1
  1051. package/dist/waka-rich-text-editor-D1uA3zbB.js +0 -1
  1052. package/dist/waka-rich-text-editor-DndVJuDw.mjs +0 -2
@@ -1,5 +1,5 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./chunk-14q5BKub.js`),t=require(`./cn-DEtaFQsA.js`),n=require(`./security-bFWwDrlg.js`),r=require(`./badge-BbwO7QeZ.js`),i=require(`./separator-NrkltulH.js`),a=require(`./textarea-CdQWggYG.js`),o=require(`./waka-editor-plugins-sGSh9hn2.js`);let s=require(`react`);s=e.a(s);let c=require(`lucide-react`),l=require(`react/jsx-runtime`);t.n();function u(e,t){try{t(e.chain().focus())}catch{}}function d(e,t,n){try{return e.isActive(t,n)}catch{return!1}}var f={bold:{icon:c.Bold,label:`Gras`,shortcut:`Ctrl+B`,action:e=>u(e,e=>e.toggleBold().run()),isActive:e=>d(e,`bold`)},italic:{icon:c.Italic,label:`Italique`,shortcut:`Ctrl+I`,action:e=>u(e,e=>e.toggleItalic().run()),isActive:e=>d(e,`italic`)},underline:{icon:c.Underline,label:`Souligné`,shortcut:`Ctrl+U`,action:e=>u(e,e=>e.toggleUnderline().run()),isActive:e=>d(e,`underline`)},strikethrough:{icon:c.Strikethrough,label:`Barré`,shortcut:`Ctrl+Shift+S`,action:e=>u(e,e=>e.toggleStrike().run()),isActive:e=>d(e,`strikethrough`)},code:{icon:c.Code,label:`Code`,shortcut:`Ctrl+E`,action:e=>u(e,e=>e.toggleCode().run()),isActive:e=>d(e,`code`)},highlight:{icon:c.Highlighter,label:`Surligné`,action:e=>u(e,e=>e.toggleHighlight().run()),isActive:e=>d(e,`highlight`)},h1:{icon:c.Heading1,label:`Titre 1`,action:e=>{try{e.tf.h1.toggle()}catch{u(e,e=>e.toggleHeading({level:1}).run())}},isActive:e=>d(e,`heading`,{level:1})},h2:{icon:c.Heading2,label:`Titre 2`,action:e=>{try{e.tf.h2.toggle()}catch{u(e,e=>e.toggleHeading({level:2}).run())}},isActive:e=>d(e,`heading`,{level:2})},h3:{icon:c.Heading3,label:`Titre 3`,action:e=>{try{e.tf.h3.toggle()}catch{u(e,e=>e.toggleHeading({level:3}).run())}},isActive:e=>d(e,`heading`,{level:3})},blockquote:{icon:c.Quote,label:`Citation`,action:e=>{try{e.tf.blockquote.toggle()}catch{u(e,e=>e.toggleBlockquote().run())}},isActive:e=>d(e,`blockquote`)},callout:{icon:c.MessageSquarePlus,label:`Callout`,action:e=>{try{e.tf.callout.insert()}catch{}},isActive:e=>d(e,`callout`)},table:{icon:c.Table,label:`Tableau`,action:e=>{try{e.tf.table.insert({rows:3,cols:3})}catch{}},isActive:e=>d(e,`table`)},columns:{icon:c.Columns2,label:`Colonnes`,action:e=>{try{e.tf.column.insert()}catch{}},isActive:e=>d(e,`column_group`)},link:{icon:c.Link,label:`Lien`,shortcut:`Ctrl+K`,action:e=>{try{e.tf.link.toggle()}catch{}},isActive:e=>d(e,`a`)},image:{icon:c.Image,label:`Image`,action:e=>{try{e.tf.image.insert({url:``})}catch{}},isActive:()=>!1},separator:{icon:c.Minus,label:`Séparateur`,action:e=>{try{u(e,e=>e.insertBreak().run())}catch{}},isActive:()=>!1},ai:{icon:c.Sparkles,label:`Assistant IA`,action:()=>{},isActive:()=>!1}},p=[[`bold`,`italic`,`underline`,`strikethrough`,`code`,`highlight`],[`h1`,`h2`,`h3`],[`blockquote`,`callout`,`table`,`columns`],[`link`,`image`,`separator`]];function m({groups:e=p,editor:r,className:a,enableAI:o=!1,onAIClick:c}){let u=s.useMemo(()=>o?[...e,[`ai`]]:e,[e,o]);return(0,l.jsx)(n.u,{delayDuration:300,children:(0,l.jsx)(`div`,{role:`toolbar`,"aria-label":`Barre d'outils de formatage`,className:t.t(`flex flex-wrap items-center gap-0.5 p-1`,`border-b bg-muted/30`,a),children:u.map((e,t)=>(0,l.jsxs)(s.Fragment,{children:[t>0&&(0,l.jsx)(i.t,{orientation:`vertical`,className:`mx-1 h-6`}),e.map(e=>{let t=f[e];if(!t)return null;let a=t.isActive?.(r)??!1,o=t.shortcut?`${t.label} (${t.shortcut})`:t.label,s=t.icon;return(0,l.jsxs)(n.c,{children:[(0,l.jsx)(n.d,{asChild:!0,children:(0,l.jsx)(i.n,{type:`button`,variant:a?`secondary`:`ghost`,size:`icon`,className:`h-7 w-7`,onClick:()=>{if(e===`ai`&&c){c();return}t.action(r)},"aria-label":t.label,"aria-pressed":a,children:(0,l.jsx)(s,{className:`h-4 w-4`})})}),(0,l.jsx)(n.l,{side:`bottom`,className:`text-xs`,children:o})]},e)})]},t))})})}m.displayName=`WakaEditorToolbar`,t.n();var h=s.forwardRef(({value:e,onChange:t,readOnly:n=!1,placeholder:r=`Commencez a ecrire...`,className:i,editorClassName:a,minHeight:o=200,label:c,description:u,error:d,preset:f=`standard`,enableAI:m=!1,enableMarkdown:h=!1,enableMedia:v=!1,enableMentions:y=!1,enableDnD:b=!1,enableTOC:x=!1,toolbarGroups:S=p,hideToolbar:C=!1,onAIClick:w,extraPlugins:T,editorRef:E},D)=>{let[O,k]=s.useState(null),[A,j]=s.useState(!1);return s.useEffect(()=>{let e=!1;return(async()=>{try{let[t,n]=await Promise.all([import(`platejs/react`),Promise.resolve().then(()=>require(`./waka-editor-plugins-sGSh9hn2.js`)).then(e=>e.g)]),r=await n.loadCorePlugins(),i=n.getPresetLoaders(f),a=await Promise.all(i.map(e=>e())),o=[];h&&o.push(n.loadMarkdownPlugin()),v&&o.push(n.loadMediaPlugins()),y&&o.push(n.loadMentionPlugins()),b&&o.push(n.loadDndPlugin()),x&&o.push(n.loadTocPlugin());let s=await Promise.all(o),c=[...r,...a.flat(),...s.flat(),...T??[]];e||k({components:{Plate:t.Plate,PlateContent:t.PlateContent,usePlateEditor:t.usePlateEditor},plugins:c})}catch{e||j(!0)}})(),()=>{e=!0}},[f,h,v,y,b,x,T]),O?(0,l.jsx)(g,{ref:D,components:O.components,plugins:O.plugins,value:e,onChange:t,readOnly:n,placeholder:r,className:i,editorClassName:a,minHeight:o,label:c,description:u,error:d,enableAI:m,toolbarGroups:S,hideToolbar:C,onAIClick:w,editorRef:E}):(0,l.jsx)(_,{ref:D,value:e,onChange:t,placeholder:r,className:i,minHeight:o,label:c,description:u,error:d,loading:!A,readOnly:n})});h.displayName=`WakaEditor`;var g=s.forwardRef(({components:{Plate:e,PlateContent:n,usePlateEditor:r},plugins:i,value:o,onChange:c,readOnly:u=!1,placeholder:d,className:f,editorClassName:p,minHeight:h,label:g,description:_,error:v,enableAI:y,toolbarGroups:b,hideToolbar:x,onAIClick:S,editorRef:C},w)=>{let T=r({plugins:i,value:o??[{type:`p`,children:[{text:``}]}]});return s.useEffect(()=>{C&&(C.current=T)},[T,C]),(0,l.jsxs)(`div`,{ref:w,className:t.t(`space-y-1.5`,f),children:[g&&(0,l.jsx)(a.n,{children:g}),_&&(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:_}),(0,l.jsx)(e,{editor:T,onChange:c?({value:e})=>c(e):void 0,readOnly:u,children:(0,l.jsxs)(`div`,{className:t.t(`border rounded-lg overflow-hidden`,v&&`border-destructive`,u&&`opacity-80`),children:[!x&&!u&&(0,l.jsx)(m,{editor:T,groups:b,enableAI:y,onAIClick:S}),(0,l.jsx)(`div`,{style:{minHeight:h},children:(0,l.jsx)(n,{placeholder:d,readOnly:u,className:t.t(`prose prose-sm max-w-none p-3`,`focus-within:outline-none`,`[&_[data-slate-editor]]:outline-none [&_[data-slate-editor]]:min-h-[inherit]`,p)})})]})}),v&&(0,l.jsx)(`p`,{className:`text-sm text-destructive`,children:v})]})});g.displayName=`PlateEditorInner`;var _=s.forwardRef(({value:e,onChange:n,placeholder:r,className:i,minHeight:o,label:c,description:u,error:d,loading:f,readOnly:p},m)=>{let h=s.useMemo(()=>{if(!e)return``;let t=e=>e.map(e=>typeof e.text==`string`?e.text:e.children?t(e.children):``).join(`
2
- `);return t(e)},[e]);return(0,l.jsxs)(`div`,{ref:m,className:t.t(`space-y-1.5`,i),children:[c&&(0,l.jsx)(a.n,{children:c}),u&&(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:u}),(0,l.jsxs)(`div`,{className:`relative`,children:[(0,l.jsx)(a.t,{value:h,onChange:e=>{n?.([{type:`p`,children:[{text:e.target.value}]}])},placeholder:r,disabled:f||p,style:{minHeight:o},className:t.t(d&&`border-destructive`)}),f&&(0,l.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-background/50 rounded-lg`,children:(0,l.jsx)(`span`,{className:`text-sm text-muted-foreground animate-pulse`,children:`Chargement de l'editeur...`})})]}),d&&(0,l.jsx)(`p`,{className:`text-sm text-destructive`,children:d})]})});_.displayName=`FallbackEditor`,t.n();function v(e,t){try{t(e)}catch{}}function y(e,t){try{return e.isActive(t)}catch{return!1}}var b=[{key:`bold`,icon:c.Bold,label:`Gras`,shortcut:`Ctrl+B`,action:e=>v(e,e=>e.chain().focus().toggleBold().run()),isActive:e=>y(e,`bold`)},{key:`italic`,icon:c.Italic,label:`Italique`,shortcut:`Ctrl+I`,action:e=>v(e,e=>e.chain().focus().toggleItalic().run()),isActive:e=>y(e,`italic`)},{key:`underline`,icon:c.Underline,label:`Souligne`,shortcut:`Ctrl+U`,action:e=>v(e,e=>e.chain().focus().toggleUnderline().run()),isActive:e=>y(e,`underline`)},{key:`strikethrough`,icon:c.Strikethrough,label:`Barre`,action:e=>v(e,e=>e.chain().focus().toggleStrike().run()),isActive:e=>y(e,`strikethrough`)},{key:`code`,icon:c.Code,label:`Code`,shortcut:`Ctrl+E`,action:e=>v(e,e=>e.chain().focus().toggleCode().run()),isActive:e=>y(e,`code`)},{key:`highlight`,icon:c.Highlighter,label:`Surligner`,action:e=>v(e,e=>e.chain().focus().toggleHighlight().run()),isActive:e=>y(e,`highlight`)},{key:`link`,icon:c.Link,label:`Lien`,shortcut:`Ctrl+K`,action:e=>{try{e.tf.link.toggle()}catch{}},isActive:e=>y(e,`a`)}],x=s.forwardRef(({editor:e,buttons:t=b,enableAI:n=!1,onAIClick:r,className:i},a)=>{let[o,u]=s.useState(null);return s.useEffect(()=>{import(`@platejs/floating`).then(e=>{e.useFloatingToolbar&&u(()=>e.useFloatingToolbar)}).catch(()=>{})},[]),(0,l.jsx)(S,{ref:a,editor:e,buttons:s.useMemo(()=>n?[...t,{key:`ai`,icon:c.Sparkles,label:`Demander a l'IA`,action:()=>r?.(),isActive:()=>!1}]:t,[t,n,r]),className:i,floatingHook:o})});x.displayName=`WakaFloatingToolbar`;var S=s.forwardRef(({editor:e,buttons:n,className:r,floatingHook:i},a)=>{let o=i?i({editor:e}):{ref:null,hidden:!1,props:{}},c=s.useCallback(e=>{typeof a==`function`?a(e):a&&(a.current=e),o.ref&&(typeof o.ref==`function`?o.ref(e):o.ref.current=e)},[a,o.ref]);return o.hidden?null:(0,l.jsx)(`div`,{ref:c,...o.props,className:t.t(`flex items-center gap-0.5 p-1`,`rounded-lg border bg-popover shadow-lg`,`animate-in fade-in-0 zoom-in-95`,r),role:`toolbar`,"aria-label":`Barre d'outils flottante`,children:n.map((n,r)=>{let i=n.isActive?.(e)??!1,a=n.icon;return(0,l.jsx)(`button`,{type:`button`,title:n.shortcut?`${n.label} (${n.shortcut})`:n.label,"aria-label":n.label,"aria-pressed":i,className:t.t(`inline-flex h-7 w-7 items-center justify-center rounded-md`,`text-sm transition-colors`,i?`bg-accent text-accent-foreground`:`hover:bg-accent/50 text-foreground/70 hover:text-foreground`),onMouseDown:t=>{t.preventDefault(),n.action(e)},children:(0,l.jsx)(a,{className:`h-3.5 w-3.5`})},n.key)})})});S.displayName=`FloatingToolbarContent`,t.n();var C=[{key:`h1`,label:`Titre 1`,description:`Titre principal de section`,icon:c.Heading1,group:`Blocs de base`,keywords:[`heading`,`titre`,`h1`],action:e=>{try{e.tf.h1.toggle()}catch{}}},{key:`h2`,label:`Titre 2`,description:`Sous-titre de section`,icon:c.Heading2,group:`Blocs de base`,keywords:[`heading`,`titre`,`h2`],action:e=>{try{e.tf.h2.toggle()}catch{}}},{key:`h3`,label:`Titre 3`,description:`Titre de sous-section`,icon:c.Heading3,group:`Blocs de base`,keywords:[`heading`,`titre`,`h3`],action:e=>{try{e.tf.h3.toggle()}catch{}}},{key:`bulletList`,label:`Liste a puces`,description:`Liste non ordonnee`,icon:c.List,group:`Blocs de base`,keywords:[`bullet`,`list`,`unordered`,`puces`],action:e=>{try{e.chain().focus().toggleBulletList().run()}catch{}}},{key:`numberedList`,label:`Liste numerotee`,description:`Liste ordonnee`,icon:c.ListOrdered,group:`Blocs de base`,keywords:[`numbered`,`list`,`ordered`,`numerotee`],action:e=>{try{e.chain().focus().toggleOrderedList().run()}catch{}}},{key:`blockquote`,label:`Citation`,description:`Bloc de citation`,icon:c.Quote,group:`Blocs de base`,keywords:[`quote`,`citation`,`blockquote`],action:e=>{try{e.tf.blockquote.toggle()}catch{}}},{key:`table`,label:`Tableau`,description:`Inserer un tableau 3x3`,icon:c.Table,group:`Blocs avances`,keywords:[`table`,`tableau`,`grid`],action:e=>{try{e.tf.table.insert({rows:3,cols:3})}catch{}}},{key:`columns`,label:`Colonnes`,description:`Mise en page multi-colonnes`,icon:c.Columns2,group:`Blocs avances`,keywords:[`column`,`colonne`,`layout`,`mise en page`],action:e=>{try{e.tf.column.insert()}catch{}}},{key:`callout`,label:`Callout`,description:`Encart d'information colore`,icon:c.MessageSquarePlus,group:`Blocs avances`,keywords:[`callout`,`alert`,`info`,`encart`],action:e=>{try{e.tf.callout.insert()}catch{}}},{key:`codeBlock`,label:`Bloc de code`,description:`Code source avec coloration`,icon:c.Code,group:`Blocs avances`,keywords:[`code`,`pre`,`source`],action:e=>{try{e.chain().focus().toggleCodeBlock().run()}catch{}}},{key:`link`,label:`Lien`,description:`Inserer un lien hypertexte`,icon:c.Link,group:`Insertions`,keywords:[`link`,`lien`,`url`,`href`],action:e=>{try{e.tf.link.toggle()}catch{}}},{key:`image`,label:`Image`,description:`Inserer une image`,icon:c.Image,group:`Insertions`,keywords:[`image`,`photo`,`picture`,`img`],action:e=>{try{e.tf.image.insert({url:``})}catch{}}},{key:`divider`,label:`Separateur`,description:`Ligne horizontale de separation`,icon:c.Minus,group:`Insertions`,keywords:[`divider`,`separator`,`hr`,`line`],action:e=>{try{e.chain().focus().insertBreak().run()}catch{}}},{key:`ai`,label:`Demander a l'IA`,description:`Generer du contenu avec l'assistant IA`,icon:c.Sparkles,group:`IA`,keywords:[`ai`,`ia`,`assistant`,`generate`,`generer`],action:()=>{}}];function w({commands:e=C,className:n,onSelect:r}){let[i,a]=s.useState(``),[o,c]=s.useState(0),u=s.useRef(null),d=s.useMemo(()=>{if(!i)return e;let t=i.toLowerCase();return e.filter(e=>e.label.toLowerCase().includes(t)||e.key.toLowerCase().includes(t)||e.keywords?.some(e=>e.toLowerCase().includes(t)))},[e,i]),f=s.useMemo(()=>{let e=new Map;for(let t of d){let n=t.group||`Autre`;e.has(n)||e.set(n,[]),e.get(n).push(t)}return e},[d]),p=s.useMemo(()=>d,[d]),m=s.useCallback(e=>{e.key===`ArrowDown`?(e.preventDefault(),c(e=>Math.min(e+1,p.length-1))):e.key===`ArrowUp`?(e.preventDefault(),c(e=>Math.max(e-1,0))):e.key===`Enter`&&p[o]&&(e.preventDefault(),r?.(p[o].key))},[p,o,r]);return s.useEffect(()=>c(0),[i]),(0,l.jsxs)(`div`,{ref:u,className:t.t(`w-72 max-h-80 overflow-y-auto`,`rounded-lg border bg-popover shadow-lg`,`p-1`,n),role:`listbox`,onKeyDown:m,children:[(0,l.jsx)(`div`,{className:`px-2 pb-1.5`,children:(0,l.jsx)(`input`,{type:`text`,value:i,onChange:e=>a(e.target.value),placeholder:`Rechercher...`,className:t.t(`w-full rounded-md border bg-background px-2 py-1.5`,`text-sm placeholder:text-muted-foreground`,`focus:outline-none focus:ring-1 focus:ring-ring`),autoFocus:!0})}),p.length===0&&(0,l.jsx)(`div`,{className:`px-2 py-4 text-center text-sm text-muted-foreground`,children:`Aucune commande trouvee`}),Array.from(f.entries()).map(([e,n])=>(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`div`,{className:`px-2 py-1 text-xs font-semibold text-muted-foreground uppercase tracking-wider`,children:e}),n.map(e=>{let n=p.indexOf(e),i=e.icon;return(0,l.jsxs)(`button`,{role:`option`,"aria-selected":n===o,className:t.t(`flex w-full items-center gap-3 rounded-md px-2 py-1.5 text-left`,`text-sm transition-colors cursor-pointer`,n===o?`bg-accent text-accent-foreground`:`hover:bg-accent/50`),onMouseEnter:()=>c(n),onClick:()=>r?.(e.key),children:[(0,l.jsx)(`div`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-md border bg-background`,children:(0,l.jsx)(i,{className:`h-4 w-4`})}),(0,l.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,l.jsx)(`div`,{className:`font-medium`,children:e.label}),e.description&&(0,l.jsx)(`div`,{className:`text-xs text-muted-foreground truncate`,children:e.description})]})]},e.key)})]},e))]})}w.displayName=`WakaSlashMenu`;async function T(e=C){try{let{SlashPlugin:t,SlashInputPlugin:n}=await import(`@platejs/combobox/react`);return[t.configure({options:{trigger:`/`,triggerPreviousCharPattern:/^$|^[\s"']$/,rules:e.map(e=>({key:e.key,text:e.label,keywords:e.keywords,onSelect:e.action}))}}),n]}catch{return console.warn(`[WakaSlashMenu] @platejs/combobox not installed, slash commands disabled`),[]}}t.n();var E=[{key:`continue`,label:`Continuer la redaction`,prompt:`Continue writing the following text naturally:
1
+ "use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./chunk-FDd1SASZ.js`),t=require(`./cn-DEeiGoUV.js`),n=require(`./security-DwyLk9h1.js`),r=require(`./badge-B2Kw7ew3.js`),i=require(`./separator-DviMy-io.js`),a=require(`./textarea-jycisJkk.js`),o=require(`./waka-editor-plugins-DO4BF3o_.js`);let s=require(`react`);s=e.r(s);let c=require(`lucide-react`),l=require(`react/jsx-runtime`);function u(e,t){try{t(e.chain().focus())}catch{}}function d(e,t,n){try{return e.isActive(t,n)}catch{return!1}}var f={bold:{icon:c.Bold,label:`Gras`,shortcut:`Ctrl+B`,action:e=>u(e,e=>e.toggleBold().run()),isActive:e=>d(e,`bold`)},italic:{icon:c.Italic,label:`Italique`,shortcut:`Ctrl+I`,action:e=>u(e,e=>e.toggleItalic().run()),isActive:e=>d(e,`italic`)},underline:{icon:c.Underline,label:`Souligné`,shortcut:`Ctrl+U`,action:e=>u(e,e=>e.toggleUnderline().run()),isActive:e=>d(e,`underline`)},strikethrough:{icon:c.Strikethrough,label:`Barré`,shortcut:`Ctrl+Shift+S`,action:e=>u(e,e=>e.toggleStrike().run()),isActive:e=>d(e,`strikethrough`)},code:{icon:c.Code,label:`Code`,shortcut:`Ctrl+E`,action:e=>u(e,e=>e.toggleCode().run()),isActive:e=>d(e,`code`)},highlight:{icon:c.Highlighter,label:`Surligné`,action:e=>u(e,e=>e.toggleHighlight().run()),isActive:e=>d(e,`highlight`)},h1:{icon:c.Heading1,label:`Titre 1`,action:e=>{try{e.tf.h1.toggle()}catch{u(e,e=>e.toggleHeading({level:1}).run())}},isActive:e=>d(e,`heading`,{level:1})},h2:{icon:c.Heading2,label:`Titre 2`,action:e=>{try{e.tf.h2.toggle()}catch{u(e,e=>e.toggleHeading({level:2}).run())}},isActive:e=>d(e,`heading`,{level:2})},h3:{icon:c.Heading3,label:`Titre 3`,action:e=>{try{e.tf.h3.toggle()}catch{u(e,e=>e.toggleHeading({level:3}).run())}},isActive:e=>d(e,`heading`,{level:3})},blockquote:{icon:c.Quote,label:`Citation`,action:e=>{try{e.tf.blockquote.toggle()}catch{u(e,e=>e.toggleBlockquote().run())}},isActive:e=>d(e,`blockquote`)},callout:{icon:c.MessageSquarePlus,label:`Callout`,action:e=>{try{e.tf.callout.insert()}catch{}},isActive:e=>d(e,`callout`)},table:{icon:c.Table,label:`Tableau`,action:e=>{try{e.tf.table.insert({rows:3,cols:3})}catch{}},isActive:e=>d(e,`table`)},columns:{icon:c.Columns2,label:`Colonnes`,action:e=>{try{e.tf.column.insert()}catch{}},isActive:e=>d(e,`column_group`)},link:{icon:c.Link,label:`Lien`,shortcut:`Ctrl+K`,action:e=>{try{e.tf.link.toggle()}catch{}},isActive:e=>d(e,`a`)},image:{icon:c.Image,label:`Image`,action:e=>{try{e.tf.image.insert({url:``})}catch{}},isActive:()=>!1},separator:{icon:c.Minus,label:`Séparateur`,action:e=>{try{u(e,e=>e.insertBreak().run())}catch{}},isActive:()=>!1},ai:{icon:c.Sparkles,label:`Assistant IA`,action:()=>{},isActive:()=>!1}},p=[[`bold`,`italic`,`underline`,`strikethrough`,`code`,`highlight`],[`h1`,`h2`,`h3`],[`blockquote`,`callout`,`table`,`columns`],[`link`,`image`,`separator`]];function m({groups:e=p,editor:r,className:a,enableAI:o=!1,onAIClick:c}){let u=s.useMemo(()=>o?[...e,[`ai`]]:e,[e,o]);return(0,l.jsx)(n.l,{delayDuration:300,children:(0,l.jsx)(`div`,{role:`toolbar`,"aria-label":`Barre d'outils de formatage`,className:t.t(`flex flex-wrap items-center gap-0.5 p-1`,`border-b bg-muted/30`,a),children:u.map((e,t)=>(0,l.jsxs)(s.Fragment,{children:[t>0&&(0,l.jsx)(i.t,{orientation:`vertical`,className:`mx-1 h-6`}),e.map(e=>{let t=f[e];if(!t)return null;let a=t.isActive?.(r)??!1,o=t.shortcut?`${t.label} (${t.shortcut})`:t.label,s=t.icon;return(0,l.jsxs)(n.s,{children:[(0,l.jsx)(n.u,{asChild:!0,children:(0,l.jsx)(i.n,{type:`button`,variant:a?`secondary`:`ghost`,size:`icon`,className:`h-7 w-7`,onClick:()=>{if(e===`ai`&&c){c();return}t.action(r)},"aria-label":t.label,"aria-pressed":a,children:(0,l.jsx)(s,{className:`h-4 w-4`})})}),(0,l.jsx)(n.c,{side:`bottom`,className:`text-xs`,children:o})]},e)})]},t))})})}m.displayName=`WakaEditorToolbar`;var h=s.forwardRef(({value:e,onChange:t,readOnly:n=!1,placeholder:r=`Commencez a ecrire...`,className:i,editorClassName:a,minHeight:o=200,label:c,description:u,error:d,preset:f=`standard`,enableAI:m=!1,enableMarkdown:h=!1,enableMedia:v=!1,enableMentions:y=!1,enableDnD:b=!1,enableTOC:x=!1,toolbarGroups:S=p,hideToolbar:C=!1,onAIClick:w,extraPlugins:T,editorRef:E},D)=>{let[O,k]=s.useState(null),[A,j]=s.useState(!1);return s.useEffect(()=>{let e=!1;return(async()=>{try{let[t,n]=await Promise.all([import(`platejs/react`),Promise.resolve().then(()=>require(`./waka-editor-plugins-DO4BF3o_.js`)).then(e=>e.g)]),r=await n.loadCorePlugins(),i=n.getPresetLoaders(f),a=await Promise.all(i.map(e=>e())),o=[];h&&o.push(n.loadMarkdownPlugin()),v&&o.push(n.loadMediaPlugins()),y&&o.push(n.loadMentionPlugins()),b&&o.push(n.loadDndPlugin()),x&&o.push(n.loadTocPlugin());let s=await Promise.all(o),c=[...r,...a.flat(),...s.flat(),...T??[]];e||k({components:{Plate:t.Plate,PlateContent:t.PlateContent,usePlateEditor:t.usePlateEditor},plugins:c})}catch{e||j(!0)}})(),()=>{e=!0}},[f,h,v,y,b,x,T]),O?(0,l.jsx)(g,{ref:D,components:O.components,plugins:O.plugins,value:e,onChange:t,readOnly:n,placeholder:r,className:i,editorClassName:a,minHeight:o,label:c,description:u,error:d,enableAI:m,toolbarGroups:S,hideToolbar:C,onAIClick:w,editorRef:E}):(0,l.jsx)(_,{ref:D,value:e,onChange:t,placeholder:r,className:i,minHeight:o,label:c,description:u,error:d,loading:!A,readOnly:n})});h.displayName=`WakaEditor`;var g=s.forwardRef(({components:{Plate:e,PlateContent:n,usePlateEditor:r},plugins:i,value:o,onChange:c,readOnly:u=!1,placeholder:d,className:f,editorClassName:p,minHeight:h,label:g,description:_,error:v,enableAI:y,toolbarGroups:b,hideToolbar:x,onAIClick:S,editorRef:C},w)=>{let T=r({plugins:i,value:o??[{type:`p`,children:[{text:``}]}]});return s.useEffect(()=>{C&&(C.current=T)},[T,C]),(0,l.jsxs)(`div`,{ref:w,className:t.t(`space-y-1.5`,f),children:[g&&(0,l.jsx)(a.n,{children:g}),_&&(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:_}),(0,l.jsx)(e,{editor:T,onChange:c?({value:e})=>c(e):void 0,readOnly:u,children:(0,l.jsxs)(`div`,{className:t.t(`border rounded-lg overflow-hidden`,v&&`border-destructive`,u&&`opacity-80`),children:[!x&&!u&&(0,l.jsx)(m,{editor:T,groups:b,enableAI:y,onAIClick:S}),(0,l.jsx)(`div`,{style:{minHeight:h},children:(0,l.jsx)(n,{placeholder:d,readOnly:u,className:t.t(`prose prose-sm max-w-none p-3`,`focus-within:outline-none`,`[&_[data-slate-editor]]:outline-none [&_[data-slate-editor]]:min-h-[inherit]`,p)})})]})}),v&&(0,l.jsx)(`p`,{className:`text-sm text-destructive`,children:v})]})});g.displayName=`PlateEditorInner`;var _=s.forwardRef(({value:e,onChange:n,placeholder:r,className:i,minHeight:o,label:c,description:u,error:d,loading:f,readOnly:p},m)=>{let h=s.useMemo(()=>{if(!e)return``;let t=e=>e.map(e=>typeof e.text==`string`?e.text:e.children?t(e.children):``).join(`
2
+ `);return t(e)},[e]);return(0,l.jsxs)(`div`,{ref:m,className:t.t(`space-y-1.5`,i),children:[c&&(0,l.jsx)(a.n,{children:c}),u&&(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:u}),(0,l.jsxs)(`div`,{className:`relative`,children:[(0,l.jsx)(a.t,{value:h,onChange:e=>{n?.([{type:`p`,children:[{text:e.target.value}]}])},placeholder:r,disabled:f||p,style:{minHeight:o},className:t.t(d&&`border-destructive`)}),f&&(0,l.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-background/50 rounded-lg`,children:(0,l.jsx)(`span`,{className:`text-sm text-muted-foreground animate-pulse`,children:`Chargement de l'editeur...`})})]}),d&&(0,l.jsx)(`p`,{className:`text-sm text-destructive`,children:d})]})});_.displayName=`FallbackEditor`;function v(e,t){try{t(e)}catch{}}function y(e,t){try{return e.isActive(t)}catch{return!1}}var b=[{key:`bold`,icon:c.Bold,label:`Gras`,shortcut:`Ctrl+B`,action:e=>v(e,e=>e.chain().focus().toggleBold().run()),isActive:e=>y(e,`bold`)},{key:`italic`,icon:c.Italic,label:`Italique`,shortcut:`Ctrl+I`,action:e=>v(e,e=>e.chain().focus().toggleItalic().run()),isActive:e=>y(e,`italic`)},{key:`underline`,icon:c.Underline,label:`Souligne`,shortcut:`Ctrl+U`,action:e=>v(e,e=>e.chain().focus().toggleUnderline().run()),isActive:e=>y(e,`underline`)},{key:`strikethrough`,icon:c.Strikethrough,label:`Barre`,action:e=>v(e,e=>e.chain().focus().toggleStrike().run()),isActive:e=>y(e,`strikethrough`)},{key:`code`,icon:c.Code,label:`Code`,shortcut:`Ctrl+E`,action:e=>v(e,e=>e.chain().focus().toggleCode().run()),isActive:e=>y(e,`code`)},{key:`highlight`,icon:c.Highlighter,label:`Surligner`,action:e=>v(e,e=>e.chain().focus().toggleHighlight().run()),isActive:e=>y(e,`highlight`)},{key:`link`,icon:c.Link,label:`Lien`,shortcut:`Ctrl+K`,action:e=>{try{e.tf.link.toggle()}catch{}},isActive:e=>y(e,`a`)}],x=s.forwardRef(({editor:e,buttons:t=b,enableAI:n=!1,onAIClick:r,className:i,disableFloating:a=!1},o)=>{let[u,d]=s.useState(null);s.useEffect(()=>{a||import(`@platejs/floating`).then(e=>{e.useFloatingToolbar&&d(()=>e.useFloatingToolbar)}).catch(()=>{})},[a]);let f=s.useMemo(()=>n?[...t,{key:`ai`,icon:c.Sparkles,label:`Demander a l'IA`,action:()=>r?.(),isActive:()=>!1}]:t,[t,n,r]);return u?(0,l.jsx)(w,{ref:o,editor:e,buttons:f,className:i,floatingHook:u}):(0,l.jsx)(C,{ref:o,editor:e,buttons:f,className:i})});x.displayName=`WakaFloatingToolbar`;function S({toolbarRef:e,toolbarProps:n,hidden:r,buttons:i,editor:a,className:o}){return r?null:(0,l.jsx)(`div`,{ref:e,...n??{},className:t.t(`flex items-center gap-0.5 p-1`,`rounded-lg border bg-popover shadow-lg`,`animate-in fade-in-0 zoom-in-95`,o),role:`toolbar`,"aria-label":`Barre d'outils flottante`,children:i.map(e=>{let n=e.isActive?.(a)??!1,r=e.icon;return(0,l.jsx)(`button`,{type:`button`,title:e.shortcut?`${e.label} (${e.shortcut})`:e.label,"aria-label":e.label,"aria-pressed":n,className:t.t(`inline-flex h-7 w-7 items-center justify-center rounded-md`,`text-sm transition-colors`,n?`bg-accent text-accent-foreground`:`hover:bg-accent/50 text-foreground/70 hover:text-foreground`),onMouseDown:t=>{t.preventDefault(),e.action(a)},children:(0,l.jsx)(r,{className:`h-3.5 w-3.5`})},e.key)})})}var C=s.forwardRef(({editor:e,buttons:t,className:n},r)=>(0,l.jsx)(S,{toolbarRef:r,buttons:t,editor:e,className:n}));C.displayName=`FloatingToolbarStatic`;var w=s.forwardRef(({editor:e,buttons:t,className:n,floatingHook:r},i)=>{let a=r({editor:e});return(0,l.jsx)(S,{toolbarRef:s.useCallback(e=>{typeof i==`function`?i(e):i&&(i.current=e),a.ref&&(typeof a.ref==`function`?a.ref(e):a.ref.current=e)},[i,a.ref]),toolbarProps:a.props,hidden:a.hidden,buttons:t,editor:e,className:n})});w.displayName=`FloatingToolbarPositioned`;var T=[{key:`h1`,label:`Titre 1`,description:`Titre principal de section`,icon:c.Heading1,group:`Blocs de base`,keywords:[`heading`,`titre`,`h1`],action:e=>{try{e.tf.h1.toggle()}catch{}}},{key:`h2`,label:`Titre 2`,description:`Sous-titre de section`,icon:c.Heading2,group:`Blocs de base`,keywords:[`heading`,`titre`,`h2`],action:e=>{try{e.tf.h2.toggle()}catch{}}},{key:`h3`,label:`Titre 3`,description:`Titre de sous-section`,icon:c.Heading3,group:`Blocs de base`,keywords:[`heading`,`titre`,`h3`],action:e=>{try{e.tf.h3.toggle()}catch{}}},{key:`bulletList`,label:`Liste a puces`,description:`Liste non ordonnee`,icon:c.List,group:`Blocs de base`,keywords:[`bullet`,`list`,`unordered`,`puces`],action:e=>{try{e.chain().focus().toggleBulletList().run()}catch{}}},{key:`numberedList`,label:`Liste numerotee`,description:`Liste ordonnee`,icon:c.ListOrdered,group:`Blocs de base`,keywords:[`numbered`,`list`,`ordered`,`numerotee`],action:e=>{try{e.chain().focus().toggleOrderedList().run()}catch{}}},{key:`blockquote`,label:`Citation`,description:`Bloc de citation`,icon:c.Quote,group:`Blocs de base`,keywords:[`quote`,`citation`,`blockquote`],action:e=>{try{e.tf.blockquote.toggle()}catch{}}},{key:`table`,label:`Tableau`,description:`Inserer un tableau 3x3`,icon:c.Table,group:`Blocs avances`,keywords:[`table`,`tableau`,`grid`],action:e=>{try{e.tf.table.insert({rows:3,cols:3})}catch{}}},{key:`columns`,label:`Colonnes`,description:`Mise en page multi-colonnes`,icon:c.Columns2,group:`Blocs avances`,keywords:[`column`,`colonne`,`layout`,`mise en page`],action:e=>{try{e.tf.column.insert()}catch{}}},{key:`callout`,label:`Callout`,description:`Encart d'information colore`,icon:c.MessageSquarePlus,group:`Blocs avances`,keywords:[`callout`,`alert`,`info`,`encart`],action:e=>{try{e.tf.callout.insert()}catch{}}},{key:`codeBlock`,label:`Bloc de code`,description:`Code source avec coloration`,icon:c.Code,group:`Blocs avances`,keywords:[`code`,`pre`,`source`],action:e=>{try{e.chain().focus().toggleCodeBlock().run()}catch{}}},{key:`link`,label:`Lien`,description:`Inserer un lien hypertexte`,icon:c.Link,group:`Insertions`,keywords:[`link`,`lien`,`url`,`href`],action:e=>{try{e.tf.link.toggle()}catch{}}},{key:`image`,label:`Image`,description:`Inserer une image`,icon:c.Image,group:`Insertions`,keywords:[`image`,`photo`,`picture`,`img`],action:e=>{try{e.tf.image.insert({url:``})}catch{}}},{key:`divider`,label:`Separateur`,description:`Ligne horizontale de separation`,icon:c.Minus,group:`Insertions`,keywords:[`divider`,`separator`,`hr`,`line`],action:e=>{try{e.chain().focus().insertBreak().run()}catch{}}},{key:`ai`,label:`Demander a l'IA`,description:`Generer du contenu avec l'assistant IA`,icon:c.Sparkles,group:`IA`,keywords:[`ai`,`ia`,`assistant`,`generate`,`generer`],action:()=>{}}];function E({commands:e=T,className:n,onSelect:r}){let[i,a]=s.useState(``),[o,c]=s.useState(0),u=s.useRef(null),d=s.useMemo(()=>{if(!i)return e;let t=i.toLowerCase();return e.filter(e=>e.label.toLowerCase().includes(t)||e.key.toLowerCase().includes(t)||e.keywords?.some(e=>e.toLowerCase().includes(t)))},[e,i]),f=s.useMemo(()=>{let e=new Map;for(let t of d){let n=t.group||`Autre`;e.has(n)||e.set(n,[]),e.get(n).push(t)}return e},[d]),p=s.useMemo(()=>d,[d]),m=s.useCallback(e=>{e.key===`ArrowDown`?(e.preventDefault(),c(e=>Math.min(e+1,p.length-1))):e.key===`ArrowUp`?(e.preventDefault(),c(e=>Math.max(e-1,0))):e.key===`Enter`&&p[o]&&(e.preventDefault(),r?.(p[o].key))},[p,o,r]);return s.useEffect(()=>c(0),[i]),(0,l.jsxs)(`div`,{ref:u,className:t.t(`w-72 max-h-80 overflow-y-auto`,`rounded-lg border bg-popover shadow-lg`,`p-1`,n),role:`listbox`,onKeyDown:m,children:[(0,l.jsx)(`div`,{className:`px-2 pb-1.5`,children:(0,l.jsx)(`input`,{type:`text`,value:i,onChange:e=>a(e.target.value),placeholder:`Rechercher...`,className:t.t(`w-full rounded-md border bg-background px-2 py-1.5`,`text-sm placeholder:text-muted-foreground`,`focus:outline-none focus:ring-1 focus:ring-ring`),autoFocus:!0})}),p.length===0&&(0,l.jsx)(`div`,{className:`px-2 py-4 text-center text-sm text-muted-foreground`,children:`Aucune commande trouvee`}),Array.from(f.entries()).map(([e,n])=>(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`div`,{className:`px-2 py-1 text-xs font-semibold text-muted-foreground uppercase tracking-wider`,children:e}),n.map(e=>{let n=p.indexOf(e),i=e.icon;return(0,l.jsxs)(`button`,{role:`option`,"aria-selected":n===o,className:t.t(`flex w-full items-center gap-3 rounded-md px-2 py-1.5 text-left`,`text-sm transition-colors cursor-pointer`,n===o?`bg-accent text-accent-foreground`:`hover:bg-accent/50`),onMouseEnter:()=>c(n),onClick:()=>r?.(e.key),children:[(0,l.jsx)(`div`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-md border bg-background`,children:(0,l.jsx)(i,{className:`h-4 w-4`})}),(0,l.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,l.jsx)(`div`,{className:`font-medium`,children:e.label}),e.description&&(0,l.jsx)(`div`,{className:`text-xs text-muted-foreground truncate`,children:e.description})]})]},e.key)})]},e))]})}E.displayName=`WakaSlashMenu`;async function D(e=T){try{let{SlashPlugin:t,SlashInputPlugin:n}=await import(`@platejs/combobox/react`);return[t.configure({options:{trigger:`/`,triggerPreviousCharPattern:/^$|^[\s"']$/,rules:e.map(e=>({key:e.key,text:e.label,keywords:e.keywords,onSelect:e.action}))}}),n]}catch{return console.warn(`[WakaSlashMenu] @platejs/combobox not installed, slash commands disabled`),[]}}var O=[{key:`continue`,label:`Continuer la redaction`,prompt:`Continue writing the following text naturally:
3
3
 
4
4
  {{selection}}`,group:`Generer`},{key:`summarize`,label:`Resumer`,prompt:`Summarize the following text concisely:
5
5
 
@@ -25,8 +25,8 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
25
25
 
26
26
  {{selection}}`,group:`Traduire`},{key:`translate-de`,label:`Traduire en allemand`,prompt:`Translate the following text to German:
27
27
 
28
- {{selection}}`,group:`Traduire`}],D=s.forwardRef(({value:e,onChange:n,aiEndpoint:r,systemPrompt:i=`You are an advanced AI writing assistant. Help the user write, edit, and improve their content.`,aiActions:o=E,enableCopilot:c=!0,copilotDebounceMs:u=500,aiHeaders:d,readOnly:f=!1,placeholder:p=`Tapez / pour les commandes, ou commencez a ecrire...`,className:m,editorClassName:h,minHeight:g=300,label:_,description:v,error:y,extraPlugins:b,editorRef:x},S)=>{let[C,w]=s.useState(null),[T,D]=s.useState(!1),k=s.useRef({aiEndpoint:r,systemPrompt:i,aiActions:o,enableCopilot:c,copilotDebounceMs:u,aiHeaders:d});return k.current={aiEndpoint:r,systemPrompt:i,aiActions:o,enableCopilot:c,copilotDebounceMs:u,aiHeaders:d},s.useEffect(()=>{let e=!1;return(async()=>{try{let[t,n,r,i,a,o,s,c,l,u]=await Promise.all([import(`platejs/react`),import(`@platejs/basic-nodes/react`),import(`@platejs/table/react`),import(`@platejs/layout/react`),import(`@platejs/callout/react`),import(`@platejs/ai/react`),import(`@platejs/markdown`),import(`@platejs/selection/react`),import(`@platejs/link/react`),import(`@platejs/indent/react`)]),d=k.current,f=[n.BoldPlugin,n.ItalicPlugin,n.UnderlinePlugin,n.StrikethroughPlugin,n.CodePlugin,n.HighlightPlugin,n.H1Plugin,n.H2Plugin,n.H3Plugin,n.H4Plugin,n.BlockquotePlugin,r.TablePlugin,r.TableRowPlugin,r.TableCellPlugin,r.TableCellHeaderPlugin,i.ColumnPlugin,i.ColumnItemPlugin,a.CalloutPlugin,l.LinkPlugin.configure({options:{allowedSchemes:[`http`,`https`,`mailto`,`tel`]}}),u.IndentPlugin,c.BlockSelectionPlugin,s.MarkdownPlugin,o.AIPlugin,o.AIChatPlugin.configure({options:{chat:{api:d.aiEndpoint,body:{system:d.systemPrompt},headers:d.aiHeaders}}})];d.enableCopilot&&o.CopilotPlugin&&f.push(o.CopilotPlugin.configure(({api:e})=>({options:{completeOptions:{api:d.aiEndpoint,body:{system:d.systemPrompt},headers:d.aiHeaders,onFinish:(t,n)=>{n!==`0`&&e.copilot.setBlockSuggestion({text:n})}},debounceDelay:d.copilotDebounceMs},shortcuts:{accept:{keys:`tab`},acceptNextWord:{keys:`mod+right`},reject:{keys:`escape`},triggerSuggestion:{keys:`ctrl+space`}}}))),e||w({Plate:t.Plate,PlateContent:t.PlateContent,usePlateEditor:t.usePlateEditor,plugins:f})}catch(t){console.error(`[WakaAIWriter] Failed to load plugins:`,t),e||D(!0)}})(),()=>{e=!0}},[]),C?(0,l.jsx)(O,{ref:S,bundle:C,value:e,onChange:n,readOnly:f,placeholder:p,className:m,editorClassName:h,minHeight:g,label:_,description:v,error:y,extraPlugins:b,editorRef:x}):(0,l.jsxs)(`div`,{ref:S,className:t.t(`space-y-1.5`,m),children:[_&&(0,l.jsx)(a.n,{children:_}),v&&(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:v}),(0,l.jsxs)(`div`,{className:`relative`,children:[(0,l.jsx)(a.t,{placeholder:p,disabled:!0,style:{minHeight:g},className:t.t(y&&`border-destructive`)}),(0,l.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-background/50 rounded-lg`,children:(0,l.jsx)(`span`,{className:`text-sm text-muted-foreground animate-pulse`,children:T?`Erreur de chargement de l'editeur IA`:`Chargement de l'editeur IA...`})})]}),y&&(0,l.jsx)(`p`,{className:`text-sm text-destructive`,children:y})]})});D.displayName=`WakaAIWriter`;var O=s.forwardRef(({bundle:{Plate:e,PlateContent:n,usePlateEditor:r,plugins:i},value:o,onChange:c,readOnly:u,placeholder:d,className:f,editorClassName:p,minHeight:m,label:h,description:g,error:_,extraPlugins:v,editorRef:y},b)=>{let x=r({plugins:s.useMemo(()=>[...i,...v??[]],[i,v]),value:o??[{type:`p`,children:[{text:``}]}]});return s.useEffect(()=>{y&&(y.current=x)},[x,y]),(0,l.jsxs)(`div`,{ref:b,className:t.t(`space-y-1.5`,f),children:[h&&(0,l.jsx)(a.n,{children:h}),g&&(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:g}),(0,l.jsx)(e,{editor:x,onChange:c?({value:e})=>c(e):void 0,readOnly:u,children:(0,l.jsxs)(`div`,{className:t.t(`border rounded-lg overflow-hidden`,_&&`border-destructive`,u&&`opacity-80`),children:[!u&&(0,l.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5 border-b bg-muted/30 text-xs text-muted-foreground`,children:[(0,l.jsx)(`kbd`,{className:`rounded border bg-muted px-1.5 py-0.5 font-mono text-[10px]`,children:`Ctrl+J`}),(0,l.jsx)(`span`,{children:`Ouvrir le menu IA`}),(0,l.jsx)(`span`,{className:`mx-1`,children:`|`}),(0,l.jsx)(`kbd`,{className:`rounded border bg-muted px-1.5 py-0.5 font-mono text-[10px]`,children:`/`}),(0,l.jsx)(`span`,{children:`Commandes`}),(0,l.jsx)(`span`,{className:`mx-1`,children:`|`}),(0,l.jsx)(`kbd`,{className:`rounded border bg-muted px-1.5 py-0.5 font-mono text-[10px]`,children:`Ctrl+Espace`}),(0,l.jsx)(`span`,{children:`Copilot`})]}),(0,l.jsx)(`div`,{style:{minHeight:m},children:(0,l.jsx)(n,{placeholder:d,readOnly:u,className:t.t(`prose prose-sm max-w-none p-4`,`focus-within:outline-none`,`[&_[data-slate-editor]]:outline-none [&_[data-slate-editor]]:min-h-[inherit]`,p)})})]})}),_&&(0,l.jsx)(`p`,{className:`text-sm text-destructive`,children:_})]})});O.displayName=`AIWriterInner`,t.n();var k=s.forwardRef(({value:e,onChange:n,readOnly:r=!1,placeholder:i=`Commencez a rediger votre document...`,className:o,editorClassName:c,minHeight:u=500,label:d,description:f,error:p,title:m,onTitleChange:h,showTOC:g=!0,enableMentions:_=!1,enableSlashCommands:v=!1,enableAI:y=!1,aiEndpoint:b,aiSystemPrompt:x,enableDnD:S=!1,enableMarkdown:C=!0,extraPlugins:w,editorRef:T},E)=>{let[D,O]=s.useState(null),[k,M]=s.useState(!1),[ee,te]=s.useState([]),N=s.useRef({enableMentions:_,enableSlashCommands:v,enableAI:y,enableDnD:S,enableMarkdown:C,aiEndpoint:b,aiSystemPrompt:x});return N.current={enableMentions:_,enableSlashCommands:v,enableAI:y,enableDnD:S,enableMarkdown:C,aiEndpoint:b,aiSystemPrompt:x},s.useEffect(()=>{let e=!1;return(async()=>{try{let t=N.current,[n,r,i,a,o,s,c]=await Promise.all([import(`platejs/react`),import(`@platejs/basic-nodes/react`),import(`@platejs/table/react`),import(`@platejs/layout/react`),import(`@platejs/callout/react`),import(`@platejs/link/react`),import(`@platejs/indent/react`)]),l=[r.BoldPlugin,r.ItalicPlugin,r.UnderlinePlugin,r.StrikethroughPlugin,r.CodePlugin,r.HighlightPlugin,r.SuperscriptPlugin,r.SubscriptPlugin,r.H1Plugin,r.H2Plugin,r.H3Plugin,r.H4Plugin,r.H5Plugin,r.H6Plugin,r.BlockquotePlugin,i.TablePlugin,i.TableRowPlugin,i.TableCellPlugin,i.TableCellHeaderPlugin,a.ColumnPlugin,a.ColumnItemPlugin,o.CalloutPlugin,s.LinkPlugin.configure({options:{allowedSchemes:[`http`,`https`,`mailto`,`tel`]}}),c.IndentPlugin];try{let{TocPlugin:e}=await import(`@platejs/toc/react`);l.push(e)}catch{}try{let{BlockSelectionPlugin:e}=await import(`@platejs/selection/react`);l.push(e)}catch{}if(t.enableMentions)try{let{MentionPlugin:e,MentionInputPlugin:t}=await import(`@platejs/mention/react`);l.push(e.configure({options:{trigger:`@`,triggerPreviousCharPattern:/^$|^[\s"']$/,insertSpaceAfterMention:!0}}),t)}catch{}if(t.enableDnD)try{let{DndPlugin:e}=await import(`@platejs/dnd/react`);l.push(e)}catch{}if(t.enableMarkdown)try{let{MarkdownPlugin:e}=await import(`@platejs/markdown`);l.push(e)}catch{}if(t.enableAI&&t.aiEndpoint)try{let{AIPlugin:e,AIChatPlugin:n}=await import(`@platejs/ai/react`);l.push(e,n.configure({options:{chat:{api:t.aiEndpoint,body:{system:t.aiSystemPrompt??`You are a helpful writing assistant.`}}}}))}catch{}e||O({Plate:n.Plate,PlateContent:n.PlateContent,usePlateEditor:n.usePlateEditor,plugins:l})}catch(t){console.error(`[WakaDocumentEditor] Failed to load:`,t),e||M(!0)}})(),()=>{e=!0}},[]),s.useEffect(()=>{if(!g||!e){te([]);return}let t=[],n=0,r=new Set([`h1`,`h2`,`h3`,`h4`,`h5`,`h6`]);for(let i of e)if(r.has(i?.type)){let e=j(i);if(e.trim()){let r=parseInt(i.type.replace(`h`,``),10);t.push({id:`toc-${n++}`,text:e.trim(),level:r,depth:r-1})}}te(t)},[e,g]),D?(0,l.jsx)(A,{ref:E,bundle:D,value:e,onChange:n,readOnly:r,placeholder:i,className:o,editorClassName:c,minHeight:u,label:d,description:f,error:p,title:m,onTitleChange:h,showTOC:g,toc:ee,extraPlugins:w,editorRef:T}):(0,l.jsxs)(`div`,{ref:E,className:t.t(`space-y-1.5`,o),children:[d&&(0,l.jsx)(a.n,{children:d}),f&&(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:f}),(0,l.jsxs)(`div`,{className:`relative`,children:[(0,l.jsx)(a.t,{placeholder:i,disabled:!0,style:{minHeight:u}}),(0,l.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-background/50 rounded-lg`,children:(0,l.jsx)(`span`,{className:`text-sm text-muted-foreground animate-pulse`,children:k?`Erreur de chargement de l'editeur`:`Chargement de l'editeur...`})})]}),p&&(0,l.jsx)(`p`,{className:`text-sm text-destructive`,children:p})]})});k.displayName=`WakaDocumentEditor`;var A=s.forwardRef(({bundle:{Plate:e,PlateContent:r,usePlateEditor:i,plugins:o},value:c,onChange:u,readOnly:d,placeholder:f,className:p,editorClassName:m,minHeight:h,label:g,description:_,error:v,title:y,onTitleChange:b,showTOC:x,toc:S,extraPlugins:C,editorRef:w},T)=>{let E=i({plugins:s.useMemo(()=>[...o,...C??[]],[o,C]),value:c??[{type:`p`,children:[{text:``}]}]});return s.useEffect(()=>{w&&(w.current=E)},[E,w]),(0,l.jsxs)(`div`,{ref:T,className:t.t(`space-y-1.5`,p),children:[g&&(0,l.jsx)(a.n,{children:g}),_&&(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:_}),(0,l.jsx)(e,{editor:E,onChange:u?({value:e})=>u(e):void 0,readOnly:d,children:(0,l.jsxs)(`div`,{className:t.t(`flex border rounded-lg overflow-hidden`,v&&`border-destructive`),children:[x&&S.length>0&&(0,l.jsxs)(`aside`,{className:`w-56 shrink-0 border-r bg-muted/20 hidden lg:block`,children:[(0,l.jsx)(`div`,{className:`p-3 border-b`,children:(0,l.jsx)(`h4`,{className:`text-xs font-bold uppercase tracking-wider text-muted-foreground`,children:`Table des matieres`})}),(0,l.jsx)(n.f,{className:`h-full max-h-[600px]`,children:(0,l.jsx)(`nav`,{className:`p-2 space-y-0.5`,children:S.map(e=>(0,l.jsx)(`button`,{className:t.t(`block w-full text-left px-2 py-1 rounded-md text-sm`,`hover:bg-accent/50 transition-colors truncate`,`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${e.depth*12+8}px`},title:e.text,children:e.text},e.id))})})]}),(0,l.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(y!==void 0||b)&&(0,l.jsx)(`div`,{className:`border-b px-6 py-4`,children:(0,l.jsx)(`input`,{type:`text`,value:y??``,onChange:e=>b?.(e.target.value),placeholder:`Titre du document`,readOnly:d,className:t.t(`w-full bg-transparent text-2xl font-bold text-foreground`,`placeholder:text-muted-foreground/50`,`focus:outline-none`)})}),(0,l.jsx)(`div`,{style:{minHeight:h},children:(0,l.jsx)(r,{placeholder:f,readOnly:d,className:t.t(`prose prose-sm max-w-none px-6 py-4`,`focus-within:outline-none`,`[&_[data-slate-editor]]:outline-none [&_[data-slate-editor]]:min-h-[inherit]`,m)})})]})]})}),v&&(0,l.jsx)(`p`,{className:`text-sm text-destructive`,children:v})]})});A.displayName=`DocumentEditorInner`;function j(e){return typeof e?.text==`string`?e.text:Array.isArray(e?.children)?e.children.map(e=>j(e)).join(``):``}t.n();var M=s.forwardRef(({markdownValue:e=``,onMarkdownChange:n,slateValue:r,onSlateChange:o,defaultMode:c=`rich`,readOnly:u=!1,placeholder:d=`Commencez a ecrire...`,className:f,editorClassName:p,minHeight:m=300,label:h,description:g,error:_,extraPlugins:v,editorRef:y},b)=>{let[x,S]=s.useState(c),[C,w]=s.useState(null),[T,E]=s.useState(!1),[D,O]=s.useState(e);s.useEffect(()=>{O(e)},[e]),s.useEffect(()=>{let e=!1;return(async()=>{try{let[t,n,r,i,a,o,s]=await Promise.all([import(`platejs/react`),import(`@platejs/basic-nodes/react`),import(`@platejs/table/react`),import(`@platejs/layout/react`),import(`@platejs/callout/react`),import(`@platejs/link/react`),import(`@platejs/markdown`)]),c=[n.BoldPlugin,n.ItalicPlugin,n.UnderlinePlugin,n.StrikethroughPlugin,n.CodePlugin,n.HighlightPlugin,n.H1Plugin,n.H2Plugin,n.H3Plugin,n.H4Plugin,n.BlockquotePlugin,r.TablePlugin,r.TableRowPlugin,r.TableCellPlugin,r.TableCellHeaderPlugin,i.ColumnPlugin,i.ColumnItemPlugin,a.CalloutPlugin,o.LinkPlugin.configure({options:{allowedSchemes:[`http`,`https`,`mailto`]}}),s.MarkdownPlugin];e||w({Plate:t.Plate,PlateContent:t.PlateContent,usePlateEditor:t.usePlateEditor,plugins:c,serializeMd:s.serializeMd,deserializeMd:s.deserializeMd})}catch(t){console.error(`[WakaMarkdownEditor] Failed to load:`,t),e||E(!0)}})(),()=>{e=!0}},[]);let k=(0,l.jsx)(`div`,{className:`flex items-center gap-1 p-1 border-b bg-muted/30`,children:[`rich`,`markdown`,`split`].map(e=>(0,l.jsx)(i.n,{type:`button`,variant:x===e?`secondary`:`ghost`,size:`sm`,className:`h-7 text-xs`,onClick:()=>S(e),children:e===`rich`?`Editeur`:e===`markdown`?`Markdown`:`Split`},e))}),A=s.useCallback(e=>{O(e),n?.(e)},[n]);return(0,l.jsxs)(`div`,{ref:b,className:t.t(`space-y-1.5`,f),children:[h&&(0,l.jsx)(a.n,{children:h}),g&&(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:g}),(0,l.jsxs)(`div`,{className:t.t(`border rounded-lg overflow-hidden`,_&&`border-destructive`),children:[!u&&k,x===`markdown`&&(0,l.jsx)(ee,{value:D,onChange:A,readOnly:u,placeholder:d,minHeight:m,className:p}),x===`rich`&&C&&(0,l.jsx)(te,{bundle:C,markdownValue:D,slateValue:r,onSlateChange:o,onMarkdownChange:n,readOnly:u,placeholder:d,minHeight:m,className:p,extraPlugins:v,editorRef:y}),x===`split`&&C&&(0,l.jsxs)(`div`,{className:`flex divide-x`,style:{minHeight:m},children:[(0,l.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,l.jsx)(te,{bundle:C,markdownValue:D,slateValue:r,onSlateChange:o,onMarkdownChange:n,readOnly:u,placeholder:d,minHeight:m,className:p,extraPlugins:v,editorRef:y})}),(0,l.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,l.jsx)(ee,{value:D,onChange:A,readOnly:u,placeholder:`Markdown...`,minHeight:m})})]}),!C&&x!==`markdown`&&(0,l.jsx)(`div`,{className:`relative`,style:{minHeight:m},children:(0,l.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-background/50`,children:(0,l.jsx)(`span`,{className:`text-sm text-muted-foreground animate-pulse`,children:T?`Erreur de chargement`:`Chargement...`})})})]}),_&&(0,l.jsx)(`p`,{className:`text-sm text-destructive`,children:_})]})});M.displayName=`WakaMarkdownEditor`;function ee({value:e,onChange:n,readOnly:r,placeholder:i,minHeight:o,className:s}){return(0,l.jsx)(a.t,{value:e,onChange:e=>n(e.target.value),readOnly:r,placeholder:i,style:{minHeight:o},className:t.t(`rounded-none border-0 resize-none font-mono text-sm`,`focus-visible:ring-0 focus-visible:ring-offset-0`,s)})}function te({bundle:{Plate:e,PlateContent:n,usePlateEditor:r,plugins:i,serializeMd:a},markdownValue:o,slateValue:c,onSlateChange:u,onMarkdownChange:d,readOnly:f,placeholder:p,minHeight:m,className:h,extraPlugins:g,editorRef:_}){let v=r({plugins:s.useMemo(()=>[...i,...g??[]],[i,g]),value:c??[{type:`p`,children:[{text:o||``}]}]});return s.useEffect(()=>{_&&(_.current=v)},[v,_]),(0,l.jsx)(e,{editor:v,onChange:s.useCallback(({value:e})=>{if(u?.(e),d&&a)try{d(a(v,{value:e}))}catch{}},[v,u,d,a]),readOnly:f,children:(0,l.jsx)(`div`,{style:{minHeight:m},children:(0,l.jsx)(n,{placeholder:p,readOnly:f,className:t.t(`prose prose-sm max-w-none p-4`,`focus-within:outline-none`,`[&_[data-slate-editor]]:outline-none [&_[data-slate-editor]]:min-h-[inherit]`,h)})})})}t.n();var N=[{key:`user-story`,label:`User Story`,description:`En tant que [role], je veux [action] afin de [benefice]`,icon:c.Users,category:`Fonctionnel`,createNodes:()=>[{type:`callout`,variant:`info`,children:[{text:``}]},{type:`h3`,children:[{text:`User Story`}]},{type:`p`,children:[{text:`En tant que `,bold:!0},{text:`[role]`}]},{type:`p`,children:[{text:`Je veux `,bold:!0},{text:`[action]`}]},{type:`p`,children:[{text:`Afin de `,bold:!0},{text:`[benefice attendu]`}]},{type:`p`,children:[{text:``}]}]},{key:`acceptance-criteria`,label:`Criteres d'acceptation`,description:`Given/When/Then avec scenarios de validation`,icon:c.CheckCircle2,category:`Fonctionnel`,createNodes:()=>[{type:`h3`,children:[{text:`Criteres d'acceptation`}]},{type:`table`,children:[{type:`tr`,children:[{type:`th`,children:[{type:`p`,children:[{text:`#`,bold:!0}]}]},{type:`th`,children:[{type:`p`,children:[{text:`Scenario`,bold:!0}]}]},{type:`th`,children:[{type:`p`,children:[{text:`Given`,bold:!0}]}]},{type:`th`,children:[{type:`p`,children:[{text:`When`,bold:!0}]}]},{type:`th`,children:[{type:`p`,children:[{text:`Then`,bold:!0}]}]}]},{type:`tr`,children:[{type:`td`,children:[{type:`p`,children:[{text:`AC-01`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Nominal`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`L'utilisateur est connecte`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Il clique sur le bouton`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Le resultat s'affiche`}]}]}]},{type:`tr`,children:[{type:`td`,children:[{type:`p`,children:[{text:`AC-02`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Erreur`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Le service est indisponible`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Il clique sur le bouton`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Un message d'erreur s'affiche`}]}]}]}]},{type:`p`,children:[{text:``}]}]},{key:`use-case`,label:`Cas d'utilisation`,description:`Acteur, pre-conditions, flux nominal, flux alternatifs`,icon:c.GitBranch,category:`Fonctionnel`,createNodes:()=>[{type:`h3`,children:[{text:`Cas d'utilisation : [Nom]`}]},{type:`column_group`,children:[{type:`column`,children:[{type:`h4`,children:[{text:`ACTEUR`}]},{type:`p`,children:[{text:`[Role utilisateur]`}]},{type:`h4`,children:[{text:`PRE-CONDITIONS`}]},{type:`p`,children:[{text:`- L'utilisateur est authentifie`}]},{type:`p`,children:[{text:`- [Autre condition]`}]},{type:`h4`,children:[{text:`POST-CONDITIONS`}]},{type:`p`,children:[{text:`- [Etat apres execution]`}]}]},{type:`column`,children:[{type:`h4`,children:[{text:`FLUX NOMINAL`}]},{type:`p`,children:[{text:`1. L'utilisateur accede a la page`}]},{type:`p`,children:[{text:`2. Le systeme affiche le formulaire`}]},{type:`p`,children:[{text:`3. L'utilisateur remplit et soumet`}]},{type:`p`,children:[{text:`4. Le systeme enregistre et confirme`}]},{type:`h4`,children:[{text:`FLUX ALTERNATIFS`}]},{type:`p`,children:[{text:`3a. Donnees invalides : erreur affichee`}]}]}]},{type:`p`,children:[{text:``}]}]},{key:`api-endpoint`,label:`Endpoint API`,description:`Specification d'un endpoint REST avec requete/reponse`,icon:c.Zap,category:`Technique`,createNodes:()=>[{type:`h3`,children:[{text:`API: [METHOD] /api/v1/[resource]`}]},{type:`table`,children:[{type:`tr`,children:[{type:`th`,children:[{type:`p`,children:[{text:`Propriete`,bold:!0}]}]},{type:`th`,children:[{type:`p`,children:[{text:`Valeur`,bold:!0}]}]}]},{type:`tr`,children:[{type:`td`,children:[{type:`p`,children:[{text:`Methode`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`GET | POST | PUT | DELETE`}]}]}]},{type:`tr`,children:[{type:`td`,children:[{type:`p`,children:[{text:`Authentification`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Bearer JWT`}]}]}]},{type:`tr`,children:[{type:`td`,children:[{type:`p`,children:[{text:`Permissions`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`[ROLE_REQUIRED]`}]}]}]},{type:`tr`,children:[{type:`td`,children:[{type:`p`,children:[{text:`Rate Limit`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`100 req/min`}]}]}]}]},{type:`h4`,children:[{text:`CORPS DE LA REQUETE`}]},{type:`blockquote`,children:[{text:`{ "field": "value" }`}]},{type:`h4`,children:[{text:`REPONSE 200`}]},{type:`blockquote`,children:[{text:`{ "data": { ... }, "meta": { "total": 42 } }`}]},{type:`p`,children:[{text:``}]}]},{key:`data-model`,label:`Modele de donnees`,description:`Schema d'entite avec champs, types et contraintes`,icon:c.Database,category:`Technique`,createNodes:()=>[{type:`h3`,children:[{text:`Modele : [NomEntite]`}]},{type:`table`,children:[{type:`tr`,children:[{type:`th`,children:[{type:`p`,children:[{text:`Champ`,bold:!0}]}]},{type:`th`,children:[{type:`p`,children:[{text:`Type`,bold:!0}]}]},{type:`th`,children:[{type:`p`,children:[{text:`Nullable`,bold:!0}]}]},{type:`th`,children:[{type:`p`,children:[{text:`Description`,bold:!0}]}]}]},{type:`tr`,children:[{type:`td`,children:[{type:`p`,children:[{text:`id`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`UUID`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Non`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Identifiant unique`}]}]}]},{type:`tr`,children:[{type:`td`,children:[{type:`p`,children:[{text:`createdAt`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`DateTime`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Non`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Date de creation`}]}]}]}]},{type:`p`,children:[{text:``}]}]},{key:`security-requirements`,label:`Exigences de securite`,description:`Regles OWASP, chiffrement, acces, conformite`,icon:c.Shield,category:`Non-fonctionnel`,createNodes:()=>[{type:`h3`,children:[{text:`Exigences de securite`}]},{type:`callout`,variant:`warning`,children:[{text:`Section obligatoire pour les modules HDS et les donnees sensibles`}]},{type:`table`,children:[{type:`tr`,children:[{type:`th`,children:[{type:`p`,children:[{text:`Categorie`,bold:!0}]}]},{type:`th`,children:[{type:`p`,children:[{text:`Exigence`,bold:!0}]}]},{type:`th`,children:[{type:`p`,children:[{text:`Niveau`,bold:!0}]}]}]},{type:`tr`,children:[{type:`td`,children:[{type:`p`,children:[{text:`Authentification`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`OAuth2 PKCE via Keycloak`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Obligatoire`}]}]}]},{type:`tr`,children:[{type:`td`,children:[{type:`p`,children:[{text:`Chiffrement`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`AES-256-GCM au repos, TLS 1.3 en transit`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Obligatoire`}]}]}]},{type:`tr`,children:[{type:`td`,children:[{type:`p`,children:[{text:`Audit`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`TracingInterceptor sur toutes les operations`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Obligatoire`}]}]}]}]},{type:`p`,children:[{text:``}]}]},{key:`risk-assessment`,label:`Risques et mitigations`,description:`Matrice de risques projet avec probabilite et impact`,icon:c.AlertTriangle,category:`Non-fonctionnel`,createNodes:()=>[{type:`h3`,children:[{text:`Analyse des risques`}]},{type:`table`,children:[{type:`tr`,children:[{type:`th`,children:[{type:`p`,children:[{text:`Risque`,bold:!0}]}]},{type:`th`,children:[{type:`p`,children:[{text:`Probabilite`,bold:!0}]}]},{type:`th`,children:[{type:`p`,children:[{text:`Impact`,bold:!0}]}]},{type:`th`,children:[{type:`p`,children:[{text:`Mitigation`,bold:!0}]}]}]},{type:`tr`,children:[{type:`td`,children:[{type:`p`,children:[{text:`[Description du risque]`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Moyen`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Haut`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`[Plan de mitigation]`}]}]}]}]},{type:`p`,children:[{text:``}]}]},{key:`spec-header`,label:`En-tete de specification`,description:`Bloc d'en-tete avec version, auteur, statut, date`,icon:c.BookOpen,category:`Document`,createNodes:()=>[{type:`h1`,children:[{text:`[Titre de la specification]`}]},{type:`table`,children:[{type:`tr`,children:[{type:`td`,children:[{type:`p`,children:[{text:`Version`,bold:!0}]}]},{type:`td`,children:[{type:`p`,children:[{text:`1.0.0`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Statut`,bold:!0}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Brouillon`}]}]}]},{type:`tr`,children:[{type:`td`,children:[{type:`p`,children:[{text:`Auteur`,bold:!0}]}]},{type:`td`,children:[{type:`p`,children:[{text:`[Nom]`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Date`,bold:!0}]}]},{type:`td`,children:[{type:`p`,children:[{text:new Date().toLocaleDateString(`fr-FR`)}]}]}]}]},{type:`h2`,children:[{text:`CONTEXTE`}]},{type:`p`,children:[{text:`[Description du contexte et des objectifs]`}]},{type:`h2`,children:[{text:`PERIMETRE`}]},{type:`p`,children:[{text:`[Ce qui est inclus et exclu du perimetre]`}]},{type:`p`,children:[{text:``}]}]}],ne=s.forwardRef(({value:e,onChange:n,readOnly:r=!1,placeholder:i=`Commencez votre specification...`,className:o,editorClassName:c,minHeight:u=500,label:d,description:f,error:p,customTemplates:m=[],showTemplateSidebar:h=!0,enableAI:g=!1,aiEndpoint:_,title:v,onTitleChange:y,extraPlugins:b,editorRef:x},S)=>{let[C,w]=s.useState(null),[T,E]=s.useState(!1),D=s.useRef(null),O=x??D,k=s.useMemo(()=>[...N,...m],[m]),A=s.useMemo(()=>{let e=new Map;for(let t of k){let n=t.category||`Autre`;e.has(n)||e.set(n,[]),e.get(n).push(t)}return e},[k]);s.useEffect(()=>{let e=!1;return(async()=>{try{let[t,n,r,i,a,o,s]=await Promise.all([import(`platejs/react`),import(`@platejs/basic-nodes/react`),import(`@platejs/table/react`),import(`@platejs/layout/react`),import(`@platejs/callout/react`),import(`@platejs/link/react`),import(`@platejs/indent/react`)]),c=[n.BoldPlugin,n.ItalicPlugin,n.UnderlinePlugin,n.StrikethroughPlugin,n.CodePlugin,n.HighlightPlugin,n.SuperscriptPlugin,n.SubscriptPlugin,n.H1Plugin,n.H2Plugin,n.H3Plugin,n.H4Plugin,n.H5Plugin,n.H6Plugin,n.BlockquotePlugin,r.TablePlugin,r.TableRowPlugin,r.TableCellPlugin,r.TableCellHeaderPlugin,i.ColumnPlugin,i.ColumnItemPlugin,a.CalloutPlugin,o.LinkPlugin.configure({options:{allowedSchemes:[`http`,`https`,`mailto`,`tel`]}}),s.IndentPlugin];try{let{TocPlugin:e}=await import(`@platejs/toc/react`);c.push(e)}catch{}try{let{BlockSelectionPlugin:e}=await import(`@platejs/selection/react`);c.push(e)}catch{}try{let{MarkdownPlugin:e}=await import(`@platejs/markdown`);c.push(e)}catch{}if(g&&_)try{let{AIPlugin:e,AIChatPlugin:t}=await import(`@platejs/ai/react`);c.push(e,t.configure({options:{chat:{api:_,body:{system:`You are a specification writing assistant for a PaaS platform.`}}}}))}catch{}e||w({Plate:t.Plate,PlateContent:t.PlateContent,usePlateEditor:t.usePlateEditor,plugins:c})}catch(t){console.error(`[WakaSpecEditor] Failed to load:`,t),e||E(!0)}})(),()=>{e=!0}},[g,_]);let j=s.useCallback(t=>{let r=t.createNodes(),i=[...e??[],...r];n?.(i)},[e,n]);return(0,l.jsxs)(`div`,{ref:S,className:t.t(`space-y-1.5`,o),children:[d&&(0,l.jsx)(a.n,{children:d}),f&&(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:f}),(0,l.jsxs)(`div`,{className:t.t(`flex border rounded-lg overflow-hidden`,p&&`border-destructive`),children:[h&&!r&&(0,l.jsxs)(`aside`,{className:`w-52 shrink-0 border-r bg-muted/20 hidden md:block`,children:[(0,l.jsx)(`div`,{className:`p-3 border-b`,children:(0,l.jsx)(`h4`,{className:`text-xs font-bold uppercase tracking-wider text-muted-foreground`,children:`Blocs specification`})}),(0,l.jsx)(`div`,{className:`p-2 space-y-3 max-h-[600px] overflow-y-auto`,children:Array.from(A.entries()).map(([e,n])=>(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-wider text-muted-foreground px-1 mb-1`,children:e}),(0,l.jsx)(`div`,{className:`space-y-0.5`,children:n.map(e=>{let n=e.icon;return(0,l.jsxs)(`button`,{type:`button`,onClick:()=>j(e),className:t.t(`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left`,`text-xs transition-colors cursor-pointer`,`hover:bg-accent/50 text-muted-foreground hover:text-foreground`),title:e.description,children:[(0,l.jsx)(n,{className:`h-3.5 w-3.5 shrink-0`}),(0,l.jsx)(`span`,{className:`truncate`,children:e.label})]},e.key)})})]},e))})]}),(0,l.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(v!==void 0||y)&&(0,l.jsx)(`div`,{className:`border-b px-6 py-4`,children:(0,l.jsx)(`input`,{type:`text`,value:v??``,onChange:e=>y?.(e.target.value),placeholder:`Titre de la specification`,readOnly:r,className:t.t(`w-full bg-transparent text-xl font-bold text-foreground`,`placeholder:text-muted-foreground/50 focus:outline-none`)})}),C?(0,l.jsx)(re,{bundle:C,value:e,onChange:n,readOnly:r,placeholder:i,editorClassName:c,minHeight:u,extraPlugins:b,editorRef:O}):(0,l.jsx)(`div`,{className:`relative`,style:{minHeight:u},children:(0,l.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-background/50`,children:(0,l.jsx)(`span`,{className:`text-sm text-muted-foreground animate-pulse`,children:T?`Erreur de chargement`:`Chargement de l'editeur...`})})})]})]}),p&&(0,l.jsx)(`p`,{className:`text-sm text-destructive`,children:p})]})});ne.displayName=`WakaSpecEditor`;function re({bundle:{Plate:e,PlateContent:n,usePlateEditor:r,plugins:i},value:a,onChange:o,readOnly:c,placeholder:u,editorClassName:d,minHeight:f,extraPlugins:p,editorRef:m}){let h=r({plugins:s.useMemo(()=>[...i,...p??[]],[i,p]),value:a??[{type:`p`,children:[{text:``}]}]});return s.useEffect(()=>{m&&(m.current=h)},[h,m]),(0,l.jsx)(e,{editor:h,onChange:o?({value:e})=>o(e):void 0,readOnly:c,children:(0,l.jsx)(`div`,{style:{minHeight:f},children:(0,l.jsx)(n,{placeholder:u,readOnly:c,className:t.t(`prose prose-sm max-w-none px-6 py-4`,`focus-within:outline-none`,`[&_[data-slate-editor]]:outline-none [&_[data-slate-editor]]:min-h-[inherit]`,d)})})})}t.n();var ie=s.forwardRef(({value:e,onChange:n,readOnly:r=!1,placeholder:i=`Glissez-deposez les blocs pour les reorganiser...`,className:o,editorClassName:c,minHeight:u=300,label:d,description:f,error:p,showDragHandles:m=!0,extraPlugins:h,editorRef:g},_)=>{let[v,y]=s.useState(null),[b,x]=s.useState(!1);return s.useEffect(()=>{let e=!1;return(async()=>{try{let[t,n,r,i,a,o,s,c]=await Promise.all([import(`platejs/react`),import(`@platejs/basic-nodes/react`),import(`@platejs/table/react`),import(`@platejs/layout/react`),import(`@platejs/callout/react`),import(`@platejs/link/react`),import(`@platejs/dnd/react`),import(`@platejs/selection/react`)]),l=[n.BoldPlugin,n.ItalicPlugin,n.UnderlinePlugin,n.StrikethroughPlugin,n.CodePlugin,n.HighlightPlugin,n.H1Plugin,n.H2Plugin,n.H3Plugin,n.H4Plugin,n.BlockquotePlugin,r.TablePlugin,r.TableRowPlugin,r.TableCellPlugin,r.TableCellHeaderPlugin,i.ColumnPlugin,i.ColumnItemPlugin,a.CalloutPlugin,o.LinkPlugin.configure({options:{allowedSchemes:[`http`,`https`,`mailto`,`tel`]}}),c.BlockSelectionPlugin,s.DndPlugin.configure({options:{enableScroller:!0}})];e||y({Plate:t.Plate,PlateContent:t.PlateContent,usePlateEditor:t.usePlateEditor,plugins:l})}catch(t){console.error(`[WakaDnDEditor] Failed to load:`,t),e||x(!0)}})(),()=>{e=!0}},[]),v?(0,l.jsx)(ae,{ref:_,bundle:v,value:e,onChange:n,readOnly:r,placeholder:i,className:o,editorClassName:c,minHeight:u,label:d,description:f,error:p,showDragHandles:m,extraPlugins:h,editorRef:g}):(0,l.jsxs)(`div`,{ref:_,className:t.t(`space-y-1.5`,o),children:[d&&(0,l.jsx)(a.n,{children:d}),f&&(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:f}),(0,l.jsxs)(`div`,{className:`relative`,children:[(0,l.jsx)(a.t,{placeholder:i,disabled:!0,style:{minHeight:u}}),(0,l.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-background/50 rounded-lg`,children:(0,l.jsx)(`span`,{className:`text-sm text-muted-foreground animate-pulse`,children:b?`Erreur de chargement`:`Chargement...`})})]}),p&&(0,l.jsx)(`p`,{className:`text-sm text-destructive`,children:p})]})});ie.displayName=`WakaDnDEditor`;var ae=s.forwardRef(({bundle:{Plate:e,PlateContent:n,usePlateEditor:r,plugins:i},value:o,onChange:c,readOnly:u,placeholder:d,className:f,editorClassName:p,minHeight:m,label:h,description:g,error:_,showDragHandles:v,extraPlugins:y,editorRef:b},x)=>{let S=r({plugins:s.useMemo(()=>[...i,...y??[]],[i,y]),value:o??[{type:`p`,children:[{text:``}]}]});return s.useEffect(()=>{b&&(b.current=S)},[S,b]),(0,l.jsxs)(`div`,{ref:x,className:t.t(`space-y-1.5`,f),children:[h&&(0,l.jsx)(a.n,{children:h}),g&&(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:g}),(0,l.jsx)(e,{editor:S,onChange:c?({value:e})=>c(e):void 0,readOnly:u,children:(0,l.jsxs)(`div`,{className:t.t(`border rounded-lg overflow-hidden`,_&&`border-destructive`),children:[!u&&v&&(0,l.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5 border-b bg-muted/30 text-xs text-muted-foreground`,children:[(0,l.jsx)(`span`,{className:`inline-block w-4 text-center`,children:`☰`}),(0,l.jsx)(`span`,{children:`Survolez un bloc pour voir la poignee de glissement`})]}),(0,l.jsx)(`div`,{style:{minHeight:m},children:(0,l.jsx)(n,{placeholder:d,readOnly:u,className:t.t(`prose prose-sm max-w-none p-4`,`focus-within:outline-none`,`[&_[data-slate-editor]]:outline-none [&_[data-slate-editor]]:min-h-[inherit]`,v&&`[&_[data-slate-node='element']]:relative [&_[data-slate-node='element']]:pl-6`,p)})})]})}),_&&(0,l.jsx)(`p`,{className:`text-sm text-destructive`,children:_})]})});ae.displayName=`DnDEditorInner`,t.n();var oe=s.forwardRef(({value:e,onChange:n,readOnly:r=!1,placeholder:i=`Editez ensemble en temps reel...`,className:o,editorClassName:c,minHeight:u=400,label:d,description:f,error:p,documentId:m,currentUser:h,providers:g,maxParticipants:_=10,onUsersChange:v,showUsersBar:y=!0,extraPlugins:b,editorRef:x},S)=>{let[C,w]=s.useState(null),[T,E]=s.useState(!1),[D,O]=s.useState([h]),k=s.useRef({documentId:m,currentUser:h,providers:g,maxParticipants:_});return k.current={documentId:m,currentUser:h,providers:g,maxParticipants:_},s.useEffect(()=>{let e=!1;return(async()=>{try{let t=k.current,[n,r,i,a,o,s,c]=await Promise.all([import(`platejs/react`),import(`@platejs/basic-nodes/react`),import(`@platejs/table/react`),import(`@platejs/layout/react`),import(`@platejs/callout/react`),import(`@platejs/link/react`),import(`@platejs/yjs/react`)]),l=[r.BoldPlugin,r.ItalicPlugin,r.UnderlinePlugin,r.StrikethroughPlugin,r.CodePlugin,r.HighlightPlugin,r.H1Plugin,r.H2Plugin,r.H3Plugin,r.H4Plugin,r.BlockquotePlugin,i.TablePlugin,i.TableRowPlugin,i.TableCellPlugin,i.TableCellHeaderPlugin,a.ColumnPlugin,a.ColumnItemPlugin,o.CalloutPlugin,s.LinkPlugin.configure({options:{allowedSchemes:[`http`,`https`,`mailto`,`tel`]}})],u=t.providers.map(e=>e.type===`hocuspocus`?{type:`hocuspocus`,options:{name:e.roomName,url:e.url,...e.options}}:{type:`webrtc`,options:{roomName:e.roomName,maxConns:t.maxParticipants-1,signaling:[e.url],...e.options}});l.push(c.YjsPlugin.configure({options:{cursors:{data:{name:t.currentUser.name,color:t.currentUser.color}},providers:u}})),e||w({Plate:n.Plate,PlateContent:n.PlateContent,usePlateEditor:n.usePlateEditor,YjsPlugin:c.YjsPlugin,plugins:l})}catch(t){console.error(`[WakaCollaborativeEditor] Failed to load:`,t),e||E(!0)}})(),()=>{e=!0}},[]),s.useEffect(()=>{v?.(D)},[D,v]),C?(0,l.jsx)(se,{ref:S,bundle:C,value:e,onChange:n,readOnly:r,placeholder:i,className:o,editorClassName:c,minHeight:u,label:d,description:f,error:p,documentId:m,currentUser:h,showUsersBar:y,connectedUsers:D,setConnectedUsers:O,extraPlugins:b,editorRef:x}):(0,l.jsxs)(`div`,{ref:S,className:t.t(`space-y-1.5`,o),children:[d&&(0,l.jsx)(a.n,{children:d}),f&&(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:f}),(0,l.jsxs)(`div`,{className:`relative`,children:[(0,l.jsx)(a.t,{placeholder:i,disabled:!0,style:{minHeight:u}}),(0,l.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-background/50 rounded-lg`,children:(0,l.jsx)(`span`,{className:`text-sm text-muted-foreground animate-pulse`,children:T?`Erreur de chargement (@platejs/yjs requis)`:`Connexion a la session collaborative...`})})]}),p&&(0,l.jsx)(`p`,{className:`text-sm text-destructive`,children:p})]})});oe.displayName=`WakaCollaborativeEditor`;var se=s.forwardRef(({bundle:{Plate:e,PlateContent:i,usePlateEditor:o,YjsPlugin:c,plugins:u},value:d,onChange:f,readOnly:p,placeholder:m,className:h,editorClassName:g,minHeight:_,label:v,description:y,error:b,documentId:x,showUsersBar:S,connectedUsers:C,extraPlugins:w,editorRef:T},E)=>{let D=o({plugins:s.useMemo(()=>[...u,...w??[]],[u,w]),skipInitialization:!0},[x]);return s.useEffect(()=>{try{D.getApi(c).yjs.init({id:x,autoSelect:`end`,value:d??[{type:`p`,children:[{text:``}]}]})}catch{}return()=>{try{D.getApi(c).yjs.destroy()}catch{}}},[D,x,c,d]),s.useEffect(()=>{T&&(T.current=D)},[D,T]),(0,l.jsxs)(`div`,{ref:E,className:t.t(`space-y-1.5`,h),children:[v&&(0,l.jsx)(a.n,{children:v}),y&&(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:y}),(0,l.jsx)(e,{editor:D,onChange:f?({value:e})=>f(e):void 0,readOnly:p,children:(0,l.jsxs)(`div`,{className:t.t(`border rounded-lg overflow-hidden`,b&&`border-destructive`),children:[S&&(0,l.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5 border-b bg-muted/30`,children:[(0,l.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`En ligne :`}),(0,l.jsx)(`div`,{className:`flex items-center -space-x-1.5`,children:C.map(e=>(0,l.jsx)(n.m,{className:`h-6 w-6 border-2 border-background`,children:(0,l.jsx)(n.h,{className:`text-[10px] text-white font-bold`,style:{backgroundColor:e.color},children:e.name.slice(0,2).toUpperCase()})},e.id))}),(0,l.jsxs)(r.t,{variant:`secondary`,className:`text-[10px] h-5`,children:[C.length,` connecte`,C.length>1?`s`:``]})]}),(0,l.jsx)(`div`,{style:{minHeight:_},children:(0,l.jsx)(i,{placeholder:m,readOnly:p,className:t.t(`prose prose-sm max-w-none p-4`,`focus-within:outline-none`,`[&_[data-slate-editor]]:outline-none [&_[data-slate-editor]]:min-h-[inherit]`,g)})})]})}),b&&(0,l.jsx)(`p`,{className:`text-sm text-destructive`,children:b})]})});se.displayName=`CollabEditorInner`,t.n();var ce=s.forwardRef(({original:e,modified:n,mode:i=`inline`,label:o,description:c,className:u,editorClassName:d,minHeight:f=200,showStats:p=!0,originalLabel:m=`Original`,modifiedLabel:h=`Modifie`,onDiffComputed:g},_)=>{let[v,y]=s.useState(null),[b,x]=s.useState({added:0,removed:0,modified:0,unchanged:0}),[S,C]=s.useState(!1);return s.useEffect(()=>{let t=!1;return(async()=>{try{let r=await import(`@platejs/diff`);if(r.computeDiff){let i=r.computeDiff(e,n);if(!t){y(i);let e={added:0,removed:0,modified:0,unchanged:0};if(Array.isArray(i))for(let t of i)t.diff===`insert`||t.diffOperation?.type===`insert`?e.added++:t.diff===`delete`||t.diffOperation?.type===`delete`?e.removed++:t.diff===`update`||t.diffOperation?.type===`update`?e.modified++:e.unchanged++;x(e),g?.(e)}}}catch(e){console.error(`[WakaDiffViewer] Failed to compute diff:`,e),t||C(!0)}})(),()=>{t=!0}},[e,n,g]),S||!v?(0,l.jsxs)(`div`,{ref:_,className:t.t(`space-y-1.5`,u),children:[o&&(0,l.jsx)(a.n,{children:o}),c&&(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:c}),S?(0,l.jsx)(de,{original:e,modified:n,mode:i,originalLabel:m,modifiedLabel:h,minHeight:f,editorClassName:d}):(0,l.jsx)(`div`,{className:`flex items-center justify-center border rounded-lg bg-muted/30`,style:{minHeight:f},children:(0,l.jsx)(`span`,{className:`text-sm text-muted-foreground animate-pulse`,children:`Calcul des differences...`})})]}):(0,l.jsxs)(`div`,{ref:_,className:t.t(`space-y-1.5`,u),children:[o&&(0,l.jsx)(a.n,{children:o}),c&&(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:c}),(0,l.jsxs)(`div`,{className:t.t(`border rounded-lg overflow-hidden`),children:[p&&(0,l.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-2 border-b bg-muted/30`,children:[(0,l.jsx)(`span`,{className:`text-xs text-muted-foreground font-medium`,children:`Differences :`}),b.added>0&&(0,l.jsxs)(r.t,{variant:`secondary`,className:`bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300 text-[10px] h-5`,children:[`+`,b.added,` ajout`,b.added>1?`s`:``]}),b.removed>0&&(0,l.jsxs)(r.t,{variant:`secondary`,className:`bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300 text-[10px] h-5`,children:[`-`,b.removed,` suppression`,b.removed>1?`s`:``]}),b.modified>0&&(0,l.jsxs)(r.t,{variant:`secondary`,className:`bg-amber-100 text-amber-800 dark:bg-amber-900/30 dark:text-amber-300 text-[10px] h-5`,children:[`~`,b.modified,` modification`,b.modified>1?`s`:``]}),b.added===0&&b.removed===0&&b.modified===0&&(0,l.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Aucune difference`})]}),i===`side-by-side`?(0,l.jsxs)(`div`,{className:`flex divide-x`,style:{minHeight:f},children:[(0,l.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,l.jsx)(`div`,{className:`px-3 py-1.5 border-b bg-red-50/50 dark:bg-red-950/10 text-xs font-medium text-muted-foreground`,children:m}),(0,l.jsx)(P,{nodes:e,diffType:`original`,className:d})]}),(0,l.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,l.jsx)(`div`,{className:`px-3 py-1.5 border-b bg-green-50/50 dark:bg-green-950/10 text-xs font-medium text-muted-foreground`,children:h}),(0,l.jsx)(P,{nodes:n,diffType:`modified`,className:d})]})]}):(0,l.jsx)(`div`,{style:{minHeight:f},children:(0,l.jsx)(le,{diffNodes:v,className:d})})]})]})});ce.displayName=`WakaDiffViewer`;function P({nodes:e,diffType:n,className:r}){return(0,l.jsx)(`div`,{className:t.t(`prose prose-sm max-w-none p-4 text-sm`,r),children:e.map((e,t)=>(0,l.jsx)(ue,{node:e,diffType:n},t))})}function le({diffNodes:e,className:n}){return(0,l.jsx)(`div`,{className:t.t(`prose prose-sm max-w-none p-4 text-sm`,n),children:e.map((e,n)=>{let r=e.diff||e.diffOperation?.type,i=``;return r===`insert`?i=`bg-green-100/60 dark:bg-green-900/20`:r===`delete`?i=`bg-red-100/60 dark:bg-red-900/20 line-through opacity-60`:r===`update`&&(i=`bg-amber-100/60 dark:bg-amber-900/20`),(0,l.jsx)(`div`,{className:t.t(`rounded px-1 -mx-1`,i),children:(0,l.jsx)(ue,{node:e,diffType:`modified`})},n)})})}function ue({node:e,diffType:t}){if(!e)return null;let n=fe(e);switch(e.type||`p`){case`h1`:return(0,l.jsx)(`h1`,{className:`text-xl font-bold mt-4 mb-1`,children:n});case`h2`:return(0,l.jsx)(`h2`,{className:`text-lg font-semibold mt-3 mb-1`,children:n});case`h3`:return(0,l.jsx)(`h3`,{className:`text-base font-semibold mt-2 mb-1`,children:n});case`blockquote`:return(0,l.jsx)(`blockquote`,{className:`border-l-2 border-muted-foreground/30 pl-3 italic text-muted-foreground`,children:n});default:return(0,l.jsx)(`p`,{className:`my-0.5 leading-relaxed`,children:n||`\xA0`})}}function de({original:e,modified:t,mode:n,originalLabel:r,modifiedLabel:i,minHeight:a,editorClassName:o}){return n===`side-by-side`?(0,l.jsxs)(`div`,{className:`flex divide-x border rounded-lg overflow-hidden`,style:{minHeight:a},children:[(0,l.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,l.jsx)(`div`,{className:`px-3 py-1.5 border-b bg-red-50/50 dark:bg-red-950/10 text-xs font-medium text-muted-foreground`,children:r}),(0,l.jsx)(P,{nodes:e,diffType:`original`,className:o})]}),(0,l.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,l.jsx)(`div`,{className:`px-3 py-1.5 border-b bg-green-50/50 dark:bg-green-950/10 text-xs font-medium text-muted-foreground`,children:i}),(0,l.jsx)(P,{nodes:t,diffType:`modified`,className:o})]})]}):(0,l.jsx)(`div`,{className:`border rounded-lg overflow-hidden`,style:{minHeight:a},children:(0,l.jsxs)(`div`,{className:`p-4 text-sm text-muted-foreground`,children:[`Installez `,(0,l.jsx)(`code`,{className:`bg-muted px-1 rounded`,children:`@platejs/diff`}),` pour la visualisation unifiee des differences.`]})})}function fe(e){return typeof e?.text==`string`?e.text:Array.isArray(e?.children)?e.children.map(e=>fe(e)).join(``):``}t.n();var pe=s.forwardRef(({value:e,onChange:n,readOnly:r=!1,placeholder:i=`Tapez @ pour mentionner un utilisateur...`,className:o,editorClassName:c,minHeight:u=200,label:d,description:f,error:p,onSearch:m,onMentionInserted:h,trigger:g=`@`,searchDebounceMs:_=300,maxResults:v=8,extraPlugins:y,editorRef:b},x)=>{let[S,C]=s.useState(null),[w,T]=s.useState(!1),[E,D]=s.useState([]),[O,k]=s.useState(!1),A=s.useRef(),j=s.useRef({onSearch:m,trigger:g,searchDebounceMs:_,maxResults:v,onMentionInserted:h});j.current={onSearch:m,trigger:g,searchDebounceMs:_,maxResults:v,onMentionInserted:h},s.useEffect(()=>{let e=!1;return(async()=>{try{let t=j.current,[n,r,i,a,o,s,c]=await Promise.all([import(`platejs/react`),import(`@platejs/basic-nodes/react`),import(`@platejs/table/react`),import(`@platejs/layout/react`),import(`@platejs/callout/react`),import(`@platejs/link/react`),import(`@platejs/mention/react`)]),l=[r.BoldPlugin,r.ItalicPlugin,r.UnderlinePlugin,r.StrikethroughPlugin,r.CodePlugin,r.HighlightPlugin,r.H1Plugin,r.H2Plugin,r.H3Plugin,r.H4Plugin,r.BlockquotePlugin,i.TablePlugin,i.TableRowPlugin,i.TableCellPlugin,i.TableCellHeaderPlugin,a.ColumnPlugin,a.ColumnItemPlugin,o.CalloutPlugin,s.LinkPlugin.configure({options:{allowedSchemes:[`http`,`https`,`mailto`,`tel`]}}),c.MentionPlugin.configure({options:{trigger:t.trigger,triggerPreviousCharPattern:/^$|^[\s"']$/,insertSpaceAfterMention:!0}}),c.MentionInputPlugin];e||C({Plate:n.Plate,PlateContent:n.PlateContent,usePlateEditor:n.usePlateEditor,plugins:l})}catch(t){console.error(`[WakaMentionEditor] Failed to load:`,t),e||T(!0)}})(),()=>{e=!0}},[]);let M=s.useCallback(e=>{if(A.current&&clearTimeout(A.current),!e.trim()){D([]),k(!1);return}k(!0),A.current=setTimeout(async()=>{try{let t=j.current;D((await t.onSearch(e)).slice(0,t.maxResults))}catch{D([])}finally{k(!1)}},j.current.searchDebounceMs)},[]);return S?(0,l.jsx)(me,{ref:x,bundle:S,value:e,onChange:n,readOnly:r,placeholder:i,className:o,editorClassName:c,minHeight:u,label:d,description:f,error:p,suggestions:E,searching:O,onSearch:M,onMentionInserted:h,extraPlugins:y,editorRef:b}):(0,l.jsxs)(`div`,{ref:x,className:t.t(`space-y-1.5`,o),children:[d&&(0,l.jsx)(a.n,{children:d}),f&&(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:f}),(0,l.jsxs)(`div`,{className:`relative`,children:[(0,l.jsx)(a.t,{placeholder:i,disabled:!0,style:{minHeight:u}}),(0,l.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-background/50 rounded-lg`,children:(0,l.jsx)(`span`,{className:`text-sm text-muted-foreground animate-pulse`,children:w?`Erreur (@platejs/mention requis)`:`Chargement...`})})]}),p&&(0,l.jsx)(`p`,{className:`text-sm text-destructive`,children:p})]})});pe.displayName=`WakaMentionEditor`;var me=s.forwardRef(({bundle:{Plate:e,PlateContent:n,usePlateEditor:r,plugins:i},value:o,onChange:c,readOnly:u,placeholder:d,className:f,editorClassName:p,minHeight:m,label:h,description:g,error:_,suggestions:v,searching:y,extraPlugins:b,editorRef:x},S)=>{let C=r({plugins:s.useMemo(()=>[...i,...b??[]],[i,b]),value:o??[{type:`p`,children:[{text:``}]}]});return s.useEffect(()=>{x&&(x.current=C)},[C,x]),(0,l.jsxs)(`div`,{ref:S,className:t.t(`space-y-1.5`,f),children:[h&&(0,l.jsx)(a.n,{children:h}),g&&(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:g}),(0,l.jsx)(e,{editor:C,onChange:c?({value:e})=>c(e):void 0,readOnly:u,children:(0,l.jsxs)(`div`,{className:t.t(`border rounded-lg overflow-hidden relative`,_&&`border-destructive`),children:[(0,l.jsx)(`div`,{style:{minHeight:m},children:(0,l.jsx)(n,{placeholder:d,readOnly:u,className:t.t(`prose prose-sm max-w-none p-4`,`focus-within:outline-none`,`[&_[data-slate-editor]]:outline-none [&_[data-slate-editor]]:min-h-[inherit]`,p)})}),v.length>0&&(0,l.jsx)(he,{suggestions:v,searching:y})]})}),_&&(0,l.jsx)(`p`,{className:`text-sm text-destructive`,children:_})]})});me.displayName=`MentionEditorInner`;function he({suggestions:e,searching:r,className:i,onSelect:a}){return(0,l.jsxs)(`div`,{className:t.t(`absolute z-50 w-64 max-h-60 overflow-y-auto`,`rounded-lg border bg-popover shadow-lg`,`p-1 mt-1`,i),children:[r&&(0,l.jsx)(`div`,{className:`px-2 py-1.5 text-xs text-muted-foreground animate-pulse`,children:`Recherche...`}),e.map(e=>(0,l.jsxs)(`button`,{type:`button`,className:t.t(`flex w-full items-center gap-2.5 rounded-md px-2 py-1.5 text-left`,`text-sm transition-colors cursor-pointer`,`hover:bg-accent/50`),onClick:()=>a?.(e),children:[(0,l.jsxs)(n.m,{className:`h-6 w-6`,children:[e.avatar&&(0,l.jsx)(n.g,{src:e.avatar,alt:e.name}),(0,l.jsx)(n.h,{className:`text-[10px] bg-primary/10 text-primary`,children:e.name.slice(0,2).toUpperCase()})]}),(0,l.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,l.jsx)(`div`,{className:`font-medium truncate`,children:e.name}),e.email&&(0,l.jsx)(`div`,{className:`text-xs text-muted-foreground truncate`,children:e.email})]}),e.role&&(0,l.jsx)(`span`,{className:`text-[10px] text-muted-foreground shrink-0`,children:e.role})]},e.id))]})}he.displayName=`MentionSuggestions`,t.n();function ge({children:e,attributes:n,className:r}){return(0,l.jsx)(`table`,{...n,className:t.t(`w-full border-collapse text-sm my-4`,`border border-border rounded-lg overflow-hidden`,r),children:(0,l.jsx)(`tbody`,{children:e})})}ge.displayName=`TableElement`;function _e({children:e,attributes:n,className:r}){return(0,l.jsx)(`tr`,{...n,className:t.t(`border-b border-border last:border-b-0`,r),children:e})}_e.displayName=`TableRowElement`;function ve({children:e,attributes:n,className:r}){return(0,l.jsx)(`td`,{...n,className:t.t(`px-3 py-2 text-sm text-foreground`,`border-r border-border last:border-r-0`,r),children:e})}ve.displayName=`TableCellElement`;function ye({children:e,attributes:n,className:r}){return(0,l.jsx)(`th`,{...n,className:t.t(`px-3 py-2 text-xs font-bold uppercase tracking-wider`,`text-muted-foreground text-left bg-muted/50`,`border-r border-border last:border-r-0`,r),children:e})}ye.displayName=`TableCellHeaderElement`;function be({children:e,attributes:n,className:r}){return(0,l.jsx)(`div`,{...n,className:t.t(`flex gap-6 my-4`,r),children:e})}be.displayName=`ColumnGroupElement`;function xe({children:e,attributes:n,className:r}){return(0,l.jsx)(`div`,{...n,className:t.t(`flex-1 min-w-0`,r),children:e})}xe.displayName=`ColumnElement`;var Se={info:`bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-950/30 dark:border-blue-800 dark:text-blue-200`,warning:`bg-amber-50 border-amber-200 text-amber-900 dark:bg-amber-950/30 dark:border-amber-800 dark:text-amber-200`,success:`bg-green-50 border-green-200 text-green-900 dark:bg-green-950/30 dark:border-green-800 dark:text-green-200`,error:`bg-red-50 border-red-200 text-red-900 dark:bg-red-950/30 dark:border-red-800 dark:text-red-200`,dark:`bg-card border-border text-card-foreground`};function Ce({children:e,attributes:n,element:r,className:i}){let a=Se[r?.variant||`info`]??Se.info;return(0,l.jsx)(`div`,{...n,className:t.t(`border rounded-xl p-4 my-3`,a,i),children:e})}Ce.displayName=`CalloutElement`;function we({children:e,attributes:n,className:r}){return(0,l.jsx)(`h1`,{...n,className:t.t(`text-2xl font-extrabold text-foreground mt-8 mb-2 first:mt-0`,r),children:e})}we.displayName=`H1Element`;function Te({children:e,attributes:n,className:r}){return(0,l.jsx)(`h2`,{...n,className:t.t(`text-sm font-bold text-foreground uppercase tracking-wider`,`mt-6 mb-3 border-b-2 border-border pb-1.5`,r),children:e})}Te.displayName=`H2Element`;function Ee({children:e,attributes:n,className:r}){return(0,l.jsx)(`h3`,{...n,className:t.t(`text-sm font-semibold text-primary italic mt-1 mb-4`,r),children:e})}Ee.displayName=`H3Element`;function De({children:e,attributes:n,className:r}){return(0,l.jsx)(`h4`,{...n,className:t.t(`text-xs font-bold text-primary uppercase tracking-wide mt-2 mb-0.5`,r),children:e})}De.displayName=`H4Element`;function Oe({children:e,attributes:n,className:r}){return(0,l.jsx)(`h5`,{...n,className:t.t(`text-xs font-semibold text-muted-foreground mt-2 mb-0.5`,r),children:e})}Oe.displayName=`H5Element`;function ke({children:e,attributes:n,className:r}){return(0,l.jsx)(`h6`,{...n,className:t.t(`text-xs font-medium text-muted-foreground mt-2 mb-0.5`,r),children:e})}ke.displayName=`H6Element`;function Ae({children:e,attributes:n,className:r}){return(0,l.jsx)(`blockquote`,{...n,className:t.t(`border-l-3 border-primary/50 pl-4 py-2`,`bg-muted/30 rounded-r-lg`,`italic text-muted-foreground`,`my-3`,r),children:e})}Ae.displayName=`BlockquoteElement`;function je({children:e,attributes:n,className:r}){return(0,l.jsx)(`p`,{...n,className:t.t(`text-sm leading-relaxed text-foreground my-0.5`,r),children:e})}je.displayName=`ParagraphElement`;function Me({children:e,attributes:n,element:r,className:i}){return(0,l.jsx)(`a`,{...n,href:r?.url,target:`_blank`,rel:`noopener noreferrer`,className:t.t(`text-primary underline decoration-primary/30 hover:decoration-primary`,`transition-colors cursor-pointer`,i),children:e})}Me.displayName=`LinkElement`;function Ne({children:e,attributes:n,element:r,className:i}){return(0,l.jsxs)(`span`,{...n,contentEditable:!1,className:t.t(`inline-flex items-center rounded-md px-1.5 py-0.5`,`bg-primary/10 text-primary text-sm font-medium`,`border border-primary/20`,i),children:[`@`,r?.value||`unknown`,e]})}Ne.displayName=`MentionElement`;function Pe({attributes:e,className:n}){return(0,l.jsx)(`div`,{...e,className:t.t(`my-6`,n),children:(0,l.jsx)(`hr`,{className:`border-border`})})}Pe.displayName=`SeparatorElement`,t.n();function Fe({children:e,attributes:n,className:r}){return(0,l.jsx)(`strong`,{...n,className:t.t(`font-bold`,r),children:e})}Fe.displayName=`BoldLeaf`;function Ie({children:e,attributes:n,className:r}){return(0,l.jsx)(`em`,{...n,className:t.t(`italic`,r),children:e})}Ie.displayName=`ItalicLeaf`;function Le({children:e,attributes:n,className:r}){return(0,l.jsx)(`span`,{...n,className:t.t(`underline decoration-foreground/50`,r),children:e})}Le.displayName=`UnderlineLeaf`;function Re({children:e,attributes:n,className:r}){return(0,l.jsx)(`s`,{...n,className:t.t(`line-through text-muted-foreground`,r),children:e})}Re.displayName=`StrikethroughLeaf`;function ze({children:e,attributes:n,className:r}){return(0,l.jsx)(`code`,{...n,className:t.t(`rounded-md bg-muted px-1.5 py-0.5`,`font-mono text-[0.85em] text-foreground`,r),children:e})}ze.displayName=`CodeLeaf`;function Be({children:e,attributes:n,className:r}){return(0,l.jsx)(`mark`,{...n,className:t.t(`bg-yellow-200/60 dark:bg-yellow-500/30`,`rounded-sm px-0.5`,r),children:e})}Be.displayName=`HighlightLeaf`;function Ve({children:e,attributes:n,className:r}){return(0,l.jsx)(`sup`,{...n,className:t.t(`text-[0.75em]`,r),children:e})}Ve.displayName=`SuperscriptLeaf`;function He({children:e,attributes:n,className:r}){return(0,l.jsx)(`sub`,{...n,className:t.t(`text-[0.75em]`,r),children:e})}He.displayName=`SubscriptLeaf`;var Ue=e.r({USER_STORY_BLOCK_TYPE:()=>I,WakaUserStoryBlock:()=>F,createUserStoryNodes:()=>Ge,createUserStoryPlugin:()=>Ke});function We({label:e,icon:n,value:r,placeholder:i,readOnly:a,onChange:o}){return(0,l.jsxs)(`div`,{className:`flex items-start gap-3 group`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-1.5 pt-1 shrink-0 w-[90px]`,children:[(0,l.jsx)(`span`,{className:`text-blue-500 dark:text-blue-400`,children:n}),(0,l.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-wider text-blue-600 dark:text-blue-400`,children:e})]}),(0,l.jsx)(`div`,{className:`flex-1 min-w-0`,children:a?(0,l.jsx)(`p`,{className:`text-sm text-foreground py-1`,children:r||(0,l.jsx)(`span`,{className:`text-muted-foreground italic`,children:i})}):(0,l.jsx)(`input`,{type:`text`,value:r,onChange:e=>o?.(e.target.value),placeholder:i,className:t.t(`w-full bg-transparent text-sm text-foreground py-1 px-0`,`border-0 border-b border-transparent`,`focus:border-blue-300 dark:focus:border-blue-600`,`focus:outline-none transition-colors`,`placeholder:text-muted-foreground/50 placeholder:italic`)})})]})}function F({attributes:e,children:n,element:r,className:i}){let a=r,o=a?.priority,s=a?.storyId,c=a?.points;return(0,l.jsxs)(`div`,{...e,contentEditable:!1,className:t.t(`relative my-4 rounded-lg overflow-hidden`,`border-l-4 border-blue-500 dark:border-blue-400`,`bg-blue-50/50 dark:bg-blue-950/20`,`border border-blue-200/60 dark:border-blue-800/40`,`shadow-sm hover:shadow-md transition-shadow duration-200`,i),children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2 bg-blue-100/50 dark:bg-blue-900/20 border-b border-blue-200/40 dark:border-blue-800/30`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,l.jsx)(`svg`,{className:`h-4 w-4 text-blue-600 dark:text-blue-400`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,"aria-hidden":`true`,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z`})}),(0,l.jsx)(`span`,{className:`text-xs font-bold uppercase tracking-wider text-blue-700 dark:text-blue-300`,children:`User Story`}),s&&(0,l.jsx)(`span`,{className:`text-[10px] font-mono font-semibold text-blue-500 dark:text-blue-400 bg-blue-100 dark:bg-blue-800/40 px-1.5 py-0.5 rounded`,children:s})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[c!==void 0&&(0,l.jsx)(`span`,{className:`inline-flex items-center justify-center h-5 min-w-[20px] px-1 rounded-full bg-blue-200 dark:bg-blue-700/50 text-[10px] font-bold text-blue-800 dark:text-blue-200`,children:c}),o&&L[o]&&(0,l.jsx)(`span`,{className:t.t(`text-[10px] font-semibold px-2 py-0.5 rounded-full`,L[o].bg,L[o].color),children:L[o].label})]})]}),(0,l.jsxs)(`div`,{className:`px-4 py-3 space-y-2`,children:[(0,l.jsx)(We,{label:`As a`,icon:(0,l.jsx)(`svg`,{className:`h-3 w-3`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z`})}),value:a?.role||``,placeholder:`role (e.g. platform administrator)`,readOnly:!0}),(0,l.jsx)(We,{label:`I want`,icon:(0,l.jsx)(`svg`,{className:`h-3 w-3`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M13 10V3L4 14h7v7l9-11h-7z`})}),value:a?.action||``,placeholder:`action (e.g. to deploy services with one click)`,readOnly:!0}),(0,l.jsx)(We,{label:`So that`,icon:(0,l.jsx)(`svg`,{className:`h-3 w-3`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z`})}),value:a?.benefit||``,placeholder:`benefit (e.g. I can reduce time-to-market)`,readOnly:!0})]}),(0,l.jsx)(`div`,{className:`hidden`,children:n})]})}function Ge(e){return[{type:I,role:e?.role||``,action:e?.action||``,benefit:e?.benefit||``,storyId:e?.storyId,priority:e?.priority,points:e?.points,children:[{text:``}]}]}async function Ke(){try{let{createPlatePlugin:e}=await import(`platejs/react`);return e({key:I,node:{isElement:!0,isVoid:!0,type:I,component:F}})}catch{return console.warn(`[WakaUserStoryBlock] platejs not installed`),null}}var I,L,qe=e.n((()=>{t.n(),I=`user_story`,L={must:{label:`Must Have`,color:`text-red-700 dark:text-red-400`,bg:`bg-red-50 dark:bg-red-500/10`},should:{label:`Should Have`,color:`text-amber-700 dark:text-amber-400`,bg:`bg-amber-50 dark:bg-amber-500/10`},could:{label:`Could Have`,color:`text-blue-700 dark:text-blue-400`,bg:`bg-blue-50 dark:bg-blue-500/10`},wont:{label:`Won't Have`,color:`text-gray-500 dark:text-gray-400`,bg:`bg-gray-50 dark:bg-gray-500/10`}},F.displayName=`WakaUserStoryBlock`})),Je=e.r({ACCEPTANCE_CRITERIA_BLOCK_TYPE:()=>z,WakaAcceptanceCriteriaBlock:()=>R,createAcceptanceCriteriaNodes:()=>Ze,createAcceptanceCriteriaPlugin:()=>Qe});function Ye({keyword:e,variant:n}){return(0,l.jsx)(`span`,{className:t.t(`inline-block text-[10px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded shrink-0 w-[52px] text-center`,{given:`bg-violet-100 text-violet-700 dark:bg-violet-500/15 dark:text-violet-400`,when:`bg-amber-100 text-amber-700 dark:bg-amber-500/15 dark:text-amber-400`,then:`bg-emerald-100 text-emerald-700 dark:bg-emerald-500/15 dark:text-emerald-400`}[n]),children:e})}function Xe({criterion:e,index:n,readOnly:r}){let[i,a]=s.useState(!0);return(0,l.jsxs)(`div`,{className:t.t(`rounded-lg border transition-all duration-200`,e.validated?`border-emerald-200 dark:border-emerald-800/40 bg-emerald-50/30 dark:bg-emerald-950/10`:`border-border bg-card/50`),children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-3 px-3 py-2`,children:[(0,l.jsx)(`button`,{type:`button`,disabled:r,className:t.t(`flex-shrink-0 h-5 w-5 rounded-md border-2 flex items-center justify-center transition-all duration-200`,e.validated?`bg-emerald-500 border-emerald-500 text-white`:`border-border hover:border-emerald-400`,r&&`cursor-default`),"aria-label":e.validated?`Mark as not validated`:`Mark as validated`,"aria-checked":e.validated,role:`checkbox`,children:e.validated&&(0,l.jsx)(`svg`,{className:`h-3 w-3`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:3,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M5 13l4 4L19 7`})})}),(0,l.jsx)(`span`,{className:`text-[10px] font-mono font-bold text-muted-foreground bg-muted px-1.5 py-0.5 rounded shrink-0`,children:e.id}),(0,l.jsx)(`span`,{className:t.t(`text-sm font-medium flex-1 min-w-0 truncate`,e.validated&&`line-through text-muted-foreground`),children:e.scenario||`Unnamed scenario`}),(0,l.jsx)(`button`,{type:`button`,onClick:()=>a(!i),className:`text-muted-foreground hover:text-foreground transition-colors p-0.5`,"aria-label":i?`Collapse`:`Expand`,children:(0,l.jsx)(`svg`,{className:t.t(`h-3.5 w-3.5 transition-transform duration-200`,i&&`rotate-180`),viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M19 9l-7 7-7-7`})})})]}),i&&(0,l.jsxs)(`div`,{className:`px-3 pb-3 pt-1 space-y-1.5 border-t border-border/50`,children:[(0,l.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,l.jsx)(Ye,{keyword:`Given`,variant:`given`}),(0,l.jsx)(`span`,{className:`text-sm text-foreground/80 pt-0.5`,children:e.given||(0,l.jsx)(`span`,{className:`italic text-muted-foreground`,children:`precondition...`})})]}),(0,l.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,l.jsx)(Ye,{keyword:`When`,variant:`when`}),(0,l.jsx)(`span`,{className:`text-sm text-foreground/80 pt-0.5`,children:e.when||(0,l.jsx)(`span`,{className:`italic text-muted-foreground`,children:`action...`})})]}),(0,l.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,l.jsx)(Ye,{keyword:`Then`,variant:`then`}),(0,l.jsx)(`span`,{className:`text-sm text-foreground/80 pt-0.5`,children:e.then||(0,l.jsx)(`span`,{className:`italic text-muted-foreground`,children:`expected result...`})})]})]})]})}function R({attributes:e,children:n,element:r,className:i}){let a=r,o=a?.criteria||[],s=a?.title||`Acceptance Criteria`,c=o.filter(e=>e.validated).length,u=o.length,d=u>0?c/u*100:0;return(0,l.jsxs)(`div`,{...e,contentEditable:!1,className:t.t(`my-4 rounded-lg overflow-hidden`,`border border-border`,`bg-card/30`,`shadow-sm`,i),children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2.5 bg-muted/30 border-b border-border`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,l.jsx)(`svg`,{className:`h-4 w-4 text-emerald-600 dark:text-emerald-400`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,"aria-hidden":`true`,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4`})}),(0,l.jsx)(`span`,{className:`text-xs font-bold uppercase tracking-wider text-foreground`,children:s})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,l.jsxs)(`span`,{className:`text-[10px] font-medium text-muted-foreground`,children:[c,`/`,u]}),(0,l.jsx)(`div`,{className:`w-16 h-1.5 bg-muted rounded-full overflow-hidden`,children:(0,l.jsx)(`div`,{className:`h-full bg-emerald-500 rounded-full transition-all duration-500`,style:{width:`${d}%`}})})]})]}),(0,l.jsx)(`div`,{className:`p-3 space-y-2`,children:o.length>0?o.map((e,t)=>(0,l.jsx)(Xe,{criterion:e,index:t,readOnly:!0},e.id)):(0,l.jsx)(`div`,{className:`py-6 text-center text-sm text-muted-foreground italic`,children:`No acceptance criteria defined yet.`})}),(0,l.jsx)(`div`,{className:`hidden`,children:n})]})}function Ze(e){return[{type:z,title:e?.title||`Acceptance Criteria`,criteria:e?.criteria||[{id:`AC-01`,scenario:`Nominal case`,given:`The user is authenticated`,when:`They perform the action`,then:`The expected result is displayed`,validated:!1},{id:`AC-02`,scenario:`Error case`,given:`The service is unavailable`,when:`They perform the action`,then:`An error message is displayed`,validated:!1}],children:[{text:``}]}]}async function Qe(){try{let{createPlatePlugin:e}=await import(`platejs/react`);return e({key:z,node:{isElement:!0,isVoid:!0,type:z,component:R}})}catch{return console.warn(`[WakaAcceptanceCriteriaBlock] platejs not installed`),null}}var z,$e=e.n((()=>{t.n(),z=`acceptance_criteria`,R.displayName=`WakaAcceptanceCriteriaBlock`})),et=e.r({API_ENDPOINT_BLOCK_TYPE:()=>V,WakaApiEndpointBlock:()=>B,createApiEndpointNodes:()=>it,createApiEndpointPlugin:()=>at});function tt({method:e}){let n=H[e]||H.GET;return(0,l.jsx)(`span`,{className:t.t(`inline-flex items-center px-2 py-0.5 rounded text-[11px] font-bold font-mono tracking-wide border`,n.bg,n.text,n.border),children:e})}function nt({status:e}){return(0,l.jsx)(`span`,{className:t.t(`text-[11px] font-mono font-bold px-1.5 py-0.5 rounded`,e<300?`text-emerald-700 dark:text-emerald-400 bg-emerald-50 dark:bg-emerald-500/10`:e<400?`text-blue-700 dark:text-blue-400 bg-blue-50 dark:bg-blue-500/10`:e<500?`text-amber-700 dark:text-amber-400 bg-amber-50 dark:bg-amber-500/10`:`text-red-700 dark:text-red-400 bg-red-50 dark:bg-red-500/10`),children:e})}function rt({code:e,label:n}){let[r,i]=s.useState(!1),a=e.split(`
29
- `).length>6;return(0,l.jsxs)(`div`,{className:`mt-2`,children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,l.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-wider text-muted-foreground`,children:n}),a&&(0,l.jsx)(`button`,{type:`button`,onClick:()=>i(!r),className:`text-[10px] text-primary hover:underline`,children:r?`Collapse`:`Expand`})]}),(0,l.jsxs)(`pre`,{className:t.t(`text-[12px] font-mono leading-relaxed p-3 rounded-md overflow-x-auto`,`bg-gray-950 dark:bg-gray-900 text-gray-100`,`border border-gray-800/50`,!r&&a&&`max-h-[150px] overflow-hidden relative`),children:[!r&&a&&(0,l.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 h-10 bg-gradient-to-t from-gray-950 dark:from-gray-900 to-transparent`}),(0,l.jsx)(`code`,{children:e})]})]})}function B({attributes:e,children:n,element:r,className:i}){let a=r,o=a?.method||`GET`,c=a?.route||`/api/v1/resource`,u=H[o]||H.GET,[d,f]=s.useState(a?.params&&a.params.length>0?`params`:a?.requestBody?`body`:`responses`);return(0,l.jsxs)(`div`,{...e,contentEditable:!1,className:t.t(`my-4 rounded-lg overflow-hidden`,`border`,u.border,`shadow-sm`,i),children:[(0,l.jsxs)(`div`,{className:t.t(`flex items-center gap-3 px-4 py-3`,u.bg),children:[(0,l.jsx)(tt,{method:o}),(0,l.jsx)(`code`,{className:t.t(`text-sm font-mono font-semibold`,u.text),children:c})]}),(0,l.jsxs)(`div`,{className:`px-4 py-3 border-b border-border/50 bg-card/50`,children:[a?.description&&(0,l.jsx)(`p`,{className:`text-sm text-foreground mb-2`,children:a.description}),(0,l.jsxs)(`div`,{className:`flex flex-wrap gap-3 text-[11px]`,children:[a?.auth&&(0,l.jsxs)(`div`,{className:`flex items-center gap-1 text-muted-foreground`,children:[(0,l.jsx)(`svg`,{className:`h-3 w-3`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z`})}),(0,l.jsx)(`span`,{className:`font-medium`,children:a.auth})]}),a?.permissions&&a.permissions.length>0&&(0,l.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,l.jsx)(`svg`,{className:`h-3 w-3 text-muted-foreground`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z`})}),a.permissions.map((e,t)=>(0,l.jsx)(`span`,{className:`px-1.5 py-0.5 rounded bg-muted text-muted-foreground font-mono text-[10px]`,children:e},t))]}),a?.rateLimit&&(0,l.jsxs)(`div`,{className:`flex items-center gap-1 text-muted-foreground`,children:[(0,l.jsx)(`svg`,{className:`h-3 w-3`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z`})}),(0,l.jsx)(`span`,{className:`font-medium`,children:a.rateLimit})]})]})]}),(0,l.jsx)(`div`,{className:`flex border-b border-border/50`,children:[{id:`params`,label:`Parameters`,count:a?.params?.length},{id:`body`,label:`Request Body`,show:!!a?.requestBody},{id:`responses`,label:`Responses`,count:a?.responses?.length}].filter(e=>e.show!==!1&&(e.count===void 0||e.count>0)).map(e=>(0,l.jsxs)(`button`,{type:`button`,onClick:()=>f(e.id),className:t.t(`px-4 py-2 text-xs font-medium transition-colors relative`,d===e.id?`text-foreground`:`text-muted-foreground hover:text-foreground`),children:[e.label,e.count!==void 0&&(0,l.jsxs)(`span`,{className:`ml-1 text-[10px] text-muted-foreground`,children:[`(`,e.count,`)`]}),d===e.id&&(0,l.jsx)(`div`,{className:t.t(`absolute bottom-0 left-0 right-0 h-0.5`,u.bg.replace(`bg-`,`bg-`).replace(`/15`,``)),style:{backgroundColor:o===`GET`?`#10b981`:o===`POST`?`#3b82f6`:o===`PUT`?`#f59e0b`:o===`DELETE`?`#ef4444`:`#6b7280`}})]},e.id))}),(0,l.jsxs)(`div`,{className:`px-4 py-3`,children:[d===`params`&&a?.params&&a.params.length>0&&(0,l.jsx)(`div`,{className:`overflow-x-auto`,children:(0,l.jsxs)(`table`,{className:`w-full text-xs`,children:[(0,l.jsx)(`thead`,{children:(0,l.jsxs)(`tr`,{className:`border-b border-border`,children:[(0,l.jsx)(`th`,{className:`text-left font-semibold text-muted-foreground py-1.5 pr-4`,children:`Name`}),(0,l.jsx)(`th`,{className:`text-left font-semibold text-muted-foreground py-1.5 pr-4`,children:`Type`}),(0,l.jsx)(`th`,{className:`text-left font-semibold text-muted-foreground py-1.5 pr-4`,children:`Required`}),(0,l.jsx)(`th`,{className:`text-left font-semibold text-muted-foreground py-1.5`,children:`Description`})]})}),(0,l.jsx)(`tbody`,{children:a.params.map((e,t)=>(0,l.jsxs)(`tr`,{className:`border-b border-border/30`,children:[(0,l.jsx)(`td`,{className:`py-1.5 pr-4 font-mono font-medium text-foreground`,children:e.name}),(0,l.jsx)(`td`,{className:`py-1.5 pr-4 font-mono text-muted-foreground`,children:e.type}),(0,l.jsx)(`td`,{className:`py-1.5 pr-4`,children:e.required?(0,l.jsx)(`span`,{className:`text-red-600 dark:text-red-400 font-semibold`,children:`required`}):(0,l.jsx)(`span`,{className:`text-muted-foreground`,children:`optional`})}),(0,l.jsx)(`td`,{className:`py-1.5 text-muted-foreground`,children:e.description})]},t))})]})}),d===`body`&&a?.requestBody&&(0,l.jsx)(rt,{code:a.requestBody,label:`Request Body`}),d===`responses`&&a?.responses&&(0,l.jsx)(`div`,{className:`space-y-3`,children:a.responses.map((e,t)=>(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,l.jsx)(nt,{status:e.status}),(0,l.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.description})]}),e.body&&(0,l.jsx)(rt,{code:e.body,label:`Response ${e.status}`})]},t))})]}),(0,l.jsx)(`div`,{className:`hidden`,children:n})]})}function it(e){return[{type:V,method:e?.method||`GET`,route:e?.route||`/api/v1/resource/:id`,description:e?.description||`Retrieves a resource by its unique identifier.`,auth:e?.auth||`Bearer JWT`,permissions:e?.permissions||[`ROLE_USER`],rateLimit:e?.rateLimit||`100 req/min`,params:e?.params||[{name:`id`,type:`UUID`,required:!0,description:`Resource unique identifier`}],requestBody:e?.requestBody,responses:e?.responses||[{status:200,description:`Success`,body:`{
28
+ {{selection}}`,group:`Traduire`}],k=s.forwardRef(({value:e,onChange:n,aiEndpoint:r,systemPrompt:i=`You are an advanced AI writing assistant. Help the user write, edit, and improve their content.`,aiActions:o=O,enableCopilot:c=!0,copilotDebounceMs:u=500,aiHeaders:d,readOnly:f=!1,placeholder:p=`Tapez / pour les commandes, ou commencez a ecrire...`,className:m,editorClassName:h,minHeight:g=300,label:_,description:v,error:y,extraPlugins:b,editorRef:x},S)=>{let[C,w]=s.useState(null),[T,E]=s.useState(!1),D=s.useRef({aiEndpoint:r,systemPrompt:i,aiActions:o,enableCopilot:c,copilotDebounceMs:u,aiHeaders:d});return D.current={aiEndpoint:r,systemPrompt:i,aiActions:o,enableCopilot:c,copilotDebounceMs:u,aiHeaders:d},s.useEffect(()=>{let e=!1;return(async()=>{try{let[t,n,r,i,a,o,s,c,l,u]=await Promise.all([import(`platejs/react`),import(`@platejs/basic-nodes/react`),import(`@platejs/table/react`),import(`@platejs/layout/react`),import(`@platejs/callout/react`),import(`@platejs/ai/react`),import(`@platejs/markdown`),import(`@platejs/selection/react`),import(`@platejs/link/react`),import(`@platejs/indent/react`)]),d=D.current,f=[n.BoldPlugin,n.ItalicPlugin,n.UnderlinePlugin,n.StrikethroughPlugin,n.CodePlugin,n.HighlightPlugin,n.H1Plugin,n.H2Plugin,n.H3Plugin,n.H4Plugin,n.BlockquotePlugin,r.TablePlugin,r.TableRowPlugin,r.TableCellPlugin,r.TableCellHeaderPlugin,i.ColumnPlugin,i.ColumnItemPlugin,a.CalloutPlugin,l.LinkPlugin.configure({options:{allowedSchemes:[`http`,`https`,`mailto`,`tel`]}}),u.IndentPlugin,c.BlockSelectionPlugin,s.MarkdownPlugin,o.AIPlugin,o.AIChatPlugin.configure({options:{chat:{api:d.aiEndpoint,body:{system:d.systemPrompt},headers:d.aiHeaders}}})];d.enableCopilot&&o.CopilotPlugin&&f.push(o.CopilotPlugin.configure(({api:e})=>({options:{completeOptions:{api:d.aiEndpoint,body:{system:d.systemPrompt},headers:d.aiHeaders,onFinish:(t,n)=>{n!==`0`&&e.copilot.setBlockSuggestion({text:n})}},debounceDelay:d.copilotDebounceMs},shortcuts:{accept:{keys:`tab`},acceptNextWord:{keys:`mod+right`},reject:{keys:`escape`},triggerSuggestion:{keys:`ctrl+space`}}}))),e||w({Plate:t.Plate,PlateContent:t.PlateContent,usePlateEditor:t.usePlateEditor,plugins:f})}catch(t){console.error(`[WakaAIWriter] Failed to load plugins:`,t),e||E(!0)}})(),()=>{e=!0}},[]),C?(0,l.jsx)(A,{ref:S,bundle:C,value:e,onChange:n,readOnly:f,placeholder:p,className:m,editorClassName:h,minHeight:g,label:_,description:v,error:y,extraPlugins:b,editorRef:x}):(0,l.jsxs)(`div`,{ref:S,className:t.t(`space-y-1.5`,m),children:[_&&(0,l.jsx)(a.n,{children:_}),v&&(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:v}),(0,l.jsxs)(`div`,{className:`relative`,children:[(0,l.jsx)(a.t,{placeholder:p,disabled:!0,style:{minHeight:g},className:t.t(y&&`border-destructive`)}),(0,l.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-background/50 rounded-lg`,children:(0,l.jsx)(`span`,{className:`text-sm text-muted-foreground animate-pulse`,children:T?`Erreur de chargement de l'editeur IA`:`Chargement de l'editeur IA...`})})]}),y&&(0,l.jsx)(`p`,{className:`text-sm text-destructive`,children:y})]})});k.displayName=`WakaAIWriter`;var A=s.forwardRef(({bundle:{Plate:e,PlateContent:n,usePlateEditor:r,plugins:i},value:o,onChange:c,readOnly:u,placeholder:d,className:f,editorClassName:p,minHeight:m,label:h,description:g,error:_,extraPlugins:v,editorRef:y},b)=>{let x=r({plugins:s.useMemo(()=>[...i,...v??[]],[i,v]),value:o??[{type:`p`,children:[{text:``}]}]});return s.useEffect(()=>{y&&(y.current=x)},[x,y]),(0,l.jsxs)(`div`,{ref:b,className:t.t(`space-y-1.5`,f),children:[h&&(0,l.jsx)(a.n,{children:h}),g&&(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:g}),(0,l.jsx)(e,{editor:x,onChange:c?({value:e})=>c(e):void 0,readOnly:u,children:(0,l.jsxs)(`div`,{className:t.t(`border rounded-lg overflow-hidden`,_&&`border-destructive`,u&&`opacity-80`),children:[!u&&(0,l.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5 border-b bg-muted/30 text-xs text-muted-foreground`,children:[(0,l.jsx)(`kbd`,{className:`rounded border bg-muted px-1.5 py-0.5 font-mono text-[10px]`,children:`Ctrl+J`}),(0,l.jsx)(`span`,{children:`Ouvrir le menu IA`}),(0,l.jsx)(`span`,{className:`mx-1`,children:`|`}),(0,l.jsx)(`kbd`,{className:`rounded border bg-muted px-1.5 py-0.5 font-mono text-[10px]`,children:`/`}),(0,l.jsx)(`span`,{children:`Commandes`}),(0,l.jsx)(`span`,{className:`mx-1`,children:`|`}),(0,l.jsx)(`kbd`,{className:`rounded border bg-muted px-1.5 py-0.5 font-mono text-[10px]`,children:`Ctrl+Espace`}),(0,l.jsx)(`span`,{children:`Copilot`})]}),(0,l.jsx)(`div`,{style:{minHeight:m},children:(0,l.jsx)(n,{placeholder:d,readOnly:u,className:t.t(`prose prose-sm max-w-none p-4`,`focus-within:outline-none`,`[&_[data-slate-editor]]:outline-none [&_[data-slate-editor]]:min-h-[inherit]`,p)})})]})}),_&&(0,l.jsx)(`p`,{className:`text-sm text-destructive`,children:_})]})});A.displayName=`AIWriterInner`;var j=s.forwardRef(({value:e,onChange:n,readOnly:r=!1,placeholder:i=`Commencez a rediger votre document...`,className:o,editorClassName:c,minHeight:u=500,label:d,description:f,error:p,title:m,onTitleChange:h,showTOC:g=!0,enableMentions:_=!1,enableSlashCommands:v=!1,enableAI:y=!1,aiEndpoint:b,aiSystemPrompt:x,enableDnD:S=!1,enableMarkdown:C=!0,extraPlugins:w,editorRef:T},E)=>{let[D,O]=s.useState(null),[k,A]=s.useState(!1),[j,N]=s.useState([]),P=s.useRef({enableMentions:_,enableSlashCommands:v,enableAI:y,enableDnD:S,enableMarkdown:C,aiEndpoint:b,aiSystemPrompt:x});return P.current={enableMentions:_,enableSlashCommands:v,enableAI:y,enableDnD:S,enableMarkdown:C,aiEndpoint:b,aiSystemPrompt:x},s.useEffect(()=>{let e=!1;return(async()=>{try{let t=P.current,[n,r,i,a,o,s,c]=await Promise.all([import(`platejs/react`),import(`@platejs/basic-nodes/react`),import(`@platejs/table/react`),import(`@platejs/layout/react`),import(`@platejs/callout/react`),import(`@platejs/link/react`),import(`@platejs/indent/react`)]),l=[r.BoldPlugin,r.ItalicPlugin,r.UnderlinePlugin,r.StrikethroughPlugin,r.CodePlugin,r.HighlightPlugin,r.SuperscriptPlugin,r.SubscriptPlugin,r.H1Plugin,r.H2Plugin,r.H3Plugin,r.H4Plugin,r.H5Plugin,r.H6Plugin,r.BlockquotePlugin,i.TablePlugin,i.TableRowPlugin,i.TableCellPlugin,i.TableCellHeaderPlugin,a.ColumnPlugin,a.ColumnItemPlugin,o.CalloutPlugin,s.LinkPlugin.configure({options:{allowedSchemes:[`http`,`https`,`mailto`,`tel`]}}),c.IndentPlugin];try{let{TocPlugin:e}=await import(`@platejs/toc/react`);l.push(e)}catch{}try{let{BlockSelectionPlugin:e}=await import(`@platejs/selection/react`);l.push(e)}catch{}if(t.enableMentions)try{let{MentionPlugin:e,MentionInputPlugin:t}=await import(`@platejs/mention/react`);l.push(e.configure({options:{trigger:`@`,triggerPreviousCharPattern:/^$|^[\s"']$/,insertSpaceAfterMention:!0}}),t)}catch{}if(t.enableDnD)try{let{DndPlugin:e}=await import(`@platejs/dnd`);l.push(e)}catch{}if(t.enableMarkdown)try{let{MarkdownPlugin:e}=await import(`@platejs/markdown`);l.push(e)}catch{}if(t.enableAI&&t.aiEndpoint)try{let{AIPlugin:e,AIChatPlugin:n}=await import(`@platejs/ai/react`);l.push(e,n.configure({options:{chat:{api:t.aiEndpoint,body:{system:t.aiSystemPrompt??`You are a helpful writing assistant.`}}}}))}catch{}e||O({Plate:n.Plate,PlateContent:n.PlateContent,usePlateEditor:n.usePlateEditor,plugins:l})}catch(t){console.error(`[WakaDocumentEditor] Failed to load:`,t),e||A(!0)}})(),()=>{e=!0}},[]),s.useEffect(()=>{if(!g||!e){N([]);return}let t=[],n=0,r=new Set([`h1`,`h2`,`h3`,`h4`,`h5`,`h6`]);for(let i of e)if(r.has(i?.type)){let e=ee(i);if(e.trim()){let r=parseInt(i.type.replace(`h`,``),10);t.push({id:`toc-${n++}`,text:e.trim(),level:r,depth:r-1})}}N(t)},[e,g]),D?(0,l.jsx)(M,{ref:E,bundle:D,value:e,onChange:n,readOnly:r,placeholder:i,className:o,editorClassName:c,minHeight:u,label:d,description:f,error:p,title:m,onTitleChange:h,showTOC:g,toc:j,extraPlugins:w,editorRef:T}):(0,l.jsxs)(`div`,{ref:E,className:t.t(`space-y-1.5`,o),children:[d&&(0,l.jsx)(a.n,{children:d}),f&&(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:f}),(0,l.jsxs)(`div`,{className:`relative`,children:[(0,l.jsx)(a.t,{placeholder:i,disabled:!0,style:{minHeight:u}}),(0,l.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-background/50 rounded-lg`,children:(0,l.jsx)(`span`,{className:`text-sm text-muted-foreground animate-pulse`,children:k?`Erreur de chargement de l'editeur`:`Chargement de l'editeur...`})})]}),p&&(0,l.jsx)(`p`,{className:`text-sm text-destructive`,children:p})]})});j.displayName=`WakaDocumentEditor`;var M=s.forwardRef(({bundle:{Plate:e,PlateContent:r,usePlateEditor:i,plugins:o},value:c,onChange:u,readOnly:d,placeholder:f,className:p,editorClassName:m,minHeight:h,label:g,description:_,error:v,title:y,onTitleChange:b,showTOC:x,toc:S,extraPlugins:C,editorRef:w},T)=>{let E=i({plugins:s.useMemo(()=>[...o,...C??[]],[o,C]),value:c??[{type:`p`,children:[{text:``}]}]});return s.useEffect(()=>{w&&(w.current=E)},[E,w]),(0,l.jsxs)(`div`,{ref:T,className:t.t(`space-y-1.5`,p),children:[g&&(0,l.jsx)(a.n,{children:g}),_&&(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:_}),(0,l.jsx)(e,{editor:E,onChange:u?({value:e})=>u(e):void 0,readOnly:d,children:(0,l.jsxs)(`div`,{className:t.t(`flex border rounded-lg overflow-hidden`,v&&`border-destructive`),children:[x&&S.length>0&&(0,l.jsxs)(`aside`,{className:`w-56 shrink-0 border-r bg-muted/20 hidden lg:block`,children:[(0,l.jsx)(`div`,{className:`p-3 border-b`,children:(0,l.jsx)(`h4`,{className:`text-xs font-bold uppercase tracking-wider text-muted-foreground`,children:`Table des matieres`})}),(0,l.jsx)(n.d,{className:`h-full max-h-[600px]`,children:(0,l.jsx)(`nav`,{className:`p-2 space-y-0.5`,children:S.map(e=>(0,l.jsx)(`button`,{className:t.t(`block w-full text-left px-2 py-1 rounded-md text-sm`,`hover:bg-accent/50 transition-colors truncate`,`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${e.depth*12+8}px`},title:e.text,children:e.text},e.id))})})]}),(0,l.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(y!==void 0||b)&&(0,l.jsx)(`div`,{className:`border-b px-6 py-4`,children:(0,l.jsx)(`input`,{type:`text`,value:y??``,onChange:e=>b?.(e.target.value),placeholder:`Titre du document`,readOnly:d,className:t.t(`w-full bg-transparent text-2xl font-bold text-foreground`,`placeholder:text-muted-foreground/50`,`focus:outline-none`)})}),(0,l.jsx)(`div`,{style:{minHeight:h},children:(0,l.jsx)(r,{placeholder:f,readOnly:d,className:t.t(`prose prose-sm max-w-none px-6 py-4`,`focus-within:outline-none`,`[&_[data-slate-editor]]:outline-none [&_[data-slate-editor]]:min-h-[inherit]`,m)})})]})]})}),v&&(0,l.jsx)(`p`,{className:`text-sm text-destructive`,children:v})]})});M.displayName=`DocumentEditorInner`;function ee(e){return typeof e?.text==`string`?e.text:Array.isArray(e?.children)?e.children.map(e=>ee(e)).join(``):``}var N=s.forwardRef(({markdownValue:e=``,onMarkdownChange:n,slateValue:r,onSlateChange:o,defaultMode:c=`rich`,readOnly:u=!1,placeholder:d=`Commencez a ecrire...`,className:f,editorClassName:p,minHeight:m=300,label:h,description:g,error:_,extraPlugins:v,editorRef:y},b)=>{let[x,S]=s.useState(c),[C,w]=s.useState(null),[T,E]=s.useState(!1),[D,O]=s.useState(e);s.useEffect(()=>{O(e)},[e]),s.useEffect(()=>{let e=!1;return(async()=>{try{let[t,n,r,i,a,o,s]=await Promise.all([import(`platejs/react`),import(`@platejs/basic-nodes/react`),import(`@platejs/table/react`),import(`@platejs/layout/react`),import(`@platejs/callout/react`),import(`@platejs/link/react`),import(`@platejs/markdown`)]),c=[n.BoldPlugin,n.ItalicPlugin,n.UnderlinePlugin,n.StrikethroughPlugin,n.CodePlugin,n.HighlightPlugin,n.H1Plugin,n.H2Plugin,n.H3Plugin,n.H4Plugin,n.BlockquotePlugin,r.TablePlugin,r.TableRowPlugin,r.TableCellPlugin,r.TableCellHeaderPlugin,i.ColumnPlugin,i.ColumnItemPlugin,a.CalloutPlugin,o.LinkPlugin.configure({options:{allowedSchemes:[`http`,`https`,`mailto`]}}),s.MarkdownPlugin];e||w({Plate:t.Plate,PlateContent:t.PlateContent,usePlateEditor:t.usePlateEditor,plugins:c,serializeMd:s.serializeMd,deserializeMd:s.deserializeMd})}catch(t){console.error(`[WakaMarkdownEditor] Failed to load:`,t),e||E(!0)}})(),()=>{e=!0}},[]);let k=(0,l.jsx)(`div`,{className:`flex items-center gap-1 p-1 border-b bg-muted/30`,children:[`rich`,`markdown`,`split`].map(e=>(0,l.jsx)(i.n,{type:`button`,variant:x===e?`secondary`:`ghost`,size:`sm`,className:`h-7 text-xs`,onClick:()=>S(e),children:e===`rich`?`Editeur`:e===`markdown`?`Markdown`:`Split`},e))}),A=s.useCallback(e=>{O(e),n?.(e)},[n]);return(0,l.jsxs)(`div`,{ref:b,className:t.t(`space-y-1.5`,f),children:[h&&(0,l.jsx)(a.n,{children:h}),g&&(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:g}),(0,l.jsxs)(`div`,{className:t.t(`border rounded-lg overflow-hidden`,_&&`border-destructive`),children:[!u&&k,x===`markdown`&&(0,l.jsx)(P,{value:D,onChange:A,readOnly:u,placeholder:d,minHeight:m,className:p}),x===`rich`&&C&&(0,l.jsx)(te,{bundle:C,markdownValue:D,slateValue:r,onSlateChange:o,onMarkdownChange:n,readOnly:u,placeholder:d,minHeight:m,className:p,extraPlugins:v,editorRef:y}),x===`split`&&C&&(0,l.jsxs)(`div`,{className:`flex divide-x`,style:{minHeight:m},children:[(0,l.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,l.jsx)(te,{bundle:C,markdownValue:D,slateValue:r,onSlateChange:o,onMarkdownChange:n,readOnly:u,placeholder:d,minHeight:m,className:p,extraPlugins:v,editorRef:y})}),(0,l.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,l.jsx)(P,{value:D,onChange:A,readOnly:u,placeholder:`Markdown...`,minHeight:m})})]}),!C&&x!==`markdown`&&(0,l.jsx)(`div`,{className:`relative`,style:{minHeight:m},children:(0,l.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-background/50`,children:(0,l.jsx)(`span`,{className:`text-sm text-muted-foreground animate-pulse`,children:T?`Erreur de chargement`:`Chargement...`})})})]}),_&&(0,l.jsx)(`p`,{className:`text-sm text-destructive`,children:_})]})});N.displayName=`WakaMarkdownEditor`;function P({value:e,onChange:n,readOnly:r,placeholder:i,minHeight:o,className:s}){return(0,l.jsx)(a.t,{value:e,onChange:e=>n(e.target.value),readOnly:r,placeholder:i,style:{minHeight:o},className:t.t(`rounded-none border-0 resize-none font-mono text-sm`,`focus-visible:ring-0 focus-visible:ring-offset-0`,s)})}function te({bundle:{Plate:e,PlateContent:n,usePlateEditor:r,plugins:i,serializeMd:a},markdownValue:o,slateValue:c,onSlateChange:u,onMarkdownChange:d,readOnly:f,placeholder:p,minHeight:m,className:h,extraPlugins:g,editorRef:_}){let v=r({plugins:s.useMemo(()=>[...i,...g??[]],[i,g]),value:c??[{type:`p`,children:[{text:o||``}]}]});return s.useEffect(()=>{_&&(_.current=v)},[v,_]),(0,l.jsx)(e,{editor:v,onChange:s.useCallback(({value:e})=>{if(u?.(e),d&&a)try{d(a(v,{value:e}))}catch{}},[v,u,d,a]),readOnly:f,children:(0,l.jsx)(`div`,{style:{minHeight:m},children:(0,l.jsx)(n,{placeholder:p,readOnly:f,className:t.t(`prose prose-sm max-w-none p-4`,`focus-within:outline-none`,`[&_[data-slate-editor]]:outline-none [&_[data-slate-editor]]:min-h-[inherit]`,h)})})})}var ne=[{key:`user-story`,label:`User Story`,description:`En tant que [role], je veux [action] afin de [benefice]`,icon:c.Users,category:`Fonctionnel`,createNodes:()=>[{type:`callout`,variant:`info`,children:[{text:``}]},{type:`h3`,children:[{text:`User Story`}]},{type:`p`,children:[{text:`En tant que `,bold:!0},{text:`[role]`}]},{type:`p`,children:[{text:`Je veux `,bold:!0},{text:`[action]`}]},{type:`p`,children:[{text:`Afin de `,bold:!0},{text:`[benefice attendu]`}]},{type:`p`,children:[{text:``}]}]},{key:`acceptance-criteria`,label:`Criteres d'acceptation`,description:`Given/When/Then avec scenarios de validation`,icon:c.CheckCircle2,category:`Fonctionnel`,createNodes:()=>[{type:`h3`,children:[{text:`Criteres d'acceptation`}]},{type:`table`,children:[{type:`tr`,children:[{type:`th`,children:[{type:`p`,children:[{text:`#`,bold:!0}]}]},{type:`th`,children:[{type:`p`,children:[{text:`Scenario`,bold:!0}]}]},{type:`th`,children:[{type:`p`,children:[{text:`Given`,bold:!0}]}]},{type:`th`,children:[{type:`p`,children:[{text:`When`,bold:!0}]}]},{type:`th`,children:[{type:`p`,children:[{text:`Then`,bold:!0}]}]}]},{type:`tr`,children:[{type:`td`,children:[{type:`p`,children:[{text:`AC-01`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Nominal`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`L'utilisateur est connecte`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Il clique sur le bouton`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Le resultat s'affiche`}]}]}]},{type:`tr`,children:[{type:`td`,children:[{type:`p`,children:[{text:`AC-02`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Erreur`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Le service est indisponible`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Il clique sur le bouton`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Un message d'erreur s'affiche`}]}]}]}]},{type:`p`,children:[{text:``}]}]},{key:`use-case`,label:`Cas d'utilisation`,description:`Acteur, pre-conditions, flux nominal, flux alternatifs`,icon:c.GitBranch,category:`Fonctionnel`,createNodes:()=>[{type:`h3`,children:[{text:`Cas d'utilisation : [Nom]`}]},{type:`column_group`,children:[{type:`column`,children:[{type:`h4`,children:[{text:`ACTEUR`}]},{type:`p`,children:[{text:`[Role utilisateur]`}]},{type:`h4`,children:[{text:`PRE-CONDITIONS`}]},{type:`p`,children:[{text:`- L'utilisateur est authentifie`}]},{type:`p`,children:[{text:`- [Autre condition]`}]},{type:`h4`,children:[{text:`POST-CONDITIONS`}]},{type:`p`,children:[{text:`- [Etat apres execution]`}]}]},{type:`column`,children:[{type:`h4`,children:[{text:`FLUX NOMINAL`}]},{type:`p`,children:[{text:`1. L'utilisateur accede a la page`}]},{type:`p`,children:[{text:`2. Le systeme affiche le formulaire`}]},{type:`p`,children:[{text:`3. L'utilisateur remplit et soumet`}]},{type:`p`,children:[{text:`4. Le systeme enregistre et confirme`}]},{type:`h4`,children:[{text:`FLUX ALTERNATIFS`}]},{type:`p`,children:[{text:`3a. Donnees invalides : erreur affichee`}]}]}]},{type:`p`,children:[{text:``}]}]},{key:`api-endpoint`,label:`Endpoint API`,description:`Specification d'un endpoint REST avec requete/reponse`,icon:c.Zap,category:`Technique`,createNodes:()=>[{type:`h3`,children:[{text:`API: [METHOD] /api/v1/[resource]`}]},{type:`table`,children:[{type:`tr`,children:[{type:`th`,children:[{type:`p`,children:[{text:`Propriete`,bold:!0}]}]},{type:`th`,children:[{type:`p`,children:[{text:`Valeur`,bold:!0}]}]}]},{type:`tr`,children:[{type:`td`,children:[{type:`p`,children:[{text:`Methode`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`GET | POST | PUT | DELETE`}]}]}]},{type:`tr`,children:[{type:`td`,children:[{type:`p`,children:[{text:`Authentification`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Bearer JWT`}]}]}]},{type:`tr`,children:[{type:`td`,children:[{type:`p`,children:[{text:`Permissions`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`[ROLE_REQUIRED]`}]}]}]},{type:`tr`,children:[{type:`td`,children:[{type:`p`,children:[{text:`Rate Limit`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`100 req/min`}]}]}]}]},{type:`h4`,children:[{text:`CORPS DE LA REQUETE`}]},{type:`blockquote`,children:[{text:`{ "field": "value" }`}]},{type:`h4`,children:[{text:`REPONSE 200`}]},{type:`blockquote`,children:[{text:`{ "data": { ... }, "meta": { "total": 42 } }`}]},{type:`p`,children:[{text:``}]}]},{key:`data-model`,label:`Modele de donnees`,description:`Schema d'entite avec champs, types et contraintes`,icon:c.Database,category:`Technique`,createNodes:()=>[{type:`h3`,children:[{text:`Modele : [NomEntite]`}]},{type:`table`,children:[{type:`tr`,children:[{type:`th`,children:[{type:`p`,children:[{text:`Champ`,bold:!0}]}]},{type:`th`,children:[{type:`p`,children:[{text:`Type`,bold:!0}]}]},{type:`th`,children:[{type:`p`,children:[{text:`Nullable`,bold:!0}]}]},{type:`th`,children:[{type:`p`,children:[{text:`Description`,bold:!0}]}]}]},{type:`tr`,children:[{type:`td`,children:[{type:`p`,children:[{text:`id`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`UUID`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Non`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Identifiant unique`}]}]}]},{type:`tr`,children:[{type:`td`,children:[{type:`p`,children:[{text:`createdAt`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`DateTime`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Non`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Date de creation`}]}]}]}]},{type:`p`,children:[{text:``}]}]},{key:`security-requirements`,label:`Exigences de securite`,description:`Regles OWASP, chiffrement, acces, conformite`,icon:c.Shield,category:`Non-fonctionnel`,createNodes:()=>[{type:`h3`,children:[{text:`Exigences de securite`}]},{type:`callout`,variant:`warning`,children:[{text:`Section obligatoire pour les modules HDS et les donnees sensibles`}]},{type:`table`,children:[{type:`tr`,children:[{type:`th`,children:[{type:`p`,children:[{text:`Categorie`,bold:!0}]}]},{type:`th`,children:[{type:`p`,children:[{text:`Exigence`,bold:!0}]}]},{type:`th`,children:[{type:`p`,children:[{text:`Niveau`,bold:!0}]}]}]},{type:`tr`,children:[{type:`td`,children:[{type:`p`,children:[{text:`Authentification`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`OAuth2 PKCE via Keycloak`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Obligatoire`}]}]}]},{type:`tr`,children:[{type:`td`,children:[{type:`p`,children:[{text:`Chiffrement`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`AES-256-GCM au repos, TLS 1.3 en transit`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Obligatoire`}]}]}]},{type:`tr`,children:[{type:`td`,children:[{type:`p`,children:[{text:`Audit`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`TracingInterceptor sur toutes les operations`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Obligatoire`}]}]}]}]},{type:`p`,children:[{text:``}]}]},{key:`risk-assessment`,label:`Risques et mitigations`,description:`Matrice de risques projet avec probabilite et impact`,icon:c.AlertTriangle,category:`Non-fonctionnel`,createNodes:()=>[{type:`h3`,children:[{text:`Analyse des risques`}]},{type:`table`,children:[{type:`tr`,children:[{type:`th`,children:[{type:`p`,children:[{text:`Risque`,bold:!0}]}]},{type:`th`,children:[{type:`p`,children:[{text:`Probabilite`,bold:!0}]}]},{type:`th`,children:[{type:`p`,children:[{text:`Impact`,bold:!0}]}]},{type:`th`,children:[{type:`p`,children:[{text:`Mitigation`,bold:!0}]}]}]},{type:`tr`,children:[{type:`td`,children:[{type:`p`,children:[{text:`[Description du risque]`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Moyen`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Haut`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`[Plan de mitigation]`}]}]}]}]},{type:`p`,children:[{text:``}]}]},{key:`spec-header`,label:`En-tete de specification`,description:`Bloc d'en-tete avec version, auteur, statut, date`,icon:c.BookOpen,category:`Document`,createNodes:()=>[{type:`h1`,children:[{text:`[Titre de la specification]`}]},{type:`table`,children:[{type:`tr`,children:[{type:`td`,children:[{type:`p`,children:[{text:`Version`,bold:!0}]}]},{type:`td`,children:[{type:`p`,children:[{text:`1.0.0`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Statut`,bold:!0}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Brouillon`}]}]}]},{type:`tr`,children:[{type:`td`,children:[{type:`p`,children:[{text:`Auteur`,bold:!0}]}]},{type:`td`,children:[{type:`p`,children:[{text:`[Nom]`}]}]},{type:`td`,children:[{type:`p`,children:[{text:`Date`,bold:!0}]}]},{type:`td`,children:[{type:`p`,children:[{text:new Date().toLocaleDateString(`fr-FR`)}]}]}]}]},{type:`h2`,children:[{text:`CONTEXTE`}]},{type:`p`,children:[{text:`[Description du contexte et des objectifs]`}]},{type:`h2`,children:[{text:`PERIMETRE`}]},{type:`p`,children:[{text:`[Ce qui est inclus et exclu du perimetre]`}]},{type:`p`,children:[{text:``}]}]}],re=s.forwardRef(({value:e,onChange:n,readOnly:r=!1,placeholder:i=`Commencez votre specification...`,className:o,editorClassName:c,minHeight:u=500,label:d,description:f,error:p,customTemplates:m=[],showTemplateSidebar:h=!0,enableAI:g=!1,aiEndpoint:_,title:v,onTitleChange:y,extraPlugins:b,editorRef:x},S)=>{let[C,w]=s.useState(null),[T,E]=s.useState(!1),D=s.useRef(null),O=x??D,k=s.useMemo(()=>[...ne,...m],[m]),A=s.useMemo(()=>{let e=new Map;for(let t of k){let n=t.category||`Autre`;e.has(n)||e.set(n,[]),e.get(n).push(t)}return e},[k]);s.useEffect(()=>{let e=!1;return(async()=>{try{let[t,n,r,i,a,o,s]=await Promise.all([import(`platejs/react`),import(`@platejs/basic-nodes/react`),import(`@platejs/table/react`),import(`@platejs/layout/react`),import(`@platejs/callout/react`),import(`@platejs/link/react`),import(`@platejs/indent/react`)]),c=[n.BoldPlugin,n.ItalicPlugin,n.UnderlinePlugin,n.StrikethroughPlugin,n.CodePlugin,n.HighlightPlugin,n.SuperscriptPlugin,n.SubscriptPlugin,n.H1Plugin,n.H2Plugin,n.H3Plugin,n.H4Plugin,n.H5Plugin,n.H6Plugin,n.BlockquotePlugin,r.TablePlugin,r.TableRowPlugin,r.TableCellPlugin,r.TableCellHeaderPlugin,i.ColumnPlugin,i.ColumnItemPlugin,a.CalloutPlugin,o.LinkPlugin.configure({options:{allowedSchemes:[`http`,`https`,`mailto`,`tel`]}}),s.IndentPlugin];try{let{TocPlugin:e}=await import(`@platejs/toc/react`);c.push(e)}catch{}try{let{BlockSelectionPlugin:e}=await import(`@platejs/selection/react`);c.push(e)}catch{}try{let{MarkdownPlugin:e}=await import(`@platejs/markdown`);c.push(e)}catch{}if(g&&_)try{let{AIPlugin:e,AIChatPlugin:t}=await import(`@platejs/ai/react`);c.push(e,t.configure({options:{chat:{api:_,body:{system:`You are a specification writing assistant for a PaaS platform.`}}}}))}catch{}e||w({Plate:t.Plate,PlateContent:t.PlateContent,usePlateEditor:t.usePlateEditor,plugins:c})}catch(t){console.error(`[WakaSpecEditor] Failed to load:`,t),e||E(!0)}})(),()=>{e=!0}},[g,_]);let j=s.useCallback(t=>{let r=t.createNodes(),i=[...e??[],...r];n?.(i)},[e,n]);return(0,l.jsxs)(`div`,{ref:S,className:t.t(`space-y-1.5`,o),children:[d&&(0,l.jsx)(a.n,{children:d}),f&&(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:f}),(0,l.jsxs)(`div`,{className:t.t(`flex border rounded-lg overflow-hidden`,p&&`border-destructive`),children:[h&&!r&&(0,l.jsxs)(`aside`,{className:`w-52 shrink-0 border-r bg-muted/20 hidden md:block`,children:[(0,l.jsx)(`div`,{className:`p-3 border-b`,children:(0,l.jsx)(`h4`,{className:`text-xs font-bold uppercase tracking-wider text-muted-foreground`,children:`Blocs specification`})}),(0,l.jsx)(`div`,{className:`p-2 space-y-3 max-h-[600px] overflow-y-auto`,children:Array.from(A.entries()).map(([e,n])=>(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-wider text-muted-foreground px-1 mb-1`,children:e}),(0,l.jsx)(`div`,{className:`space-y-0.5`,children:n.map(e=>{let n=e.icon;return(0,l.jsxs)(`button`,{type:`button`,onClick:()=>j(e),className:t.t(`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left`,`text-xs transition-colors cursor-pointer`,`hover:bg-accent/50 text-muted-foreground hover:text-foreground`),title:e.description,children:[(0,l.jsx)(n,{className:`h-3.5 w-3.5 shrink-0`}),(0,l.jsx)(`span`,{className:`truncate`,children:e.label})]},e.key)})})]},e))})]}),(0,l.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(v!==void 0||y)&&(0,l.jsx)(`div`,{className:`border-b px-6 py-4`,children:(0,l.jsx)(`input`,{type:`text`,value:v??``,onChange:e=>y?.(e.target.value),placeholder:`Titre de la specification`,readOnly:r,className:t.t(`w-full bg-transparent text-xl font-bold text-foreground`,`placeholder:text-muted-foreground/50 focus:outline-none`)})}),C?(0,l.jsx)(ie,{bundle:C,value:e,onChange:n,readOnly:r,placeholder:i,editorClassName:c,minHeight:u,extraPlugins:b,editorRef:O}):(0,l.jsx)(`div`,{className:`relative`,style:{minHeight:u},children:(0,l.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-background/50`,children:(0,l.jsx)(`span`,{className:`text-sm text-muted-foreground animate-pulse`,children:T?`Erreur de chargement`:`Chargement de l'editeur...`})})})]})]}),p&&(0,l.jsx)(`p`,{className:`text-sm text-destructive`,children:p})]})});re.displayName=`WakaSpecEditor`;function ie({bundle:{Plate:e,PlateContent:n,usePlateEditor:r,plugins:i},value:a,onChange:o,readOnly:c,placeholder:u,editorClassName:d,minHeight:f,extraPlugins:p,editorRef:m}){let h=r({plugins:s.useMemo(()=>[...i,...p??[]],[i,p]),value:a??[{type:`p`,children:[{text:``}]}]});return s.useEffect(()=>{m&&(m.current=h)},[h,m]),(0,l.jsx)(e,{editor:h,onChange:o?({value:e})=>o(e):void 0,readOnly:c,children:(0,l.jsx)(`div`,{style:{minHeight:f},children:(0,l.jsx)(n,{placeholder:u,readOnly:c,className:t.t(`prose prose-sm max-w-none px-6 py-4`,`focus-within:outline-none`,`[&_[data-slate-editor]]:outline-none [&_[data-slate-editor]]:min-h-[inherit]`,d)})})})}var ae=s.forwardRef(({value:e,onChange:n,readOnly:r=!1,placeholder:i=`Glissez-deposez les blocs pour les reorganiser...`,className:o,editorClassName:c,minHeight:u=300,label:d,description:f,error:p,showDragHandles:m=!0,extraPlugins:h,editorRef:g},_)=>{let[v,y]=s.useState(null),[b,x]=s.useState(!1);return s.useEffect(()=>{let e=!1;return(async()=>{try{let[t,n,r,i,a,o,s,c]=await Promise.all([import(`platejs/react`),import(`@platejs/basic-nodes/react`),import(`@platejs/table/react`),import(`@platejs/layout/react`),import(`@platejs/callout/react`),import(`@platejs/link/react`),import(`@platejs/dnd`),import(`@platejs/selection/react`)]),l=[n.BoldPlugin,n.ItalicPlugin,n.UnderlinePlugin,n.StrikethroughPlugin,n.CodePlugin,n.HighlightPlugin,n.H1Plugin,n.H2Plugin,n.H3Plugin,n.H4Plugin,n.BlockquotePlugin,r.TablePlugin,r.TableRowPlugin,r.TableCellPlugin,r.TableCellHeaderPlugin,i.ColumnPlugin,i.ColumnItemPlugin,a.CalloutPlugin,o.LinkPlugin.configure({options:{allowedSchemes:[`http`,`https`,`mailto`,`tel`]}}),c.BlockSelectionPlugin,s.DndPlugin.configure({options:{enableScroller:!0}})];e||y({Plate:t.Plate,PlateContent:t.PlateContent,usePlateEditor:t.usePlateEditor,plugins:l})}catch(t){console.error(`[WakaDnDEditor] Failed to load:`,t),e||x(!0)}})(),()=>{e=!0}},[]),v?(0,l.jsx)(oe,{ref:_,bundle:v,value:e,onChange:n,readOnly:r,placeholder:i,className:o,editorClassName:c,minHeight:u,label:d,description:f,error:p,showDragHandles:m,extraPlugins:h,editorRef:g}):(0,l.jsxs)(`div`,{ref:_,className:t.t(`space-y-1.5`,o),children:[d&&(0,l.jsx)(a.n,{children:d}),f&&(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:f}),(0,l.jsxs)(`div`,{className:`relative`,children:[(0,l.jsx)(a.t,{placeholder:i,disabled:!0,style:{minHeight:u}}),(0,l.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-background/50 rounded-lg`,children:(0,l.jsx)(`span`,{className:`text-sm text-muted-foreground animate-pulse`,children:b?`Erreur de chargement`:`Chargement...`})})]}),p&&(0,l.jsx)(`p`,{className:`text-sm text-destructive`,children:p})]})});ae.displayName=`WakaDnDEditor`;var oe=s.forwardRef(({bundle:{Plate:e,PlateContent:n,usePlateEditor:r,plugins:i},value:o,onChange:c,readOnly:u,placeholder:d,className:f,editorClassName:p,minHeight:m,label:h,description:g,error:_,showDragHandles:v,extraPlugins:y,editorRef:b},x)=>{let S=r({plugins:s.useMemo(()=>[...i,...y??[]],[i,y]),value:o??[{type:`p`,children:[{text:``}]}]});return s.useEffect(()=>{b&&(b.current=S)},[S,b]),(0,l.jsxs)(`div`,{ref:x,className:t.t(`space-y-1.5`,f),children:[h&&(0,l.jsx)(a.n,{children:h}),g&&(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:g}),(0,l.jsx)(e,{editor:S,onChange:c?({value:e})=>c(e):void 0,readOnly:u,children:(0,l.jsxs)(`div`,{className:t.t(`border rounded-lg overflow-hidden`,_&&`border-destructive`),children:[!u&&v&&(0,l.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5 border-b bg-muted/30 text-xs text-muted-foreground`,children:[(0,l.jsx)(`span`,{className:`inline-block w-4 text-center`,children:`☰`}),(0,l.jsx)(`span`,{children:`Survolez un bloc pour voir la poignee de glissement`})]}),(0,l.jsx)(`div`,{style:{minHeight:m},children:(0,l.jsx)(n,{placeholder:d,readOnly:u,className:t.t(`prose prose-sm max-w-none p-4`,`focus-within:outline-none`,`[&_[data-slate-editor]]:outline-none [&_[data-slate-editor]]:min-h-[inherit]`,v&&`[&_[data-slate-node='element']]:relative [&_[data-slate-node='element']]:pl-6`,p)})})]})}),_&&(0,l.jsx)(`p`,{className:`text-sm text-destructive`,children:_})]})});oe.displayName=`DnDEditorInner`;var se=s.forwardRef(({value:e,onChange:n,readOnly:r=!1,placeholder:i=`Editez ensemble en temps reel...`,className:o,editorClassName:c,minHeight:u=400,label:d,description:f,error:p,documentId:m,currentUser:h,providers:g,maxParticipants:_=10,onUsersChange:v,showUsersBar:y=!0,extraPlugins:b,editorRef:x},S)=>{let[C,w]=s.useState(null),[T,E]=s.useState(!1),[D,O]=s.useState([h]),k=s.useRef({documentId:m,currentUser:h,providers:g,maxParticipants:_});return k.current={documentId:m,currentUser:h,providers:g,maxParticipants:_},s.useEffect(()=>{let e=!1;return(async()=>{try{let t=k.current,[n,r,i,a,o,s,c]=await Promise.all([import(`platejs/react`),import(`@platejs/basic-nodes/react`),import(`@platejs/table/react`),import(`@platejs/layout/react`),import(`@platejs/callout/react`),import(`@platejs/link/react`),import(`@platejs/yjs/react`)]),l=[r.BoldPlugin,r.ItalicPlugin,r.UnderlinePlugin,r.StrikethroughPlugin,r.CodePlugin,r.HighlightPlugin,r.H1Plugin,r.H2Plugin,r.H3Plugin,r.H4Plugin,r.BlockquotePlugin,i.TablePlugin,i.TableRowPlugin,i.TableCellPlugin,i.TableCellHeaderPlugin,a.ColumnPlugin,a.ColumnItemPlugin,o.CalloutPlugin,s.LinkPlugin.configure({options:{allowedSchemes:[`http`,`https`,`mailto`,`tel`]}})],u=t.providers.map(e=>e.type===`hocuspocus`?{type:`hocuspocus`,options:{name:e.roomName,url:e.url,...e.options}}:{type:`webrtc`,options:{roomName:e.roomName,maxConns:t.maxParticipants-1,signaling:[e.url],...e.options}});l.push(c.YjsPlugin.configure({options:{cursors:{data:{name:t.currentUser.name,color:t.currentUser.color}},providers:u}})),e||w({Plate:n.Plate,PlateContent:n.PlateContent,usePlateEditor:n.usePlateEditor,YjsPlugin:c.YjsPlugin,plugins:l})}catch(t){console.error(`[WakaCollaborativeEditor] Failed to load:`,t),e||E(!0)}})(),()=>{e=!0}},[]),s.useEffect(()=>{v?.(D)},[D,v]),C?(0,l.jsx)(ce,{ref:S,bundle:C,value:e,onChange:n,readOnly:r,placeholder:i,className:o,editorClassName:c,minHeight:u,label:d,description:f,error:p,documentId:m,currentUser:h,showUsersBar:y,connectedUsers:D,setConnectedUsers:O,extraPlugins:b,editorRef:x}):(0,l.jsxs)(`div`,{ref:S,className:t.t(`space-y-1.5`,o),children:[d&&(0,l.jsx)(a.n,{children:d}),f&&(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:f}),(0,l.jsxs)(`div`,{className:`relative`,children:[(0,l.jsx)(a.t,{placeholder:i,disabled:!0,style:{minHeight:u}}),(0,l.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-background/50 rounded-lg`,children:(0,l.jsx)(`span`,{className:`text-sm text-muted-foreground animate-pulse`,children:T?`Erreur de chargement (@platejs/yjs requis)`:`Connexion a la session collaborative...`})})]}),p&&(0,l.jsx)(`p`,{className:`text-sm text-destructive`,children:p})]})});se.displayName=`WakaCollaborativeEditor`;var ce=s.forwardRef(({bundle:{Plate:e,PlateContent:i,usePlateEditor:o,YjsPlugin:c,plugins:u},value:d,onChange:f,readOnly:p,placeholder:m,className:h,editorClassName:g,minHeight:_,label:v,description:y,error:b,documentId:x,showUsersBar:S,connectedUsers:C,extraPlugins:w,editorRef:T},E)=>{let D=o({plugins:s.useMemo(()=>[...u,...w??[]],[u,w]),skipInitialization:!0},[x]);return s.useEffect(()=>{try{D.getApi(c).yjs.init({id:x,autoSelect:`end`,value:d??[{type:`p`,children:[{text:``}]}]})}catch{}return()=>{try{D.getApi(c).yjs.destroy()}catch{}}},[D,x,c,d]),s.useEffect(()=>{T&&(T.current=D)},[D,T]),(0,l.jsxs)(`div`,{ref:E,className:t.t(`space-y-1.5`,h),children:[v&&(0,l.jsx)(a.n,{children:v}),y&&(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:y}),(0,l.jsx)(e,{editor:D,onChange:f?({value:e})=>f(e):void 0,readOnly:p,children:(0,l.jsxs)(`div`,{className:t.t(`border rounded-lg overflow-hidden`,b&&`border-destructive`),children:[S&&(0,l.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5 border-b bg-muted/30`,children:[(0,l.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`En ligne :`}),(0,l.jsx)(`div`,{className:`flex items-center -space-x-1.5`,children:C.map(e=>(0,l.jsx)(n.p,{className:`h-6 w-6 border-2 border-background`,children:(0,l.jsx)(n.m,{className:`text-[10px] text-white font-bold`,style:{backgroundColor:e.color},children:e.name.slice(0,2).toUpperCase()})},e.id))}),(0,l.jsxs)(r.t,{variant:`secondary`,className:`text-[10px] h-5`,children:[C.length,` connecte`,C.length>1?`s`:``]})]}),(0,l.jsx)(`div`,{style:{minHeight:_},children:(0,l.jsx)(i,{placeholder:m,readOnly:p,className:t.t(`prose prose-sm max-w-none p-4`,`focus-within:outline-none`,`[&_[data-slate-editor]]:outline-none [&_[data-slate-editor]]:min-h-[inherit]`,g)})})]})}),b&&(0,l.jsx)(`p`,{className:`text-sm text-destructive`,children:b})]})});ce.displayName=`CollabEditorInner`;var le=s.forwardRef(({original:e,modified:n,mode:i=`inline`,label:o,description:c,className:u,editorClassName:d,minHeight:f=200,showStats:p=!0,originalLabel:m=`Original`,modifiedLabel:h=`Modifie`,onDiffComputed:g},_)=>{let[v,y]=s.useState(null),[b,x]=s.useState({added:0,removed:0,modified:0,unchanged:0}),[S,C]=s.useState(!1);return s.useEffect(()=>{let t=!1;return(async()=>{try{let r=await import(`@platejs/diff`);if(r.computeDiff){let i=r.computeDiff(e,n);if(!t){y(i);let e={added:0,removed:0,modified:0,unchanged:0};if(Array.isArray(i))for(let t of i)t.diff===`insert`||t.diffOperation?.type===`insert`?e.added++:t.diff===`delete`||t.diffOperation?.type===`delete`?e.removed++:t.diff===`update`||t.diffOperation?.type===`update`?e.modified++:e.unchanged++;x(e),g?.(e)}}}catch(e){console.error(`[WakaDiffViewer] Failed to compute diff:`,e),t||C(!0)}})(),()=>{t=!0}},[e,n,g]),S||!v?(0,l.jsxs)(`div`,{ref:_,className:t.t(`space-y-1.5`,u),children:[o&&(0,l.jsx)(a.n,{children:o}),c&&(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:c}),S?(0,l.jsx)(fe,{original:e,modified:n,mode:i,originalLabel:m,modifiedLabel:h,minHeight:f,editorClassName:d}):(0,l.jsx)(`div`,{className:`flex items-center justify-center border rounded-lg bg-muted/30`,style:{minHeight:f},children:(0,l.jsx)(`span`,{className:`text-sm text-muted-foreground animate-pulse`,children:`Calcul des differences...`})})]}):(0,l.jsxs)(`div`,{ref:_,className:t.t(`space-y-1.5`,u),children:[o&&(0,l.jsx)(a.n,{children:o}),c&&(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:c}),(0,l.jsxs)(`div`,{className:t.t(`border rounded-lg overflow-hidden`),children:[p&&(0,l.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-2 border-b bg-muted/30`,children:[(0,l.jsx)(`span`,{className:`text-xs text-muted-foreground font-medium`,children:`Differences :`}),b.added>0&&(0,l.jsxs)(r.t,{variant:`secondary`,className:`bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300 text-[10px] h-5`,children:[`+`,b.added,` ajout`,b.added>1?`s`:``]}),b.removed>0&&(0,l.jsxs)(r.t,{variant:`secondary`,className:`bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300 text-[10px] h-5`,children:[`-`,b.removed,` suppression`,b.removed>1?`s`:``]}),b.modified>0&&(0,l.jsxs)(r.t,{variant:`secondary`,className:`bg-amber-100 text-amber-800 dark:bg-amber-900/30 dark:text-amber-300 text-[10px] h-5`,children:[`~`,b.modified,` modification`,b.modified>1?`s`:``]}),b.added===0&&b.removed===0&&b.modified===0&&(0,l.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Aucune difference`})]}),i===`side-by-side`?(0,l.jsxs)(`div`,{className:`flex divide-x`,style:{minHeight:f},children:[(0,l.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,l.jsx)(`div`,{className:`px-3 py-1.5 border-b bg-red-50/50 dark:bg-red-950/10 text-xs font-medium text-muted-foreground`,children:m}),(0,l.jsx)(F,{nodes:e,diffType:`original`,className:d})]}),(0,l.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,l.jsx)(`div`,{className:`px-3 py-1.5 border-b bg-green-50/50 dark:bg-green-950/10 text-xs font-medium text-muted-foreground`,children:h}),(0,l.jsx)(F,{nodes:n,diffType:`modified`,className:d})]})]}):(0,l.jsx)(`div`,{style:{minHeight:f},children:(0,l.jsx)(ue,{diffNodes:v,className:d})})]})]})});le.displayName=`WakaDiffViewer`;function F({nodes:e,diffType:n,className:r}){return(0,l.jsx)(`div`,{className:t.t(`prose prose-sm max-w-none p-4 text-sm`,r),children:e.map((e,t)=>(0,l.jsx)(de,{node:e,diffType:n},t))})}function ue({diffNodes:e,className:n}){return(0,l.jsx)(`div`,{className:t.t(`prose prose-sm max-w-none p-4 text-sm`,n),children:e.map((e,n)=>{let r=e.diff||e.diffOperation?.type,i=``;return r===`insert`?i=`bg-green-100/60 dark:bg-green-900/20`:r===`delete`?i=`bg-red-100/60 dark:bg-red-900/20 line-through opacity-60`:r===`update`&&(i=`bg-amber-100/60 dark:bg-amber-900/20`),(0,l.jsx)(`div`,{className:t.t(`rounded px-1 -mx-1`,i),children:(0,l.jsx)(de,{node:e,diffType:`modified`})},n)})})}function de({node:e,diffType:t}){if(!e)return null;let n=pe(e);switch(e.type||`p`){case`h1`:return(0,l.jsx)(`h1`,{className:`text-xl font-bold mt-4 mb-1`,children:n});case`h2`:return(0,l.jsx)(`h2`,{className:`text-lg font-semibold mt-3 mb-1`,children:n});case`h3`:return(0,l.jsx)(`h3`,{className:`text-base font-semibold mt-2 mb-1`,children:n});case`blockquote`:return(0,l.jsx)(`blockquote`,{className:`border-l-2 border-muted-foreground/30 pl-3 italic text-muted-foreground`,children:n});default:return(0,l.jsx)(`p`,{className:`my-0.5 leading-relaxed`,children:n||`\xA0`})}}function fe({original:e,modified:t,mode:n,originalLabel:r,modifiedLabel:i,minHeight:a,editorClassName:o}){return n===`side-by-side`?(0,l.jsxs)(`div`,{className:`flex divide-x border rounded-lg overflow-hidden`,style:{minHeight:a},children:[(0,l.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,l.jsx)(`div`,{className:`px-3 py-1.5 border-b bg-red-50/50 dark:bg-red-950/10 text-xs font-medium text-muted-foreground`,children:r}),(0,l.jsx)(F,{nodes:e,diffType:`original`,className:o})]}),(0,l.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,l.jsx)(`div`,{className:`px-3 py-1.5 border-b bg-green-50/50 dark:bg-green-950/10 text-xs font-medium text-muted-foreground`,children:i}),(0,l.jsx)(F,{nodes:t,diffType:`modified`,className:o})]})]}):(0,l.jsx)(`div`,{className:`border rounded-lg overflow-hidden`,style:{minHeight:a},children:(0,l.jsxs)(`div`,{className:`p-4 text-sm text-muted-foreground`,children:[`Installez `,(0,l.jsx)(`code`,{className:`bg-muted px-1 rounded`,children:`@platejs/diff`}),` pour la visualisation unifiee des differences.`]})})}function pe(e){return typeof e?.text==`string`?e.text:Array.isArray(e?.children)?e.children.map(e=>pe(e)).join(``):``}var me=s.forwardRef(({value:e,onChange:n,readOnly:r=!1,placeholder:i=`Tapez @ pour mentionner un utilisateur...`,className:o,editorClassName:c,minHeight:u=200,label:d,description:f,error:p,onSearch:m,onMentionInserted:h,trigger:g=`@`,searchDebounceMs:_=300,maxResults:v=8,extraPlugins:y,editorRef:b},x)=>{let[S,C]=s.useState(null),[w,T]=s.useState(!1),[E,D]=s.useState([]),[O,k]=s.useState(!1),A=s.useRef(),j=s.useRef({onSearch:m,trigger:g,searchDebounceMs:_,maxResults:v,onMentionInserted:h});j.current={onSearch:m,trigger:g,searchDebounceMs:_,maxResults:v,onMentionInserted:h},s.useEffect(()=>{let e=!1;return(async()=>{try{let t=j.current,[n,r,i,a,o,s,c]=await Promise.all([import(`platejs/react`),import(`@platejs/basic-nodes/react`),import(`@platejs/table/react`),import(`@platejs/layout/react`),import(`@platejs/callout/react`),import(`@platejs/link/react`),import(`@platejs/mention/react`)]),l=[r.BoldPlugin,r.ItalicPlugin,r.UnderlinePlugin,r.StrikethroughPlugin,r.CodePlugin,r.HighlightPlugin,r.H1Plugin,r.H2Plugin,r.H3Plugin,r.H4Plugin,r.BlockquotePlugin,i.TablePlugin,i.TableRowPlugin,i.TableCellPlugin,i.TableCellHeaderPlugin,a.ColumnPlugin,a.ColumnItemPlugin,o.CalloutPlugin,s.LinkPlugin.configure({options:{allowedSchemes:[`http`,`https`,`mailto`,`tel`]}}),c.MentionPlugin.configure({options:{trigger:t.trigger,triggerPreviousCharPattern:/^$|^[\s"']$/,insertSpaceAfterMention:!0}}),c.MentionInputPlugin];e||C({Plate:n.Plate,PlateContent:n.PlateContent,usePlateEditor:n.usePlateEditor,plugins:l})}catch(t){console.error(`[WakaMentionEditor] Failed to load:`,t),e||T(!0)}})(),()=>{e=!0}},[]);let M=s.useCallback(e=>{if(A.current&&clearTimeout(A.current),!e.trim()){D([]),k(!1);return}k(!0),A.current=setTimeout(async()=>{try{let t=j.current;D((await t.onSearch(e)).slice(0,t.maxResults))}catch{D([])}finally{k(!1)}},j.current.searchDebounceMs)},[]);return S?(0,l.jsx)(he,{ref:x,bundle:S,value:e,onChange:n,readOnly:r,placeholder:i,className:o,editorClassName:c,minHeight:u,label:d,description:f,error:p,suggestions:E,searching:O,onSearch:M,onMentionInserted:h,extraPlugins:y,editorRef:b}):(0,l.jsxs)(`div`,{ref:x,className:t.t(`space-y-1.5`,o),children:[d&&(0,l.jsx)(a.n,{children:d}),f&&(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:f}),(0,l.jsxs)(`div`,{className:`relative`,children:[(0,l.jsx)(a.t,{placeholder:i,disabled:!0,style:{minHeight:u}}),(0,l.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-background/50 rounded-lg`,children:(0,l.jsx)(`span`,{className:`text-sm text-muted-foreground animate-pulse`,children:w?`Erreur (@platejs/mention requis)`:`Chargement...`})})]}),p&&(0,l.jsx)(`p`,{className:`text-sm text-destructive`,children:p})]})});me.displayName=`WakaMentionEditor`;var he=s.forwardRef(({bundle:{Plate:e,PlateContent:n,usePlateEditor:r,plugins:i},value:o,onChange:c,readOnly:u,placeholder:d,className:f,editorClassName:p,minHeight:m,label:h,description:g,error:_,suggestions:v,searching:y,extraPlugins:b,editorRef:x},S)=>{let C=r({plugins:s.useMemo(()=>[...i,...b??[]],[i,b]),value:o??[{type:`p`,children:[{text:``}]}]});return s.useEffect(()=>{x&&(x.current=C)},[C,x]),(0,l.jsxs)(`div`,{ref:S,className:t.t(`space-y-1.5`,f),children:[h&&(0,l.jsx)(a.n,{children:h}),g&&(0,l.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:g}),(0,l.jsx)(e,{editor:C,onChange:c?({value:e})=>c(e):void 0,readOnly:u,children:(0,l.jsxs)(`div`,{className:t.t(`border rounded-lg overflow-hidden relative`,_&&`border-destructive`),children:[(0,l.jsx)(`div`,{style:{minHeight:m},children:(0,l.jsx)(n,{placeholder:d,readOnly:u,className:t.t(`prose prose-sm max-w-none p-4`,`focus-within:outline-none`,`[&_[data-slate-editor]]:outline-none [&_[data-slate-editor]]:min-h-[inherit]`,p)})}),v.length>0&&(0,l.jsx)(I,{suggestions:v,searching:y})]})}),_&&(0,l.jsx)(`p`,{className:`text-sm text-destructive`,children:_})]})});he.displayName=`MentionEditorInner`;function I({suggestions:e,searching:r,className:i,onSelect:a}){return(0,l.jsxs)(`div`,{className:t.t(`absolute z-50 w-64 max-h-60 overflow-y-auto`,`rounded-lg border bg-popover shadow-lg`,`p-1 mt-1`,i),children:[r&&(0,l.jsx)(`div`,{className:`px-2 py-1.5 text-xs text-muted-foreground animate-pulse`,children:`Recherche...`}),e.map(e=>(0,l.jsxs)(`button`,{type:`button`,className:t.t(`flex w-full items-center gap-2.5 rounded-md px-2 py-1.5 text-left`,`text-sm transition-colors cursor-pointer`,`hover:bg-accent/50`),onClick:()=>a?.(e),children:[(0,l.jsxs)(n.p,{className:`h-6 w-6`,children:[e.avatar&&(0,l.jsx)(n.h,{src:e.avatar,alt:e.name}),(0,l.jsx)(n.m,{className:`text-[10px] bg-primary/10 text-primary`,children:e.name.slice(0,2).toUpperCase()})]}),(0,l.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,l.jsx)(`div`,{className:`font-medium truncate`,children:e.name}),e.email&&(0,l.jsx)(`div`,{className:`text-xs text-muted-foreground truncate`,children:e.email})]}),e.role&&(0,l.jsx)(`span`,{className:`text-[10px] text-muted-foreground shrink-0`,children:e.role})]},e.id))]})}I.displayName=`MentionSuggestions`;function ge({children:e,attributes:n,className:r}){return(0,l.jsx)(`table`,{...n,className:t.t(`w-full border-collapse text-sm my-4`,`border border-border rounded-lg overflow-hidden`,r),children:(0,l.jsx)(`tbody`,{children:e})})}ge.displayName=`TableElement`;function _e({children:e,attributes:n,className:r}){return(0,l.jsx)(`tr`,{...n,className:t.t(`border-b border-border last:border-b-0`,r),children:e})}_e.displayName=`TableRowElement`;function ve({children:e,attributes:n,className:r}){return(0,l.jsx)(`td`,{...n,className:t.t(`px-3 py-2 text-sm text-foreground`,`border-r border-border last:border-r-0`,r),children:e})}ve.displayName=`TableCellElement`;function ye({children:e,attributes:n,className:r}){return(0,l.jsx)(`th`,{...n,className:t.t(`px-3 py-2 text-xs font-bold uppercase tracking-wider`,`text-muted-foreground text-left bg-muted/50`,`border-r border-border last:border-r-0`,r),children:e})}ye.displayName=`TableCellHeaderElement`;function be({children:e,attributes:n,className:r}){return(0,l.jsx)(`div`,{...n,className:t.t(`flex gap-6 my-4`,r),children:e})}be.displayName=`ColumnGroupElement`;function xe({children:e,attributes:n,className:r}){return(0,l.jsx)(`div`,{...n,className:t.t(`flex-1 min-w-0`,r),children:e})}xe.displayName=`ColumnElement`;var Se={info:`bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-950/30 dark:border-blue-800 dark:text-blue-200`,warning:`bg-amber-50 border-amber-200 text-amber-900 dark:bg-amber-950/30 dark:border-amber-800 dark:text-amber-200`,success:`bg-green-50 border-green-200 text-green-900 dark:bg-green-950/30 dark:border-green-800 dark:text-green-200`,error:`bg-red-50 border-red-200 text-red-900 dark:bg-red-950/30 dark:border-red-800 dark:text-red-200`,dark:`bg-card border-border text-card-foreground`};function Ce({children:e,attributes:n,element:r,className:i}){let a=Se[r?.variant||`info`]??Se.info;return(0,l.jsx)(`div`,{...n,className:t.t(`border rounded-xl p-4 my-3`,a,i),children:e})}Ce.displayName=`CalloutElement`;function we({children:e,attributes:n,className:r}){return(0,l.jsx)(`h1`,{...n,className:t.t(`text-2xl font-extrabold text-foreground mt-8 mb-2 first:mt-0`,r),children:e})}we.displayName=`H1Element`;function Te({children:e,attributes:n,className:r}){return(0,l.jsx)(`h2`,{...n,className:t.t(`text-sm font-bold text-foreground uppercase tracking-wider`,`mt-6 mb-3 border-b-2 border-border pb-1.5`,r),children:e})}Te.displayName=`H2Element`;function Ee({children:e,attributes:n,className:r}){return(0,l.jsx)(`h3`,{...n,className:t.t(`text-sm font-semibold text-primary italic mt-1 mb-4`,r),children:e})}Ee.displayName=`H3Element`;function De({children:e,attributes:n,className:r}){return(0,l.jsx)(`h4`,{...n,className:t.t(`text-xs font-bold text-primary uppercase tracking-wide mt-2 mb-0.5`,r),children:e})}De.displayName=`H4Element`;function Oe({children:e,attributes:n,className:r}){return(0,l.jsx)(`h5`,{...n,className:t.t(`text-xs font-semibold text-muted-foreground mt-2 mb-0.5`,r),children:e})}Oe.displayName=`H5Element`;function ke({children:e,attributes:n,className:r}){return(0,l.jsx)(`h6`,{...n,className:t.t(`text-xs font-medium text-muted-foreground mt-2 mb-0.5`,r),children:e})}ke.displayName=`H6Element`;function Ae({children:e,attributes:n,className:r}){return(0,l.jsx)(`blockquote`,{...n,className:t.t(`border-l-3 border-primary/50 pl-4 py-2`,`bg-muted/30 rounded-r-lg`,`italic text-muted-foreground`,`my-3`,r),children:e})}Ae.displayName=`BlockquoteElement`;function je({children:e,attributes:n,className:r}){return(0,l.jsx)(`p`,{...n,className:t.t(`text-sm leading-relaxed text-foreground my-0.5`,r),children:e})}je.displayName=`ParagraphElement`;function Me({children:e,attributes:n,element:r,className:i}){return(0,l.jsx)(`a`,{...n,href:r?.url,target:`_blank`,rel:`noopener noreferrer`,className:t.t(`text-primary underline decoration-primary/30 hover:decoration-primary`,`transition-colors cursor-pointer`,i),children:e})}Me.displayName=`LinkElement`;function Ne({children:e,attributes:n,element:r,className:i}){return(0,l.jsxs)(`span`,{...n,contentEditable:!1,className:t.t(`inline-flex items-center rounded-md px-1.5 py-0.5`,`bg-primary/10 text-primary text-sm font-medium`,`border border-primary/20`,i),children:[`@`,r?.value||`unknown`,e]})}Ne.displayName=`MentionElement`;function Pe({attributes:e,className:n}){return(0,l.jsx)(`div`,{...e,className:t.t(`my-6`,n),children:(0,l.jsx)(`hr`,{className:`border-border`})})}Pe.displayName=`SeparatorElement`;function Fe({children:e,attributes:n,className:r}){return(0,l.jsx)(`strong`,{...n,className:t.t(`font-bold`,r),children:e})}Fe.displayName=`BoldLeaf`;function Ie({children:e,attributes:n,className:r}){return(0,l.jsx)(`em`,{...n,className:t.t(`italic`,r),children:e})}Ie.displayName=`ItalicLeaf`;function Le({children:e,attributes:n,className:r}){return(0,l.jsx)(`span`,{...n,className:t.t(`underline decoration-foreground/50`,r),children:e})}Le.displayName=`UnderlineLeaf`;function Re({children:e,attributes:n,className:r}){return(0,l.jsx)(`s`,{...n,className:t.t(`line-through text-muted-foreground`,r),children:e})}Re.displayName=`StrikethroughLeaf`;function ze({children:e,attributes:n,className:r}){return(0,l.jsx)(`code`,{...n,className:t.t(`rounded-md bg-muted px-1.5 py-0.5`,`font-mono text-[0.85em] text-foreground`,r),children:e})}ze.displayName=`CodeLeaf`;function Be({children:e,attributes:n,className:r}){return(0,l.jsx)(`mark`,{...n,className:t.t(`bg-yellow-200/60 dark:bg-yellow-500/30`,`rounded-sm px-0.5`,r),children:e})}Be.displayName=`HighlightLeaf`;function Ve({children:e,attributes:n,className:r}){return(0,l.jsx)(`sup`,{...n,className:t.t(`text-[0.75em]`,r),children:e})}Ve.displayName=`SuperscriptLeaf`;function He({children:e,attributes:n,className:r}){return(0,l.jsx)(`sub`,{...n,className:t.t(`text-[0.75em]`,r),children:e})}He.displayName=`SubscriptLeaf`;var L=`user_story`,R={must:{label:`Must Have`,color:`text-red-700 dark:text-red-400`,bg:`bg-red-50 dark:bg-red-500/10`},should:{label:`Should Have`,color:`text-amber-700 dark:text-amber-400`,bg:`bg-amber-50 dark:bg-amber-500/10`},could:{label:`Could Have`,color:`text-blue-700 dark:text-blue-400`,bg:`bg-blue-50 dark:bg-blue-500/10`},wont:{label:`Won't Have`,color:`text-gray-500 dark:text-gray-400`,bg:`bg-gray-50 dark:bg-gray-500/10`}};function z({label:e,icon:n,value:r,placeholder:i,readOnly:a,onChange:o}){return(0,l.jsxs)(`div`,{className:`flex items-start gap-3 group`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-1.5 pt-1 shrink-0 w-[90px]`,children:[(0,l.jsx)(`span`,{className:`text-blue-500 dark:text-blue-400`,children:n}),(0,l.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-wider text-blue-600 dark:text-blue-400`,children:e})]}),(0,l.jsx)(`div`,{className:`flex-1 min-w-0`,children:a?(0,l.jsx)(`p`,{className:`text-sm text-foreground py-1`,children:r||(0,l.jsx)(`span`,{className:`text-muted-foreground italic`,children:i})}):(0,l.jsx)(`input`,{type:`text`,value:r,onChange:e=>o?.(e.target.value),placeholder:i,className:t.t(`w-full bg-transparent text-sm text-foreground py-1 px-0`,`border-0 border-b border-transparent`,`focus:border-blue-300 dark:focus:border-blue-600`,`focus:outline-none transition-colors`,`placeholder:text-muted-foreground/50 placeholder:italic`)})})]})}function B({attributes:e,children:n,element:r,className:i}){let a=r,o=a?.priority,s=a?.storyId,c=a?.points;return(0,l.jsxs)(`div`,{...e,contentEditable:!1,className:t.t(`relative my-4 rounded-lg overflow-hidden`,`border-l-4 border-blue-500 dark:border-blue-400`,`bg-blue-50/50 dark:bg-blue-950/20`,`border border-blue-200/60 dark:border-blue-800/40`,`shadow-sm hover:shadow-md transition-shadow duration-200`,i),children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2 bg-blue-100/50 dark:bg-blue-900/20 border-b border-blue-200/40 dark:border-blue-800/30`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,l.jsx)(`svg`,{className:`h-4 w-4 text-blue-600 dark:text-blue-400`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,"aria-hidden":`true`,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z`})}),(0,l.jsx)(`span`,{className:`text-xs font-bold uppercase tracking-wider text-blue-700 dark:text-blue-300`,children:`User Story`}),s&&(0,l.jsx)(`span`,{className:`text-[10px] font-mono font-semibold text-blue-500 dark:text-blue-400 bg-blue-100 dark:bg-blue-800/40 px-1.5 py-0.5 rounded`,children:s})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[c!==void 0&&(0,l.jsx)(`span`,{className:`inline-flex items-center justify-center h-5 min-w-[20px] px-1 rounded-full bg-blue-200 dark:bg-blue-700/50 text-[10px] font-bold text-blue-800 dark:text-blue-200`,children:c}),o&&R[o]&&(0,l.jsx)(`span`,{className:t.t(`text-[10px] font-semibold px-2 py-0.5 rounded-full`,R[o].bg,R[o].color),children:R[o].label})]})]}),(0,l.jsxs)(`div`,{className:`px-4 py-3 space-y-2`,children:[(0,l.jsx)(z,{label:`As a`,icon:(0,l.jsx)(`svg`,{className:`h-3 w-3`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z`})}),value:a?.role||``,placeholder:`role (e.g. platform administrator)`,readOnly:!0}),(0,l.jsx)(z,{label:`I want`,icon:(0,l.jsx)(`svg`,{className:`h-3 w-3`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M13 10V3L4 14h7v7l9-11h-7z`})}),value:a?.action||``,placeholder:`action (e.g. to deploy services with one click)`,readOnly:!0}),(0,l.jsx)(z,{label:`So that`,icon:(0,l.jsx)(`svg`,{className:`h-3 w-3`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z`})}),value:a?.benefit||``,placeholder:`benefit (e.g. I can reduce time-to-market)`,readOnly:!0})]}),(0,l.jsx)(`div`,{className:`hidden`,children:n})]})}B.displayName=`WakaUserStoryBlock`;function Ue(e){return[{type:L,role:e?.role||``,action:e?.action||``,benefit:e?.benefit||``,storyId:e?.storyId,priority:e?.priority,points:e?.points,children:[{text:``}]}]}async function We(){try{let{createPlatePlugin:e}=await import(`platejs/react`);return e({key:L,node:{isElement:!0,isVoid:!0,type:L,component:B}})}catch{return console.warn(`[WakaUserStoryBlock] platejs not installed`),null}}var V=`acceptance_criteria`;function H({keyword:e,variant:n}){return(0,l.jsx)(`span`,{className:t.t(`inline-block text-[10px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded shrink-0 w-[52px] text-center`,{given:`bg-violet-100 text-violet-700 dark:bg-violet-500/15 dark:text-violet-400`,when:`bg-amber-100 text-amber-700 dark:bg-amber-500/15 dark:text-amber-400`,then:`bg-emerald-100 text-emerald-700 dark:bg-emerald-500/15 dark:text-emerald-400`}[n]),children:e})}function Ge({criterion:e,index:n,readOnly:r}){let[i,a]=s.useState(!0);return(0,l.jsxs)(`div`,{className:t.t(`rounded-lg border transition-all duration-200`,e.validated?`border-emerald-200 dark:border-emerald-800/40 bg-emerald-50/30 dark:bg-emerald-950/10`:`border-border bg-card/50`),children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-3 px-3 py-2`,children:[(0,l.jsx)(`button`,{type:`button`,disabled:r,className:t.t(`flex-shrink-0 h-5 w-5 rounded-md border-2 flex items-center justify-center transition-all duration-200`,e.validated?`bg-emerald-500 border-emerald-500 text-white`:`border-border hover:border-emerald-400`,r&&`cursor-default`),"aria-label":e.validated?`Mark as not validated`:`Mark as validated`,"aria-checked":e.validated,role:`checkbox`,children:e.validated&&(0,l.jsx)(`svg`,{className:`h-3 w-3`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:3,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M5 13l4 4L19 7`})})}),(0,l.jsx)(`span`,{className:`text-[10px] font-mono font-bold text-muted-foreground bg-muted px-1.5 py-0.5 rounded shrink-0`,children:e.id}),(0,l.jsx)(`span`,{className:t.t(`text-sm font-medium flex-1 min-w-0 truncate`,e.validated&&`line-through text-muted-foreground`),children:e.scenario||`Unnamed scenario`}),(0,l.jsx)(`button`,{type:`button`,onClick:()=>a(!i),className:`text-muted-foreground hover:text-foreground transition-colors p-0.5`,"aria-label":i?`Collapse`:`Expand`,children:(0,l.jsx)(`svg`,{className:t.t(`h-3.5 w-3.5 transition-transform duration-200`,i&&`rotate-180`),viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M19 9l-7 7-7-7`})})})]}),i&&(0,l.jsxs)(`div`,{className:`px-3 pb-3 pt-1 space-y-1.5 border-t border-border/50`,children:[(0,l.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,l.jsx)(H,{keyword:`Given`,variant:`given`}),(0,l.jsx)(`span`,{className:`text-sm text-foreground/80 pt-0.5`,children:e.given||(0,l.jsx)(`span`,{className:`italic text-muted-foreground`,children:`precondition...`})})]}),(0,l.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,l.jsx)(H,{keyword:`When`,variant:`when`}),(0,l.jsx)(`span`,{className:`text-sm text-foreground/80 pt-0.5`,children:e.when||(0,l.jsx)(`span`,{className:`italic text-muted-foreground`,children:`action...`})})]}),(0,l.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,l.jsx)(H,{keyword:`Then`,variant:`then`}),(0,l.jsx)(`span`,{className:`text-sm text-foreground/80 pt-0.5`,children:e.then||(0,l.jsx)(`span`,{className:`italic text-muted-foreground`,children:`expected result...`})})]})]})]})}function U({attributes:e,children:n,element:r,className:i}){let a=r,o=a?.criteria||[],s=a?.title||`Acceptance Criteria`,c=o.filter(e=>e.validated).length,u=o.length,d=u>0?c/u*100:0;return(0,l.jsxs)(`div`,{...e,contentEditable:!1,className:t.t(`my-4 rounded-lg overflow-hidden`,`border border-border`,`bg-card/30`,`shadow-sm`,i),children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2.5 bg-muted/30 border-b border-border`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,l.jsx)(`svg`,{className:`h-4 w-4 text-emerald-600 dark:text-emerald-400`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,"aria-hidden":`true`,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4`})}),(0,l.jsx)(`span`,{className:`text-xs font-bold uppercase tracking-wider text-foreground`,children:s})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,l.jsxs)(`span`,{className:`text-[10px] font-medium text-muted-foreground`,children:[c,`/`,u]}),(0,l.jsx)(`div`,{className:`w-16 h-1.5 bg-muted rounded-full overflow-hidden`,children:(0,l.jsx)(`div`,{className:`h-full bg-emerald-500 rounded-full transition-all duration-500`,style:{width:`${d}%`}})})]})]}),(0,l.jsx)(`div`,{className:`p-3 space-y-2`,children:o.length>0?o.map((e,t)=>(0,l.jsx)(Ge,{criterion:e,index:t,readOnly:!0},e.id)):(0,l.jsx)(`div`,{className:`py-6 text-center text-sm text-muted-foreground italic`,children:`No acceptance criteria defined yet.`})}),(0,l.jsx)(`div`,{className:`hidden`,children:n})]})}U.displayName=`WakaAcceptanceCriteriaBlock`;function Ke(e){return[{type:V,title:e?.title||`Acceptance Criteria`,criteria:e?.criteria||[{id:`AC-01`,scenario:`Nominal case`,given:`The user is authenticated`,when:`They perform the action`,then:`The expected result is displayed`,validated:!1},{id:`AC-02`,scenario:`Error case`,given:`The service is unavailable`,when:`They perform the action`,then:`An error message is displayed`,validated:!1}],children:[{text:``}]}]}async function qe(){try{let{createPlatePlugin:e}=await import(`platejs/react`);return e({key:V,node:{isElement:!0,isVoid:!0,type:V,component:U}})}catch{return console.warn(`[WakaAcceptanceCriteriaBlock] platejs not installed`),null}}var W=`api_endpoint`,G={GET:{bg:`bg-emerald-100 dark:bg-emerald-500/15`,text:`text-emerald-700 dark:text-emerald-400`,border:`border-emerald-300 dark:border-emerald-600/40`},POST:{bg:`bg-blue-100 dark:bg-blue-500/15`,text:`text-blue-700 dark:text-blue-400`,border:`border-blue-300 dark:border-blue-600/40`},PUT:{bg:`bg-amber-100 dark:bg-amber-500/15`,text:`text-amber-700 dark:text-amber-400`,border:`border-amber-300 dark:border-amber-600/40`},PATCH:{bg:`bg-orange-100 dark:bg-orange-500/15`,text:`text-orange-700 dark:text-orange-400`,border:`border-orange-300 dark:border-orange-600/40`},DELETE:{bg:`bg-red-100 dark:bg-red-500/15`,text:`text-red-700 dark:text-red-400`,border:`border-red-300 dark:border-red-600/40`},HEAD:{bg:`bg-gray-100 dark:bg-gray-500/15`,text:`text-gray-700 dark:text-gray-400`,border:`border-gray-300 dark:border-gray-600/40`},OPTIONS:{bg:`bg-purple-100 dark:bg-purple-500/15`,text:`text-purple-700 dark:text-purple-400`,border:`border-purple-300 dark:border-purple-600/40`}};function Je({method:e}){let n=G[e]||G.GET;return(0,l.jsx)(`span`,{className:t.t(`inline-flex items-center px-2 py-0.5 rounded text-[11px] font-bold font-mono tracking-wide border`,n.bg,n.text,n.border),children:e})}function Ye({status:e}){return(0,l.jsx)(`span`,{className:t.t(`text-[11px] font-mono font-bold px-1.5 py-0.5 rounded`,e<300?`text-emerald-700 dark:text-emerald-400 bg-emerald-50 dark:bg-emerald-500/10`:e<400?`text-blue-700 dark:text-blue-400 bg-blue-50 dark:bg-blue-500/10`:e<500?`text-amber-700 dark:text-amber-400 bg-amber-50 dark:bg-amber-500/10`:`text-red-700 dark:text-red-400 bg-red-50 dark:bg-red-500/10`),children:e})}function Xe({code:e,label:n}){let[r,i]=s.useState(!1),a=e.split(`
29
+ `).length>6;return(0,l.jsxs)(`div`,{className:`mt-2`,children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,l.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-wider text-muted-foreground`,children:n}),a&&(0,l.jsx)(`button`,{type:`button`,onClick:()=>i(!r),className:`text-[10px] text-primary hover:underline`,children:r?`Collapse`:`Expand`})]}),(0,l.jsxs)(`pre`,{className:t.t(`text-[12px] font-mono leading-relaxed p-3 rounded-md overflow-x-auto`,`bg-gray-950 dark:bg-gray-900 text-gray-100`,`border border-gray-800/50`,!r&&a&&`max-h-[150px] overflow-hidden relative`),children:[!r&&a&&(0,l.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 h-10 bg-gradient-to-t from-gray-950 dark:from-gray-900 to-transparent`}),(0,l.jsx)(`code`,{children:e})]})]})}function K({attributes:e,children:n,element:r,className:i}){let a=r,o=a?.method||`GET`,c=a?.route||`/api/v1/resource`,u=G[o]||G.GET,[d,f]=s.useState(a?.params&&a.params.length>0?`params`:a?.requestBody?`body`:`responses`);return(0,l.jsxs)(`div`,{...e,contentEditable:!1,className:t.t(`my-4 rounded-lg overflow-hidden`,`border`,u.border,`shadow-sm`,i),children:[(0,l.jsxs)(`div`,{className:t.t(`flex items-center gap-3 px-4 py-3`,u.bg),children:[(0,l.jsx)(Je,{method:o}),(0,l.jsx)(`code`,{className:t.t(`text-sm font-mono font-semibold`,u.text),children:c})]}),(0,l.jsxs)(`div`,{className:`px-4 py-3 border-b border-border/50 bg-card/50`,children:[a?.description&&(0,l.jsx)(`p`,{className:`text-sm text-foreground mb-2`,children:a.description}),(0,l.jsxs)(`div`,{className:`flex flex-wrap gap-3 text-[11px]`,children:[a?.auth&&(0,l.jsxs)(`div`,{className:`flex items-center gap-1 text-muted-foreground`,children:[(0,l.jsx)(`svg`,{className:`h-3 w-3`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z`})}),(0,l.jsx)(`span`,{className:`font-medium`,children:a.auth})]}),a?.permissions&&a.permissions.length>0&&(0,l.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,l.jsx)(`svg`,{className:`h-3 w-3 text-muted-foreground`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z`})}),a.permissions.map((e,t)=>(0,l.jsx)(`span`,{className:`px-1.5 py-0.5 rounded bg-muted text-muted-foreground font-mono text-[10px]`,children:e},t))]}),a?.rateLimit&&(0,l.jsxs)(`div`,{className:`flex items-center gap-1 text-muted-foreground`,children:[(0,l.jsx)(`svg`,{className:`h-3 w-3`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z`})}),(0,l.jsx)(`span`,{className:`font-medium`,children:a.rateLimit})]})]})]}),(0,l.jsx)(`div`,{className:`flex border-b border-border/50`,children:[{id:`params`,label:`Parameters`,count:a?.params?.length},{id:`body`,label:`Request Body`,show:!!a?.requestBody},{id:`responses`,label:`Responses`,count:a?.responses?.length}].filter(e=>e.show!==!1&&(e.count===void 0||e.count>0)).map(e=>(0,l.jsxs)(`button`,{type:`button`,onClick:()=>f(e.id),className:t.t(`px-4 py-2 text-xs font-medium transition-colors relative`,d===e.id?`text-foreground`:`text-muted-foreground hover:text-foreground`),children:[e.label,e.count!==void 0&&(0,l.jsxs)(`span`,{className:`ml-1 text-[10px] text-muted-foreground`,children:[`(`,e.count,`)`]}),d===e.id&&(0,l.jsx)(`div`,{className:t.t(`absolute bottom-0 left-0 right-0 h-0.5`,u.bg.replace(`bg-`,`bg-`).replace(`/15`,``)),style:{backgroundColor:o===`GET`?`#10b981`:o===`POST`?`#3b82f6`:o===`PUT`?`#f59e0b`:o===`DELETE`?`#ef4444`:`#6b7280`}})]},e.id))}),(0,l.jsxs)(`div`,{className:`px-4 py-3`,children:[d===`params`&&a?.params&&a.params.length>0&&(0,l.jsx)(`div`,{className:`overflow-x-auto`,children:(0,l.jsxs)(`table`,{className:`w-full text-xs`,children:[(0,l.jsx)(`thead`,{children:(0,l.jsxs)(`tr`,{className:`border-b border-border`,children:[(0,l.jsx)(`th`,{className:`text-left font-semibold text-muted-foreground py-1.5 pr-4`,children:`Name`}),(0,l.jsx)(`th`,{className:`text-left font-semibold text-muted-foreground py-1.5 pr-4`,children:`Type`}),(0,l.jsx)(`th`,{className:`text-left font-semibold text-muted-foreground py-1.5 pr-4`,children:`Required`}),(0,l.jsx)(`th`,{className:`text-left font-semibold text-muted-foreground py-1.5`,children:`Description`})]})}),(0,l.jsx)(`tbody`,{children:a.params.map((e,t)=>(0,l.jsxs)(`tr`,{className:`border-b border-border/30`,children:[(0,l.jsx)(`td`,{className:`py-1.5 pr-4 font-mono font-medium text-foreground`,children:e.name}),(0,l.jsx)(`td`,{className:`py-1.5 pr-4 font-mono text-muted-foreground`,children:e.type}),(0,l.jsx)(`td`,{className:`py-1.5 pr-4`,children:e.required?(0,l.jsx)(`span`,{className:`text-red-600 dark:text-red-400 font-semibold`,children:`required`}):(0,l.jsx)(`span`,{className:`text-muted-foreground`,children:`optional`})}),(0,l.jsx)(`td`,{className:`py-1.5 text-muted-foreground`,children:e.description})]},t))})]})}),d===`body`&&a?.requestBody&&(0,l.jsx)(Xe,{code:a.requestBody,label:`Request Body`}),d===`responses`&&a?.responses&&(0,l.jsx)(`div`,{className:`space-y-3`,children:a.responses.map((e,t)=>(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,l.jsx)(Ye,{status:e.status}),(0,l.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.description})]}),e.body&&(0,l.jsx)(Xe,{code:e.body,label:`Response ${e.status}`})]},t))})]}),(0,l.jsx)(`div`,{className:`hidden`,children:n})]})}K.displayName=`WakaApiEndpointBlock`;function Ze(e){return[{type:W,method:e?.method||`GET`,route:e?.route||`/api/v1/resource/:id`,description:e?.description||`Retrieves a resource by its unique identifier.`,auth:e?.auth||`Bearer JWT`,permissions:e?.permissions||[`ROLE_USER`],rateLimit:e?.rateLimit||`100 req/min`,params:e?.params||[{name:`id`,type:`UUID`,required:!0,description:`Resource unique identifier`}],requestBody:e?.requestBody,responses:e?.responses||[{status:200,description:`Success`,body:`{
30
30
  "data": {
31
31
  "id": "uuid",
32
32
  "name": "Example",
@@ -35,14 +35,14 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
35
35
  }`},{status:404,description:`Resource not found`,body:`{
36
36
  "error": "NOT_FOUND",
37
37
  "message": "Resource not found"
38
- }`}],children:[{text:``}]}]}async function at(){try{let{createPlatePlugin:e}=await import(`platejs/react`);return e({key:V,node:{isElement:!0,isVoid:!0,type:V,component:B}})}catch{return console.warn(`[WakaApiEndpointBlock] platejs not installed`),null}}var V,H,ot=e.n((()=>{t.n(),V=`api_endpoint`,H={GET:{bg:`bg-emerald-100 dark:bg-emerald-500/15`,text:`text-emerald-700 dark:text-emerald-400`,border:`border-emerald-300 dark:border-emerald-600/40`},POST:{bg:`bg-blue-100 dark:bg-blue-500/15`,text:`text-blue-700 dark:text-blue-400`,border:`border-blue-300 dark:border-blue-600/40`},PUT:{bg:`bg-amber-100 dark:bg-amber-500/15`,text:`text-amber-700 dark:text-amber-400`,border:`border-amber-300 dark:border-amber-600/40`},PATCH:{bg:`bg-orange-100 dark:bg-orange-500/15`,text:`text-orange-700 dark:text-orange-400`,border:`border-orange-300 dark:border-orange-600/40`},DELETE:{bg:`bg-red-100 dark:bg-red-500/15`,text:`text-red-700 dark:text-red-400`,border:`border-red-300 dark:border-red-600/40`},HEAD:{bg:`bg-gray-100 dark:bg-gray-500/15`,text:`text-gray-700 dark:text-gray-400`,border:`border-gray-300 dark:border-gray-600/40`},OPTIONS:{bg:`bg-purple-100 dark:bg-purple-500/15`,text:`text-purple-700 dark:text-purple-400`,border:`border-purple-300 dark:border-purple-600/40`}},B.displayName=`WakaApiEndpointBlock`})),st=e.r({DIAGRAM_BLOCK_TYPE:()=>W,WakaDiagramBlock:()=>U,createDiagramNodes:()=>ct,createDiagramPlugin:()=>lt});function U({attributes:e,children:n,element:r,className:i,onRender:a}){let o=r,c=o?.syntax||`mermaid`,u=o?.source||``,d=ut[c],[f,p]=s.useState(!1),[m,h]=s.useState(null),[g,_]=s.useState(!a),v=s.useRef(null);return s.useEffect(()=>{if(!u||!a||g)return;let e=!1,t=setTimeout(async()=>{p(!0),h(null);try{let t=await a(u,c);if(!e&&v.current){v.current.textContent=``;let e=new DOMParser().parseFromString(t,`text/html`),n=document.createDocumentFragment();Array.from(e.body.childNodes).forEach(e=>{n.appendChild(document.importNode(e,!0))}),v.current.appendChild(n)}}catch(t){e||h(t instanceof Error?t.message:`Render failed`)}finally{e||p(!1)}},500);return()=>{e=!0,clearTimeout(t)}},[u,c,a,g]),(0,l.jsxs)(`div`,{...e,contentEditable:!1,className:t.t(`my-4 rounded-lg overflow-hidden border border-border shadow-sm`,i),children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2 bg-muted/30 border-b border-border`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,l.jsx)(`svg`,{className:t.t(`h-4 w-4`,d.color.split(` `)[0]),viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,"aria-hidden":`true`,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:d.icon})}),(0,l.jsx)(`span`,{className:t.t(`text-[10px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded`,d.color),children:d.label}),o?.caption&&(0,l.jsx)(`span`,{className:`text-xs text-muted-foreground ml-2`,children:o.caption})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,l.jsx)(`button`,{type:`button`,onClick:()=>_(!0),className:t.t(`px-2 py-1 rounded text-[10px] font-medium transition-colors`,g?`bg-muted text-foreground`:`text-muted-foreground hover:text-foreground`),children:`Source`}),(0,l.jsx)(`button`,{type:`button`,onClick:()=>_(!1),className:t.t(`px-2 py-1 rounded text-[10px] font-medium transition-colors`,g?`text-muted-foreground hover:text-foreground`:`bg-muted text-foreground`),children:`Preview`})]})]}),g&&(0,l.jsx)(`div`,{className:`border-b border-border`,children:(0,l.jsx)(`pre`,{className:t.t(`text-[12px] font-mono leading-relaxed p-4 overflow-x-auto`,`bg-gray-950 dark:bg-gray-900 text-gray-100`,`max-h-[300px] overflow-y-auto`),children:(0,l.jsx)(`code`,{children:u||`graph TD
38
+ }`}],children:[{text:``}]}]}async function Qe(){try{let{createPlatePlugin:e}=await import(`platejs/react`);return e({key:W,node:{isElement:!0,isVoid:!0,type:W,component:K}})}catch{return console.warn(`[WakaApiEndpointBlock] platejs not installed`),null}}var q=`diagram`,$e={mermaid:{label:`Mermaid`,color:`text-pink-600 dark:text-pink-400 bg-pink-50 dark:bg-pink-500/10`,icon:`M12 3l8 4.5v9L12 21l-8-4.5v-9L12 3z`},plantuml:{label:`PlantUML`,color:`text-teal-600 dark:text-teal-400 bg-teal-50 dark:bg-teal-500/10`,icon:`M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6z`},excalidraw:{label:`Excalidraw`,color:`text-indigo-600 dark:text-indigo-400 bg-indigo-50 dark:bg-indigo-500/10`,icon:`M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z`}};function J({attributes:e,children:n,element:r,className:i,onRender:a}){let o=r,c=o?.syntax||`mermaid`,u=o?.source||``,d=$e[c],[f,p]=s.useState(!1),[m,h]=s.useState(null),[g,_]=s.useState(!a),v=s.useRef(null);return s.useEffect(()=>{if(!u||!a||g)return;let e=!1,t=setTimeout(async()=>{p(!0),h(null);try{let t=await a(u,c);if(!e&&v.current){v.current.textContent=``;let e=new DOMParser().parseFromString(t,`text/html`),n=document.createDocumentFragment();Array.from(e.body.childNodes).forEach(e=>{n.appendChild(document.importNode(e,!0))}),v.current.appendChild(n)}}catch(t){e||h(t instanceof Error?t.message:`Render failed`)}finally{e||p(!1)}},500);return()=>{e=!0,clearTimeout(t)}},[u,c,a,g]),(0,l.jsxs)(`div`,{...e,contentEditable:!1,className:t.t(`my-4 rounded-lg overflow-hidden border border-border shadow-sm`,i),children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2 bg-muted/30 border-b border-border`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,l.jsx)(`svg`,{className:t.t(`h-4 w-4`,d.color.split(` `)[0]),viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,"aria-hidden":`true`,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:d.icon})}),(0,l.jsx)(`span`,{className:t.t(`text-[10px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded`,d.color),children:d.label}),o?.caption&&(0,l.jsx)(`span`,{className:`text-xs text-muted-foreground ml-2`,children:o.caption})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,l.jsx)(`button`,{type:`button`,onClick:()=>_(!0),className:t.t(`px-2 py-1 rounded text-[10px] font-medium transition-colors`,g?`bg-muted text-foreground`:`text-muted-foreground hover:text-foreground`),children:`Source`}),(0,l.jsx)(`button`,{type:`button`,onClick:()=>_(!1),className:t.t(`px-2 py-1 rounded text-[10px] font-medium transition-colors`,g?`text-muted-foreground hover:text-foreground`:`bg-muted text-foreground`),children:`Preview`})]})]}),g&&(0,l.jsx)(`div`,{className:`border-b border-border`,children:(0,l.jsx)(`pre`,{className:t.t(`text-[12px] font-mono leading-relaxed p-4 overflow-x-auto`,`bg-gray-950 dark:bg-gray-900 text-gray-100`,`max-h-[300px] overflow-y-auto`),children:(0,l.jsx)(`code`,{children:u||`graph TD
39
39
  A[Start] --> B[Process]
40
40
  B --> C{Decision}
41
41
  C -->|Yes| D[Result A]
42
- C -->|No| E[Result B]`})})}),!g&&(0,l.jsx)(`div`,{className:`p-4 bg-white dark:bg-gray-950 min-h-[120px] flex items-center justify-center`,children:f?(0,l.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-muted-foreground`,children:[(0,l.jsxs)(`svg`,{className:`h-6 w-6 animate-spin`,viewBox:`0 0 24 24`,fill:`none`,children:[(0,l.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,l.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`})]}),(0,l.jsx)(`span`,{className:`text-xs`,children:`Rendering diagram...`})]}):m?(0,l.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-destructive`,children:[(0,l.jsx)(`svg`,{className:`h-6 w-6`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.34 16.5c-.77.833.192 2.5 1.732 2.5z`})}),(0,l.jsx)(`span`,{className:`text-xs`,children:m})]}):a?(0,l.jsx)(`div`,{ref:v,className:`diagram-rendered w-full [&_svg]:max-w-full [&_svg]:h-auto`}):(0,l.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-muted-foreground`,children:[(0,l.jsx)(`svg`,{className:`h-8 w-8`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.5,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:d.icon})}),(0,l.jsx)(`span`,{className:`text-xs`,children:`Provide an onRender callback to see the diagram preview`}),(0,l.jsx)(`button`,{type:`button`,onClick:()=>_(!0),className:`text-xs text-primary hover:underline`,children:`View source instead`})]})}),(0,l.jsx)(`div`,{className:`hidden`,children:n})]})}function ct(e){return[{type:W,syntax:e?.syntax||`mermaid`,source:e?.source||`graph TD
42
+ C -->|No| E[Result B]`})})}),!g&&(0,l.jsx)(`div`,{className:`p-4 bg-white dark:bg-gray-950 min-h-[120px] flex items-center justify-center`,children:f?(0,l.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-muted-foreground`,children:[(0,l.jsxs)(`svg`,{className:`h-6 w-6 animate-spin`,viewBox:`0 0 24 24`,fill:`none`,children:[(0,l.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,l.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`})]}),(0,l.jsx)(`span`,{className:`text-xs`,children:`Rendering diagram...`})]}):m?(0,l.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-destructive`,children:[(0,l.jsx)(`svg`,{className:`h-6 w-6`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.34 16.5c-.77.833.192 2.5 1.732 2.5z`})}),(0,l.jsx)(`span`,{className:`text-xs`,children:m})]}):a?(0,l.jsx)(`div`,{ref:v,className:`diagram-rendered w-full [&_svg]:max-w-full [&_svg]:h-auto`}):(0,l.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-muted-foreground`,children:[(0,l.jsx)(`svg`,{className:`h-8 w-8`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.5,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:d.icon})}),(0,l.jsx)(`span`,{className:`text-xs`,children:`Provide an onRender callback to see the diagram preview`}),(0,l.jsx)(`button`,{type:`button`,onClick:()=>_(!0),className:`text-xs text-primary hover:underline`,children:`View source instead`})]})}),(0,l.jsx)(`div`,{className:`hidden`,children:n})]})}J.displayName=`WakaDiagramBlock`;function et(e){return[{type:q,syntax:e?.syntax||`mermaid`,source:e?.source||`graph TD
43
43
  A[Start] --> B[Process]
44
44
  B --> C{Decision}
45
45
  C -->|Yes| D[Result A]
46
- C -->|No| E[Result B]`,caption:e?.caption,children:[{text:``}]}]}async function lt(e){try{let{createPlatePlugin:t}=await import(`platejs/react`);return t({key:W,node:{isElement:!0,isVoid:!0,type:W,component:t=>(0,l.jsx)(U,{...t,onRender:e})}})}catch{return console.warn(`[WakaDiagramBlock] platejs not installed`),null}}var W,ut,dt=e.n((()=>{t.n(),W=`diagram`,ut={mermaid:{label:`Mermaid`,color:`text-pink-600 dark:text-pink-400 bg-pink-50 dark:bg-pink-500/10`,icon:`M12 3l8 4.5v9L12 21l-8-4.5v-9L12 3z`},plantuml:{label:`PlantUML`,color:`text-teal-600 dark:text-teal-400 bg-teal-50 dark:bg-teal-500/10`,icon:`M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6z`},excalidraw:{label:`Excalidraw`,color:`text-indigo-600 dark:text-indigo-400 bg-indigo-50 dark:bg-indigo-500/10`,icon:`M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z`}},U.displayName=`WakaDiagramBlock`})),ft=e.r({AI_ASSIST_BLOCK_TYPE:()=>K,WakaAiAssistBlock:()=>G,createAiAssistNodes:()=>mt,createAiAssistPlugin:()=>ht});function pt({status:e}){let n={idle:{label:`Ready`,color:`bg-muted-foreground/30`,pulse:!1},loading:{label:`Thinking...`,color:`bg-amber-500`,pulse:!0},streaming:{label:`Writing...`,color:`bg-blue-500`,pulse:!0},complete:{label:`Complete`,color:`bg-emerald-500`,pulse:!1},error:{label:`Error`,color:`bg-destructive`,pulse:!1}}[e];return(0,l.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,l.jsx)(`div`,{className:t.t(`h-2 w-2 rounded-full`,n.color,n.pulse&&`animate-pulse`)}),(0,l.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground`,children:n.label})]})}function G({attributes:e,children:n,element:r,className:i,onGenerate:a,onAccept:o,onDiscard:s}){let c=r,u=c?.status||`idle`,d=c?.prompt||``,f=c?.response||``;return(0,l.jsxs)(`div`,{...e,contentEditable:!1,className:t.t(`my-4 rounded-lg overflow-hidden`,`border border-border`,`bg-gradient-to-br from-violet-50/30 via-card to-blue-50/30`,`dark:from-violet-950/10 dark:via-card dark:to-blue-950/10`,`shadow-sm`,i),children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2.5 border-b border-border/50`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,l.jsxs)(`div`,{className:`relative`,children:[(0,l.jsx)(`svg`,{className:`h-4 w-4 text-violet-600 dark:text-violet-400`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,l.jsx)(`path`,{d:`M12 2L13.09 8.26L18 6L14.74 10.91L21 12L14.74 13.09L18 18L13.09 15.74L12 22L10.91 15.74L6 18L9.26 13.09L3 12L9.26 10.91L6 6L10.91 8.26L12 2Z`})}),(u===`loading`||u===`streaming`)&&(0,l.jsx)(`div`,{className:`absolute inset-0 animate-ping`,children:(0,l.jsx)(`svg`,{className:`h-4 w-4 text-violet-400/50`,viewBox:`0 0 24 24`,fill:`currentColor`,children:(0,l.jsx)(`path`,{d:`M12 2L13.09 8.26L18 6L14.74 10.91L21 12L14.74 13.09L18 18L13.09 15.74L12 22L10.91 15.74L6 18L9.26 13.09L3 12L9.26 10.91L6 6L10.91 8.26L12 2Z`})})})]}),(0,l.jsx)(`span`,{className:`text-xs font-bold uppercase tracking-wider text-violet-700 dark:text-violet-300`,children:`AI Assistant`}),c?.model&&(0,l.jsx)(`span`,{className:`text-[10px] font-mono text-muted-foreground bg-muted px-1.5 py-0.5 rounded`,children:c.model})]}),(0,l.jsx)(pt,{status:u})]}),(0,l.jsx)(`div`,{className:`px-4 py-3 border-b border-border/30`,children:(0,l.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,l.jsx)(`div`,{className:`flex-shrink-0 mt-0.5 h-5 w-5 rounded-full bg-foreground/10 flex items-center justify-center`,children:(0,l.jsx)(`svg`,{className:`h-3 w-3 text-foreground/60`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z`})})}),(0,l.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,l.jsx)(`p`,{className:`text-sm text-foreground leading-relaxed`,children:d||(0,l.jsx)(`span`,{className:`text-muted-foreground italic`,children:`Ask the AI assistant a question...`})})})]})}),(f||u===`loading`||u===`streaming`)&&(0,l.jsx)(`div`,{className:`px-4 py-3`,children:(0,l.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,l.jsx)(`div`,{className:`flex-shrink-0 mt-0.5 h-5 w-5 rounded-full bg-violet-100 dark:bg-violet-500/20 flex items-center justify-center`,children:(0,l.jsx)(`svg`,{className:`h-3 w-3 text-violet-600 dark:text-violet-400`,viewBox:`0 0 24 24`,fill:`currentColor`,children:(0,l.jsx)(`path`,{d:`M12 2L13.09 8.26L18 6L14.74 10.91L21 12L14.74 13.09L18 18L13.09 15.74L12 22L10.91 15.74L6 18L9.26 13.09L3 12L9.26 10.91L6 6L10.91 8.26L12 2Z`})})}),(0,l.jsx)(`div`,{className:`flex-1 min-w-0`,children:u===`loading`&&!f?(0,l.jsxs)(`div`,{className:`space-y-2`,children:[(0,l.jsx)(`div`,{className:`h-3 w-3/4 bg-muted rounded animate-pulse`}),(0,l.jsx)(`div`,{className:`h-3 w-1/2 bg-muted rounded animate-pulse`}),(0,l.jsx)(`div`,{className:`h-3 w-5/6 bg-muted rounded animate-pulse`})]}):(0,l.jsxs)(`div`,{className:`text-sm text-foreground leading-relaxed whitespace-pre-wrap prose prose-sm dark:prose-invert max-w-none`,children:[f,u===`streaming`&&(0,l.jsx)(`span`,{className:`inline-block w-1.5 h-4 bg-violet-500 ml-0.5 animate-pulse rounded-sm`})]})})]})}),u===`error`&&c?.errorMessage&&(0,l.jsx)(`div`,{className:`mx-4 mb-3 px-3 py-2 rounded-md bg-destructive/10 border border-destructive/20`,children:(0,l.jsx)(`p`,{className:`text-xs text-destructive`,children:c.errorMessage})}),u===`complete`&&f&&(0,l.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2 border-t border-border/50 bg-muted/20`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] text-muted-foreground`,children:[c?.tokenCount&&(0,l.jsxs)(`span`,{children:[c.tokenCount,` tokens`]}),c?.generatedAt&&(0,l.jsx)(`span`,{children:new Date(c.generatedAt).toLocaleTimeString(`fr-FR`,{hour:`2-digit`,minute:`2-digit`})})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s&&(0,l.jsx)(`button`,{type:`button`,onClick:s,className:`px-3 py-1 rounded text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-muted transition-colors`,children:`Discard`}),o&&(0,l.jsx)(`button`,{type:`button`,onClick:()=>o(f),className:`px-3 py-1 rounded text-xs font-medium bg-primary text-primary-foreground hover:bg-primary/90 transition-colors shadow-sm`,children:`Insert into document`})]})]}),(0,l.jsx)(`div`,{className:`hidden`,children:n})]})}function mt(e){return[{type:K,prompt:e?.prompt||``,response:``,status:`idle`,model:e?.model||`claude-sonnet-4-20250514`,children:[{text:``}]}]}async function ht(e,t){try{let{createPlatePlugin:n}=await import(`platejs/react`);return n({key:K,node:{isElement:!0,isVoid:!0,type:K,component:n=>(0,l.jsx)(G,{...n,onGenerate:e,onAccept:t})}})}catch{return console.warn(`[WakaAiAssistBlock] platejs not installed`),null}}var K,gt=e.n((()=>{t.n(),K=`ai_assist`,G.displayName=`WakaAiAssistBlock`})),_t=e.r({VERSION_DIFF_BLOCK_TYPE:()=>J,WakaVersionDiffBlock:()=>q,createVersionDiffNodes:()=>vt,createVersionDiffPlugin:()=>yt});function q({attributes:e,children:n,element:r,className:i}){let a=r,[o,c]=s.useState(`unified`),[u,d]=s.useState(!0),f=a?.hunks||[],p=a?.stats||{additions:0,deletions:0,modifications:0},m=a?.oldVersionLabel||`Previous`,h=a?.newVersionLabel||`Current`;return(0,l.jsxs)(`div`,{...e,contentEditable:!1,className:t.t(`my-4 rounded-lg overflow-hidden border border-border shadow-sm`,i),children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2.5 bg-muted/30 border-b border-border`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,l.jsx)(`svg`,{className:`h-4 w-4 text-orange-600 dark:text-orange-400`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,"aria-hidden":`true`,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 3v6m0 0l-3 3m3-3l3 3M6 21h12a2 2 0 002-2V7l-5-5H6a2 2 0 00-2 2v15a2 2 0 002 2z`})}),(0,l.jsx)(`span`,{className:`text-xs font-bold uppercase tracking-wider text-foreground`,children:`Version Diff`}),(0,l.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px]`,children:[(0,l.jsx)(`span`,{className:`px-1.5 py-0.5 rounded bg-red-100 dark:bg-red-500/10 text-red-700 dark:text-red-400 font-mono font-medium`,children:m}),(0,l.jsx)(`svg`,{className:`h-3 w-3 text-muted-foreground`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M14 5l7 7m0 0l-7 7m7-7H3`})}),(0,l.jsx)(`span`,{className:`px-1.5 py-0.5 rounded bg-emerald-100 dark:bg-emerald-500/10 text-emerald-700 dark:text-emerald-400 font-mono font-medium`,children:h})]})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] font-mono`,children:[p.additions>0&&(0,l.jsxs)(`span`,{className:`text-emerald-600 dark:text-emerald-400 font-semibold`,children:[`+`,p.additions]}),p.deletions>0&&(0,l.jsxs)(`span`,{className:`text-red-600 dark:text-red-400 font-semibold`,children:[`-`,p.deletions]}),p.modifications>0&&(0,l.jsxs)(`span`,{className:`text-amber-600 dark:text-amber-400 font-semibold`,children:[`~`,p.modifications]})]}),(0,l.jsx)(`div`,{className:`flex items-center border border-border rounded overflow-hidden`,children:[`unified`,`split`,`summary`].map(e=>(0,l.jsx)(`button`,{type:`button`,onClick:()=>c(e),className:t.t(`px-2 py-1 text-[10px] font-medium transition-colors`,o===e?`bg-foreground/10 text-foreground`:`text-muted-foreground hover:text-foreground`),children:e.charAt(0).toUpperCase()+e.slice(1)},e))}),(0,l.jsx)(`button`,{type:`button`,onClick:()=>d(!u),className:`text-muted-foreground hover:text-foreground transition-colors`,children:(0,l.jsx)(`svg`,{className:t.t(`h-4 w-4 transition-transform`,!u&&`-rotate-90`),viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M19 9l-7 7-7-7`})})})]})]}),(a?.author||a?.timestamp)&&(0,l.jsxs)(`div`,{className:`px-4 py-1.5 border-b border-border/50 bg-muted/10 flex items-center gap-3 text-[10px] text-muted-foreground`,children:[a.author&&(0,l.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,l.jsx)(`svg`,{className:`h-3 w-3`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z`})}),(0,l.jsx)(`span`,{className:`font-medium`,children:a.author})]}),a.timestamp&&(0,l.jsx)(`span`,{children:new Date(a.timestamp).toLocaleString(`fr-FR`)})]}),u&&(0,l.jsx)(`div`,{className:`overflow-x-auto`,children:o===`summary`?(0,l.jsxs)(`div`,{className:`p-4 space-y-3`,children:[(0,l.jsxs)(`div`,{className:`grid grid-cols-3 gap-3`,children:[(0,l.jsxs)(`div`,{className:`rounded-lg bg-emerald-50 dark:bg-emerald-500/5 border border-emerald-200 dark:border-emerald-500/20 p-3 text-center`,children:[(0,l.jsx)(`div`,{className:`text-2xl font-bold text-emerald-600 dark:text-emerald-400`,children:p.additions}),(0,l.jsx)(`div`,{className:`text-[10px] font-medium text-emerald-700/70 dark:text-emerald-400/70 uppercase tracking-wider`,children:`Additions`})]}),(0,l.jsxs)(`div`,{className:`rounded-lg bg-red-50 dark:bg-red-500/5 border border-red-200 dark:border-red-500/20 p-3 text-center`,children:[(0,l.jsx)(`div`,{className:`text-2xl font-bold text-red-600 dark:text-red-400`,children:p.deletions}),(0,l.jsx)(`div`,{className:`text-[10px] font-medium text-red-700/70 dark:text-red-400/70 uppercase tracking-wider`,children:`Deletions`})]}),(0,l.jsxs)(`div`,{className:`rounded-lg bg-amber-50 dark:bg-amber-500/5 border border-amber-200 dark:border-amber-500/20 p-3 text-center`,children:[(0,l.jsx)(`div`,{className:`text-2xl font-bold text-amber-600 dark:text-amber-400`,children:p.modifications}),(0,l.jsx)(`div`,{className:`text-[10px] font-medium text-amber-700/70 dark:text-amber-400/70 uppercase tracking-wider`,children:`Modified`})]})]}),(0,l.jsxs)(`div`,{className:`h-2 rounded-full bg-muted overflow-hidden flex`,children:[p.additions>0&&(0,l.jsx)(`div`,{className:`bg-emerald-500 h-full`,style:{width:`${p.additions/(p.additions+p.deletions+p.modifications)*100}%`}}),p.modifications>0&&(0,l.jsx)(`div`,{className:`bg-amber-500 h-full`,style:{width:`${p.modifications/(p.additions+p.deletions+p.modifications)*100}%`}}),p.deletions>0&&(0,l.jsx)(`div`,{className:`bg-red-500 h-full`,style:{width:`${p.deletions/(p.additions+p.deletions+p.modifications)*100}%`}})]})]}):o===`split`?(0,l.jsxs)(`div`,{className:`grid grid-cols-2 divide-x divide-border`,children:[(0,l.jsxs)(`div`,{className:`p-0`,children:[(0,l.jsx)(`div`,{className:`px-3 py-1.5 border-b border-border/50 bg-red-50/50 dark:bg-red-950/10`,children:(0,l.jsx)(`span`,{className:`text-[10px] font-semibold text-red-700 dark:text-red-400 uppercase tracking-wider`,children:m})}),(0,l.jsx)(`div`,{className:`font-mono text-[12px] leading-relaxed`,children:f.map((e,n)=>(0,l.jsx)(s.Fragment,{children:e.lines.filter(e=>e.type!==`added`).map((e,r)=>(0,l.jsxs)(`div`,{className:t.t(`px-3 py-0.5 flex`,e.type===`removed`&&`bg-red-100/60 dark:bg-red-500/10`,e.type===`modified`&&`bg-amber-100/60 dark:bg-amber-500/10`),children:[(0,l.jsx)(`span`,{className:`w-8 text-right pr-2 text-muted-foreground/50 select-none shrink-0`,children:e.oldLineNumber}),(0,l.jsxs)(`span`,{className:t.t(e.type===`removed`&&`text-red-800 dark:text-red-300`,e.type===`modified`&&`text-amber-800 dark:text-amber-300`),children:[e.type===`removed`&&(0,l.jsx)(`span`,{className:`text-red-500 mr-1`,children:`-`}),e.content]})]},`${n}-${r}`))},n))})]}),(0,l.jsxs)(`div`,{className:`p-0`,children:[(0,l.jsx)(`div`,{className:`px-3 py-1.5 border-b border-border/50 bg-emerald-50/50 dark:bg-emerald-950/10`,children:(0,l.jsx)(`span`,{className:`text-[10px] font-semibold text-emerald-700 dark:text-emerald-400 uppercase tracking-wider`,children:h})}),(0,l.jsx)(`div`,{className:`font-mono text-[12px] leading-relaxed`,children:f.map((e,n)=>(0,l.jsx)(s.Fragment,{children:e.lines.filter(e=>e.type!==`removed`).map((e,r)=>(0,l.jsxs)(`div`,{className:t.t(`px-3 py-0.5 flex`,e.type===`added`&&`bg-emerald-100/60 dark:bg-emerald-500/10`,e.type===`modified`&&`bg-amber-100/60 dark:bg-amber-500/10`),children:[(0,l.jsx)(`span`,{className:`w-8 text-right pr-2 text-muted-foreground/50 select-none shrink-0`,children:e.newLineNumber}),(0,l.jsxs)(`span`,{className:t.t(e.type===`added`&&`text-emerald-800 dark:text-emerald-300`,e.type===`modified`&&`text-amber-800 dark:text-amber-300`),children:[e.type===`added`&&(0,l.jsx)(`span`,{className:`text-emerald-500 mr-1`,children:`+`}),e.content]})]},`${n}-${r}`))},n))})]})]}):(0,l.jsxs)(`div`,{className:`font-mono text-[12px] leading-relaxed`,children:[f.map((e,n)=>(0,l.jsxs)(s.Fragment,{children:[(0,l.jsxs)(`div`,{className:`px-3 py-1 bg-blue-50/50 dark:bg-blue-950/10 text-blue-600 dark:text-blue-400 text-[10px]`,children:[`@@ -`,e.oldStart,` +`,e.newStart,` @@`]}),e.lines.map((e,r)=>(0,l.jsxs)(`div`,{className:t.t(`px-3 py-0.5 flex`,e.type===`added`&&`bg-emerald-100/60 dark:bg-emerald-500/10`,e.type===`removed`&&`bg-red-100/60 dark:bg-red-500/10`,e.type===`modified`&&`bg-amber-100/60 dark:bg-amber-500/10`),children:[(0,l.jsx)(`span`,{className:`w-8 text-right pr-2 text-muted-foreground/50 select-none shrink-0`,children:e.oldLineNumber||``}),(0,l.jsx)(`span`,{className:`w-8 text-right pr-2 text-muted-foreground/50 select-none shrink-0`,children:e.newLineNumber||``}),(0,l.jsx)(`span`,{className:`w-4 shrink-0 text-center select-none`,children:e.type===`added`?(0,l.jsx)(`span`,{className:`text-emerald-500`,children:`+`}):e.type===`removed`?(0,l.jsx)(`span`,{className:`text-red-500`,children:`-`}):e.type===`modified`?(0,l.jsx)(`span`,{className:`text-amber-500`,children:`~`}):(0,l.jsx)(`span`,{className:`text-muted-foreground/30`,children:` `})}),(0,l.jsx)(`span`,{className:t.t(e.type===`added`&&`text-emerald-800 dark:text-emerald-300`,e.type===`removed`&&`text-red-800 dark:text-red-300 line-through`,e.type===`modified`&&`text-amber-800 dark:text-amber-300`),children:e.content})]},`${n}-${r}`))]},n)),f.length===0&&(0,l.jsx)(`div`,{className:`py-8 text-center text-sm text-muted-foreground italic`,children:`No differences found.`})]})}),(0,l.jsx)(`div`,{className:`hidden`,children:n})]})}function vt(e){return[{type:J,oldVersionLabel:e?.oldVersionLabel||`v1.0`,newVersionLabel:e?.newVersionLabel||`v1.1`,oldText:e?.oldText||``,newText:e?.newText||``,hunks:e?.hunks||[{oldStart:1,newStart:1,lines:[{content:`The system SHALL authenticate users via OAuth2.`,type:`unchanged`,oldLineNumber:1,newLineNumber:1},{content:`Rate limiting: 50 req/min per user.`,type:`removed`,oldLineNumber:2},{content:`Rate limiting: 100 req/min per user.`,type:`added`,newLineNumber:2},{content:`All API responses use JSON format.`,type:`unchanged`,oldLineNumber:3,newLineNumber:3},{content:`Added: Support for WebSocket real-time events.`,type:`added`,newLineNumber:4}]}],stats:e?.stats||{additions:2,deletions:1,modifications:0},author:e?.author,timestamp:e?.timestamp,children:[{text:``}]}]}async function yt(){try{let{createPlatePlugin:e}=await import(`platejs/react`);return e({key:J,node:{isElement:!0,isVoid:!0,type:J,component:q}})}catch{return console.warn(`[WakaVersionDiffBlock] platejs not installed`),null}}var J,bt=e.n((()=>{t.n(),J=`version_diff`,q.displayName=`WakaVersionDiffBlock`})),xt=e.r({EMBED_BLOCK_TYPE:()=>X,WakaEmbedBlock:()=>Y,createEmbedNodes:()=>wt,createEmbedPlugin:()=>Tt,detectEmbedProvider:()=>St,resolveEmbedUrl:()=>Ct});function St(e){let t=e.toLowerCase();return t.includes(`figma.com`)?`figma`:t.includes(`youtube.com`)||t.includes(`youtu.be`)?`youtube`:t.includes(`vimeo.com`)?`vimeo`:t.includes(`codesandbox.io`)?`codesandbox`:t.includes(`codepen.io`)?`codepen`:t.includes(`stackblitz.com`)?`stackblitz`:t.includes(`loom.com`)?`loom`:t.includes(`miro.com`)?`miro`:t.includes(`notion.so`)?`notion`:t.includes(`gist.github.com`)?`github-gist`:`generic`}function Ct(e,t){return Et[t].transform(e)||e}function Y({attributes:e,children:r,element:i,className:a}){let o=i,c=Et[o?.provider||`generic`],u=o?.embedUrl||``,d=o?.aspectRatio||c.defaultAspect,f=s.useMemo(()=>u?n.s(u):``,[u]),[p,m]=s.useState(!1),[h,g]=s.useState(!1);return(0,l.jsxs)(`div`,{...e,contentEditable:!1,className:t.t(`my-4 rounded-lg overflow-hidden border border-border shadow-sm`,a),children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 bg-muted/30 border-b border-border`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,l.jsx)(`svg`,{className:t.t(`h-4 w-4`,c.color),viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,l.jsx)(`path`,{d:c.icon})}),(0,l.jsx)(`span`,{className:t.t(`text-[10px] font-bold uppercase tracking-wider`,c.color),children:c.label}),o?.title&&(0,l.jsx)(`span`,{className:`text-xs text-muted-foreground ml-1 truncate max-w-[300px]`,children:o.title})]}),o?.url&&(0,l.jsxs)(`a`,{href:n.s(o.url),target:`_blank`,rel:`noopener noreferrer`,className:`text-[10px] text-primary hover:underline flex items-center gap-1`,children:[`Open`,(0,l.jsx)(`svg`,{className:`h-3 w-3`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14`})})]})]}),(0,l.jsxs)(`div`,{className:`relative bg-muted/10`,style:{aspectRatio:d,maxHeight:o?.maxHeight?`${o.maxHeight}px`:void 0},children:[!p&&!h&&f&&(0,l.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-muted/20`,children:(0,l.jsxs)(`svg`,{className:`h-8 w-8 animate-spin text-muted-foreground/30`,viewBox:`0 0 24 24`,fill:`none`,children:[(0,l.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,l.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`})]})}),h&&(0,l.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center bg-muted/10 text-muted-foreground`,children:[(0,l.jsx)(`svg`,{className:`h-8 w-8 mb-2`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.5,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.34 16.5c-.77.833.192 2.5 1.732 2.5z`})}),(0,l.jsx)(`span`,{className:`text-xs`,children:`Failed to load embed`})]}),!f&&(0,l.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 text-muted-foreground`,children:[(0,l.jsx)(`svg`,{className:`h-10 w-10 mb-3 text-muted-foreground/30`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.5,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1`})}),(0,l.jsx)(`span`,{className:`text-sm`,children:`Paste a URL to embed content`}),(0,l.jsx)(`span`,{className:`text-[10px] mt-1 text-muted-foreground/60`,children:`Supports Figma, YouTube, CodeSandbox, Loom, and more`})]}),f&&(0,l.jsx)(`iframe`,{src:f,title:o?.title||`${c.label} embed`,className:t.t(`w-full h-full border-0`,!p&&`opacity-0`),loading:`lazy`,allowFullScreen:!0,sandbox:`allow-scripts allow-same-origin allow-popups allow-forms`,onLoad:()=>m(!0),onError:()=>g(!0)})]}),(0,l.jsx)(`div`,{className:`hidden`,children:r})]})}function wt(e,t){let n=St(e);return[{type:X,url:e,provider:n,embedUrl:Ct(e,n),title:t?.title,aspectRatio:t?.aspectRatio,maxHeight:t?.maxHeight,children:[{text:``}]}]}async function Tt(){try{let{createPlatePlugin:e}=await import(`platejs/react`);return e({key:X,node:{isElement:!0,isVoid:!0,type:X,component:Y}})}catch{return console.warn(`[WakaEmbedBlock] platejs not installed`),null}}var X,Et,Dt=e.n((()=>{t.n(),n.a(),X=`embed`,Et={figma:{label:`Figma`,icon:`M12 2a4 4 0 00-4 4v4a4 4 0 004-4V2zm0 12a4 4 0 01-4 4v2h4v-6zm8-4a4 4 0 01-4 4H12v-8h4a4 4 0 014 4z`,color:`text-purple-600 dark:text-purple-400`,bgColor:`bg-purple-50 dark:bg-purple-500/10`,transform:e=>e.includes(`figma.com`)?`https://www.figma.com/embed?embed_host=wakastart&url=${encodeURIComponent(e)}`:null,defaultAspect:`16/9`,domain:`figma.com`},youtube:{label:`YouTube`,icon:`M19.615 3.184c-3.604-.246-11.631-.245-15.23 0C.488 3.45.029 5.804 0 12c.029 6.185.484 8.549 4.385 8.816 3.6.245 11.626.246 15.23 0C23.512 20.55 23.971 18.196 24 12c-.029-6.185-.484-8.549-4.385-8.816zM9 16V8l8 4-8 4z`,color:`text-red-600 dark:text-red-400`,bgColor:`bg-red-50 dark:bg-red-500/10`,transform:e=>{let t=e.match(/(?:youtube\.com\/(?:watch\?v=|embed\/)|youtu\.be\/)([a-zA-Z0-9_-]+)/);return t?`https://www.youtube.com/embed/${t[1]}`:null},defaultAspect:`16/9`,domain:`youtube.com`},vimeo:{label:`Vimeo`,icon:`M22.875 10.063c-.098 2.141-1.592 5.075-4.483 8.8-2.988 3.891-5.517 5.836-7.588 5.836-1.282 0-2.367-1.184-3.258-3.553L6.14 15.15c-.589-2.369-1.221-3.553-1.896-3.553-.147 0-.663.31-1.546.928l-.925-1.19c.973-.855 1.932-1.71 2.877-2.565 1.297-1.12 2.27-1.71 2.921-1.77 1.534-.147 2.479.903 2.834 3.148.384 2.422.65 3.928.801 4.519.445 2.022.934 3.033 1.468 3.033.414 0 1.037-.656 1.868-1.967.831-1.311 1.276-2.31 1.336-2.998.119-1.14-.328-1.71-1.342-1.71-.478 0-.97.109-1.477.327.981-3.212 2.855-4.773 5.625-4.684 2.054.059 3.024 1.394 2.908 4.003z`,color:`text-sky-600 dark:text-sky-400`,bgColor:`bg-sky-50 dark:bg-sky-500/10`,transform:e=>{let t=e.match(/vimeo\.com\/(\d+)/);return t?`https://player.vimeo.com/video/${t[1]}`:null},defaultAspect:`16/9`,domain:`vimeo.com`},codesandbox:{label:`CodeSandbox`,icon:`M2 6l10-4 10 4v12l-10 4L2 18V6zm10 2L4 4v8l8 4V8zm8-4l-8 4v8l8-4V4z`,color:`text-gray-700 dark:text-gray-300`,bgColor:`bg-gray-50 dark:bg-gray-500/10`,transform:e=>{let t=e.match(/codesandbox\.io\/(?:s|p)\/([a-zA-Z0-9-]+)/);return t?`https://codesandbox.io/embed/${t[1]}?fontsize=14&hidenavigation=1&theme=dark`:null},defaultAspect:`16/9`,domain:`codesandbox.io`},codepen:{label:`CodePen`,icon:`M12 2L2 8.5v7L12 22l10-6.5v-7L12 2zm0 3.311L18.26 9 12 12.689 5.74 9 12 5.311zM4 10.289l6 3.9v5.522l-6-3.9v-5.522zm8 9.422v-5.522l6-3.9v5.522l-6 3.9z`,color:`text-gray-700 dark:text-gray-300`,bgColor:`bg-gray-50 dark:bg-gray-500/10`,transform:e=>{let t=e.match(/codepen\.io\/([^/]+)\/pen\/([a-zA-Z0-9]+)/);return t?`https://codepen.io/${t[1]}/embed/${t[2]}?default-tab=result&theme-id=dark`:null},defaultAspect:`16/9`,domain:`codepen.io`},stackblitz:{label:`StackBlitz`,icon:`M13 10V3L4 14h7v7l9-11h-7z`,color:`text-blue-600 dark:text-blue-400`,bgColor:`bg-blue-50 dark:bg-blue-500/10`,transform:e=>e.includes(`stackblitz.com`)?e.replace(`stackblitz.com/edit`,`stackblitz.com/embed`):null,defaultAspect:`16/9`,domain:`stackblitz.com`},loom:{label:`Loom`,icon:`M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 14.5v-9l6 4.5-6 4.5z`,color:`text-purple-600 dark:text-purple-400`,bgColor:`bg-purple-50 dark:bg-purple-500/10`,transform:e=>{let t=e.match(/loom\.com\/share\/([a-zA-Z0-9]+)/);return t?`https://www.loom.com/embed/${t[1]}`:null},defaultAspect:`16/9`,domain:`loom.com`},miro:{label:`Miro`,icon:`M4 3h16a1 1 0 011 1v16a1 1 0 01-1 1H4a1 1 0 01-1-1V4a1 1 0 011-1z`,color:`text-yellow-600 dark:text-yellow-400`,bgColor:`bg-yellow-50 dark:bg-yellow-500/10`,transform:e=>{let t=e.match(/miro\.com\/app\/board\/([^/?]+)/);return t?`https://miro.com/app/live-embed/${t[1]}/`:null},defaultAspect:`16/9`,domain:`miro.com`},notion:{label:`Notion`,icon:`M4 4a2 2 0 012-2h12a2 2 0 012 2v16a2 2 0 01-2 2H6a2 2 0 01-2-2V4zm4 2v4h8V6H8zm0 6v2h8v-2H8zm0 4v2h5v-2H8z`,color:`text-gray-800 dark:text-gray-200`,bgColor:`bg-gray-50 dark:bg-gray-500/10`,transform:()=>null,defaultAspect:`16/9`,domain:`notion.so`},"github-gist":{label:`GitHub Gist`,icon:`M12 2C6.477 2 2 6.477 2 12c0 4.42 2.865 8.166 6.839 9.489.5.092.682-.217.682-.482 0-.237-.009-.866-.013-1.7-2.782.604-3.369-1.34-3.369-1.34-.454-1.156-1.11-1.462-1.11-1.462-.908-.62.069-.608.069-.608 1.003.07 1.531 1.03 1.531 1.03.892 1.529 2.341 1.087 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.11-4.555-4.943 0-1.091.39-1.984 1.029-2.683-.103-.253-.446-1.27.098-2.647 0 0 .84-.269 2.75 1.025A9.578 9.578 0 0112 6.836c.85.004 1.705.114 2.504.336 1.909-1.294 2.747-1.025 2.747-1.025.546 1.377.203 2.394.1 2.647.64.699 1.028 1.592 1.028 2.683 0 3.842-2.339 4.687-4.566 4.935.359.309.678.919.678 1.852 0 1.336-.012 2.415-.012 2.743 0 .267.18.578.688.48C19.138 20.161 22 16.416 22 12c0-5.523-4.477-10-10-10z`,color:`text-gray-800 dark:text-gray-200`,bgColor:`bg-gray-50 dark:bg-gray-500/10`,transform:()=>null,defaultAspect:`4/3`,domain:`gist.github.com`},generic:{label:`Embed`,icon:`M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14`,color:`text-muted-foreground`,bgColor:`bg-muted`,transform:()=>null,defaultAspect:`16/9`,domain:``}},Y.displayName=`WakaEmbedBlock`})),Ot=e.r({CODE_PLAYGROUND_BLOCK_TYPE:()=>Q,WakaCodePlaygroundBlock:()=>Z,createCodePlaygroundNodes:()=>At,createCodePlaygroundPlugin:()=>jt});function kt(e){return e.split(`
47
- `).map((e,t)=>(0,l.jsxs)(`div`,{className:`table-row`,children:[(0,l.jsx)(`span`,{className:`table-cell w-8 text-right pr-3 text-muted-foreground/40 select-none text-[11px]`,children:t+1}),(0,l.jsx)(`span`,{className:`table-cell`,children:e||` `})]},t))}function Z({attributes:e,children:n,element:r,className:i,onExecute:a}){let o=r,c=o?.code||``,u=o?.language||`javascript`,d=Mt[u],f=o?.output||``,p=o?.errorOutput||``,m=o?.executionStatus||`idle`,h=o?.title||`main${d.extension}`,[g,_]=s.useState(!!f||!!p),[v,y]=s.useState(m),b=s.useCallback(async()=>{if(a){y(`running`),_(!0);try{await a(c,u),y(`success`)}catch{y(`error`)}}},[c,u,a]),x=v===m?m:v;return(0,l.jsxs)(`div`,{...e,contentEditable:!1,className:t.t(`my-4 rounded-lg overflow-hidden border border-gray-800 dark:border-gray-700 shadow-lg`,i),children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-1.5 bg-gray-900 dark:bg-gray-800 border-b border-gray-800 dark:border-gray-700`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-1.5`,"aria-hidden":`true`,children:[(0,l.jsx)(`div`,{className:`h-3 w-3 rounded-full bg-red-500/80`}),(0,l.jsx)(`div`,{className:`h-3 w-3 rounded-full bg-yellow-500/80`}),(0,l.jsx)(`div`,{className:`h-3 w-3 rounded-full bg-green-500/80`})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-0.5 rounded bg-gray-800 dark:bg-gray-700`,children:[(0,l.jsx)(`span`,{className:t.t(`text-[10px] font-bold`,d.color),children:d.label}),(0,l.jsx)(`span`,{className:`text-xs font-mono text-gray-300`,children:h})]})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[x!==`idle`&&(0,l.jsxs)(`div`,{className:`flex items-center gap-1`,children:[x===`running`&&(0,l.jsxs)(`svg`,{className:`h-3 w-3 animate-spin text-amber-400`,viewBox:`0 0 24 24`,fill:`none`,children:[(0,l.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,l.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`})]}),x===`success`&&(0,l.jsx)(`svg`,{className:`h-3 w-3 text-emerald-400`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M5 13l4 4L19 7`})}),x===`error`&&(0,l.jsx)(`svg`,{className:`h-3 w-3 text-red-400`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6 18L18 6M6 6l12 12`})})]}),a&&(0,l.jsxs)(`button`,{type:`button`,onClick:b,disabled:x===`running`||!c.trim(),className:t.t(`flex items-center gap-1 px-2.5 py-1 rounded text-[10px] font-semibold transition-all`,x===`running`?`bg-amber-500/20 text-amber-300 cursor-wait`:`bg-emerald-500/20 text-emerald-300 hover:bg-emerald-500/30`,!c.trim()&&`opacity-40 cursor-not-allowed`),"aria-label":`Run code`,children:[(0,l.jsx)(`svg`,{className:`h-3 w-3`,viewBox:`0 0 24 24`,fill:`currentColor`,children:(0,l.jsx)(`path`,{d:`M8 5v14l11-7z`})}),x===`running`?`Running...`:`Run`]}),(0,l.jsx)(`button`,{type:`button`,onClick:()=>_(!g),className:t.t(`px-2 py-1 rounded text-[10px] font-medium transition-colors`,g?`bg-gray-700 text-gray-200`:`text-gray-400 hover:text-gray-200`),children:`Console`})]})]}),(0,l.jsx)(`div`,{className:`bg-gray-950 dark:bg-[#0d1117] overflow-x-auto`,children:(0,l.jsx)(`pre`,{className:`p-4 text-[12px] font-mono leading-relaxed text-gray-100 min-h-[80px]`,children:(0,l.jsx)(`code`,{className:`table w-full`,children:kt(c)})})}),g&&(f||p||x===`running`)&&(0,l.jsxs)(`div`,{className:`border-t border-gray-800 dark:border-gray-700`,children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-1 bg-gray-900 dark:bg-gray-800`,children:[(0,l.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-wider text-gray-400`,children:`Output`}),(f||p)&&(0,l.jsx)(`button`,{type:`button`,className:`text-[10px] text-gray-500 hover:text-gray-300 transition-colors`,"aria-label":`Clear output`,children:`Clear`})]}),(0,l.jsx)(`div`,{className:`bg-gray-950 dark:bg-[#0d1117] p-3 max-h-[200px] overflow-y-auto`,children:x===`running`?(0,l.jsxs)(`div`,{className:`flex items-center gap-2 text-amber-400 text-xs font-mono`,children:[(0,l.jsxs)(`svg`,{className:`h-3 w-3 animate-spin`,viewBox:`0 0 24 24`,fill:`none`,children:[(0,l.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,l.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`})]}),`Executing...`]}):p?(0,l.jsx)(`pre`,{className:`text-[12px] font-mono text-red-400 whitespace-pre-wrap`,children:p}):f?(0,l.jsx)(`pre`,{className:`text-[12px] font-mono text-gray-200 whitespace-pre-wrap`,children:f}):null})]}),(0,l.jsx)(`div`,{className:`hidden`,children:n})]})}function At(e){return[{type:Q,code:e?.code||`// Write your code here
48
- console.log("Hello, WakaStart!");`,language:e?.language||`javascript`,title:e?.title,output:``,errorOutput:``,executionStatus:`idle`,showLineNumbers:!0,readOnly:!1,children:[{text:``}]}]}async function jt(e){try{let{createPlatePlugin:t}=await import(`platejs/react`);return t({key:Q,node:{isElement:!0,isVoid:!0,type:Q,component:t=>(0,l.jsx)(Z,{...t,onExecute:e})}})}catch{return console.warn(`[WakaCodePlaygroundBlock] platejs not installed`),null}}var Q,Mt,Nt=e.n((()=>{t.n(),Q=`code_playground`,Mt={javascript:{label:`JavaScript`,color:`text-yellow-500`,extension:`.js`},typescript:{label:`TypeScript`,color:`text-blue-500`,extension:`.ts`},python:{label:`Python`,color:`text-green-500`,extension:`.py`},html:{label:`HTML`,color:`text-orange-500`,extension:`.html`},css:{label:`CSS`,color:`text-pink-500`,extension:`.css`},json:{label:`JSON`,color:`text-gray-400`,extension:`.json`},sql:{label:`SQL`,color:`text-cyan-500`,extension:`.sql`},bash:{label:`Bash`,color:`text-emerald-500`,extension:`.sh`},go:{label:`Go`,color:`text-cyan-600`,extension:`.go`},rust:{label:`Rust`,color:`text-orange-600`,extension:`.rs`}},Z.displayName=`WakaCodePlaygroundBlock`})),Pt=e.r({COMMENT_THREAD_BLOCK_TYPE:()=>$,WakaCommentThreadBlock:()=>Rt,createCommentThreadNodes:()=>zt,createCommentThreadPlugin:()=>Bt});function Ft(e){let t=Date.now()-new Date(e).getTime(),n=Math.floor(t/1e3);if(n<60)return`just now`;let r=Math.floor(n/60);if(r<60)return`${r}m ago`;let i=Math.floor(r/60);if(i<24)return`${i}h ago`;let a=Math.floor(i/24);if(a<30)return`${a}d ago`;let o=Math.floor(a/30);return o<12?`${o}mo ago`:`${Math.floor(o/12)}y ago`}function It({author:e,size:n=`sm`}){let r=n===`sm`?`h-6 w-6 text-[9px]`:`h-8 w-8 text-[10px]`;return e.avatar?(0,l.jsx)(`img`,{src:e.avatar,alt:e.name,className:t.t(`rounded-full object-cover flex-shrink-0`,r)}):(0,l.jsx)(`div`,{className:t.t(`rounded-full flex items-center justify-center text-white font-semibold flex-shrink-0`,r,[`bg-blue-500`,`bg-emerald-500`,`bg-violet-500`,`bg-amber-500`,`bg-rose-500`,`bg-cyan-500`][e.name.split(``).reduce((e,t)=>e+t.charCodeAt(0),0)%6]),children:e.name.charAt(0).toUpperCase()})}function Lt({comment:e,isCurrentUser:n,isFirst:r}){return(0,l.jsxs)(`div`,{className:t.t(`flex gap-2.5 px-3 py-2`,!r&&`border-t border-border/30`),children:[(0,l.jsx)(It,{author:e.author}),(0,l.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,l.jsx)(`span`,{className:t.t(`text-xs font-semibold`,n?`text-primary`:`text-foreground`),children:e.author.name}),(0,l.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:Ft(e.createdAt)}),e.edited&&(0,l.jsx)(`span`,{className:`text-[9px] text-muted-foreground/60 italic`,children:`(edited)`})]}),(0,l.jsx)(`p`,{className:`text-xs text-foreground/80 mt-0.5 leading-relaxed whitespace-pre-wrap`,children:e.content}),e.reactions&&e.reactions.length>0&&(0,l.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-1.5`,children:e.reactions.map((e,n)=>(0,l.jsxs)(`button`,{type:`button`,className:t.t(`inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded-full text-[10px] border transition-colors`,e.reacted?`bg-primary/10 border-primary/30 text-primary`:`bg-muted/50 border-border/50 text-muted-foreground hover:bg-muted`),children:[(0,l.jsx)(`span`,{children:e.emoji}),(0,l.jsx)(`span`,{className:`font-medium`,children:e.count})]},n))})]})]})}function Rt({attributes:e,children:n,element:r,className:i,currentUserId:a,onReply:o,onResolve:c,onReopen:u}){let d=r,f=d?.threadId||``,p=d?.quotedText||``,m=d?.status||`open`,h=d?.comments||[],g=d?.totalComments??h.length,[_,v]=s.useState(``),[y,b]=s.useState(m===`resolved`),x={open:{label:`Open`,color:`text-blue-600 dark:text-blue-400`,bg:`bg-blue-50 dark:bg-blue-500/10`},resolved:{label:`Resolved`,color:`text-emerald-600 dark:text-emerald-400`,bg:`bg-emerald-50 dark:bg-emerald-500/10`},archived:{label:`Archived`,color:`text-muted-foreground`,bg:`bg-muted`}},S=()=>{!_.trim()||!o||(o(f,_.trim()),v(``))};return(0,l.jsxs)(`div`,{...e,contentEditable:!1,className:t.t(`my-3 rounded-lg overflow-hidden border shadow-sm transition-all duration-200`,m===`resolved`?`border-emerald-200 dark:border-emerald-800/30`:`border-primary/20`,i),children:[(0,l.jsxs)(`div`,{className:t.t(`flex items-center justify-between px-3 py-2 cursor-pointer`,m===`resolved`?`bg-emerald-50/50 dark:bg-emerald-950/10`:`bg-primary/5`),onClick:()=>b(!y),role:`button`,tabIndex:0,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&b(!y)},"aria-expanded":!y,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,l.jsx)(`svg`,{className:t.t(`h-4 w-4`,m===`resolved`?`text-emerald-500`:`text-primary`),viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,"aria-hidden":`true`,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z`})}),(0,l.jsx)(`span`,{className:t.t(`text-[10px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded`,x[m].bg,x[m].color),children:x[m].label}),(0,l.jsxs)(`span`,{className:`text-[10px] text-muted-foreground`,children:[g,` comment`,g===1?``:`s`]})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[m===`open`&&c&&(0,l.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),c(f)},className:`text-[10px] font-medium text-emerald-600 hover:text-emerald-700 dark:text-emerald-400 transition-colors`,children:`Resolve`}),m===`resolved`&&u&&(0,l.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),u(f)},className:`text-[10px] font-medium text-primary hover:text-primary/80 transition-colors`,children:`Reopen`}),(0,l.jsx)(`svg`,{className:t.t(`h-3.5 w-3.5 text-muted-foreground transition-transform`,y&&`-rotate-90`),viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M19 9l-7 7-7-7`})})]})]}),!y&&(0,l.jsxs)(l.Fragment,{children:[p&&(0,l.jsx)(`div`,{className:`mx-3 mt-3 mb-1 px-3 py-2 rounded bg-muted/50 border-l-2 border-primary/30`,children:(0,l.jsxs)(`p`,{className:`text-xs text-muted-foreground italic leading-relaxed line-clamp-3`,children:[`"`,p,`"`]})}),(0,l.jsx)(`div`,{className:`py-1`,children:h.map((e,t)=>(0,l.jsx)(Lt,{comment:e,isCurrentUser:e.author.id===a,isFirst:t===0},e.id))}),m===`open`&&o&&(0,l.jsx)(`div`,{className:`px-3 pb-3 pt-1 border-t border-border/30`,children:(0,l.jsxs)(`div`,{className:`flex gap-2`,children:[(0,l.jsx)(`input`,{type:`text`,value:_,onChange:e=>v(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),S())},placeholder:`Reply...`,className:t.t(`flex-1 px-3 py-1.5 rounded-md text-xs bg-muted/50 border border-border/50`,`focus:outline-none focus:ring-1 focus:ring-ring`,`placeholder:text-muted-foreground/50`)}),(0,l.jsx)(`button`,{type:`button`,onClick:S,disabled:!_.trim(),className:t.t(`px-3 py-1.5 rounded-md text-xs font-medium transition-colors`,`bg-primary text-primary-foreground hover:bg-primary/90`,`disabled:opacity-40 disabled:cursor-not-allowed`),children:`Reply`})]})})]}),(0,l.jsx)(`div`,{className:`hidden`,children:n})]})}function zt(e){let t=new Date().toISOString();return[{type:$,threadId:e?.threadId||`thread-${Date.now()}`,quotedText:e?.quotedText||``,status:`open`,comments:e?.initialComment?[{id:`comment-${Date.now()}`,author:{id:e.initialComment.authorId,name:e.initialComment.authorName},content:e.initialComment.content,createdAt:t}]:[],children:[{text:``}]}]}async function Bt(e,t,n){try{let{createPlatePlugin:r}=await import(`platejs/react`);return r({key:$,node:{isElement:!0,isVoid:!0,type:$,component:r=>(0,l.jsx)(Rt,{...r,currentUserId:e,onReply:t,onResolve:n})}})}catch{return console.warn(`[WakaCommentThreadBlock] platejs not installed`),null}}var $,Vt=e.n((()=>{t.n(),$=`comment_thread`,Rt.displayName=`WakaCommentThreadBlock`}));t.n();var Ht=[{key:`user-story`,label:`User Story`,description:`Structured user story (As a / I want / So that)`,icon:(()=>{let{Users:e}=require(`lucide-react`);return e})(),group:`WakaStart Blocks`,keywords:[`user`,`story`,`agile`,`requirement`,`persona`],isCustom:!0,action:t=>{try{let{createUserStoryNodes:n}=(qe(),e.i(Ue));t.insertNodes(n())}catch{}}},{key:`acceptance-criteria`,label:`Acceptance Criteria`,description:`Gherkin-format criteria (Given / When / Then)`,icon:(()=>{let{CheckCircle2:e}=require(`lucide-react`);return e})(),group:`WakaStart Blocks`,keywords:[`acceptance`,`criteria`,`gherkin`,`given`,`when`,`then`,`test`],isCustom:!0,action:t=>{try{let{createAcceptanceCriteriaNodes:n}=($e(),e.i(Je));t.insertNodes(n())}catch{}}},{key:`api-endpoint`,label:`API Endpoint`,description:`REST API documentation (method, route, body, response)`,icon:(()=>{let{Zap:e}=require(`lucide-react`);return e})(),group:`WakaStart Blocks`,keywords:[`api`,`endpoint`,`rest`,`route`,`get`,`post`,`put`,`delete`],isCustom:!0,action:t=>{try{let{createApiEndpointNodes:n}=(ot(),e.i(et));t.insertNodes(n())}catch{}}},{key:`diagram`,label:`Diagram`,description:`Mermaid / PlantUML diagram with live preview`,icon:(()=>{let{GitBranch:e}=require(`lucide-react`);return e})(),group:`WakaStart Blocks`,keywords:[`diagram`,`mermaid`,`plantuml`,`flowchart`,`sequence`,`graph`],isCustom:!0,action:t=>{try{let{createDiagramNodes:n}=(dt(),e.i(st));t.insertNodes(n())}catch{}}},{key:`ai-assist`,label:`AI Assistant`,description:`Ask the AI to generate content for your document`,icon:(()=>{let{Sparkles:e}=require(`lucide-react`);return e})(),group:`WakaStart Blocks`,keywords:[`ai`,`ia`,`assistant`,`generate`,`write`,`help`,`claude`],isCustom:!0,action:t=>{try{let{createAiAssistNodes:n}=(gt(),e.i(ft));t.insertNodes(n())}catch{}}},{key:`version-diff`,label:`Version Diff`,description:`Compare two versions of text with visual diff`,icon:(()=>{let{GitCompare:e}=require(`lucide-react`);return e})(),group:`WakaStart Blocks`,keywords:[`diff`,`version`,`compare`,`change`,`history`,`git`],isCustom:!0,action:t=>{try{let{createVersionDiffNodes:n}=(bt(),e.i(_t));t.insertNodes(n())}catch{}}},{key:`embed`,label:`Embed`,description:`Embed external content (Figma, YouTube, CodeSandbox...)`,icon:(()=>{let{ExternalLink:e}=require(`lucide-react`);return e})(),group:`WakaStart Blocks`,keywords:[`embed`,`figma`,`youtube`,`codesandbox`,`loom`,`iframe`,`video`],isCustom:!0,action:t=>{try{let{createEmbedNodes:n}=(Dt(),e.i(xt));t.insertNodes(n(``))}catch{}}},{key:`code-playground`,label:`Code Playground`,description:`Executable code block with console output`,icon:(()=>{let{Terminal:e}=require(`lucide-react`);return e})(),group:`WakaStart Blocks`,keywords:[`code`,`playground`,`run`,`execute`,`terminal`,`console`,`sandbox`],isCustom:!0,action:t=>{try{let{createCodePlaygroundNodes:n}=(Nt(),e.i(Ot));t.insertNodes(n())}catch{}}},{key:`comment-thread`,label:`Comment Thread`,description:`Inline discussion thread (like Google Docs)`,icon:(()=>{let{MessageSquare:e}=require(`lucide-react`);return e})(),group:`WakaStart Blocks`,keywords:[`comment`,`thread`,`discussion`,`review`,`feedback`,`note`],isCustom:!0,action:t=>{try{let{createCommentThreadNodes:n}=(Vt(),e.i(Pt));t.insertNodes(n())}catch{}}}];function Ut(e){return[...C.map(e=>({...e,isCustom:!1})),...Ht,...e||[]]}function Wt({commands:e,query:n=``,onSelect:r,activeIndex:i,onActiveIndexChange:a,className:o}){let c=s.useMemo(()=>e||Ut(),[e]),[u,d]=s.useState(0),f=i??u,p=a||d,m=s.useMemo(()=>{if(!n)return c;let e=n.toLowerCase();return c.filter(t=>t.label.toLowerCase().includes(e)||t.key.toLowerCase().includes(e)||t.description?.toLowerCase().includes(e)||t.keywords?.some(t=>t.toLowerCase().includes(e)))},[c,n]),h=s.useMemo(()=>{let e=new Map;for(let t of m){let n=t.group||`Other`;e.has(n)||e.set(n,[]),e.get(n).push(t)}return e},[m]);s.useEffect(()=>p(0),[n]);let g=s.useCallback(e=>{e.key===`ArrowDown`?(e.preventDefault(),p(Math.min(f+1,m.length-1))):e.key===`ArrowUp`?(e.preventDefault(),p(Math.max(f-1,0))):e.key===`Enter`&&m[f]&&(e.preventDefault(),r?.(m[f]))},[m,f,r,p]);return(0,l.jsxs)(`div`,{className:t.t(`w-80 max-h-96 overflow-y-auto`,`rounded-lg border bg-popover shadow-xl`,`p-1`,o),role:`listbox`,onKeyDown:g,"aria-label":`Slash commands`,children:[m.length===0&&(0,l.jsxs)(`div`,{className:`px-3 py-6 text-center text-sm text-muted-foreground`,children:[`No blocks found for "`,n,`"`]}),Array.from(h.entries()).map(([e,n])=>(0,l.jsxs)(`div`,{className:`mb-1`,children:[(0,l.jsxs)(`div`,{className:`px-2 py-1.5 text-[10px] font-bold uppercase tracking-wider text-muted-foreground/70 flex items-center gap-2`,children:[e,e===`WakaStart Blocks`&&(0,l.jsx)(`span`,{className:`px-1 py-0.5 rounded bg-primary/10 text-primary text-[8px] font-bold normal-case tracking-normal`,children:`Custom`})]}),n.map(e=>{let n=m.indexOf(e),i=e.icon;return(0,l.jsxs)(`button`,{role:`option`,"aria-selected":n===f,className:t.t(`flex w-full items-center gap-3 rounded-md px-2 py-2 text-left`,`text-sm transition-colors cursor-pointer`,n===f?`bg-accent text-accent-foreground`:`hover:bg-accent/50`),onMouseEnter:()=>p(n),onClick:()=>r?.(e),children:[(0,l.jsx)(`div`,{className:t.t(`flex h-8 w-8 shrink-0 items-center justify-center rounded-md border`,e.isCustom?`border-primary/20 bg-primary/5`:`border-border bg-background`),children:typeof i==`function`?(0,l.jsx)(i,{className:`h-4 w-4`}):i}),(0,l.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,l.jsx)(`span`,{className:`font-medium text-sm`,children:e.label}),e.isCustom&&(0,l.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-primary flex-shrink-0`})]}),e.description&&(0,l.jsx)(`div`,{className:`text-[11px] text-muted-foreground truncate mt-0.5`,children:e.description})]})]},e.key)})]},e))]})}Wt.displayName=`WakaSlashMenuBlock`;async function Gt(e){try{let{SlashPlugin:t,SlashInputPlugin:n}=await import(`@platejs/combobox/react`),r=Ut(e);return[t.configure({options:{trigger:`/`,triggerPreviousCharPattern:/^$|^[\s"']$/,rules:r.map(e=>({key:e.key,text:e.label,keywords:e.keywords,onSelect:e.action}))}}),n]}catch{return console.warn(`[WakaSlashMenuBlock] @platejs/combobox not installed, slash commands disabled`),[]}}async function Kt(e){let t=[],n=[createUserStoryPlugin(),createAcceptanceCriteriaPlugin(),createApiEndpointPlugin(),createDiagramPlugin(e?.diagramRenderer),createAiAssistPlugin(e?.aiGenerator),createVersionDiffPlugin(),createEmbedPlugin(),createCodePlaygroundPlugin(e?.codeExecutor),createCommentThreadPlugin(e?.currentUserId,e?.onCommentReply)],r=await Promise.allSettled(n);for(let e of r)e.status===`fulfilled`&&e.value&&t.push(e.value);return t}exports.ACCEPTANCE_CRITERIA_BLOCK_TYPE=z,exports.AI_ASSIST_BLOCK_TYPE=K,exports.API_ENDPOINT_BLOCK_TYPE=V,exports.BlockquoteElement=Ae,exports.BoldLeaf=Fe,exports.CODE_PLAYGROUND_BLOCK_TYPE=Q,exports.COMMENT_THREAD_BLOCK_TYPE=$,exports.CalloutElement=Ce,exports.CodeLeaf=ze,exports.ColumnElement=xe,exports.ColumnGroupElement=be,exports.DEFAULT_AI_ACTIONS=E,exports.DEFAULT_FLOATING_BUTTONS=b,exports.DEFAULT_SLASH_COMMANDS=C,exports.DEFAULT_SPEC_TEMPLATES=N,exports.DEFAULT_TOOLBAR_GROUPS=p,exports.DIAGRAM_BLOCK_TYPE=W,exports.EMBED_BLOCK_TYPE=X,exports.H1Element=we,exports.H2Element=Te,exports.H3Element=Ee,exports.H4Element=De,exports.H5Element=Oe,exports.H6Element=ke,exports.HighlightLeaf=Be,exports.ItalicLeaf=Ie,exports.LinkElement=Me,exports.MentionElement=Ne,exports.MentionSuggestions=he,exports.ParagraphElement=je,exports.SeparatorElement=Pe,exports.StrikethroughLeaf=Re,exports.SubscriptLeaf=He,exports.SuperscriptLeaf=Ve,exports.TableCellElement=ve,exports.TableCellHeaderElement=ye,exports.TableElement=ge,exports.TableRowElement=_e,exports.USER_STORY_BLOCK_TYPE=I,exports.UnderlineLeaf=Le,exports.VERSION_DIFF_BLOCK_TYPE=J,exports.WAKA_BLOCK_COMMANDS=Ht,exports.WakaAIWriter=D,exports.WakaAcceptanceCriteriaBlock=R,exports.WakaAiAssistBlock=G,exports.WakaApiEndpointBlock=B,exports.WakaCodePlaygroundBlock=Z,exports.WakaCollaborativeEditor=oe,exports.WakaCommentThreadBlock=Rt,exports.WakaDiagramBlock=U,exports.WakaDiffViewer=ce,exports.WakaDnDEditor=ie,exports.WakaDocumentEditor=k,exports.WakaEditor=h,exports.WakaEditorToolbar=m,exports.WakaEmbedBlock=Y,exports.WakaFloatingToolbar=x,exports.WakaMarkdownEditor=M,exports.WakaMentionEditor=pe,exports.WakaSlashMenu=w,exports.WakaSlashMenuBlock=Wt,exports.WakaSpecEditor=ne,exports.WakaUserStoryBlock=F,exports.WakaVersionDiffBlock=q,exports.createAcceptanceCriteriaNodes=Ze,exports.createAcceptanceCriteriaPlugin=Qe,exports.createAiAssistNodes=mt,exports.createAiAssistPlugin=ht,exports.createApiEndpointNodes=it,exports.createApiEndpointPlugin=at,exports.createCodePlaygroundNodes=At,exports.createCodePlaygroundPlugin=jt,exports.createCommentThreadNodes=zt,exports.createCommentThreadPlugin=Bt,exports.createDiagramNodes=ct,exports.createDiagramPlugin=lt,exports.createEmbedNodes=wt,exports.createEmbedPlugin=Tt,exports.createSlashCommandPlugins=T,exports.createUserStoryNodes=Ge,exports.createUserStoryPlugin=Ke,exports.createVersionDiffNodes=vt,exports.createVersionDiffPlugin=yt,exports.createWakaSlashPlugins=Gt,exports.detectEmbedProvider=St,exports.getAllWakaSlashCommands=Ut,exports.getPresetLoaders=o.t,exports.loadAIPlugins=o.n,exports.loadAllWakaBlockPlugins=Kt,exports.loadComboboxPlugins=o.r,exports.loadCorePlugins=o.i,exports.loadDiffPlugin=o.a,exports.loadDndPlugin=o.o,exports.loadEmojiPlugin=o.s,exports.loadFloatingPlugin=o.c,exports.loadIndentPlugin=o.l,exports.loadLinkPlugin=o.u,exports.loadMarkdownPlugin=o.d,exports.loadMediaPlugins=o.f,exports.loadMentionPlugins=o.p,exports.loadSelectionPlugin=o.m,exports.loadTocPlugin=o.h,exports.resolveEmbedUrl=Ct;
46
+ C -->|No| E[Result B]`,caption:e?.caption,children:[{text:``}]}]}async function tt(e){try{let{createPlatePlugin:t}=await import(`platejs/react`);return t({key:q,node:{isElement:!0,isVoid:!0,type:q,component:t=>(0,l.jsx)(J,{...t,onRender:e})}})}catch{return console.warn(`[WakaDiagramBlock] platejs not installed`),null}}var Y=`ai_assist`;function nt({status:e}){let n={idle:{label:`Ready`,color:`bg-muted-foreground/30`,pulse:!1},loading:{label:`Thinking...`,color:`bg-amber-500`,pulse:!0},streaming:{label:`Writing...`,color:`bg-blue-500`,pulse:!0},complete:{label:`Complete`,color:`bg-emerald-500`,pulse:!1},error:{label:`Error`,color:`bg-destructive`,pulse:!1}}[e];return(0,l.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,l.jsx)(`div`,{className:t.t(`h-2 w-2 rounded-full`,n.color,n.pulse&&`animate-pulse`)}),(0,l.jsx)(`span`,{className:`text-[10px] font-medium text-muted-foreground`,children:n.label})]})}function rt({attributes:e,children:n,element:r,className:i,onGenerate:a,onAccept:o,onDiscard:s}){let c=r,u=c?.status||`idle`,d=c?.prompt||``,f=c?.response||``;return(0,l.jsxs)(`div`,{...e,contentEditable:!1,className:t.t(`my-4 rounded-lg overflow-hidden`,`border border-border`,`bg-gradient-to-br from-violet-50/30 via-card to-blue-50/30`,`dark:from-violet-950/10 dark:via-card dark:to-blue-950/10`,`shadow-sm`,i),children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2.5 border-b border-border/50`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,l.jsxs)(`div`,{className:`relative`,children:[(0,l.jsx)(`svg`,{className:`h-4 w-4 text-violet-600 dark:text-violet-400`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,l.jsx)(`path`,{d:`M12 2L13.09 8.26L18 6L14.74 10.91L21 12L14.74 13.09L18 18L13.09 15.74L12 22L10.91 15.74L6 18L9.26 13.09L3 12L9.26 10.91L6 6L10.91 8.26L12 2Z`})}),(u===`loading`||u===`streaming`)&&(0,l.jsx)(`div`,{className:`absolute inset-0 animate-ping`,children:(0,l.jsx)(`svg`,{className:`h-4 w-4 text-violet-400/50`,viewBox:`0 0 24 24`,fill:`currentColor`,children:(0,l.jsx)(`path`,{d:`M12 2L13.09 8.26L18 6L14.74 10.91L21 12L14.74 13.09L18 18L13.09 15.74L12 22L10.91 15.74L6 18L9.26 13.09L3 12L9.26 10.91L6 6L10.91 8.26L12 2Z`})})})]}),(0,l.jsx)(`span`,{className:`text-xs font-bold uppercase tracking-wider text-violet-700 dark:text-violet-300`,children:`AI Assistant`}),c?.model&&(0,l.jsx)(`span`,{className:`text-[10px] font-mono text-muted-foreground bg-muted px-1.5 py-0.5 rounded`,children:c.model})]}),(0,l.jsx)(nt,{status:u})]}),(0,l.jsx)(`div`,{className:`px-4 py-3 border-b border-border/30`,children:(0,l.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,l.jsx)(`div`,{className:`flex-shrink-0 mt-0.5 h-5 w-5 rounded-full bg-foreground/10 flex items-center justify-center`,children:(0,l.jsx)(`svg`,{className:`h-3 w-3 text-foreground/60`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z`})})}),(0,l.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,l.jsx)(`p`,{className:`text-sm text-foreground leading-relaxed`,children:d||(0,l.jsx)(`span`,{className:`text-muted-foreground italic`,children:`Ask the AI assistant a question...`})})})]})}),(f||u===`loading`||u===`streaming`)&&(0,l.jsx)(`div`,{className:`px-4 py-3`,children:(0,l.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,l.jsx)(`div`,{className:`flex-shrink-0 mt-0.5 h-5 w-5 rounded-full bg-violet-100 dark:bg-violet-500/20 flex items-center justify-center`,children:(0,l.jsx)(`svg`,{className:`h-3 w-3 text-violet-600 dark:text-violet-400`,viewBox:`0 0 24 24`,fill:`currentColor`,children:(0,l.jsx)(`path`,{d:`M12 2L13.09 8.26L18 6L14.74 10.91L21 12L14.74 13.09L18 18L13.09 15.74L12 22L10.91 15.74L6 18L9.26 13.09L3 12L9.26 10.91L6 6L10.91 8.26L12 2Z`})})}),(0,l.jsx)(`div`,{className:`flex-1 min-w-0`,children:u===`loading`&&!f?(0,l.jsxs)(`div`,{className:`space-y-2`,children:[(0,l.jsx)(`div`,{className:`h-3 w-3/4 bg-muted rounded animate-pulse`}),(0,l.jsx)(`div`,{className:`h-3 w-1/2 bg-muted rounded animate-pulse`}),(0,l.jsx)(`div`,{className:`h-3 w-5/6 bg-muted rounded animate-pulse`})]}):(0,l.jsxs)(`div`,{className:`text-sm text-foreground leading-relaxed whitespace-pre-wrap prose prose-sm dark:prose-invert max-w-none`,children:[f,u===`streaming`&&(0,l.jsx)(`span`,{className:`inline-block w-1.5 h-4 bg-violet-500 ml-0.5 animate-pulse rounded-sm`})]})})]})}),u===`error`&&c?.errorMessage&&(0,l.jsx)(`div`,{className:`mx-4 mb-3 px-3 py-2 rounded-md bg-destructive/10 border border-destructive/20`,children:(0,l.jsx)(`p`,{className:`text-xs text-destructive`,children:c.errorMessage})}),u===`complete`&&f&&(0,l.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2 border-t border-border/50 bg-muted/20`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] text-muted-foreground`,children:[c?.tokenCount&&(0,l.jsxs)(`span`,{children:[c.tokenCount,` tokens`]}),c?.generatedAt&&(0,l.jsx)(`span`,{children:new Date(c.generatedAt).toLocaleTimeString(`fr-FR`,{hour:`2-digit`,minute:`2-digit`})})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s&&(0,l.jsx)(`button`,{type:`button`,onClick:s,className:`px-3 py-1 rounded text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-muted transition-colors`,children:`Discard`}),o&&(0,l.jsx)(`button`,{type:`button`,onClick:()=>o(f),className:`px-3 py-1 rounded text-xs font-medium bg-primary text-primary-foreground hover:bg-primary/90 transition-colors shadow-sm`,children:`Insert into document`})]})]}),(0,l.jsx)(`div`,{className:`hidden`,children:n})]})}rt.displayName=`WakaAiAssistBlock`;function it(e){return[{type:Y,prompt:e?.prompt||``,response:``,status:`idle`,model:e?.model||`claude-sonnet-4-20250514`,children:[{text:``}]}]}async function at(e,t){try{let{createPlatePlugin:n}=await import(`platejs/react`);return n({key:Y,node:{isElement:!0,isVoid:!0,type:Y,component:n=>(0,l.jsx)(rt,{...n,onGenerate:e,onAccept:t})}})}catch{return console.warn(`[WakaAiAssistBlock] platejs not installed`),null}}var X=`version_diff`;function ot({attributes:e,children:n,element:r,className:i}){let a=r,[o,c]=s.useState(`unified`),[u,d]=s.useState(!0),f=a?.hunks||[],p=a?.stats||{additions:0,deletions:0,modifications:0},m=a?.oldVersionLabel||`Previous`,h=a?.newVersionLabel||`Current`;return(0,l.jsxs)(`div`,{...e,contentEditable:!1,className:t.t(`my-4 rounded-lg overflow-hidden border border-border shadow-sm`,i),children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2.5 bg-muted/30 border-b border-border`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,l.jsx)(`svg`,{className:`h-4 w-4 text-orange-600 dark:text-orange-400`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,"aria-hidden":`true`,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 3v6m0 0l-3 3m3-3l3 3M6 21h12a2 2 0 002-2V7l-5-5H6a2 2 0 00-2 2v15a2 2 0 002 2z`})}),(0,l.jsx)(`span`,{className:`text-xs font-bold uppercase tracking-wider text-foreground`,children:`Version Diff`}),(0,l.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px]`,children:[(0,l.jsx)(`span`,{className:`px-1.5 py-0.5 rounded bg-red-100 dark:bg-red-500/10 text-red-700 dark:text-red-400 font-mono font-medium`,children:m}),(0,l.jsx)(`svg`,{className:`h-3 w-3 text-muted-foreground`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M14 5l7 7m0 0l-7 7m7-7H3`})}),(0,l.jsx)(`span`,{className:`px-1.5 py-0.5 rounded bg-emerald-100 dark:bg-emerald-500/10 text-emerald-700 dark:text-emerald-400 font-mono font-medium`,children:h})]})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] font-mono`,children:[p.additions>0&&(0,l.jsxs)(`span`,{className:`text-emerald-600 dark:text-emerald-400 font-semibold`,children:[`+`,p.additions]}),p.deletions>0&&(0,l.jsxs)(`span`,{className:`text-red-600 dark:text-red-400 font-semibold`,children:[`-`,p.deletions]}),p.modifications>0&&(0,l.jsxs)(`span`,{className:`text-amber-600 dark:text-amber-400 font-semibold`,children:[`~`,p.modifications]})]}),(0,l.jsx)(`div`,{className:`flex items-center border border-border rounded overflow-hidden`,children:[`unified`,`split`,`summary`].map(e=>(0,l.jsx)(`button`,{type:`button`,onClick:()=>c(e),className:t.t(`px-2 py-1 text-[10px] font-medium transition-colors`,o===e?`bg-foreground/10 text-foreground`:`text-muted-foreground hover:text-foreground`),children:e.charAt(0).toUpperCase()+e.slice(1)},e))}),(0,l.jsx)(`button`,{type:`button`,onClick:()=>d(!u),className:`text-muted-foreground hover:text-foreground transition-colors`,children:(0,l.jsx)(`svg`,{className:t.t(`h-4 w-4 transition-transform`,!u&&`-rotate-90`),viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M19 9l-7 7-7-7`})})})]})]}),(a?.author||a?.timestamp)&&(0,l.jsxs)(`div`,{className:`px-4 py-1.5 border-b border-border/50 bg-muted/10 flex items-center gap-3 text-[10px] text-muted-foreground`,children:[a.author&&(0,l.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,l.jsx)(`svg`,{className:`h-3 w-3`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z`})}),(0,l.jsx)(`span`,{className:`font-medium`,children:a.author})]}),a.timestamp&&(0,l.jsx)(`span`,{children:new Date(a.timestamp).toLocaleString(`fr-FR`)})]}),u&&(0,l.jsx)(`div`,{className:`overflow-x-auto`,children:o===`summary`?(0,l.jsxs)(`div`,{className:`p-4 space-y-3`,children:[(0,l.jsxs)(`div`,{className:`grid grid-cols-3 gap-3`,children:[(0,l.jsxs)(`div`,{className:`rounded-lg bg-emerald-50 dark:bg-emerald-500/5 border border-emerald-200 dark:border-emerald-500/20 p-3 text-center`,children:[(0,l.jsx)(`div`,{className:`text-2xl font-bold text-emerald-600 dark:text-emerald-400`,children:p.additions}),(0,l.jsx)(`div`,{className:`text-[10px] font-medium text-emerald-700/70 dark:text-emerald-400/70 uppercase tracking-wider`,children:`Additions`})]}),(0,l.jsxs)(`div`,{className:`rounded-lg bg-red-50 dark:bg-red-500/5 border border-red-200 dark:border-red-500/20 p-3 text-center`,children:[(0,l.jsx)(`div`,{className:`text-2xl font-bold text-red-600 dark:text-red-400`,children:p.deletions}),(0,l.jsx)(`div`,{className:`text-[10px] font-medium text-red-700/70 dark:text-red-400/70 uppercase tracking-wider`,children:`Deletions`})]}),(0,l.jsxs)(`div`,{className:`rounded-lg bg-amber-50 dark:bg-amber-500/5 border border-amber-200 dark:border-amber-500/20 p-3 text-center`,children:[(0,l.jsx)(`div`,{className:`text-2xl font-bold text-amber-600 dark:text-amber-400`,children:p.modifications}),(0,l.jsx)(`div`,{className:`text-[10px] font-medium text-amber-700/70 dark:text-amber-400/70 uppercase tracking-wider`,children:`Modified`})]})]}),(0,l.jsxs)(`div`,{className:`h-2 rounded-full bg-muted overflow-hidden flex`,children:[p.additions>0&&(0,l.jsx)(`div`,{className:`bg-emerald-500 h-full`,style:{width:`${p.additions/(p.additions+p.deletions+p.modifications)*100}%`}}),p.modifications>0&&(0,l.jsx)(`div`,{className:`bg-amber-500 h-full`,style:{width:`${p.modifications/(p.additions+p.deletions+p.modifications)*100}%`}}),p.deletions>0&&(0,l.jsx)(`div`,{className:`bg-red-500 h-full`,style:{width:`${p.deletions/(p.additions+p.deletions+p.modifications)*100}%`}})]})]}):o===`split`?(0,l.jsxs)(`div`,{className:`grid grid-cols-2 divide-x divide-border`,children:[(0,l.jsxs)(`div`,{className:`p-0`,children:[(0,l.jsx)(`div`,{className:`px-3 py-1.5 border-b border-border/50 bg-red-50/50 dark:bg-red-950/10`,children:(0,l.jsx)(`span`,{className:`text-[10px] font-semibold text-red-700 dark:text-red-400 uppercase tracking-wider`,children:m})}),(0,l.jsx)(`div`,{className:`font-mono text-[12px] leading-relaxed`,children:f.map((e,n)=>(0,l.jsx)(s.Fragment,{children:e.lines.filter(e=>e.type!==`added`).map((e,r)=>(0,l.jsxs)(`div`,{className:t.t(`px-3 py-0.5 flex`,e.type===`removed`&&`bg-red-100/60 dark:bg-red-500/10`,e.type===`modified`&&`bg-amber-100/60 dark:bg-amber-500/10`),children:[(0,l.jsx)(`span`,{className:`w-8 text-right pr-2 text-muted-foreground/50 select-none shrink-0`,children:e.oldLineNumber}),(0,l.jsxs)(`span`,{className:t.t(e.type===`removed`&&`text-red-800 dark:text-red-300`,e.type===`modified`&&`text-amber-800 dark:text-amber-300`),children:[e.type===`removed`&&(0,l.jsx)(`span`,{className:`text-red-500 mr-1`,children:`-`}),e.content]})]},`${n}-${r}`))},n))})]}),(0,l.jsxs)(`div`,{className:`p-0`,children:[(0,l.jsx)(`div`,{className:`px-3 py-1.5 border-b border-border/50 bg-emerald-50/50 dark:bg-emerald-950/10`,children:(0,l.jsx)(`span`,{className:`text-[10px] font-semibold text-emerald-700 dark:text-emerald-400 uppercase tracking-wider`,children:h})}),(0,l.jsx)(`div`,{className:`font-mono text-[12px] leading-relaxed`,children:f.map((e,n)=>(0,l.jsx)(s.Fragment,{children:e.lines.filter(e=>e.type!==`removed`).map((e,r)=>(0,l.jsxs)(`div`,{className:t.t(`px-3 py-0.5 flex`,e.type===`added`&&`bg-emerald-100/60 dark:bg-emerald-500/10`,e.type===`modified`&&`bg-amber-100/60 dark:bg-amber-500/10`),children:[(0,l.jsx)(`span`,{className:`w-8 text-right pr-2 text-muted-foreground/50 select-none shrink-0`,children:e.newLineNumber}),(0,l.jsxs)(`span`,{className:t.t(e.type===`added`&&`text-emerald-800 dark:text-emerald-300`,e.type===`modified`&&`text-amber-800 dark:text-amber-300`),children:[e.type===`added`&&(0,l.jsx)(`span`,{className:`text-emerald-500 mr-1`,children:`+`}),e.content]})]},`${n}-${r}`))},n))})]})]}):(0,l.jsxs)(`div`,{className:`font-mono text-[12px] leading-relaxed`,children:[f.map((e,n)=>(0,l.jsxs)(s.Fragment,{children:[(0,l.jsxs)(`div`,{className:`px-3 py-1 bg-blue-50/50 dark:bg-blue-950/10 text-blue-600 dark:text-blue-400 text-[10px]`,children:[`@@ -`,e.oldStart,` +`,e.newStart,` @@`]}),e.lines.map((e,r)=>(0,l.jsxs)(`div`,{className:t.t(`px-3 py-0.5 flex`,e.type===`added`&&`bg-emerald-100/60 dark:bg-emerald-500/10`,e.type===`removed`&&`bg-red-100/60 dark:bg-red-500/10`,e.type===`modified`&&`bg-amber-100/60 dark:bg-amber-500/10`),children:[(0,l.jsx)(`span`,{className:`w-8 text-right pr-2 text-muted-foreground/50 select-none shrink-0`,children:e.oldLineNumber||``}),(0,l.jsx)(`span`,{className:`w-8 text-right pr-2 text-muted-foreground/50 select-none shrink-0`,children:e.newLineNumber||``}),(0,l.jsx)(`span`,{className:`w-4 shrink-0 text-center select-none`,children:e.type===`added`?(0,l.jsx)(`span`,{className:`text-emerald-500`,children:`+`}):e.type===`removed`?(0,l.jsx)(`span`,{className:`text-red-500`,children:`-`}):e.type===`modified`?(0,l.jsx)(`span`,{className:`text-amber-500`,children:`~`}):(0,l.jsx)(`span`,{className:`text-muted-foreground/30`,children:` `})}),(0,l.jsx)(`span`,{className:t.t(e.type===`added`&&`text-emerald-800 dark:text-emerald-300`,e.type===`removed`&&`text-red-800 dark:text-red-300 line-through`,e.type===`modified`&&`text-amber-800 dark:text-amber-300`),children:e.content})]},`${n}-${r}`))]},n)),f.length===0&&(0,l.jsx)(`div`,{className:`py-8 text-center text-sm text-muted-foreground italic`,children:`No differences found.`})]})}),(0,l.jsx)(`div`,{className:`hidden`,children:n})]})}ot.displayName=`WakaVersionDiffBlock`;function st(e){return[{type:X,oldVersionLabel:e?.oldVersionLabel||`v1.0`,newVersionLabel:e?.newVersionLabel||`v1.1`,oldText:e?.oldText||``,newText:e?.newText||``,hunks:e?.hunks||[{oldStart:1,newStart:1,lines:[{content:`The system SHALL authenticate users via OAuth2.`,type:`unchanged`,oldLineNumber:1,newLineNumber:1},{content:`Rate limiting: 50 req/min per user.`,type:`removed`,oldLineNumber:2},{content:`Rate limiting: 100 req/min per user.`,type:`added`,newLineNumber:2},{content:`All API responses use JSON format.`,type:`unchanged`,oldLineNumber:3,newLineNumber:3},{content:`Added: Support for WebSocket real-time events.`,type:`added`,newLineNumber:4}]}],stats:e?.stats||{additions:2,deletions:1,modifications:0},author:e?.author,timestamp:e?.timestamp,children:[{text:``}]}]}async function ct(){try{let{createPlatePlugin:e}=await import(`platejs/react`);return e({key:X,node:{isElement:!0,isVoid:!0,type:X,component:ot}})}catch{return console.warn(`[WakaVersionDiffBlock] platejs not installed`),null}}var Z=`embed`,lt={figma:{label:`Figma`,icon:`M12 2a4 4 0 00-4 4v4a4 4 0 004-4V2zm0 12a4 4 0 01-4 4v2h4v-6zm8-4a4 4 0 01-4 4H12v-8h4a4 4 0 014 4z`,color:`text-purple-600 dark:text-purple-400`,bgColor:`bg-purple-50 dark:bg-purple-500/10`,transform:e=>e.includes(`figma.com`)?`https://www.figma.com/embed?embed_host=wakastart&url=${encodeURIComponent(e)}`:null,defaultAspect:`16/9`,domain:`figma.com`},youtube:{label:`YouTube`,icon:`M19.615 3.184c-3.604-.246-11.631-.245-15.23 0C.488 3.45.029 5.804 0 12c.029 6.185.484 8.549 4.385 8.816 3.6.245 11.626.246 15.23 0C23.512 20.55 23.971 18.196 24 12c-.029-6.185-.484-8.549-4.385-8.816zM9 16V8l8 4-8 4z`,color:`text-red-600 dark:text-red-400`,bgColor:`bg-red-50 dark:bg-red-500/10`,transform:e=>{let t=e.match(/(?:youtube\.com\/(?:watch\?v=|embed\/)|youtu\.be\/)([a-zA-Z0-9_-]+)/);return t?`https://www.youtube.com/embed/${t[1]}`:null},defaultAspect:`16/9`,domain:`youtube.com`},vimeo:{label:`Vimeo`,icon:`M22.875 10.063c-.098 2.141-1.592 5.075-4.483 8.8-2.988 3.891-5.517 5.836-7.588 5.836-1.282 0-2.367-1.184-3.258-3.553L6.14 15.15c-.589-2.369-1.221-3.553-1.896-3.553-.147 0-.663.31-1.546.928l-.925-1.19c.973-.855 1.932-1.71 2.877-2.565 1.297-1.12 2.27-1.71 2.921-1.77 1.534-.147 2.479.903 2.834 3.148.384 2.422.65 3.928.801 4.519.445 2.022.934 3.033 1.468 3.033.414 0 1.037-.656 1.868-1.967.831-1.311 1.276-2.31 1.336-2.998.119-1.14-.328-1.71-1.342-1.71-.478 0-.97.109-1.477.327.981-3.212 2.855-4.773 5.625-4.684 2.054.059 3.024 1.394 2.908 4.003z`,color:`text-sky-600 dark:text-sky-400`,bgColor:`bg-sky-50 dark:bg-sky-500/10`,transform:e=>{let t=e.match(/vimeo\.com\/(\d+)/);return t?`https://player.vimeo.com/video/${t[1]}`:null},defaultAspect:`16/9`,domain:`vimeo.com`},codesandbox:{label:`CodeSandbox`,icon:`M2 6l10-4 10 4v12l-10 4L2 18V6zm10 2L4 4v8l8 4V8zm8-4l-8 4v8l8-4V4z`,color:`text-gray-700 dark:text-gray-300`,bgColor:`bg-gray-50 dark:bg-gray-500/10`,transform:e=>{let t=e.match(/codesandbox\.io\/(?:s|p)\/([a-zA-Z0-9-]+)/);return t?`https://codesandbox.io/embed/${t[1]}?fontsize=14&hidenavigation=1&theme=dark`:null},defaultAspect:`16/9`,domain:`codesandbox.io`},codepen:{label:`CodePen`,icon:`M12 2L2 8.5v7L12 22l10-6.5v-7L12 2zm0 3.311L18.26 9 12 12.689 5.74 9 12 5.311zM4 10.289l6 3.9v5.522l-6-3.9v-5.522zm8 9.422v-5.522l6-3.9v5.522l-6 3.9z`,color:`text-gray-700 dark:text-gray-300`,bgColor:`bg-gray-50 dark:bg-gray-500/10`,transform:e=>{let t=e.match(/codepen\.io\/([^/]+)\/pen\/([a-zA-Z0-9]+)/);return t?`https://codepen.io/${t[1]}/embed/${t[2]}?default-tab=result&theme-id=dark`:null},defaultAspect:`16/9`,domain:`codepen.io`},stackblitz:{label:`StackBlitz`,icon:`M13 10V3L4 14h7v7l9-11h-7z`,color:`text-blue-600 dark:text-blue-400`,bgColor:`bg-blue-50 dark:bg-blue-500/10`,transform:e=>e.includes(`stackblitz.com`)?e.replace(`stackblitz.com/edit`,`stackblitz.com/embed`):null,defaultAspect:`16/9`,domain:`stackblitz.com`},loom:{label:`Loom`,icon:`M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 14.5v-9l6 4.5-6 4.5z`,color:`text-purple-600 dark:text-purple-400`,bgColor:`bg-purple-50 dark:bg-purple-500/10`,transform:e=>{let t=e.match(/loom\.com\/share\/([a-zA-Z0-9]+)/);return t?`https://www.loom.com/embed/${t[1]}`:null},defaultAspect:`16/9`,domain:`loom.com`},miro:{label:`Miro`,icon:`M4 3h16a1 1 0 011 1v16a1 1 0 01-1 1H4a1 1 0 01-1-1V4a1 1 0 011-1z`,color:`text-yellow-600 dark:text-yellow-400`,bgColor:`bg-yellow-50 dark:bg-yellow-500/10`,transform:e=>{let t=e.match(/miro\.com\/app\/board\/([^/?]+)/);return t?`https://miro.com/app/live-embed/${t[1]}/`:null},defaultAspect:`16/9`,domain:`miro.com`},notion:{label:`Notion`,icon:`M4 4a2 2 0 012-2h12a2 2 0 012 2v16a2 2 0 01-2 2H6a2 2 0 01-2-2V4zm4 2v4h8V6H8zm0 6v2h8v-2H8zm0 4v2h5v-2H8z`,color:`text-gray-800 dark:text-gray-200`,bgColor:`bg-gray-50 dark:bg-gray-500/10`,transform:()=>null,defaultAspect:`16/9`,domain:`notion.so`},"github-gist":{label:`GitHub Gist`,icon:`M12 2C6.477 2 2 6.477 2 12c0 4.42 2.865 8.166 6.839 9.489.5.092.682-.217.682-.482 0-.237-.009-.866-.013-1.7-2.782.604-3.369-1.34-3.369-1.34-.454-1.156-1.11-1.462-1.11-1.462-.908-.62.069-.608.069-.608 1.003.07 1.531 1.03 1.531 1.03.892 1.529 2.341 1.087 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.11-4.555-4.943 0-1.091.39-1.984 1.029-2.683-.103-.253-.446-1.27.098-2.647 0 0 .84-.269 2.75 1.025A9.578 9.578 0 0112 6.836c.85.004 1.705.114 2.504.336 1.909-1.294 2.747-1.025 2.747-1.025.546 1.377.203 2.394.1 2.647.64.699 1.028 1.592 1.028 2.683 0 3.842-2.339 4.687-4.566 4.935.359.309.678.919.678 1.852 0 1.336-.012 2.415-.012 2.743 0 .267.18.578.688.48C19.138 20.161 22 16.416 22 12c0-5.523-4.477-10-10-10z`,color:`text-gray-800 dark:text-gray-200`,bgColor:`bg-gray-50 dark:bg-gray-500/10`,transform:()=>null,defaultAspect:`4/3`,domain:`gist.github.com`},generic:{label:`Embed`,icon:`M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14`,color:`text-muted-foreground`,bgColor:`bg-muted`,transform:()=>null,defaultAspect:`16/9`,domain:``}};function ut(e){let t=e.toLowerCase();return t.includes(`figma.com`)?`figma`:t.includes(`youtube.com`)||t.includes(`youtu.be`)?`youtube`:t.includes(`vimeo.com`)?`vimeo`:t.includes(`codesandbox.io`)?`codesandbox`:t.includes(`codepen.io`)?`codepen`:t.includes(`stackblitz.com`)?`stackblitz`:t.includes(`loom.com`)?`loom`:t.includes(`miro.com`)?`miro`:t.includes(`notion.so`)?`notion`:t.includes(`gist.github.com`)?`github-gist`:`generic`}function dt(e,t){return lt[t].transform(e)||e}function ft({attributes:e,children:r,element:i,className:a}){let o=i,c=lt[o?.provider||`generic`],u=o?.embedUrl||``,d=o?.aspectRatio||c.defaultAspect,f=s.useMemo(()=>u?n.o(u):``,[u]),[p,m]=s.useState(!1),[h,g]=s.useState(!1);return(0,l.jsxs)(`div`,{...e,contentEditable:!1,className:t.t(`my-4 rounded-lg overflow-hidden border border-border shadow-sm`,a),children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 bg-muted/30 border-b border-border`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,l.jsx)(`svg`,{className:t.t(`h-4 w-4`,c.color),viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,l.jsx)(`path`,{d:c.icon})}),(0,l.jsx)(`span`,{className:t.t(`text-[10px] font-bold uppercase tracking-wider`,c.color),children:c.label}),o?.title&&(0,l.jsx)(`span`,{className:`text-xs text-muted-foreground ml-1 truncate max-w-[300px]`,children:o.title})]}),o?.url&&(0,l.jsxs)(`a`,{href:n.o(o.url),target:`_blank`,rel:`noopener noreferrer`,className:`text-[10px] text-primary hover:underline flex items-center gap-1`,children:[`Open`,(0,l.jsx)(`svg`,{className:`h-3 w-3`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14`})})]})]}),(0,l.jsxs)(`div`,{className:`relative bg-muted/10`,style:{aspectRatio:d,maxHeight:o?.maxHeight?`${o.maxHeight}px`:void 0},children:[!p&&!h&&f&&(0,l.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-muted/20`,children:(0,l.jsxs)(`svg`,{className:`h-8 w-8 animate-spin text-muted-foreground/30`,viewBox:`0 0 24 24`,fill:`none`,children:[(0,l.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,l.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`})]})}),h&&(0,l.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center bg-muted/10 text-muted-foreground`,children:[(0,l.jsx)(`svg`,{className:`h-8 w-8 mb-2`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.5,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.34 16.5c-.77.833.192 2.5 1.732 2.5z`})}),(0,l.jsx)(`span`,{className:`text-xs`,children:`Failed to load embed`})]}),!f&&(0,l.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 text-muted-foreground`,children:[(0,l.jsx)(`svg`,{className:`h-10 w-10 mb-3 text-muted-foreground/30`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.5,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1`})}),(0,l.jsx)(`span`,{className:`text-sm`,children:`Paste a URL to embed content`}),(0,l.jsx)(`span`,{className:`text-[10px] mt-1 text-muted-foreground/60`,children:`Supports Figma, YouTube, CodeSandbox, Loom, and more`})]}),f&&(0,l.jsx)(`iframe`,{src:f,title:o?.title||`${c.label} embed`,className:t.t(`w-full h-full border-0`,!p&&`opacity-0`),loading:`lazy`,allowFullScreen:!0,sandbox:`allow-scripts allow-same-origin allow-popups allow-forms`,onLoad:()=>m(!0),onError:()=>g(!0)})]}),(0,l.jsx)(`div`,{className:`hidden`,children:r})]})}ft.displayName=`WakaEmbedBlock`;function pt(e,t){let n=ut(e);return[{type:Z,url:e,provider:n,embedUrl:dt(e,n),title:t?.title,aspectRatio:t?.aspectRatio,maxHeight:t?.maxHeight,children:[{text:``}]}]}async function mt(){try{let{createPlatePlugin:e}=await import(`platejs/react`);return e({key:Z,node:{isElement:!0,isVoid:!0,type:Z,component:ft}})}catch{return console.warn(`[WakaEmbedBlock] platejs not installed`),null}}var Q=`code_playground`,ht={javascript:{label:`JavaScript`,color:`text-yellow-500`,extension:`.js`},typescript:{label:`TypeScript`,color:`text-blue-500`,extension:`.ts`},python:{label:`Python`,color:`text-green-500`,extension:`.py`},html:{label:`HTML`,color:`text-orange-500`,extension:`.html`},css:{label:`CSS`,color:`text-pink-500`,extension:`.css`},json:{label:`JSON`,color:`text-gray-400`,extension:`.json`},sql:{label:`SQL`,color:`text-cyan-500`,extension:`.sql`},bash:{label:`Bash`,color:`text-emerald-500`,extension:`.sh`},go:{label:`Go`,color:`text-cyan-600`,extension:`.go`},rust:{label:`Rust`,color:`text-orange-600`,extension:`.rs`}};function gt(e){return e.split(`
47
+ `).map((e,t)=>(0,l.jsxs)(`div`,{className:`table-row`,children:[(0,l.jsx)(`span`,{className:`table-cell w-8 text-right pr-3 text-muted-foreground/40 select-none text-[11px]`,children:t+1}),(0,l.jsx)(`span`,{className:`table-cell`,children:e||` `})]},t))}function _t({attributes:e,children:n,element:r,className:i,onExecute:a}){let o=r,c=o?.code||``,u=o?.language||`javascript`,d=ht[u],f=o?.output||``,p=o?.errorOutput||``,m=o?.executionStatus||`idle`,h=o?.title||`main${d.extension}`,[g,_]=s.useState(!!f||!!p),[v,y]=s.useState(m),b=s.useCallback(async()=>{if(a){y(`running`),_(!0);try{await a(c,u),y(`success`)}catch{y(`error`)}}},[c,u,a]),x=v===m?m:v;return(0,l.jsxs)(`div`,{...e,contentEditable:!1,className:t.t(`my-4 rounded-lg overflow-hidden border border-gray-800 dark:border-gray-700 shadow-lg`,i),children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-1.5 bg-gray-900 dark:bg-gray-800 border-b border-gray-800 dark:border-gray-700`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-1.5`,"aria-hidden":`true`,children:[(0,l.jsx)(`div`,{className:`h-3 w-3 rounded-full bg-red-500/80`}),(0,l.jsx)(`div`,{className:`h-3 w-3 rounded-full bg-yellow-500/80`}),(0,l.jsx)(`div`,{className:`h-3 w-3 rounded-full bg-green-500/80`})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-0.5 rounded bg-gray-800 dark:bg-gray-700`,children:[(0,l.jsx)(`span`,{className:t.t(`text-[10px] font-bold`,d.color),children:d.label}),(0,l.jsx)(`span`,{className:`text-xs font-mono text-gray-300`,children:h})]})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[x!==`idle`&&(0,l.jsxs)(`div`,{className:`flex items-center gap-1`,children:[x===`running`&&(0,l.jsxs)(`svg`,{className:`h-3 w-3 animate-spin text-amber-400`,viewBox:`0 0 24 24`,fill:`none`,children:[(0,l.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,l.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`})]}),x===`success`&&(0,l.jsx)(`svg`,{className:`h-3 w-3 text-emerald-400`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M5 13l4 4L19 7`})}),x===`error`&&(0,l.jsx)(`svg`,{className:`h-3 w-3 text-red-400`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6 18L18 6M6 6l12 12`})})]}),a&&(0,l.jsxs)(`button`,{type:`button`,onClick:b,disabled:x===`running`||!c.trim(),className:t.t(`flex items-center gap-1 px-2.5 py-1 rounded text-[10px] font-semibold transition-all`,x===`running`?`bg-amber-500/20 text-amber-300 cursor-wait`:`bg-emerald-500/20 text-emerald-300 hover:bg-emerald-500/30`,!c.trim()&&`opacity-40 cursor-not-allowed`),"aria-label":`Run code`,children:[(0,l.jsx)(`svg`,{className:`h-3 w-3`,viewBox:`0 0 24 24`,fill:`currentColor`,children:(0,l.jsx)(`path`,{d:`M8 5v14l11-7z`})}),x===`running`?`Running...`:`Run`]}),(0,l.jsx)(`button`,{type:`button`,onClick:()=>_(!g),className:t.t(`px-2 py-1 rounded text-[10px] font-medium transition-colors`,g?`bg-gray-700 text-gray-200`:`text-gray-400 hover:text-gray-200`),children:`Console`})]})]}),(0,l.jsx)(`div`,{className:`bg-gray-950 dark:bg-[#0d1117] overflow-x-auto`,children:(0,l.jsx)(`pre`,{className:`p-4 text-[12px] font-mono leading-relaxed text-gray-100 min-h-[80px]`,children:(0,l.jsx)(`code`,{className:`table w-full`,children:gt(c)})})}),g&&(f||p||x===`running`)&&(0,l.jsxs)(`div`,{className:`border-t border-gray-800 dark:border-gray-700`,children:[(0,l.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-1 bg-gray-900 dark:bg-gray-800`,children:[(0,l.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-wider text-gray-400`,children:`Output`}),(f||p)&&(0,l.jsx)(`button`,{type:`button`,className:`text-[10px] text-gray-500 hover:text-gray-300 transition-colors`,"aria-label":`Clear output`,children:`Clear`})]}),(0,l.jsx)(`div`,{className:`bg-gray-950 dark:bg-[#0d1117] p-3 max-h-[200px] overflow-y-auto`,children:x===`running`?(0,l.jsxs)(`div`,{className:`flex items-center gap-2 text-amber-400 text-xs font-mono`,children:[(0,l.jsxs)(`svg`,{className:`h-3 w-3 animate-spin`,viewBox:`0 0 24 24`,fill:`none`,children:[(0,l.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,l.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z`})]}),`Executing...`]}):p?(0,l.jsx)(`pre`,{className:`text-[12px] font-mono text-red-400 whitespace-pre-wrap`,children:p}):f?(0,l.jsx)(`pre`,{className:`text-[12px] font-mono text-gray-200 whitespace-pre-wrap`,children:f}):null})]}),(0,l.jsx)(`div`,{className:`hidden`,children:n})]})}_t.displayName=`WakaCodePlaygroundBlock`;function vt(e){return[{type:Q,code:e?.code||`// Write your code here
48
+ console.log("Hello, WakaStart!");`,language:e?.language||`javascript`,title:e?.title,output:``,errorOutput:``,executionStatus:`idle`,showLineNumbers:!0,readOnly:!1,children:[{text:``}]}]}async function yt(e){try{let{createPlatePlugin:t}=await import(`platejs/react`);return t({key:Q,node:{isElement:!0,isVoid:!0,type:Q,component:t=>(0,l.jsx)(_t,{...t,onExecute:e})}})}catch{return console.warn(`[WakaCodePlaygroundBlock] platejs not installed`),null}}var $=`comment_thread`;function bt(e){let t=Date.now()-new Date(e).getTime(),n=Math.floor(t/1e3);if(n<60)return`just now`;let r=Math.floor(n/60);if(r<60)return`${r}m ago`;let i=Math.floor(r/60);if(i<24)return`${i}h ago`;let a=Math.floor(i/24);if(a<30)return`${a}d ago`;let o=Math.floor(a/30);return o<12?`${o}mo ago`:`${Math.floor(o/12)}y ago`}function xt({author:e,size:n=`sm`}){let r=n===`sm`?`h-6 w-6 text-[9px]`:`h-8 w-8 text-[10px]`;return e.avatar?(0,l.jsx)(`img`,{src:e.avatar,alt:e.name,className:t.t(`rounded-full object-cover flex-shrink-0`,r)}):(0,l.jsx)(`div`,{className:t.t(`rounded-full flex items-center justify-center text-white font-semibold flex-shrink-0`,r,[`bg-blue-500`,`bg-emerald-500`,`bg-violet-500`,`bg-amber-500`,`bg-rose-500`,`bg-cyan-500`][e.name.split(``).reduce((e,t)=>e+t.charCodeAt(0),0)%6]),children:e.name.charAt(0).toUpperCase()})}function St({comment:e,isCurrentUser:n,isFirst:r}){return(0,l.jsxs)(`div`,{className:t.t(`flex gap-2.5 px-3 py-2`,!r&&`border-t border-border/30`),children:[(0,l.jsx)(xt,{author:e.author}),(0,l.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,l.jsx)(`span`,{className:t.t(`text-xs font-semibold`,n?`text-primary`:`text-foreground`),children:e.author.name}),(0,l.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:bt(e.createdAt)}),e.edited&&(0,l.jsx)(`span`,{className:`text-[9px] text-muted-foreground/60 italic`,children:`(edited)`})]}),(0,l.jsx)(`p`,{className:`text-xs text-foreground/80 mt-0.5 leading-relaxed whitespace-pre-wrap`,children:e.content}),e.reactions&&e.reactions.length>0&&(0,l.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-1.5`,children:e.reactions.map((e,n)=>(0,l.jsxs)(`button`,{type:`button`,className:t.t(`inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded-full text-[10px] border transition-colors`,e.reacted?`bg-primary/10 border-primary/30 text-primary`:`bg-muted/50 border-border/50 text-muted-foreground hover:bg-muted`),children:[(0,l.jsx)(`span`,{children:e.emoji}),(0,l.jsx)(`span`,{className:`font-medium`,children:e.count})]},n))})]})]})}function Ct({attributes:e,children:n,element:r,className:i,currentUserId:a,onReply:o,onResolve:c,onReopen:u}){let d=r,f=d?.threadId||``,p=d?.quotedText||``,m=d?.status||`open`,h=d?.comments||[],g=d?.totalComments??h.length,[_,v]=s.useState(``),[y,b]=s.useState(m===`resolved`),x={open:{label:`Open`,color:`text-blue-600 dark:text-blue-400`,bg:`bg-blue-50 dark:bg-blue-500/10`},resolved:{label:`Resolved`,color:`text-emerald-600 dark:text-emerald-400`,bg:`bg-emerald-50 dark:bg-emerald-500/10`},archived:{label:`Archived`,color:`text-muted-foreground`,bg:`bg-muted`}},S=()=>{!_.trim()||!o||(o(f,_.trim()),v(``))};return(0,l.jsxs)(`div`,{...e,contentEditable:!1,className:t.t(`my-3 rounded-lg overflow-hidden border shadow-sm transition-all duration-200`,m===`resolved`?`border-emerald-200 dark:border-emerald-800/30`:`border-primary/20`,i),children:[(0,l.jsxs)(`div`,{className:t.t(`flex items-center justify-between px-3 py-2 cursor-pointer`,m===`resolved`?`bg-emerald-50/50 dark:bg-emerald-950/10`:`bg-primary/5`),onClick:()=>b(!y),role:`button`,tabIndex:0,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&b(!y)},"aria-expanded":!y,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,l.jsx)(`svg`,{className:t.t(`h-4 w-4`,m===`resolved`?`text-emerald-500`:`text-primary`),viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,"aria-hidden":`true`,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z`})}),(0,l.jsx)(`span`,{className:t.t(`text-[10px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded`,x[m].bg,x[m].color),children:x[m].label}),(0,l.jsxs)(`span`,{className:`text-[10px] text-muted-foreground`,children:[g,` comment`,g===1?``:`s`]})]}),(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[m===`open`&&c&&(0,l.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),c(f)},className:`text-[10px] font-medium text-emerald-600 hover:text-emerald-700 dark:text-emerald-400 transition-colors`,children:`Resolve`}),m===`resolved`&&u&&(0,l.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),u(f)},className:`text-[10px] font-medium text-primary hover:text-primary/80 transition-colors`,children:`Reopen`}),(0,l.jsx)(`svg`,{className:t.t(`h-3.5 w-3.5 text-muted-foreground transition-transform`,y&&`-rotate-90`),viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,children:(0,l.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M19 9l-7 7-7-7`})})]})]}),!y&&(0,l.jsxs)(l.Fragment,{children:[p&&(0,l.jsx)(`div`,{className:`mx-3 mt-3 mb-1 px-3 py-2 rounded bg-muted/50 border-l-2 border-primary/30`,children:(0,l.jsxs)(`p`,{className:`text-xs text-muted-foreground italic leading-relaxed line-clamp-3`,children:[`"`,p,`"`]})}),(0,l.jsx)(`div`,{className:`py-1`,children:h.map((e,t)=>(0,l.jsx)(St,{comment:e,isCurrentUser:e.author.id===a,isFirst:t===0},e.id))}),m===`open`&&o&&(0,l.jsx)(`div`,{className:`px-3 pb-3 pt-1 border-t border-border/30`,children:(0,l.jsxs)(`div`,{className:`flex gap-2`,children:[(0,l.jsx)(`input`,{type:`text`,value:_,onChange:e=>v(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),S())},placeholder:`Reply...`,className:t.t(`flex-1 px-3 py-1.5 rounded-md text-xs bg-muted/50 border border-border/50`,`focus:outline-none focus:ring-1 focus:ring-ring`,`placeholder:text-muted-foreground/50`)}),(0,l.jsx)(`button`,{type:`button`,onClick:S,disabled:!_.trim(),className:t.t(`px-3 py-1.5 rounded-md text-xs font-medium transition-colors`,`bg-primary text-primary-foreground hover:bg-primary/90`,`disabled:opacity-40 disabled:cursor-not-allowed`),children:`Reply`})]})})]}),(0,l.jsx)(`div`,{className:`hidden`,children:n})]})}Ct.displayName=`WakaCommentThreadBlock`;function wt(e){let t=new Date().toISOString();return[{type:$,threadId:e?.threadId||`thread-${Date.now()}`,quotedText:e?.quotedText||``,status:`open`,comments:e?.initialComment?[{id:`comment-${Date.now()}`,author:{id:e.initialComment.authorId,name:e.initialComment.authorName},content:e.initialComment.content,createdAt:t}]:[],children:[{text:``}]}]}async function Tt(e,t,n){try{let{createPlatePlugin:r}=await import(`platejs/react`);return r({key:$,node:{isElement:!0,isVoid:!0,type:$,component:r=>(0,l.jsx)(Ct,{...r,currentUserId:e,onReply:t,onResolve:n})}})}catch{return console.warn(`[WakaCommentThreadBlock] platejs not installed`),null}}var Et=[{key:`user-story`,label:`User Story`,description:`Structured user story (As a / I want / So that)`,icon:c.Users,group:`WakaStart Blocks`,keywords:[`user`,`story`,`agile`,`requirement`,`persona`],isCustom:!0,action:e=>{e.insertNodes(Ue())}},{key:`acceptance-criteria`,label:`Acceptance Criteria`,description:`Gherkin-format criteria (Given / When / Then)`,icon:c.CheckCircle2,group:`WakaStart Blocks`,keywords:[`acceptance`,`criteria`,`gherkin`,`given`,`when`,`then`,`test`],isCustom:!0,action:e=>{e.insertNodes(Ke())}},{key:`api-endpoint`,label:`API Endpoint`,description:`REST API documentation (method, route, body, response)`,icon:c.Zap,group:`WakaStart Blocks`,keywords:[`api`,`endpoint`,`rest`,`route`,`get`,`post`,`put`,`delete`],isCustom:!0,action:e=>{e.insertNodes(Ze())}},{key:`diagram`,label:`Diagram`,description:`Mermaid / PlantUML diagram with live preview`,icon:c.GitBranch,group:`WakaStart Blocks`,keywords:[`diagram`,`mermaid`,`plantuml`,`flowchart`,`sequence`,`graph`],isCustom:!0,action:e=>{e.insertNodes(et())}},{key:`ai-assist`,label:`AI Assistant`,description:`Ask the AI to generate content for your document`,icon:c.Sparkles,group:`WakaStart Blocks`,keywords:[`ai`,`ia`,`assistant`,`generate`,`write`,`help`,`claude`],isCustom:!0,action:e=>{e.insertNodes(it())}},{key:`version-diff`,label:`Version Diff`,description:`Compare two versions of text with visual diff`,icon:c.GitCompare,group:`WakaStart Blocks`,keywords:[`diff`,`version`,`compare`,`change`,`history`,`git`],isCustom:!0,action:e=>{e.insertNodes(st())}},{key:`embed`,label:`Embed`,description:`Embed external content (Figma, YouTube, CodeSandbox...)`,icon:c.ExternalLink,group:`WakaStart Blocks`,keywords:[`embed`,`figma`,`youtube`,`codesandbox`,`loom`,`iframe`,`video`],isCustom:!0,action:e=>{e.insertNodes(pt(``))}},{key:`code-playground`,label:`Code Playground`,description:`Executable code block with console output`,icon:c.Terminal,group:`WakaStart Blocks`,keywords:[`code`,`playground`,`run`,`execute`,`terminal`,`console`,`sandbox`],isCustom:!0,action:e=>{e.insertNodes(vt())}},{key:`comment-thread`,label:`Comment Thread`,description:`Inline discussion thread (like Google Docs)`,icon:c.MessageSquare,group:`WakaStart Blocks`,keywords:[`comment`,`thread`,`discussion`,`review`,`feedback`,`note`],isCustom:!0,action:e=>{e.insertNodes(wt())}}];function Dt(e){return[...T.map(e=>({...e,isCustom:!1})),...Et,...e||[]]}function Ot({commands:e,query:n=``,onSelect:r,activeIndex:i,onActiveIndexChange:a,className:o}){let c=s.useMemo(()=>e||Dt(),[e]),[u,d]=s.useState(0),f=i??u,p=a||d,m=s.useMemo(()=>{if(!n)return c;let e=n.toLowerCase();return c.filter(t=>t.label.toLowerCase().includes(e)||t.key.toLowerCase().includes(e)||t.description?.toLowerCase().includes(e)||t.keywords?.some(t=>t.toLowerCase().includes(e)))},[c,n]),h=s.useMemo(()=>{let e=new Map;for(let t of m){let n=t.group||`Other`;e.has(n)||e.set(n,[]),e.get(n).push(t)}return e},[m]);s.useEffect(()=>p(0),[n]);let g=s.useCallback(e=>{e.key===`ArrowDown`?(e.preventDefault(),p(Math.min(f+1,m.length-1))):e.key===`ArrowUp`?(e.preventDefault(),p(Math.max(f-1,0))):e.key===`Enter`&&m[f]&&(e.preventDefault(),r?.(m[f]))},[m,f,r,p]);return(0,l.jsxs)(`div`,{className:t.t(`w-80 max-h-96 overflow-y-auto`,`rounded-lg border bg-popover shadow-xl`,`p-1`,o),role:`listbox`,onKeyDown:g,"aria-label":`Slash commands`,children:[m.length===0&&(0,l.jsxs)(`div`,{className:`px-3 py-6 text-center text-sm text-muted-foreground`,children:[`No blocks found for "`,n,`"`]}),Array.from(h.entries()).map(([e,n])=>(0,l.jsxs)(`div`,{className:`mb-1`,children:[(0,l.jsxs)(`div`,{className:`px-2 py-1.5 text-[10px] font-bold uppercase tracking-wider text-muted-foreground/70 flex items-center gap-2`,children:[e,e===`WakaStart Blocks`&&(0,l.jsx)(`span`,{className:`px-1 py-0.5 rounded bg-primary/10 text-primary text-[8px] font-bold normal-case tracking-normal`,children:`Custom`})]}),n.map(e=>{let n=m.indexOf(e),i=e.icon;return(0,l.jsxs)(`button`,{role:`option`,"aria-selected":n===f,className:t.t(`flex w-full items-center gap-3 rounded-md px-2 py-2 text-left`,`text-sm transition-colors cursor-pointer`,n===f?`bg-accent text-accent-foreground`:`hover:bg-accent/50`),onMouseEnter:()=>p(n),onClick:()=>r?.(e),children:[(0,l.jsx)(`div`,{className:t.t(`flex h-8 w-8 shrink-0 items-center justify-center rounded-md border`,e.isCustom?`border-primary/20 bg-primary/5`:`border-border bg-background`),children:(0,l.jsx)(i,{className:`h-4 w-4`})}),(0,l.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,l.jsx)(`span`,{className:`font-medium text-sm`,children:e.label}),e.isCustom&&(0,l.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-primary flex-shrink-0`})]}),e.description&&(0,l.jsx)(`div`,{className:`text-[11px] text-muted-foreground truncate mt-0.5`,children:e.description})]})]},e.key)})]},e))]})}Ot.displayName=`WakaSlashMenuBlock`;async function kt(e){try{let{SlashPlugin:t,SlashInputPlugin:n}=await import(`@platejs/combobox/react`),r=Dt(e);return[t.configure({options:{trigger:`/`,triggerPreviousCharPattern:/^$|^[\s"']$/,rules:r.map(e=>({key:e.key,text:e.label,keywords:e.keywords,onSelect:e.action}))}}),n]}catch{return console.warn(`[WakaSlashMenuBlock] @platejs/combobox not installed, slash commands disabled`),[]}}async function At(e){let t=[],n=[createUserStoryPlugin(),createAcceptanceCriteriaPlugin(),createApiEndpointPlugin(),createDiagramPlugin(e?.diagramRenderer),createAiAssistPlugin(e?.aiGenerator),createVersionDiffPlugin(),createEmbedPlugin(),createCodePlaygroundPlugin(e?.codeExecutor),createCommentThreadPlugin(e?.currentUserId,e?.onCommentReply)],r=await Promise.allSettled(n);for(let e of r)e.status===`fulfilled`&&e.value&&t.push(e.value);return t}exports.ACCEPTANCE_CRITERIA_BLOCK_TYPE=V,exports.AI_ASSIST_BLOCK_TYPE=Y,exports.API_ENDPOINT_BLOCK_TYPE=W,exports.BlockquoteElement=Ae,exports.BoldLeaf=Fe,exports.CODE_PLAYGROUND_BLOCK_TYPE=Q,exports.COMMENT_THREAD_BLOCK_TYPE=$,exports.CalloutElement=Ce,exports.CodeLeaf=ze,exports.ColumnElement=xe,exports.ColumnGroupElement=be,exports.DEFAULT_AI_ACTIONS=O,exports.DEFAULT_FLOATING_BUTTONS=b,exports.DEFAULT_SLASH_COMMANDS=T,exports.DEFAULT_SPEC_TEMPLATES=ne,exports.DEFAULT_TOOLBAR_GROUPS=p,exports.DIAGRAM_BLOCK_TYPE=q,exports.EMBED_BLOCK_TYPE=Z,exports.H1Element=we,exports.H2Element=Te,exports.H3Element=Ee,exports.H4Element=De,exports.H5Element=Oe,exports.H6Element=ke,exports.HighlightLeaf=Be,exports.ItalicLeaf=Ie,exports.LinkElement=Me,exports.MentionElement=Ne,exports.MentionSuggestions=I,exports.ParagraphElement=je,exports.SeparatorElement=Pe,exports.StrikethroughLeaf=Re,exports.SubscriptLeaf=He,exports.SuperscriptLeaf=Ve,exports.TableCellElement=ve,exports.TableCellHeaderElement=ye,exports.TableElement=ge,exports.TableRowElement=_e,exports.USER_STORY_BLOCK_TYPE=L,exports.UnderlineLeaf=Le,exports.VERSION_DIFF_BLOCK_TYPE=X,exports.WAKA_BLOCK_COMMANDS=Et,exports.WakaAIWriter=k,exports.WakaAcceptanceCriteriaBlock=U,exports.WakaAiAssistBlock=rt,exports.WakaApiEndpointBlock=K,exports.WakaCodePlaygroundBlock=_t,exports.WakaCollaborativeEditor=se,exports.WakaCommentThreadBlock=Ct,exports.WakaDiagramBlock=J,exports.WakaDiffViewer=le,exports.WakaDnDEditor=ae,exports.WakaDocumentEditor=j,exports.WakaEditor=h,exports.WakaEditorToolbar=m,exports.WakaEmbedBlock=ft,exports.WakaFloatingToolbar=x,exports.WakaMarkdownEditor=N,exports.WakaMentionEditor=me,exports.WakaSlashMenu=E,exports.WakaSlashMenuBlock=Ot,exports.WakaSpecEditor=re,exports.WakaUserStoryBlock=B,exports.WakaVersionDiffBlock=ot,exports.createAcceptanceCriteriaNodes=Ke,exports.createAcceptanceCriteriaPlugin=qe,exports.createAiAssistNodes=it,exports.createAiAssistPlugin=at,exports.createApiEndpointNodes=Ze,exports.createApiEndpointPlugin=Qe,exports.createCodePlaygroundNodes=vt,exports.createCodePlaygroundPlugin=yt,exports.createCommentThreadNodes=wt,exports.createCommentThreadPlugin=Tt,exports.createDiagramNodes=et,exports.createDiagramPlugin=tt,exports.createEmbedNodes=pt,exports.createEmbedPlugin=mt,exports.createSlashCommandPlugins=D,exports.createUserStoryNodes=Ue,exports.createUserStoryPlugin=We,exports.createVersionDiffNodes=st,exports.createVersionDiffPlugin=ct,exports.createWakaSlashPlugins=kt,exports.detectEmbedProvider=ut,exports.getAllWakaSlashCommands=Dt,exports.getPresetLoaders=o.t,exports.loadAIPlugins=o.n,exports.loadAllWakaBlockPlugins=At,exports.loadComboboxPlugins=o.r,exports.loadCorePlugins=o.i,exports.loadDiffPlugin=o.a,exports.loadDndPlugin=o.o,exports.loadEmojiPlugin=o.s,exports.loadFloatingPlugin=o.c,exports.loadIndentPlugin=o.l,exports.loadLinkPlugin=o.u,exports.loadMarkdownPlugin=o.d,exports.loadMediaPlugins=o.f,exports.loadMentionPlugins=o.p,exports.loadSelectionPlugin=o.m,exports.loadTocPlugin=o.h,exports.resolveEmbedUrl=dt;