dominds 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (273) hide show
  1. package/LICENSE +157 -0
  2. package/README.md +250 -0
  3. package/README.zh.md +161 -0
  4. package/dist/access-control.js +253 -0
  5. package/dist/cli/create.js +263 -0
  6. package/dist/cli/read.js +84 -0
  7. package/dist/cli/tui.js +199 -0
  8. package/dist/cli/webui.js +169 -0
  9. package/dist/cli.js +227 -0
  10. package/dist/dialog-factory.js +53 -0
  11. package/dist/dialog-global-registry.js +68 -0
  12. package/dist/dialog-instance-registry.js +78 -0
  13. package/dist/dialog-run-state.js +198 -0
  14. package/dist/dialog.js +1024 -0
  15. package/dist/evt-registry.js +103 -0
  16. package/dist/index.js +8 -0
  17. package/dist/llm/client.js +69 -0
  18. package/dist/llm/defaults.yaml +386 -0
  19. package/dist/llm/driver.js +3214 -0
  20. package/dist/llm/gen/anthropic.js +611 -0
  21. package/dist/llm/gen/codex.js +375 -0
  22. package/dist/llm/gen/mock.js +326 -0
  23. package/dist/llm/gen/openai.js +470 -0
  24. package/dist/llm/gen/registry.js +26 -0
  25. package/dist/llm/gen.js +2 -0
  26. package/dist/llm/tools-projection.js +37 -0
  27. package/dist/log.js +228 -0
  28. package/dist/mcp/config.js +230 -0
  29. package/dist/mcp/sdk-client.js +129 -0
  30. package/dist/mcp/server-runtime.js +57 -0
  31. package/dist/mcp/stdio-client.js +280 -0
  32. package/dist/mcp/supervisor.js +979 -0
  33. package/dist/mcp/tool-names.js +109 -0
  34. package/dist/minds/builtin/cmdr/persona.md +3 -0
  35. package/dist/minds/builtin/dijiang/knowledge.md +287 -0
  36. package/dist/minds/builtin/dijiang/persona.md +7 -0
  37. package/dist/minds/builtin/fuxi/persona.en.md +59 -0
  38. package/dist/minds/builtin/fuxi/persona.zh.md +49 -0
  39. package/dist/minds/builtin/pangu/persona.en.md +78 -0
  40. package/dist/minds/builtin/pangu/persona.zh.md +71 -0
  41. package/dist/minds/load.js +617 -0
  42. package/dist/minds/minds-i18n.js +131 -0
  43. package/dist/minds/system-prompt.js +281 -0
  44. package/dist/persistence.js +3128 -0
  45. package/dist/problems.js +109 -0
  46. package/dist/server/api-routes.js +1031 -0
  47. package/dist/server/auth.js +180 -0
  48. package/dist/server/mime-types.js +32 -0
  49. package/dist/server/prompts-routes.js +543 -0
  50. package/dist/server/server-core.js +235 -0
  51. package/dist/server/setup-routes.js +697 -0
  52. package/dist/server/static-server.js +132 -0
  53. package/dist/server/websocket-handler.js +1011 -0
  54. package/dist/server.js +164 -0
  55. package/dist/shared/async-fifo-mutex.js +36 -0
  56. package/dist/shared/diligence.js +20 -0
  57. package/dist/shared/dotenv.js +144 -0
  58. package/dist/shared/evt.js +195 -0
  59. package/dist/shared/i18n/driver-messages.js +267 -0
  60. package/dist/shared/i18n/text.js +9 -0
  61. package/dist/shared/i18n/tool-result-messages.js +51 -0
  62. package/dist/shared/rtws-cli.js +73 -0
  63. package/dist/shared/runtime-language.js +47 -0
  64. package/dist/shared/team-mgmt-manual.js +116 -0
  65. package/dist/shared/types/context-health.js +2 -0
  66. package/dist/shared/types/dialog.js +11 -0
  67. package/dist/shared/types/i18n.js +2 -0
  68. package/dist/shared/types/index.js +26 -0
  69. package/dist/shared/types/language.js +40 -0
  70. package/dist/shared/types/problems.js +2 -0
  71. package/dist/shared/types/prompts.js +2 -0
  72. package/dist/shared/types/q4h.js +7 -0
  73. package/dist/shared/types/run-state.js +8 -0
  74. package/dist/shared/types/setup.js +2 -0
  75. package/dist/shared/types/storage.js +10 -0
  76. package/dist/shared/types/tellask.js +8 -0
  77. package/dist/shared/types/tools-registry.js +2 -0
  78. package/dist/shared/types/wire.js +12 -0
  79. package/dist/shared/utils/fmt.js +9 -0
  80. package/dist/shared/utils/html.js +20 -0
  81. package/dist/shared/utils/id.js +18 -0
  82. package/dist/shared/utils/inter-dialog-format.js +101 -0
  83. package/dist/shared/utils/time.js +13 -0
  84. package/dist/static/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  85. package/dist/static/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  86. package/dist/static/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  87. package/dist/static/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  88. package/dist/static/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  89. package/dist/static/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  90. package/dist/static/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  91. package/dist/static/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  92. package/dist/static/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  93. package/dist/static/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  94. package/dist/static/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  95. package/dist/static/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  96. package/dist/static/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  97. package/dist/static/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  98. package/dist/static/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  99. package/dist/static/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  100. package/dist/static/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  101. package/dist/static/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  102. package/dist/static/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  103. package/dist/static/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  104. package/dist/static/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  105. package/dist/static/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  106. package/dist/static/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  107. package/dist/static/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  108. package/dist/static/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  109. package/dist/static/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  110. package/dist/static/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  111. package/dist/static/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  112. package/dist/static/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  113. package/dist/static/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  114. package/dist/static/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  115. package/dist/static/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  116. package/dist/static/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  117. package/dist/static/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  118. package/dist/static/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  119. package/dist/static/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  120. package/dist/static/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  121. package/dist/static/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  122. package/dist/static/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  123. package/dist/static/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  124. package/dist/static/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  125. package/dist/static/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  126. package/dist/static/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  127. package/dist/static/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  128. package/dist/static/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  129. package/dist/static/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  130. package/dist/static/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  131. package/dist/static/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  132. package/dist/static/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  133. package/dist/static/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  134. package/dist/static/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  135. package/dist/static/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  136. package/dist/static/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  137. package/dist/static/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  138. package/dist/static/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  139. package/dist/static/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  140. package/dist/static/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  141. package/dist/static/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  142. package/dist/static/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  143. package/dist/static/assets/_baseUniq-Crfl3d5Y.js +661 -0
  144. package/dist/static/assets/_baseUniq-Crfl3d5Y.js.map +1 -0
  145. package/dist/static/assets/arc-CbA_x9GD.js +132 -0
  146. package/dist/static/assets/arc-CbA_x9GD.js.map +1 -0
  147. package/dist/static/assets/architectureDiagram-VXUJARFQ-lcFS8ZQJ.js +8685 -0
  148. package/dist/static/assets/architectureDiagram-VXUJARFQ-lcFS8ZQJ.js.map +1 -0
  149. package/dist/static/assets/blockDiagram-VD42YOAC-B3Q36qRc.js +3608 -0
  150. package/dist/static/assets/blockDiagram-VD42YOAC-B3Q36qRc.js.map +1 -0
  151. package/dist/static/assets/c4Diagram-YG6GDRKO-Mt-aq3VH.js +2482 -0
  152. package/dist/static/assets/c4Diagram-YG6GDRKO-Mt-aq3VH.js.map +1 -0
  153. package/dist/static/assets/channel-BVr1Yke-.js +8 -0
  154. package/dist/static/assets/channel-BVr1Yke-.js.map +1 -0
  155. package/dist/static/assets/chunk-4BX2VUAB-qCIn5Iic.js +17 -0
  156. package/dist/static/assets/chunk-4BX2VUAB-qCIn5Iic.js.map +1 -0
  157. package/dist/static/assets/chunk-55IACEB6-q172NeCV.js +14 -0
  158. package/dist/static/assets/chunk-55IACEB6-q172NeCV.js.map +1 -0
  159. package/dist/static/assets/chunk-B4BG7PRW-CMJmtYzq.js +1827 -0
  160. package/dist/static/assets/chunk-B4BG7PRW-CMJmtYzq.js.map +1 -0
  161. package/dist/static/assets/chunk-DI55MBZ5-DiuwwZPL.js +1916 -0
  162. package/dist/static/assets/chunk-DI55MBZ5-DiuwwZPL.js.map +1 -0
  163. package/dist/static/assets/chunk-FMBD7UC4-06sqZTTn.js +20 -0
  164. package/dist/static/assets/chunk-FMBD7UC4-06sqZTTn.js.map +1 -0
  165. package/dist/static/assets/chunk-QN33PNHL-CnpBNkpP.js +25 -0
  166. package/dist/static/assets/chunk-QN33PNHL-CnpBNkpP.js.map +1 -0
  167. package/dist/static/assets/chunk-QZHKN3VN-CNgjMR-e.js +18 -0
  168. package/dist/static/assets/chunk-QZHKN3VN-CNgjMR-e.js.map +1 -0
  169. package/dist/static/assets/chunk-TZMSLE5B-BxtzW6--.js +109 -0
  170. package/dist/static/assets/chunk-TZMSLE5B-BxtzW6--.js.map +1 -0
  171. package/dist/static/assets/classDiagram-2ON5EDUG-29huvmn-.js +23 -0
  172. package/dist/static/assets/classDiagram-2ON5EDUG-29huvmn-.js.map +1 -0
  173. package/dist/static/assets/classDiagram-v2-WZHVMYZB-29huvmn-.js +23 -0
  174. package/dist/static/assets/classDiagram-v2-WZHVMYZB-29huvmn-.js.map +1 -0
  175. package/dist/static/assets/clone-D2OgLSSn.js +9 -0
  176. package/dist/static/assets/clone-D2OgLSSn.js.map +1 -0
  177. package/dist/static/assets/cose-bilkent-S5V4N54A-BNegDCxl.js +4943 -0
  178. package/dist/static/assets/cose-bilkent-S5V4N54A-BNegDCxl.js.map +1 -0
  179. package/dist/static/assets/cytoscape.esm-Bm8DJGmZ.js +30240 -0
  180. package/dist/static/assets/cytoscape.esm-Bm8DJGmZ.js.map +1 -0
  181. package/dist/static/assets/dagre-6UL2VRFP-f1XrTRSn.js +695 -0
  182. package/dist/static/assets/dagre-6UL2VRFP-f1XrTRSn.js.map +1 -0
  183. package/dist/static/assets/defaultLocale-DVr69WTU.js +207 -0
  184. package/dist/static/assets/defaultLocale-DVr69WTU.js.map +1 -0
  185. package/dist/static/assets/diagram-PSM6KHXK-8w1WbeDi.js +849 -0
  186. package/dist/static/assets/diagram-PSM6KHXK-8w1WbeDi.js.map +1 -0
  187. package/dist/static/assets/diagram-QEK2KX5R-CF4wtMmR.js +303 -0
  188. package/dist/static/assets/diagram-QEK2KX5R-CF4wtMmR.js.map +1 -0
  189. package/dist/static/assets/diagram-S2PKOQOG-8p3Avgn2.js +213 -0
  190. package/dist/static/assets/diagram-S2PKOQOG-8p3Avgn2.js.map +1 -0
  191. package/dist/static/assets/erDiagram-Q2GNP2WA-BMKLxlM9.js +1159 -0
  192. package/dist/static/assets/erDiagram-Q2GNP2WA-BMKLxlM9.js.map +1 -0
  193. package/dist/static/assets/favicon-Cmg5RbCj.svg +8 -0
  194. package/dist/static/assets/flowDiagram-NV44I4VS-CgEuPNK2.js +2332 -0
  195. package/dist/static/assets/flowDiagram-NV44I4VS-CgEuPNK2.js.map +1 -0
  196. package/dist/static/assets/ganttDiagram-JELNMOA3-bJkDCf-9.js +3681 -0
  197. package/dist/static/assets/ganttDiagram-JELNMOA3-bJkDCf-9.js.map +1 -0
  198. package/dist/static/assets/gitGraphDiagram-NY62KEGX-4QE9kesp.js +1206 -0
  199. package/dist/static/assets/gitGraphDiagram-NY62KEGX-4QE9kesp.js.map +1 -0
  200. package/dist/static/assets/graph-CS0Pmm7c.js +597 -0
  201. package/dist/static/assets/graph-CS0Pmm7c.js.map +1 -0
  202. package/dist/static/assets/index-BS6HnGzC.js +112303 -0
  203. package/dist/static/assets/index-BS6HnGzC.js.map +1 -0
  204. package/dist/static/assets/index-DaIsSzC_.css +483 -0
  205. package/dist/static/assets/infoDiagram-WHAUD3N6-ypBcKfUs.js +34 -0
  206. package/dist/static/assets/infoDiagram-WHAUD3N6-ypBcKfUs.js.map +1 -0
  207. package/dist/static/assets/init-ZxktEp_H.js +17 -0
  208. package/dist/static/assets/init-ZxktEp_H.js.map +1 -0
  209. package/dist/static/assets/journeyDiagram-XKPGCS4Q-QnrxDowJ.js +1255 -0
  210. package/dist/static/assets/journeyDiagram-XKPGCS4Q-QnrxDowJ.js.map +1 -0
  211. package/dist/static/assets/kanban-definition-3W4ZIXB7-CfvEc4z5.js +1048 -0
  212. package/dist/static/assets/kanban-definition-3W4ZIXB7-CfvEc4z5.js.map +1 -0
  213. package/dist/static/assets/layout-8TGxpm23.js +2218 -0
  214. package/dist/static/assets/layout-8TGxpm23.js.map +1 -0
  215. package/dist/static/assets/linear-BATBPQQv.js +341 -0
  216. package/dist/static/assets/linear-BATBPQQv.js.map +1 -0
  217. package/dist/static/assets/min-B3oVH3AC.js +42 -0
  218. package/dist/static/assets/min-B3oVH3AC.js.map +1 -0
  219. package/dist/static/assets/mindmap-definition-VGOIOE7T-L7VLwwF8.js +1127 -0
  220. package/dist/static/assets/mindmap-definition-VGOIOE7T-L7VLwwF8.js.map +1 -0
  221. package/dist/static/assets/ordinal-CxptdPJm.js +77 -0
  222. package/dist/static/assets/ordinal-CxptdPJm.js.map +1 -0
  223. package/dist/static/assets/pieDiagram-ADFJNKIX-CFW3zIhM.js +241 -0
  224. package/dist/static/assets/pieDiagram-ADFJNKIX-CFW3zIhM.js.map +1 -0
  225. package/dist/static/assets/quadrantDiagram-AYHSOK5B-B7ssen3E.js +1338 -0
  226. package/dist/static/assets/quadrantDiagram-AYHSOK5B-B7ssen3E.js.map +1 -0
  227. package/dist/static/assets/requirementDiagram-UZGBJVZJ-D0v5BArv.js +1162 -0
  228. package/dist/static/assets/requirementDiagram-UZGBJVZJ-D0v5BArv.js.map +1 -0
  229. package/dist/static/assets/sankeyDiagram-TZEHDZUN-B7slncJe.js +1195 -0
  230. package/dist/static/assets/sankeyDiagram-TZEHDZUN-B7slncJe.js.map +1 -0
  231. package/dist/static/assets/sequenceDiagram-WL72ISMW-oXU2lRh_.js +3875 -0
  232. package/dist/static/assets/sequenceDiagram-WL72ISMW-oXU2lRh_.js.map +1 -0
  233. package/dist/static/assets/stateDiagram-FKZM4ZOC-CFYsEd0x.js +452 -0
  234. package/dist/static/assets/stateDiagram-FKZM4ZOC-CFYsEd0x.js.map +1 -0
  235. package/dist/static/assets/stateDiagram-v2-4FDKWEC3-C0UWaNA7.js +22 -0
  236. package/dist/static/assets/stateDiagram-v2-4FDKWEC3-C0UWaNA7.js.map +1 -0
  237. package/dist/static/assets/timeline-definition-IT6M3QCI-C3KODUrh.js +1223 -0
  238. package/dist/static/assets/timeline-definition-IT6M3QCI-C3KODUrh.js.map +1 -0
  239. package/dist/static/assets/treemap-KMMF4GRG-DAGDLhj2.js +18753 -0
  240. package/dist/static/assets/treemap-KMMF4GRG-DAGDLhj2.js.map +1 -0
  241. package/dist/static/assets/xychartDiagram-PRI3JC2R-C0J9iwTO.js +1888 -0
  242. package/dist/static/assets/xychartDiagram-PRI3JC2R-C0J9iwTO.js.map +1 -0
  243. package/dist/static/index.html +71 -0
  244. package/dist/static/testing/dom-observation-utils.js +425 -0
  245. package/dist/static/testing/e2e-test-helper.js +3119 -0
  246. package/dist/team.js +1160 -0
  247. package/dist/tellask.js +431 -0
  248. package/dist/tool.js +150 -0
  249. package/dist/tools/apply-patch.js +542 -0
  250. package/dist/tools/builtins.js +196 -0
  251. package/dist/tools/context-health.js +177 -0
  252. package/dist/tools/ctrl.js +478 -0
  253. package/dist/tools/diag.js +583 -0
  254. package/dist/tools/env.js +184 -0
  255. package/dist/tools/fs.js +818 -0
  256. package/dist/tools/mcp.js +138 -0
  257. package/dist/tools/mem.js +349 -0
  258. package/dist/tools/os.js +751 -0
  259. package/dist/tools/prompts/team_mgmt.en.md +70 -0
  260. package/dist/tools/prompts/team_mgmt.zh.md +70 -0
  261. package/dist/tools/prompts/ws_mod.en.md +86 -0
  262. package/dist/tools/prompts/ws_mod.zh.md +87 -0
  263. package/dist/tools/registry-snapshot.js +31 -0
  264. package/dist/tools/registry.js +121 -0
  265. package/dist/tools/ripgrep.js +678 -0
  266. package/dist/tools/team-mgmt.js +3300 -0
  267. package/dist/tools/txt.js +3178 -0
  268. package/dist/utils/id.js +72 -0
  269. package/dist/utils/task-doc.js +236 -0
  270. package/dist/utils/task-package.js +522 -0
  271. package/dist/utils/taskdoc-search.js +280 -0
  272. package/dist/utils/taskdoc.js +400 -0
  273. package/package.json +69 -0
@@ -0,0 +1,1223 @@
1
+ import { _ as __name, c as getConfig2, l as log, d as select, V as setupGraphViewbox, W as isDark, X as lighten, Y as darken, B as __export, $ as commonDb_exports, y as clear } from "./index-BS6HnGzC.js";
2
+ import { d as d3arc } from "./arc-CbA_x9GD.js";
3
+ var parser = (function() {
4
+ var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
5
+ for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v) ;
6
+ return o2;
7
+ }, "o"), $V0 = [6, 8, 10, 11, 12, 14, 16, 17, 20, 21], $V1 = [1, 9], $V2 = [1, 10], $V3 = [1, 11], $V4 = [1, 12], $V5 = [1, 13], $V6 = [1, 16], $V7 = [1, 17];
8
+ var parser2 = {
9
+ trace: /* @__PURE__ */ __name(function trace() {
10
+ }, "trace"),
11
+ yy: {},
12
+ symbols_: { "error": 2, "start": 3, "timeline": 4, "document": 5, "EOF": 6, "line": 7, "SPACE": 8, "statement": 9, "NEWLINE": 10, "title": 11, "acc_title": 12, "acc_title_value": 13, "acc_descr": 14, "acc_descr_value": 15, "acc_descr_multiline_value": 16, "section": 17, "period_statement": 18, "event_statement": 19, "period": 20, "event": 21, "$accept": 0, "$end": 1 },
13
+ terminals_: { 2: "error", 4: "timeline", 6: "EOF", 8: "SPACE", 10: "NEWLINE", 11: "title", 12: "acc_title", 13: "acc_title_value", 14: "acc_descr", 15: "acc_descr_value", 16: "acc_descr_multiline_value", 17: "section", 20: "period", 21: "event" },
14
+ productions_: [0, [3, 3], [5, 0], [5, 2], [7, 2], [7, 1], [7, 1], [7, 1], [9, 1], [9, 2], [9, 2], [9, 1], [9, 1], [9, 1], [9, 1], [18, 1], [19, 1]],
15
+ performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
16
+ var $0 = $$.length - 1;
17
+ switch (yystate) {
18
+ case 1:
19
+ return $$[$0 - 1];
20
+ case 2:
21
+ this.$ = [];
22
+ break;
23
+ case 3:
24
+ $$[$0 - 1].push($$[$0]);
25
+ this.$ = $$[$0 - 1];
26
+ break;
27
+ case 4:
28
+ case 5:
29
+ this.$ = $$[$0];
30
+ break;
31
+ case 6:
32
+ case 7:
33
+ this.$ = [];
34
+ break;
35
+ case 8:
36
+ yy.getCommonDb().setDiagramTitle($$[$0].substr(6));
37
+ this.$ = $$[$0].substr(6);
38
+ break;
39
+ case 9:
40
+ this.$ = $$[$0].trim();
41
+ yy.getCommonDb().setAccTitle(this.$);
42
+ break;
43
+ case 10:
44
+ case 11:
45
+ this.$ = $$[$0].trim();
46
+ yy.getCommonDb().setAccDescription(this.$);
47
+ break;
48
+ case 12:
49
+ yy.addSection($$[$0].substr(8));
50
+ this.$ = $$[$0].substr(8);
51
+ break;
52
+ case 15:
53
+ yy.addTask($$[$0], 0, "");
54
+ this.$ = $$[$0];
55
+ break;
56
+ case 16:
57
+ yy.addEvent($$[$0].substr(2));
58
+ this.$ = $$[$0];
59
+ break;
60
+ }
61
+ }, "anonymous"),
62
+ table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, o($V0, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: [1, 6], 9: 7, 10: [1, 8], 11: $V1, 12: $V2, 14: $V3, 16: $V4, 17: $V5, 18: 14, 19: 15, 20: $V6, 21: $V7 }, o($V0, [2, 7], { 1: [2, 1] }), o($V0, [2, 3]), { 9: 18, 11: $V1, 12: $V2, 14: $V3, 16: $V4, 17: $V5, 18: 14, 19: 15, 20: $V6, 21: $V7 }, o($V0, [2, 5]), o($V0, [2, 6]), o($V0, [2, 8]), { 13: [1, 19] }, { 15: [1, 20] }, o($V0, [2, 11]), o($V0, [2, 12]), o($V0, [2, 13]), o($V0, [2, 14]), o($V0, [2, 15]), o($V0, [2, 16]), o($V0, [2, 4]), o($V0, [2, 9]), o($V0, [2, 10])],
63
+ defaultActions: {},
64
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
65
+ if (hash.recoverable) {
66
+ this.trace(str);
67
+ } else {
68
+ var error = new Error(str);
69
+ error.hash = hash;
70
+ throw error;
71
+ }
72
+ }, "parseError"),
73
+ parse: /* @__PURE__ */ __name(function parse(input) {
74
+ var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1;
75
+ var args = lstack.slice.call(arguments, 1);
76
+ var lexer2 = Object.create(this.lexer);
77
+ var sharedState = { yy: {} };
78
+ for (var k in this.yy) {
79
+ if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
80
+ sharedState.yy[k] = this.yy[k];
81
+ }
82
+ }
83
+ lexer2.setInput(input, sharedState.yy);
84
+ sharedState.yy.lexer = lexer2;
85
+ sharedState.yy.parser = this;
86
+ if (typeof lexer2.yylloc == "undefined") {
87
+ lexer2.yylloc = {};
88
+ }
89
+ var yyloc = lexer2.yylloc;
90
+ lstack.push(yyloc);
91
+ var ranges = lexer2.options && lexer2.options.ranges;
92
+ if (typeof sharedState.yy.parseError === "function") {
93
+ this.parseError = sharedState.yy.parseError;
94
+ } else {
95
+ this.parseError = Object.getPrototypeOf(this).parseError;
96
+ }
97
+ function popStack(n) {
98
+ stack.length = stack.length - 2 * n;
99
+ vstack.length = vstack.length - n;
100
+ lstack.length = lstack.length - n;
101
+ }
102
+ __name(popStack, "popStack");
103
+ function lex() {
104
+ var token;
105
+ token = tstack.pop() || lexer2.lex() || EOF;
106
+ if (typeof token !== "number") {
107
+ if (token instanceof Array) {
108
+ tstack = token;
109
+ token = tstack.pop();
110
+ }
111
+ token = self.symbols_[token] || token;
112
+ }
113
+ return token;
114
+ }
115
+ __name(lex, "lex");
116
+ var symbol, state, action, r, yyval = {}, p, len, newState, expected;
117
+ while (true) {
118
+ state = stack[stack.length - 1];
119
+ if (this.defaultActions[state]) {
120
+ action = this.defaultActions[state];
121
+ } else {
122
+ if (symbol === null || typeof symbol == "undefined") {
123
+ symbol = lex();
124
+ }
125
+ action = table[state] && table[state][symbol];
126
+ }
127
+ if (typeof action === "undefined" || !action.length || !action[0]) {
128
+ var errStr = "";
129
+ expected = [];
130
+ for (p in table[state]) {
131
+ if (this.terminals_[p] && p > TERROR) {
132
+ expected.push("'" + this.terminals_[p] + "'");
133
+ }
134
+ }
135
+ if (lexer2.showPosition) {
136
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
137
+ } else {
138
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
139
+ }
140
+ this.parseError(errStr, {
141
+ text: lexer2.match,
142
+ token: this.terminals_[symbol] || symbol,
143
+ line: lexer2.yylineno,
144
+ loc: yyloc,
145
+ expected
146
+ });
147
+ }
148
+ if (action[0] instanceof Array && action.length > 1) {
149
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
150
+ }
151
+ switch (action[0]) {
152
+ case 1:
153
+ stack.push(symbol);
154
+ vstack.push(lexer2.yytext);
155
+ lstack.push(lexer2.yylloc);
156
+ stack.push(action[1]);
157
+ symbol = null;
158
+ {
159
+ yyleng = lexer2.yyleng;
160
+ yytext = lexer2.yytext;
161
+ yylineno = lexer2.yylineno;
162
+ yyloc = lexer2.yylloc;
163
+ }
164
+ break;
165
+ case 2:
166
+ len = this.productions_[action[1]][1];
167
+ yyval.$ = vstack[vstack.length - len];
168
+ yyval._$ = {
169
+ first_line: lstack[lstack.length - (len || 1)].first_line,
170
+ last_line: lstack[lstack.length - 1].last_line,
171
+ first_column: lstack[lstack.length - (len || 1)].first_column,
172
+ last_column: lstack[lstack.length - 1].last_column
173
+ };
174
+ if (ranges) {
175
+ yyval._$.range = [
176
+ lstack[lstack.length - (len || 1)].range[0],
177
+ lstack[lstack.length - 1].range[1]
178
+ ];
179
+ }
180
+ r = this.performAction.apply(yyval, [
181
+ yytext,
182
+ yyleng,
183
+ yylineno,
184
+ sharedState.yy,
185
+ action[1],
186
+ vstack,
187
+ lstack
188
+ ].concat(args));
189
+ if (typeof r !== "undefined") {
190
+ return r;
191
+ }
192
+ if (len) {
193
+ stack = stack.slice(0, -1 * len * 2);
194
+ vstack = vstack.slice(0, -1 * len);
195
+ lstack = lstack.slice(0, -1 * len);
196
+ }
197
+ stack.push(this.productions_[action[1]][0]);
198
+ vstack.push(yyval.$);
199
+ lstack.push(yyval._$);
200
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
201
+ stack.push(newState);
202
+ break;
203
+ case 3:
204
+ return true;
205
+ }
206
+ }
207
+ return true;
208
+ }, "parse")
209
+ };
210
+ var lexer = /* @__PURE__ */ (function() {
211
+ var lexer2 = {
212
+ EOF: 1,
213
+ parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
214
+ if (this.yy.parser) {
215
+ this.yy.parser.parseError(str, hash);
216
+ } else {
217
+ throw new Error(str);
218
+ }
219
+ }, "parseError"),
220
+ // resets the lexer, sets new input
221
+ setInput: /* @__PURE__ */ __name(function(input, yy) {
222
+ this.yy = yy || this.yy || {};
223
+ this._input = input;
224
+ this._more = this._backtrack = this.done = false;
225
+ this.yylineno = this.yyleng = 0;
226
+ this.yytext = this.matched = this.match = "";
227
+ this.conditionStack = ["INITIAL"];
228
+ this.yylloc = {
229
+ first_line: 1,
230
+ first_column: 0,
231
+ last_line: 1,
232
+ last_column: 0
233
+ };
234
+ if (this.options.ranges) {
235
+ this.yylloc.range = [0, 0];
236
+ }
237
+ this.offset = 0;
238
+ return this;
239
+ }, "setInput"),
240
+ // consumes and returns one char from the input
241
+ input: /* @__PURE__ */ __name(function() {
242
+ var ch = this._input[0];
243
+ this.yytext += ch;
244
+ this.yyleng++;
245
+ this.offset++;
246
+ this.match += ch;
247
+ this.matched += ch;
248
+ var lines = ch.match(/(?:\r\n?|\n).*/g);
249
+ if (lines) {
250
+ this.yylineno++;
251
+ this.yylloc.last_line++;
252
+ } else {
253
+ this.yylloc.last_column++;
254
+ }
255
+ if (this.options.ranges) {
256
+ this.yylloc.range[1]++;
257
+ }
258
+ this._input = this._input.slice(1);
259
+ return ch;
260
+ }, "input"),
261
+ // unshifts one char (or a string) into the input
262
+ unput: /* @__PURE__ */ __name(function(ch) {
263
+ var len = ch.length;
264
+ var lines = ch.split(/(?:\r\n?|\n)/g);
265
+ this._input = ch + this._input;
266
+ this.yytext = this.yytext.substr(0, this.yytext.length - len);
267
+ this.offset -= len;
268
+ var oldLines = this.match.split(/(?:\r\n?|\n)/g);
269
+ this.match = this.match.substr(0, this.match.length - 1);
270
+ this.matched = this.matched.substr(0, this.matched.length - 1);
271
+ if (lines.length - 1) {
272
+ this.yylineno -= lines.length - 1;
273
+ }
274
+ var r = this.yylloc.range;
275
+ this.yylloc = {
276
+ first_line: this.yylloc.first_line,
277
+ last_line: this.yylineno + 1,
278
+ first_column: this.yylloc.first_column,
279
+ last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
280
+ };
281
+ if (this.options.ranges) {
282
+ this.yylloc.range = [r[0], r[0] + this.yyleng - len];
283
+ }
284
+ this.yyleng = this.yytext.length;
285
+ return this;
286
+ }, "unput"),
287
+ // When called from action, caches matched text and appends it on next action
288
+ more: /* @__PURE__ */ __name(function() {
289
+ this._more = true;
290
+ return this;
291
+ }, "more"),
292
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
293
+ reject: /* @__PURE__ */ __name(function() {
294
+ if (this.options.backtrack_lexer) {
295
+ this._backtrack = true;
296
+ } else {
297
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), {
298
+ text: "",
299
+ token: null,
300
+ line: this.yylineno
301
+ });
302
+ }
303
+ return this;
304
+ }, "reject"),
305
+ // retain first n characters of the match
306
+ less: /* @__PURE__ */ __name(function(n) {
307
+ this.unput(this.match.slice(n));
308
+ }, "less"),
309
+ // displays already matched input, i.e. for error messages
310
+ pastInput: /* @__PURE__ */ __name(function() {
311
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
312
+ return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
313
+ }, "pastInput"),
314
+ // displays upcoming input, i.e. for error messages
315
+ upcomingInput: /* @__PURE__ */ __name(function() {
316
+ var next = this.match;
317
+ if (next.length < 20) {
318
+ next += this._input.substr(0, 20 - next.length);
319
+ }
320
+ return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
321
+ }, "upcomingInput"),
322
+ // displays the character position where the lexing error occurred, i.e. for error messages
323
+ showPosition: /* @__PURE__ */ __name(function() {
324
+ var pre = this.pastInput();
325
+ var c = new Array(pre.length + 1).join("-");
326
+ return pre + this.upcomingInput() + "\n" + c + "^";
327
+ }, "showPosition"),
328
+ // test the lexed token: return FALSE when not a match, otherwise return token
329
+ test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
330
+ var token, lines, backup;
331
+ if (this.options.backtrack_lexer) {
332
+ backup = {
333
+ yylineno: this.yylineno,
334
+ yylloc: {
335
+ first_line: this.yylloc.first_line,
336
+ last_line: this.last_line,
337
+ first_column: this.yylloc.first_column,
338
+ last_column: this.yylloc.last_column
339
+ },
340
+ yytext: this.yytext,
341
+ match: this.match,
342
+ matches: this.matches,
343
+ matched: this.matched,
344
+ yyleng: this.yyleng,
345
+ offset: this.offset,
346
+ _more: this._more,
347
+ _input: this._input,
348
+ yy: this.yy,
349
+ conditionStack: this.conditionStack.slice(0),
350
+ done: this.done
351
+ };
352
+ if (this.options.ranges) {
353
+ backup.yylloc.range = this.yylloc.range.slice(0);
354
+ }
355
+ }
356
+ lines = match[0].match(/(?:\r\n?|\n).*/g);
357
+ if (lines) {
358
+ this.yylineno += lines.length;
359
+ }
360
+ this.yylloc = {
361
+ first_line: this.yylloc.last_line,
362
+ last_line: this.yylineno + 1,
363
+ first_column: this.yylloc.last_column,
364
+ last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
365
+ };
366
+ this.yytext += match[0];
367
+ this.match += match[0];
368
+ this.matches = match;
369
+ this.yyleng = this.yytext.length;
370
+ if (this.options.ranges) {
371
+ this.yylloc.range = [this.offset, this.offset += this.yyleng];
372
+ }
373
+ this._more = false;
374
+ this._backtrack = false;
375
+ this._input = this._input.slice(match[0].length);
376
+ this.matched += match[0];
377
+ token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
378
+ if (this.done && this._input) {
379
+ this.done = false;
380
+ }
381
+ if (token) {
382
+ return token;
383
+ } else if (this._backtrack) {
384
+ for (var k in backup) {
385
+ this[k] = backup[k];
386
+ }
387
+ return false;
388
+ }
389
+ return false;
390
+ }, "test_match"),
391
+ // return next match in input
392
+ next: /* @__PURE__ */ __name(function() {
393
+ if (this.done) {
394
+ return this.EOF;
395
+ }
396
+ if (!this._input) {
397
+ this.done = true;
398
+ }
399
+ var token, match, tempMatch, index;
400
+ if (!this._more) {
401
+ this.yytext = "";
402
+ this.match = "";
403
+ }
404
+ var rules = this._currentRules();
405
+ for (var i = 0; i < rules.length; i++) {
406
+ tempMatch = this._input.match(this.rules[rules[i]]);
407
+ if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
408
+ match = tempMatch;
409
+ index = i;
410
+ if (this.options.backtrack_lexer) {
411
+ token = this.test_match(tempMatch, rules[i]);
412
+ if (token !== false) {
413
+ return token;
414
+ } else if (this._backtrack) {
415
+ match = false;
416
+ continue;
417
+ } else {
418
+ return false;
419
+ }
420
+ } else if (!this.options.flex) {
421
+ break;
422
+ }
423
+ }
424
+ }
425
+ if (match) {
426
+ token = this.test_match(match, rules[index]);
427
+ if (token !== false) {
428
+ return token;
429
+ }
430
+ return false;
431
+ }
432
+ if (this._input === "") {
433
+ return this.EOF;
434
+ } else {
435
+ return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
436
+ text: "",
437
+ token: null,
438
+ line: this.yylineno
439
+ });
440
+ }
441
+ }, "next"),
442
+ // return next match that has a token
443
+ lex: /* @__PURE__ */ __name(function lex() {
444
+ var r = this.next();
445
+ if (r) {
446
+ return r;
447
+ } else {
448
+ return this.lex();
449
+ }
450
+ }, "lex"),
451
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
452
+ begin: /* @__PURE__ */ __name(function begin(condition) {
453
+ this.conditionStack.push(condition);
454
+ }, "begin"),
455
+ // pop the previously active lexer condition state off the condition stack
456
+ popState: /* @__PURE__ */ __name(function popState() {
457
+ var n = this.conditionStack.length - 1;
458
+ if (n > 0) {
459
+ return this.conditionStack.pop();
460
+ } else {
461
+ return this.conditionStack[0];
462
+ }
463
+ }, "popState"),
464
+ // produce the lexer rule set which is active for the currently active lexer condition state
465
+ _currentRules: /* @__PURE__ */ __name(function _currentRules() {
466
+ if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
467
+ return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
468
+ } else {
469
+ return this.conditions["INITIAL"].rules;
470
+ }
471
+ }, "_currentRules"),
472
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
473
+ topState: /* @__PURE__ */ __name(function topState(n) {
474
+ n = this.conditionStack.length - 1 - Math.abs(n || 0);
475
+ if (n >= 0) {
476
+ return this.conditionStack[n];
477
+ } else {
478
+ return "INITIAL";
479
+ }
480
+ }, "topState"),
481
+ // alias for begin(condition)
482
+ pushState: /* @__PURE__ */ __name(function pushState(condition) {
483
+ this.begin(condition);
484
+ }, "pushState"),
485
+ // return the number of states currently on the stack
486
+ stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
487
+ return this.conditionStack.length;
488
+ }, "stateStackSize"),
489
+ options: { "case-insensitive": true },
490
+ performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
491
+ switch ($avoiding_name_collisions) {
492
+ case 0:
493
+ break;
494
+ case 1:
495
+ break;
496
+ case 2:
497
+ return 10;
498
+ case 3:
499
+ break;
500
+ case 4:
501
+ break;
502
+ case 5:
503
+ return 4;
504
+ case 6:
505
+ return 11;
506
+ case 7:
507
+ this.begin("acc_title");
508
+ return 12;
509
+ case 8:
510
+ this.popState();
511
+ return "acc_title_value";
512
+ case 9:
513
+ this.begin("acc_descr");
514
+ return 14;
515
+ case 10:
516
+ this.popState();
517
+ return "acc_descr_value";
518
+ case 11:
519
+ this.begin("acc_descr_multiline");
520
+ break;
521
+ case 12:
522
+ this.popState();
523
+ break;
524
+ case 13:
525
+ return "acc_descr_multiline_value";
526
+ case 14:
527
+ return 17;
528
+ case 15:
529
+ return 21;
530
+ case 16:
531
+ return 20;
532
+ case 17:
533
+ return 6;
534
+ case 18:
535
+ return "INVALID";
536
+ }
537
+ }, "anonymous"),
538
+ rules: [/^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:timeline\b)/i, /^(?:title\s[^\n]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:section\s[^:\n]+)/i, /^(?::\s(?:[^:\n]|:(?!\s))+)/i, /^(?:[^#:\n]+)/i, /^(?:$)/i, /^(?:.)/i],
539
+ conditions: { "acc_descr_multiline": { "rules": [12, 13], "inclusive": false }, "acc_descr": { "rules": [10], "inclusive": false }, "acc_title": { "rules": [8], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18], "inclusive": true } }
540
+ };
541
+ return lexer2;
542
+ })();
543
+ parser2.lexer = lexer;
544
+ function Parser() {
545
+ this.yy = {};
546
+ }
547
+ __name(Parser, "Parser");
548
+ Parser.prototype = parser2;
549
+ parser2.Parser = Parser;
550
+ return new Parser();
551
+ })();
552
+ parser.parser = parser;
553
+ var timeline_default = parser;
554
+ var timelineDb_exports = {};
555
+ __export(timelineDb_exports, {
556
+ addEvent: () => addEvent,
557
+ addSection: () => addSection,
558
+ addTask: () => addTask,
559
+ addTaskOrg: () => addTaskOrg,
560
+ clear: () => clear2,
561
+ default: () => timelineDb_default,
562
+ getCommonDb: () => getCommonDb,
563
+ getSections: () => getSections,
564
+ getTasks: () => getTasks
565
+ });
566
+ var currentSection = "";
567
+ var currentTaskId = 0;
568
+ var sections = [];
569
+ var tasks = [];
570
+ var rawTasks = [];
571
+ var getCommonDb = /* @__PURE__ */ __name(() => commonDb_exports, "getCommonDb");
572
+ var clear2 = /* @__PURE__ */ __name(function() {
573
+ sections.length = 0;
574
+ tasks.length = 0;
575
+ currentSection = "";
576
+ rawTasks.length = 0;
577
+ clear();
578
+ }, "clear");
579
+ var addSection = /* @__PURE__ */ __name(function(txt) {
580
+ currentSection = txt;
581
+ sections.push(txt);
582
+ }, "addSection");
583
+ var getSections = /* @__PURE__ */ __name(function() {
584
+ return sections;
585
+ }, "getSections");
586
+ var getTasks = /* @__PURE__ */ __name(function() {
587
+ let allItemsProcessed = compileTasks();
588
+ const maxDepth = 100;
589
+ let iterationCount = 0;
590
+ while (!allItemsProcessed && iterationCount < maxDepth) {
591
+ allItemsProcessed = compileTasks();
592
+ iterationCount++;
593
+ }
594
+ tasks.push(...rawTasks);
595
+ return tasks;
596
+ }, "getTasks");
597
+ var addTask = /* @__PURE__ */ __name(function(period, length, event) {
598
+ const rawTask = {
599
+ id: currentTaskId++,
600
+ section: currentSection,
601
+ type: currentSection,
602
+ task: period,
603
+ score: length ? length : 0,
604
+ //if event is defined, then add it the events array
605
+ events: event ? [event] : []
606
+ };
607
+ rawTasks.push(rawTask);
608
+ }, "addTask");
609
+ var addEvent = /* @__PURE__ */ __name(function(event) {
610
+ const currentTask = rawTasks.find((task) => task.id === currentTaskId - 1);
611
+ currentTask.events.push(event);
612
+ }, "addEvent");
613
+ var addTaskOrg = /* @__PURE__ */ __name(function(descr) {
614
+ const newTask = {
615
+ section: currentSection,
616
+ type: currentSection,
617
+ description: descr,
618
+ task: descr,
619
+ classes: []
620
+ };
621
+ tasks.push(newTask);
622
+ }, "addTaskOrg");
623
+ var compileTasks = /* @__PURE__ */ __name(function() {
624
+ const compileTask = /* @__PURE__ */ __name(function(pos) {
625
+ return rawTasks[pos].processed;
626
+ }, "compileTask");
627
+ let allProcessed = true;
628
+ for (const [i, rawTask] of rawTasks.entries()) {
629
+ compileTask(i);
630
+ allProcessed = allProcessed && rawTask.processed;
631
+ }
632
+ return allProcessed;
633
+ }, "compileTasks");
634
+ var timelineDb_default = {
635
+ clear: clear2,
636
+ getCommonDb,
637
+ addSection,
638
+ getSections,
639
+ getTasks,
640
+ addTask,
641
+ addTaskOrg,
642
+ addEvent
643
+ };
644
+ var MAX_SECTIONS = 12;
645
+ var drawRect = /* @__PURE__ */ __name(function(elem, rectData) {
646
+ const rectElem = elem.append("rect");
647
+ rectElem.attr("x", rectData.x);
648
+ rectElem.attr("y", rectData.y);
649
+ rectElem.attr("fill", rectData.fill);
650
+ rectElem.attr("stroke", rectData.stroke);
651
+ rectElem.attr("width", rectData.width);
652
+ rectElem.attr("height", rectData.height);
653
+ rectElem.attr("rx", rectData.rx);
654
+ rectElem.attr("ry", rectData.ry);
655
+ if (rectData.class !== void 0) {
656
+ rectElem.attr("class", rectData.class);
657
+ }
658
+ return rectElem;
659
+ }, "drawRect");
660
+ var drawFace = /* @__PURE__ */ __name(function(element, faceData) {
661
+ const radius = 15;
662
+ const circleElement = element.append("circle").attr("cx", faceData.cx).attr("cy", faceData.cy).attr("class", "face").attr("r", radius).attr("stroke-width", 2).attr("overflow", "visible");
663
+ const face = element.append("g");
664
+ face.append("circle").attr("cx", faceData.cx - radius / 3).attr("cy", faceData.cy - radius / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666");
665
+ face.append("circle").attr("cx", faceData.cx + radius / 3).attr("cy", faceData.cy - radius / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666");
666
+ function smile(face2) {
667
+ const arc = d3arc().startAngle(Math.PI / 2).endAngle(3 * (Math.PI / 2)).innerRadius(radius / 2).outerRadius(radius / 2.2);
668
+ face2.append("path").attr("class", "mouth").attr("d", arc).attr("transform", "translate(" + faceData.cx + "," + (faceData.cy + 2) + ")");
669
+ }
670
+ __name(smile, "smile");
671
+ function sad(face2) {
672
+ const arc = d3arc().startAngle(3 * Math.PI / 2).endAngle(5 * (Math.PI / 2)).innerRadius(radius / 2).outerRadius(radius / 2.2);
673
+ face2.append("path").attr("class", "mouth").attr("d", arc).attr("transform", "translate(" + faceData.cx + "," + (faceData.cy + 7) + ")");
674
+ }
675
+ __name(sad, "sad");
676
+ function ambivalent(face2) {
677
+ face2.append("line").attr("class", "mouth").attr("stroke", 2).attr("x1", faceData.cx - 5).attr("y1", faceData.cy + 7).attr("x2", faceData.cx + 5).attr("y2", faceData.cy + 7).attr("class", "mouth").attr("stroke-width", "1px").attr("stroke", "#666");
678
+ }
679
+ __name(ambivalent, "ambivalent");
680
+ if (faceData.score > 3) {
681
+ smile(face);
682
+ } else if (faceData.score < 3) {
683
+ sad(face);
684
+ } else {
685
+ ambivalent(face);
686
+ }
687
+ return circleElement;
688
+ }, "drawFace");
689
+ var drawCircle = /* @__PURE__ */ __name(function(element, circleData) {
690
+ const circleElement = element.append("circle");
691
+ circleElement.attr("cx", circleData.cx);
692
+ circleElement.attr("cy", circleData.cy);
693
+ circleElement.attr("class", "actor-" + circleData.pos);
694
+ circleElement.attr("fill", circleData.fill);
695
+ circleElement.attr("stroke", circleData.stroke);
696
+ circleElement.attr("r", circleData.r);
697
+ if (circleElement.class !== void 0) {
698
+ circleElement.attr("class", circleElement.class);
699
+ }
700
+ if (circleData.title !== void 0) {
701
+ circleElement.append("title").text(circleData.title);
702
+ }
703
+ return circleElement;
704
+ }, "drawCircle");
705
+ var drawText = /* @__PURE__ */ __name(function(elem, textData) {
706
+ const nText = textData.text.replace(/<br\s*\/?>/gi, " ");
707
+ const textElem = elem.append("text");
708
+ textElem.attr("x", textData.x);
709
+ textElem.attr("y", textData.y);
710
+ textElem.attr("class", "legend");
711
+ textElem.style("text-anchor", textData.anchor);
712
+ if (textData.class !== void 0) {
713
+ textElem.attr("class", textData.class);
714
+ }
715
+ const span = textElem.append("tspan");
716
+ span.attr("x", textData.x + textData.textMargin * 2);
717
+ span.text(nText);
718
+ return textElem;
719
+ }, "drawText");
720
+ var drawLabel = /* @__PURE__ */ __name(function(elem, txtObject) {
721
+ function genPoints(x, y, width, height, cut) {
722
+ return x + "," + y + " " + (x + width) + "," + y + " " + (x + width) + "," + (y + height - cut) + " " + (x + width - cut * 1.2) + "," + (y + height) + " " + x + "," + (y + height);
723
+ }
724
+ __name(genPoints, "genPoints");
725
+ const polygon = elem.append("polygon");
726
+ polygon.attr("points", genPoints(txtObject.x, txtObject.y, 50, 20, 7));
727
+ polygon.attr("class", "labelBox");
728
+ txtObject.y = txtObject.y + txtObject.labelMargin;
729
+ txtObject.x = txtObject.x + 0.5 * txtObject.labelMargin;
730
+ drawText(elem, txtObject);
731
+ }, "drawLabel");
732
+ var drawSection = /* @__PURE__ */ __name(function(elem, section, conf) {
733
+ const g = elem.append("g");
734
+ const rect = getNoteRect();
735
+ rect.x = section.x;
736
+ rect.y = section.y;
737
+ rect.fill = section.fill;
738
+ rect.width = conf.width;
739
+ rect.height = conf.height;
740
+ rect.class = "journey-section section-type-" + section.num;
741
+ rect.rx = 3;
742
+ rect.ry = 3;
743
+ drawRect(g, rect);
744
+ _drawTextCandidateFunc(conf)(
745
+ section.text,
746
+ g,
747
+ rect.x,
748
+ rect.y,
749
+ rect.width,
750
+ rect.height,
751
+ { class: "journey-section section-type-" + section.num },
752
+ conf,
753
+ section.colour
754
+ );
755
+ }, "drawSection");
756
+ var taskCount = -1;
757
+ var drawTask = /* @__PURE__ */ __name(function(elem, task, conf) {
758
+ const center = task.x + conf.width / 2;
759
+ const g = elem.append("g");
760
+ taskCount++;
761
+ const maxHeight = 300 + 5 * 30;
762
+ g.append("line").attr("id", "task" + taskCount).attr("x1", center).attr("y1", task.y).attr("x2", center).attr("y2", maxHeight).attr("class", "task-line").attr("stroke-width", "1px").attr("stroke-dasharray", "4 2").attr("stroke", "#666");
763
+ drawFace(g, {
764
+ cx: center,
765
+ cy: 300 + (5 - task.score) * 30,
766
+ score: task.score
767
+ });
768
+ const rect = getNoteRect();
769
+ rect.x = task.x;
770
+ rect.y = task.y;
771
+ rect.fill = task.fill;
772
+ rect.width = conf.width;
773
+ rect.height = conf.height;
774
+ rect.class = "task task-type-" + task.num;
775
+ rect.rx = 3;
776
+ rect.ry = 3;
777
+ drawRect(g, rect);
778
+ _drawTextCandidateFunc(conf)(
779
+ task.task,
780
+ g,
781
+ rect.x,
782
+ rect.y,
783
+ rect.width,
784
+ rect.height,
785
+ { class: "task" },
786
+ conf,
787
+ task.colour
788
+ );
789
+ }, "drawTask");
790
+ var drawBackgroundRect = /* @__PURE__ */ __name(function(elem, bounds) {
791
+ const rectElem = drawRect(elem, {
792
+ x: bounds.startx,
793
+ y: bounds.starty,
794
+ width: bounds.stopx - bounds.startx,
795
+ height: bounds.stopy - bounds.starty,
796
+ fill: bounds.fill,
797
+ class: "rect"
798
+ });
799
+ rectElem.lower();
800
+ }, "drawBackgroundRect");
801
+ var getTextObj = /* @__PURE__ */ __name(function() {
802
+ return {
803
+ x: 0,
804
+ y: 0,
805
+ fill: void 0,
806
+ "text-anchor": "start",
807
+ width: 100,
808
+ height: 100,
809
+ textMargin: 0,
810
+ rx: 0,
811
+ ry: 0
812
+ };
813
+ }, "getTextObj");
814
+ var getNoteRect = /* @__PURE__ */ __name(function() {
815
+ return {
816
+ x: 0,
817
+ y: 0,
818
+ width: 100,
819
+ anchor: "start",
820
+ height: 100,
821
+ rx: 0,
822
+ ry: 0
823
+ };
824
+ }, "getNoteRect");
825
+ var _drawTextCandidateFunc = /* @__PURE__ */ (function() {
826
+ function byText(content, g, x, y, width, height, textAttrs, colour) {
827
+ const text = g.append("text").attr("x", x + width / 2).attr("y", y + height / 2 + 5).style("font-color", colour).style("text-anchor", "middle").text(content);
828
+ _setTextAttrs(text, textAttrs);
829
+ }
830
+ __name(byText, "byText");
831
+ function byTspan(content, g, x, y, width, height, textAttrs, conf, colour) {
832
+ const { taskFontSize, taskFontFamily } = conf;
833
+ const lines = content.split(/<br\s*\/?>/gi);
834
+ for (let i = 0; i < lines.length; i++) {
835
+ const dy = i * taskFontSize - taskFontSize * (lines.length - 1) / 2;
836
+ const text = g.append("text").attr("x", x + width / 2).attr("y", y).attr("fill", colour).style("text-anchor", "middle").style("font-size", taskFontSize).style("font-family", taskFontFamily);
837
+ text.append("tspan").attr("x", x + width / 2).attr("dy", dy).text(lines[i]);
838
+ text.attr("y", y + height / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central");
839
+ _setTextAttrs(text, textAttrs);
840
+ }
841
+ }
842
+ __name(byTspan, "byTspan");
843
+ function byFo(content, g, x, y, width, height, textAttrs, conf) {
844
+ const body = g.append("switch");
845
+ const f = body.append("foreignObject").attr("x", x).attr("y", y).attr("width", width).attr("height", height).attr("position", "fixed");
846
+ const text = f.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
847
+ text.append("div").attr("class", "label").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content);
848
+ byTspan(content, body, x, y, width, height, textAttrs, conf);
849
+ _setTextAttrs(text, textAttrs);
850
+ }
851
+ __name(byFo, "byFo");
852
+ function _setTextAttrs(toText, fromTextAttrsDict) {
853
+ for (const key in fromTextAttrsDict) {
854
+ if (key in fromTextAttrsDict) {
855
+ toText.attr(key, fromTextAttrsDict[key]);
856
+ }
857
+ }
858
+ }
859
+ __name(_setTextAttrs, "_setTextAttrs");
860
+ return function(conf) {
861
+ return conf.textPlacement === "fo" ? byFo : conf.textPlacement === "old" ? byText : byTspan;
862
+ };
863
+ })();
864
+ var initGraphics = /* @__PURE__ */ __name(function(graphics) {
865
+ graphics.append("defs").append("marker").attr("id", "arrowhead").attr("refX", 5).attr("refY", 2).attr("markerWidth", 6).attr("markerHeight", 4).attr("orient", "auto").append("path").attr("d", "M 0,0 V 4 L6,2 Z");
866
+ }, "initGraphics");
867
+ function wrap(text, width) {
868
+ text.each(function() {
869
+ var text2 = select(this), words = text2.text().split(/(\s+|<br>)/).reverse(), word, line = [], lineHeight = 1.1, y = text2.attr("y"), dy = parseFloat(text2.attr("dy")), tspan = text2.text(null).append("tspan").attr("x", 0).attr("y", y).attr("dy", dy + "em");
870
+ for (let j = 0; j < words.length; j++) {
871
+ word = words[words.length - 1 - j];
872
+ line.push(word);
873
+ tspan.text(line.join(" ").trim());
874
+ if (tspan.node().getComputedTextLength() > width || word === "<br>") {
875
+ line.pop();
876
+ tspan.text(line.join(" ").trim());
877
+ if (word === "<br>") {
878
+ line = [""];
879
+ } else {
880
+ line = [word];
881
+ }
882
+ tspan = text2.append("tspan").attr("x", 0).attr("y", y).attr("dy", lineHeight + "em").text(word);
883
+ }
884
+ }
885
+ });
886
+ }
887
+ __name(wrap, "wrap");
888
+ var drawNode = /* @__PURE__ */ __name(function(elem, node, fullSection, conf) {
889
+ const section = fullSection % MAX_SECTIONS - 1;
890
+ const nodeElem = elem.append("g");
891
+ node.section = section;
892
+ nodeElem.attr(
893
+ "class",
894
+ (node.class ? node.class + " " : "") + "timeline-node " + ("section-" + section)
895
+ );
896
+ const bkgElem = nodeElem.append("g");
897
+ const textElem = nodeElem.append("g");
898
+ const txt = textElem.append("text").text(node.descr).attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle").call(wrap, node.width);
899
+ const bbox = txt.node().getBBox();
900
+ const fontSize = conf.fontSize?.replace ? conf.fontSize.replace("px", "") : conf.fontSize;
901
+ node.height = bbox.height + fontSize * 1.1 * 0.5 + node.padding;
902
+ node.height = Math.max(node.height, node.maxHeight);
903
+ node.width = node.width + 2 * node.padding;
904
+ textElem.attr("transform", "translate(" + node.width / 2 + ", " + node.padding / 2 + ")");
905
+ defaultBkg(bkgElem, node, section, conf);
906
+ return node;
907
+ }, "drawNode");
908
+ var getVirtualNodeHeight = /* @__PURE__ */ __name(function(elem, node, conf) {
909
+ const textElem = elem.append("g");
910
+ const txt = textElem.append("text").text(node.descr).attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle").call(wrap, node.width);
911
+ const bbox = txt.node().getBBox();
912
+ const fontSize = conf.fontSize?.replace ? conf.fontSize.replace("px", "") : conf.fontSize;
913
+ textElem.remove();
914
+ return bbox.height + fontSize * 1.1 * 0.5 + node.padding;
915
+ }, "getVirtualNodeHeight");
916
+ var defaultBkg = /* @__PURE__ */ __name(function(elem, node, section) {
917
+ const rd = 5;
918
+ elem.append("path").attr("id", "node-" + node.id).attr("class", "node-bkg node-" + node.type).attr(
919
+ "d",
920
+ `M0 ${node.height - rd} v${-node.height + 2 * rd} q0,-5 5,-5 h${node.width - 2 * rd} q5,0 5,5 v${node.height - rd} H0 Z`
921
+ );
922
+ elem.append("line").attr("class", "node-line-" + section).attr("x1", 0).attr("y1", node.height).attr("x2", node.width).attr("y2", node.height);
923
+ }, "defaultBkg");
924
+ var svgDraw_default = {
925
+ drawRect,
926
+ drawCircle,
927
+ drawSection,
928
+ drawText,
929
+ drawLabel,
930
+ drawTask,
931
+ drawBackgroundRect,
932
+ getTextObj,
933
+ getNoteRect,
934
+ initGraphics,
935
+ drawNode,
936
+ getVirtualNodeHeight
937
+ };
938
+ var draw = /* @__PURE__ */ __name(function(text, id, version, diagObj) {
939
+ const conf = getConfig2();
940
+ const LEFT_MARGIN = conf.timeline?.leftMargin ?? 50;
941
+ log.debug("timeline", diagObj.db);
942
+ const securityLevel = conf.securityLevel;
943
+ let sandboxElement;
944
+ if (securityLevel === "sandbox") {
945
+ sandboxElement = select("#i" + id);
946
+ }
947
+ const root = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body");
948
+ const svg = root.select("#" + id);
949
+ svg.append("g");
950
+ const tasks2 = diagObj.db.getTasks();
951
+ const title = diagObj.db.getCommonDb().getDiagramTitle();
952
+ log.debug("task", tasks2);
953
+ svgDraw_default.initGraphics(svg);
954
+ const sections2 = diagObj.db.getSections();
955
+ log.debug("sections", sections2);
956
+ let maxSectionHeight = 0;
957
+ let maxTaskHeight = 0;
958
+ let depthY = 0;
959
+ let sectionBeginY = 0;
960
+ let masterX = 50 + LEFT_MARGIN;
961
+ let masterY = 50;
962
+ sectionBeginY = 50;
963
+ let sectionNumber = 0;
964
+ let hasSections = true;
965
+ sections2.forEach(function(section) {
966
+ const sectionNode = {
967
+ number: sectionNumber,
968
+ descr: section,
969
+ section: sectionNumber,
970
+ width: 150,
971
+ padding: 20,
972
+ maxHeight: maxSectionHeight
973
+ };
974
+ const sectionHeight = svgDraw_default.getVirtualNodeHeight(svg, sectionNode, conf);
975
+ log.debug("sectionHeight before draw", sectionHeight);
976
+ maxSectionHeight = Math.max(maxSectionHeight, sectionHeight + 20);
977
+ });
978
+ let maxEventCount = 0;
979
+ let maxEventLineLength = 0;
980
+ log.debug("tasks.length", tasks2.length);
981
+ for (const [i, task] of tasks2.entries()) {
982
+ const taskNode = {
983
+ number: i,
984
+ descr: task,
985
+ section: task.section,
986
+ width: 150,
987
+ padding: 20,
988
+ maxHeight: maxTaskHeight
989
+ };
990
+ const taskHeight = svgDraw_default.getVirtualNodeHeight(svg, taskNode, conf);
991
+ log.debug("taskHeight before draw", taskHeight);
992
+ maxTaskHeight = Math.max(maxTaskHeight, taskHeight + 20);
993
+ maxEventCount = Math.max(maxEventCount, task.events.length);
994
+ let maxEventLineLengthTemp = 0;
995
+ for (const event of task.events) {
996
+ const eventNode = {
997
+ descr: event,
998
+ section: task.section,
999
+ number: task.section,
1000
+ width: 150,
1001
+ padding: 20,
1002
+ maxHeight: 50
1003
+ };
1004
+ maxEventLineLengthTemp += svgDraw_default.getVirtualNodeHeight(svg, eventNode, conf);
1005
+ }
1006
+ if (task.events.length > 0) {
1007
+ maxEventLineLengthTemp += (task.events.length - 1) * 10;
1008
+ }
1009
+ maxEventLineLength = Math.max(maxEventLineLength, maxEventLineLengthTemp);
1010
+ }
1011
+ log.debug("maxSectionHeight before draw", maxSectionHeight);
1012
+ log.debug("maxTaskHeight before draw", maxTaskHeight);
1013
+ if (sections2 && sections2.length > 0) {
1014
+ sections2.forEach((section) => {
1015
+ const tasksForSection = tasks2.filter((task) => task.section === section);
1016
+ const sectionNode = {
1017
+ number: sectionNumber,
1018
+ descr: section,
1019
+ section: sectionNumber,
1020
+ width: 200 * Math.max(tasksForSection.length, 1) - 50,
1021
+ padding: 20,
1022
+ maxHeight: maxSectionHeight
1023
+ };
1024
+ log.debug("sectionNode", sectionNode);
1025
+ const sectionNodeWrapper = svg.append("g");
1026
+ const node = svgDraw_default.drawNode(sectionNodeWrapper, sectionNode, sectionNumber, conf);
1027
+ log.debug("sectionNode output", node);
1028
+ sectionNodeWrapper.attr("transform", `translate(${masterX}, ${sectionBeginY})`);
1029
+ masterY += maxSectionHeight + 50;
1030
+ if (tasksForSection.length > 0) {
1031
+ drawTasks(
1032
+ svg,
1033
+ tasksForSection,
1034
+ sectionNumber,
1035
+ masterX,
1036
+ masterY,
1037
+ maxTaskHeight,
1038
+ conf,
1039
+ maxEventCount,
1040
+ maxEventLineLength,
1041
+ maxSectionHeight,
1042
+ false
1043
+ );
1044
+ }
1045
+ masterX += 200 * Math.max(tasksForSection.length, 1);
1046
+ masterY = sectionBeginY;
1047
+ sectionNumber++;
1048
+ });
1049
+ } else {
1050
+ hasSections = false;
1051
+ drawTasks(
1052
+ svg,
1053
+ tasks2,
1054
+ sectionNumber,
1055
+ masterX,
1056
+ masterY,
1057
+ maxTaskHeight,
1058
+ conf,
1059
+ maxEventCount,
1060
+ maxEventLineLength,
1061
+ maxSectionHeight,
1062
+ true
1063
+ );
1064
+ }
1065
+ const box = svg.node().getBBox();
1066
+ log.debug("bounds", box);
1067
+ if (title) {
1068
+ svg.append("text").text(title).attr("x", box.width / 2 - LEFT_MARGIN).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 20);
1069
+ }
1070
+ depthY = hasSections ? maxSectionHeight + maxTaskHeight + 150 : maxTaskHeight + 100;
1071
+ const lineWrapper = svg.append("g").attr("class", "lineWrapper");
1072
+ lineWrapper.append("line").attr("x1", LEFT_MARGIN).attr("y1", depthY).attr("x2", box.width + 3 * LEFT_MARGIN).attr("y2", depthY).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", "url(#arrowhead)");
1073
+ setupGraphViewbox(
1074
+ void 0,
1075
+ svg,
1076
+ conf.timeline?.padding ?? 50,
1077
+ conf.timeline?.useMaxWidth ?? false
1078
+ );
1079
+ }, "draw");
1080
+ var drawTasks = /* @__PURE__ */ __name(function(diagram2, tasks2, sectionColor, masterX, masterY, maxTaskHeight, conf, maxEventCount, maxEventLineLength, maxSectionHeight, isWithoutSections) {
1081
+ for (const task of tasks2) {
1082
+ const taskNode = {
1083
+ descr: task.task,
1084
+ section: sectionColor,
1085
+ number: sectionColor,
1086
+ width: 150,
1087
+ padding: 20,
1088
+ maxHeight: maxTaskHeight
1089
+ };
1090
+ log.debug("taskNode", taskNode);
1091
+ const taskWrapper = diagram2.append("g").attr("class", "taskWrapper");
1092
+ const node = svgDraw_default.drawNode(taskWrapper, taskNode, sectionColor, conf);
1093
+ const taskHeight = node.height;
1094
+ log.debug("taskHeight after draw", taskHeight);
1095
+ taskWrapper.attr("transform", `translate(${masterX}, ${masterY})`);
1096
+ maxTaskHeight = Math.max(maxTaskHeight, taskHeight);
1097
+ if (task.events) {
1098
+ const lineWrapper = diagram2.append("g").attr("class", "lineWrapper");
1099
+ let lineLength = maxTaskHeight;
1100
+ masterY += 100;
1101
+ lineLength = lineLength + drawEvents(diagram2, task.events, sectionColor, masterX, masterY, conf);
1102
+ masterY -= 100;
1103
+ lineWrapper.append("line").attr("x1", masterX + 190 / 2).attr("y1", masterY + maxTaskHeight).attr("x2", masterX + 190 / 2).attr("y2", masterY + maxTaskHeight + 100 + maxEventLineLength + 100).attr("stroke-width", 2).attr("stroke", "black").attr("marker-end", "url(#arrowhead)").attr("stroke-dasharray", "5,5");
1104
+ }
1105
+ masterX = masterX + 200;
1106
+ if (isWithoutSections && !conf.timeline?.disableMulticolor) {
1107
+ sectionColor++;
1108
+ }
1109
+ }
1110
+ masterY = masterY - 10;
1111
+ }, "drawTasks");
1112
+ var drawEvents = /* @__PURE__ */ __name(function(diagram2, events, sectionColor, masterX, masterY, conf) {
1113
+ let maxEventHeight = 0;
1114
+ const eventBeginY = masterY;
1115
+ masterY = masterY + 100;
1116
+ for (const event of events) {
1117
+ const eventNode = {
1118
+ descr: event,
1119
+ section: sectionColor,
1120
+ number: sectionColor,
1121
+ width: 150,
1122
+ padding: 20,
1123
+ maxHeight: 50
1124
+ };
1125
+ log.debug("eventNode", eventNode);
1126
+ const eventWrapper = diagram2.append("g").attr("class", "eventWrapper");
1127
+ const node = svgDraw_default.drawNode(eventWrapper, eventNode, sectionColor, conf);
1128
+ const eventHeight = node.height;
1129
+ maxEventHeight = maxEventHeight + eventHeight;
1130
+ eventWrapper.attr("transform", `translate(${masterX}, ${masterY})`);
1131
+ masterY = masterY + 10 + eventHeight;
1132
+ }
1133
+ masterY = eventBeginY;
1134
+ return maxEventHeight;
1135
+ }, "drawEvents");
1136
+ var timelineRenderer_default = {
1137
+ setConf: /* @__PURE__ */ __name(() => {
1138
+ }, "setConf"),
1139
+ draw
1140
+ };
1141
+ var genSections = /* @__PURE__ */ __name((options) => {
1142
+ let sections2 = "";
1143
+ for (let i = 0; i < options.THEME_COLOR_LIMIT; i++) {
1144
+ options["lineColor" + i] = options["lineColor" + i] || options["cScaleInv" + i];
1145
+ if (isDark(options["lineColor" + i])) {
1146
+ options["lineColor" + i] = lighten(options["lineColor" + i], 20);
1147
+ } else {
1148
+ options["lineColor" + i] = darken(options["lineColor" + i], 20);
1149
+ }
1150
+ }
1151
+ for (let i = 0; i < options.THEME_COLOR_LIMIT; i++) {
1152
+ const sw = "" + (17 - 3 * i);
1153
+ sections2 += `
1154
+ .section-${i - 1} rect, .section-${i - 1} path, .section-${i - 1} circle, .section-${i - 1} path {
1155
+ fill: ${options["cScale" + i]};
1156
+ }
1157
+ .section-${i - 1} text {
1158
+ fill: ${options["cScaleLabel" + i]};
1159
+ }
1160
+ .node-icon-${i - 1} {
1161
+ font-size: 40px;
1162
+ color: ${options["cScaleLabel" + i]};
1163
+ }
1164
+ .section-edge-${i - 1}{
1165
+ stroke: ${options["cScale" + i]};
1166
+ }
1167
+ .edge-depth-${i - 1}{
1168
+ stroke-width: ${sw};
1169
+ }
1170
+ .section-${i - 1} line {
1171
+ stroke: ${options["cScaleInv" + i]} ;
1172
+ stroke-width: 3;
1173
+ }
1174
+
1175
+ .lineWrapper line{
1176
+ stroke: ${options["cScaleLabel" + i]} ;
1177
+ }
1178
+
1179
+ .disabled, .disabled circle, .disabled text {
1180
+ fill: lightgray;
1181
+ }
1182
+ .disabled text {
1183
+ fill: #efefef;
1184
+ }
1185
+ `;
1186
+ }
1187
+ return sections2;
1188
+ }, "genSections");
1189
+ var getStyles = /* @__PURE__ */ __name((options) => `
1190
+ .edge {
1191
+ stroke-width: 3;
1192
+ }
1193
+ ${genSections(options)}
1194
+ .section-root rect, .section-root path, .section-root circle {
1195
+ fill: ${options.git0};
1196
+ }
1197
+ .section-root text {
1198
+ fill: ${options.gitBranchLabel0};
1199
+ }
1200
+ .icon-container {
1201
+ height:100%;
1202
+ display: flex;
1203
+ justify-content: center;
1204
+ align-items: center;
1205
+ }
1206
+ .edge {
1207
+ fill: none;
1208
+ }
1209
+ .eventWrapper {
1210
+ filter: brightness(120%);
1211
+ }
1212
+ `, "getStyles");
1213
+ var styles_default = getStyles;
1214
+ var diagram = {
1215
+ db: timelineDb_exports,
1216
+ renderer: timelineRenderer_default,
1217
+ parser: timeline_default,
1218
+ styles: styles_default
1219
+ };
1220
+ export {
1221
+ diagram
1222
+ };
1223
+ //# sourceMappingURL=timeline-definition-IT6M3QCI-C3KODUrh.js.map