@adoptai/genui-components 0.1.32

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 (554) hide show
  1. package/README.md +56 -0
  2. package/dist/builders/BuilderForm.d.ts +25 -0
  3. package/dist/builders/BuilderForm.d.ts.map +1 -0
  4. package/dist/builders/BuilderRecap.d.ts +12 -0
  5. package/dist/builders/BuilderRecap.d.ts.map +1 -0
  6. package/dist/builders/ContextSlot.d.ts +6 -0
  7. package/dist/builders/ContextSlot.d.ts.map +1 -0
  8. package/dist/builders/EscalationCard.d.ts +12 -0
  9. package/dist/builders/EscalationCard.d.ts.map +1 -0
  10. package/dist/builders/FieldRenderer.d.ts +12 -0
  11. package/dist/builders/FieldRenderer.d.ts.map +1 -0
  12. package/dist/builders/FormBuilder.d.ts +13 -0
  13. package/dist/builders/FormBuilder.d.ts.map +1 -0
  14. package/dist/builders/StepperBuilder.d.ts +20 -0
  15. package/dist/builders/StepperBuilder.d.ts.map +1 -0
  16. package/dist/builders/fields.d.ts +27 -0
  17. package/dist/builders/fields.d.ts.map +1 -0
  18. package/dist/builders/hooks.d.ts +22 -0
  19. package/dist/builders/hooks.d.ts.map +1 -0
  20. package/dist/builders/index.d.ts +20 -0
  21. package/dist/builders/index.d.ts.map +1 -0
  22. package/dist/builders/resolver.d.ts +10 -0
  23. package/dist/builders/resolver.d.ts.map +1 -0
  24. package/dist/builders/schemas.d.ts +130 -0
  25. package/dist/builders/schemas.d.ts.map +1 -0
  26. package/dist/builders/validateBuilder.d.ts +10 -0
  27. package/dist/builders/validateBuilder.d.ts.map +1 -0
  28. package/dist/composites/aging-report/resolver.cjs +339 -0
  29. package/dist/composites/aging-report/resolver.cjs.map +1 -0
  30. package/dist/composites/aging-report/resolver.d.ts +3 -0
  31. package/dist/composites/aging-report/resolver.d.ts.map +1 -0
  32. package/dist/composites/aging-report/resolver.js +337 -0
  33. package/dist/composites/aging-report/resolver.js.map +1 -0
  34. package/dist/composites/alert/resolver.cjs +510 -0
  35. package/dist/composites/alert/resolver.cjs.map +1 -0
  36. package/dist/composites/alert/resolver.d.ts +3 -0
  37. package/dist/composites/alert/resolver.d.ts.map +1 -0
  38. package/dist/composites/alert/resolver.js +508 -0
  39. package/dist/composites/alert/resolver.js.map +1 -0
  40. package/dist/composites/allocation-donut/resolver.cjs +363 -0
  41. package/dist/composites/allocation-donut/resolver.cjs.map +1 -0
  42. package/dist/composites/allocation-donut/resolver.d.ts +3 -0
  43. package/dist/composites/allocation-donut/resolver.d.ts.map +1 -0
  44. package/dist/composites/allocation-donut/resolver.js +361 -0
  45. package/dist/composites/allocation-donut/resolver.js.map +1 -0
  46. package/dist/composites/amortization-table/resolver.cjs +692 -0
  47. package/dist/composites/amortization-table/resolver.cjs.map +1 -0
  48. package/dist/composites/amortization-table/resolver.d.ts +3 -0
  49. package/dist/composites/amortization-table/resolver.d.ts.map +1 -0
  50. package/dist/composites/amortization-table/resolver.js +690 -0
  51. package/dist/composites/amortization-table/resolver.js.map +1 -0
  52. package/dist/composites/area-chart/resolver.cjs +334 -0
  53. package/dist/composites/area-chart/resolver.cjs.map +1 -0
  54. package/dist/composites/area-chart/resolver.d.ts +3 -0
  55. package/dist/composites/area-chart/resolver.d.ts.map +1 -0
  56. package/dist/composites/area-chart/resolver.js +332 -0
  57. package/dist/composites/area-chart/resolver.js.map +1 -0
  58. package/dist/composites/audit-trail/resolver.cjs +564 -0
  59. package/dist/composites/audit-trail/resolver.cjs.map +1 -0
  60. package/dist/composites/audit-trail/resolver.d.ts +3 -0
  61. package/dist/composites/audit-trail/resolver.d.ts.map +1 -0
  62. package/dist/composites/audit-trail/resolver.js +562 -0
  63. package/dist/composites/audit-trail/resolver.js.map +1 -0
  64. package/dist/composites/balance-sheet/resolver.cjs +475 -0
  65. package/dist/composites/balance-sheet/resolver.cjs.map +1 -0
  66. package/dist/composites/balance-sheet/resolver.d.ts +3 -0
  67. package/dist/composites/balance-sheet/resolver.d.ts.map +1 -0
  68. package/dist/composites/balance-sheet/resolver.js +469 -0
  69. package/dist/composites/balance-sheet/resolver.js.map +1 -0
  70. package/dist/composites/bullet-chart/resolver.cjs +300 -0
  71. package/dist/composites/bullet-chart/resolver.cjs.map +1 -0
  72. package/dist/composites/bullet-chart/resolver.d.ts +3 -0
  73. package/dist/composites/bullet-chart/resolver.d.ts.map +1 -0
  74. package/dist/composites/bullet-chart/resolver.js +298 -0
  75. package/dist/composites/bullet-chart/resolver.js.map +1 -0
  76. package/dist/composites/cash-flow-statement/resolver.cjs +757 -0
  77. package/dist/composites/cash-flow-statement/resolver.cjs.map +1 -0
  78. package/dist/composites/cash-flow-statement/resolver.d.ts +3 -0
  79. package/dist/composites/cash-flow-statement/resolver.d.ts.map +1 -0
  80. package/dist/composites/cash-flow-statement/resolver.js +751 -0
  81. package/dist/composites/cash-flow-statement/resolver.js.map +1 -0
  82. package/dist/composites/chart-of-accounts/resolver.cjs +603 -0
  83. package/dist/composites/chart-of-accounts/resolver.cjs.map +1 -0
  84. package/dist/composites/chart-of-accounts/resolver.d.ts +3 -0
  85. package/dist/composites/chart-of-accounts/resolver.d.ts.map +1 -0
  86. package/dist/composites/chart-of-accounts/resolver.js +601 -0
  87. package/dist/composites/chart-of-accounts/resolver.js.map +1 -0
  88. package/dist/composites/cited-answer/resolver.cjs +829 -0
  89. package/dist/composites/cited-answer/resolver.cjs.map +1 -0
  90. package/dist/composites/cited-answer/resolver.d.ts +3 -0
  91. package/dist/composites/cited-answer/resolver.d.ts.map +1 -0
  92. package/dist/composites/cited-answer/resolver.js +827 -0
  93. package/dist/composites/cited-answer/resolver.js.map +1 -0
  94. package/dist/composites/combo-chart/resolver.cjs +402 -0
  95. package/dist/composites/combo-chart/resolver.cjs.map +1 -0
  96. package/dist/composites/combo-chart/resolver.d.ts +3 -0
  97. package/dist/composites/combo-chart/resolver.d.ts.map +1 -0
  98. package/dist/composites/combo-chart/resolver.js +400 -0
  99. package/dist/composites/combo-chart/resolver.js.map +1 -0
  100. package/dist/composites/comparative-bar-chart/resolver.cjs +366 -0
  101. package/dist/composites/comparative-bar-chart/resolver.cjs.map +1 -0
  102. package/dist/composites/comparative-bar-chart/resolver.d.ts +3 -0
  103. package/dist/composites/comparative-bar-chart/resolver.d.ts.map +1 -0
  104. package/dist/composites/comparative-bar-chart/resolver.js +364 -0
  105. package/dist/composites/comparative-bar-chart/resolver.js.map +1 -0
  106. package/dist/composites/compliance-checklist/resolver.cjs +618 -0
  107. package/dist/composites/compliance-checklist/resolver.cjs.map +1 -0
  108. package/dist/composites/compliance-checklist/resolver.d.ts +3 -0
  109. package/dist/composites/compliance-checklist/resolver.d.ts.map +1 -0
  110. package/dist/composites/compliance-checklist/resolver.js +616 -0
  111. package/dist/composites/compliance-checklist/resolver.js.map +1 -0
  112. package/dist/composites/connect-integration/resolver.d.ts +3 -0
  113. package/dist/composites/connect-integration/resolver.d.ts.map +1 -0
  114. package/dist/composites/data-table/resolver.cjs +324 -0
  115. package/dist/composites/data-table/resolver.cjs.map +1 -0
  116. package/dist/composites/data-table/resolver.d.ts +3 -0
  117. package/dist/composites/data-table/resolver.d.ts.map +1 -0
  118. package/dist/composites/data-table/resolver.js +322 -0
  119. package/dist/composites/data-table/resolver.js.map +1 -0
  120. package/dist/composites/depreciation-schedule/resolver.cjs +726 -0
  121. package/dist/composites/depreciation-schedule/resolver.cjs.map +1 -0
  122. package/dist/composites/depreciation-schedule/resolver.d.ts +3 -0
  123. package/dist/composites/depreciation-schedule/resolver.d.ts.map +1 -0
  124. package/dist/composites/depreciation-schedule/resolver.js +724 -0
  125. package/dist/composites/depreciation-schedule/resolver.js.map +1 -0
  126. package/dist/composites/document-preview/ExcelViewer.d.ts +8 -0
  127. package/dist/composites/document-preview/ExcelViewer.d.ts.map +1 -0
  128. package/dist/composites/document-preview/PdfViewer.d.ts +10 -0
  129. package/dist/composites/document-preview/PdfViewer.d.ts.map +1 -0
  130. package/dist/composites/document-preview/resolver.cjs +1036 -0
  131. package/dist/composites/document-preview/resolver.cjs.map +1 -0
  132. package/dist/composites/document-preview/resolver.d.ts +3 -0
  133. package/dist/composites/document-preview/resolver.d.ts.map +1 -0
  134. package/dist/composites/document-preview/resolver.js +1011 -0
  135. package/dist/composites/document-preview/resolver.js.map +1 -0
  136. package/dist/composites/document-preview/useFullscreen.d.ts +8 -0
  137. package/dist/composites/document-preview/useFullscreen.d.ts.map +1 -0
  138. package/dist/composites/download-card/resolver.cjs +1831 -0
  139. package/dist/composites/download-card/resolver.cjs.map +1 -0
  140. package/dist/composites/download-card/resolver.d.ts +3 -0
  141. package/dist/composites/download-card/resolver.d.ts.map +1 -0
  142. package/dist/composites/download-card/resolver.js +1804 -0
  143. package/dist/composites/download-card/resolver.js.map +1 -0
  144. package/dist/composites/engagement-pipeline/resolver.cjs +834 -0
  145. package/dist/composites/engagement-pipeline/resolver.cjs.map +1 -0
  146. package/dist/composites/engagement-pipeline/resolver.d.ts +3 -0
  147. package/dist/composites/engagement-pipeline/resolver.d.ts.map +1 -0
  148. package/dist/composites/engagement-pipeline/resolver.js +828 -0
  149. package/dist/composites/engagement-pipeline/resolver.js.map +1 -0
  150. package/dist/composites/entity-card-grid/resolver.cjs +444 -0
  151. package/dist/composites/entity-card-grid/resolver.cjs.map +1 -0
  152. package/dist/composites/entity-card-grid/resolver.d.ts +3 -0
  153. package/dist/composites/entity-card-grid/resolver.d.ts.map +1 -0
  154. package/dist/composites/entity-card-grid/resolver.js +442 -0
  155. package/dist/composites/entity-card-grid/resolver.js.map +1 -0
  156. package/dist/composites/escalation-card/resolver.cjs +359 -0
  157. package/dist/composites/escalation-card/resolver.cjs.map +1 -0
  158. package/dist/composites/escalation-card/resolver.d.ts +3 -0
  159. package/dist/composites/escalation-card/resolver.d.ts.map +1 -0
  160. package/dist/composites/escalation-card/resolver.js +357 -0
  161. package/dist/composites/escalation-card/resolver.js.map +1 -0
  162. package/dist/composites/file-browser/resolver.cjs +440 -0
  163. package/dist/composites/file-browser/resolver.cjs.map +1 -0
  164. package/dist/composites/file-browser/resolver.d.ts +3 -0
  165. package/dist/composites/file-browser/resolver.d.ts.map +1 -0
  166. package/dist/composites/file-browser/resolver.js +438 -0
  167. package/dist/composites/file-browser/resolver.js.map +1 -0
  168. package/dist/composites/flow-canvas/DiagramStreamParser.d.ts +15 -0
  169. package/dist/composites/flow-canvas/DiagramStreamParser.d.ts.map +1 -0
  170. package/dist/composites/flow-canvas/ElementStreamParser.d.ts +19 -0
  171. package/dist/composites/flow-canvas/ElementStreamParser.d.ts.map +1 -0
  172. package/dist/composites/flow-canvas/ExcalidrawCanvas.d.ts +8 -0
  173. package/dist/composites/flow-canvas/ExcalidrawCanvas.d.ts.map +1 -0
  174. package/dist/composites/flow-canvas/FlowGraph.d.ts +11 -0
  175. package/dist/composites/flow-canvas/FlowGraph.d.ts.map +1 -0
  176. package/dist/composites/flow-canvas/layoutFlow.d.ts +18 -0
  177. package/dist/composites/flow-canvas/layoutFlow.d.ts.map +1 -0
  178. package/dist/composites/flow-canvas/parseMermaidFlow.d.ts +24 -0
  179. package/dist/composites/flow-canvas/parseMermaidFlow.d.ts.map +1 -0
  180. package/dist/composites/flow-canvas/resolver.cjs +1295 -0
  181. package/dist/composites/flow-canvas/resolver.cjs.map +1 -0
  182. package/dist/composites/flow-canvas/resolver.d.ts +12 -0
  183. package/dist/composites/flow-canvas/resolver.d.ts.map +1 -0
  184. package/dist/composites/flow-canvas/resolver.js +1287 -0
  185. package/dist/composites/flow-canvas/resolver.js.map +1 -0
  186. package/dist/composites/funnel-chart/resolver.cjs +315 -0
  187. package/dist/composites/funnel-chart/resolver.cjs.map +1 -0
  188. package/dist/composites/funnel-chart/resolver.d.ts +3 -0
  189. package/dist/composites/funnel-chart/resolver.d.ts.map +1 -0
  190. package/dist/composites/funnel-chart/resolver.js +313 -0
  191. package/dist/composites/funnel-chart/resolver.js.map +1 -0
  192. package/dist/composites/gauge-chart/resolver.cjs +294 -0
  193. package/dist/composites/gauge-chart/resolver.cjs.map +1 -0
  194. package/dist/composites/gauge-chart/resolver.d.ts +3 -0
  195. package/dist/composites/gauge-chart/resolver.d.ts.map +1 -0
  196. package/dist/composites/gauge-chart/resolver.js +292 -0
  197. package/dist/composites/gauge-chart/resolver.js.map +1 -0
  198. package/dist/composites/general-ledger/resolver.cjs +543 -0
  199. package/dist/composites/general-ledger/resolver.cjs.map +1 -0
  200. package/dist/composites/general-ledger/resolver.d.ts +3 -0
  201. package/dist/composites/general-ledger/resolver.d.ts.map +1 -0
  202. package/dist/composites/general-ledger/resolver.js +541 -0
  203. package/dist/composites/general-ledger/resolver.js.map +1 -0
  204. package/dist/composites/grouped-table/resolver.cjs +388 -0
  205. package/dist/composites/grouped-table/resolver.cjs.map +1 -0
  206. package/dist/composites/grouped-table/resolver.d.ts +3 -0
  207. package/dist/composites/grouped-table/resolver.d.ts.map +1 -0
  208. package/dist/composites/grouped-table/resolver.js +386 -0
  209. package/dist/composites/grouped-table/resolver.js.map +1 -0
  210. package/dist/composites/heatmap-table/resolver.cjs +380 -0
  211. package/dist/composites/heatmap-table/resolver.cjs.map +1 -0
  212. package/dist/composites/heatmap-table/resolver.d.ts +3 -0
  213. package/dist/composites/heatmap-table/resolver.d.ts.map +1 -0
  214. package/dist/composites/heatmap-table/resolver.js +378 -0
  215. package/dist/composites/heatmap-table/resolver.js.map +1 -0
  216. package/dist/composites/income-statement/resolver.cjs +583 -0
  217. package/dist/composites/income-statement/resolver.cjs.map +1 -0
  218. package/dist/composites/income-statement/resolver.d.ts +3 -0
  219. package/dist/composites/income-statement/resolver.d.ts.map +1 -0
  220. package/dist/composites/income-statement/resolver.js +577 -0
  221. package/dist/composites/income-statement/resolver.js.map +1 -0
  222. package/dist/composites/integrations-list/resolver.d.ts +3 -0
  223. package/dist/composites/integrations-list/resolver.d.ts.map +1 -0
  224. package/dist/composites/invoice-detail/resolver.cjs +1086 -0
  225. package/dist/composites/invoice-detail/resolver.cjs.map +1 -0
  226. package/dist/composites/invoice-detail/resolver.d.ts +3 -0
  227. package/dist/composites/invoice-detail/resolver.d.ts.map +1 -0
  228. package/dist/composites/invoice-detail/resolver.js +1084 -0
  229. package/dist/composites/invoice-detail/resolver.js.map +1 -0
  230. package/dist/composites/job-tracker/resolver.cjs +830 -0
  231. package/dist/composites/job-tracker/resolver.cjs.map +1 -0
  232. package/dist/composites/job-tracker/resolver.d.ts +3 -0
  233. package/dist/composites/job-tracker/resolver.d.ts.map +1 -0
  234. package/dist/composites/job-tracker/resolver.js +828 -0
  235. package/dist/composites/job-tracker/resolver.js.map +1 -0
  236. package/dist/composites/journal-entry/resolver.cjs +324 -0
  237. package/dist/composites/journal-entry/resolver.cjs.map +1 -0
  238. package/dist/composites/journal-entry/resolver.d.ts +3 -0
  239. package/dist/composites/journal-entry/resolver.d.ts.map +1 -0
  240. package/dist/composites/journal-entry/resolver.js +322 -0
  241. package/dist/composites/journal-entry/resolver.js.map +1 -0
  242. package/dist/composites/key-value-list/resolver.cjs +708 -0
  243. package/dist/composites/key-value-list/resolver.cjs.map +1 -0
  244. package/dist/composites/key-value-list/resolver.d.ts +3 -0
  245. package/dist/composites/key-value-list/resolver.d.ts.map +1 -0
  246. package/dist/composites/key-value-list/resolver.js +702 -0
  247. package/dist/composites/key-value-list/resolver.js.map +1 -0
  248. package/dist/composites/legal-test-result/resolver.cjs +666 -0
  249. package/dist/composites/legal-test-result/resolver.cjs.map +1 -0
  250. package/dist/composites/legal-test-result/resolver.d.ts +3 -0
  251. package/dist/composites/legal-test-result/resolver.d.ts.map +1 -0
  252. package/dist/composites/legal-test-result/resolver.js +664 -0
  253. package/dist/composites/legal-test-result/resolver.js.map +1 -0
  254. package/dist/composites/line-chart/resolver.cjs +344 -0
  255. package/dist/composites/line-chart/resolver.cjs.map +1 -0
  256. package/dist/composites/line-chart/resolver.d.ts +3 -0
  257. package/dist/composites/line-chart/resolver.d.ts.map +1 -0
  258. package/dist/composites/line-chart/resolver.js +342 -0
  259. package/dist/composites/line-chart/resolver.js.map +1 -0
  260. package/dist/composites/news-feed/resolver.cjs +539 -0
  261. package/dist/composites/news-feed/resolver.cjs.map +1 -0
  262. package/dist/composites/news-feed/resolver.d.ts +3 -0
  263. package/dist/composites/news-feed/resolver.d.ts.map +1 -0
  264. package/dist/composites/news-feed/resolver.js +537 -0
  265. package/dist/composites/news-feed/resolver.js.map +1 -0
  266. package/dist/composites/ops-dashboard/resolver.cjs +430 -0
  267. package/dist/composites/ops-dashboard/resolver.cjs.map +1 -0
  268. package/dist/composites/ops-dashboard/resolver.d.ts +3 -0
  269. package/dist/composites/ops-dashboard/resolver.d.ts.map +1 -0
  270. package/dist/composites/ops-dashboard/resolver.js +428 -0
  271. package/dist/composites/ops-dashboard/resolver.js.map +1 -0
  272. package/dist/composites/pipeline-preview/layout.d.ts +39 -0
  273. package/dist/composites/pipeline-preview/layout.d.ts.map +1 -0
  274. package/dist/composites/pipeline-preview/opMeta.d.ts +9 -0
  275. package/dist/composites/pipeline-preview/opMeta.d.ts.map +1 -0
  276. package/dist/composites/pipeline-preview/resolver.d.ts +3 -0
  277. package/dist/composites/pipeline-preview/resolver.d.ts.map +1 -0
  278. package/dist/composites/provenance-chain/resolver.cjs +797 -0
  279. package/dist/composites/provenance-chain/resolver.cjs.map +1 -0
  280. package/dist/composites/provenance-chain/resolver.d.ts +3 -0
  281. package/dist/composites/provenance-chain/resolver.d.ts.map +1 -0
  282. package/dist/composites/provenance-chain/resolver.js +795 -0
  283. package/dist/composites/provenance-chain/resolver.js.map +1 -0
  284. package/dist/composites/radar-chart/resolver.cjs +323 -0
  285. package/dist/composites/radar-chart/resolver.cjs.map +1 -0
  286. package/dist/composites/radar-chart/resolver.d.ts +3 -0
  287. package/dist/composites/radar-chart/resolver.d.ts.map +1 -0
  288. package/dist/composites/radar-chart/resolver.js +321 -0
  289. package/dist/composites/radar-chart/resolver.js.map +1 -0
  290. package/dist/composites/reconciliation-view/resolver.cjs +917 -0
  291. package/dist/composites/reconciliation-view/resolver.cjs.map +1 -0
  292. package/dist/composites/reconciliation-view/resolver.d.ts +3 -0
  293. package/dist/composites/reconciliation-view/resolver.d.ts.map +1 -0
  294. package/dist/composites/reconciliation-view/resolver.js +915 -0
  295. package/dist/composites/reconciliation-view/resolver.js.map +1 -0
  296. package/dist/composites/scatter-chart/resolver.cjs +357 -0
  297. package/dist/composites/scatter-chart/resolver.cjs.map +1 -0
  298. package/dist/composites/scatter-chart/resolver.d.ts +3 -0
  299. package/dist/composites/scatter-chart/resolver.d.ts.map +1 -0
  300. package/dist/composites/scatter-chart/resolver.js +355 -0
  301. package/dist/composites/scatter-chart/resolver.js.map +1 -0
  302. package/dist/composites/screener-table/resolver.cjs +372 -0
  303. package/dist/composites/screener-table/resolver.cjs.map +1 -0
  304. package/dist/composites/screener-table/resolver.d.ts +3 -0
  305. package/dist/composites/screener-table/resolver.d.ts.map +1 -0
  306. package/dist/composites/screener-table/resolver.js +370 -0
  307. package/dist/composites/screener-table/resolver.js.map +1 -0
  308. package/dist/composites/search-results/resolver.cjs +391 -0
  309. package/dist/composites/search-results/resolver.cjs.map +1 -0
  310. package/dist/composites/search-results/resolver.d.ts +3 -0
  311. package/dist/composites/search-results/resolver.d.ts.map +1 -0
  312. package/dist/composites/search-results/resolver.js +389 -0
  313. package/dist/composites/search-results/resolver.js.map +1 -0
  314. package/dist/composites/sparkline-table/resolver.cjs +361 -0
  315. package/dist/composites/sparkline-table/resolver.cjs.map +1 -0
  316. package/dist/composites/sparkline-table/resolver.d.ts +3 -0
  317. package/dist/composites/sparkline-table/resolver.d.ts.map +1 -0
  318. package/dist/composites/sparkline-table/resolver.js +359 -0
  319. package/dist/composites/sparkline-table/resolver.js.map +1 -0
  320. package/dist/composites/stacked-breakdown/resolver.cjs +397 -0
  321. package/dist/composites/stacked-breakdown/resolver.cjs.map +1 -0
  322. package/dist/composites/stacked-breakdown/resolver.d.ts +3 -0
  323. package/dist/composites/stacked-breakdown/resolver.d.ts.map +1 -0
  324. package/dist/composites/stacked-breakdown/resolver.js +395 -0
  325. package/dist/composites/stacked-breakdown/resolver.js.map +1 -0
  326. package/dist/composites/stat-grid/resolver.cjs +498 -0
  327. package/dist/composites/stat-grid/resolver.cjs.map +1 -0
  328. package/dist/composites/stat-grid/resolver.d.ts +3 -0
  329. package/dist/composites/stat-grid/resolver.d.ts.map +1 -0
  330. package/dist/composites/stat-grid/resolver.js +496 -0
  331. package/dist/composites/stat-grid/resolver.js.map +1 -0
  332. package/dist/composites/status-card/resolver.cjs +593 -0
  333. package/dist/composites/status-card/resolver.cjs.map +1 -0
  334. package/dist/composites/status-card/resolver.d.ts +3 -0
  335. package/dist/composites/status-card/resolver.d.ts.map +1 -0
  336. package/dist/composites/status-card/resolver.js +591 -0
  337. package/dist/composites/status-card/resolver.js.map +1 -0
  338. package/dist/composites/tabs-panel/resolver.cjs +564 -0
  339. package/dist/composites/tabs-panel/resolver.cjs.map +1 -0
  340. package/dist/composites/tabs-panel/resolver.d.ts +3 -0
  341. package/dist/composites/tabs-panel/resolver.d.ts.map +1 -0
  342. package/dist/composites/tabs-panel/resolver.js +562 -0
  343. package/dist/composites/tabs-panel/resolver.js.map +1 -0
  344. package/dist/composites/transaction-feed/resolver.cjs +830 -0
  345. package/dist/composites/transaction-feed/resolver.cjs.map +1 -0
  346. package/dist/composites/transaction-feed/resolver.d.ts +3 -0
  347. package/dist/composites/transaction-feed/resolver.d.ts.map +1 -0
  348. package/dist/composites/transaction-feed/resolver.js +828 -0
  349. package/dist/composites/transaction-feed/resolver.js.map +1 -0
  350. package/dist/composites/treemap-chart/resolver.cjs +323 -0
  351. package/dist/composites/treemap-chart/resolver.cjs.map +1 -0
  352. package/dist/composites/treemap-chart/resolver.d.ts +3 -0
  353. package/dist/composites/treemap-chart/resolver.d.ts.map +1 -0
  354. package/dist/composites/treemap-chart/resolver.js +321 -0
  355. package/dist/composites/treemap-chart/resolver.js.map +1 -0
  356. package/dist/composites/trial-balance/resolver.cjs +359 -0
  357. package/dist/composites/trial-balance/resolver.cjs.map +1 -0
  358. package/dist/composites/trial-balance/resolver.d.ts +3 -0
  359. package/dist/composites/trial-balance/resolver.d.ts.map +1 -0
  360. package/dist/composites/trial-balance/resolver.js +353 -0
  361. package/dist/composites/trial-balance/resolver.js.map +1 -0
  362. package/dist/composites/variance-analysis/resolver.cjs +310 -0
  363. package/dist/composites/variance-analysis/resolver.cjs.map +1 -0
  364. package/dist/composites/variance-analysis/resolver.d.ts +3 -0
  365. package/dist/composites/variance-analysis/resolver.d.ts.map +1 -0
  366. package/dist/composites/variance-analysis/resolver.js +308 -0
  367. package/dist/composites/variance-analysis/resolver.js.map +1 -0
  368. package/dist/composites/waterfall-chart/resolver.cjs +347 -0
  369. package/dist/composites/waterfall-chart/resolver.cjs.map +1 -0
  370. package/dist/composites/waterfall-chart/resolver.d.ts +3 -0
  371. package/dist/composites/waterfall-chart/resolver.d.ts.map +1 -0
  372. package/dist/composites/waterfall-chart/resolver.js +345 -0
  373. package/dist/composites/waterfall-chart/resolver.js.map +1 -0
  374. package/dist/index.cjs +18271 -0
  375. package/dist/index.cjs.map +1 -0
  376. package/dist/index.d.ts +52 -0
  377. package/dist/index.d.ts.map +1 -0
  378. package/dist/index.js +18184 -0
  379. package/dist/index.js.map +1 -0
  380. package/dist/renderer.cjs +17092 -0
  381. package/dist/renderer.cjs.map +1 -0
  382. package/dist/renderer.d.ts +7 -0
  383. package/dist/renderer.d.ts.map +1 -0
  384. package/dist/renderer.js +17064 -0
  385. package/dist/renderer.js.map +1 -0
  386. package/dist/resolver.cjs +17061 -0
  387. package/dist/resolver.cjs.map +1 -0
  388. package/dist/resolver.d.ts +6 -0
  389. package/dist/resolver.d.ts.map +1 -0
  390. package/dist/resolver.js +17033 -0
  391. package/dist/resolver.js.map +1 -0
  392. package/dist/schemas/aging-report.d.ts +74 -0
  393. package/dist/schemas/aging-report.d.ts.map +1 -0
  394. package/dist/schemas/alert.d.ts +39 -0
  395. package/dist/schemas/alert.d.ts.map +1 -0
  396. package/dist/schemas/allocation-donut.d.ts +53 -0
  397. package/dist/schemas/allocation-donut.d.ts.map +1 -0
  398. package/dist/schemas/amortization-table.d.ts +102 -0
  399. package/dist/schemas/amortization-table.d.ts.map +1 -0
  400. package/dist/schemas/area-chart.d.ts +61 -0
  401. package/dist/schemas/area-chart.d.ts.map +1 -0
  402. package/dist/schemas/audit-trail.d.ts +88 -0
  403. package/dist/schemas/audit-trail.d.ts.map +1 -0
  404. package/dist/schemas/balance-sheet.d.ts +170 -0
  405. package/dist/schemas/balance-sheet.d.ts.map +1 -0
  406. package/dist/schemas/buildRenderUITool.d.ts +7 -0
  407. package/dist/schemas/buildRenderUITool.d.ts.map +1 -0
  408. package/dist/schemas/bullet-chart.d.ts +58 -0
  409. package/dist/schemas/bullet-chart.d.ts.map +1 -0
  410. package/dist/schemas/cash-flow-statement.d.ts +165 -0
  411. package/dist/schemas/cash-flow-statement.d.ts.map +1 -0
  412. package/dist/schemas/chart-of-accounts.d.ts +93 -0
  413. package/dist/schemas/chart-of-accounts.d.ts.map +1 -0
  414. package/dist/schemas/cited-answer.d.ts +76 -0
  415. package/dist/schemas/cited-answer.d.ts.map +1 -0
  416. package/dist/schemas/coercePayload.d.ts +16 -0
  417. package/dist/schemas/coercePayload.d.ts.map +1 -0
  418. package/dist/schemas/combo-chart.d.ts +111 -0
  419. package/dist/schemas/combo-chart.d.ts.map +1 -0
  420. package/dist/schemas/comparative-bar-chart.d.ts +83 -0
  421. package/dist/schemas/comparative-bar-chart.d.ts.map +1 -0
  422. package/dist/schemas/compliance-checklist.d.ts +91 -0
  423. package/dist/schemas/compliance-checklist.d.ts.map +1 -0
  424. package/dist/schemas/connect-integration.d.ts +47 -0
  425. package/dist/schemas/connect-integration.d.ts.map +1 -0
  426. package/dist/schemas/data-table.d.ts +63 -0
  427. package/dist/schemas/data-table.d.ts.map +1 -0
  428. package/dist/schemas/depreciation-schedule.d.ts +125 -0
  429. package/dist/schemas/depreciation-schedule.d.ts.map +1 -0
  430. package/dist/schemas/document-preview.d.ts +128 -0
  431. package/dist/schemas/document-preview.d.ts.map +1 -0
  432. package/dist/schemas/download-card.d.ts +62 -0
  433. package/dist/schemas/download-card.d.ts.map +1 -0
  434. package/dist/schemas/engagement-pipeline.d.ts +119 -0
  435. package/dist/schemas/engagement-pipeline.d.ts.map +1 -0
  436. package/dist/schemas/entity-card-grid.d.ts +101 -0
  437. package/dist/schemas/entity-card-grid.d.ts.map +1 -0
  438. package/dist/schemas/escalation-card.d.ts +44 -0
  439. package/dist/schemas/escalation-card.d.ts.map +1 -0
  440. package/dist/schemas/file-browser.d.ts +81 -0
  441. package/dist/schemas/file-browser.d.ts.map +1 -0
  442. package/dist/schemas/flow-canvas.d.ts +58 -0
  443. package/dist/schemas/flow-canvas.d.ts.map +1 -0
  444. package/dist/schemas/funnel-chart.d.ts +53 -0
  445. package/dist/schemas/funnel-chart.d.ts.map +1 -0
  446. package/dist/schemas/gauge-chart.d.ts +58 -0
  447. package/dist/schemas/gauge-chart.d.ts.map +1 -0
  448. package/dist/schemas/general-ledger.d.ts +120 -0
  449. package/dist/schemas/general-ledger.d.ts.map +1 -0
  450. package/dist/schemas/grouped-table.d.ts +101 -0
  451. package/dist/schemas/grouped-table.d.ts.map +1 -0
  452. package/dist/schemas/heatmap-table.d.ts +76 -0
  453. package/dist/schemas/heatmap-table.d.ts.map +1 -0
  454. package/dist/schemas/income-statement.d.ts +170 -0
  455. package/dist/schemas/income-statement.d.ts.map +1 -0
  456. package/dist/schemas/index.cjs +3509 -0
  457. package/dist/schemas/index.cjs.map +1 -0
  458. package/dist/schemas/index.d.ts +5030 -0
  459. package/dist/schemas/index.d.ts.map +1 -0
  460. package/dist/schemas/index.js +3505 -0
  461. package/dist/schemas/index.js.map +1 -0
  462. package/dist/schemas/integrations-list.d.ts +62 -0
  463. package/dist/schemas/integrations-list.d.ts.map +1 -0
  464. package/dist/schemas/invoice-detail.d.ts +157 -0
  465. package/dist/schemas/invoice-detail.d.ts.map +1 -0
  466. package/dist/schemas/job-tracker.d.ts +114 -0
  467. package/dist/schemas/job-tracker.d.ts.map +1 -0
  468. package/dist/schemas/journal-entry.d.ts +90 -0
  469. package/dist/schemas/journal-entry.d.ts.map +1 -0
  470. package/dist/schemas/key-value-list.d.ts +108 -0
  471. package/dist/schemas/key-value-list.d.ts.map +1 -0
  472. package/dist/schemas/legal-test-result.d.ts +130 -0
  473. package/dist/schemas/legal-test-result.d.ts.map +1 -0
  474. package/dist/schemas/line-chart.d.ts +71 -0
  475. package/dist/schemas/line-chart.d.ts.map +1 -0
  476. package/dist/schemas/news-feed.d.ts +63 -0
  477. package/dist/schemas/news-feed.d.ts.map +1 -0
  478. package/dist/schemas/ops-dashboard.d.ts +92 -0
  479. package/dist/schemas/ops-dashboard.d.ts.map +1 -0
  480. package/dist/schemas/pipeline-preview.d.ts +209 -0
  481. package/dist/schemas/pipeline-preview.d.ts.map +1 -0
  482. package/dist/schemas/provenance-chain.d.ts +121 -0
  483. package/dist/schemas/provenance-chain.d.ts.map +1 -0
  484. package/dist/schemas/radar-chart.d.ts +70 -0
  485. package/dist/schemas/radar-chart.d.ts.map +1 -0
  486. package/dist/schemas/reconciliation-view.d.ts +156 -0
  487. package/dist/schemas/reconciliation-view.d.ts.map +1 -0
  488. package/dist/schemas/scatter-chart.d.ts +90 -0
  489. package/dist/schemas/scatter-chart.d.ts.map +1 -0
  490. package/dist/schemas/screener-table.d.ts +74 -0
  491. package/dist/schemas/screener-table.d.ts.map +1 -0
  492. package/dist/schemas/search-results.d.ts +87 -0
  493. package/dist/schemas/search-results.d.ts.map +1 -0
  494. package/dist/schemas/sparkline-table.d.ts +74 -0
  495. package/dist/schemas/sparkline-table.d.ts.map +1 -0
  496. package/dist/schemas/stacked-breakdown.d.ts +70 -0
  497. package/dist/schemas/stacked-breakdown.d.ts.map +1 -0
  498. package/dist/schemas/stat-grid.d.ts +55 -0
  499. package/dist/schemas/stat-grid.d.ts.map +1 -0
  500. package/dist/schemas/status-card.d.ts +84 -0
  501. package/dist/schemas/status-card.d.ts.map +1 -0
  502. package/dist/schemas/tabs-panel.d.ts +42 -0
  503. package/dist/schemas/tabs-panel.d.ts.map +1 -0
  504. package/dist/schemas/transaction-feed.d.ts +82 -0
  505. package/dist/schemas/transaction-feed.d.ts.map +1 -0
  506. package/dist/schemas/treemap-chart.d.ts +53 -0
  507. package/dist/schemas/treemap-chart.d.ts.map +1 -0
  508. package/dist/schemas/trial-balance.d.ts +85 -0
  509. package/dist/schemas/trial-balance.d.ts.map +1 -0
  510. package/dist/schemas/validatePayload.d.ts +10 -0
  511. package/dist/schemas/validatePayload.d.ts.map +1 -0
  512. package/dist/schemas/variance-analysis.d.ts +73 -0
  513. package/dist/schemas/variance-analysis.d.ts.map +1 -0
  514. package/dist/schemas/waterfall-chart.d.ts +53 -0
  515. package/dist/schemas/waterfall-chart.d.ts.map +1 -0
  516. package/dist/shared/ColumnSettingsPanel.d.ts +13 -0
  517. package/dist/shared/ColumnSettingsPanel.d.ts.map +1 -0
  518. package/dist/shared/ComponentActions.d.ts +20 -0
  519. package/dist/shared/ComponentActions.d.ts.map +1 -0
  520. package/dist/shared/FileCard.d.ts +35 -0
  521. package/dist/shared/FileCard.d.ts.map +1 -0
  522. package/dist/shared/Markdown.d.ts +22 -0
  523. package/dist/shared/Markdown.d.ts.map +1 -0
  524. package/dist/shared/PreviewModal.d.ts +19 -0
  525. package/dist/shared/PreviewModal.d.ts.map +1 -0
  526. package/dist/shared/ThemeContext.d.ts +18 -0
  527. package/dist/shared/ThemeContext.d.ts.map +1 -0
  528. package/dist/shared/brandIcons.d.ts +3 -0
  529. package/dist/shared/brandIcons.d.ts.map +1 -0
  530. package/dist/shared/downloadCSV.d.ts +5 -0
  531. package/dist/shared/downloadCSV.d.ts.map +1 -0
  532. package/dist/shared/fileType.d.ts +19 -0
  533. package/dist/shared/fileType.d.ts.map +1 -0
  534. package/dist/shared/theme.d.ts +48 -0
  535. package/dist/shared/theme.d.ts.map +1 -0
  536. package/dist/shared/useColumnVisibility.d.ts +13 -0
  537. package/dist/shared/useColumnVisibility.d.ts.map +1 -0
  538. package/dist/shared/useSeriesToggle.d.ts +8 -0
  539. package/dist/shared/useSeriesToggle.d.ts.map +1 -0
  540. package/dist/shared/viewers/CsvViewer.d.ts +13 -0
  541. package/dist/shared/viewers/CsvViewer.d.ts.map +1 -0
  542. package/dist/shared/viewers/DocxViewer.d.ts +8 -0
  543. package/dist/shared/viewers/DocxViewer.d.ts.map +1 -0
  544. package/dist/shared/viewers/PreviewHost.d.ts +17 -0
  545. package/dist/shared/viewers/PreviewHost.d.ts.map +1 -0
  546. package/dist/shared/viewers/TextViewer.d.ts +13 -0
  547. package/dist/shared/viewers/TextViewer.d.ts.map +1 -0
  548. package/dist/shared/viewers/decode.d.ts +14 -0
  549. package/dist/shared/viewers/decode.d.ts.map +1 -0
  550. package/dist/tool-definitions.json +4629 -0
  551. package/dist/types.d.ts +8 -0
  552. package/dist/types.d.ts.map +1 -0
  553. package/package.json +110 -0
  554. package/styles/contract.css +17 -0
@@ -0,0 +1,1287 @@
1
+ "use client";
2
+ import React4, { createContext, Suspense, useState, useRef, useMemo, useEffect, useCallback, useContext } from 'react';
3
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
+ import dagre from '@dagrejs/dagre';
5
+ import { createPortal } from 'react-dom';
6
+ import { ReactFlowProvider, useNodesState, useEdgesState, useReactFlow, ReactFlow, Background, BackgroundVariant, Handle, Position } from '@xyflow/react';
7
+ import '@xyflow/react/dist/style.css';
8
+ import { toPng } from 'html-to-image';
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __defProps = Object.defineProperties;
12
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
13
+ var __getOwnPropNames = Object.getOwnPropertyNames;
14
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
15
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
16
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
17
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
18
+ var __spreadValues = (a, b) => {
19
+ for (var prop in b || (b = {}))
20
+ if (__hasOwnProp.call(b, prop))
21
+ __defNormalProp(a, prop, b[prop]);
22
+ if (__getOwnPropSymbols)
23
+ for (var prop of __getOwnPropSymbols(b)) {
24
+ if (__propIsEnum.call(b, prop))
25
+ __defNormalProp(a, prop, b[prop]);
26
+ }
27
+ return a;
28
+ };
29
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
30
+ var __esm = (fn, res) => function __init() {
31
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
32
+ };
33
+ var __export = (target, all) => {
34
+ for (var name in all)
35
+ __defProp(target, name, { get: all[name], enumerable: true });
36
+ };
37
+
38
+ // src/shared/theme.ts
39
+ var BORDER, MUTED, PAPER, ACCENT, ACCENT_SOFT, SECONDARY, CHART_PALETTE;
40
+ var init_theme = __esm({
41
+ "src/shared/theme.ts"() {
42
+ BORDER = "#dedede";
43
+ MUTED = "#777777";
44
+ PAPER = "#f6f6f6";
45
+ ACCENT = "#ff5000";
46
+ ACCENT_SOFT = "#cc4000";
47
+ SECONDARY = "#0364ff";
48
+ CHART_PALETTE = [
49
+ "#ff5000",
50
+ "#0364ff",
51
+ "#16a34a",
52
+ "#dc2626",
53
+ "#7c3aed",
54
+ "#0891b2",
55
+ "#f59e0b",
56
+ "#6366f1",
57
+ "#ec4899",
58
+ "#84cc16",
59
+ "#e11d48",
60
+ "#0ea5e9"
61
+ ];
62
+ }
63
+ });
64
+ function useTheme() {
65
+ return useContext(GenUIThemeContext);
66
+ }
67
+ var DEFAULT_TOKENS, GenUIThemeContext;
68
+ var init_ThemeContext = __esm({
69
+ "src/shared/ThemeContext.tsx"() {
70
+ "use client";
71
+ init_theme();
72
+ DEFAULT_TOKENS = {
73
+ BORDER,
74
+ MUTED,
75
+ PAPER,
76
+ ACCENT,
77
+ ACCENT_SOFT,
78
+ SECONDARY,
79
+ CHART_PALETTE: [...CHART_PALETTE]
80
+ };
81
+ GenUIThemeContext = createContext(DEFAULT_TOKENS);
82
+ }
83
+ });
84
+
85
+ // src/composites/flow-canvas/parseMermaidFlow.ts
86
+ function detectShape(rawNode) {
87
+ let m = rawNode.match(/^(\w+)\[(?:"|")?([^\]]*?)(?:"|")?\]$/);
88
+ const patterns = [
89
+ [/^(\w+)\[\((.+?)\)\]$/, "rounded"],
90
+ // ([label]) — stadium
91
+ [/^(\w+)\[\[(.+?)\]\]$/, "rect"],
92
+ // [[label]] — subroutine → rect
93
+ [/^(\w+)\[\((.+?)\)\]$/, "rounded"],
94
+ // [(label)] — cylinder approximation
95
+ [/^(\w+)\(\((.+?)\)\)$/, "circle"],
96
+ // ((label))
97
+ [/^(\w+)\(\[(.+?)\]\)$/, "rounded"],
98
+ // ([label])
99
+ [/^(\w+)\[(.+?)\]$/, "rect"],
100
+ // [label]
101
+ [/^(\w+)\{(.+?)\}$/, "diamond"]
102
+ // {label}
103
+ ];
104
+ for (const [re, shape] of patterns) {
105
+ m = rawNode.match(re);
106
+ if (m) return { id: m[1], label: unquote(m[2]), shape };
107
+ }
108
+ m = rawNode.match(/^(\w+)\[\((.+?)\)\]$/);
109
+ if (m) return { id: m[1], label: unquote(m[2]), shape: "cylinder" };
110
+ const bare = rawNode.match(/^(\w+)$/);
111
+ if (bare) return { id: bare[1], label: bare[1], shape: "rect" };
112
+ return { id: rawNode.replace(/\W/g, "_"), label: rawNode, shape: "rect" };
113
+ }
114
+ function unquote(s) {
115
+ return s.replace(/^["']|["']$/g, "").trim();
116
+ }
117
+ function splitEdge(line) {
118
+ let m = line.match(/^(.+?)\s*--+>\|([^|]*)\|\s*(.+)$/);
119
+ if (m) return { left: m[1].trim(), right: m[3].trim(), edgeLabel: m[2].trim() || void 0 };
120
+ m = line.match(/^(.+?)\s*---*>?\s+(.+)$/);
121
+ if (m) return { left: m[1].trim(), right: m[2].trim() };
122
+ return null;
123
+ }
124
+ function parseMermaidFlow(source) {
125
+ var _a, _b, _c;
126
+ const lines = source.split("\n").map((l) => l.trim()).filter((l) => l && !l.startsWith("%%"));
127
+ if (!lines.length) return null;
128
+ const header = lines[0].toLowerCase();
129
+ if (!header.startsWith("flowchart") && !header.startsWith("graph")) return null;
130
+ const directionMap = {
131
+ td: "TB",
132
+ tb: "TB",
133
+ lr: "LR",
134
+ rl: "RL",
135
+ bt: "BT"
136
+ };
137
+ const dirToken = (_b = (_a = header.split(/\s+/)[1]) == null ? void 0 : _a.toLowerCase()) != null ? _b : "td";
138
+ const direction = (_c = directionMap[dirToken]) != null ? _c : "TB";
139
+ const nodeMap = /* @__PURE__ */ new Map();
140
+ const edges = [];
141
+ function ensureNode(raw) {
142
+ const parsed = detectShape(raw);
143
+ if (!nodeMap.has(parsed.id)) {
144
+ nodeMap.set(parsed.id, parsed);
145
+ } else if (parsed.label !== parsed.id) {
146
+ const existing = nodeMap.get(parsed.id);
147
+ if (existing.label === existing.id) {
148
+ nodeMap.set(parsed.id, __spreadProps(__spreadValues({}, existing), { label: parsed.label, shape: parsed.shape }));
149
+ }
150
+ }
151
+ return parsed.id;
152
+ }
153
+ for (let i = 1; i < lines.length; i++) {
154
+ const line = lines[i];
155
+ if (line.startsWith("subgraph")) {
156
+ continue;
157
+ }
158
+ if (line === "end") {
159
+ continue;
160
+ }
161
+ const edgeParts = splitEdge(line);
162
+ if (edgeParts) {
163
+ let parts = [edgeParts.left];
164
+ let rest = edgeParts.right;
165
+ let chain = splitEdge(rest);
166
+ while (chain) {
167
+ parts.push(chain.left);
168
+ rest = chain.right;
169
+ chain = splitEdge(rest);
170
+ }
171
+ parts.push(rest);
172
+ for (let j = 0; j < parts.length - 1; j++) {
173
+ const srcId = ensureNode(parts[j]);
174
+ const dstId = ensureNode(parts[j + 1]);
175
+ edges.push({
176
+ source: srcId,
177
+ target: dstId,
178
+ label: j === 0 ? edgeParts.edgeLabel : void 0
179
+ });
180
+ }
181
+ continue;
182
+ }
183
+ if (line && !line.startsWith("style") && !line.startsWith("classDef") && !line.startsWith("class ")) {
184
+ ensureNode(line);
185
+ }
186
+ }
187
+ return {
188
+ direction,
189
+ nodes: Array.from(nodeMap.values()),
190
+ edges
191
+ };
192
+ }
193
+ var init_parseMermaidFlow = __esm({
194
+ "src/composites/flow-canvas/parseMermaidFlow.ts"() {
195
+ }
196
+ });
197
+ function reverseDir(dir) {
198
+ return dir === "LR" ? "RL" : dir === "RL" ? "LR" : dir === "TB" ? "BT" : "TB";
199
+ }
200
+ function measureBounds(nodes) {
201
+ let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;
202
+ for (const n of nodes) {
203
+ const x2 = n.position.x + n.width;
204
+ const y2 = n.position.y + n.height;
205
+ if (n.position.x < minX) minX = n.position.x;
206
+ if (n.position.y < minY) minY = n.position.y;
207
+ if (x2 > maxX) maxX = x2;
208
+ if (y2 > maxY) maxY = y2;
209
+ }
210
+ return { w: maxX - minX + 40, h: maxY - minY + 40 };
211
+ }
212
+ function applySnake(nodes, direction, rowGap) {
213
+ const isHoriz = direction === "LR" || direction === "RL";
214
+ const primary = isHoriz ? "x" : "y";
215
+ const secondary = isHoriz ? "y" : "x";
216
+ const rankMap = /* @__PURE__ */ new Map();
217
+ for (const n of nodes) {
218
+ const key = Math.round(n.position[primary] / 2) * 2;
219
+ if (!rankMap.has(key)) rankMap.set(key, []);
220
+ rankMap.get(key).push(n);
221
+ }
222
+ const ranks = [...rankMap.keys()].sort((a, b) => a - b);
223
+ if (ranks.length <= 5) return;
224
+ const nodesPerRow = 5;
225
+ const primarySpan = ranks[ranks.length - 1] - ranks[0];
226
+ const rankStep = primarySpan / Math.max(ranks.length - 1, 1);
227
+ let secondaryOffset = 0;
228
+ for (let rowIdx = 0; rowIdx < Math.ceil(ranks.length / nodesPerRow); rowIdx++) {
229
+ const rowRanks = ranks.slice(rowIdx * nodesPerRow, (rowIdx + 1) * nodesPerRow);
230
+ const isReversed = rowIdx % 2 === 1;
231
+ const rowDir = isReversed ? reverseDir(direction) : direction;
232
+ let rowSecondaryMax = secondaryOffset;
233
+ for (let colIdx = 0; colIdx < rowRanks.length; colIdx++) {
234
+ const rank = rowRanks[colIdx];
235
+ const rankNodes = rankMap.get(rank);
236
+ const effectiveCol = isReversed ? nodesPerRow - 1 - colIdx : colIdx;
237
+ const newPrimary = effectiveCol * rankStep;
238
+ const minSec = Math.min(...rankNodes.map((n) => n.position[secondary]));
239
+ for (const n of rankNodes) {
240
+ const secOffset = n.position[secondary] - minSec;
241
+ const newPos = __spreadValues({}, n.position);
242
+ newPos[primary] = newPrimary;
243
+ newPos[secondary] = secondaryOffset + secOffset;
244
+ n.position = newPos;
245
+ n.data = __spreadProps(__spreadValues({}, n.data), { direction: rowDir });
246
+ const nodeSecSize = (isHoriz ? n.height : n.width) || 40;
247
+ rowSecondaryMax = Math.max(
248
+ rowSecondaryMax,
249
+ secondaryOffset + secOffset + nodeSecSize
250
+ );
251
+ }
252
+ }
253
+ secondaryOffset = rowSecondaryMax + rowGap;
254
+ }
255
+ }
256
+ function computeLayout(flow, nodeWidth = 148, nodeHeight = 40) {
257
+ const g = new dagre.graphlib.Graph();
258
+ g.setDefaultEdgeLabel(() => ({}));
259
+ g.setGraph({
260
+ rankdir: RANK_DIR[flow.direction],
261
+ ranksep: 60,
262
+ nodesep: 40,
263
+ marginx: 20,
264
+ marginy: 20
265
+ });
266
+ for (const node of flow.nodes) {
267
+ const w = node.shape === "diamond" ? nodeWidth + 40 : nodeWidth;
268
+ const h = node.shape === "diamond" ? nodeHeight + 24 : nodeHeight;
269
+ g.setNode(node.id, { width: w, height: h });
270
+ }
271
+ for (const edge of flow.edges) {
272
+ g.setEdge(edge.source, edge.target, {});
273
+ }
274
+ dagre.layout(g);
275
+ const nodes = flow.nodes.map((n) => {
276
+ const pos = g.node(n.id);
277
+ const w = n.shape === "diamond" ? nodeWidth + 40 : nodeWidth;
278
+ const h = n.shape === "diamond" ? nodeHeight + 24 : nodeHeight;
279
+ return {
280
+ id: n.id,
281
+ type: n.shape,
282
+ position: { x: pos.x - w / 2, y: pos.y - h / 2 },
283
+ data: { label: n.label, direction: flow.direction },
284
+ width: w,
285
+ height: h
286
+ };
287
+ });
288
+ const pre = measureBounds(nodes);
289
+ const isHoriz = flow.direction === "LR" || flow.direction === "RL";
290
+ const preRatio = isHoriz ? pre.w / Math.max(pre.h, 1) : pre.h / Math.max(pre.w, 1);
291
+ if (preRatio > SNAKE_RATIO && nodes.length > 4) {
292
+ applySnake(nodes, flow.direction, 60);
293
+ }
294
+ const { w: graphWidth, h: graphHeight } = measureBounds(nodes);
295
+ const edges = flow.edges.map((e, i) => ({
296
+ id: `e-${e.source}-${e.target}-${i}`,
297
+ source: e.source,
298
+ target: e.target,
299
+ label: e.label,
300
+ type: "smoothstep",
301
+ style: { stroke: "#c93d1e", strokeWidth: 1.75 },
302
+ labelStyle: {
303
+ fill: "#6b6b6b",
304
+ fontSize: 10,
305
+ fontFamily: "Plus Jakarta Sans, system-ui, sans-serif"
306
+ },
307
+ labelBgStyle: { fill: "#f8f8f7", fillOpacity: 0.92 },
308
+ labelBgPadding: [3, 5],
309
+ markerEnd: {
310
+ type: "arrowclosed",
311
+ color: "#c93d1e",
312
+ width: 16,
313
+ height: 16
314
+ }
315
+ }));
316
+ return { nodes, edges, graphWidth, graphHeight };
317
+ }
318
+ var RANK_DIR, SNAKE_RATIO;
319
+ var init_layoutFlow = __esm({
320
+ "src/composites/flow-canvas/layoutFlow.ts"() {
321
+ RANK_DIR = {
322
+ TB: "TB",
323
+ BT: "BT",
324
+ LR: "LR",
325
+ RL: "RL"
326
+ };
327
+ SNAKE_RATIO = 2.6;
328
+ }
329
+ });
330
+
331
+ // src/composites/flow-canvas/FlowGraph.tsx
332
+ var FlowGraph_exports = {};
333
+ __export(FlowGraph_exports, {
334
+ FlowGraph: () => FlowGraph
335
+ });
336
+ function themeVars(t) {
337
+ return {
338
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
339
+ ["--gx-accent"]: t.ACCENT,
340
+ ["--gx-border"]: t.BORDER,
341
+ ["--gx-muted"]: t.MUTED,
342
+ ["--gx-bg"]: "#ffffff",
343
+ ["--gx-bg-subtle"]: t.PAPER,
344
+ ["--gx-text"]: "var(--foreground)",
345
+ ["--gx-outline"]: "var(--foreground)",
346
+ ["--gx-font"]: "var(--font-sans, Figtree, system-ui, sans-serif)"
347
+ };
348
+ }
349
+ function Handles({ dir }) {
350
+ switch (dir) {
351
+ case "BT":
352
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
353
+ /* @__PURE__ */ jsx(Handle, { type: "target", position: Position.Bottom, style: hDot }),
354
+ /* @__PURE__ */ jsx(Handle, { type: "source", position: Position.Top, style: hDot })
355
+ ] });
356
+ case "LR":
357
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
358
+ /* @__PURE__ */ jsx(Handle, { type: "target", position: Position.Left, style: hDot }),
359
+ /* @__PURE__ */ jsx(Handle, { type: "source", position: Position.Right, style: hDot })
360
+ ] });
361
+ case "RL":
362
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
363
+ /* @__PURE__ */ jsx(Handle, { type: "target", position: Position.Right, style: hDot }),
364
+ /* @__PURE__ */ jsx(Handle, { type: "source", position: Position.Left, style: hDot })
365
+ ] });
366
+ default:
367
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
368
+ /* @__PURE__ */ jsx(Handle, { type: "target", position: Position.Top, style: hDot }),
369
+ /* @__PURE__ */ jsx(Handle, { type: "source", position: Position.Bottom, style: hDot })
370
+ ] });
371
+ }
372
+ }
373
+ function nodeClass(status) {
374
+ return "gx-flow-node" + (status ? ` gx-flow-${status}` : "");
375
+ }
376
+ function DoneBadge() {
377
+ return /* @__PURE__ */ jsx("span", { className: "gx-done-badge", "aria-hidden": "true", children: /* @__PURE__ */ jsx("svg", { width: "9", height: "9", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "4", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx("path", { d: "M20 6 9 17l-5-5" }) }) });
378
+ }
379
+ function RectNode({ data }) {
380
+ var _a;
381
+ const s = data.status;
382
+ return /* @__PURE__ */ jsxs("div", { className: nodeClass(s), style: __spreadProps(__spreadValues({}, nodeBase), { borderRadius: "6px" }), children: [
383
+ /* @__PURE__ */ jsx(Handles, { dir: data.direction }),
384
+ s === "done" && /* @__PURE__ */ jsx(DoneBadge, {}),
385
+ String((_a = data.label) != null ? _a : "")
386
+ ] });
387
+ }
388
+ function RoundedNode({ data }) {
389
+ var _a;
390
+ const s = data.status;
391
+ return /* @__PURE__ */ jsxs("div", { className: nodeClass(s), style: __spreadProps(__spreadValues({}, nodeBase), { borderRadius: "999px" }), children: [
392
+ /* @__PURE__ */ jsx(Handles, { dir: data.direction }),
393
+ s === "done" && /* @__PURE__ */ jsx(DoneBadge, {}),
394
+ String((_a = data.label) != null ? _a : "")
395
+ ] });
396
+ }
397
+ function CircleNode({ data }) {
398
+ var _a;
399
+ const s = data.status;
400
+ return /* @__PURE__ */ jsxs("div", { className: nodeClass(s), style: __spreadProps(__spreadValues({}, nodeBase), { borderRadius: "50%", padding: "6px" }), children: [
401
+ /* @__PURE__ */ jsx(Handles, { dir: data.direction }),
402
+ s === "done" && /* @__PURE__ */ jsx(DoneBadge, {}),
403
+ String((_a = data.label) != null ? _a : "")
404
+ ] });
405
+ }
406
+ function DiamondNode({ data }) {
407
+ var _a;
408
+ const s = data.status;
409
+ return /* @__PURE__ */ jsxs("div", { className: nodeClass(s), style: { position: "relative", width: "100%", height: "100%", display: "flex", alignItems: "center", justifyContent: "center", border: "none", background: "transparent" }, children: [
410
+ /* @__PURE__ */ jsx(Handles, { dir: data.direction }),
411
+ s === "done" && /* @__PURE__ */ jsx(DoneBadge, {}),
412
+ /* @__PURE__ */ jsx("svg", { style: { position: "absolute", inset: 0, width: "100%", height: "100%", overflow: "visible" }, viewBox: "0 0 1 1", preserveAspectRatio: "none", children: /* @__PURE__ */ jsx("polygon", { className: "gx-flow-poly", points: "0.5,0.03 0.97,0.5 0.5,0.97 0.03,0.5", fill: "var(--gx-bg)", stroke: "var(--gx-outline)", strokeWidth: "1.5", vectorEffect: "non-scaling-stroke" }) }),
413
+ /* @__PURE__ */ jsx("span", { style: { position: "relative", zIndex: 1, fontFamily: "var(--gx-font)", fontSize: "11px", fontWeight: 500, color: "var(--gx-text)", textAlign: "center", lineHeight: 1.25, userSelect: "none", padding: "0 22px", maxWidth: "100%" }, children: String((_a = data.label) != null ? _a : "") })
414
+ ] });
415
+ }
416
+ function CylinderNode({ data }) {
417
+ var _a;
418
+ const a = 5;
419
+ const s = data.status;
420
+ return /* @__PURE__ */ jsxs("div", { className: nodeClass(s), style: { position: "relative", width: "100%", height: "100%", border: "none", background: "transparent" }, children: [
421
+ /* @__PURE__ */ jsx(Handles, { dir: data.direction }),
422
+ s === "done" && /* @__PURE__ */ jsx(DoneBadge, {}),
423
+ /* @__PURE__ */ jsx("div", { style: { position: "absolute", top: 0, left: 0, right: 0, height: a * 2, border: "1.5px solid var(--gx-outline)", borderRadius: "50%", background: "var(--gx-bg)", zIndex: 1 } }),
424
+ /* @__PURE__ */ jsx("div", { style: { position: "absolute", inset: `${a}px 0`, border: "1.5px solid var(--gx-outline)", borderTop: "none", borderBottom: "none", background: "var(--gx-bg)", display: "flex", alignItems: "center", justifyContent: "center", fontFamily: "var(--gx-font)", fontSize: "12px", fontWeight: 500, color: "var(--gx-text)" }, children: String((_a = data.label) != null ? _a : "") }),
425
+ /* @__PURE__ */ jsx("div", { style: { position: "absolute", bottom: 0, left: 0, right: 0, height: a * 2, border: "1.5px solid var(--gx-outline)", borderRadius: "50%", background: "var(--gx-bg)", zIndex: 1 } })
426
+ ] });
427
+ }
428
+ function FitBtn() {
429
+ const { fitView } = useReactFlow();
430
+ return /* @__PURE__ */ jsxs("button", { style: pillStyle, onClick: () => fitView({ padding: 0.1, duration: 300 }), onMouseEnter: onEnter, onMouseLeave: onLeave, children: [
431
+ /* @__PURE__ */ jsx("svg", { width: "11", height: "11", viewBox: "0 0 11 11", fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx("path", { d: "M1 4V1h3M7 1h3v3M10 7v3H7M4 10H1V7" }) }),
432
+ /* @__PURE__ */ jsx("span", { children: "Fit" })
433
+ ] });
434
+ }
435
+ function idealHeight(boxW, graphWidth, graphHeight) {
436
+ if (!graphWidth || !graphHeight || !boxW) return 300;
437
+ const ratio = graphWidth / graphHeight;
438
+ const h = Math.round(boxW / ratio);
439
+ return Math.max(220, Math.min(480, h));
440
+ }
441
+ async function getMermaid(t) {
442
+ const m = (await import('mermaid')).default;
443
+ const sig = `${t.ACCENT}|${t.BORDER}|${t.PAPER}|${t.MUTED}`;
444
+ if (!mermaidReady || mermaidSig !== sig) {
445
+ m.initialize({
446
+ startOnLoad: false,
447
+ logLevel: 5,
448
+ theme: "base",
449
+ themeVariables: {
450
+ primaryColor: "#ffffff",
451
+ primaryBorderColor: "#171717",
452
+ primaryTextColor: "#171717",
453
+ mainBkg: "#ffffff",
454
+ nodeBorder: "#171717",
455
+ lineColor: t.ACCENT,
456
+ secondaryColor: t.PAPER,
457
+ clusterBkg: t.PAPER,
458
+ clusterBorder: t.BORDER,
459
+ noteBkgColor: t.PAPER,
460
+ noteBorderColor: t.BORDER,
461
+ actorLineColor: t.ACCENT,
462
+ loopTextColor: t.MUTED,
463
+ fontFamily: "Figtree, system-ui, sans-serif",
464
+ fontSize: "12px"
465
+ }
466
+ });
467
+ mermaidReady = true;
468
+ mermaidSig = sig;
469
+ }
470
+ return m;
471
+ }
472
+ function MermaidFallback({ diagram, title }) {
473
+ const tokens = useTheme();
474
+ const [svg, setSvg] = useState("");
475
+ const [err, setErr] = useState(false);
476
+ const [full, setFull] = useState(false);
477
+ const idRef = useRef(0);
478
+ useEffect(() => {
479
+ const id = ++renderSeq;
480
+ idRef.current = id;
481
+ setErr(false);
482
+ (async () => {
483
+ try {
484
+ const m = await getMermaid(tokens);
485
+ if (idRef.current !== id) return;
486
+ const { svg: out } = await m.render(`gx-mm-${id}`, diagram);
487
+ if (idRef.current !== id) return;
488
+ setSvg(out);
489
+ } catch (e) {
490
+ if (idRef.current === id) setErr(true);
491
+ }
492
+ })();
493
+ }, [diagram, tokens]);
494
+ if (err) {
495
+ return /* @__PURE__ */ jsxs("div", { style: { height: "100%", overflow: "auto", padding: 20, fontSize: 12, fontFamily: "var(--font-sans)", display: "flex", flexDirection: "column", gap: 8 }, children: [
496
+ /* @__PURE__ */ jsx("span", { style: { color: tokens.ACCENT, fontWeight: 500 }, children: "Diagram syntax error" }),
497
+ /* @__PURE__ */ jsx("pre", { style: { fontSize: 11, background: "#ffffff", border: `1px solid ${tokens.BORDER}`, borderRadius: 6, padding: "10px 12px", overflowX: "auto", whiteSpace: "pre-wrap", wordBreak: "break-word", color: "var(--foreground)", margin: 0 }, children: diagram })
498
+ ] });
499
+ }
500
+ if (!svg) {
501
+ return /* @__PURE__ */ jsx("div", { style: { height: "100%", display: "flex", alignItems: "center", justifyContent: "center", color: tokens.MUTED, fontSize: 11, fontFamily: "var(--font-sans)", letterSpacing: "0.06em", textTransform: "uppercase" }, children: "rendering" });
502
+ }
503
+ return /* @__PURE__ */ jsxs("div", { style: { position: "relative", height: "100%", overflow: "auto" }, children: [
504
+ /* @__PURE__ */ jsx("div", { className: "mermaid-output", dangerouslySetInnerHTML: { __html: svg } }),
505
+ /* @__PURE__ */ jsxs("button", { style: __spreadProps(__spreadValues({}, pillStyle), { position: "absolute", top: 10, right: 10, zIndex: 10 }), onClick: () => setFull(true), onMouseEnter: onEnter, onMouseLeave: onLeave, children: [
506
+ /* @__PURE__ */ jsx(ExpandIcon, {}),
507
+ /* @__PURE__ */ jsx("span", { children: "Expand" })
508
+ ] }),
509
+ full && typeof document !== "undefined" && createPortal(
510
+ /* @__PURE__ */ jsx("div", { style: __spreadProps(__spreadValues({}, themeVars(tokens)), { position: "fixed", inset: 0, zIndex: 9999, background: "rgba(23,23,23,0.55)", display: "flex", alignItems: "center", justifyContent: "center", backdropFilter: "blur(6px)", WebkitBackdropFilter: "blur(6px)" }), onClick: (e) => {
511
+ if (e.target === e.currentTarget) setFull(false);
512
+ }, children: /* @__PURE__ */ jsxs("div", { style: { background: "#ffffff", borderRadius: 10, border: `1px solid ${tokens.BORDER}`, boxShadow: "0 8px 32px rgba(23,23,23,0.12)", width: "min(92vw,1280px)", height: "min(88vh,960px)", display: "flex", flexDirection: "column", overflow: "hidden" }, children: [
513
+ /* @__PURE__ */ jsxs("div", { style: { padding: "8px 12px", borderBottom: `1px solid ${tokens.BORDER}`, display: "flex", alignItems: "center", justifyContent: "space-between", background: tokens.PAPER }, children: [
514
+ /* @__PURE__ */ jsx("span", { style: { fontFamily: "var(--font-sans)", fontSize: 12, color: tokens.MUTED }, children: title != null ? title : "Diagram" }),
515
+ /* @__PURE__ */ jsxs("button", { style: __spreadProps(__spreadValues({}, pillStyle), { color: tokens.ACCENT }), onClick: () => setFull(false), children: [
516
+ /* @__PURE__ */ jsx(CloseIcon, {}),
517
+ /* @__PURE__ */ jsx("span", { children: "Close" })
518
+ ] })
519
+ ] }),
520
+ /* @__PURE__ */ jsx("div", { style: { flex: 1, overflow: "auto", display: "flex", alignItems: "center", justifyContent: "center", padding: 32 }, children: /* @__PURE__ */ jsx("div", { dangerouslySetInnerHTML: { __html: svg }, style: { maxWidth: "100%" } }) })
521
+ ] }) }),
522
+ document.body
523
+ )
524
+ ] });
525
+ }
526
+ function FullscreenModalInner({ nodes, edges, title, onClose }) {
527
+ const tokens = useTheme();
528
+ const [n, , onNC] = useNodesState(nodes);
529
+ const [e, , onEC] = useEdgesState(edges);
530
+ return /* @__PURE__ */ jsx("div", { style: __spreadProps(__spreadValues({}, themeVars(tokens)), { position: "fixed", inset: 0, zIndex: 9999, background: "rgba(23,23,23,0.55)", display: "flex", alignItems: "center", justifyContent: "center", backdropFilter: "blur(6px)", WebkitBackdropFilter: "blur(6px)" }), onClick: (ev) => {
531
+ if (ev.target === ev.currentTarget) onClose();
532
+ }, children: /* @__PURE__ */ jsxs("div", { style: { background: "#ffffff", borderRadius: "10px", border: `1px solid ${tokens.BORDER}`, boxShadow: "0 8px 32px rgba(23,23,23,0.12)", width: "min(92vw,1280px)", height: "min(88vh,960px)", display: "flex", flexDirection: "column", overflow: "hidden" }, children: [
533
+ /* @__PURE__ */ jsxs("div", { style: { padding: "8px 12px", borderBottom: `1px solid ${tokens.BORDER}`, display: "flex", alignItems: "center", justifyContent: "space-between", background: tokens.PAPER, flexShrink: 0 }, children: [
534
+ /* @__PURE__ */ jsx("span", { style: { fontFamily: "var(--font-sans)", fontSize: "12px", color: tokens.MUTED }, children: title != null ? title : "Diagram" }),
535
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "6px" }, children: [
536
+ /* @__PURE__ */ jsx(FitBtn, {}),
537
+ /* @__PURE__ */ jsxs("button", { style: __spreadProps(__spreadValues({}, pillStyle), { color: tokens.ACCENT }), onClick: onClose, children: [
538
+ /* @__PURE__ */ jsx(CloseIcon, {}),
539
+ /* @__PURE__ */ jsx("span", { children: "Close" })
540
+ ] })
541
+ ] })
542
+ ] }),
543
+ /* @__PURE__ */ jsx("div", { style: { flex: 1, position: "relative" }, children: /* @__PURE__ */ jsx(ReactFlow, { nodes: n, edges: e, nodeTypes, onNodesChange: onNC, onEdgesChange: onEC, fitView: true, fitViewOptions: { padding: 0.1 }, nodesDraggable: false, nodesConnectable: false, elementsSelectable: false, panOnDrag: true, zoomOnScroll: true, minZoom: 0.15, maxZoom: 4, proOptions: { hideAttribution: true }, style: { background: tokens.PAPER, width: "100%", height: "100%" }, children: /* @__PURE__ */ jsx(Background, { variant: BackgroundVariant.Dots, gap: 20, size: 1, color: tokens.BORDER }) }) })
544
+ ] }) });
545
+ }
546
+ function FullscreenModal({ nodes, edges, title, onClose }) {
547
+ useEffect(() => {
548
+ const h = (e) => {
549
+ if (e.key === "Escape") onClose();
550
+ };
551
+ window.addEventListener("keydown", h);
552
+ return () => window.removeEventListener("keydown", h);
553
+ }, [onClose]);
554
+ return createPortal(
555
+ /* @__PURE__ */ jsx(ReactFlowProvider, { children: /* @__PURE__ */ jsx(FullscreenModalInner, { nodes, edges, title, onClose }) }),
556
+ document.body
557
+ );
558
+ }
559
+ function usePrefersReducedMotion() {
560
+ const [reduced, setReduced] = useState(false);
561
+ useEffect(() => {
562
+ var _a;
563
+ if (typeof matchMedia === "undefined") return;
564
+ const mq = matchMedia("(prefers-reduced-motion: reduce)");
565
+ setReduced(mq.matches);
566
+ const h = () => setReduced(mq.matches);
567
+ (_a = mq.addEventListener) == null ? void 0 : _a.call(mq, "change", h);
568
+ return () => {
569
+ var _a2;
570
+ return (_a2 = mq.removeEventListener) == null ? void 0 : _a2.call(mq, "change", h);
571
+ };
572
+ }, []);
573
+ return reduced;
574
+ }
575
+ function topoOrder(nodeIds, edges) {
576
+ var _a, _b, _c, _d;
577
+ const indeg = new Map(nodeIds.map((id) => [id, 0]));
578
+ const adj = new Map(nodeIds.map((id) => [id, []]));
579
+ for (const e of edges) {
580
+ if (!indeg.has(e.target) || !adj.has(e.source)) continue;
581
+ indeg.set(e.target, ((_a = indeg.get(e.target)) != null ? _a : 0) + 1);
582
+ adj.get(e.source).push(e.target);
583
+ }
584
+ const queue = nodeIds.filter((id) => {
585
+ var _a2;
586
+ return ((_a2 = indeg.get(id)) != null ? _a2 : 0) === 0;
587
+ });
588
+ const seen = /* @__PURE__ */ new Set();
589
+ const order = [];
590
+ while (queue.length) {
591
+ const id = queue.shift();
592
+ if (seen.has(id)) continue;
593
+ seen.add(id);
594
+ order.push(id);
595
+ for (const t of (_b = adj.get(id)) != null ? _b : []) {
596
+ indeg.set(t, ((_c = indeg.get(t)) != null ? _c : 1) - 1);
597
+ if (((_d = indeg.get(t)) != null ? _d : 0) <= 0 && !seen.has(t)) queue.push(t);
598
+ }
599
+ }
600
+ for (const id of nodeIds) if (!seen.has(id)) order.push(id);
601
+ return order;
602
+ }
603
+ function useAutoplay(order, enabled) {
604
+ const reduced = usePrefersReducedMotion();
605
+ const [step, setStep] = useState(0);
606
+ const key = order.join("|");
607
+ useEffect(() => {
608
+ if (!enabled || reduced || order.length === 0) {
609
+ setStep(0);
610
+ return;
611
+ }
612
+ let s = 0;
613
+ setStep(0);
614
+ let timer;
615
+ const tick = () => {
616
+ s += 1;
617
+ if (s > order.length) {
618
+ s = 0;
619
+ setStep(0);
620
+ timer = setTimeout(tick, 850);
621
+ return;
622
+ }
623
+ setStep(s);
624
+ timer = setTimeout(tick, s === order.length ? 1100 : 850);
625
+ };
626
+ timer = setTimeout(tick, 850);
627
+ return () => clearTimeout(timer);
628
+ }, [enabled, reduced, key]);
629
+ return useMemo(() => {
630
+ const m = {};
631
+ order.forEach((id, i) => {
632
+ m[id] = i < step ? "done" : i === step ? "active" : "pending";
633
+ });
634
+ if (step >= order.length) order.forEach((id) => m[id] = "done");
635
+ return m;
636
+ }, [order, step]);
637
+ }
638
+ function resolveStates(nodes, nodeStates) {
639
+ var _a, _b;
640
+ if (!nodeStates) return {};
641
+ const m = {};
642
+ for (const n of nodes) {
643
+ const label = (_a = n.data) == null ? void 0 : _a.label;
644
+ const st = (_b = nodeStates[n.id]) != null ? _b : label ? nodeStates[label] : void 0;
645
+ if (st) m[n.id] = st;
646
+ }
647
+ return m;
648
+ }
649
+ function Inner({ diagram, title, autoplay, nodeStates }) {
650
+ const tokens = useTheme();
651
+ const [full, setFull] = useState(false);
652
+ const [focused, setFocused] = useState(false);
653
+ const [boxW, setBoxW] = useState(640);
654
+ const containerRef = useRef(null);
655
+ const parsed = useMemo(() => parseMermaidFlow(diagram), [diagram]);
656
+ const layout = useMemo(() => parsed ? computeLayout(parsed) : null, [parsed]);
657
+ const themedEdges = useMemo(
658
+ () => {
659
+ var _a;
660
+ return ((_a = layout == null ? void 0 : layout.edges) != null ? _a : []).map((e) => __spreadProps(__spreadValues({}, e), {
661
+ style: __spreadProps(__spreadValues({}, e.style), { stroke: tokens.ACCENT, strokeWidth: 1.75 }),
662
+ labelStyle: { fill: tokens.MUTED, fontSize: 10, fontFamily: "var(--font-sans, Figtree, system-ui, sans-serif)" },
663
+ labelBgStyle: { fill: "#ffffff", fillOpacity: 0.92 },
664
+ markerEnd: { type: "arrowclosed", color: tokens.ACCENT, width: 12, height: 12 }
665
+ }));
666
+ },
667
+ [layout, tokens.ACCENT, tokens.MUTED]
668
+ );
669
+ const order = useMemo(
670
+ () => {
671
+ var _a, _b;
672
+ return topoOrder(((_a = layout == null ? void 0 : layout.nodes) != null ? _a : []).map((n) => n.id), (_b = layout == null ? void 0 : layout.edges) != null ? _b : []);
673
+ },
674
+ [layout]
675
+ );
676
+ const autoStatus = useAutoplay(order, !!autoplay);
677
+ const staticStatus = useMemo(() => {
678
+ var _a;
679
+ return resolveStates((_a = layout == null ? void 0 : layout.nodes) != null ? _a : [], nodeStates);
680
+ }, [layout, nodeStates]);
681
+ const statusMap = autoplay ? autoStatus : staticStatus;
682
+ const displayNodes = useMemo(
683
+ () => {
684
+ var _a;
685
+ return ((_a = layout == null ? void 0 : layout.nodes) != null ? _a : []).map((n) => __spreadProps(__spreadValues({}, n), { data: __spreadProps(__spreadValues({}, n.data), { status: statusMap[n.id] }) }));
686
+ },
687
+ [layout, statusMap]
688
+ );
689
+ const displayEdges = useMemo(
690
+ () => themedEdges.map((e) => {
691
+ const ss = statusMap[e.source];
692
+ const ts = statusMap[e.target];
693
+ const flowing = ss === "done" && ts === "active";
694
+ const bothDone = ss === "done" && ts === "done";
695
+ const anyStatus = !!(ss || ts);
696
+ const lit = flowing || bothDone;
697
+ const stroke = lit || !anyStatus ? tokens.ACCENT : tokens.BORDER;
698
+ return __spreadProps(__spreadValues({}, e), {
699
+ animated: flowing,
700
+ style: __spreadProps(__spreadValues({}, e.style), { stroke, strokeWidth: flowing ? 2.25 : 1.75, opacity: anyStatus && !lit ? 0.5 : 1, transition: "stroke 0.3s ease, opacity 0.3s ease" }),
701
+ markerEnd: { type: "arrowclosed", color: stroke, width: 12, height: 12 }
702
+ });
703
+ }),
704
+ [themedEdges, statusMap, tokens.ACCENT, tokens.BORDER]
705
+ );
706
+ const [nodes, setNodes, onNC] = useNodesState(displayNodes);
707
+ const [edges, setEdges, onEC] = useEdgesState(displayEdges);
708
+ const rf = useReactFlow();
709
+ useEffect(() => {
710
+ setNodes(displayNodes);
711
+ }, [displayNodes, setNodes]);
712
+ useEffect(() => {
713
+ setEdges(displayEdges);
714
+ }, [displayEdges, setEdges]);
715
+ useEffect(() => {
716
+ const id = requestAnimationFrame(() => {
717
+ try {
718
+ rf.fitView({ padding: 0.1 });
719
+ } catch (e) {
720
+ }
721
+ });
722
+ return () => cancelAnimationFrame(id);
723
+ }, [layout, rf]);
724
+ const handleClickOutside = useCallback((e) => {
725
+ if (containerRef.current && !containerRef.current.contains(e.target)) setFocused(false);
726
+ }, []);
727
+ useEffect(() => {
728
+ document.addEventListener("mousedown", handleClickOutside);
729
+ return () => document.removeEventListener("mousedown", handleClickOutside);
730
+ }, [handleClickOutside]);
731
+ useEffect(() => {
732
+ const el = containerRef.current;
733
+ if (!el) return;
734
+ let raf = 0;
735
+ const measure = () => {
736
+ const w = el.clientWidth || 640;
737
+ setBoxW((prev) => Math.abs(prev - w) > 1 ? w : prev);
738
+ };
739
+ measure();
740
+ if (typeof ResizeObserver === "undefined") return;
741
+ const ro = new ResizeObserver(() => {
742
+ cancelAnimationFrame(raf);
743
+ raf = requestAnimationFrame(measure);
744
+ });
745
+ ro.observe(el);
746
+ return () => {
747
+ cancelAnimationFrame(raf);
748
+ ro.disconnect();
749
+ };
750
+ }, []);
751
+ if (!parsed || !layout) {
752
+ return /* @__PURE__ */ jsx("div", { style: __spreadProps(__spreadValues({}, themeVars(tokens)), { height: 320 }), children: /* @__PURE__ */ jsx(MermaidFallback, { diagram, title }) });
753
+ }
754
+ const h = idealHeight(boxW, layout.graphWidth, layout.graphHeight);
755
+ return /* @__PURE__ */ jsxs("div", { ref: containerRef, style: __spreadProps(__spreadValues({}, themeVars(tokens)), { position: "relative", width: "100%", height: h }), onMouseDown: () => setFocused(true), children: [
756
+ /* @__PURE__ */ jsx("style", { children: FLOW_ANIM_CSS }),
757
+ /* @__PURE__ */ jsx(
758
+ ReactFlow,
759
+ {
760
+ nodes,
761
+ edges,
762
+ nodeTypes,
763
+ onNodesChange: onNC,
764
+ onEdgesChange: onEC,
765
+ fitView: true,
766
+ fitViewOptions: { padding: 0.1 },
767
+ nodesDraggable: false,
768
+ nodesConnectable: false,
769
+ elementsSelectable: false,
770
+ panOnDrag: true,
771
+ zoomOnScroll: focused,
772
+ preventScrolling: focused,
773
+ minZoom: 0.2,
774
+ maxZoom: 4,
775
+ proOptions: { hideAttribution: true },
776
+ style: { background: tokens.PAPER, width: "100%", height: "100%", borderRadius: 10 },
777
+ children: /* @__PURE__ */ jsx(Background, { variant: BackgroundVariant.Dots, gap: 20, size: 1, color: tokens.BORDER })
778
+ }
779
+ ),
780
+ /* @__PURE__ */ jsxs("div", { style: { position: "absolute", top: 10, right: 10, zIndex: 10, display: "flex", gap: 6 }, children: [
781
+ /* @__PURE__ */ jsx(FitBtn, {}),
782
+ /* @__PURE__ */ jsxs("button", { style: pillStyle, onClick: () => setFull(true), onMouseEnter: onEnter, onMouseLeave: onLeave, children: [
783
+ /* @__PURE__ */ jsx(ExpandIcon, {}),
784
+ /* @__PURE__ */ jsx("span", { children: "Expand" })
785
+ ] })
786
+ ] }),
787
+ full && typeof document !== "undefined" && /* @__PURE__ */ jsx(FullscreenModal, { nodes: displayNodes, edges: displayEdges, title, onClose: () => setFull(false) })
788
+ ] });
789
+ }
790
+ function FlowGraph({ diagram, title, autoplay, nodeStates }) {
791
+ return /* @__PURE__ */ jsx(ReactFlowProvider, { children: /* @__PURE__ */ jsx(Inner, { diagram, title, autoplay, nodeStates }) });
792
+ }
793
+ var hDot, FLOW_ANIM_CSS, nodeBase, nodeTypes, pillStyle, onEnter, onLeave, ExpandIcon, CloseIcon, mermaidReady, mermaidSig, renderSeq;
794
+ var init_FlowGraph = __esm({
795
+ "src/composites/flow-canvas/FlowGraph.tsx"() {
796
+ "use client";
797
+ init_ThemeContext();
798
+ init_parseMermaidFlow();
799
+ init_layoutFlow();
800
+ hDot = {
801
+ width: 8,
802
+ height: 8,
803
+ background: "var(--gx-accent)",
804
+ border: "2px solid var(--gx-bg)",
805
+ borderRadius: "50%"
806
+ };
807
+ FLOW_ANIM_CSS = `
808
+ .gx-flow-node{transition:opacity .3s ease,box-shadow .35s ease,border-color .3s ease,background-color .3s ease;}
809
+ .gx-flow-pending{opacity:.45;}
810
+ .gx-flow-active{border-color:var(--gx-accent)!important;background-color:color-mix(in srgb,var(--gx-accent) 9%,#fff)!important;animation:gxFlowPulse 1.5s ease-in-out infinite;}
811
+ .gx-flow-done{border-color:var(--gx-accent)!important;background-color:color-mix(in srgb,var(--gx-accent) 15%,#fff)!important;}
812
+ .gx-flow-error{border-color:#dc2626!important;background-color:#fdecec!important;}
813
+ .gx-flow-poly{transition:stroke .3s ease,fill .3s ease;}
814
+ .gx-flow-active .gx-flow-poly{stroke:var(--gx-accent);fill:color-mix(in srgb,var(--gx-accent) 9%,#fff);}
815
+ .gx-flow-done .gx-flow-poly{stroke:var(--gx-accent);fill:color-mix(in srgb,var(--gx-accent) 15%,#fff);}
816
+ .gx-done-badge{position:absolute;top:-7px;right:-7px;width:15px;height:15px;border-radius:50%;background:var(--gx-accent);color:#fff;display:flex;align-items:center;justify-content:center;z-index:3;box-shadow:0 1px 2px rgba(0,0,0,.2);}
817
+ @keyframes gxFlowPulse{0%,100%{box-shadow:0 0 0 0 color-mix(in srgb,var(--gx-accent) 50%,transparent);}50%{box-shadow:0 0 0 7px color-mix(in srgb,var(--gx-accent) 0%,transparent);}}
818
+ @media (prefers-reduced-motion: reduce){.gx-flow-active{animation:none;}}
819
+ `;
820
+ nodeBase = {
821
+ position: "relative",
822
+ background: "var(--gx-bg)",
823
+ color: "var(--gx-text)",
824
+ border: "1.5px solid var(--gx-outline)",
825
+ fontFamily: "var(--gx-font)",
826
+ fontSize: "12px",
827
+ fontWeight: 500,
828
+ display: "flex",
829
+ alignItems: "center",
830
+ justifyContent: "center",
831
+ textAlign: "center",
832
+ padding: "8px 14px",
833
+ width: "100%",
834
+ height: "100%",
835
+ boxSizing: "border-box",
836
+ userSelect: "none",
837
+ lineHeight: 1.3
838
+ };
839
+ nodeTypes = {
840
+ rect: RectNode,
841
+ rounded: RoundedNode,
842
+ circle: CircleNode,
843
+ diamond: DiamondNode,
844
+ cylinder: CylinderNode
845
+ };
846
+ pillStyle = {
847
+ display: "flex",
848
+ alignItems: "center",
849
+ gap: "5px",
850
+ height: "26px",
851
+ padding: "0 10px",
852
+ background: "rgba(255,255,255,0.9)",
853
+ backdropFilter: "blur(10px)",
854
+ WebkitBackdropFilter: "blur(10px)",
855
+ border: "1px solid var(--gx-border)",
856
+ borderRadius: "100px",
857
+ cursor: "pointer",
858
+ color: "var(--gx-muted)",
859
+ fontSize: "11px",
860
+ fontFamily: "var(--gx-font)",
861
+ fontWeight: 500,
862
+ boxShadow: "0 1px 3px rgba(0,0,0,0.07)",
863
+ transition: "background 0.12s, color 0.12s"
864
+ };
865
+ onEnter = (e) => {
866
+ e.currentTarget.style.background = "var(--gx-bg)";
867
+ e.currentTarget.style.color = "var(--gx-text)";
868
+ };
869
+ onLeave = (e) => {
870
+ e.currentTarget.style.background = "rgba(255,255,255,0.9)";
871
+ e.currentTarget.style.color = "var(--gx-muted)";
872
+ };
873
+ ExpandIcon = () => /* @__PURE__ */ jsx("svg", { width: "11", height: "11", viewBox: "0 0 11 11", fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", children: /* @__PURE__ */ jsx("path", { d: "M1 4V1h3M7 1h3v3M10 7v3H7M4 10H1V7" }) });
874
+ CloseIcon = () => /* @__PURE__ */ jsxs("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", children: [
875
+ /* @__PURE__ */ jsx("line", { x1: "1", y1: "1", x2: "9", y2: "9" }),
876
+ /* @__PURE__ */ jsx("line", { x1: "9", y1: "1", x2: "1", y2: "9" })
877
+ ] });
878
+ mermaidReady = false;
879
+ mermaidSig = "";
880
+ renderSeq = 0;
881
+ }
882
+ });
883
+
884
+ // src/shared/ColumnSettingsPanel.tsx
885
+ init_theme();
886
+ function ColumnSettingsPanel({ columns, hidden, onToggle, onShowAll, onHideAll }) {
887
+ return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "6px", minWidth: "180px" }, children: [
888
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", justifyContent: "space-between", paddingBottom: "4px", borderBottom: `1px solid ${BORDER}` }, children: [
889
+ /* @__PURE__ */ jsx(
890
+ "button",
891
+ {
892
+ onClick: onShowAll,
893
+ style: { background: "none", border: "none", cursor: "pointer", fontSize: "11px", color: ACCENT, fontWeight: 500, padding: 0 },
894
+ children: "Show all"
895
+ }
896
+ ),
897
+ /* @__PURE__ */ jsx(
898
+ "button",
899
+ {
900
+ onClick: onHideAll,
901
+ style: { background: "none", border: "none", cursor: "pointer", fontSize: "11px", color: MUTED, fontWeight: 500, padding: 0 },
902
+ children: "Hide all"
903
+ }
904
+ )
905
+ ] }),
906
+ columns.map((col) => /* @__PURE__ */ jsxs(
907
+ "label",
908
+ {
909
+ style: { display: "flex", alignItems: "center", gap: "8px", cursor: "pointer", fontSize: "12px", color: "var(--foreground)" },
910
+ children: [
911
+ /* @__PURE__ */ jsx(
912
+ "input",
913
+ {
914
+ type: "checkbox",
915
+ checked: !hidden.has(col.key),
916
+ onChange: () => onToggle(col.key),
917
+ style: { accentColor: ACCENT, width: "14px", height: "14px", margin: 0, cursor: "pointer" }
918
+ }
919
+ ),
920
+ col.label
921
+ ]
922
+ },
923
+ col.key
924
+ ))
925
+ ] });
926
+ }
927
+
928
+ // src/shared/ComponentActions.tsx
929
+ init_theme();
930
+ var DOT_COLOR = "#aaaaaa";
931
+ var DOT_HOVER = "#555555";
932
+ function ComponentActions({ children, onDownloadCSV, columnConfig, filename = "component" }) {
933
+ const [open, setOpen] = useState(false);
934
+ const [view, setView] = useState("main");
935
+ const contentRef = useRef(null);
936
+ const menuRef = useRef(null);
937
+ const btnRef = useRef(null);
938
+ const close = useCallback(() => {
939
+ setOpen(false);
940
+ setView("main");
941
+ }, []);
942
+ useEffect(() => {
943
+ if (!open) return;
944
+ const handler = (e) => {
945
+ var _a, _b;
946
+ if ((_a = menuRef.current) == null ? void 0 : _a.contains(e.target)) return;
947
+ if ((_b = btnRef.current) == null ? void 0 : _b.contains(e.target)) return;
948
+ close();
949
+ };
950
+ document.addEventListener("mousedown", handler);
951
+ return () => document.removeEventListener("mousedown", handler);
952
+ }, [open, close]);
953
+ const handleDownloadPNG = useCallback(async () => {
954
+ if (!contentRef.current) return;
955
+ try {
956
+ const url = await toPng(contentRef.current, { backgroundColor: "white", pixelRatio: 2 });
957
+ const a = document.createElement("a");
958
+ a.href = url;
959
+ a.download = `${filename}.png`;
960
+ a.click();
961
+ } catch (e) {
962
+ }
963
+ close();
964
+ }, [filename, close]);
965
+ const handleCSV = useCallback(() => {
966
+ onDownloadCSV == null ? void 0 : onDownloadCSV();
967
+ close();
968
+ }, [onDownloadCSV, close]);
969
+ return /* @__PURE__ */ jsxs("div", { style: { width: "100%", display: "flex", flexDirection: "column" }, children: [
970
+ /* @__PURE__ */ jsx("div", { ref: contentRef, style: { width: "100%" }, children }),
971
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", justifyContent: "flex-end", marginTop: "4px", position: "relative", zIndex: 10, flexShrink: 0 }, children: [
972
+ /* @__PURE__ */ jsx(
973
+ "button",
974
+ {
975
+ ref: btnRef,
976
+ onClick: () => {
977
+ setOpen((o) => !o);
978
+ setView("main");
979
+ },
980
+ "aria-label": "Component actions",
981
+ style: {
982
+ background: "none",
983
+ border: "none",
984
+ cursor: "pointer",
985
+ padding: "4px 8px",
986
+ display: "flex",
987
+ gap: "3px",
988
+ alignItems: "center",
989
+ borderRadius: "6px",
990
+ transition: "background 0.15s"
991
+ },
992
+ onMouseEnter: (e) => {
993
+ e.currentTarget.style.background = "#f2f2f2";
994
+ e.currentTarget.querySelectorAll("circle").forEach((c) => c.style.fill = DOT_HOVER);
995
+ },
996
+ onMouseLeave: (e) => {
997
+ e.currentTarget.style.background = "none";
998
+ e.currentTarget.querySelectorAll("circle").forEach((c) => c.style.fill = DOT_COLOR);
999
+ },
1000
+ children: /* @__PURE__ */ jsxs("svg", { width: "20", height: "6", viewBox: "0 0 20 6", children: [
1001
+ /* @__PURE__ */ jsx("circle", { cx: "3", cy: "3", r: "2", style: { fill: DOT_COLOR, transition: "fill 0.15s" } }),
1002
+ /* @__PURE__ */ jsx("circle", { cx: "10", cy: "3", r: "2", style: { fill: DOT_COLOR, transition: "fill 0.15s" } }),
1003
+ /* @__PURE__ */ jsx("circle", { cx: "17", cy: "3", r: "2", style: { fill: DOT_COLOR, transition: "fill 0.15s" } })
1004
+ ] })
1005
+ }
1006
+ ),
1007
+ open && /* @__PURE__ */ jsx(
1008
+ "div",
1009
+ {
1010
+ ref: menuRef,
1011
+ style: {
1012
+ position: "absolute",
1013
+ bottom: "100%",
1014
+ right: 0,
1015
+ marginBottom: "4px",
1016
+ background: "white",
1017
+ border: `1px solid ${BORDER}`,
1018
+ borderRadius: "0.75rem",
1019
+ boxShadow: "0 4px 12px rgba(0,0,0,0.06)",
1020
+ zIndex: 50,
1021
+ padding: view === "columns" ? "10px" : "4px",
1022
+ minWidth: view === "columns" ? "200px" : "160px"
1023
+ },
1024
+ children: view === "main" ? /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column" }, children: [
1025
+ columnConfig && /* @__PURE__ */ jsx(MenuButton, { label: "Customize columns", onClick: () => setView("columns") }),
1026
+ onDownloadCSV && /* @__PURE__ */ jsx(MenuButton, { label: "Download CSV", onClick: handleCSV }),
1027
+ /* @__PURE__ */ jsx(MenuButton, { label: "Download PNG", onClick: handleDownloadPNG })
1028
+ ] }) : /* @__PURE__ */ jsxs("div", { children: [
1029
+ /* @__PURE__ */ jsx(
1030
+ "button",
1031
+ {
1032
+ onClick: () => setView("main"),
1033
+ style: { background: "none", border: "none", cursor: "pointer", fontSize: "11px", color: MUTED, marginBottom: "6px", padding: 0 },
1034
+ children: "\u2190 Back"
1035
+ }
1036
+ ),
1037
+ /* @__PURE__ */ jsx(
1038
+ ColumnSettingsPanel,
1039
+ {
1040
+ columns: columnConfig.columns,
1041
+ hidden: columnConfig.hidden,
1042
+ onToggle: columnConfig.onToggle,
1043
+ onShowAll: columnConfig.onShowAll,
1044
+ onHideAll: columnConfig.onHideAll
1045
+ }
1046
+ )
1047
+ ] })
1048
+ }
1049
+ )
1050
+ ] })
1051
+ ] });
1052
+ }
1053
+ function MenuButton({ label, onClick }) {
1054
+ return /* @__PURE__ */ jsx(
1055
+ "button",
1056
+ {
1057
+ onClick,
1058
+ style: {
1059
+ background: "none",
1060
+ border: "none",
1061
+ cursor: "pointer",
1062
+ padding: "8px 12px",
1063
+ fontSize: "12.5px",
1064
+ color: "var(--foreground)",
1065
+ textAlign: "left",
1066
+ borderRadius: "8px",
1067
+ transition: "background 0.15s",
1068
+ whiteSpace: "nowrap"
1069
+ },
1070
+ onMouseEnter: (e) => e.currentTarget.style.background = "#f2f2f2",
1071
+ onMouseLeave: (e) => e.currentTarget.style.background = "none",
1072
+ children: label
1073
+ }
1074
+ );
1075
+ }
1076
+
1077
+ // src/composites/flow-canvas/resolver.tsx
1078
+ init_ThemeContext();
1079
+ var FlowGraph2 = React4.lazy(
1080
+ () => Promise.resolve().then(() => (init_FlowGraph(), FlowGraph_exports)).then((m) => ({ default: m.FlowGraph }))
1081
+ );
1082
+ function FlowCanvasRenderer({
1083
+ diagram,
1084
+ title,
1085
+ description,
1086
+ streaming = false,
1087
+ autoplay,
1088
+ nodeStates
1089
+ }) {
1090
+ const { ACCENT: ACCENT2, BORDER: BORDER2, MUTED: MUTED2, PAPER: PAPER2 } = useTheme();
1091
+ return /* @__PURE__ */ jsxs("div", { style: { width: "100%", display: "flex", flexDirection: "column", gap: "8px" }, children: [
1092
+ (title || streaming) && /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
1093
+ title && /* @__PURE__ */ jsx("p", { style: {
1094
+ fontFamily: "var(--font-serif)",
1095
+ fontSize: "15px",
1096
+ fontWeight: 600,
1097
+ color: "var(--foreground)",
1098
+ letterSpacing: "-0.005em",
1099
+ margin: 0
1100
+ }, children: title }),
1101
+ streaming && /* @__PURE__ */ jsx("span", { style: {
1102
+ display: "inline-block",
1103
+ width: "7px",
1104
+ height: "7px",
1105
+ borderRadius: "50%",
1106
+ background: ACCENT2,
1107
+ animation: "canvasPulse 1.2s ease-in-out infinite",
1108
+ flexShrink: 0
1109
+ } })
1110
+ ] }),
1111
+ description && !streaming && /* @__PURE__ */ jsx("p", { style: { fontSize: "12.5px", color: "#888888", margin: 0, fontFamily: "var(--font-sans)" }, children: description }),
1112
+ /* @__PURE__ */ jsx("div", { style: __spreadValues({
1113
+ width: "100%",
1114
+ borderRadius: "0.75rem",
1115
+ border: `1px solid ${BORDER2}`,
1116
+ boxShadow: "0 1px 2px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.05)",
1117
+ overflow: "hidden",
1118
+ background: "#ffffff",
1119
+ position: "relative"
1120
+ }, diagram ? {} : { height: "320px" }), children: diagram ? /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(FlowGraph2, { diagram, title, autoplay, nodeStates }) }) : /* @__PURE__ */ jsx("div", { style: {
1121
+ position: "absolute",
1122
+ inset: 0,
1123
+ display: "flex",
1124
+ alignItems: "center",
1125
+ justifyContent: "center"
1126
+ }, children: /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", gap: "12px" }, children: [
1127
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", gap: "5px" }, children: [0, 1, 2].map((i) => /* @__PURE__ */ jsx("span", { style: {
1128
+ width: "6px",
1129
+ height: "6px",
1130
+ borderRadius: "50%",
1131
+ background: ACCENT2,
1132
+ display: "inline-block",
1133
+ animation: `bounce 1s ease-in-out ${i * 0.18}s infinite`
1134
+ } }, i)) }),
1135
+ /* @__PURE__ */ jsx("span", { style: { fontSize: "12px", color: "#888888", fontFamily: "var(--font-sans)" }, children: "Drawing diagram\u2026" })
1136
+ ] }) }) }),
1137
+ /* @__PURE__ */ jsx("style", { children: `
1138
+ @keyframes canvasPulse {
1139
+ 0%, 100% { opacity: 1; transform: scale(1); }
1140
+ 50% { opacity: 0.4; transform: scale(0.75); }
1141
+ }
1142
+
1143
+ /* \u2500\u2500 Mermaid output container \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
1144
+ /* Centering + padding handled by the shared Viewport; let the svg size
1145
+ naturally so fit-to-view can scale it. */
1146
+ .mermaid-output {
1147
+ display: flex;
1148
+ align-items: flex-start;
1149
+ justify-content: center;
1150
+ width: 100%;
1151
+ box-sizing: border-box;
1152
+ padding: 24px 20px;
1153
+ }
1154
+ .mermaid-output svg { display: block; max-width: 100%; height: auto; }
1155
+
1156
+ /* \u2500\u2500 All SVG text \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
1157
+ .mermaid-output text,
1158
+ .mermaid-output text tspan {
1159
+ font-family: Figtree, system-ui, sans-serif !important;
1160
+ font-size: 12px !important;
1161
+ fill: #111111 !important;
1162
+ }
1163
+
1164
+ /* \u2500\u2500 Flowchart: node shapes \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
1165
+ .mermaid-output .node rect,
1166
+ .mermaid-output .node circle,
1167
+ .mermaid-output .node ellipse,
1168
+ .mermaid-output .node polygon,
1169
+ .mermaid-output .node path {
1170
+ stroke: #111111 !important;
1171
+ stroke-width: 2 !important;
1172
+ }
1173
+
1174
+ /* \u2500\u2500 Edges / arrows \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
1175
+ .mermaid-output .edgePath .path,
1176
+ .mermaid-output .flowchart-link {
1177
+ stroke: ${ACCENT2} !important;
1178
+ stroke-width: 2 !important;
1179
+ }
1180
+ .mermaid-output marker path {
1181
+ fill: ${ACCENT2} !important;
1182
+ stroke: ${ACCENT2} !important;
1183
+ }
1184
+ .mermaid-output .edgeLabel rect {
1185
+ fill: #ffffff !important;
1186
+ stroke: none !important;
1187
+ }
1188
+ .mermaid-output .edgeLabel text,
1189
+ .mermaid-output .edgeLabel text tspan {
1190
+ fill: ${MUTED2} !important;
1191
+ font-size: 11px !important;
1192
+ }
1193
+
1194
+ /* \u2500\u2500 Clusters / subgraphs \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
1195
+ .mermaid-output .cluster rect {
1196
+ fill: ${PAPER2} !important;
1197
+ stroke: ${BORDER2} !important;
1198
+ stroke-width: 2 !important;
1199
+ }
1200
+ .mermaid-output .cluster text,
1201
+ .mermaid-output .cluster text tspan {
1202
+ font-size: 10px !important;
1203
+ font-weight: 600 !important;
1204
+ letter-spacing: 0.05em !important;
1205
+ fill: ${MUTED2} !important;
1206
+ text-transform: uppercase !important;
1207
+ }
1208
+
1209
+ /* \u2500\u2500 Sequence diagrams \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
1210
+ .mermaid-output .actor {
1211
+ fill: #ffffff !important;
1212
+ stroke: #111111 !important;
1213
+ stroke-width: 2 !important;
1214
+ }
1215
+ .mermaid-output line.actor-line {
1216
+ stroke: ${ACCENT2} !important;
1217
+ stroke-width: 1.5 !important;
1218
+ stroke-dasharray: 5 4 !important;
1219
+ }
1220
+ .mermaid-output .messageLine0,
1221
+ .mermaid-output .messageLine1 {
1222
+ stroke: ${ACCENT2} !important;
1223
+ stroke-width: 2 !important;
1224
+ }
1225
+ .mermaid-output .note {
1226
+ fill: #fef8e7 !important;
1227
+ stroke: #e0c97c !important;
1228
+ stroke-width: 2 !important;
1229
+ }
1230
+ .mermaid-output .activation0,
1231
+ .mermaid-output .activation1 {
1232
+ fill: #fef3c7 !important;
1233
+ stroke: ${ACCENT2} !important;
1234
+ stroke-width: 2 !important;
1235
+ }
1236
+ .mermaid-output .loopLine {
1237
+ stroke: ${BORDER2} !important;
1238
+ stroke-dasharray: 4 4 !important;
1239
+ }
1240
+
1241
+ /* \u2500\u2500 ER diagrams \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
1242
+ .mermaid-output .er.entityBox {
1243
+ fill: #ffffff !important;
1244
+ stroke: #111111 !important;
1245
+ stroke-width: 2 !important;
1246
+ }
1247
+ .mermaid-output .er.relationshipLine {
1248
+ stroke: ${ACCENT2} !important;
1249
+ stroke-width: 2 !important;
1250
+ }
1251
+ .mermaid-output .er.reltext tspan {
1252
+ fill: ${MUTED2} !important;
1253
+ font-size: 11px !important;
1254
+ }
1255
+
1256
+ /* \u2500\u2500 Class diagrams \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
1257
+ .mermaid-output g.classGroup rect {
1258
+ fill: #ffffff !important;
1259
+ stroke: #111111 !important;
1260
+ stroke-width: 2 !important;
1261
+ }
1262
+ .mermaid-output .relation {
1263
+ stroke: ${ACCENT2} !important;
1264
+ stroke-width: 2 !important;
1265
+ }
1266
+ ` })
1267
+ ] });
1268
+ }
1269
+ function FlowCanvasResolver(p) {
1270
+ var _a;
1271
+ const { ACCENT: ACCENT2, BORDER: BORDER2 } = useTheme();
1272
+ return /* @__PURE__ */ jsx(ComponentActions, { filename: (_a = p.title) != null ? _a : "flow-canvas", children: /* @__PURE__ */ jsx(
1273
+ FlowCanvasRenderer,
1274
+ {
1275
+ diagram: p.diagram,
1276
+ title: p.title,
1277
+ description: p.description,
1278
+ streaming: false,
1279
+ autoplay: p.autoplay,
1280
+ nodeStates: p.node_states
1281
+ }
1282
+ ) });
1283
+ }
1284
+
1285
+ export { FlowCanvasRenderer, FlowCanvasResolver };
1286
+ //# sourceMappingURL=resolver.js.map
1287
+ //# sourceMappingURL=resolver.js.map