@brainfish-ai/components 0.14.2 → 0.15.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (255) hide show
  1. package/dist/accordion.d.ts +12 -0
  2. package/dist/badge.d.ts +14 -0
  3. package/dist/button.d.ts +16 -0
  4. package/dist/calendar.d.ts +12 -0
  5. package/dist/card.d.ts +17 -0
  6. package/dist/chat-search.d.ts +424 -0
  7. package/dist/collapsible.d.ts +10 -0
  8. package/dist/{colors/index.d.ts → colors.d.ts} +133 -128
  9. package/dist/{components/combobox/combobox.d.ts → combobox.d.ts} +23 -18
  10. package/dist/command.d.ts +90 -0
  11. package/dist/data-table.d.ts +23 -0
  12. package/dist/{components/date-picker/date-picker.d.ts → date-picker.d.ts} +12 -9
  13. package/dist/dialog.d.ts +30 -0
  14. package/dist/div-button.d.ts +16 -0
  15. package/dist/dropdown-menu.d.ts +43 -0
  16. package/dist/esm/chunks/{ChatSearch.BVivOuWt.js → ChatSearch.nXLnU6TL.js} +7 -4
  17. package/dist/esm/chunks/ChatSearch.nXLnU6TL.js.map +1 -0
  18. package/dist/esm/chunks/{FormattedMessage.C7CKFL5X.js → FormattedMessage.aTY_CSO9.js} +3 -8
  19. package/dist/esm/chunks/{FormattedMessage.C7CKFL5X.js.map → FormattedMessage.aTY_CSO9.js.map} +1 -1
  20. package/dist/esm/chunks/_basePickBy-BRd8bulh.BihFF1eU.js +140 -0
  21. package/dist/esm/chunks/_basePickBy-BRd8bulh.BihFF1eU.js.map +1 -0
  22. package/dist/esm/chunks/_baseUniq-CjJl2kgN.C3Wg6Gzv.js +585 -0
  23. package/dist/esm/chunks/_baseUniq-CjJl2kgN.C3Wg6Gzv.js.map +1 -0
  24. package/dist/esm/chunks/_commonjsHelpers.BFTU3MAI.js +8 -0
  25. package/dist/esm/chunks/_commonjsHelpers.BFTU3MAI.js.map +1 -0
  26. package/dist/esm/chunks/arc-BwUz6pB-.CLjvikE5.js +84 -0
  27. package/dist/esm/chunks/arc-BwUz6pB-.CLjvikE5.js.map +1 -0
  28. package/dist/esm/chunks/architectureDiagram-W76B3OCA-Cb5kazGQ.1bO-o28W.js +4662 -0
  29. package/dist/esm/chunks/architectureDiagram-W76B3OCA-Cb5kazGQ.1bO-o28W.js.map +1 -0
  30. package/dist/esm/chunks/blockDiagram-QIGZ2CNN-DDf1fn8j.CbGMaSk6.js +2262 -0
  31. package/dist/esm/chunks/blockDiagram-QIGZ2CNN-DDf1fn8j.CbGMaSk6.js.map +1 -0
  32. package/dist/esm/chunks/c4Diagram-FPNF74CW-Bums6QOx.Cr4gEhB6.js +1581 -0
  33. package/dist/esm/chunks/c4Diagram-FPNF74CW-Bums6QOx.Cr4gEhB6.js.map +1 -0
  34. package/dist/esm/chunks/channel-0GCo3iLB.B41ZW7VC.js +6 -0
  35. package/dist/esm/chunks/channel-0GCo3iLB.B41ZW7VC.js.map +1 -0
  36. package/dist/esm/chunks/chunk-4BX2VUAB-BNEZvE0o.BzF9LZVo.js +9 -0
  37. package/dist/esm/chunks/chunk-4BX2VUAB-BNEZvE0o.BzF9LZVo.js.map +1 -0
  38. package/dist/esm/chunks/chunk-55IACEB6-DKe9mqg4.BScGh1GA.js +9 -0
  39. package/dist/esm/chunks/chunk-55IACEB6-DKe9mqg4.BScGh1GA.js.map +1 -0
  40. package/dist/esm/chunks/chunk-FMBD7UC4-crQF-lvP.eIOmyWTR.js +20 -0
  41. package/dist/esm/chunks/chunk-FMBD7UC4-crQF-lvP.eIOmyWTR.js.map +1 -0
  42. package/dist/esm/chunks/chunk-K7UQS3LO-Cfwyr-vZ.BAoAWAQk.js +1373 -0
  43. package/dist/esm/chunks/chunk-K7UQS3LO-Cfwyr-vZ.BAoAWAQk.js.map +1 -0
  44. package/dist/esm/chunks/chunk-QN33PNHL-DspJEonH.BH03Z53b.js +20 -0
  45. package/dist/esm/chunks/chunk-QN33PNHL-DspJEonH.BH03Z53b.js.map +1 -0
  46. package/dist/esm/chunks/chunk-QZHKN3VN-BCAuXuhM.Yv71fggY.js +16 -0
  47. package/dist/esm/chunks/chunk-QZHKN3VN-BCAuXuhM.Yv71fggY.js.map +1 -0
  48. package/dist/esm/chunks/chunk-TVAH2DTR-UAGFGTWa.DtaXLvO3.js +1368 -0
  49. package/dist/esm/chunks/chunk-TVAH2DTR-UAGFGTWa.DtaXLvO3.js.map +1 -0
  50. package/dist/esm/chunks/chunk-TZMSLE5B-BuOZ_3Ji.DWg5e95b.js +59 -0
  51. package/dist/esm/chunks/chunk-TZMSLE5B-BuOZ_3Ji.DWg5e95b.js.map +1 -0
  52. package/dist/esm/chunks/classDiagram-KNZD7YFC-DX7nurcU.CyPH6UHq.js +17 -0
  53. package/dist/esm/chunks/classDiagram-KNZD7YFC-DX7nurcU.CyPH6UHq.js.map +1 -0
  54. package/dist/esm/chunks/classDiagram-v2-RKCZMP56-DX7nurcU.CyPH6UHq.js +17 -0
  55. package/dist/esm/chunks/classDiagram-v2-RKCZMP56-DX7nurcU.CyPH6UHq.js.map +1 -0
  56. package/dist/esm/chunks/clone-Bqjztgu2.BFjA-F4h.js +9 -0
  57. package/dist/esm/chunks/clone-Bqjztgu2.BFjA-F4h.js.map +1 -0
  58. package/dist/esm/chunks/cose-bilkent-S5V4N54A-BQHziyWw.BZGNVFdw.js +2610 -0
  59. package/dist/esm/chunks/cose-bilkent-S5V4N54A-BQHziyWw.BZGNVFdw.js.map +1 -0
  60. package/dist/esm/chunks/cytoscape.esm-qgs_QMrm.Cg6eOcD7.js +18633 -0
  61. package/dist/esm/chunks/cytoscape.esm-qgs_QMrm.Cg6eOcD7.js.map +1 -0
  62. package/dist/esm/chunks/dagre-5GWH7T2D-lsJD5N-w.B1kdVc5w.js +445 -0
  63. package/dist/esm/chunks/dagre-5GWH7T2D-lsJD5N-w.B1kdVc5w.js.map +1 -0
  64. package/dist/esm/chunks/defaultLocale-D7EN2tov.B8F577Sx.js +168 -0
  65. package/dist/esm/chunks/defaultLocale-D7EN2tov.B8F577Sx.js.map +1 -0
  66. package/dist/esm/chunks/diagram-N5W7TBWH-BRbQQdVg.CLbXQp4w.js +533 -0
  67. package/dist/esm/chunks/diagram-N5W7TBWH-BRbQQdVg.CLbXQp4w.js.map +1 -0
  68. package/dist/esm/chunks/diagram-QEK2KX5R-8l9h9zsj.DLBRL8pH.js +218 -0
  69. package/dist/esm/chunks/diagram-QEK2KX5R-8l9h9zsj.DLBRL8pH.js.map +1 -0
  70. package/dist/esm/chunks/diagram-S2PKOQOG-Cqv8fzC4.BsV-iXxM.js +143 -0
  71. package/dist/esm/chunks/diagram-S2PKOQOG-Cqv8fzC4.BsV-iXxM.js.map +1 -0
  72. package/dist/esm/chunks/erDiagram-AWTI2OKA-CuacxCQc.BRxf9Bvb.js +842 -0
  73. package/dist/esm/chunks/erDiagram-AWTI2OKA-CuacxCQc.BRxf9Bvb.js.map +1 -0
  74. package/dist/esm/chunks/flowDiagram-PVAE7QVJ-CYALWpXg.DIYz6l2w.js +1621 -0
  75. package/dist/esm/chunks/flowDiagram-PVAE7QVJ-CYALWpXg.DIYz6l2w.js.map +1 -0
  76. package/dist/esm/chunks/ganttDiagram-OWAHRB6G-DasKdnJE.Dl2sI2Nk.js +2506 -0
  77. package/dist/esm/chunks/ganttDiagram-OWAHRB6G-DasKdnJE.Dl2sI2Nk.js.map +1 -0
  78. package/dist/esm/chunks/gitGraphDiagram-NY62KEGX-CBXt0yuv.mD35jpPG.js +700 -0
  79. package/dist/esm/chunks/gitGraphDiagram-NY62KEGX-CBXt0yuv.mD35jpPG.js.map +1 -0
  80. package/dist/esm/chunks/graph-DuS579Mj.CVtaKNIJ.js +248 -0
  81. package/dist/esm/chunks/graph-DuS579Mj.CVtaKNIJ.js.map +1 -0
  82. package/dist/esm/chunks/infoDiagram-STP46IZ2-D6dOD0xH.BLhsKnwz.js +25 -0
  83. package/dist/esm/chunks/infoDiagram-STP46IZ2-D6dOD0xH.BLhsKnwz.js.map +1 -0
  84. package/dist/esm/chunks/init-DjUOC4st.BOEiyheD.js +16 -0
  85. package/dist/esm/chunks/init-DjUOC4st.BOEiyheD.js.map +1 -0
  86. package/dist/esm/chunks/journeyDiagram-BIP6EPQ6-BVvhjpLT.Cy1B2LuZ.js +837 -0
  87. package/dist/esm/chunks/journeyDiagram-BIP6EPQ6-BVvhjpLT.Cy1B2LuZ.js.map +1 -0
  88. package/dist/esm/chunks/kanban-definition-6OIFK2YF-DXUNU6e4.YiYgNKI6.js +720 -0
  89. package/dist/esm/chunks/kanban-definition-6OIFK2YF-DXUNU6e4.YiYgNKI6.js.map +1 -0
  90. package/dist/esm/chunks/katex-CUSbq6rG.R-nwQ7Gi.js +11679 -0
  91. package/dist/esm/chunks/katex-CUSbq6rG.R-nwQ7Gi.js.map +1 -0
  92. package/dist/esm/chunks/layout-C51Wxzwk.D_mfdH7L.js +1322 -0
  93. package/dist/esm/chunks/layout-C51Wxzwk.D_mfdH7L.js.map +1 -0
  94. package/dist/esm/chunks/linear-CHlV0TT4.CvsRyKtq.js +256 -0
  95. package/dist/esm/chunks/linear-CHlV0TT4.CvsRyKtq.js.map +1 -0
  96. package/dist/esm/chunks/markdownTranslator-D7_8pMsF.-EYyJrCs.js +15985 -0
  97. package/dist/esm/chunks/markdownTranslator-D7_8pMsF.-EYyJrCs.js.map +1 -0
  98. package/dist/esm/chunks/mermaid.core-C5kBD6J-.BXPxVcVa.js +15491 -0
  99. package/dist/esm/chunks/mermaid.core-C5kBD6J-.BXPxVcVa.js.map +1 -0
  100. package/dist/esm/chunks/mindmap-definition-Q6HEUPPD-HFrYx80F.ysRA57eW.js +782 -0
  101. package/dist/esm/chunks/mindmap-definition-Q6HEUPPD-HFrYx80F.ysRA57eW.js.map +1 -0
  102. package/dist/esm/chunks/ordinal-DfAQgscy.J1PPD2vL.js +62 -0
  103. package/dist/esm/chunks/ordinal-DfAQgscy.J1PPD2vL.js.map +1 -0
  104. package/dist/esm/chunks/paragraph-node-C0kBl9gb.CIP8K4ND.js +61421 -0
  105. package/dist/esm/chunks/paragraph-node-C0kBl9gb.CIP8K4ND.js.map +1 -0
  106. package/dist/esm/chunks/pieDiagram-ADFJNKIX-CsslphWO.B4GbWuZv.js +162 -0
  107. package/dist/esm/chunks/pieDiagram-ADFJNKIX-CsslphWO.B4GbWuZv.js.map +1 -0
  108. package/dist/esm/chunks/quadrantDiagram-LMRXKWRM-5QFmGeOP.C_UxDQXe.js +1023 -0
  109. package/dist/esm/chunks/quadrantDiagram-LMRXKWRM-5QFmGeOP.C_UxDQXe.js.map +1 -0
  110. package/dist/esm/chunks/requirementDiagram-4UW4RH46-C22keu8n.C4-dnVVT.js +851 -0
  111. package/dist/esm/chunks/requirementDiagram-4UW4RH46-C22keu8n.C4-dnVVT.js.map +1 -0
  112. package/dist/esm/chunks/sankeyDiagram-GR3RE2ED-BpqD9_-e.ngMCnT6E.js +811 -0
  113. package/dist/esm/chunks/sankeyDiagram-GR3RE2ED-BpqD9_-e.ngMCnT6E.js.map +1 -0
  114. package/dist/esm/chunks/sequenceDiagram-C3RYC4MD-oePYpAJV.CBdzhzsP.js +2512 -0
  115. package/dist/esm/chunks/sequenceDiagram-C3RYC4MD-oePYpAJV.CBdzhzsP.js.map +1 -0
  116. package/dist/esm/chunks/simple-editor.BahVaPV_.js +17657 -0
  117. package/dist/esm/chunks/simple-editor.BahVaPV_.js.map +1 -0
  118. package/dist/esm/chunks/simple-viewer-BRtSPXgb.j1P0rnc3.js +5543 -0
  119. package/dist/esm/chunks/simple-viewer-BRtSPXgb.j1P0rnc3.js.map +1 -0
  120. package/dist/esm/chunks/stateDiagram-KXAO66HF-D4aLegBB.CQf3ipbf.js +264 -0
  121. package/dist/esm/chunks/stateDiagram-KXAO66HF-D4aLegBB.CQf3ipbf.js.map +1 -0
  122. package/dist/esm/chunks/stateDiagram-v2-UMBNRL4Z-EsHlUtVh.KT7g_d3p.js +17 -0
  123. package/dist/esm/chunks/stateDiagram-v2-UMBNRL4Z-EsHlUtVh.KT7g_d3p.js.map +1 -0
  124. package/dist/esm/chunks/timeline-definition-XQNQX7LJ-6YQdnQ9U.CyMubI5o.js +798 -0
  125. package/dist/esm/chunks/timeline-definition-XQNQX7LJ-6YQdnQ9U.CyMubI5o.js.map +1 -0
  126. package/dist/esm/chunks/treemap-75Q7IDZK-vsWUWgT4.STv98gDF.js +12982 -0
  127. package/dist/esm/chunks/treemap-75Q7IDZK-vsWUWgT4.STv98gDF.js.map +1 -0
  128. package/dist/esm/chunks/xychartDiagram-6GGTOJPD-M8ajOOsE.Ds3v-kkT.js +1341 -0
  129. package/dist/esm/chunks/xychartDiagram-6GGTOJPD-M8ajOOsE.Ds3v-kkT.js.map +1 -0
  130. package/dist/esm/components/chat-search.js +1 -1
  131. package/dist/esm/components/markdown-editor-viewer.js +2 -0
  132. package/dist/esm/components/markdown-editor-viewer.js.map +1 -0
  133. package/dist/esm/components/markdown.js +1 -1
  134. package/dist/esm/index.css +1 -1
  135. package/dist/esm/index.js +3 -2
  136. package/dist/esm/index.js.map +1 -1
  137. package/dist/{components/feedback/feedback.d.ts → feedback.d.ts} +21 -17
  138. package/dist/file-upload.d.ts +45 -0
  139. package/dist/{components/filter/types.d.ts → filter.d.ts} +82 -59
  140. package/dist/generating-star.d.ts +10 -0
  141. package/dist/icon.d.ts +26 -0
  142. package/dist/index.d.ts +1204 -28
  143. package/dist/input.d.ts +11 -0
  144. package/dist/label.d.ts +8 -0
  145. package/dist/markdown-editor-viewer.d.ts +113 -0
  146. package/dist/markdown.d.ts +55 -0
  147. package/dist/popover.d.ts +12 -0
  148. package/dist/progress.d.ts +8 -0
  149. package/dist/scroll-area.d.ts +8 -0
  150. package/dist/{components/select/simpleSelect.d.ts → select.d.ts} +20 -15
  151. package/dist/stats.html +1 -1
  152. package/dist/switch.d.ts +6 -0
  153. package/dist/table.d.ts +19 -0
  154. package/dist/textarea.d.ts +5 -0
  155. package/dist/tooltip.d.ts +18 -0
  156. package/dist/{components/two-level-combobox/two-level-combobox.d.ts → two-level-combobox.d.ts} +24 -15
  157. package/markdown-editor.plan.md +322 -0
  158. package/markdown-editor.spec.md +915 -0
  159. package/package.json +23 -4
  160. package/dist/colors/blue.d.ts +0 -13
  161. package/dist/colors/customColor.d.ts +0 -4
  162. package/dist/colors/dark.d.ts +0 -13
  163. package/dist/colors/green.d.ts +0 -13
  164. package/dist/colors/orange.d.ts +0 -13
  165. package/dist/colors/pink.d.ts +0 -13
  166. package/dist/colors/primary.d.ts +0 -20
  167. package/dist/colors/purple.d.ts +0 -13
  168. package/dist/colors/red.d.ts +0 -13
  169. package/dist/colors/yellow.d.ts +0 -13
  170. package/dist/components/chat-search/Answer.d.ts +0 -29
  171. package/dist/components/chat-search/AnswerActions.d.ts +0 -13
  172. package/dist/components/chat-search/AnswerBlock.d.ts +0 -8
  173. package/dist/components/chat-search/ChatSearch.d.ts +0 -11
  174. package/dist/components/chat-search/ChatSearchContext.d.ts +0 -36
  175. package/dist/components/chat-search/FollowUpQuestions.d.ts +0 -7
  176. package/dist/components/chat-search/FollowUpSearchBar.d.ts +0 -11
  177. package/dist/components/chat-search/Header.d.ts +0 -9
  178. package/dist/components/chat-search/LoadingConversation.d.ts +0 -2
  179. package/dist/components/chat-search/LoadingSkeleton.d.ts +0 -6
  180. package/dist/components/chat-search/NextBestActions.d.ts +0 -8
  181. package/dist/components/chat-search/PrimarySearch.d.ts +0 -35
  182. package/dist/components/chat-search/ScrollToBottomArrow.d.ts +0 -6
  183. package/dist/components/chat-search/Suggestions.d.ts +0 -9
  184. package/dist/components/chat-search/TimelineNavigation.d.ts +0 -9
  185. package/dist/components/chat-search/blocks/ActionButtons.d.ts +0 -5
  186. package/dist/components/chat-search/blocks/ActionInputForm.d.ts +0 -20
  187. package/dist/components/chat-search/blocks/MarkdownText.d.ts +0 -8
  188. package/dist/components/chat-search/blocks/utils.d.ts +0 -15
  189. package/dist/components/chat-search/helpers/excuteClientAction.d.ts +0 -9
  190. package/dist/components/chat-search/helpers/nextBestActions.d.ts +0 -7
  191. package/dist/components/chat-search/hooks/index.d.ts +0 -7
  192. package/dist/components/chat-search/hooks/useAccessibleColor.d.ts +0 -1
  193. package/dist/components/chat-search/hooks/useAnswerList.d.ts +0 -217
  194. package/dist/components/chat-search/hooks/useConversationId.d.ts +0 -5
  195. package/dist/components/chat-search/hooks/useConversationLoader.d.ts +0 -17
  196. package/dist/components/chat-search/hooks/useDarkMode.d.ts +0 -1
  197. package/dist/components/chat-search/hooks/useIsChatSearchDirty.d.ts +0 -1
  198. package/dist/components/chat-search/hooks/useScrollManager.d.ts +0 -6
  199. package/dist/components/chat-search/hooks/useSubscriptionManager.d.ts +0 -4
  200. package/dist/components/chat-search/hooks/useUrlManager.d.ts +0 -8
  201. package/dist/components/chat-search/index.d.ts +0 -5
  202. package/dist/components/chat-search/text-config.d.ts +0 -3
  203. package/dist/components/chat-search/theme.d.ts +0 -0
  204. package/dist/components/chat-search/types.d.ts +0 -260
  205. package/dist/components/combobox/index.d.ts +0 -1
  206. package/dist/components/data-table/data-table.d.ts +0 -17
  207. package/dist/components/data-table/index.d.ts +0 -2
  208. package/dist/components/date-picker/index.d.ts +0 -1
  209. package/dist/components/feedback/feedback-reason.d.ts +0 -10
  210. package/dist/components/feedback/index.d.ts +0 -1
  211. package/dist/components/file-upload/file-upload-status.d.ts +0 -17
  212. package/dist/components/file-upload/file-upload.d.ts +0 -4
  213. package/dist/components/file-upload/index.d.ts +0 -4
  214. package/dist/components/file-upload/types.d.ts +0 -18
  215. package/dist/components/file-upload/utils.d.ts +0 -1
  216. package/dist/components/filter/components/CustomValueInput.d.ts +0 -11
  217. package/dist/components/filter/components/MultiSelectDropdown.d.ts +0 -10
  218. package/dist/components/filter/components/SingleSelectDropdown.d.ts +0 -9
  219. package/dist/components/filter/filter.d.ts +0 -6
  220. package/dist/components/filter/filters.d.ts +0 -12
  221. package/dist/components/filter/hooks.d.ts +0 -9
  222. package/dist/components/filter/index.d.ts +0 -3
  223. package/dist/components/generating-star/generating-star.d.ts +0 -6
  224. package/dist/components/generating-star/index.d.ts +0 -2
  225. package/dist/components/markdown/CodeBlock.d.ts +0 -7
  226. package/dist/components/markdown/FormattedMessage.d.ts +0 -14
  227. package/dist/components/markdown/Frame.d.ts +0 -10
  228. package/dist/components/markdown/MemoizedReactMarkdown.d.ts +0 -6
  229. package/dist/components/markdown/MermaidDiagram.d.ts +0 -6
  230. package/dist/components/markdown/ZoomableImage.d.ts +0 -7
  231. package/dist/components/markdown/embeds/Loom.d.ts +0 -7
  232. package/dist/components/markdown/embeds/NativeVideo.d.ts +0 -6
  233. package/dist/components/markdown/embeds/Supademo.d.ts +0 -7
  234. package/dist/components/markdown/embeds/Typeform.d.ts +0 -7
  235. package/dist/components/markdown/embeds/VideoTimeline.d.ts +0 -9
  236. package/dist/components/markdown/embeds/Vimeo.d.ts +0 -7
  237. package/dist/components/markdown/embeds/Wistia.d.ts +0 -7
  238. package/dist/components/markdown/embeds/Youtube.d.ts +0 -7
  239. package/dist/components/markdown/embeds/index.d.ts +0 -9
  240. package/dist/components/markdown/index.d.ts +0 -6
  241. package/dist/components/markdown/utils/codeblock.d.ts +0 -6
  242. package/dist/components/markdown/utils/stripNewLines.d.ts +0 -1
  243. package/dist/components/markdown/utils/urls.d.ts +0 -6
  244. package/dist/components/select/index.d.ts +0 -1
  245. package/dist/components/two-level-combobox/index.d.ts +0 -1
  246. package/dist/env.d.ts +0 -5
  247. package/dist/esm/chunks/ChatSearch.BVivOuWt.js.map +0 -1
  248. package/dist/lib/addUtmParams.d.ts +0 -20
  249. package/dist/lib/api.d.ts +0 -96
  250. package/dist/lib/feature-flags.d.ts +0 -9
  251. package/dist/lib/features.d.ts +0 -3
  252. package/dist/lib/fetchClient.d.ts +0 -19
  253. package/dist/lib/getContentType.d.ts +0 -1
  254. package/dist/lib/hooks.d.ts +0 -15
  255. package/dist/lib/utils.d.ts +0 -8
@@ -0,0 +1,700 @@
1
+ import { t } from './chunk-4BX2VUAB-BNEZvE0o.BzF9LZVo.js';
2
+ import { e } from './chunk-QZHKN3VN-BCAuXuhM.Yv71fggY.js';
3
+ import { _ as p$1, q as py, p as dy, s as uy, g as fy, a as hy, b as cy, l as F$1, c as ut, d as ht, u as oe, C as my, y as ly, k as Kr$1, D as el, E as Ft, F as Eh, G as Gw } from './mermaid.core-C5kBD6J-.BXPxVcVa.js';
4
+ import { S as Sy } from './treemap-75Q7IDZK-vsWUWgT4.STv98gDF.js';
5
+
6
+ var p = {
7
+ NORMAL: 0,
8
+ REVERSE: 1,
9
+ HIGHLIGHT: 2,
10
+ MERGE: 3,
11
+ CHERRY_PICK: 4
12
+ }, hr = Eh.gitGraph, I = /* @__PURE__ */ p$1(() => el({
13
+ ...hr,
14
+ ...Ft().gitGraph
15
+ }), "getConfig"), c = new e(() => {
16
+ const t = I(), r = t.mainBranchName, s = t.mainBranchOrder;
17
+ return {
18
+ mainBranchName: r,
19
+ commits: /* @__PURE__ */ new Map(),
20
+ head: null,
21
+ branchConfig: /* @__PURE__ */ new Map([[r, { name: r, order: s }]]),
22
+ branches: /* @__PURE__ */ new Map([[r, null]]),
23
+ currBranch: r,
24
+ direction: "LR",
25
+ seq: 0,
26
+ options: {}
27
+ };
28
+ });
29
+ function A() {
30
+ return Gw({ length: 7 });
31
+ }
32
+ p$1(A, "getID");
33
+ function F(t, r) {
34
+ const s = /* @__PURE__ */ Object.create(null);
35
+ return t.reduce((n, e) => {
36
+ const a = r(e);
37
+ return s[a] || (s[a] = true, n.push(e)), n;
38
+ }, []);
39
+ }
40
+ p$1(F, "uniqBy");
41
+ var lr = /* @__PURE__ */ p$1(function(t) {
42
+ c.records.direction = t;
43
+ }, "setDirection"), $r = /* @__PURE__ */ p$1(function(t) {
44
+ F$1.debug("options str", t), t = t?.trim(), t = t || "{}";
45
+ try {
46
+ c.records.options = JSON.parse(t);
47
+ } catch (r) {
48
+ F$1.error("error while parsing gitGraph options", r.message);
49
+ }
50
+ }, "setOptions"), fr = /* @__PURE__ */ p$1(function() {
51
+ return c.records.options;
52
+ }, "getOptions"), gr = /* @__PURE__ */ p$1(function(t) {
53
+ let r = t.msg, s = t.id;
54
+ const n = t.type;
55
+ let e = t.tags;
56
+ F$1.info("commit", r, s, n, e), F$1.debug("Entering commit:", r, s, n, e);
57
+ const a = I();
58
+ s = Kr$1.sanitizeText(s, a), r = Kr$1.sanitizeText(r, a), e = e?.map((o) => Kr$1.sanitizeText(o, a));
59
+ const d = {
60
+ id: s || c.records.seq + "-" + A(),
61
+ message: r,
62
+ seq: c.records.seq++,
63
+ type: n ?? p.NORMAL,
64
+ tags: e ?? [],
65
+ parents: c.records.head == null ? [] : [c.records.head.id],
66
+ branch: c.records.currBranch
67
+ };
68
+ c.records.head = d, F$1.info("main branch", a.mainBranchName), c.records.commits.has(d.id) && F$1.warn(`Commit ID ${d.id} already exists`), c.records.commits.set(d.id, d), c.records.branches.set(c.records.currBranch, d.id), F$1.debug("in pushCommit " + d.id);
69
+ }, "commit"), yr = /* @__PURE__ */ p$1(function(t) {
70
+ let r = t.name;
71
+ const s = t.order;
72
+ if (r = Kr$1.sanitizeText(r, I()), c.records.branches.has(r))
73
+ throw new Error(
74
+ `Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`
75
+ );
76
+ c.records.branches.set(r, c.records.head != null ? c.records.head.id : null), c.records.branchConfig.set(r, { name: r, order: s }), z(r), F$1.debug("in createBranch");
77
+ }, "branch"), ur = /* @__PURE__ */ p$1((t) => {
78
+ let r = t.branch, s = t.id;
79
+ const n = t.type, e = t.tags, a = I();
80
+ r = Kr$1.sanitizeText(r, a), s && (s = Kr$1.sanitizeText(s, a));
81
+ const d = c.records.branches.get(c.records.currBranch), o = c.records.branches.get(r), f = d ? c.records.commits.get(d) : void 0, h = o ? c.records.commits.get(o) : void 0;
82
+ if (f && h && f.branch === r)
83
+ throw new Error(`Cannot merge branch '${r}' into itself.`);
84
+ if (c.records.currBranch === r) {
85
+ const i = new Error('Incorrect usage of "merge". Cannot merge a branch to itself');
86
+ throw i.hash = {
87
+ text: `merge ${r}`,
88
+ token: `merge ${r}`,
89
+ expected: ["branch abc"]
90
+ }, i;
91
+ }
92
+ if (f === void 0 || !f) {
93
+ const i = new Error(
94
+ `Incorrect usage of "merge". Current branch (${c.records.currBranch})has no commits`
95
+ );
96
+ throw i.hash = {
97
+ text: `merge ${r}`,
98
+ token: `merge ${r}`,
99
+ expected: ["commit"]
100
+ }, i;
101
+ }
102
+ if (!c.records.branches.has(r)) {
103
+ const i = new Error(
104
+ 'Incorrect usage of "merge". Branch to be merged (' + r + ") does not exist"
105
+ );
106
+ throw i.hash = {
107
+ text: `merge ${r}`,
108
+ token: `merge ${r}`,
109
+ expected: [`branch ${r}`]
110
+ }, i;
111
+ }
112
+ if (h === void 0 || !h) {
113
+ const i = new Error(
114
+ 'Incorrect usage of "merge". Branch to be merged (' + r + ") has no commits"
115
+ );
116
+ throw i.hash = {
117
+ text: `merge ${r}`,
118
+ token: `merge ${r}`,
119
+ expected: ['"commit"']
120
+ }, i;
121
+ }
122
+ if (f === h) {
123
+ const i = new Error('Incorrect usage of "merge". Both branches have same head');
124
+ throw i.hash = {
125
+ text: `merge ${r}`,
126
+ token: `merge ${r}`,
127
+ expected: ["branch abc"]
128
+ }, i;
129
+ }
130
+ if (s && c.records.commits.has(s)) {
131
+ const i = new Error(
132
+ 'Incorrect usage of "merge". Commit with id:' + s + " already exists, use different custom id"
133
+ );
134
+ throw i.hash = {
135
+ text: `merge ${r} ${s} ${n} ${e?.join(" ")}`,
136
+ token: `merge ${r} ${s} ${n} ${e?.join(" ")}`,
137
+ expected: [
138
+ `merge ${r} ${s}_UNIQUE ${n} ${e?.join(" ")}`
139
+ ]
140
+ }, i;
141
+ }
142
+ const $ = o || "", g = {
143
+ id: s || `${c.records.seq}-${A()}`,
144
+ message: `merged branch ${r} into ${c.records.currBranch}`,
145
+ seq: c.records.seq++,
146
+ parents: c.records.head == null ? [] : [c.records.head.id, $],
147
+ branch: c.records.currBranch,
148
+ type: p.MERGE,
149
+ customType: n,
150
+ customId: !!s,
151
+ tags: e ?? []
152
+ };
153
+ c.records.head = g, c.records.commits.set(g.id, g), c.records.branches.set(c.records.currBranch, g.id), F$1.debug(c.records.branches), F$1.debug("in mergeBranch");
154
+ }, "merge"), xr = /* @__PURE__ */ p$1(function(t) {
155
+ let r = t.id, s = t.targetId, n = t.tags, e = t.parent;
156
+ F$1.debug("Entering cherryPick:", r, s, n);
157
+ const a = I();
158
+ if (r = Kr$1.sanitizeText(r, a), s = Kr$1.sanitizeText(s, a), n = n?.map((f) => Kr$1.sanitizeText(f, a)), e = Kr$1.sanitizeText(e, a), !r || !c.records.commits.has(r)) {
159
+ const f = new Error(
160
+ 'Incorrect usage of "cherryPick". Source commit id should exist and provided'
161
+ );
162
+ throw f.hash = {
163
+ text: `cherryPick ${r} ${s}`,
164
+ token: `cherryPick ${r} ${s}`,
165
+ expected: ["cherry-pick abc"]
166
+ }, f;
167
+ }
168
+ const d = c.records.commits.get(r);
169
+ if (d === void 0 || !d)
170
+ throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');
171
+ if (e && !(Array.isArray(d.parents) && d.parents.includes(e)))
172
+ throw new Error(
173
+ "Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit."
174
+ );
175
+ const o = d.branch;
176
+ if (d.type === p.MERGE && !e)
177
+ throw new Error(
178
+ "Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified."
179
+ );
180
+ if (!s || !c.records.commits.has(s)) {
181
+ if (o === c.records.currBranch) {
182
+ const g = new Error(
183
+ 'Incorrect usage of "cherryPick". Source commit is already on current branch'
184
+ );
185
+ throw g.hash = {
186
+ text: `cherryPick ${r} ${s}`,
187
+ token: `cherryPick ${r} ${s}`,
188
+ expected: ["cherry-pick abc"]
189
+ }, g;
190
+ }
191
+ const f = c.records.branches.get(c.records.currBranch);
192
+ if (f === void 0 || !f) {
193
+ const g = new Error(
194
+ `Incorrect usage of "cherry-pick". Current branch (${c.records.currBranch})has no commits`
195
+ );
196
+ throw g.hash = {
197
+ text: `cherryPick ${r} ${s}`,
198
+ token: `cherryPick ${r} ${s}`,
199
+ expected: ["cherry-pick abc"]
200
+ }, g;
201
+ }
202
+ const h = c.records.commits.get(f);
203
+ if (h === void 0 || !h) {
204
+ const g = new Error(
205
+ `Incorrect usage of "cherry-pick". Current branch (${c.records.currBranch})has no commits`
206
+ );
207
+ throw g.hash = {
208
+ text: `cherryPick ${r} ${s}`,
209
+ token: `cherryPick ${r} ${s}`,
210
+ expected: ["cherry-pick abc"]
211
+ }, g;
212
+ }
213
+ const $ = {
214
+ id: c.records.seq + "-" + A(),
215
+ message: `cherry-picked ${d?.message} into ${c.records.currBranch}`,
216
+ seq: c.records.seq++,
217
+ parents: c.records.head == null ? [] : [c.records.head.id, d.id],
218
+ branch: c.records.currBranch,
219
+ type: p.CHERRY_PICK,
220
+ tags: n ? n.filter(Boolean) : [
221
+ `cherry-pick:${d.id}${d.type === p.MERGE ? `|parent:${e}` : ""}`
222
+ ]
223
+ };
224
+ c.records.head = $, c.records.commits.set($.id, $), c.records.branches.set(c.records.currBranch, $.id), F$1.debug(c.records.branches), F$1.debug("in cherryPick");
225
+ }
226
+ }, "cherryPick"), z = /* @__PURE__ */ p$1(function(t) {
227
+ if (t = Kr$1.sanitizeText(t, I()), c.records.branches.has(t)) {
228
+ c.records.currBranch = t;
229
+ const r = c.records.branches.get(c.records.currBranch);
230
+ r === void 0 || !r ? c.records.head = null : c.records.head = c.records.commits.get(r) ?? null;
231
+ } else {
232
+ const r = new Error(
233
+ `Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`
234
+ );
235
+ throw r.hash = {
236
+ text: `checkout ${t}`,
237
+ token: `checkout ${t}`,
238
+ expected: [`branch ${t}`]
239
+ }, r;
240
+ }
241
+ }, "checkout");
242
+ function H(t, r, s) {
243
+ const n = t.indexOf(r);
244
+ n === -1 ? t.push(s) : t.splice(n, 1, s);
245
+ }
246
+ p$1(H, "upsert");
247
+ function P(t) {
248
+ const r = t.reduce((e, a) => e.seq > a.seq ? e : a, t[0]);
249
+ let s = "";
250
+ t.forEach(function(e) {
251
+ e === r ? s += " *" : s += " |";
252
+ });
253
+ const n = [s, r.id, r.seq];
254
+ for (const e in c.records.branches)
255
+ c.records.branches.get(e) === r.id && n.push(e);
256
+ if (F$1.debug(n.join(" ")), r.parents && r.parents.length == 2 && r.parents[0] && r.parents[1]) {
257
+ const e = c.records.commits.get(r.parents[0]);
258
+ H(t, r, e), r.parents[1] && t.push(c.records.commits.get(r.parents[1]));
259
+ } else {
260
+ if (r.parents.length == 0)
261
+ return;
262
+ if (r.parents[0]) {
263
+ const e = c.records.commits.get(r.parents[0]);
264
+ H(t, r, e);
265
+ }
266
+ }
267
+ t = F(t, (e) => e.id), P(t);
268
+ }
269
+ p$1(P, "prettyPrintCommitHistory");
270
+ var pr = /* @__PURE__ */ p$1(function() {
271
+ F$1.debug(c.records.commits);
272
+ const t = N()[0];
273
+ P([t]);
274
+ }, "prettyPrint"), mr = /* @__PURE__ */ p$1(function() {
275
+ c.reset(), ly();
276
+ }, "clear"), br = /* @__PURE__ */ p$1(function() {
277
+ return [...c.records.branchConfig.values()].map((r, s) => r.order !== null && r.order !== void 0 ? r : {
278
+ ...r,
279
+ order: parseFloat(`0.${s}`)
280
+ }).sort((r, s) => (r.order ?? 0) - (s.order ?? 0)).map(({ name: r }) => ({ name: r }));
281
+ }, "getBranchesAsObjArray"), wr = /* @__PURE__ */ p$1(function() {
282
+ return c.records.branches;
283
+ }, "getBranches"), vr = /* @__PURE__ */ p$1(function() {
284
+ return c.records.commits;
285
+ }, "getCommits"), N = /* @__PURE__ */ p$1(function() {
286
+ const t = [...c.records.commits.values()];
287
+ return t.forEach(function(r) {
288
+ F$1.debug(r.id);
289
+ }), t.sort((r, s) => r.seq - s.seq), t;
290
+ }, "getCommitsArray"), Cr = /* @__PURE__ */ p$1(function() {
291
+ return c.records.currBranch;
292
+ }, "getCurrentBranch"), Er = /* @__PURE__ */ p$1(function() {
293
+ return c.records.direction;
294
+ }, "getDirection"), Tr = /* @__PURE__ */ p$1(function() {
295
+ return c.records.head;
296
+ }, "getHead"), S = {
297
+ commitType: p,
298
+ getConfig: I,
299
+ setDirection: lr,
300
+ setOptions: $r,
301
+ getOptions: fr,
302
+ commit: gr,
303
+ branch: yr,
304
+ merge: ur,
305
+ cherryPick: xr,
306
+ checkout: z,
307
+ //reset,
308
+ prettyPrint: pr,
309
+ clear: mr,
310
+ getBranchesAsObjArray: br,
311
+ getBranches: wr,
312
+ getCommits: vr,
313
+ getCommitsArray: N,
314
+ getCurrentBranch: Cr,
315
+ getDirection: Er,
316
+ getHead: Tr,
317
+ setAccTitle: cy,
318
+ getAccTitle: hy,
319
+ getAccDescription: fy,
320
+ setAccDescription: uy,
321
+ setDiagramTitle: dy,
322
+ getDiagramTitle: py
323
+ }, Br = /* @__PURE__ */ p$1((t$1, r) => {
324
+ t(t$1, r), t$1.dir && r.setDirection(t$1.dir);
325
+ for (const s of t$1.statements)
326
+ Lr(s, r);
327
+ }, "populate"), Lr = /* @__PURE__ */ p$1((t, r) => {
328
+ const n = {
329
+ Commit: /* @__PURE__ */ p$1((e) => r.commit(kr(e)), "Commit"),
330
+ Branch: /* @__PURE__ */ p$1((e) => r.branch(Mr(e)), "Branch"),
331
+ Merge: /* @__PURE__ */ p$1((e) => r.merge(Ir(e)), "Merge"),
332
+ Checkout: /* @__PURE__ */ p$1((e) => r.checkout(Rr(e)), "Checkout"),
333
+ CherryPicking: /* @__PURE__ */ p$1((e) => r.cherryPick(Gr(e)), "CherryPicking")
334
+ }[t.$type];
335
+ n ? n(t) : F$1.error(`Unknown statement type: ${t.$type}`);
336
+ }, "parseStatement"), kr = /* @__PURE__ */ p$1((t) => ({
337
+ id: t.id,
338
+ msg: t.message ?? "",
339
+ type: t.type !== void 0 ? p[t.type] : p.NORMAL,
340
+ tags: t.tags ?? void 0
341
+ }), "parseCommit"), Mr = /* @__PURE__ */ p$1((t) => ({
342
+ name: t.name,
343
+ order: t.order ?? 0
344
+ }), "parseBranch"), Ir = /* @__PURE__ */ p$1((t) => ({
345
+ branch: t.branch,
346
+ id: t.id ?? "",
347
+ type: t.type !== void 0 ? p[t.type] : void 0,
348
+ tags: t.tags ?? void 0
349
+ }), "parseMerge"), Rr = /* @__PURE__ */ p$1((t) => t.branch, "parseCheckout"), Gr = /* @__PURE__ */ p$1((t) => ({
350
+ id: t.id,
351
+ targetId: "",
352
+ tags: t.tags?.length === 0 ? void 0 : t.tags,
353
+ parent: t.parent
354
+ }), "parseCherryPicking"), Or = {
355
+ parse: /* @__PURE__ */ p$1(async (t) => {
356
+ const r = await Sy("gitGraph", t);
357
+ F$1.debug(r), Br(r, S);
358
+ }, "parse")
359
+ }, qr = ut(), v = qr?.gitGraph, L = 10, k = 40, E = 4, T = 2, M = 8, b = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map(), O = 30, R = /* @__PURE__ */ new Map(), q = [], B = 0, u = "LR", Ar = /* @__PURE__ */ p$1(() => {
360
+ b.clear(), w.clear(), R.clear(), B = 0, q = [], u = "LR";
361
+ }, "clear"), W = /* @__PURE__ */ p$1((t) => {
362
+ const r = document.createElementNS("http://www.w3.org/2000/svg", "text");
363
+ return (typeof t == "string" ? t.split(/\\n|\n|<br\s*\/?>/gi) : t).forEach((n) => {
364
+ const e = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
365
+ e.setAttributeNS("http://www.w3.org/XML/1998/namespace", "xml:space", "preserve"), e.setAttribute("dy", "1em"), e.setAttribute("x", "0"), e.setAttribute("class", "row"), e.textContent = n.trim(), r.appendChild(e);
366
+ }), r;
367
+ }, "drawText"), j = /* @__PURE__ */ p$1((t) => {
368
+ let r, s, n;
369
+ return u === "BT" ? (s = /* @__PURE__ */ p$1((e, a) => e <= a, "comparisonFunc"), n = 1 / 0) : (s = /* @__PURE__ */ p$1((e, a) => e >= a, "comparisonFunc"), n = 0), t.forEach((e) => {
370
+ const a = u === "TB" || u == "BT" ? w.get(e)?.y : w.get(e)?.x;
371
+ a !== void 0 && s(a, n) && (r = e, n = a);
372
+ }), r;
373
+ }, "findClosestParent"), _r = /* @__PURE__ */ p$1((t) => {
374
+ let r = "", s = 1 / 0;
375
+ return t.forEach((n) => {
376
+ const e = w.get(n).y;
377
+ e <= s && (r = n, s = e);
378
+ }), r || void 0;
379
+ }, "findClosestParentBT"), Hr = /* @__PURE__ */ p$1((t, r, s) => {
380
+ let n = s, e = s;
381
+ const a = [];
382
+ t.forEach((d) => {
383
+ const o = r.get(d);
384
+ if (!o)
385
+ throw new Error(`Commit not found for key ${d}`);
386
+ o.parents.length ? (n = Dr(o), e = Math.max(n, e)) : a.push(o), Fr(o, n);
387
+ }), n = e, a.forEach((d) => {
388
+ zr(d, n, s);
389
+ }), t.forEach((d) => {
390
+ const o = r.get(d);
391
+ if (o?.parents.length) {
392
+ const f = _r(o.parents);
393
+ n = w.get(f).y - k, n <= e && (e = n);
394
+ const h = b.get(o.branch).pos, $ = n - L;
395
+ w.set(o.id, { x: h, y: $ });
396
+ }
397
+ });
398
+ }, "setParallelBTPos"), Pr = /* @__PURE__ */ p$1((t) => {
399
+ const r = j(t.parents.filter((n) => n !== null));
400
+ if (!r)
401
+ throw new Error(`Closest parent not found for commit ${t.id}`);
402
+ const s = w.get(r)?.y;
403
+ if (s === void 0)
404
+ throw new Error(`Closest parent position not found for commit ${t.id}`);
405
+ return s;
406
+ }, "findClosestParentPos"), Dr = /* @__PURE__ */ p$1((t) => Pr(t) + k, "calculateCommitPosition"), Fr = /* @__PURE__ */ p$1((t, r) => {
407
+ const s = b.get(t.branch);
408
+ if (!s)
409
+ throw new Error(`Branch not found for commit ${t.id}`);
410
+ const n = s.pos, e = r + L;
411
+ return w.set(t.id, { x: n, y: e }), { x: n, y: e };
412
+ }, "setCommitPosition"), zr = /* @__PURE__ */ p$1((t, r, s) => {
413
+ const n = b.get(t.branch);
414
+ if (!n)
415
+ throw new Error(`Branch not found for commit ${t.id}`);
416
+ const e = r + s, a = n.pos;
417
+ w.set(t.id, { x: a, y: e });
418
+ }, "setRootPosition"), Nr = /* @__PURE__ */ p$1((t, r, s, n, e, a) => {
419
+ if (a === p.HIGHLIGHT)
420
+ t.append("rect").attr("x", s.x - 10).attr("y", s.y - 10).attr("width", 20).attr("height", 20).attr(
421
+ "class",
422
+ `commit ${r.id} commit-highlight${e % M} ${n}-outer`
423
+ ), t.append("rect").attr("x", s.x - 6).attr("y", s.y - 6).attr("width", 12).attr("height", 12).attr(
424
+ "class",
425
+ `commit ${r.id} commit${e % M} ${n}-inner`
426
+ );
427
+ else if (a === p.CHERRY_PICK)
428
+ t.append("circle").attr("cx", s.x).attr("cy", s.y).attr("r", 10).attr("class", `commit ${r.id} ${n}`), t.append("circle").attr("cx", s.x - 3).attr("cy", s.y + 2).attr("r", 2.75).attr("fill", "#fff").attr("class", `commit ${r.id} ${n}`), t.append("circle").attr("cx", s.x + 3).attr("cy", s.y + 2).attr("r", 2.75).attr("fill", "#fff").attr("class", `commit ${r.id} ${n}`), t.append("line").attr("x1", s.x + 3).attr("y1", s.y + 1).attr("x2", s.x).attr("y2", s.y - 5).attr("stroke", "#fff").attr("class", `commit ${r.id} ${n}`), t.append("line").attr("x1", s.x - 3).attr("y1", s.y + 1).attr("x2", s.x).attr("y2", s.y - 5).attr("stroke", "#fff").attr("class", `commit ${r.id} ${n}`);
429
+ else {
430
+ const d = t.append("circle");
431
+ if (d.attr("cx", s.x), d.attr("cy", s.y), d.attr("r", r.type === p.MERGE ? 9 : 10), d.attr("class", `commit ${r.id} commit${e % M}`), a === p.MERGE) {
432
+ const o = t.append("circle");
433
+ o.attr("cx", s.x), o.attr("cy", s.y), o.attr("r", 6), o.attr(
434
+ "class",
435
+ `commit ${n} ${r.id} commit${e % M}`
436
+ );
437
+ }
438
+ a === p.REVERSE && t.append("path").attr(
439
+ "d",
440
+ `M ${s.x - 5},${s.y - 5}L${s.x + 5},${s.y + 5}M${s.x - 5},${s.y + 5}L${s.x + 5},${s.y - 5}`
441
+ ).attr("class", `commit ${n} ${r.id} commit${e % M}`);
442
+ }
443
+ }, "drawCommitBullet"), Sr = /* @__PURE__ */ p$1((t, r, s, n) => {
444
+ if (r.type !== p.CHERRY_PICK && (r.customId && r.type === p.MERGE || r.type !== p.MERGE) && v?.showCommitLabel) {
445
+ const e = t.append("g"), a = e.insert("rect").attr("class", "commit-label-bkg"), d = e.append("text").attr("x", n).attr("y", s.y + 25).attr("class", "commit-label").text(r.id), o = d.node()?.getBBox();
446
+ if (o && (a.attr("x", s.posWithOffset - o.width / 2 - T).attr("y", s.y + 13.5).attr("width", o.width + 2 * T).attr("height", o.height + 2 * T), u === "TB" || u === "BT" ? (a.attr("x", s.x - (o.width + 4 * E + 5)).attr("y", s.y - 12), d.attr("x", s.x - (o.width + 4 * E)).attr("y", s.y + o.height - 12)) : d.attr("x", s.posWithOffset - o.width / 2), v.rotateCommitLabel))
447
+ if (u === "TB" || u === "BT")
448
+ d.attr(
449
+ "transform",
450
+ "rotate(-45, " + s.x + ", " + s.y + ")"
451
+ ), a.attr(
452
+ "transform",
453
+ "rotate(-45, " + s.x + ", " + s.y + ")"
454
+ );
455
+ else {
456
+ const f = -7.5 - (o.width + 10) / 25 * 9.5, h = 10 + o.width / 25 * 8.5;
457
+ e.attr(
458
+ "transform",
459
+ "translate(" + f + ", " + h + ") rotate(-45, " + n + ", " + s.y + ")"
460
+ );
461
+ }
462
+ }
463
+ }, "drawCommitLabel"), Wr = /* @__PURE__ */ p$1((t, r, s, n) => {
464
+ if (r.tags.length > 0) {
465
+ let e = 0, a = 0, d = 0;
466
+ const o = [];
467
+ for (const f of r.tags.reverse()) {
468
+ const h = t.insert("polygon"), $ = t.append("circle"), g = t.append("text").attr("y", s.y - 16 - e).attr("class", "tag-label").text(f), i = g.node()?.getBBox();
469
+ if (!i)
470
+ throw new Error("Tag bbox not found");
471
+ a = Math.max(a, i.width), d = Math.max(d, i.height), g.attr("x", s.posWithOffset - i.width / 2), o.push({
472
+ tag: g,
473
+ hole: $,
474
+ rect: h,
475
+ yOffset: e
476
+ }), e += 20;
477
+ }
478
+ for (const { tag: f, hole: h, rect: $, yOffset: g } of o) {
479
+ const i = d / 2, y = s.y - 19.2 - g;
480
+ if ($.attr("class", "tag-label-bkg").attr(
481
+ "points",
482
+ `
483
+ ${n - a / 2 - E / 2},${y + T}
484
+ ${n - a / 2 - E / 2},${y - T}
485
+ ${s.posWithOffset - a / 2 - E},${y - i - T}
486
+ ${s.posWithOffset + a / 2 + E},${y - i - T}
487
+ ${s.posWithOffset + a / 2 + E},${y + i + T}
488
+ ${s.posWithOffset - a / 2 - E},${y + i + T}`
489
+ ), h.attr("cy", y).attr("cx", n - a / 2 + E / 2).attr("r", 1.5).attr("class", "tag-hole"), u === "TB" || u === "BT") {
490
+ const x = n + g;
491
+ $.attr("class", "tag-label-bkg").attr(
492
+ "points",
493
+ `
494
+ ${s.x},${x + 2}
495
+ ${s.x},${x - 2}
496
+ ${s.x + L},${x - i - 2}
497
+ ${s.x + L + a + 4},${x - i - 2}
498
+ ${s.x + L + a + 4},${x + i + 2}
499
+ ${s.x + L},${x + i + 2}`
500
+ ).attr("transform", "translate(12,12) rotate(45, " + s.x + "," + n + ")"), h.attr("cx", s.x + E / 2).attr("cy", x).attr("transform", "translate(12,12) rotate(45, " + s.x + "," + n + ")"), f.attr("x", s.x + 5).attr("y", x + 3).attr("transform", "translate(14,14) rotate(45, " + s.x + "," + n + ")");
501
+ }
502
+ }
503
+ }
504
+ }, "drawCommitTags"), jr = /* @__PURE__ */ p$1((t) => {
505
+ switch (t.customType ?? t.type) {
506
+ case p.NORMAL:
507
+ return "commit-normal";
508
+ case p.REVERSE:
509
+ return "commit-reverse";
510
+ case p.HIGHLIGHT:
511
+ return "commit-highlight";
512
+ case p.MERGE:
513
+ return "commit-merge";
514
+ case p.CHERRY_PICK:
515
+ return "commit-cherry-pick";
516
+ default:
517
+ return "commit-normal";
518
+ }
519
+ }, "getCommitClassType"), Yr = /* @__PURE__ */ p$1((t, r, s, n) => {
520
+ const e = { x: 0, y: 0 };
521
+ if (t.parents.length > 0) {
522
+ const a = j(t.parents);
523
+ if (a) {
524
+ const d = n.get(a) ?? e;
525
+ return r === "TB" ? d.y + k : r === "BT" ? (n.get(t.id) ?? e).y - k : d.x + k;
526
+ }
527
+ } else
528
+ return r === "TB" ? O : r === "BT" ? (n.get(t.id) ?? e).y - k : 0;
529
+ return 0;
530
+ }, "calculatePosition"), Kr = /* @__PURE__ */ p$1((t, r, s) => {
531
+ const n = u === "BT" && s ? r : r + L, e = u === "TB" || u === "BT" ? n : b.get(t.branch)?.pos, a = u === "TB" || u === "BT" ? b.get(t.branch)?.pos : n;
532
+ if (a === void 0 || e === void 0)
533
+ throw new Error(`Position were undefined for commit ${t.id}`);
534
+ return { x: a, y: e, posWithOffset: n };
535
+ }, "getCommitPosition"), D = /* @__PURE__ */ p$1((t, r, s) => {
536
+ if (!v)
537
+ throw new Error("GitGraph config not found");
538
+ const n = t.append("g").attr("class", "commit-bullets"), e = t.append("g").attr("class", "commit-labels");
539
+ let a = u === "TB" || u === "BT" ? O : 0;
540
+ const d = [...r.keys()], o = v?.parallelCommits ?? false, f = /* @__PURE__ */ p$1(($, g) => {
541
+ const i = r.get($)?.seq, y = r.get(g)?.seq;
542
+ return i !== void 0 && y !== void 0 ? i - y : 0;
543
+ }, "sortKeys");
544
+ let h = d.sort(f);
545
+ u === "BT" && (o && Hr(h, r, a), h = h.reverse()), h.forEach(($) => {
546
+ const g = r.get($);
547
+ if (!g)
548
+ throw new Error(`Commit not found for key ${$}`);
549
+ o && (a = Yr(g, u, a, w));
550
+ const i = Kr(g, a, o);
551
+ if (s) {
552
+ const y = jr(g), x = g.customType ?? g.type, _ = b.get(g.branch)?.index ?? 0;
553
+ Nr(n, g, i, y, _, x), Sr(e, g, i, a), Wr(e, g, i, a);
554
+ }
555
+ u === "TB" || u === "BT" ? w.set(g.id, { x: i.x, y: i.posWithOffset }) : w.set(g.id, { x: i.posWithOffset, y: i.y }), a = u === "BT" && o ? a + k : a + k + L, a > B && (B = a);
556
+ });
557
+ }, "drawCommits"), Ur = /* @__PURE__ */ p$1((t, r, s, n, e) => {
558
+ const d = (u === "TB" || u === "BT" ? s.x < n.x : s.y < n.y) ? r.branch : t.branch, o = /* @__PURE__ */ p$1((h) => h.branch === d, "isOnBranchToGetCurve"), f = /* @__PURE__ */ p$1((h) => h.seq > t.seq && h.seq < r.seq, "isBetweenCommits");
559
+ return [...e.values()].some((h) => f(h) && o(h));
560
+ }, "shouldRerouteArrow"), G = /* @__PURE__ */ p$1((t, r, s = 0) => {
561
+ const n = t + Math.abs(t - r) / 2;
562
+ if (s > 5)
563
+ return n;
564
+ if (q.every((d) => Math.abs(d - n) >= 10))
565
+ return q.push(n), n;
566
+ const a = Math.abs(t - r);
567
+ return G(t, r - a / 5, s + 1);
568
+ }, "findLane"), Vr = /* @__PURE__ */ p$1((t, r, s, n) => {
569
+ const e = w.get(r.id), a = w.get(s.id);
570
+ if (e === void 0 || a === void 0)
571
+ throw new Error(`Commit positions not found for commits ${r.id} and ${s.id}`);
572
+ const d = Ur(r, s, e, a, n);
573
+ let o = "", f = "", h = 0, $ = 0, g = b.get(s.branch)?.index;
574
+ s.type === p.MERGE && r.id !== s.parents[0] && (g = b.get(r.branch)?.index);
575
+ let i;
576
+ if (d) {
577
+ o = "A 10 10, 0, 0, 0,", f = "A 10 10, 0, 0, 1,", h = 10, $ = 10;
578
+ const y = e.y < a.y ? G(e.y, a.y) : G(a.y, e.y), x = e.x < a.x ? G(e.x, a.x) : G(a.x, e.x);
579
+ u === "TB" ? e.x < a.x ? i = `M ${e.x} ${e.y} L ${x - h} ${e.y} ${f} ${x} ${e.y + $} L ${x} ${a.y - h} ${o} ${x + $} ${a.y} L ${a.x} ${a.y}` : (g = b.get(r.branch)?.index, i = `M ${e.x} ${e.y} L ${x + h} ${e.y} ${o} ${x} ${e.y + $} L ${x} ${a.y - h} ${f} ${x - $} ${a.y} L ${a.x} ${a.y}`) : u === "BT" ? e.x < a.x ? i = `M ${e.x} ${e.y} L ${x - h} ${e.y} ${o} ${x} ${e.y - $} L ${x} ${a.y + h} ${f} ${x + $} ${a.y} L ${a.x} ${a.y}` : (g = b.get(r.branch)?.index, i = `M ${e.x} ${e.y} L ${x + h} ${e.y} ${f} ${x} ${e.y - $} L ${x} ${a.y + h} ${o} ${x - $} ${a.y} L ${a.x} ${a.y}`) : e.y < a.y ? i = `M ${e.x} ${e.y} L ${e.x} ${y - h} ${o} ${e.x + $} ${y} L ${a.x - h} ${y} ${f} ${a.x} ${y + $} L ${a.x} ${a.y}` : (g = b.get(r.branch)?.index, i = `M ${e.x} ${e.y} L ${e.x} ${y + h} ${f} ${e.x + $} ${y} L ${a.x - h} ${y} ${o} ${a.x} ${y - $} L ${a.x} ${a.y}`);
580
+ } else
581
+ o = "A 20 20, 0, 0, 0,", f = "A 20 20, 0, 0, 1,", h = 20, $ = 20, u === "TB" ? (e.x < a.x && (s.type === p.MERGE && r.id !== s.parents[0] ? i = `M ${e.x} ${e.y} L ${e.x} ${a.y - h} ${o} ${e.x + $} ${a.y} L ${a.x} ${a.y}` : i = `M ${e.x} ${e.y} L ${a.x - h} ${e.y} ${f} ${a.x} ${e.y + $} L ${a.x} ${a.y}`), e.x > a.x && (o = "A 20 20, 0, 0, 0,", f = "A 20 20, 0, 0, 1,", h = 20, $ = 20, s.type === p.MERGE && r.id !== s.parents[0] ? i = `M ${e.x} ${e.y} L ${e.x} ${a.y - h} ${f} ${e.x - $} ${a.y} L ${a.x} ${a.y}` : i = `M ${e.x} ${e.y} L ${a.x + h} ${e.y} ${o} ${a.x} ${e.y + $} L ${a.x} ${a.y}`), e.x === a.x && (i = `M ${e.x} ${e.y} L ${a.x} ${a.y}`)) : u === "BT" ? (e.x < a.x && (s.type === p.MERGE && r.id !== s.parents[0] ? i = `M ${e.x} ${e.y} L ${e.x} ${a.y + h} ${f} ${e.x + $} ${a.y} L ${a.x} ${a.y}` : i = `M ${e.x} ${e.y} L ${a.x - h} ${e.y} ${o} ${a.x} ${e.y - $} L ${a.x} ${a.y}`), e.x > a.x && (o = "A 20 20, 0, 0, 0,", f = "A 20 20, 0, 0, 1,", h = 20, $ = 20, s.type === p.MERGE && r.id !== s.parents[0] ? i = `M ${e.x} ${e.y} L ${e.x} ${a.y + h} ${o} ${e.x - $} ${a.y} L ${a.x} ${a.y}` : i = `M ${e.x} ${e.y} L ${a.x - h} ${e.y} ${o} ${a.x} ${e.y - $} L ${a.x} ${a.y}`), e.x === a.x && (i = `M ${e.x} ${e.y} L ${a.x} ${a.y}`)) : (e.y < a.y && (s.type === p.MERGE && r.id !== s.parents[0] ? i = `M ${e.x} ${e.y} L ${a.x - h} ${e.y} ${f} ${a.x} ${e.y + $} L ${a.x} ${a.y}` : i = `M ${e.x} ${e.y} L ${e.x} ${a.y - h} ${o} ${e.x + $} ${a.y} L ${a.x} ${a.y}`), e.y > a.y && (s.type === p.MERGE && r.id !== s.parents[0] ? i = `M ${e.x} ${e.y} L ${a.x - h} ${e.y} ${o} ${a.x} ${e.y - $} L ${a.x} ${a.y}` : i = `M ${e.x} ${e.y} L ${e.x} ${a.y + h} ${f} ${e.x + $} ${a.y} L ${a.x} ${a.y}`), e.y === a.y && (i = `M ${e.x} ${e.y} L ${a.x} ${a.y}`));
582
+ if (i === void 0)
583
+ throw new Error("Line definition not found");
584
+ t.append("path").attr("d", i).attr("class", "arrow arrow" + g % M);
585
+ }, "drawArrow"), Xr = /* @__PURE__ */ p$1((t, r) => {
586
+ const s = t.append("g").attr("class", "commit-arrows");
587
+ [...r.keys()].forEach((n) => {
588
+ const e = r.get(n);
589
+ e.parents && e.parents.length > 0 && e.parents.forEach((a) => {
590
+ Vr(s, r.get(a), e, r);
591
+ });
592
+ });
593
+ }, "drawArrows"), Jr = /* @__PURE__ */ p$1((t, r) => {
594
+ const s = t.append("g");
595
+ r.forEach((n, e) => {
596
+ const a = e % M, d = b.get(n.name)?.pos;
597
+ if (d === void 0)
598
+ throw new Error(`Position not found for branch ${n.name}`);
599
+ const o = s.append("line");
600
+ o.attr("x1", 0), o.attr("y1", d), o.attr("x2", B), o.attr("y2", d), o.attr("class", "branch branch" + a), u === "TB" ? (o.attr("y1", O), o.attr("x1", d), o.attr("y2", B), o.attr("x2", d)) : u === "BT" && (o.attr("y1", B), o.attr("x1", d), o.attr("y2", O), o.attr("x2", d)), q.push(d);
601
+ const f = n.name, h = W(f), $ = s.insert("rect"), i = s.insert("g").attr("class", "branchLabel").insert("g").attr("class", "label branch-label" + a);
602
+ i.node().appendChild(h);
603
+ const y = h.getBBox();
604
+ $.attr("class", "branchLabelBkg label" + a).attr("rx", 4).attr("ry", 4).attr("x", -y.width - 4 - (v?.rotateCommitLabel === true ? 30 : 0)).attr("y", -y.height / 2 + 8).attr("width", y.width + 18).attr("height", y.height + 4), i.attr(
605
+ "transform",
606
+ "translate(" + (-y.width - 14 - (v?.rotateCommitLabel === true ? 30 : 0)) + ", " + (d - y.height / 2 - 1) + ")"
607
+ ), u === "TB" ? ($.attr("x", d - y.width / 2 - 10).attr("y", 0), i.attr("transform", "translate(" + (d - y.width / 2 - 5) + ", 0)")) : u === "BT" ? ($.attr("x", d - y.width / 2 - 10).attr("y", B), i.attr("transform", "translate(" + (d - y.width / 2 - 5) + ", " + B + ")")) : $.attr("transform", "translate(-19, " + (d - y.height / 2) + ")");
608
+ });
609
+ }, "drawBranches"), Qr = /* @__PURE__ */ p$1(function(t, r, s, n, e) {
610
+ return b.set(t, { pos: r, index: s }), r += 50 + (e ? 40 : 0) + (u === "TB" || u === "BT" ? n.width / 2 : 0), r;
611
+ }, "setBranchPosition"), Zr = /* @__PURE__ */ p$1(function(t, r, s, n) {
612
+ if (Ar(), F$1.debug("in gitgraph renderer", t + `
613
+ `, "id:", r, s), !v)
614
+ throw new Error("GitGraph config not found");
615
+ const e = v.rotateCommitLabel ?? false, a = n.db;
616
+ R = a.getCommits();
617
+ const d = a.getBranchesAsObjArray();
618
+ u = a.getDirection();
619
+ const o = ht(`[id="${r}"]`);
620
+ let f = 0;
621
+ d.forEach((h, $) => {
622
+ const g = W(h.name), i = o.append("g"), y = i.insert("g").attr("class", "branchLabel"), x = y.insert("g").attr("class", "label branch-label");
623
+ x.node()?.appendChild(g);
624
+ const _ = g.getBBox();
625
+ f = Qr(h.name, f, $, _, e), x.remove(), y.remove(), i.remove();
626
+ }), D(o, R, false), v.showBranches && Jr(o, d), Xr(o, R), D(o, R, true), oe.insertTitle(
627
+ o,
628
+ "gitTitleText",
629
+ v.titleTopMargin ?? 0,
630
+ a.getDiagramTitle()
631
+ ), my(
632
+ void 0,
633
+ o,
634
+ v.diagramPadding,
635
+ v.useMaxWidth
636
+ );
637
+ }, "draw"), re = {
638
+ draw: Zr
639
+ }, ee = /* @__PURE__ */ p$1((t) => `
640
+ .commit-id,
641
+ .commit-msg,
642
+ .branch-label {
643
+ fill: lightgrey;
644
+ color: lightgrey;
645
+ font-family: 'trebuchet ms', verdana, arial, sans-serif;
646
+ font-family: var(--mermaid-font-family);
647
+ }
648
+ ${[0, 1, 2, 3, 4, 5, 6, 7].map(
649
+ (r) => `
650
+ .branch-label${r} { fill: ${t["gitBranchLabel" + r]}; }
651
+ .commit${r} { stroke: ${t["git" + r]}; fill: ${t["git" + r]}; }
652
+ .commit-highlight${r} { stroke: ${t["gitInv" + r]}; fill: ${t["gitInv" + r]}; }
653
+ .label${r} { fill: ${t["git" + r]}; }
654
+ .arrow${r} { stroke: ${t["git" + r]}; }
655
+ `
656
+ ).join(`
657
+ `)}
658
+
659
+ .branch {
660
+ stroke-width: 1;
661
+ stroke: ${t.lineColor};
662
+ stroke-dasharray: 2;
663
+ }
664
+ .commit-label { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelColor};}
665
+ .commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelBackground}; opacity: 0.5; }
666
+ .tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};}
667
+ .tag-label-bkg { fill: ${t.tagLabelBackground}; stroke: ${t.tagLabelBorder}; }
668
+ .tag-hole { fill: ${t.textColor}; }
669
+
670
+ .commit-merge {
671
+ stroke: ${t.primaryColor};
672
+ fill: ${t.primaryColor};
673
+ }
674
+ .commit-reverse {
675
+ stroke: ${t.primaryColor};
676
+ fill: ${t.primaryColor};
677
+ stroke-width: 3;
678
+ }
679
+ .commit-highlight-outer {
680
+ }
681
+ .commit-highlight-inner {
682
+ stroke: ${t.primaryColor};
683
+ fill: ${t.primaryColor};
684
+ }
685
+
686
+ .arrow { stroke-width: 8; stroke-linecap: round; fill: none}
687
+ .gitTitleText {
688
+ text-anchor: middle;
689
+ font-size: 18px;
690
+ fill: ${t.textColor};
691
+ }
692
+ `, "getStyles"), te = ee, ce = {
693
+ parser: Or,
694
+ db: S,
695
+ renderer: re,
696
+ styles: te
697
+ };
698
+
699
+ export { ce as diagram };
700
+ //# sourceMappingURL=gitGraphDiagram-NY62KEGX-CBXt0yuv.mD35jpPG.js.map