@scalar/agent-chat 0.2.3 → 0.2.6

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 (270) hide show
  1. package/LICENSE +21 -0
  2. package/dist/App.vue.d.ts +3 -2
  3. package/dist/App.vue.d.ts.map +1 -1
  4. package/dist/App.vue.js +32 -0
  5. package/dist/App.vue2.js +4 -0
  6. package/dist/Chat.vue.d.ts.map +1 -1
  7. package/dist/Chat.vue.js +23 -0
  8. package/dist/Chat.vue2.js +4 -0
  9. package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
  10. package/dist/api.d.ts +50 -0
  11. package/dist/api.d.ts.map +1 -0
  12. package/dist/api.js +68 -0
  13. package/dist/components/ApprovalSection.vue.d.ts.map +1 -1
  14. package/dist/components/ApprovalSection.vue.js +7 -0
  15. package/dist/components/ApprovalSection.vue2.js +42 -0
  16. package/dist/components/AuthenticationProvided.vue.d.ts +3 -0
  17. package/dist/components/AuthenticationProvided.vue.d.ts.map +1 -0
  18. package/dist/components/AuthenticationProvided.vue.js +13 -0
  19. package/dist/components/AuthenticationRequired.vue.d.ts +3 -0
  20. package/dist/components/AuthenticationRequired.vue.d.ts.map +1 -0
  21. package/dist/components/AuthenticationRequired.vue.js +13 -0
  22. package/dist/components/AutosendPaused.vue.d.ts.map +1 -1
  23. package/dist/components/AutosendPaused.vue.js +13 -0
  24. package/dist/components/ContextItem.vue.d.ts.map +1 -1
  25. package/dist/components/ContextItem.vue.js +7 -0
  26. package/dist/components/ContextItem.vue2.js +19 -0
  27. package/dist/components/ErrorMessage.vue.d.ts +2 -1
  28. package/dist/components/ErrorMessage.vue.d.ts.map +1 -1
  29. package/dist/components/ErrorMessage.vue.js +7 -0
  30. package/dist/components/ErrorMessage.vue2.js +22 -0
  31. package/dist/components/LoadingMiniOpenAPIDoc.vue.d.ts.map +1 -1
  32. package/dist/components/LoadingMiniOpenAPIDoc.vue.js +14 -0
  33. package/dist/components/LoadingOpenAPISpecsSummary.vue.d.ts.map +1 -1
  34. package/dist/components/LoadingOpenAPISpecsSummary.vue.js +14 -0
  35. package/dist/components/Logo.vue.d.ts.map +1 -1
  36. package/dist/components/Logo.vue.js +23 -0
  37. package/dist/components/PaymentSection.vue.d.ts.map +1 -1
  38. package/dist/components/PaymentSection.vue.js +7 -0
  39. package/dist/components/PaymentSection.vue2.js +34 -0
  40. package/dist/components/RequestApproved.vue.d.ts.map +1 -1
  41. package/dist/components/RequestApproved.vue.js +13 -0
  42. package/dist/components/RequestFailed.vue.d.ts.map +1 -1
  43. package/dist/components/RequestFailed.vue.js +24 -0
  44. package/dist/components/RequestPreview.vue.d.ts +1 -1
  45. package/dist/components/RequestPreview.vue.d.ts.map +1 -1
  46. package/dist/components/RequestPreview.vue.js +7 -0
  47. package/dist/components/RequestPreview.vue2.js +123 -0
  48. package/dist/components/RequestRejected.vue.d.ts.map +1 -1
  49. package/dist/components/RequestRejected.vue.js +22 -0
  50. package/dist/components/RequestSuccess.vue.d.ts.map +1 -1
  51. package/dist/components/RequestSuccess.vue.js +13 -0
  52. package/dist/components/ResponseBody/ResponseBody.vue.d.ts +1 -1
  53. package/dist/components/ResponseBody/ResponseBody.vue.d.ts.map +1 -1
  54. package/dist/components/ResponseBody/ResponseBody.vue.js +41 -0
  55. package/dist/components/ResponseBody/ResponseBody.vue2.js +4 -0
  56. package/dist/components/ResponseBody/ResponseBodyInfo.vue.d.ts.map +1 -1
  57. package/dist/components/ResponseBody/ResponseBodyInfo.vue.js +14 -0
  58. package/dist/components/ResponseBody/ResponseBodyPreview.vue.d.ts +1 -1
  59. package/dist/components/ResponseBody/ResponseBodyPreview.vue.d.ts.map +1 -1
  60. package/dist/components/ResponseBody/ResponseBodyPreview.vue.js +7 -0
  61. package/dist/components/ResponseBody/ResponseBodyPreview.vue2.js +65 -0
  62. package/dist/components/ResponseBody/ResponseBodyRaw.vue.d.ts.map +1 -1
  63. package/dist/components/ResponseBody/ResponseBodyRaw.vue.js +20 -0
  64. package/dist/components/ResponseBody/ResponseBodyRaw.vue2.js +4 -0
  65. package/dist/components/ResponseBody/ResponseBodyToggle.vue.d.ts +2 -2
  66. package/dist/components/ResponseBody/ResponseBodyToggle.vue.d.ts.map +1 -1
  67. package/dist/components/ResponseBody/ResponseBodyToggle.vue.js +26 -0
  68. package/dist/components/ResponseBody/ResponseBodyToggle.vue2.js +4 -0
  69. package/dist/components/ResponseBody/helpers/media-types.js +130 -0
  70. package/dist/components/ResponseBody/helpers/process-response-body.d.ts +1 -1
  71. package/dist/components/ResponseBody/helpers/process-response-body.d.ts.map +1 -1
  72. package/dist/components/ResponseBody/helpers/process-response-body.js +33 -0
  73. package/dist/components/SearchPopover.vue.d.ts +2 -2
  74. package/dist/components/SearchPopover.vue.d.ts.map +1 -1
  75. package/dist/components/SearchPopover.vue.js +7 -0
  76. package/dist/components/SearchPopover.vue2.js +67 -0
  77. package/dist/components/Selector.vue.d.ts +24 -0
  78. package/dist/components/Selector.vue.d.ts.map +1 -0
  79. package/dist/components/Selector.vue.js +67 -0
  80. package/dist/components/Selector.vue2.js +4 -0
  81. package/dist/components/SendingRequest.vue.d.ts.map +1 -1
  82. package/dist/components/SendingRequest.vue.js +24 -0
  83. package/dist/components/ServerSelector.vue.d.ts +22 -0
  84. package/dist/components/ServerSelector.vue.d.ts.map +1 -0
  85. package/dist/components/ServerSelector.vue.js +57 -0
  86. package/dist/components/ServerSelector.vue2.js +4 -0
  87. package/dist/components/Suggestion.vue.d.ts.map +1 -1
  88. package/dist/components/TestRequestButton.vue.d.ts.map +1 -1
  89. package/dist/components/{Endpoint.vue.d.ts → UploadSection.vue.d.ts} +3 -5
  90. package/dist/components/UploadSection.vue.d.ts.map +1 -0
  91. package/dist/components/UploadSection.vue.js +7 -0
  92. package/dist/components/UploadSection.vue2.js +62 -0
  93. package/dist/entities/prompt/constants.d.ts +2 -0
  94. package/dist/entities/prompt/constants.d.ts.map +1 -0
  95. package/dist/entities/prompt/constants.js +4 -0
  96. package/dist/entities/registry/document.d.ts +21 -0
  97. package/dist/entities/registry/document.d.ts.map +1 -0
  98. package/dist/entities/registry/document.js +12 -0
  99. package/dist/entities/tools/ask-for-authentication.d.ts +7 -0
  100. package/dist/entities/tools/ask-for-authentication.d.ts.map +1 -0
  101. package/dist/entities/tools/ask-for-authentication.js +8 -0
  102. package/dist/entities/tools/constants.d.ts +2 -0
  103. package/dist/entities/tools/constants.d.ts.map +1 -0
  104. package/dist/entities/tools/constants.js +4 -0
  105. package/dist/entities/tools/execute-request.d.ts +42 -0
  106. package/dist/entities/tools/execute-request.d.ts.map +1 -0
  107. package/dist/entities/tools/execute-request.js +11 -0
  108. package/dist/entities/tools/get-mini-openapi-spec.d.ts +12 -0
  109. package/dist/entities/tools/get-mini-openapi-spec.d.ts.map +1 -0
  110. package/dist/entities/tools/get-mini-openapi-spec.js +8 -0
  111. package/dist/entities/tools/get-openapi-spec-summary.d.ts +10 -0
  112. package/dist/entities/tools/get-openapi-spec-summary.d.ts.map +1 -0
  113. package/dist/entities/tools/get-openapi-spec-summary.js +4 -0
  114. package/dist/helpers.d.ts +20 -12
  115. package/dist/helpers.d.ts.map +1 -1
  116. package/dist/helpers.js +122 -0
  117. package/dist/hooks/{useChatApprovals.d.ts → use-chat-approvals.d.ts} +1 -1
  118. package/dist/hooks/use-chat-approvals.d.ts.map +1 -0
  119. package/dist/hooks/use-chat-approvals.js +21 -0
  120. package/dist/hooks/use-chat-error.d.ts +14 -0
  121. package/dist/hooks/use-chat-error.d.ts.map +1 -0
  122. package/dist/hooks/use-chat-error.js +23 -0
  123. package/dist/hooks/use-chat-pending-client-tool-parts.d.ts +19 -0
  124. package/dist/hooks/use-chat-pending-client-tool-parts.d.ts.map +1 -0
  125. package/dist/hooks/use-chat-pending-client-tool-parts.js +12 -0
  126. package/dist/hooks/{useChatScroll.d.ts → use-chat-scroll.d.ts} +1 -1
  127. package/dist/hooks/use-chat-scroll.d.ts.map +1 -0
  128. package/dist/hooks/use-chat-scroll.js +16 -0
  129. package/dist/hooks/{useSearch.d.ts → use-search.d.ts} +11 -11
  130. package/dist/hooks/use-search.d.ts.map +1 -0
  131. package/dist/hooks/use-search.js +25 -0
  132. package/dist/hooks/use-term-and-conditions.d.ts +6 -0
  133. package/dist/hooks/use-term-and-conditions.d.ts.map +1 -0
  134. package/dist/hooks/use-term-and-conditions.js +16 -0
  135. package/dist/hooks/use-upload-tmp-document.d.ts +19 -0
  136. package/dist/hooks/use-upload-tmp-document.d.ts.map +1 -0
  137. package/dist/hooks/use-upload-tmp-document.js +64 -0
  138. package/dist/index.d.ts +2 -1
  139. package/dist/index.d.ts.map +1 -1
  140. package/dist/index.js +2 -1
  141. package/dist/package.json +34 -23
  142. package/dist/registry/add-documents-to-store.d.ts +6 -6
  143. package/dist/registry/add-documents-to-store.d.ts.map +1 -1
  144. package/dist/registry/add-documents-to-store.js +40 -0
  145. package/dist/registry/create-document-name.d.ts +2 -0
  146. package/dist/registry/create-document-name.d.ts.map +1 -0
  147. package/dist/registry/create-document-name.js +6 -0
  148. package/dist/state/state.d.ts +20 -8
  149. package/dist/state/state.d.ts.map +1 -1
  150. package/dist/state/state.js +110 -0
  151. package/dist/style.css +1 -1
  152. package/dist/types.d.ts +2 -0
  153. package/dist/types.d.ts.map +1 -0
  154. package/dist/views/Chat/Chat.vue.d.ts.map +1 -1
  155. package/dist/views/Chat/Chat.vue.js +7 -0
  156. package/dist/views/Chat/Chat.vue2.js +77 -0
  157. package/dist/views/Chat/Messages/AskForAuthentication.vue.d.ts +10 -0
  158. package/dist/views/Chat/Messages/AskForAuthentication.vue.d.ts.map +1 -0
  159. package/dist/views/Chat/Messages/AskForAuthentication.vue.js +7 -0
  160. package/dist/views/Chat/Messages/AskForAuthentication.vue2.js +93 -0
  161. package/dist/views/Chat/Messages/ExecuteRequestTool.vue.d.ts +2 -2
  162. package/dist/views/Chat/Messages/ExecuteRequestTool.vue.d.ts.map +1 -1
  163. package/dist/views/Chat/Messages/ExecuteRequestTool.vue.js +7 -0
  164. package/dist/views/Chat/Messages/ExecuteRequestTool.vue2.js +23 -0
  165. package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue.d.ts +2 -2
  166. package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue.d.ts.map +1 -1
  167. package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue.js +7 -0
  168. package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue2.js +56 -0
  169. package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.d.ts +2 -2
  170. package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.d.ts.map +1 -1
  171. package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.js +26 -0
  172. package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue2.js +4 -0
  173. package/dist/views/Chat/Messages/Text.vue.d.ts.map +1 -1
  174. package/dist/views/Chat/Messages/Text.vue.js +16 -0
  175. package/dist/views/Chat/Messages/Text.vue2.js +4 -0
  176. package/dist/views/Layout.vue.d.ts.map +1 -1
  177. package/dist/views/Layout.vue.js +7 -0
  178. package/dist/views/Layout.vue2.js +23 -0
  179. package/dist/views/PromptForm.vue.d.ts.map +1 -1
  180. package/dist/views/PromptForm.vue.js +7 -0
  181. package/dist/views/PromptForm.vue2.js +212 -0
  182. package/dist/views/Settings/Auth.vue.d.ts.map +1 -1
  183. package/dist/views/Settings/Auth.vue.js +67 -0
  184. package/dist/views/Settings/Auth.vue2.js +4 -0
  185. package/dist/views/Settings/DocSettings.vue.d.ts.map +1 -1
  186. package/dist/views/Settings/DocSettings.vue.js +7 -0
  187. package/dist/views/Settings/DocSettings.vue2.js +48 -0
  188. package/dist/views/Settings/Settings.vue.d.ts.map +1 -1
  189. package/dist/views/Settings/Settings.vue.js +8 -0
  190. package/dist/views/Settings/Settings.vue2.js +67 -0
  191. package/dist/views/Start.vue.d.ts.map +1 -1
  192. package/dist/views/Start.vue.js +7 -0
  193. package/dist/views/Start.vue2.js +41 -0
  194. package/package.json +52 -7
  195. package/dist/Tooltip-Cm82QgNj.js +0 -575
  196. package/dist/__vite-optional-peer-dep_stream-markdown_markstream-vue_false-sdjmOmXd.js +0 -5
  197. package/dist/__vite-optional-peer-dep_stream-monaco_markstream-vue_false-HdL4xm5U.js +0 -5
  198. package/dist/__vite-optional-peer-dep_vue-i18n_markstream-vue_false-B9Pwe5kz.js +0 -5
  199. package/dist/_basePickBy-hHD8tMGb.js +0 -151
  200. package/dist/_baseUniq-DTF1wuF6.js +0 -614
  201. package/dist/arc-Dw2RQerU.js +0 -83
  202. package/dist/architecture-U656AL7Q-B00Z9eXr.js +0 -36
  203. package/dist/architectureDiagram-VXUJARFQ-BtOffFaM.js +0 -4662
  204. package/dist/blockDiagram-VD42YOAC-BUqFMMQe.js +0 -2261
  205. package/dist/c4Diagram-YG6GDRKO-NrM1YcpG.js +0 -1579
  206. package/dist/channel-105myCGU.js +0 -5
  207. package/dist/chunk-4BX2VUAB-TAxJli7C.js +0 -8
  208. package/dist/chunk-55IACEB6-VXFJ4bz5.js +0 -8
  209. package/dist/chunk-B4BG7PRW-CZDQpfj5.js +0 -1375
  210. package/dist/chunk-DI55MBZ5-D3l7TA-E.js +0 -1370
  211. package/dist/chunk-FMBD7UC4-BMXFm8I3.js +0 -19
  212. package/dist/chunk-QN33PNHL-BOUpbpWp.js +0 -19
  213. package/dist/chunk-QZHKN3VN-C-TEEx05.js +0 -15
  214. package/dist/chunk-TZMSLE5B-BUiROKNR.js +0 -64
  215. package/dist/classDiagram-2ON5EDUG-HQET4ybK.js +0 -16
  216. package/dist/classDiagram-v2-WZHVMYZB-HQET4ybK.js +0 -16
  217. package/dist/clone-CIIO71O9.js +0 -8
  218. package/dist/components/Endpoint.vue.d.ts.map +0 -1
  219. package/dist/cose-bilkent-S5V4N54A-CMsF4n-5.js +0 -2609
  220. package/dist/cytoscape.esm-DfdJODL8.js +0 -18735
  221. package/dist/dagre-6UL2VRFP-DqzdQ6Qg.js +0 -444
  222. package/dist/defaultLocale-BEa-49Qz.js +0 -171
  223. package/dist/diagram-PSM6KHXK-1xyGntw2.js +0 -531
  224. package/dist/diagram-QEK2KX5R-DdZdlAm1.js +0 -217
  225. package/dist/diagram-S2PKOQOG-C80Eo2jp.js +0 -142
  226. package/dist/erDiagram-Q2GNP2WA-DFVRrMXT.js +0 -841
  227. package/dist/flowDiagram-NV44I4VS-D9QK_qqB.js +0 -1620
  228. package/dist/ganttDiagram-LVOFAZNH-Bo1NTkeQ.js +0 -2506
  229. package/dist/gitGraph-F6HP7TQM-C5hdgcgO.js +0 -27
  230. package/dist/gitGraphDiagram-NY62KEGX-BZqnqZh6.js +0 -699
  231. package/dist/graph-Dth4IhEK.js +0 -247
  232. package/dist/hooks/useChatApprovals.d.ts.map +0 -1
  233. package/dist/hooks/useChatOperationBlocks.d.ts +0 -3
  234. package/dist/hooks/useChatOperationBlocks.d.ts.map +0 -1
  235. package/dist/hooks/useChatScroll.d.ts.map +0 -1
  236. package/dist/hooks/useSearch.d.ts.map +0 -1
  237. package/dist/index-BOvT43H8.js +0 -111780
  238. package/dist/index2-B36B-gt0.js +0 -69
  239. package/dist/index3-CtIyYUnG.js +0 -70
  240. package/dist/index4-Dzz91Ao2.js +0 -537
  241. package/dist/index5-Bmz0gMSP.js +0 -590
  242. package/dist/index6-DMB3qTSV.js +0 -196
  243. package/dist/info-NVLQJR56-azt5obk5.js +0 -27
  244. package/dist/infoDiagram-ER5ION4S-DD4Jtctm.js +0 -24
  245. package/dist/infographic_markstream-vue_false-BfsmcXxk.js +0 -5
  246. package/dist/init-DjUOC4st.js +0 -16
  247. package/dist/journeyDiagram-XKPGCS4Q-CXL6UO0r.js +0 -834
  248. package/dist/kanban-definition-3W4ZIXB7-B57do5Wg.js +0 -719
  249. package/dist/katex-SsTUIUTC.js +0 -11688
  250. package/dist/layout-7TCY8eA2.js +0 -1332
  251. package/dist/linear-DSm5i91N.js +0 -625
  252. package/dist/mermaid-parser.core-CUQWpAMM.js +0 -12746
  253. package/dist/mermaid.core-QjuzH7xx.js +0 -14164
  254. package/dist/mhchem-XHl7cef5.js +0 -2306
  255. package/dist/mindmap-definition-VGOIOE7T-DAQyGNAM.js +0 -784
  256. package/dist/ordinal-DfAQgscy.js +0 -61
  257. package/dist/packet-BFZMPI3H-CixuxAEA.js +0 -27
  258. package/dist/pie-7BOR55EZ-D3cgnzR1.js +0 -32
  259. package/dist/pieDiagram-ADFJNKIX-BqxgYwrL.js +0 -161
  260. package/dist/quadrantDiagram-AYHSOK5B-CQ4v-9Hh.js +0 -1022
  261. package/dist/radar-NHE76QYJ-DhV0Od_M.js +0 -27
  262. package/dist/requirementDiagram-UZGBJVZJ-ncWNAgFi.js +0 -850
  263. package/dist/safeRaf-I3a3-dyJ.js +0 -10
  264. package/dist/sankeyDiagram-TZEHDZUN-yCR2_cH5.js +0 -810
  265. package/dist/sequenceDiagram-WL72ISMW-DZ7wqFyd.js +0 -2511
  266. package/dist/stateDiagram-FKZM4ZOC-Dra68Tzi.js +0 -263
  267. package/dist/stateDiagram-v2-4FDKWEC3-CARbPECD.js +0 -16
  268. package/dist/timeline-definition-IT6M3QCI-DEbG9QIM.js +0 -795
  269. package/dist/treemap-KMMF4GRG-CQbPsyWe.js +0 -81
  270. package/dist/xychartDiagram-PRI3JC2R-C94Pu8hL.js +0 -1340
@@ -1,795 +0,0 @@
1
- import { _ as s, c as xt, l as E, d as j, V as kt, W as vt, X as _t, Y as bt, B as wt, $ as St, y as Et } from "./mermaid.core-QjuzH7xx.js";
2
- import { d as nt } from "./arc-Dw2RQerU.js";
3
- var Q = (function() {
4
- var n = /* @__PURE__ */ s(function(x, r, a, c) {
5
- for (a = a || {}, c = x.length; c--; a[x[c]] = r) ;
6
- return a;
7
- }, "o"), t = [6, 8, 10, 11, 12, 14, 16, 17, 20, 21], e = [1, 9], l = [1, 10], i = [1, 11], d = [1, 12], h = [1, 13], f = [1, 16], m = [1, 17], p = {
8
- trace: /* @__PURE__ */ s(function() {
9
- }, "trace"),
10
- yy: {},
11
- 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 },
12
- 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" },
13
- 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]],
14
- performAction: /* @__PURE__ */ s(function(r, a, c, u, y, o, w) {
15
- var v = o.length - 1;
16
- switch (y) {
17
- case 1:
18
- return o[v - 1];
19
- case 2:
20
- this.$ = [];
21
- break;
22
- case 3:
23
- o[v - 1].push(o[v]), this.$ = o[v - 1];
24
- break;
25
- case 4:
26
- case 5:
27
- this.$ = o[v];
28
- break;
29
- case 6:
30
- case 7:
31
- this.$ = [];
32
- break;
33
- case 8:
34
- u.getCommonDb().setDiagramTitle(o[v].substr(6)), this.$ = o[v].substr(6);
35
- break;
36
- case 9:
37
- this.$ = o[v].trim(), u.getCommonDb().setAccTitle(this.$);
38
- break;
39
- case 10:
40
- case 11:
41
- this.$ = o[v].trim(), u.getCommonDb().setAccDescription(this.$);
42
- break;
43
- case 12:
44
- u.addSection(o[v].substr(8)), this.$ = o[v].substr(8);
45
- break;
46
- case 15:
47
- u.addTask(o[v], 0, ""), this.$ = o[v];
48
- break;
49
- case 16:
50
- u.addEvent(o[v].substr(2)), this.$ = o[v];
51
- break;
52
- }
53
- }, "anonymous"),
54
- table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, n(t, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: [1, 6], 9: 7, 10: [1, 8], 11: e, 12: l, 14: i, 16: d, 17: h, 18: 14, 19: 15, 20: f, 21: m }, n(t, [2, 7], { 1: [2, 1] }), n(t, [2, 3]), { 9: 18, 11: e, 12: l, 14: i, 16: d, 17: h, 18: 14, 19: 15, 20: f, 21: m }, n(t, [2, 5]), n(t, [2, 6]), n(t, [2, 8]), { 13: [1, 19] }, { 15: [1, 20] }, n(t, [2, 11]), n(t, [2, 12]), n(t, [2, 13]), n(t, [2, 14]), n(t, [2, 15]), n(t, [2, 16]), n(t, [2, 4]), n(t, [2, 9]), n(t, [2, 10])],
55
- defaultActions: {},
56
- parseError: /* @__PURE__ */ s(function(r, a) {
57
- if (a.recoverable)
58
- this.trace(r);
59
- else {
60
- var c = new Error(r);
61
- throw c.hash = a, c;
62
- }
63
- }, "parseError"),
64
- parse: /* @__PURE__ */ s(function(r) {
65
- var a = this, c = [0], u = [], y = [null], o = [], w = this.table, v = "", N = 0, P = 0, W = 2, U = 1, H = o.slice.call(arguments, 1), g = Object.create(this.lexer), b = { yy: {} };
66
- for (var L in this.yy)
67
- Object.prototype.hasOwnProperty.call(this.yy, L) && (b.yy[L] = this.yy[L]);
68
- g.setInput(r, b.yy), b.yy.lexer = g, b.yy.parser = this, typeof g.yylloc > "u" && (g.yylloc = {});
69
- var $ = g.yylloc;
70
- o.push($);
71
- var z = g.options && g.options.ranges;
72
- typeof b.yy.parseError == "function" ? this.parseError = b.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
73
- function Z(T) {
74
- c.length = c.length - 2 * T, y.length = y.length - T, o.length = o.length - T;
75
- }
76
- s(Z, "popStack");
77
- function tt() {
78
- var T;
79
- return T = u.pop() || g.lex() || U, typeof T != "number" && (T instanceof Array && (u = T, T = u.pop()), T = a.symbols_[T] || T), T;
80
- }
81
- s(tt, "lex");
82
- for (var S, A, I, J, R = {}, B, M, et, O; ; ) {
83
- if (A = c[c.length - 1], this.defaultActions[A] ? I = this.defaultActions[A] : ((S === null || typeof S > "u") && (S = tt()), I = w[A] && w[A][S]), typeof I > "u" || !I.length || !I[0]) {
84
- var K = "";
85
- O = [];
86
- for (B in w[A])
87
- this.terminals_[B] && B > W && O.push("'" + this.terminals_[B] + "'");
88
- g.showPosition ? K = "Parse error on line " + (N + 1) + `:
89
- ` + g.showPosition() + `
90
- Expecting ` + O.join(", ") + ", got '" + (this.terminals_[S] || S) + "'" : K = "Parse error on line " + (N + 1) + ": Unexpected " + (S == U ? "end of input" : "'" + (this.terminals_[S] || S) + "'"), this.parseError(K, {
91
- text: g.match,
92
- token: this.terminals_[S] || S,
93
- line: g.yylineno,
94
- loc: $,
95
- expected: O
96
- });
97
- }
98
- if (I[0] instanceof Array && I.length > 1)
99
- throw new Error("Parse Error: multiple actions possible at state: " + A + ", token: " + S);
100
- switch (I[0]) {
101
- case 1:
102
- c.push(S), y.push(g.yytext), o.push(g.yylloc), c.push(I[1]), S = null, P = g.yyleng, v = g.yytext, N = g.yylineno, $ = g.yylloc;
103
- break;
104
- case 2:
105
- if (M = this.productions_[I[1]][1], R.$ = y[y.length - M], R._$ = {
106
- first_line: o[o.length - (M || 1)].first_line,
107
- last_line: o[o.length - 1].last_line,
108
- first_column: o[o.length - (M || 1)].first_column,
109
- last_column: o[o.length - 1].last_column
110
- }, z && (R._$.range = [
111
- o[o.length - (M || 1)].range[0],
112
- o[o.length - 1].range[1]
113
- ]), J = this.performAction.apply(R, [
114
- v,
115
- P,
116
- N,
117
- b.yy,
118
- I[1],
119
- y,
120
- o
121
- ].concat(H)), typeof J < "u")
122
- return J;
123
- M && (c = c.slice(0, -1 * M * 2), y = y.slice(0, -1 * M), o = o.slice(0, -1 * M)), c.push(this.productions_[I[1]][0]), y.push(R.$), o.push(R._$), et = w[c[c.length - 2]][c[c.length - 1]], c.push(et);
124
- break;
125
- case 3:
126
- return !0;
127
- }
128
- }
129
- return !0;
130
- }, "parse")
131
- }, k = /* @__PURE__ */ (function() {
132
- var x = {
133
- EOF: 1,
134
- parseError: /* @__PURE__ */ s(function(a, c) {
135
- if (this.yy.parser)
136
- this.yy.parser.parseError(a, c);
137
- else
138
- throw new Error(a);
139
- }, "parseError"),
140
- // resets the lexer, sets new input
141
- setInput: /* @__PURE__ */ s(function(r, a) {
142
- return this.yy = a || this.yy || {}, this._input = r, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
143
- first_line: 1,
144
- first_column: 0,
145
- last_line: 1,
146
- last_column: 0
147
- }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
148
- }, "setInput"),
149
- // consumes and returns one char from the input
150
- input: /* @__PURE__ */ s(function() {
151
- var r = this._input[0];
152
- this.yytext += r, this.yyleng++, this.offset++, this.match += r, this.matched += r;
153
- var a = r.match(/(?:\r\n?|\n).*/g);
154
- return a ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), r;
155
- }, "input"),
156
- // unshifts one char (or a string) into the input
157
- unput: /* @__PURE__ */ s(function(r) {
158
- var a = r.length, c = r.split(/(?:\r\n?|\n)/g);
159
- this._input = r + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - a), this.offset -= a;
160
- var u = this.match.split(/(?:\r\n?|\n)/g);
161
- this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), c.length - 1 && (this.yylineno -= c.length - 1);
162
- var y = this.yylloc.range;
163
- return this.yylloc = {
164
- first_line: this.yylloc.first_line,
165
- last_line: this.yylineno + 1,
166
- first_column: this.yylloc.first_column,
167
- last_column: c ? (c.length === u.length ? this.yylloc.first_column : 0) + u[u.length - c.length].length - c[0].length : this.yylloc.first_column - a
168
- }, this.options.ranges && (this.yylloc.range = [y[0], y[0] + this.yyleng - a]), this.yyleng = this.yytext.length, this;
169
- }, "unput"),
170
- // When called from action, caches matched text and appends it on next action
171
- more: /* @__PURE__ */ s(function() {
172
- return this._more = !0, this;
173
- }, "more"),
174
- // 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.
175
- reject: /* @__PURE__ */ s(function() {
176
- if (this.options.backtrack_lexer)
177
- this._backtrack = !0;
178
- else
179
- 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).
180
- ` + this.showPosition(), {
181
- text: "",
182
- token: null,
183
- line: this.yylineno
184
- });
185
- return this;
186
- }, "reject"),
187
- // retain first n characters of the match
188
- less: /* @__PURE__ */ s(function(r) {
189
- this.unput(this.match.slice(r));
190
- }, "less"),
191
- // displays already matched input, i.e. for error messages
192
- pastInput: /* @__PURE__ */ s(function() {
193
- var r = this.matched.substr(0, this.matched.length - this.match.length);
194
- return (r.length > 20 ? "..." : "") + r.substr(-20).replace(/\n/g, "");
195
- }, "pastInput"),
196
- // displays upcoming input, i.e. for error messages
197
- upcomingInput: /* @__PURE__ */ s(function() {
198
- var r = this.match;
199
- return r.length < 20 && (r += this._input.substr(0, 20 - r.length)), (r.substr(0, 20) + (r.length > 20 ? "..." : "")).replace(/\n/g, "");
200
- }, "upcomingInput"),
201
- // displays the character position where the lexing error occurred, i.e. for error messages
202
- showPosition: /* @__PURE__ */ s(function() {
203
- var r = this.pastInput(), a = new Array(r.length + 1).join("-");
204
- return r + this.upcomingInput() + `
205
- ` + a + "^";
206
- }, "showPosition"),
207
- // test the lexed token: return FALSE when not a match, otherwise return token
208
- test_match: /* @__PURE__ */ s(function(r, a) {
209
- var c, u, y;
210
- if (this.options.backtrack_lexer && (y = {
211
- yylineno: this.yylineno,
212
- yylloc: {
213
- first_line: this.yylloc.first_line,
214
- last_line: this.last_line,
215
- first_column: this.yylloc.first_column,
216
- last_column: this.yylloc.last_column
217
- },
218
- yytext: this.yytext,
219
- match: this.match,
220
- matches: this.matches,
221
- matched: this.matched,
222
- yyleng: this.yyleng,
223
- offset: this.offset,
224
- _more: this._more,
225
- _input: this._input,
226
- yy: this.yy,
227
- conditionStack: this.conditionStack.slice(0),
228
- done: this.done
229
- }, this.options.ranges && (y.yylloc.range = this.yylloc.range.slice(0))), u = r[0].match(/(?:\r\n?|\n).*/g), u && (this.yylineno += u.length), this.yylloc = {
230
- first_line: this.yylloc.last_line,
231
- last_line: this.yylineno + 1,
232
- first_column: this.yylloc.last_column,
233
- last_column: u ? u[u.length - 1].length - u[u.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + r[0].length
234
- }, this.yytext += r[0], this.match += r[0], this.matches = r, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(r[0].length), this.matched += r[0], c = this.performAction.call(this, this.yy, this, a, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), c)
235
- return c;
236
- if (this._backtrack) {
237
- for (var o in y)
238
- this[o] = y[o];
239
- return !1;
240
- }
241
- return !1;
242
- }, "test_match"),
243
- // return next match in input
244
- next: /* @__PURE__ */ s(function() {
245
- if (this.done)
246
- return this.EOF;
247
- this._input || (this.done = !0);
248
- var r, a, c, u;
249
- this._more || (this.yytext = "", this.match = "");
250
- for (var y = this._currentRules(), o = 0; o < y.length; o++)
251
- if (c = this._input.match(this.rules[y[o]]), c && (!a || c[0].length > a[0].length)) {
252
- if (a = c, u = o, this.options.backtrack_lexer) {
253
- if (r = this.test_match(c, y[o]), r !== !1)
254
- return r;
255
- if (this._backtrack) {
256
- a = !1;
257
- continue;
258
- } else
259
- return !1;
260
- } else if (!this.options.flex)
261
- break;
262
- }
263
- return a ? (r = this.test_match(a, y[u]), r !== !1 ? r : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
264
- ` + this.showPosition(), {
265
- text: "",
266
- token: null,
267
- line: this.yylineno
268
- });
269
- }, "next"),
270
- // return next match that has a token
271
- lex: /* @__PURE__ */ s(function() {
272
- var a = this.next();
273
- return a || this.lex();
274
- }, "lex"),
275
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
276
- begin: /* @__PURE__ */ s(function(a) {
277
- this.conditionStack.push(a);
278
- }, "begin"),
279
- // pop the previously active lexer condition state off the condition stack
280
- popState: /* @__PURE__ */ s(function() {
281
- var a = this.conditionStack.length - 1;
282
- return a > 0 ? this.conditionStack.pop() : this.conditionStack[0];
283
- }, "popState"),
284
- // produce the lexer rule set which is active for the currently active lexer condition state
285
- _currentRules: /* @__PURE__ */ s(function() {
286
- return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
287
- }, "_currentRules"),
288
- // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
289
- topState: /* @__PURE__ */ s(function(a) {
290
- return a = this.conditionStack.length - 1 - Math.abs(a || 0), a >= 0 ? this.conditionStack[a] : "INITIAL";
291
- }, "topState"),
292
- // alias for begin(condition)
293
- pushState: /* @__PURE__ */ s(function(a) {
294
- this.begin(a);
295
- }, "pushState"),
296
- // return the number of states currently on the stack
297
- stateStackSize: /* @__PURE__ */ s(function() {
298
- return this.conditionStack.length;
299
- }, "stateStackSize"),
300
- options: { "case-insensitive": !0 },
301
- performAction: /* @__PURE__ */ s(function(a, c, u, y) {
302
- switch (u) {
303
- case 0:
304
- break;
305
- case 1:
306
- break;
307
- case 2:
308
- return 10;
309
- case 3:
310
- break;
311
- case 4:
312
- break;
313
- case 5:
314
- return 4;
315
- case 6:
316
- return 11;
317
- case 7:
318
- return this.begin("acc_title"), 12;
319
- case 8:
320
- return this.popState(), "acc_title_value";
321
- case 9:
322
- return this.begin("acc_descr"), 14;
323
- case 10:
324
- return this.popState(), "acc_descr_value";
325
- case 11:
326
- this.begin("acc_descr_multiline");
327
- break;
328
- case 12:
329
- this.popState();
330
- break;
331
- case 13:
332
- return "acc_descr_multiline_value";
333
- case 14:
334
- return 17;
335
- case 15:
336
- return 21;
337
- case 16:
338
- return 20;
339
- case 17:
340
- return 6;
341
- case 18:
342
- return "INVALID";
343
- }
344
- }, "anonymous"),
345
- 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],
346
- conditions: { acc_descr_multiline: { rules: [12, 13], inclusive: !1 }, acc_descr: { rules: [10], inclusive: !1 }, acc_title: { rules: [8], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18], inclusive: !0 } }
347
- };
348
- return x;
349
- })();
350
- p.lexer = k;
351
- function _() {
352
- this.yy = {};
353
- }
354
- return s(_, "Parser"), _.prototype = p, p.Parser = _, new _();
355
- })();
356
- Q.parser = Q;
357
- var Tt = Q, at = {};
358
- wt(at, {
359
- addEvent: () => yt,
360
- addSection: () => ht,
361
- addTask: () => pt,
362
- addTaskOrg: () => gt,
363
- clear: () => ct,
364
- default: () => It,
365
- getCommonDb: () => ot,
366
- getSections: () => dt,
367
- getTasks: () => ut
368
- });
369
- var F = "", lt = 0, X = [], G = [], V = [], ot = /* @__PURE__ */ s(() => St, "getCommonDb"), ct = /* @__PURE__ */ s(function() {
370
- X.length = 0, G.length = 0, F = "", V.length = 0, Et();
371
- }, "clear"), ht = /* @__PURE__ */ s(function(n) {
372
- F = n, X.push(n);
373
- }, "addSection"), dt = /* @__PURE__ */ s(function() {
374
- return X;
375
- }, "getSections"), ut = /* @__PURE__ */ s(function() {
376
- let n = it();
377
- const t = 100;
378
- let e = 0;
379
- for (; !n && e < t; )
380
- n = it(), e++;
381
- return G.push(...V), G;
382
- }, "getTasks"), pt = /* @__PURE__ */ s(function(n, t, e) {
383
- const l = {
384
- id: lt++,
385
- section: F,
386
- type: F,
387
- task: n,
388
- score: t || 0,
389
- //if event is defined, then add it the events array
390
- events: e ? [e] : []
391
- };
392
- V.push(l);
393
- }, "addTask"), yt = /* @__PURE__ */ s(function(n) {
394
- V.find((e) => e.id === lt - 1).events.push(n);
395
- }, "addEvent"), gt = /* @__PURE__ */ s(function(n) {
396
- const t = {
397
- section: F,
398
- type: F,
399
- description: n,
400
- task: n,
401
- classes: []
402
- };
403
- G.push(t);
404
- }, "addTaskOrg"), it = /* @__PURE__ */ s(function() {
405
- const n = /* @__PURE__ */ s(function(e) {
406
- return V[e].processed;
407
- }, "compileTask");
408
- let t = !0;
409
- for (const [e, l] of V.entries())
410
- n(e), t = t && l.processed;
411
- return t;
412
- }, "compileTasks"), It = {
413
- clear: ct,
414
- getCommonDb: ot,
415
- addSection: ht,
416
- getSections: dt,
417
- getTasks: ut,
418
- addTask: pt,
419
- addTaskOrg: gt,
420
- addEvent: yt
421
- }, Nt = 12, q = /* @__PURE__ */ s(function(n, t) {
422
- const e = n.append("rect");
423
- return e.attr("x", t.x), e.attr("y", t.y), e.attr("fill", t.fill), e.attr("stroke", t.stroke), e.attr("width", t.width), e.attr("height", t.height), e.attr("rx", t.rx), e.attr("ry", t.ry), t.class !== void 0 && e.attr("class", t.class), e;
424
- }, "drawRect"), Lt = /* @__PURE__ */ s(function(n, t) {
425
- const l = n.append("circle").attr("cx", t.cx).attr("cy", t.cy).attr("class", "face").attr("r", 15).attr("stroke-width", 2).attr("overflow", "visible"), i = n.append("g");
426
- i.append("circle").attr("cx", t.cx - 15 / 3).attr("cy", t.cy - 15 / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666"), i.append("circle").attr("cx", t.cx + 15 / 3).attr("cy", t.cy - 15 / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666");
427
- function d(m) {
428
- const p = nt().startAngle(Math.PI / 2).endAngle(3 * (Math.PI / 2)).innerRadius(7.5).outerRadius(6.8181818181818175);
429
- m.append("path").attr("class", "mouth").attr("d", p).attr("transform", "translate(" + t.cx + "," + (t.cy + 2) + ")");
430
- }
431
- s(d, "smile");
432
- function h(m) {
433
- const p = nt().startAngle(3 * Math.PI / 2).endAngle(5 * (Math.PI / 2)).innerRadius(7.5).outerRadius(6.8181818181818175);
434
- m.append("path").attr("class", "mouth").attr("d", p).attr("transform", "translate(" + t.cx + "," + (t.cy + 7) + ")");
435
- }
436
- s(h, "sad");
437
- function f(m) {
438
- m.append("line").attr("class", "mouth").attr("stroke", 2).attr("x1", t.cx - 5).attr("y1", t.cy + 7).attr("x2", t.cx + 5).attr("y2", t.cy + 7).attr("class", "mouth").attr("stroke-width", "1px").attr("stroke", "#666");
439
- }
440
- return s(f, "ambivalent"), t.score > 3 ? d(i) : t.score < 3 ? h(i) : f(i), l;
441
- }, "drawFace"), $t = /* @__PURE__ */ s(function(n, t) {
442
- const e = n.append("circle");
443
- return e.attr("cx", t.cx), e.attr("cy", t.cy), e.attr("class", "actor-" + t.pos), e.attr("fill", t.fill), e.attr("stroke", t.stroke), e.attr("r", t.r), e.class !== void 0 && e.attr("class", e.class), t.title !== void 0 && e.append("title").text(t.title), e;
444
- }, "drawCircle"), ft = /* @__PURE__ */ s(function(n, t) {
445
- const e = t.text.replace(/<br\s*\/?>/gi, " "), l = n.append("text");
446
- l.attr("x", t.x), l.attr("y", t.y), l.attr("class", "legend"), l.style("text-anchor", t.anchor), t.class !== void 0 && l.attr("class", t.class);
447
- const i = l.append("tspan");
448
- return i.attr("x", t.x + t.textMargin * 2), i.text(e), l;
449
- }, "drawText"), Mt = /* @__PURE__ */ s(function(n, t) {
450
- function e(i, d, h, f, m) {
451
- return i + "," + d + " " + (i + h) + "," + d + " " + (i + h) + "," + (d + f - m) + " " + (i + h - m * 1.2) + "," + (d + f) + " " + i + "," + (d + f);
452
- }
453
- s(e, "genPoints");
454
- const l = n.append("polygon");
455
- l.attr("points", e(t.x, t.y, 50, 20, 7)), l.attr("class", "labelBox"), t.y = t.y + t.labelMargin, t.x = t.x + 0.5 * t.labelMargin, ft(n, t);
456
- }, "drawLabel"), Ht = /* @__PURE__ */ s(function(n, t, e) {
457
- const l = n.append("g"), i = Y();
458
- i.x = t.x, i.y = t.y, i.fill = t.fill, i.width = e.width, i.height = e.height, i.class = "journey-section section-type-" + t.num, i.rx = 3, i.ry = 3, q(l, i), mt(e)(
459
- t.text,
460
- l,
461
- i.x,
462
- i.y,
463
- i.width,
464
- i.height,
465
- { class: "journey-section section-type-" + t.num },
466
- e,
467
- t.colour
468
- );
469
- }, "drawSection"), rt = -1, Pt = /* @__PURE__ */ s(function(n, t, e) {
470
- const l = t.x + e.width / 2, i = n.append("g");
471
- rt++, i.append("line").attr("id", "task" + rt).attr("x1", l).attr("y1", t.y).attr("x2", l).attr("y2", 450).attr("class", "task-line").attr("stroke-width", "1px").attr("stroke-dasharray", "4 2").attr("stroke", "#666"), Lt(i, {
472
- cx: l,
473
- cy: 300 + (5 - t.score) * 30,
474
- score: t.score
475
- });
476
- const h = Y();
477
- h.x = t.x, h.y = t.y, h.fill = t.fill, h.width = e.width, h.height = e.height, h.class = "task task-type-" + t.num, h.rx = 3, h.ry = 3, q(i, h), mt(e)(
478
- t.task,
479
- i,
480
- h.x,
481
- h.y,
482
- h.width,
483
- h.height,
484
- { class: "task" },
485
- e,
486
- t.colour
487
- );
488
- }, "drawTask"), At = /* @__PURE__ */ s(function(n, t) {
489
- q(n, {
490
- x: t.startx,
491
- y: t.starty,
492
- width: t.stopx - t.startx,
493
- height: t.stopy - t.starty,
494
- fill: t.fill,
495
- class: "rect"
496
- }).lower();
497
- }, "drawBackgroundRect"), Ct = /* @__PURE__ */ s(function() {
498
- return {
499
- x: 0,
500
- y: 0,
501
- fill: void 0,
502
- "text-anchor": "start",
503
- width: 100,
504
- height: 100,
505
- textMargin: 0,
506
- rx: 0,
507
- ry: 0
508
- };
509
- }, "getTextObj"), Y = /* @__PURE__ */ s(function() {
510
- return {
511
- x: 0,
512
- y: 0,
513
- width: 100,
514
- anchor: "start",
515
- height: 100,
516
- rx: 0,
517
- ry: 0
518
- };
519
- }, "getNoteRect"), mt = /* @__PURE__ */ (function() {
520
- function n(i, d, h, f, m, p, k, _) {
521
- const x = d.append("text").attr("x", h + m / 2).attr("y", f + p / 2 + 5).style("font-color", _).style("text-anchor", "middle").text(i);
522
- l(x, k);
523
- }
524
- s(n, "byText");
525
- function t(i, d, h, f, m, p, k, _, x) {
526
- const { taskFontSize: r, taskFontFamily: a } = _, c = i.split(/<br\s*\/?>/gi);
527
- for (let u = 0; u < c.length; u++) {
528
- const y = u * r - r * (c.length - 1) / 2, o = d.append("text").attr("x", h + m / 2).attr("y", f).attr("fill", x).style("text-anchor", "middle").style("font-size", r).style("font-family", a);
529
- o.append("tspan").attr("x", h + m / 2).attr("dy", y).text(c[u]), o.attr("y", f + p / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), l(o, k);
530
- }
531
- }
532
- s(t, "byTspan");
533
- function e(i, d, h, f, m, p, k, _) {
534
- const x = d.append("switch"), a = x.append("foreignObject").attr("x", h).attr("y", f).attr("width", m).attr("height", p).attr("position", "fixed").append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
535
- a.append("div").attr("class", "label").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(i), t(i, x, h, f, m, p, k, _), l(a, k);
536
- }
537
- s(e, "byFo");
538
- function l(i, d) {
539
- for (const h in d)
540
- h in d && i.attr(h, d[h]);
541
- }
542
- return s(l, "_setTextAttrs"), function(i) {
543
- return i.textPlacement === "fo" ? e : i.textPlacement === "old" ? n : t;
544
- };
545
- })(), Rt = /* @__PURE__ */ s(function(n) {
546
- n.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");
547
- }, "initGraphics");
548
- function D(n, t) {
549
- n.each(function() {
550
- var e = j(this), l = e.text().split(/(\s+|<br>)/).reverse(), i, d = [], h = 1.1, f = e.attr("y"), m = parseFloat(e.attr("dy")), p = e.text(null).append("tspan").attr("x", 0).attr("y", f).attr("dy", m + "em");
551
- for (let k = 0; k < l.length; k++)
552
- i = l[l.length - 1 - k], d.push(i), p.text(d.join(" ").trim()), (p.node().getComputedTextLength() > t || i === "<br>") && (d.pop(), p.text(d.join(" ").trim()), i === "<br>" ? d = [""] : d = [i], p = e.append("tspan").attr("x", 0).attr("y", f).attr("dy", h + "em").text(i));
553
- });
554
- }
555
- s(D, "wrap");
556
- var Ft = /* @__PURE__ */ s(function(n, t, e, l) {
557
- const i = e % Nt - 1, d = n.append("g");
558
- t.section = i, d.attr(
559
- "class",
560
- (t.class ? t.class + " " : "") + "timeline-node " + ("section-" + i)
561
- );
562
- const h = d.append("g"), f = d.append("g"), p = f.append("text").text(t.descr).attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle").call(D, t.width).node().getBBox(), k = l.fontSize?.replace ? l.fontSize.replace("px", "") : l.fontSize;
563
- return t.height = p.height + k * 1.1 * 0.5 + t.padding, t.height = Math.max(t.height, t.maxHeight), t.width = t.width + 2 * t.padding, f.attr("transform", "translate(" + t.width / 2 + ", " + t.padding / 2 + ")"), Wt(h, t, i, l), t;
564
- }, "drawNode"), Vt = /* @__PURE__ */ s(function(n, t, e) {
565
- const l = n.append("g"), d = l.append("text").text(t.descr).attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle").call(D, t.width).node().getBBox(), h = e.fontSize?.replace ? e.fontSize.replace("px", "") : e.fontSize;
566
- return l.remove(), d.height + h * 1.1 * 0.5 + t.padding;
567
- }, "getVirtualNodeHeight"), Wt = /* @__PURE__ */ s(function(n, t, e) {
568
- n.append("path").attr("id", "node-" + t.id).attr("class", "node-bkg node-" + t.type).attr(
569
- "d",
570
- `M0 ${t.height - 5} v${-t.height + 10} q0,-5 5,-5 h${t.width - 10} q5,0 5,5 v${t.height - 5} H0 Z`
571
- ), n.append("line").attr("class", "node-line-" + e).attr("x1", 0).attr("y1", t.height).attr("x2", t.width).attr("y2", t.height);
572
- }, "defaultBkg"), C = {
573
- drawRect: q,
574
- drawCircle: $t,
575
- drawSection: Ht,
576
- drawText: ft,
577
- drawLabel: Mt,
578
- drawTask: Pt,
579
- drawBackgroundRect: At,
580
- getTextObj: Ct,
581
- getNoteRect: Y,
582
- initGraphics: Rt,
583
- drawNode: Ft,
584
- getVirtualNodeHeight: Vt
585
- }, zt = /* @__PURE__ */ s(function(n, t, e, l) {
586
- const i = xt(), d = i.timeline?.leftMargin ?? 50;
587
- E.debug("timeline", l.db);
588
- const h = i.securityLevel;
589
- let f;
590
- h === "sandbox" && (f = j("#i" + t));
591
- const p = (h === "sandbox" ? j(f.nodes()[0].contentDocument.body) : j("body")).select("#" + t);
592
- p.append("g");
593
- const k = l.db.getTasks(), _ = l.db.getCommonDb().getDiagramTitle();
594
- E.debug("task", k), C.initGraphics(p);
595
- const x = l.db.getSections();
596
- E.debug("sections", x);
597
- let r = 0, a = 0, c = 0, u = 0, y = 50 + d, o = 50;
598
- u = 50;
599
- let w = 0, v = !0;
600
- x.forEach(function(H) {
601
- const g = {
602
- number: w,
603
- descr: H,
604
- section: w,
605
- width: 150,
606
- padding: 20,
607
- maxHeight: r
608
- }, b = C.getVirtualNodeHeight(p, g, i);
609
- E.debug("sectionHeight before draw", b), r = Math.max(r, b + 20);
610
- });
611
- let N = 0, P = 0;
612
- E.debug("tasks.length", k.length);
613
- for (const [H, g] of k.entries()) {
614
- const b = {
615
- number: H,
616
- descr: g,
617
- section: g.section,
618
- width: 150,
619
- padding: 20,
620
- maxHeight: a
621
- }, L = C.getVirtualNodeHeight(p, b, i);
622
- E.debug("taskHeight before draw", L), a = Math.max(a, L + 20), N = Math.max(N, g.events.length);
623
- let $ = 0;
624
- for (const z of g.events) {
625
- const Z = {
626
- descr: z,
627
- section: g.section,
628
- number: g.section,
629
- width: 150,
630
- padding: 20,
631
- maxHeight: 50
632
- };
633
- $ += C.getVirtualNodeHeight(p, Z, i);
634
- }
635
- g.events.length > 0 && ($ += (g.events.length - 1) * 10), P = Math.max(P, $);
636
- }
637
- E.debug("maxSectionHeight before draw", r), E.debug("maxTaskHeight before draw", a), x && x.length > 0 ? x.forEach((H) => {
638
- const g = k.filter((z) => z.section === H), b = {
639
- number: w,
640
- descr: H,
641
- section: w,
642
- width: 200 * Math.max(g.length, 1) - 50,
643
- padding: 20,
644
- maxHeight: r
645
- };
646
- E.debug("sectionNode", b);
647
- const L = p.append("g"), $ = C.drawNode(L, b, w, i);
648
- E.debug("sectionNode output", $), L.attr("transform", `translate(${y}, ${u})`), o += r + 50, g.length > 0 && st(
649
- p,
650
- g,
651
- w,
652
- y,
653
- o,
654
- a,
655
- i,
656
- N,
657
- P,
658
- r,
659
- !1
660
- ), y += 200 * Math.max(g.length, 1), o = u, w++;
661
- }) : (v = !1, st(
662
- p,
663
- k,
664
- w,
665
- y,
666
- o,
667
- a,
668
- i,
669
- N,
670
- P,
671
- r,
672
- !0
673
- ));
674
- const W = p.node().getBBox();
675
- E.debug("bounds", W), _ && p.append("text").text(_).attr("x", W.width / 2 - d).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 20), c = v ? r + a + 150 : a + 100, p.append("g").attr("class", "lineWrapper").append("line").attr("x1", d).attr("y1", c).attr("x2", W.width + 3 * d).attr("y2", c).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", "url(#arrowhead)"), kt(
676
- void 0,
677
- p,
678
- i.timeline?.padding ?? 50,
679
- i.timeline?.useMaxWidth ?? !1
680
- );
681
- }, "draw"), st = /* @__PURE__ */ s(function(n, t, e, l, i, d, h, f, m, p, k) {
682
- for (const _ of t) {
683
- const x = {
684
- descr: _.task,
685
- section: e,
686
- number: e,
687
- width: 150,
688
- padding: 20,
689
- maxHeight: d
690
- };
691
- E.debug("taskNode", x);
692
- const r = n.append("g").attr("class", "taskWrapper"), c = C.drawNode(r, x, e, h).height;
693
- if (E.debug("taskHeight after draw", c), r.attr("transform", `translate(${l}, ${i})`), d = Math.max(d, c), _.events) {
694
- const u = n.append("g").attr("class", "lineWrapper");
695
- let y = d;
696
- i += 100, y = y + Bt(n, _.events, e, l, i, h), i -= 100, u.append("line").attr("x1", l + 190 / 2).attr("y1", i + d).attr("x2", l + 190 / 2).attr("y2", i + d + 100 + m + 100).attr("stroke-width", 2).attr("stroke", "black").attr("marker-end", "url(#arrowhead)").attr("stroke-dasharray", "5,5");
697
- }
698
- l = l + 200, k && !h.timeline?.disableMulticolor && e++;
699
- }
700
- i = i - 10;
701
- }, "drawTasks"), Bt = /* @__PURE__ */ s(function(n, t, e, l, i, d) {
702
- let h = 0;
703
- const f = i;
704
- i = i + 100;
705
- for (const m of t) {
706
- const p = {
707
- descr: m,
708
- section: e,
709
- number: e,
710
- width: 150,
711
- padding: 20,
712
- maxHeight: 50
713
- };
714
- E.debug("eventNode", p);
715
- const k = n.append("g").attr("class", "eventWrapper"), x = C.drawNode(k, p, e, d).height;
716
- h = h + x, k.attr("transform", `translate(${l}, ${i})`), i = i + 10 + x;
717
- }
718
- return i = f, h;
719
- }, "drawEvents"), Ot = {
720
- setConf: /* @__PURE__ */ s(() => {
721
- }, "setConf"),
722
- draw: zt
723
- }, jt = /* @__PURE__ */ s((n) => {
724
- let t = "";
725
- for (let e = 0; e < n.THEME_COLOR_LIMIT; e++)
726
- n["lineColor" + e] = n["lineColor" + e] || n["cScaleInv" + e], vt(n["lineColor" + e]) ? n["lineColor" + e] = _t(n["lineColor" + e], 20) : n["lineColor" + e] = bt(n["lineColor" + e], 20);
727
- for (let e = 0; e < n.THEME_COLOR_LIMIT; e++) {
728
- const l = "" + (17 - 3 * e);
729
- t += `
730
- .section-${e - 1} rect, .section-${e - 1} path, .section-${e - 1} circle, .section-${e - 1} path {
731
- fill: ${n["cScale" + e]};
732
- }
733
- .section-${e - 1} text {
734
- fill: ${n["cScaleLabel" + e]};
735
- }
736
- .node-icon-${e - 1} {
737
- font-size: 40px;
738
- color: ${n["cScaleLabel" + e]};
739
- }
740
- .section-edge-${e - 1}{
741
- stroke: ${n["cScale" + e]};
742
- }
743
- .edge-depth-${e - 1}{
744
- stroke-width: ${l};
745
- }
746
- .section-${e - 1} line {
747
- stroke: ${n["cScaleInv" + e]} ;
748
- stroke-width: 3;
749
- }
750
-
751
- .lineWrapper line{
752
- stroke: ${n["cScaleLabel" + e]} ;
753
- }
754
-
755
- .disabled, .disabled circle, .disabled text {
756
- fill: lightgray;
757
- }
758
- .disabled text {
759
- fill: #efefef;
760
- }
761
- `;
762
- }
763
- return t;
764
- }, "genSections"), Gt = /* @__PURE__ */ s((n) => `
765
- .edge {
766
- stroke-width: 3;
767
- }
768
- ${jt(n)}
769
- .section-root rect, .section-root path, .section-root circle {
770
- fill: ${n.git0};
771
- }
772
- .section-root text {
773
- fill: ${n.gitBranchLabel0};
774
- }
775
- .icon-container {
776
- height:100%;
777
- display: flex;
778
- justify-content: center;
779
- align-items: center;
780
- }
781
- .edge {
782
- fill: none;
783
- }
784
- .eventWrapper {
785
- filter: brightness(120%);
786
- }
787
- `, "getStyles"), qt = Gt, Jt = {
788
- db: at,
789
- renderer: Ot,
790
- parser: Tt,
791
- styles: qt
792
- };
793
- export {
794
- Jt as diagram
795
- };