@loopstack/loopstack-studio 0.25.0 → 0.25.2

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 (196) hide show
  1. package/dist/components/ai-elements/message.js +2 -2
  2. package/dist/components/ai-elements/reasoning.js +9 -9
  3. package/dist/loopstack-studio.css +1 -1
  4. package/dist/node_modules/@chevrotain/gast/lib/src/helpers.js +2 -5
  5. package/dist/node_modules/@chevrotain/gast/lib/src/model.js +69 -72
  6. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{architecture-7HQA4BMR.js → architecture-YZFGNWBL.js} +2 -2
  7. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-TQ3KTPDO.js → chunk-2KRD3SAO.js} +1 -1
  8. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-4F5CHEZ2.js → chunk-67CJDMHE.js} +1 -1
  9. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-UMXZTB3W.js → chunk-7N4EOEYR.js} +5 -2
  10. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-PL6DKKU2.js → chunk-AA7GKIK3.js} +1 -1
  11. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-CIAEETIT.js +23 -0
  12. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-SJTYNZTY.js → chunk-FOC6F5B3.js} +1 -1
  13. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-K5T4RW27.js +1197 -0
  14. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-FRFDVMJY.js → chunk-KGLVRYIC.js} +1 -1
  15. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{chunk-B2363JML.js → chunk-LIHQZDEY.js} +1 -1
  16. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-ORNJ4GCN.js +29 -0
  17. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/{gitGraph-G5XIXVHT.js → gitGraph-7Q5UKJZL.js} +2 -2
  18. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/info-OMHHGYJF.js +3 -0
  19. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/packet-4T2RLAQJ.js +3 -0
  20. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/pie-ZZUOXDRM.js +3 -0
  21. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/radar-PYXPWWZC.js +3 -0
  22. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treeView-SZITEDCU.js +3 -0
  23. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treemap-W4RFUUIX.js +3 -0
  24. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/wardley-RL74JXVD.js +3 -0
  25. package/dist/node_modules/@mermaid-js/parser/dist/mermaid-parser.core.js +27 -17
  26. package/dist/node_modules/@upsetjs/venn.js/build/venn.esm.js +903 -0
  27. package/dist/node_modules/@xyflow/react/dist/esm/index.js +76 -75
  28. package/dist/node_modules/@xyflow/system/dist/esm/index.js +30 -28
  29. package/dist/node_modules/chevrotain/lib/src/parse/cst/cst_visitor.js +31 -40
  30. package/dist/node_modules/chevrotain/lib/src/parse/errors_public.js +23 -26
  31. package/dist/node_modules/chevrotain/lib/src/parse/exceptions_public.js +12 -13
  32. package/dist/node_modules/chevrotain/lib/src/parse/grammar/checks.js +181 -205
  33. package/dist/node_modules/chevrotain/lib/src/parse/grammar/first.js +11 -13
  34. package/dist/node_modules/chevrotain/lib/src/parse/grammar/follow.js +12 -13
  35. package/dist/node_modules/chevrotain/lib/src/parse/grammar/gast/gast_resolver_public.js +8 -9
  36. package/dist/node_modules/chevrotain/lib/src/parse/grammar/interpreter.js +176 -183
  37. package/dist/node_modules/chevrotain/lib/src/parse/grammar/llk_lookahead.js +17 -19
  38. package/dist/node_modules/chevrotain/lib/src/parse/grammar/lookahead.js +153 -160
  39. package/dist/node_modules/chevrotain/lib/src/parse/grammar/resolver.js +10 -12
  40. package/dist/node_modules/chevrotain/lib/src/parse/grammar/rest.js +36 -38
  41. package/dist/node_modules/chevrotain/lib/src/parse/parser/parser.js +37 -45
  42. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/error_handler.js +12 -14
  43. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/gast_recorder.js +80 -86
  44. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/lexer_adapter.js +6 -2
  45. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/looksahead.js +39 -41
  46. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/perf_tracer.js +7 -8
  47. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_api.js +69 -70
  48. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_engine.js +215 -205
  49. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/recoverable.js +76 -76
  50. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/tree_builder.js +29 -39
  51. package/dist/node_modules/chevrotain/lib/src/scan/lexer.js +252 -274
  52. package/dist/node_modules/chevrotain/lib/src/scan/lexer_public.js +93 -106
  53. package/dist/node_modules/chevrotain/lib/src/scan/reg_exp.js +61 -61
  54. package/dist/node_modules/chevrotain/lib/src/scan/tokens.js +31 -41
  55. package/dist/node_modules/chevrotain/lib/src/scan/tokens_public.js +15 -18
  56. package/dist/node_modules/chevrotain-allstar/lib/all-star-lookahead.js +226 -226
  57. package/dist/node_modules/chevrotain-allstar/lib/atn.js +17 -17
  58. package/dist/node_modules/cytoscape/dist/cytoscape.esm.js +17 -14
  59. package/dist/node_modules/dagre-d3-es/src/dagre/greedy-fas.js +19 -19
  60. package/dist/node_modules/dagre-d3-es/src/dagre/layout.js +48 -48
  61. package/dist/node_modules/dagre-d3-es/src/dagre/nesting-graph.js +9 -9
  62. package/dist/node_modules/dagre-d3-es/src/dagre/order/cross-count.js +3 -3
  63. package/dist/node_modules/dagre-d3-es/src/dagre/order/index.js +11 -11
  64. package/dist/node_modules/dagre-d3-es/src/dagre/order/init-order.js +4 -4
  65. package/dist/node_modules/dagre-d3-es/src/dagre/order/resolve-conflicts.js +4 -4
  66. package/dist/node_modules/dagre-d3-es/src/dagre/order/sort-subgraph.js +8 -8
  67. package/dist/node_modules/dagre-d3-es/src/dagre/order/sort.js +5 -5
  68. package/dist/node_modules/dagre-d3-es/src/dagre/position/bk.js +61 -61
  69. package/dist/node_modules/dagre-d3-es/src/dagre/position/index.js +1 -1
  70. package/dist/node_modules/dagre-d3-es/src/dagre/rank/network-simplex.js +25 -25
  71. package/dist/node_modules/dagre-d3-es/src/dagre/rank/util.js +8 -8
  72. package/dist/node_modules/dagre-d3-es/src/dagre/util.js +48 -48
  73. package/dist/node_modules/dagre-d3-es/src/graphlib/graph.js +109 -109
  74. package/dist/node_modules/dagre-d3-es/src/graphlib/json.js +17 -17
  75. package/dist/node_modules/dompurify/dist/purify.es.js +67 -67
  76. package/dist/node_modules/katex/dist/katex.js +1256 -1209
  77. package/dist/node_modules/khroma/dist/methods/transparentize.js +3 -0
  78. package/dist/node_modules/lodash-es/_baseClone.js +2 -2
  79. package/dist/node_modules/lodash-es/_baseMatchesProperty.js +6 -6
  80. package/dist/node_modules/lodash-es/_baseToString.js +1 -1
  81. package/dist/node_modules/lodash-es/_baseUniq.js +1 -1
  82. package/dist/node_modules/lodash-es/_createSet.js +1 -1
  83. package/dist/node_modules/lodash-es/_getAllKeys.js +2 -2
  84. package/dist/node_modules/lodash-es/_getAllKeysIn.js +1 -1
  85. package/dist/node_modules/lodash-es/findIndex.js +2 -2
  86. package/dist/node_modules/lodash-es/flatMap.js +1 -1
  87. package/dist/node_modules/lodash-es/forEach.js +1 -1
  88. package/dist/node_modules/lodash-es/max.js +1 -1
  89. package/dist/node_modules/lodash-es/min.js +1 -1
  90. package/dist/node_modules/lodash-es/minBy.js +1 -1
  91. package/dist/node_modules/lodash-es/reduce.js +1 -1
  92. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/architectureDiagram-Q4EWVU46.js +691 -0
  93. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{blockDiagram-VD42YOAC.js → blockDiagram-DXYQGD6D.js} +183 -157
  94. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{c4Diagram-YG6GDRKO.js → c4Diagram-AHTNJAMY.js} +65 -63
  95. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-336JU56O.js +47 -0
  96. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-EXTU4WIE.js → chunk-426QAEUC.js} +1 -1
  97. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-B4BG7PRW.js → chunk-4TB4RGXK.js} +533 -393
  98. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-5FUZZQ4R.js +3638 -0
  99. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-S3R3BYOJ.js → chunk-5PVQY5BW.js} +1 -1
  100. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-HN2XXSSU.js → chunk-BSJP7CBP.js} +20 -14
  101. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-QN33PNHL.js → chunk-EDXVE4YY.js} +1 -1
  102. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ENJZ2VHE.js +568 -0
  103. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ICPOFSXX.js +2320 -0
  104. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-DI55MBZ5.js → chunk-OYMX7WX6.js} +35 -21
  105. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-U2HBQHQK.js +272 -0
  106. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-ATLVNIR6.js → chunk-X2U36JSP.js} +1 -1
  107. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{chunk-MI3HLSF2.js → chunk-XPW4576I.js} +11 -7
  108. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-YZCP3GAM.js +60 -0
  109. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ZZ45TVLE.js +30 -0
  110. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{classDiagram-2ON5EDUG.js → classDiagram-6PBFFD2Q.js} +12 -11
  111. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{classDiagram-v2-WZHVMYZB.js → classDiagram-v2-HSJHXN6E.js} +12 -11
  112. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{dagre-6UL2VRFP.js → dagre-KV5264BT.js} +8 -8
  113. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-5BDNPKRD.js +99 -0
  114. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{diagram-PSM6KHXK.js → diagram-G4DWMVQ6.js} +20 -23
  115. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-MMDJMWI5.js +211 -0
  116. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{diagram-S2PKOQOG.js → diagram-TYMM5635.js} +4 -4
  117. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{erDiagram-Q2GNP2WA.js → erDiagram-SMLLAGMA.js} +486 -386
  118. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{flowDiagram-NV44I4VS.js → flowDiagram-DWJPFMVM.js} +915 -898
  119. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{ganttDiagram-JELNMOA3.js → ganttDiagram-T4ZO3ILL.js} +59 -29
  120. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-UUTBAWPF.js +728 -0
  121. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/infoDiagram-42DDH7IO.js +17 -0
  122. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/ishikawaDiagram-UXIWVN3A.js +714 -0
  123. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{journeyDiagram-XKPGCS4Q.js → journeyDiagram-VCZTEJTY.js} +32 -32
  124. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{kanban-definition-3W4ZIXB7.js → kanban-definition-6JOO6SKY.js} +13 -9
  125. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{mindmap-definition-VGOIOE7T.js → mindmap-definition-QFDTVHPH.js} +105 -59
  126. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/pieDiagram-DEJITSTG.js +117 -0
  127. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{quadrantDiagram-AYHSOK5B.js → quadrantDiagram-34T5L4WZ.js} +1 -1
  128. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{requirementDiagram-UZGBJVZJ.js → requirementDiagram-MS252O5E.js} +49 -19
  129. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{sankeyDiagram-TZEHDZUN.js → sankeyDiagram-XADWPNL6.js} +1 -1
  130. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-FGHM5R23.js +4155 -0
  131. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{stateDiagram-FKZM4ZOC.js → stateDiagram-FHFEXIEX.js} +12 -12
  132. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{stateDiagram-v2-4FDKWEC3.js → stateDiagram-v2-QKLJ7IA2.js} +11 -11
  133. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-GMOUNBTQ.js +1071 -0
  134. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/vennDiagram-DHZGUBPP.js +959 -0
  135. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/wardleyDiagram-NUSXRM2D.js +574 -0
  136. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/{xychartDiagram-PRI3JC2R.js → xychartDiagram-5P7HB3ND.js} +38 -35
  137. package/dist/node_modules/mermaid/dist/mermaid.core.js +235 -192
  138. package/dist/node_modules/nanoid/url-alphabet/index.js +1 -1
  139. package/dist/node_modules/remend/dist/index.js +333 -264
  140. package/dist/node_modules/streamdown/dist/chunk-BO2N2NFS.js +2498 -0
  141. package/dist/node_modules/streamdown/dist/highlighted-body-OFNGDK62.js +35 -0
  142. package/dist/node_modules/streamdown/dist/index.js +1 -1
  143. package/dist/node_modules/streamdown/dist/mermaid-GHXKKRXX.js +3 -0
  144. package/dist/node_modules/streamdown/node_modules/marked/lib/marked.esm.js +672 -667
  145. package/dist/pages/DashboardPage.js +3 -3
  146. package/package.json +2 -2
  147. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/chunk-TCCFYFTB.js +0 -787
  148. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/info-VBDWY6EO.js +0 -3
  149. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/packet-DYOGHKS2.js +0 -3
  150. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/pie-VRWISCQL.js +0 -3
  151. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/radar-ZZBFDIW7.js +0 -3
  152. package/dist/node_modules/@mermaid-js/parser/dist/chunks/mermaid-parser.core/treemap-GDKQZRPO.js +0 -3
  153. package/dist/node_modules/chevrotain/lib/src/parse/parser/traits/context_assist.js +0 -16
  154. package/dist/node_modules/lodash-es/_arrayAggregator.js +0 -9
  155. package/dist/node_modules/lodash-es/_arrayEvery.js +0 -6
  156. package/dist/node_modules/lodash-es/_baseAggregator.js +0 -8
  157. package/dist/node_modules/lodash-es/_baseDifference.js +0 -22
  158. package/dist/node_modules/lodash-es/_baseEvery.js +0 -9
  159. package/dist/node_modules/lodash-es/_baseIsRegExp.js +0 -8
  160. package/dist/node_modules/lodash-es/_baseSlice.js +0 -8
  161. package/dist/node_modules/lodash-es/_baseSome.js +0 -9
  162. package/dist/node_modules/lodash-es/_createAggregator.js +0 -12
  163. package/dist/node_modules/lodash-es/assign.js +0 -14
  164. package/dist/node_modules/lodash-es/compact.js +0 -9
  165. package/dist/node_modules/lodash-es/difference.js +0 -8
  166. package/dist/node_modules/lodash-es/drop.js +0 -8
  167. package/dist/node_modules/lodash-es/dropRight.js +0 -8
  168. package/dist/node_modules/lodash-es/every.js +0 -11
  169. package/dist/node_modules/lodash-es/groupBy.js +0 -6
  170. package/dist/node_modules/lodash-es/head.js +0 -5
  171. package/dist/node_modules/lodash-es/includes.js +0 -13
  172. package/dist/node_modules/lodash-es/indexOf.js +0 -11
  173. package/dist/node_modules/lodash-es/isRegExp.js +0 -5
  174. package/dist/node_modules/lodash-es/negate.js +0 -16
  175. package/dist/node_modules/lodash-es/pickBy.js +0 -15
  176. package/dist/node_modules/lodash-es/reject.js +0 -10
  177. package/dist/node_modules/lodash-es/some.js +0 -11
  178. package/dist/node_modules/lodash-es/uniq.js +0 -6
  179. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/architectureDiagram-VXUJARFQ.js +0 -673
  180. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ABZYJK2D.js +0 -1547
  181. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-CVBHYZKI.js +0 -10
  182. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-DR5Q36YT.js +0 -135
  183. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-JA3XYJ7Z.js +0 -247
  184. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-JZLCHNYA.js +0 -3516
  185. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-N4CR4FBY.js +0 -39
  186. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-QXUST7PY.js +0 -497
  187. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/chunk-TZMSLE5B.js +0 -55
  188. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/diagram-QEK2KX5R.js +0 -211
  189. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/gitGraphDiagram-V2S2FVAM.js +0 -621
  190. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/infoDiagram-HS3SLOUP.js +0 -18
  191. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/pieDiagram-ADFJNKIX.js +0 -117
  192. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/sequenceDiagram-WL72ISMW.js +0 -3560
  193. package/dist/node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-IT6M3QCI.js +0 -833
  194. package/dist/node_modules/streamdown/dist/chunk-RLXIAIE6.js +0 -2189
  195. package/dist/node_modules/streamdown/dist/highlighted-body-B3W2YXNL.js +0 -33
  196. package/dist/node_modules/streamdown/dist/mermaid-3ZIDBTTL.js +0 -3
@@ -0,0 +1,4155 @@
1
+ import { __name, log } from "./chunk-AGHRB4JF.js";
2
+ import { assignWithDepth_default, calculateMathMLDimensions, clear, common_default, configureSvgSize, getAccDescription, getAccTitle, getConfig, getConfig2, getDiagramTitle, getUrl, hasKatex, renderKatexSanitized, sanitizeText, setAccDescription, setAccTitle, setConfig2, setDiagramTitle } from "./chunk-ICPOFSXX.js";
3
+ import select_default from "../../../../d3-selection/src/select.js";
4
+ import "../../../../d3/src/index.js";
5
+ import { JSON_SCHEMA, load } from "./chunk-XPW4576I.js";
6
+ import { require_dist } from "../../../../@braintree/sanitize-url/dist/index.js";
7
+ import { ZERO_WIDTH_SPACE, parseFontSize, utils_default } from "./chunk-5PVQY5BW.js";
8
+ import { drawBackgroundRect, drawEmbeddedImage, drawImage, drawRect, getNoteRect, getTextObj } from "./chunk-YZCP3GAM.js";
9
+ import { ImperativeState } from "./chunk-QZHKN3VN.js";
10
+ var import_dist = require_dist(), parser = (function() {
11
+ var t = /* @__PURE__ */ __name(function(e, t, n, r) {
12
+ for (n ||= {}, r = e.length; r--; n[e[r]] = t);
13
+ return n;
14
+ }, "o"), n = [1, 2], r = [1, 3], i = [1, 4], a = [2, 4], o = [1, 9], s = [1, 11], c = [1, 12], l = [1, 14], u = [1, 15], d = [1, 17], f = [1, 18], p = [1, 19], m = [1, 25], h = [1, 26], g = [1, 27], _ = [1, 28], v = [1, 29], y = [1, 30], b = [1, 31], x = [1, 32], S = [1, 33], C = [1, 34], w = [1, 35], T = [1, 36], E = [1, 37], D = [1, 38], O = [1, 39], k = [1, 40], A = [1, 42], j = [1, 43], M = [1, 44], N = [1, 45], P = [1, 46], F = [1, 47], I = [
15
+ 1,
16
+ 4,
17
+ 5,
18
+ 10,
19
+ 14,
20
+ 15,
21
+ 17,
22
+ 19,
23
+ 22,
24
+ 24,
25
+ 30,
26
+ 31,
27
+ 32,
28
+ 34,
29
+ 36,
30
+ 37,
31
+ 38,
32
+ 39,
33
+ 40,
34
+ 42,
35
+ 44,
36
+ 45,
37
+ 47,
38
+ 48,
39
+ 49,
40
+ 50,
41
+ 51,
42
+ 53,
43
+ 54,
44
+ 56,
45
+ 61,
46
+ 62,
47
+ 63,
48
+ 64,
49
+ 73
50
+ ], L = [1, 74], R = [1, 80], z = [1, 81], B = [1, 82], V = [1, 83], Be = [1, 84], Ve = [1, 85], He = [1, 86], Ue = [1, 87], We = [1, 88], Ge = [1, 89], Ke = [1, 90], qe = [1, 91], Je = [1, 92], Ye = [1, 93], H = [1, 94], U = [1, 95], W = [1, 96], Xe = [1, 97], Ze = [1, 98], Qe = [1, 99], $e = [1, 100], et = [1, 101], G = [1, 102], tt = [1, 103], nt = [1, 104], rt = [1, 105], it = [2, 78], K = [
51
+ 4,
52
+ 5,
53
+ 17,
54
+ 51,
55
+ 53,
56
+ 54
57
+ ], q = [
58
+ 4,
59
+ 5,
60
+ 10,
61
+ 14,
62
+ 15,
63
+ 17,
64
+ 19,
65
+ 22,
66
+ 24,
67
+ 30,
68
+ 31,
69
+ 32,
70
+ 34,
71
+ 36,
72
+ 37,
73
+ 38,
74
+ 39,
75
+ 40,
76
+ 42,
77
+ 44,
78
+ 45,
79
+ 47,
80
+ 51,
81
+ 53,
82
+ 54,
83
+ 56,
84
+ 61,
85
+ 62,
86
+ 63,
87
+ 64,
88
+ 73
89
+ ], at = [
90
+ 4,
91
+ 5,
92
+ 10,
93
+ 14,
94
+ 15,
95
+ 17,
96
+ 19,
97
+ 22,
98
+ 24,
99
+ 30,
100
+ 31,
101
+ 32,
102
+ 34,
103
+ 36,
104
+ 37,
105
+ 38,
106
+ 39,
107
+ 40,
108
+ 42,
109
+ 44,
110
+ 45,
111
+ 47,
112
+ 50,
113
+ 51,
114
+ 53,
115
+ 54,
116
+ 56,
117
+ 61,
118
+ 62,
119
+ 63,
120
+ 64,
121
+ 73
122
+ ], J = [
123
+ 4,
124
+ 5,
125
+ 10,
126
+ 14,
127
+ 15,
128
+ 17,
129
+ 19,
130
+ 22,
131
+ 24,
132
+ 30,
133
+ 31,
134
+ 32,
135
+ 34,
136
+ 36,
137
+ 37,
138
+ 38,
139
+ 39,
140
+ 40,
141
+ 42,
142
+ 44,
143
+ 45,
144
+ 47,
145
+ 49,
146
+ 51,
147
+ 53,
148
+ 54,
149
+ 56,
150
+ 61,
151
+ 62,
152
+ 63,
153
+ 64,
154
+ 73
155
+ ], ot = [
156
+ 4,
157
+ 5,
158
+ 10,
159
+ 14,
160
+ 15,
161
+ 17,
162
+ 19,
163
+ 22,
164
+ 24,
165
+ 30,
166
+ 31,
167
+ 32,
168
+ 34,
169
+ 36,
170
+ 37,
171
+ 38,
172
+ 39,
173
+ 40,
174
+ 42,
175
+ 44,
176
+ 45,
177
+ 47,
178
+ 48,
179
+ 51,
180
+ 53,
181
+ 54,
182
+ 56,
183
+ 61,
184
+ 62,
185
+ 63,
186
+ 64,
187
+ 73
188
+ ], Y = [5, 52], X = [
189
+ 70,
190
+ 71,
191
+ 72,
192
+ 73
193
+ ], Z = [1, 151], Q = {
194
+ trace: /* @__PURE__ */ __name(function() {}, "trace"),
195
+ yy: {},
196
+ symbols_: {
197
+ error: 2,
198
+ start: 3,
199
+ SPACE: 4,
200
+ NEWLINE: 5,
201
+ SD: 6,
202
+ document: 7,
203
+ line: 8,
204
+ statement: 9,
205
+ INVALID: 10,
206
+ box_section: 11,
207
+ box_line: 12,
208
+ participant_statement: 13,
209
+ create: 14,
210
+ box: 15,
211
+ restOfLine: 16,
212
+ end: 17,
213
+ signal: 18,
214
+ autonumber: 19,
215
+ NUM: 20,
216
+ off: 21,
217
+ activate: 22,
218
+ actor: 23,
219
+ deactivate: 24,
220
+ note_statement: 25,
221
+ links_statement: 26,
222
+ link_statement: 27,
223
+ properties_statement: 28,
224
+ details_statement: 29,
225
+ title: 30,
226
+ legacy_title: 31,
227
+ acc_title: 32,
228
+ acc_title_value: 33,
229
+ acc_descr: 34,
230
+ acc_descr_value: 35,
231
+ acc_descr_multiline_value: 36,
232
+ loop: 37,
233
+ rect: 38,
234
+ opt: 39,
235
+ alt: 40,
236
+ else_sections: 41,
237
+ par: 42,
238
+ par_sections: 43,
239
+ par_over: 44,
240
+ critical: 45,
241
+ option_sections: 46,
242
+ break: 47,
243
+ option: 48,
244
+ and: 49,
245
+ else: 50,
246
+ participant: 51,
247
+ AS: 52,
248
+ participant_actor: 53,
249
+ destroy: 54,
250
+ actor_with_config: 55,
251
+ note: 56,
252
+ placement: 57,
253
+ text2: 58,
254
+ over: 59,
255
+ actor_pair: 60,
256
+ links: 61,
257
+ link: 62,
258
+ properties: 63,
259
+ details: 64,
260
+ spaceList: 65,
261
+ ",": 66,
262
+ left_of: 67,
263
+ right_of: 68,
264
+ signaltype: 69,
265
+ "+": 70,
266
+ "-": 71,
267
+ "()": 72,
268
+ ACTOR: 73,
269
+ config_object: 74,
270
+ CONFIG_START: 75,
271
+ CONFIG_CONTENT: 76,
272
+ CONFIG_END: 77,
273
+ SOLID_OPEN_ARROW: 78,
274
+ DOTTED_OPEN_ARROW: 79,
275
+ SOLID_ARROW: 80,
276
+ SOLID_ARROW_TOP: 81,
277
+ SOLID_ARROW_BOTTOM: 82,
278
+ STICK_ARROW_TOP: 83,
279
+ STICK_ARROW_BOTTOM: 84,
280
+ SOLID_ARROW_TOP_DOTTED: 85,
281
+ SOLID_ARROW_BOTTOM_DOTTED: 86,
282
+ STICK_ARROW_TOP_DOTTED: 87,
283
+ STICK_ARROW_BOTTOM_DOTTED: 88,
284
+ SOLID_ARROW_TOP_REVERSE: 89,
285
+ SOLID_ARROW_BOTTOM_REVERSE: 90,
286
+ STICK_ARROW_TOP_REVERSE: 91,
287
+ STICK_ARROW_BOTTOM_REVERSE: 92,
288
+ SOLID_ARROW_TOP_REVERSE_DOTTED: 93,
289
+ SOLID_ARROW_BOTTOM_REVERSE_DOTTED: 94,
290
+ STICK_ARROW_TOP_REVERSE_DOTTED: 95,
291
+ STICK_ARROW_BOTTOM_REVERSE_DOTTED: 96,
292
+ BIDIRECTIONAL_SOLID_ARROW: 97,
293
+ DOTTED_ARROW: 98,
294
+ BIDIRECTIONAL_DOTTED_ARROW: 99,
295
+ SOLID_CROSS: 100,
296
+ DOTTED_CROSS: 101,
297
+ SOLID_POINT: 102,
298
+ DOTTED_POINT: 103,
299
+ TXT: 104,
300
+ $accept: 0,
301
+ $end: 1
302
+ },
303
+ terminals_: {
304
+ 2: "error",
305
+ 4: "SPACE",
306
+ 5: "NEWLINE",
307
+ 6: "SD",
308
+ 10: "INVALID",
309
+ 14: "create",
310
+ 15: "box",
311
+ 16: "restOfLine",
312
+ 17: "end",
313
+ 19: "autonumber",
314
+ 20: "NUM",
315
+ 21: "off",
316
+ 22: "activate",
317
+ 24: "deactivate",
318
+ 30: "title",
319
+ 31: "legacy_title",
320
+ 32: "acc_title",
321
+ 33: "acc_title_value",
322
+ 34: "acc_descr",
323
+ 35: "acc_descr_value",
324
+ 36: "acc_descr_multiline_value",
325
+ 37: "loop",
326
+ 38: "rect",
327
+ 39: "opt",
328
+ 40: "alt",
329
+ 42: "par",
330
+ 44: "par_over",
331
+ 45: "critical",
332
+ 47: "break",
333
+ 48: "option",
334
+ 49: "and",
335
+ 50: "else",
336
+ 51: "participant",
337
+ 52: "AS",
338
+ 53: "participant_actor",
339
+ 54: "destroy",
340
+ 56: "note",
341
+ 59: "over",
342
+ 61: "links",
343
+ 62: "link",
344
+ 63: "properties",
345
+ 64: "details",
346
+ 66: ",",
347
+ 67: "left_of",
348
+ 68: "right_of",
349
+ 70: "+",
350
+ 71: "-",
351
+ 72: "()",
352
+ 73: "ACTOR",
353
+ 75: "CONFIG_START",
354
+ 76: "CONFIG_CONTENT",
355
+ 77: "CONFIG_END",
356
+ 78: "SOLID_OPEN_ARROW",
357
+ 79: "DOTTED_OPEN_ARROW",
358
+ 80: "SOLID_ARROW",
359
+ 81: "SOLID_ARROW_TOP",
360
+ 82: "SOLID_ARROW_BOTTOM",
361
+ 83: "STICK_ARROW_TOP",
362
+ 84: "STICK_ARROW_BOTTOM",
363
+ 85: "SOLID_ARROW_TOP_DOTTED",
364
+ 86: "SOLID_ARROW_BOTTOM_DOTTED",
365
+ 87: "STICK_ARROW_TOP_DOTTED",
366
+ 88: "STICK_ARROW_BOTTOM_DOTTED",
367
+ 89: "SOLID_ARROW_TOP_REVERSE",
368
+ 90: "SOLID_ARROW_BOTTOM_REVERSE",
369
+ 91: "STICK_ARROW_TOP_REVERSE",
370
+ 92: "STICK_ARROW_BOTTOM_REVERSE",
371
+ 93: "SOLID_ARROW_TOP_REVERSE_DOTTED",
372
+ 94: "SOLID_ARROW_BOTTOM_REVERSE_DOTTED",
373
+ 95: "STICK_ARROW_TOP_REVERSE_DOTTED",
374
+ 96: "STICK_ARROW_BOTTOM_REVERSE_DOTTED",
375
+ 97: "BIDIRECTIONAL_SOLID_ARROW",
376
+ 98: "DOTTED_ARROW",
377
+ 99: "BIDIRECTIONAL_DOTTED_ARROW",
378
+ 100: "SOLID_CROSS",
379
+ 101: "DOTTED_CROSS",
380
+ 102: "SOLID_POINT",
381
+ 103: "DOTTED_POINT",
382
+ 104: "TXT"
383
+ },
384
+ productions_: [
385
+ 0,
386
+ [3, 2],
387
+ [3, 2],
388
+ [3, 2],
389
+ [7, 0],
390
+ [7, 2],
391
+ [8, 2],
392
+ [8, 1],
393
+ [8, 1],
394
+ [8, 1],
395
+ [11, 0],
396
+ [11, 2],
397
+ [12, 2],
398
+ [12, 1],
399
+ [12, 1],
400
+ [9, 1],
401
+ [9, 2],
402
+ [9, 4],
403
+ [9, 2],
404
+ [9, 4],
405
+ [9, 3],
406
+ [9, 3],
407
+ [9, 2],
408
+ [9, 3],
409
+ [9, 3],
410
+ [9, 2],
411
+ [9, 2],
412
+ [9, 2],
413
+ [9, 2],
414
+ [9, 2],
415
+ [9, 1],
416
+ [9, 1],
417
+ [9, 2],
418
+ [9, 2],
419
+ [9, 1],
420
+ [9, 4],
421
+ [9, 4],
422
+ [9, 4],
423
+ [9, 4],
424
+ [9, 4],
425
+ [9, 4],
426
+ [9, 4],
427
+ [9, 4],
428
+ [46, 1],
429
+ [46, 4],
430
+ [43, 1],
431
+ [43, 4],
432
+ [41, 1],
433
+ [41, 4],
434
+ [13, 5],
435
+ [13, 3],
436
+ [13, 5],
437
+ [13, 3],
438
+ [13, 3],
439
+ [13, 5],
440
+ [13, 3],
441
+ [13, 5],
442
+ [13, 3],
443
+ [25, 4],
444
+ [25, 4],
445
+ [26, 3],
446
+ [27, 3],
447
+ [28, 3],
448
+ [29, 3],
449
+ [65, 2],
450
+ [65, 1],
451
+ [60, 3],
452
+ [60, 1],
453
+ [57, 1],
454
+ [57, 1],
455
+ [18, 5],
456
+ [18, 5],
457
+ [18, 5],
458
+ [18, 5],
459
+ [18, 6],
460
+ [18, 4],
461
+ [55, 2],
462
+ [74, 3],
463
+ [23, 1],
464
+ [69, 1],
465
+ [69, 1],
466
+ [69, 1],
467
+ [69, 1],
468
+ [69, 1],
469
+ [69, 1],
470
+ [69, 1],
471
+ [69, 1],
472
+ [69, 1],
473
+ [69, 1],
474
+ [69, 1],
475
+ [69, 1],
476
+ [69, 1],
477
+ [69, 1],
478
+ [69, 1],
479
+ [69, 1],
480
+ [69, 1],
481
+ [69, 1],
482
+ [69, 1],
483
+ [69, 1],
484
+ [69, 1],
485
+ [69, 1],
486
+ [69, 1],
487
+ [69, 1],
488
+ [69, 1],
489
+ [69, 1],
490
+ [58, 1]
491
+ ],
492
+ performAction: /* @__PURE__ */ __name(function(e, t, n, r, i, a, o) {
493
+ var s = a.length - 1;
494
+ switch (i) {
495
+ case 3: return r.apply(a[s]), a[s];
496
+ case 4:
497
+ case 10:
498
+ this.$ = [];
499
+ break;
500
+ case 5:
501
+ case 11:
502
+ a[s - 1].push(a[s]), this.$ = a[s - 1];
503
+ break;
504
+ case 6:
505
+ case 7:
506
+ case 12:
507
+ case 13:
508
+ this.$ = a[s];
509
+ break;
510
+ case 8:
511
+ case 9:
512
+ case 14:
513
+ this.$ = [];
514
+ break;
515
+ case 16:
516
+ a[s].type = "createParticipant", this.$ = a[s];
517
+ break;
518
+ case 17:
519
+ a[s - 1].unshift({
520
+ type: "boxStart",
521
+ boxData: r.parseBoxData(a[s - 2])
522
+ }), a[s - 1].push({
523
+ type: "boxEnd",
524
+ boxText: a[s - 2]
525
+ }), this.$ = a[s - 1];
526
+ break;
527
+ case 19:
528
+ this.$ = {
529
+ type: "sequenceIndex",
530
+ sequenceIndex: Number(a[s - 2]),
531
+ sequenceIndexStep: Number(a[s - 1]),
532
+ sequenceVisible: !0,
533
+ signalType: r.LINETYPE.AUTONUMBER
534
+ };
535
+ break;
536
+ case 20:
537
+ this.$ = {
538
+ type: "sequenceIndex",
539
+ sequenceIndex: Number(a[s - 1]),
540
+ sequenceIndexStep: 1,
541
+ sequenceVisible: !0,
542
+ signalType: r.LINETYPE.AUTONUMBER
543
+ };
544
+ break;
545
+ case 21:
546
+ this.$ = {
547
+ type: "sequenceIndex",
548
+ sequenceVisible: !1,
549
+ signalType: r.LINETYPE.AUTONUMBER
550
+ };
551
+ break;
552
+ case 22:
553
+ this.$ = {
554
+ type: "sequenceIndex",
555
+ sequenceVisible: !0,
556
+ signalType: r.LINETYPE.AUTONUMBER
557
+ };
558
+ break;
559
+ case 23:
560
+ this.$ = {
561
+ type: "activeStart",
562
+ signalType: r.LINETYPE.ACTIVE_START,
563
+ actor: a[s - 1].actor
564
+ };
565
+ break;
566
+ case 24:
567
+ this.$ = {
568
+ type: "activeEnd",
569
+ signalType: r.LINETYPE.ACTIVE_END,
570
+ actor: a[s - 1].actor
571
+ };
572
+ break;
573
+ case 30:
574
+ r.setDiagramTitle(a[s].substring(6)), this.$ = a[s].substring(6);
575
+ break;
576
+ case 31:
577
+ r.setDiagramTitle(a[s].substring(7)), this.$ = a[s].substring(7);
578
+ break;
579
+ case 32:
580
+ this.$ = a[s].trim(), r.setAccTitle(this.$);
581
+ break;
582
+ case 33:
583
+ case 34:
584
+ this.$ = a[s].trim(), r.setAccDescription(this.$);
585
+ break;
586
+ case 35:
587
+ a[s - 1].unshift({
588
+ type: "loopStart",
589
+ loopText: r.parseMessage(a[s - 2]),
590
+ signalType: r.LINETYPE.LOOP_START
591
+ }), a[s - 1].push({
592
+ type: "loopEnd",
593
+ loopText: a[s - 2],
594
+ signalType: r.LINETYPE.LOOP_END
595
+ }), this.$ = a[s - 1];
596
+ break;
597
+ case 36:
598
+ a[s - 1].unshift({
599
+ type: "rectStart",
600
+ color: r.parseMessage(a[s - 2]),
601
+ signalType: r.LINETYPE.RECT_START
602
+ }), a[s - 1].push({
603
+ type: "rectEnd",
604
+ color: r.parseMessage(a[s - 2]),
605
+ signalType: r.LINETYPE.RECT_END
606
+ }), this.$ = a[s - 1];
607
+ break;
608
+ case 37:
609
+ a[s - 1].unshift({
610
+ type: "optStart",
611
+ optText: r.parseMessage(a[s - 2]),
612
+ signalType: r.LINETYPE.OPT_START
613
+ }), a[s - 1].push({
614
+ type: "optEnd",
615
+ optText: r.parseMessage(a[s - 2]),
616
+ signalType: r.LINETYPE.OPT_END
617
+ }), this.$ = a[s - 1];
618
+ break;
619
+ case 38:
620
+ a[s - 1].unshift({
621
+ type: "altStart",
622
+ altText: r.parseMessage(a[s - 2]),
623
+ signalType: r.LINETYPE.ALT_START
624
+ }), a[s - 1].push({
625
+ type: "altEnd",
626
+ signalType: r.LINETYPE.ALT_END
627
+ }), this.$ = a[s - 1];
628
+ break;
629
+ case 39:
630
+ a[s - 1].unshift({
631
+ type: "parStart",
632
+ parText: r.parseMessage(a[s - 2]),
633
+ signalType: r.LINETYPE.PAR_START
634
+ }), a[s - 1].push({
635
+ type: "parEnd",
636
+ signalType: r.LINETYPE.PAR_END
637
+ }), this.$ = a[s - 1];
638
+ break;
639
+ case 40:
640
+ a[s - 1].unshift({
641
+ type: "parStart",
642
+ parText: r.parseMessage(a[s - 2]),
643
+ signalType: r.LINETYPE.PAR_OVER_START
644
+ }), a[s - 1].push({
645
+ type: "parEnd",
646
+ signalType: r.LINETYPE.PAR_END
647
+ }), this.$ = a[s - 1];
648
+ break;
649
+ case 41:
650
+ a[s - 1].unshift({
651
+ type: "criticalStart",
652
+ criticalText: r.parseMessage(a[s - 2]),
653
+ signalType: r.LINETYPE.CRITICAL_START
654
+ }), a[s - 1].push({
655
+ type: "criticalEnd",
656
+ signalType: r.LINETYPE.CRITICAL_END
657
+ }), this.$ = a[s - 1];
658
+ break;
659
+ case 42:
660
+ a[s - 1].unshift({
661
+ type: "breakStart",
662
+ breakText: r.parseMessage(a[s - 2]),
663
+ signalType: r.LINETYPE.BREAK_START
664
+ }), a[s - 1].push({
665
+ type: "breakEnd",
666
+ optText: r.parseMessage(a[s - 2]),
667
+ signalType: r.LINETYPE.BREAK_END
668
+ }), this.$ = a[s - 1];
669
+ break;
670
+ case 44:
671
+ this.$ = a[s - 3].concat([{
672
+ type: "option",
673
+ optionText: r.parseMessage(a[s - 1]),
674
+ signalType: r.LINETYPE.CRITICAL_OPTION
675
+ }, a[s]]);
676
+ break;
677
+ case 46:
678
+ this.$ = a[s - 3].concat([{
679
+ type: "and",
680
+ parText: r.parseMessage(a[s - 1]),
681
+ signalType: r.LINETYPE.PAR_AND
682
+ }, a[s]]);
683
+ break;
684
+ case 48:
685
+ this.$ = a[s - 3].concat([{
686
+ type: "else",
687
+ altText: r.parseMessage(a[s - 1]),
688
+ signalType: r.LINETYPE.ALT_ELSE
689
+ }, a[s]]);
690
+ break;
691
+ case 49:
692
+ a[s - 3].draw = "participant", a[s - 3].type = "addParticipant", a[s - 3].description = r.parseMessage(a[s - 1]), this.$ = a[s - 3];
693
+ break;
694
+ case 50:
695
+ a[s - 1].draw = "participant", a[s - 1].type = "addParticipant", this.$ = a[s - 1];
696
+ break;
697
+ case 51:
698
+ a[s - 3].draw = "actor", a[s - 3].type = "addParticipant", a[s - 3].description = r.parseMessage(a[s - 1]), this.$ = a[s - 3];
699
+ break;
700
+ case 52:
701
+ case 57:
702
+ a[s - 1].draw = "actor", a[s - 1].type = "addParticipant", this.$ = a[s - 1];
703
+ break;
704
+ case 53:
705
+ a[s - 1].type = "destroyParticipant", this.$ = a[s - 1];
706
+ break;
707
+ case 54:
708
+ a[s - 3].draw = "participant", a[s - 3].type = "addParticipant", a[s - 3].description = r.parseMessage(a[s - 1]), this.$ = a[s - 3];
709
+ break;
710
+ case 55:
711
+ a[s - 1].draw = "participant", a[s - 1].type = "addParticipant", this.$ = a[s - 1];
712
+ break;
713
+ case 56:
714
+ a[s - 3].draw = "actor", a[s - 3].type = "addParticipant", a[s - 3].description = r.parseMessage(a[s - 1]), this.$ = a[s - 3];
715
+ break;
716
+ case 58:
717
+ this.$ = [a[s - 1], {
718
+ type: "addNote",
719
+ placement: a[s - 2],
720
+ actor: a[s - 1].actor,
721
+ text: a[s]
722
+ }];
723
+ break;
724
+ case 59:
725
+ a[s - 2] = [].concat(a[s - 1], a[s - 1]).slice(0, 2), a[s - 2][0] = a[s - 2][0].actor, a[s - 2][1] = a[s - 2][1].actor, this.$ = [a[s - 1], {
726
+ type: "addNote",
727
+ placement: r.PLACEMENT.OVER,
728
+ actor: a[s - 2].slice(0, 2),
729
+ text: a[s]
730
+ }];
731
+ break;
732
+ case 60:
733
+ this.$ = [a[s - 1], {
734
+ type: "addLinks",
735
+ actor: a[s - 1].actor,
736
+ text: a[s]
737
+ }];
738
+ break;
739
+ case 61:
740
+ this.$ = [a[s - 1], {
741
+ type: "addALink",
742
+ actor: a[s - 1].actor,
743
+ text: a[s]
744
+ }];
745
+ break;
746
+ case 62:
747
+ this.$ = [a[s - 1], {
748
+ type: "addProperties",
749
+ actor: a[s - 1].actor,
750
+ text: a[s]
751
+ }];
752
+ break;
753
+ case 63:
754
+ this.$ = [a[s - 1], {
755
+ type: "addDetails",
756
+ actor: a[s - 1].actor,
757
+ text: a[s]
758
+ }];
759
+ break;
760
+ case 66:
761
+ this.$ = [a[s - 2], a[s]];
762
+ break;
763
+ case 67:
764
+ this.$ = a[s];
765
+ break;
766
+ case 68:
767
+ this.$ = r.PLACEMENT.LEFTOF;
768
+ break;
769
+ case 69:
770
+ this.$ = r.PLACEMENT.RIGHTOF;
771
+ break;
772
+ case 70:
773
+ this.$ = [
774
+ a[s - 4],
775
+ a[s - 1],
776
+ {
777
+ type: "addMessage",
778
+ from: a[s - 4].actor,
779
+ to: a[s - 1].actor,
780
+ signalType: a[s - 3],
781
+ msg: a[s],
782
+ activate: !0
783
+ },
784
+ {
785
+ type: "activeStart",
786
+ signalType: r.LINETYPE.ACTIVE_START,
787
+ actor: a[s - 1].actor
788
+ }
789
+ ];
790
+ break;
791
+ case 71:
792
+ this.$ = [
793
+ a[s - 4],
794
+ a[s - 1],
795
+ {
796
+ type: "addMessage",
797
+ from: a[s - 4].actor,
798
+ to: a[s - 1].actor,
799
+ signalType: a[s - 3],
800
+ msg: a[s]
801
+ },
802
+ {
803
+ type: "activeEnd",
804
+ signalType: r.LINETYPE.ACTIVE_END,
805
+ actor: a[s - 4].actor
806
+ }
807
+ ];
808
+ break;
809
+ case 72:
810
+ this.$ = [
811
+ a[s - 4],
812
+ a[s - 1],
813
+ {
814
+ type: "addMessage",
815
+ from: a[s - 4].actor,
816
+ to: a[s - 1].actor,
817
+ signalType: a[s - 3],
818
+ msg: a[s],
819
+ activate: !0,
820
+ centralConnection: r.LINETYPE.CENTRAL_CONNECTION
821
+ },
822
+ {
823
+ type: "centralConnection",
824
+ signalType: r.LINETYPE.CENTRAL_CONNECTION,
825
+ actor: a[s - 1].actor
826
+ }
827
+ ];
828
+ break;
829
+ case 73:
830
+ this.$ = [
831
+ a[s - 4],
832
+ a[s - 1],
833
+ {
834
+ type: "addMessage",
835
+ from: a[s - 4].actor,
836
+ to: a[s - 1].actor,
837
+ signalType: a[s - 2],
838
+ msg: a[s],
839
+ activate: !1,
840
+ centralConnection: r.LINETYPE.CENTRAL_CONNECTION_REVERSE
841
+ },
842
+ {
843
+ type: "centralConnectionReverse",
844
+ signalType: r.LINETYPE.CENTRAL_CONNECTION_REVERSE,
845
+ actor: a[s - 4].actor
846
+ }
847
+ ];
848
+ break;
849
+ case 74:
850
+ this.$ = [
851
+ a[s - 5],
852
+ a[s - 1],
853
+ {
854
+ type: "addMessage",
855
+ from: a[s - 5].actor,
856
+ to: a[s - 1].actor,
857
+ signalType: a[s - 3],
858
+ msg: a[s],
859
+ activate: !0,
860
+ centralConnection: r.LINETYPE.CENTRAL_CONNECTION_DUAL
861
+ },
862
+ {
863
+ type: "centralConnection",
864
+ signalType: r.LINETYPE.CENTRAL_CONNECTION,
865
+ actor: a[s - 1].actor
866
+ },
867
+ {
868
+ type: "centralConnectionReverse",
869
+ signalType: r.LINETYPE.CENTRAL_CONNECTION_REVERSE,
870
+ actor: a[s - 5].actor
871
+ }
872
+ ];
873
+ break;
874
+ case 75:
875
+ this.$ = [
876
+ a[s - 3],
877
+ a[s - 1],
878
+ {
879
+ type: "addMessage",
880
+ from: a[s - 3].actor,
881
+ to: a[s - 1].actor,
882
+ signalType: a[s - 2],
883
+ msg: a[s]
884
+ }
885
+ ];
886
+ break;
887
+ case 76:
888
+ this.$ = {
889
+ type: "addParticipant",
890
+ actor: a[s - 1],
891
+ config: a[s]
892
+ };
893
+ break;
894
+ case 77:
895
+ this.$ = a[s - 1].trim();
896
+ break;
897
+ case 78:
898
+ this.$ = {
899
+ type: "addParticipant",
900
+ actor: a[s]
901
+ };
902
+ break;
903
+ case 79:
904
+ this.$ = r.LINETYPE.SOLID_OPEN;
905
+ break;
906
+ case 80:
907
+ this.$ = r.LINETYPE.DOTTED_OPEN;
908
+ break;
909
+ case 81:
910
+ this.$ = r.LINETYPE.SOLID;
911
+ break;
912
+ case 82:
913
+ this.$ = r.LINETYPE.SOLID_TOP;
914
+ break;
915
+ case 83:
916
+ this.$ = r.LINETYPE.SOLID_BOTTOM;
917
+ break;
918
+ case 84:
919
+ this.$ = r.LINETYPE.STICK_TOP;
920
+ break;
921
+ case 85:
922
+ this.$ = r.LINETYPE.STICK_BOTTOM;
923
+ break;
924
+ case 86:
925
+ this.$ = r.LINETYPE.SOLID_TOP_DOTTED;
926
+ break;
927
+ case 87:
928
+ this.$ = r.LINETYPE.SOLID_BOTTOM_DOTTED;
929
+ break;
930
+ case 88:
931
+ this.$ = r.LINETYPE.STICK_TOP_DOTTED;
932
+ break;
933
+ case 89:
934
+ this.$ = r.LINETYPE.STICK_BOTTOM_DOTTED;
935
+ break;
936
+ case 90:
937
+ this.$ = r.LINETYPE.SOLID_ARROW_TOP_REVERSE;
938
+ break;
939
+ case 91:
940
+ this.$ = r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;
941
+ break;
942
+ case 92:
943
+ this.$ = r.LINETYPE.STICK_ARROW_TOP_REVERSE;
944
+ break;
945
+ case 93:
946
+ this.$ = r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;
947
+ break;
948
+ case 94:
949
+ this.$ = r.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;
950
+ break;
951
+ case 95:
952
+ this.$ = r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;
953
+ break;
954
+ case 96:
955
+ this.$ = r.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;
956
+ break;
957
+ case 97:
958
+ this.$ = r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;
959
+ break;
960
+ case 98:
961
+ this.$ = r.LINETYPE.BIDIRECTIONAL_SOLID;
962
+ break;
963
+ case 99:
964
+ this.$ = r.LINETYPE.DOTTED;
965
+ break;
966
+ case 100:
967
+ this.$ = r.LINETYPE.BIDIRECTIONAL_DOTTED;
968
+ break;
969
+ case 101:
970
+ this.$ = r.LINETYPE.SOLID_CROSS;
971
+ break;
972
+ case 102:
973
+ this.$ = r.LINETYPE.DOTTED_CROSS;
974
+ break;
975
+ case 103:
976
+ this.$ = r.LINETYPE.SOLID_POINT;
977
+ break;
978
+ case 104:
979
+ this.$ = r.LINETYPE.DOTTED_POINT;
980
+ break;
981
+ case 105:
982
+ this.$ = r.parseMessage(a[s].trim().substring(1));
983
+ break;
984
+ }
985
+ }, "anonymous"),
986
+ table: [
987
+ {
988
+ 3: 1,
989
+ 4: n,
990
+ 5: r,
991
+ 6: i
992
+ },
993
+ { 1: [3] },
994
+ {
995
+ 3: 5,
996
+ 4: n,
997
+ 5: r,
998
+ 6: i
999
+ },
1000
+ {
1001
+ 3: 6,
1002
+ 4: n,
1003
+ 5: r,
1004
+ 6: i
1005
+ },
1006
+ t([
1007
+ 1,
1008
+ 4,
1009
+ 5,
1010
+ 10,
1011
+ 14,
1012
+ 15,
1013
+ 19,
1014
+ 22,
1015
+ 24,
1016
+ 30,
1017
+ 31,
1018
+ 32,
1019
+ 34,
1020
+ 36,
1021
+ 37,
1022
+ 38,
1023
+ 39,
1024
+ 40,
1025
+ 42,
1026
+ 44,
1027
+ 45,
1028
+ 47,
1029
+ 51,
1030
+ 53,
1031
+ 54,
1032
+ 56,
1033
+ 61,
1034
+ 62,
1035
+ 63,
1036
+ 64,
1037
+ 73
1038
+ ], a, { 7: 7 }),
1039
+ { 1: [2, 1] },
1040
+ { 1: [2, 2] },
1041
+ {
1042
+ 1: [2, 3],
1043
+ 4: o,
1044
+ 5: s,
1045
+ 8: 8,
1046
+ 9: 10,
1047
+ 10: c,
1048
+ 13: 13,
1049
+ 14: l,
1050
+ 15: u,
1051
+ 18: 16,
1052
+ 19: d,
1053
+ 22: f,
1054
+ 23: 41,
1055
+ 24: p,
1056
+ 25: 20,
1057
+ 26: 21,
1058
+ 27: 22,
1059
+ 28: 23,
1060
+ 29: 24,
1061
+ 30: m,
1062
+ 31: h,
1063
+ 32: g,
1064
+ 34: _,
1065
+ 36: v,
1066
+ 37: y,
1067
+ 38: b,
1068
+ 39: x,
1069
+ 40: S,
1070
+ 42: C,
1071
+ 44: w,
1072
+ 45: T,
1073
+ 47: E,
1074
+ 51: D,
1075
+ 53: O,
1076
+ 54: k,
1077
+ 56: A,
1078
+ 61: j,
1079
+ 62: M,
1080
+ 63: N,
1081
+ 64: P,
1082
+ 73: F
1083
+ },
1084
+ t(I, [2, 5]),
1085
+ {
1086
+ 9: 48,
1087
+ 13: 13,
1088
+ 14: l,
1089
+ 15: u,
1090
+ 18: 16,
1091
+ 19: d,
1092
+ 22: f,
1093
+ 23: 41,
1094
+ 24: p,
1095
+ 25: 20,
1096
+ 26: 21,
1097
+ 27: 22,
1098
+ 28: 23,
1099
+ 29: 24,
1100
+ 30: m,
1101
+ 31: h,
1102
+ 32: g,
1103
+ 34: _,
1104
+ 36: v,
1105
+ 37: y,
1106
+ 38: b,
1107
+ 39: x,
1108
+ 40: S,
1109
+ 42: C,
1110
+ 44: w,
1111
+ 45: T,
1112
+ 47: E,
1113
+ 51: D,
1114
+ 53: O,
1115
+ 54: k,
1116
+ 56: A,
1117
+ 61: j,
1118
+ 62: M,
1119
+ 63: N,
1120
+ 64: P,
1121
+ 73: F
1122
+ },
1123
+ t(I, [2, 7]),
1124
+ t(I, [2, 8]),
1125
+ t(I, [2, 9]),
1126
+ t(I, [2, 15]),
1127
+ {
1128
+ 13: 49,
1129
+ 51: D,
1130
+ 53: O,
1131
+ 54: k
1132
+ },
1133
+ { 16: [1, 50] },
1134
+ { 5: [1, 51] },
1135
+ {
1136
+ 5: [1, 54],
1137
+ 20: [1, 52],
1138
+ 21: [1, 53]
1139
+ },
1140
+ {
1141
+ 23: 55,
1142
+ 73: F
1143
+ },
1144
+ {
1145
+ 23: 56,
1146
+ 73: F
1147
+ },
1148
+ { 5: [1, 57] },
1149
+ { 5: [1, 58] },
1150
+ { 5: [1, 59] },
1151
+ { 5: [1, 60] },
1152
+ { 5: [1, 61] },
1153
+ t(I, [2, 30]),
1154
+ t(I, [2, 31]),
1155
+ { 33: [1, 62] },
1156
+ { 35: [1, 63] },
1157
+ t(I, [2, 34]),
1158
+ { 16: [1, 64] },
1159
+ { 16: [1, 65] },
1160
+ { 16: [1, 66] },
1161
+ { 16: [1, 67] },
1162
+ { 16: [1, 68] },
1163
+ { 16: [1, 69] },
1164
+ { 16: [1, 70] },
1165
+ { 16: [1, 71] },
1166
+ {
1167
+ 23: 72,
1168
+ 55: 73,
1169
+ 73: L
1170
+ },
1171
+ {
1172
+ 23: 75,
1173
+ 55: 76,
1174
+ 73: L
1175
+ },
1176
+ {
1177
+ 23: 77,
1178
+ 73: F
1179
+ },
1180
+ {
1181
+ 69: 78,
1182
+ 72: [1, 79],
1183
+ 78: R,
1184
+ 79: z,
1185
+ 80: B,
1186
+ 81: V,
1187
+ 82: Be,
1188
+ 83: Ve,
1189
+ 84: He,
1190
+ 85: Ue,
1191
+ 86: We,
1192
+ 87: Ge,
1193
+ 88: Ke,
1194
+ 89: qe,
1195
+ 90: Je,
1196
+ 91: Ye,
1197
+ 92: H,
1198
+ 93: U,
1199
+ 94: W,
1200
+ 95: Xe,
1201
+ 96: Ze,
1202
+ 97: Qe,
1203
+ 98: $e,
1204
+ 99: et,
1205
+ 100: G,
1206
+ 101: tt,
1207
+ 102: nt,
1208
+ 103: rt
1209
+ },
1210
+ {
1211
+ 57: 106,
1212
+ 59: [1, 107],
1213
+ 67: [1, 108],
1214
+ 68: [1, 109]
1215
+ },
1216
+ {
1217
+ 23: 110,
1218
+ 73: F
1219
+ },
1220
+ {
1221
+ 23: 111,
1222
+ 73: F
1223
+ },
1224
+ {
1225
+ 23: 112,
1226
+ 73: F
1227
+ },
1228
+ {
1229
+ 23: 113,
1230
+ 73: F
1231
+ },
1232
+ t([
1233
+ 5,
1234
+ 66,
1235
+ 72,
1236
+ 78,
1237
+ 79,
1238
+ 80,
1239
+ 81,
1240
+ 82,
1241
+ 83,
1242
+ 84,
1243
+ 85,
1244
+ 86,
1245
+ 87,
1246
+ 88,
1247
+ 89,
1248
+ 90,
1249
+ 91,
1250
+ 92,
1251
+ 93,
1252
+ 94,
1253
+ 95,
1254
+ 96,
1255
+ 97,
1256
+ 98,
1257
+ 99,
1258
+ 100,
1259
+ 101,
1260
+ 102,
1261
+ 103,
1262
+ 104
1263
+ ], it),
1264
+ t(I, [2, 6]),
1265
+ t(I, [2, 16]),
1266
+ t(K, [2, 10], { 11: 114 }),
1267
+ t(I, [2, 18]),
1268
+ {
1269
+ 5: [1, 116],
1270
+ 20: [1, 115]
1271
+ },
1272
+ { 5: [1, 117] },
1273
+ t(I, [2, 22]),
1274
+ { 5: [1, 118] },
1275
+ { 5: [1, 119] },
1276
+ t(I, [2, 25]),
1277
+ t(I, [2, 26]),
1278
+ t(I, [2, 27]),
1279
+ t(I, [2, 28]),
1280
+ t(I, [2, 29]),
1281
+ t(I, [2, 32]),
1282
+ t(I, [2, 33]),
1283
+ t(q, a, { 7: 120 }),
1284
+ t(q, a, { 7: 121 }),
1285
+ t(q, a, { 7: 122 }),
1286
+ t(at, a, {
1287
+ 41: 123,
1288
+ 7: 124
1289
+ }),
1290
+ t(J, a, {
1291
+ 43: 125,
1292
+ 7: 126
1293
+ }),
1294
+ t(J, a, {
1295
+ 7: 126,
1296
+ 43: 127
1297
+ }),
1298
+ t(ot, a, {
1299
+ 46: 128,
1300
+ 7: 129
1301
+ }),
1302
+ t(q, a, { 7: 130 }),
1303
+ {
1304
+ 5: [1, 132],
1305
+ 52: [1, 131]
1306
+ },
1307
+ {
1308
+ 5: [1, 134],
1309
+ 52: [1, 133]
1310
+ },
1311
+ t(Y, it, {
1312
+ 74: 135,
1313
+ 75: [1, 136]
1314
+ }),
1315
+ {
1316
+ 5: [1, 138],
1317
+ 52: [1, 137]
1318
+ },
1319
+ {
1320
+ 5: [1, 140],
1321
+ 52: [1, 139]
1322
+ },
1323
+ { 5: [1, 141] },
1324
+ {
1325
+ 23: 145,
1326
+ 70: [1, 142],
1327
+ 71: [1, 143],
1328
+ 72: [1, 144],
1329
+ 73: F
1330
+ },
1331
+ {
1332
+ 69: 146,
1333
+ 78: R,
1334
+ 79: z,
1335
+ 80: B,
1336
+ 81: V,
1337
+ 82: Be,
1338
+ 83: Ve,
1339
+ 84: He,
1340
+ 85: Ue,
1341
+ 86: We,
1342
+ 87: Ge,
1343
+ 88: Ke,
1344
+ 89: qe,
1345
+ 90: Je,
1346
+ 91: Ye,
1347
+ 92: H,
1348
+ 93: U,
1349
+ 94: W,
1350
+ 95: Xe,
1351
+ 96: Ze,
1352
+ 97: Qe,
1353
+ 98: $e,
1354
+ 99: et,
1355
+ 100: G,
1356
+ 101: tt,
1357
+ 102: nt,
1358
+ 103: rt
1359
+ },
1360
+ t(X, [2, 79]),
1361
+ t(X, [2, 80]),
1362
+ t(X, [2, 81]),
1363
+ t(X, [2, 82]),
1364
+ t(X, [2, 83]),
1365
+ t(X, [2, 84]),
1366
+ t(X, [2, 85]),
1367
+ t(X, [2, 86]),
1368
+ t(X, [2, 87]),
1369
+ t(X, [2, 88]),
1370
+ t(X, [2, 89]),
1371
+ t(X, [2, 90]),
1372
+ t(X, [2, 91]),
1373
+ t(X, [2, 92]),
1374
+ t(X, [2, 93]),
1375
+ t(X, [2, 94]),
1376
+ t(X, [2, 95]),
1377
+ t(X, [2, 96]),
1378
+ t(X, [2, 97]),
1379
+ t(X, [2, 98]),
1380
+ t(X, [2, 99]),
1381
+ t(X, [2, 100]),
1382
+ t(X, [2, 101]),
1383
+ t(X, [2, 102]),
1384
+ t(X, [2, 103]),
1385
+ t(X, [2, 104]),
1386
+ {
1387
+ 23: 147,
1388
+ 73: F
1389
+ },
1390
+ {
1391
+ 23: 149,
1392
+ 60: 148,
1393
+ 73: F
1394
+ },
1395
+ { 73: [2, 68] },
1396
+ { 73: [2, 69] },
1397
+ {
1398
+ 58: 150,
1399
+ 104: Z
1400
+ },
1401
+ {
1402
+ 58: 152,
1403
+ 104: Z
1404
+ },
1405
+ {
1406
+ 58: 153,
1407
+ 104: Z
1408
+ },
1409
+ {
1410
+ 58: 154,
1411
+ 104: Z
1412
+ },
1413
+ {
1414
+ 4: [1, 157],
1415
+ 5: [1, 159],
1416
+ 12: 156,
1417
+ 13: 158,
1418
+ 17: [1, 155],
1419
+ 51: D,
1420
+ 53: O,
1421
+ 54: k
1422
+ },
1423
+ { 5: [1, 160] },
1424
+ t(I, [2, 20]),
1425
+ t(I, [2, 21]),
1426
+ t(I, [2, 23]),
1427
+ t(I, [2, 24]),
1428
+ {
1429
+ 4: o,
1430
+ 5: s,
1431
+ 8: 8,
1432
+ 9: 10,
1433
+ 10: c,
1434
+ 13: 13,
1435
+ 14: l,
1436
+ 15: u,
1437
+ 17: [1, 161],
1438
+ 18: 16,
1439
+ 19: d,
1440
+ 22: f,
1441
+ 23: 41,
1442
+ 24: p,
1443
+ 25: 20,
1444
+ 26: 21,
1445
+ 27: 22,
1446
+ 28: 23,
1447
+ 29: 24,
1448
+ 30: m,
1449
+ 31: h,
1450
+ 32: g,
1451
+ 34: _,
1452
+ 36: v,
1453
+ 37: y,
1454
+ 38: b,
1455
+ 39: x,
1456
+ 40: S,
1457
+ 42: C,
1458
+ 44: w,
1459
+ 45: T,
1460
+ 47: E,
1461
+ 51: D,
1462
+ 53: O,
1463
+ 54: k,
1464
+ 56: A,
1465
+ 61: j,
1466
+ 62: M,
1467
+ 63: N,
1468
+ 64: P,
1469
+ 73: F
1470
+ },
1471
+ {
1472
+ 4: o,
1473
+ 5: s,
1474
+ 8: 8,
1475
+ 9: 10,
1476
+ 10: c,
1477
+ 13: 13,
1478
+ 14: l,
1479
+ 15: u,
1480
+ 17: [1, 162],
1481
+ 18: 16,
1482
+ 19: d,
1483
+ 22: f,
1484
+ 23: 41,
1485
+ 24: p,
1486
+ 25: 20,
1487
+ 26: 21,
1488
+ 27: 22,
1489
+ 28: 23,
1490
+ 29: 24,
1491
+ 30: m,
1492
+ 31: h,
1493
+ 32: g,
1494
+ 34: _,
1495
+ 36: v,
1496
+ 37: y,
1497
+ 38: b,
1498
+ 39: x,
1499
+ 40: S,
1500
+ 42: C,
1501
+ 44: w,
1502
+ 45: T,
1503
+ 47: E,
1504
+ 51: D,
1505
+ 53: O,
1506
+ 54: k,
1507
+ 56: A,
1508
+ 61: j,
1509
+ 62: M,
1510
+ 63: N,
1511
+ 64: P,
1512
+ 73: F
1513
+ },
1514
+ {
1515
+ 4: o,
1516
+ 5: s,
1517
+ 8: 8,
1518
+ 9: 10,
1519
+ 10: c,
1520
+ 13: 13,
1521
+ 14: l,
1522
+ 15: u,
1523
+ 17: [1, 163],
1524
+ 18: 16,
1525
+ 19: d,
1526
+ 22: f,
1527
+ 23: 41,
1528
+ 24: p,
1529
+ 25: 20,
1530
+ 26: 21,
1531
+ 27: 22,
1532
+ 28: 23,
1533
+ 29: 24,
1534
+ 30: m,
1535
+ 31: h,
1536
+ 32: g,
1537
+ 34: _,
1538
+ 36: v,
1539
+ 37: y,
1540
+ 38: b,
1541
+ 39: x,
1542
+ 40: S,
1543
+ 42: C,
1544
+ 44: w,
1545
+ 45: T,
1546
+ 47: E,
1547
+ 51: D,
1548
+ 53: O,
1549
+ 54: k,
1550
+ 56: A,
1551
+ 61: j,
1552
+ 62: M,
1553
+ 63: N,
1554
+ 64: P,
1555
+ 73: F
1556
+ },
1557
+ { 17: [1, 164] },
1558
+ {
1559
+ 4: o,
1560
+ 5: s,
1561
+ 8: 8,
1562
+ 9: 10,
1563
+ 10: c,
1564
+ 13: 13,
1565
+ 14: l,
1566
+ 15: u,
1567
+ 17: [2, 47],
1568
+ 18: 16,
1569
+ 19: d,
1570
+ 22: f,
1571
+ 23: 41,
1572
+ 24: p,
1573
+ 25: 20,
1574
+ 26: 21,
1575
+ 27: 22,
1576
+ 28: 23,
1577
+ 29: 24,
1578
+ 30: m,
1579
+ 31: h,
1580
+ 32: g,
1581
+ 34: _,
1582
+ 36: v,
1583
+ 37: y,
1584
+ 38: b,
1585
+ 39: x,
1586
+ 40: S,
1587
+ 42: C,
1588
+ 44: w,
1589
+ 45: T,
1590
+ 47: E,
1591
+ 50: [1, 165],
1592
+ 51: D,
1593
+ 53: O,
1594
+ 54: k,
1595
+ 56: A,
1596
+ 61: j,
1597
+ 62: M,
1598
+ 63: N,
1599
+ 64: P,
1600
+ 73: F
1601
+ },
1602
+ { 17: [1, 166] },
1603
+ {
1604
+ 4: o,
1605
+ 5: s,
1606
+ 8: 8,
1607
+ 9: 10,
1608
+ 10: c,
1609
+ 13: 13,
1610
+ 14: l,
1611
+ 15: u,
1612
+ 17: [2, 45],
1613
+ 18: 16,
1614
+ 19: d,
1615
+ 22: f,
1616
+ 23: 41,
1617
+ 24: p,
1618
+ 25: 20,
1619
+ 26: 21,
1620
+ 27: 22,
1621
+ 28: 23,
1622
+ 29: 24,
1623
+ 30: m,
1624
+ 31: h,
1625
+ 32: g,
1626
+ 34: _,
1627
+ 36: v,
1628
+ 37: y,
1629
+ 38: b,
1630
+ 39: x,
1631
+ 40: S,
1632
+ 42: C,
1633
+ 44: w,
1634
+ 45: T,
1635
+ 47: E,
1636
+ 49: [1, 167],
1637
+ 51: D,
1638
+ 53: O,
1639
+ 54: k,
1640
+ 56: A,
1641
+ 61: j,
1642
+ 62: M,
1643
+ 63: N,
1644
+ 64: P,
1645
+ 73: F
1646
+ },
1647
+ { 17: [1, 168] },
1648
+ { 17: [1, 169] },
1649
+ {
1650
+ 4: o,
1651
+ 5: s,
1652
+ 8: 8,
1653
+ 9: 10,
1654
+ 10: c,
1655
+ 13: 13,
1656
+ 14: l,
1657
+ 15: u,
1658
+ 17: [2, 43],
1659
+ 18: 16,
1660
+ 19: d,
1661
+ 22: f,
1662
+ 23: 41,
1663
+ 24: p,
1664
+ 25: 20,
1665
+ 26: 21,
1666
+ 27: 22,
1667
+ 28: 23,
1668
+ 29: 24,
1669
+ 30: m,
1670
+ 31: h,
1671
+ 32: g,
1672
+ 34: _,
1673
+ 36: v,
1674
+ 37: y,
1675
+ 38: b,
1676
+ 39: x,
1677
+ 40: S,
1678
+ 42: C,
1679
+ 44: w,
1680
+ 45: T,
1681
+ 47: E,
1682
+ 48: [1, 170],
1683
+ 51: D,
1684
+ 53: O,
1685
+ 54: k,
1686
+ 56: A,
1687
+ 61: j,
1688
+ 62: M,
1689
+ 63: N,
1690
+ 64: P,
1691
+ 73: F
1692
+ },
1693
+ {
1694
+ 4: o,
1695
+ 5: s,
1696
+ 8: 8,
1697
+ 9: 10,
1698
+ 10: c,
1699
+ 13: 13,
1700
+ 14: l,
1701
+ 15: u,
1702
+ 17: [1, 171],
1703
+ 18: 16,
1704
+ 19: d,
1705
+ 22: f,
1706
+ 23: 41,
1707
+ 24: p,
1708
+ 25: 20,
1709
+ 26: 21,
1710
+ 27: 22,
1711
+ 28: 23,
1712
+ 29: 24,
1713
+ 30: m,
1714
+ 31: h,
1715
+ 32: g,
1716
+ 34: _,
1717
+ 36: v,
1718
+ 37: y,
1719
+ 38: b,
1720
+ 39: x,
1721
+ 40: S,
1722
+ 42: C,
1723
+ 44: w,
1724
+ 45: T,
1725
+ 47: E,
1726
+ 51: D,
1727
+ 53: O,
1728
+ 54: k,
1729
+ 56: A,
1730
+ 61: j,
1731
+ 62: M,
1732
+ 63: N,
1733
+ 64: P,
1734
+ 73: F
1735
+ },
1736
+ { 16: [1, 172] },
1737
+ t(I, [2, 50]),
1738
+ { 16: [1, 173] },
1739
+ t(I, [2, 55]),
1740
+ t(Y, [2, 76]),
1741
+ { 76: [1, 174] },
1742
+ { 16: [1, 175] },
1743
+ t(I, [2, 52]),
1744
+ { 16: [1, 176] },
1745
+ t(I, [2, 57]),
1746
+ t(I, [2, 53]),
1747
+ {
1748
+ 23: 177,
1749
+ 73: F
1750
+ },
1751
+ {
1752
+ 23: 178,
1753
+ 73: F
1754
+ },
1755
+ {
1756
+ 23: 179,
1757
+ 73: F
1758
+ },
1759
+ {
1760
+ 58: 180,
1761
+ 104: Z
1762
+ },
1763
+ {
1764
+ 23: 181,
1765
+ 72: [1, 182],
1766
+ 73: F
1767
+ },
1768
+ {
1769
+ 58: 183,
1770
+ 104: Z
1771
+ },
1772
+ {
1773
+ 58: 184,
1774
+ 104: Z
1775
+ },
1776
+ {
1777
+ 66: [1, 185],
1778
+ 104: [2, 67]
1779
+ },
1780
+ { 5: [2, 60] },
1781
+ { 5: [2, 105] },
1782
+ { 5: [2, 61] },
1783
+ { 5: [2, 62] },
1784
+ { 5: [2, 63] },
1785
+ t(I, [2, 17]),
1786
+ t(K, [2, 11]),
1787
+ {
1788
+ 13: 186,
1789
+ 51: D,
1790
+ 53: O,
1791
+ 54: k
1792
+ },
1793
+ t(K, [2, 13]),
1794
+ t(K, [2, 14]),
1795
+ t(I, [2, 19]),
1796
+ t(I, [2, 35]),
1797
+ t(I, [2, 36]),
1798
+ t(I, [2, 37]),
1799
+ t(I, [2, 38]),
1800
+ { 16: [1, 187] },
1801
+ t(I, [2, 39]),
1802
+ { 16: [1, 188] },
1803
+ t(I, [2, 40]),
1804
+ t(I, [2, 41]),
1805
+ { 16: [1, 189] },
1806
+ t(I, [2, 42]),
1807
+ { 5: [1, 190] },
1808
+ { 5: [1, 191] },
1809
+ { 77: [1, 192] },
1810
+ { 5: [1, 193] },
1811
+ { 5: [1, 194] },
1812
+ {
1813
+ 58: 195,
1814
+ 104: Z
1815
+ },
1816
+ {
1817
+ 58: 196,
1818
+ 104: Z
1819
+ },
1820
+ {
1821
+ 58: 197,
1822
+ 104: Z
1823
+ },
1824
+ { 5: [2, 75] },
1825
+ {
1826
+ 58: 198,
1827
+ 104: Z
1828
+ },
1829
+ {
1830
+ 23: 199,
1831
+ 73: F
1832
+ },
1833
+ { 5: [2, 58] },
1834
+ { 5: [2, 59] },
1835
+ {
1836
+ 23: 200,
1837
+ 73: F
1838
+ },
1839
+ t(K, [2, 12]),
1840
+ t(at, a, {
1841
+ 7: 124,
1842
+ 41: 201
1843
+ }),
1844
+ t(J, a, {
1845
+ 7: 126,
1846
+ 43: 202
1847
+ }),
1848
+ t(ot, a, {
1849
+ 7: 129,
1850
+ 46: 203
1851
+ }),
1852
+ t(I, [2, 49]),
1853
+ t(I, [2, 54]),
1854
+ t(Y, [2, 77]),
1855
+ t(I, [2, 51]),
1856
+ t(I, [2, 56]),
1857
+ { 5: [2, 70] },
1858
+ { 5: [2, 71] },
1859
+ { 5: [2, 72] },
1860
+ { 5: [2, 73] },
1861
+ {
1862
+ 58: 204,
1863
+ 104: Z
1864
+ },
1865
+ { 104: [2, 66] },
1866
+ { 17: [2, 48] },
1867
+ { 17: [2, 46] },
1868
+ { 17: [2, 44] },
1869
+ { 5: [2, 74] }
1870
+ ],
1871
+ defaultActions: {
1872
+ 5: [2, 1],
1873
+ 6: [2, 2],
1874
+ 108: [2, 68],
1875
+ 109: [2, 69],
1876
+ 150: [2, 60],
1877
+ 151: [2, 105],
1878
+ 152: [2, 61],
1879
+ 153: [2, 62],
1880
+ 154: [2, 63],
1881
+ 180: [2, 75],
1882
+ 183: [2, 58],
1883
+ 184: [2, 59],
1884
+ 195: [2, 70],
1885
+ 196: [2, 71],
1886
+ 197: [2, 72],
1887
+ 198: [2, 73],
1888
+ 200: [2, 66],
1889
+ 201: [2, 48],
1890
+ 202: [2, 46],
1891
+ 203: [2, 44],
1892
+ 204: [2, 74]
1893
+ },
1894
+ parseError: /* @__PURE__ */ __name(function(e, t) {
1895
+ if (t.recoverable) this.trace(e);
1896
+ else {
1897
+ var n = Error(e);
1898
+ throw n.hash = t, n;
1899
+ }
1900
+ }, "parseError"),
1901
+ parse: /* @__PURE__ */ __name(function(t) {
1902
+ var n = this, r = [0], i = [], a = [null], o = [], s = this.table, c = "", l = 0, u = 0, d = 0, f = 2, p = 1, m = o.slice.call(arguments, 1), h = Object.create(this.lexer), g = { yy: {} };
1903
+ for (var _ in this.yy) Object.prototype.hasOwnProperty.call(this.yy, _) && (g.yy[_] = this.yy[_]);
1904
+ h.setInput(t, g.yy), g.yy.lexer = h, g.yy.parser = this, h.yylloc === void 0 && (h.yylloc = {});
1905
+ var v = h.yylloc;
1906
+ o.push(v);
1907
+ var y = h.options && h.options.ranges;
1908
+ typeof g.yy.parseError == "function" ? this.parseError = g.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
1909
+ function b(e) {
1910
+ r.length -= 2 * e, a.length -= e, o.length -= e;
1911
+ }
1912
+ __name(b, "popStack");
1913
+ function x() {
1914
+ var e = i.pop() || h.lex() || p;
1915
+ return typeof e != "number" && (e instanceof Array && (i = e, e = i.pop()), e = n.symbols_[e] || e), e;
1916
+ }
1917
+ __name(x, "lex");
1918
+ for (var S, C, w, T, E, D = {}, O, k, A, j;;) {
1919
+ if (w = r[r.length - 1], this.defaultActions[w] ? T = this.defaultActions[w] : (S ??= x(), T = s[w] && s[w][S]), T === void 0 || !T.length || !T[0]) {
1920
+ var M = "";
1921
+ for (O in j = [], s[w]) this.terminals_[O] && O > f && j.push("'" + this.terminals_[O] + "'");
1922
+ M = h.showPosition ? "Parse error on line " + (l + 1) + ":\n" + h.showPosition() + "\nExpecting " + j.join(", ") + ", got '" + (this.terminals_[S] || S) + "'" : "Parse error on line " + (l + 1) + ": Unexpected " + (S == p ? "end of input" : "'" + (this.terminals_[S] || S) + "'"), this.parseError(M, {
1923
+ text: h.match,
1924
+ token: this.terminals_[S] || S,
1925
+ line: h.yylineno,
1926
+ loc: v,
1927
+ expected: j
1928
+ });
1929
+ }
1930
+ if (T[0] instanceof Array && T.length > 1) throw Error("Parse Error: multiple actions possible at state: " + w + ", token: " + S);
1931
+ switch (T[0]) {
1932
+ case 1:
1933
+ r.push(S), a.push(h.yytext), o.push(h.yylloc), r.push(T[1]), S = null, C ? (S = C, C = null) : (u = h.yyleng, c = h.yytext, l = h.yylineno, v = h.yylloc, d > 0 && d--);
1934
+ break;
1935
+ case 2:
1936
+ if (k = this.productions_[T[1]][1], D.$ = a[a.length - k], D._$ = {
1937
+ first_line: o[o.length - (k || 1)].first_line,
1938
+ last_line: o[o.length - 1].last_line,
1939
+ first_column: o[o.length - (k || 1)].first_column,
1940
+ last_column: o[o.length - 1].last_column
1941
+ }, y && (D._$.range = [o[o.length - (k || 1)].range[0], o[o.length - 1].range[1]]), E = this.performAction.apply(D, [
1942
+ c,
1943
+ u,
1944
+ l,
1945
+ g.yy,
1946
+ T[1],
1947
+ a,
1948
+ o
1949
+ ].concat(m)), E !== void 0) return E;
1950
+ k && (r = r.slice(0, -1 * k * 2), a = a.slice(0, -1 * k), o = o.slice(0, -1 * k)), r.push(this.productions_[T[1]][0]), a.push(D.$), o.push(D._$), A = s[r[r.length - 2]][r[r.length - 1]], r.push(A);
1951
+ break;
1952
+ case 3: return !0;
1953
+ }
1954
+ }
1955
+ return !0;
1956
+ }, "parse")
1957
+ };
1958
+ Q.lexer = /* @__PURE__ */ (function() {
1959
+ return {
1960
+ EOF: 1,
1961
+ parseError: /* @__PURE__ */ __name(function(e, t) {
1962
+ if (this.yy.parser) this.yy.parser.parseError(e, t);
1963
+ else throw Error(e);
1964
+ }, "parseError"),
1965
+ setInput: /* @__PURE__ */ __name(function(e, t) {
1966
+ return this.yy = t || this.yy || {}, this._input = e, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
1967
+ first_line: 1,
1968
+ first_column: 0,
1969
+ last_line: 1,
1970
+ last_column: 0
1971
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
1972
+ }, "setInput"),
1973
+ input: /* @__PURE__ */ __name(function() {
1974
+ var e = this._input[0];
1975
+ return this.yytext += e, this.yyleng++, this.offset++, this.match += e, this.matched += e, e.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), e;
1976
+ }, "input"),
1977
+ unput: /* @__PURE__ */ __name(function(e) {
1978
+ var t = e.length, n = e.split(/(?:\r\n?|\n)/g);
1979
+ this._input = e + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - t), this.offset -= t;
1980
+ var r = this.match.split(/(?:\r\n?|\n)/g);
1981
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), n.length - 1 && (this.yylineno -= n.length - 1);
1982
+ var i = this.yylloc.range;
1983
+ return this.yylloc = {
1984
+ first_line: this.yylloc.first_line,
1985
+ last_line: this.yylineno + 1,
1986
+ first_column: this.yylloc.first_column,
1987
+ last_column: n ? (n.length === r.length ? this.yylloc.first_column : 0) + r[r.length - n.length].length - n[0].length : this.yylloc.first_column - t
1988
+ }, this.options.ranges && (this.yylloc.range = [i[0], i[0] + this.yyleng - t]), this.yyleng = this.yytext.length, this;
1989
+ }, "unput"),
1990
+ more: /* @__PURE__ */ __name(function() {
1991
+ return this._more = !0, this;
1992
+ }, "more"),
1993
+ reject: /* @__PURE__ */ __name(function() {
1994
+ if (this.options.backtrack_lexer) this._backtrack = !0;
1995
+ else 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(), {
1996
+ text: "",
1997
+ token: null,
1998
+ line: this.yylineno
1999
+ });
2000
+ return this;
2001
+ }, "reject"),
2002
+ less: /* @__PURE__ */ __name(function(e) {
2003
+ this.unput(this.match.slice(e));
2004
+ }, "less"),
2005
+ pastInput: /* @__PURE__ */ __name(function() {
2006
+ var e = this.matched.substr(0, this.matched.length - this.match.length);
2007
+ return (e.length > 20 ? "..." : "") + e.substr(-20).replace(/\n/g, "");
2008
+ }, "pastInput"),
2009
+ upcomingInput: /* @__PURE__ */ __name(function() {
2010
+ var e = this.match;
2011
+ return e.length < 20 && (e += this._input.substr(0, 20 - e.length)), (e.substr(0, 20) + (e.length > 20 ? "..." : "")).replace(/\n/g, "");
2012
+ }, "upcomingInput"),
2013
+ showPosition: /* @__PURE__ */ __name(function() {
2014
+ var e = this.pastInput(), t = Array(e.length + 1).join("-");
2015
+ return e + this.upcomingInput() + "\n" + t + "^";
2016
+ }, "showPosition"),
2017
+ test_match: /* @__PURE__ */ __name(function(e, t) {
2018
+ var n, r, i;
2019
+ if (this.options.backtrack_lexer && (i = {
2020
+ yylineno: this.yylineno,
2021
+ yylloc: {
2022
+ first_line: this.yylloc.first_line,
2023
+ last_line: this.last_line,
2024
+ first_column: this.yylloc.first_column,
2025
+ last_column: this.yylloc.last_column
2026
+ },
2027
+ yytext: this.yytext,
2028
+ match: this.match,
2029
+ matches: this.matches,
2030
+ matched: this.matched,
2031
+ yyleng: this.yyleng,
2032
+ offset: this.offset,
2033
+ _more: this._more,
2034
+ _input: this._input,
2035
+ yy: this.yy,
2036
+ conditionStack: this.conditionStack.slice(0),
2037
+ done: this.done
2038
+ }, this.options.ranges && (i.yylloc.range = this.yylloc.range.slice(0))), r = e[0].match(/(?:\r\n?|\n).*/g), r && (this.yylineno += r.length), this.yylloc = {
2039
+ first_line: this.yylloc.last_line,
2040
+ last_line: this.yylineno + 1,
2041
+ first_column: this.yylloc.last_column,
2042
+ last_column: r ? r[r.length - 1].length - r[r.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + e[0].length
2043
+ }, this.yytext += e[0], this.match += e[0], this.matches = e, 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(e[0].length), this.matched += e[0], n = this.performAction.call(this, this.yy, this, t, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), n) return n;
2044
+ if (this._backtrack) {
2045
+ for (var a in i) this[a] = i[a];
2046
+ return !1;
2047
+ }
2048
+ return !1;
2049
+ }, "test_match"),
2050
+ next: /* @__PURE__ */ __name(function() {
2051
+ if (this.done) return this.EOF;
2052
+ this._input || (this.done = !0);
2053
+ var e, t, n, r;
2054
+ this._more || (this.yytext = "", this.match = "");
2055
+ for (var i = this._currentRules(), a = 0; a < i.length; a++) if (n = this._input.match(this.rules[i[a]]), n && (!t || n[0].length > t[0].length)) {
2056
+ if (t = n, r = a, this.options.backtrack_lexer) {
2057
+ if (e = this.test_match(n, i[a]), e !== !1) return e;
2058
+ if (this._backtrack) {
2059
+ t = !1;
2060
+ continue;
2061
+ } else return !1;
2062
+ } else if (!this.options.flex) break;
2063
+ }
2064
+ return t ? (e = this.test_match(t, i[r]), e === !1 ? !1 : e) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
2065
+ text: "",
2066
+ token: null,
2067
+ line: this.yylineno
2068
+ });
2069
+ }, "next"),
2070
+ lex: /* @__PURE__ */ __name(function() {
2071
+ return this.next() || this.lex();
2072
+ }, "lex"),
2073
+ begin: /* @__PURE__ */ __name(function(e) {
2074
+ this.conditionStack.push(e);
2075
+ }, "begin"),
2076
+ popState: /* @__PURE__ */ __name(function() {
2077
+ return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0];
2078
+ }, "popState"),
2079
+ _currentRules: /* @__PURE__ */ __name(function() {
2080
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
2081
+ }, "_currentRules"),
2082
+ topState: /* @__PURE__ */ __name(function(e) {
2083
+ return e = this.conditionStack.length - 1 - Math.abs(e || 0), e >= 0 ? this.conditionStack[e] : "INITIAL";
2084
+ }, "topState"),
2085
+ pushState: /* @__PURE__ */ __name(function(e) {
2086
+ this.begin(e);
2087
+ }, "pushState"),
2088
+ stateStackSize: /* @__PURE__ */ __name(function() {
2089
+ return this.conditionStack.length;
2090
+ }, "stateStackSize"),
2091
+ options: { "case-insensitive": !0 },
2092
+ performAction: /* @__PURE__ */ __name(function(e, t, n, r) {
2093
+ switch (n) {
2094
+ case 0: return 5;
2095
+ case 1: break;
2096
+ case 2: break;
2097
+ case 3: break;
2098
+ case 4: break;
2099
+ case 5: break;
2100
+ case 6: return 20;
2101
+ case 7: return this.begin("CONFIG"), 75;
2102
+ case 8: return 76;
2103
+ case 9: return this.popState(), this.begin("ALIAS"), 77;
2104
+ case 10: return this.popState(), this.popState(), 77;
2105
+ case 11: return t.yytext = t.yytext.trim(), 73;
2106
+ case 12: return t.yytext = t.yytext.trim(), this.begin("ALIAS"), 73;
2107
+ case 13: return t.yytext = t.yytext.trim(), this.popState(), 73;
2108
+ case 14: return this.popState(), 10;
2109
+ case 15: return t.yytext = t.yytext.trim(), this.popState(), 10;
2110
+ case 16: return this.begin("LINE"), 15;
2111
+ case 17: return this.begin("ID"), 51;
2112
+ case 18: return this.begin("ID"), 53;
2113
+ case 19: return 14;
2114
+ case 20: return this.begin("ID"), 54;
2115
+ case 21: return this.popState(), this.popState(), this.begin("LINE"), 52;
2116
+ case 22: return this.popState(), this.popState(), 5;
2117
+ case 23: return this.begin("LINE"), 37;
2118
+ case 24: return this.begin("LINE"), 38;
2119
+ case 25: return this.begin("LINE"), 39;
2120
+ case 26: return this.begin("LINE"), 40;
2121
+ case 27: return this.begin("LINE"), 50;
2122
+ case 28: return this.begin("LINE"), 42;
2123
+ case 29: return this.begin("LINE"), 44;
2124
+ case 30: return this.begin("LINE"), 49;
2125
+ case 31: return this.begin("LINE"), 45;
2126
+ case 32: return this.begin("LINE"), 48;
2127
+ case 33: return this.begin("LINE"), 47;
2128
+ case 34: return this.popState(), 16;
2129
+ case 35: return 17;
2130
+ case 36: return 67;
2131
+ case 37: return 68;
2132
+ case 38: return 61;
2133
+ case 39: return 62;
2134
+ case 40: return 63;
2135
+ case 41: return 64;
2136
+ case 42: return 59;
2137
+ case 43: return 56;
2138
+ case 44: return this.begin("ID"), 22;
2139
+ case 45: return this.begin("ID"), 24;
2140
+ case 46: return 30;
2141
+ case 47: return 31;
2142
+ case 48: return this.begin("acc_title"), 32;
2143
+ case 49: return this.popState(), "acc_title_value";
2144
+ case 50: return this.begin("acc_descr"), 34;
2145
+ case 51: return this.popState(), "acc_descr_value";
2146
+ case 52:
2147
+ this.begin("acc_descr_multiline");
2148
+ break;
2149
+ case 53:
2150
+ this.popState();
2151
+ break;
2152
+ case 54: return "acc_descr_multiline_value";
2153
+ case 55: return 6;
2154
+ case 56: return 19;
2155
+ case 57: return 21;
2156
+ case 58: return 66;
2157
+ case 59: return 5;
2158
+ case 60: return t.yytext = t.yytext.trim(), 73;
2159
+ case 61: return 80;
2160
+ case 62: return 97;
2161
+ case 63: return 98;
2162
+ case 64: return 99;
2163
+ case 65: return 78;
2164
+ case 66: return 79;
2165
+ case 67: return 100;
2166
+ case 68: return 101;
2167
+ case 69: return 102;
2168
+ case 70: return 103;
2169
+ case 71: return 85;
2170
+ case 72: return 86;
2171
+ case 73: return 87;
2172
+ case 74: return 88;
2173
+ case 75: return 93;
2174
+ case 76: return 94;
2175
+ case 77: return 95;
2176
+ case 78: return 96;
2177
+ case 79: return 81;
2178
+ case 80: return 82;
2179
+ case 81: return 83;
2180
+ case 82: return 84;
2181
+ case 83: return 89;
2182
+ case 84: return 90;
2183
+ case 85: return 91;
2184
+ case 86: return 92;
2185
+ case 87: return 104;
2186
+ case 88: return 104;
2187
+ case 89: return 70;
2188
+ case 90: return 71;
2189
+ case 91: return 72;
2190
+ case 92: return 5;
2191
+ case 93: return 10;
2192
+ }
2193
+ }, "anonymous"),
2194
+ rules: [
2195
+ /^(?:[\n]+)/i,
2196
+ /^(?:\s+)/i,
2197
+ /^(?:((?!\n)\s)+)/i,
2198
+ /^(?:#[^\n]*)/i,
2199
+ /^(?:%(?!\{)[^\n]*)/i,
2200
+ /^(?:[^\}]%%[^\n]*)/i,
2201
+ /^(?:[0-9]+(?=[ \n]+))/i,
2202
+ /^(?:@\{)/i,
2203
+ /^(?:[^\}]+)/i,
2204
+ /^(?:\}(?=\s+as\s))/i,
2205
+ /^(?:\})/i,
2206
+ /^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,
2207
+ /^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i,
2208
+ /^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i,
2209
+ /^(?:[^<>:\n,;@]*<[^\n]*)/i,
2210
+ /^(?:[^\n]+)/i,
2211
+ /^(?:box\b)/i,
2212
+ /^(?:participant\b)/i,
2213
+ /^(?:actor\b)/i,
2214
+ /^(?:create\b)/i,
2215
+ /^(?:destroy\b)/i,
2216
+ /^(?:as\b)/i,
2217
+ /^(?:(?:))/i,
2218
+ /^(?:loop\b)/i,
2219
+ /^(?:rect\b)/i,
2220
+ /^(?:opt\b)/i,
2221
+ /^(?:alt\b)/i,
2222
+ /^(?:else\b)/i,
2223
+ /^(?:par\b)/i,
2224
+ /^(?:par_over\b)/i,
2225
+ /^(?:and\b)/i,
2226
+ /^(?:critical\b)/i,
2227
+ /^(?:option\b)/i,
2228
+ /^(?:break\b)/i,
2229
+ /^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,
2230
+ /^(?:end\b)/i,
2231
+ /^(?:left of\b)/i,
2232
+ /^(?:right of\b)/i,
2233
+ /^(?:links\b)/i,
2234
+ /^(?:link\b)/i,
2235
+ /^(?:properties\b)/i,
2236
+ /^(?:details\b)/i,
2237
+ /^(?:over\b)/i,
2238
+ /^(?:note\b)/i,
2239
+ /^(?:activate\b)/i,
2240
+ /^(?:deactivate\b)/i,
2241
+ /^(?:title\s[^#\n;]+)/i,
2242
+ /^(?:title:\s[^#\n;]+)/i,
2243
+ /^(?:accTitle\s*:\s*)/i,
2244
+ /^(?:(?!\n||)*[^\n]*)/i,
2245
+ /^(?:accDescr\s*:\s*)/i,
2246
+ /^(?:(?!\n||)*[^\n]*)/i,
2247
+ /^(?:accDescr\s*\{\s*)/i,
2248
+ /^(?:[\}])/i,
2249
+ /^(?:[^\}]*)/i,
2250
+ /^(?:sequenceDiagram\b)/i,
2251
+ /^(?:autonumber\b)/i,
2252
+ /^(?:off\b)/i,
2253
+ /^(?:,)/i,
2254
+ /^(?:;)/i,
2255
+ /^(?:[^\/\\\+\()\+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)|-\|\\|-\\|-\/|-\/\/|-\|\/|\/\|-|\\\|-|\/\/-|\\\\-|\/\|-|--\|\\|--|\(\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,
2256
+ /^(?:->>)/i,
2257
+ /^(?:<<->>)/i,
2258
+ /^(?:-->>)/i,
2259
+ /^(?:<<-->>)/i,
2260
+ /^(?:->)/i,
2261
+ /^(?:-->)/i,
2262
+ /^(?:-[x])/i,
2263
+ /^(?:--[x])/i,
2264
+ /^(?:-[\)])/i,
2265
+ /^(?:--[\)])/i,
2266
+ /^(?:--\|\\)/i,
2267
+ /^(?:--\|\/)/i,
2268
+ /^(?:--\\\\)/i,
2269
+ /^(?:--\/\/)/i,
2270
+ /^(?:\/\|--)/i,
2271
+ /^(?:\\\|--)/i,
2272
+ /^(?:\/\/--)/i,
2273
+ /^(?:\\\\--)/i,
2274
+ /^(?:-\|\\)/i,
2275
+ /^(?:-\|\/)/i,
2276
+ /^(?:-\\\\)/i,
2277
+ /^(?:-\/\/)/i,
2278
+ /^(?:\/\|-)/i,
2279
+ /^(?:\\\|-)/i,
2280
+ /^(?:\/\/-)/i,
2281
+ /^(?:\\\\-)/i,
2282
+ /^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,
2283
+ /^(?::)/i,
2284
+ /^(?:\+)/i,
2285
+ /^(?:-)/i,
2286
+ /^(?:\(\))/i,
2287
+ /^(?:$)/i,
2288
+ /^(?:.)/i
2289
+ ],
2290
+ conditions: {
2291
+ acc_descr_multiline: {
2292
+ rules: [53, 54],
2293
+ inclusive: !1
2294
+ },
2295
+ acc_descr: {
2296
+ rules: [51],
2297
+ inclusive: !1
2298
+ },
2299
+ acc_title: {
2300
+ rules: [49],
2301
+ inclusive: !1
2302
+ },
2303
+ ID: {
2304
+ rules: [
2305
+ 2,
2306
+ 3,
2307
+ 7,
2308
+ 11,
2309
+ 12,
2310
+ 13,
2311
+ 14,
2312
+ 15
2313
+ ],
2314
+ inclusive: !1
2315
+ },
2316
+ ALIAS: {
2317
+ rules: [
2318
+ 2,
2319
+ 3,
2320
+ 21,
2321
+ 22
2322
+ ],
2323
+ inclusive: !1
2324
+ },
2325
+ LINE: {
2326
+ rules: [
2327
+ 2,
2328
+ 3,
2329
+ 34
2330
+ ],
2331
+ inclusive: !1
2332
+ },
2333
+ CONFIG: {
2334
+ rules: [
2335
+ 8,
2336
+ 9,
2337
+ 10
2338
+ ],
2339
+ inclusive: !1
2340
+ },
2341
+ CONFIG_DATA: {
2342
+ rules: [],
2343
+ inclusive: !1
2344
+ },
2345
+ INITIAL: {
2346
+ rules: [
2347
+ 0,
2348
+ 1,
2349
+ 3,
2350
+ 4,
2351
+ 5,
2352
+ 6,
2353
+ 16,
2354
+ 17,
2355
+ 18,
2356
+ 19,
2357
+ 20,
2358
+ 23,
2359
+ 24,
2360
+ 25,
2361
+ 26,
2362
+ 27,
2363
+ 28,
2364
+ 29,
2365
+ 30,
2366
+ 31,
2367
+ 32,
2368
+ 33,
2369
+ 35,
2370
+ 36,
2371
+ 37,
2372
+ 38,
2373
+ 39,
2374
+ 40,
2375
+ 41,
2376
+ 42,
2377
+ 43,
2378
+ 44,
2379
+ 45,
2380
+ 46,
2381
+ 47,
2382
+ 48,
2383
+ 50,
2384
+ 52,
2385
+ 55,
2386
+ 56,
2387
+ 57,
2388
+ 58,
2389
+ 59,
2390
+ 60,
2391
+ 61,
2392
+ 62,
2393
+ 63,
2394
+ 64,
2395
+ 65,
2396
+ 66,
2397
+ 67,
2398
+ 68,
2399
+ 69,
2400
+ 70,
2401
+ 71,
2402
+ 72,
2403
+ 73,
2404
+ 74,
2405
+ 75,
2406
+ 76,
2407
+ 77,
2408
+ 78,
2409
+ 79,
2410
+ 80,
2411
+ 81,
2412
+ 82,
2413
+ 83,
2414
+ 84,
2415
+ 85,
2416
+ 86,
2417
+ 87,
2418
+ 88,
2419
+ 89,
2420
+ 90,
2421
+ 91,
2422
+ 92,
2423
+ 93
2424
+ ],
2425
+ inclusive: !0
2426
+ }
2427
+ }
2428
+ };
2429
+ })();
2430
+ function $() {
2431
+ this.yy = {};
2432
+ }
2433
+ return __name($, "Parser"), $.prototype = Q, Q.Parser = $, new $();
2434
+ })();
2435
+ parser.parser = parser;
2436
+ var sequenceDiagram_default = parser, LINETYPE = {
2437
+ SOLID: 0,
2438
+ DOTTED: 1,
2439
+ NOTE: 2,
2440
+ SOLID_CROSS: 3,
2441
+ DOTTED_CROSS: 4,
2442
+ SOLID_OPEN: 5,
2443
+ DOTTED_OPEN: 6,
2444
+ LOOP_START: 10,
2445
+ LOOP_END: 11,
2446
+ ALT_START: 12,
2447
+ ALT_ELSE: 13,
2448
+ ALT_END: 14,
2449
+ OPT_START: 15,
2450
+ OPT_END: 16,
2451
+ ACTIVE_START: 17,
2452
+ ACTIVE_END: 18,
2453
+ PAR_START: 19,
2454
+ PAR_AND: 20,
2455
+ PAR_END: 21,
2456
+ RECT_START: 22,
2457
+ RECT_END: 23,
2458
+ SOLID_POINT: 24,
2459
+ DOTTED_POINT: 25,
2460
+ AUTONUMBER: 26,
2461
+ CRITICAL_START: 27,
2462
+ CRITICAL_OPTION: 28,
2463
+ CRITICAL_END: 29,
2464
+ BREAK_START: 30,
2465
+ BREAK_END: 31,
2466
+ PAR_OVER_START: 32,
2467
+ BIDIRECTIONAL_SOLID: 33,
2468
+ BIDIRECTIONAL_DOTTED: 34,
2469
+ SOLID_TOP: 41,
2470
+ SOLID_BOTTOM: 42,
2471
+ STICK_TOP: 43,
2472
+ STICK_BOTTOM: 44,
2473
+ SOLID_ARROW_TOP_REVERSE: 45,
2474
+ SOLID_ARROW_BOTTOM_REVERSE: 46,
2475
+ STICK_ARROW_TOP_REVERSE: 47,
2476
+ STICK_ARROW_BOTTOM_REVERSE: 48,
2477
+ SOLID_TOP_DOTTED: 51,
2478
+ SOLID_BOTTOM_DOTTED: 52,
2479
+ STICK_TOP_DOTTED: 53,
2480
+ STICK_BOTTOM_DOTTED: 54,
2481
+ SOLID_ARROW_TOP_REVERSE_DOTTED: 55,
2482
+ SOLID_ARROW_BOTTOM_REVERSE_DOTTED: 56,
2483
+ STICK_ARROW_TOP_REVERSE_DOTTED: 57,
2484
+ STICK_ARROW_BOTTOM_REVERSE_DOTTED: 58,
2485
+ CENTRAL_CONNECTION: 59,
2486
+ CENTRAL_CONNECTION_REVERSE: 60,
2487
+ CENTRAL_CONNECTION_DUAL: 61
2488
+ }, ARROWTYPE = {
2489
+ FILLED: 0,
2490
+ OPEN: 1
2491
+ }, PLACEMENT = {
2492
+ LEFTOF: 0,
2493
+ RIGHTOF: 1,
2494
+ OVER: 2
2495
+ }, PARTICIPANT_TYPE = {
2496
+ ACTOR: "actor",
2497
+ BOUNDARY: "boundary",
2498
+ COLLECTIONS: "collections",
2499
+ CONTROL: "control",
2500
+ DATABASE: "database",
2501
+ ENTITY: "entity",
2502
+ PARTICIPANT: "participant",
2503
+ QUEUE: "queue"
2504
+ }, SequenceDB = class {
2505
+ constructor() {
2506
+ this.state = new ImperativeState(() => ({
2507
+ prevActor: void 0,
2508
+ actors: /* @__PURE__ */ new Map(),
2509
+ createdActors: /* @__PURE__ */ new Map(),
2510
+ destroyedActors: /* @__PURE__ */ new Map(),
2511
+ boxes: [],
2512
+ messages: [],
2513
+ notes: [],
2514
+ sequenceNumbersEnabled: !1,
2515
+ wrapEnabled: void 0,
2516
+ currentBox: void 0,
2517
+ lastCreated: void 0,
2518
+ lastDestroyed: void 0
2519
+ })), this.setAccTitle = setAccTitle, this.setAccDescription = setAccDescription, this.setDiagramTitle = setDiagramTitle, this.getAccTitle = getAccTitle, this.getAccDescription = getAccDescription, this.getDiagramTitle = getDiagramTitle, this.apply = this.apply.bind(this), this.parseBoxData = this.parseBoxData.bind(this), this.parseMessage = this.parseMessage.bind(this), this.clear(), this.setWrap(getConfig2().wrap), this.LINETYPE = LINETYPE, this.ARROWTYPE = ARROWTYPE, this.PLACEMENT = PLACEMENT;
2520
+ }
2521
+ static #e = __name(this, "SequenceDB");
2522
+ addBox(e) {
2523
+ this.state.records.boxes.push({
2524
+ name: e.text,
2525
+ wrap: e.wrap ?? this.autoWrap(),
2526
+ fill: e.color,
2527
+ actorKeys: []
2528
+ }), this.state.records.currentBox = this.state.records.boxes.slice(-1)[0];
2529
+ }
2530
+ addActor(e, t, n, r, i) {
2531
+ let a = this.state.records.currentBox, o;
2532
+ if (i !== void 0) {
2533
+ let e;
2534
+ e = i.includes("\n") ? i + "\n" : "{\n" + i + "\n}", o = load(e, { schema: JSON_SCHEMA });
2535
+ }
2536
+ r = o?.type ?? r, o?.alias && (!n || n.text === t) && (n = {
2537
+ text: o.alias,
2538
+ wrap: n?.wrap,
2539
+ type: r
2540
+ });
2541
+ let s = this.state.records.actors.get(e);
2542
+ if (s) {
2543
+ if (this.state.records.currentBox && s.box && this.state.records.currentBox !== s.box) throw Error(`A same participant should only be defined in one Box: ${s.name} can't be in '${s.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);
2544
+ if (a = s.box ? s.box : this.state.records.currentBox, s.box = a, s && t === s.name && n == null) return;
2545
+ }
2546
+ if (n?.text ?? (n = {
2547
+ text: t,
2548
+ type: r
2549
+ }), (r == null || n.text == null) && (n = {
2550
+ text: t,
2551
+ type: r
2552
+ }), this.state.records.actors.set(e, {
2553
+ box: a,
2554
+ name: t,
2555
+ description: n.text,
2556
+ wrap: n.wrap ?? this.autoWrap(),
2557
+ prevActor: this.state.records.prevActor,
2558
+ links: {},
2559
+ properties: {},
2560
+ actorCnt: null,
2561
+ rectData: null,
2562
+ type: r ?? "participant"
2563
+ }), this.state.records.prevActor) {
2564
+ let t = this.state.records.actors.get(this.state.records.prevActor);
2565
+ t && (t.nextActor = e);
2566
+ }
2567
+ this.state.records.currentBox && this.state.records.currentBox.actorKeys.push(e), this.state.records.prevActor = e;
2568
+ }
2569
+ activationCount(e) {
2570
+ let t, n = 0;
2571
+ if (!e) return 0;
2572
+ for (t = 0; t < this.state.records.messages.length; t++) this.state.records.messages[t].type === this.LINETYPE.ACTIVE_START && this.state.records.messages[t].from === e && n++, this.state.records.messages[t].type === this.LINETYPE.ACTIVE_END && this.state.records.messages[t].from === e && n--;
2573
+ return n;
2574
+ }
2575
+ addMessage(e, t, n, r) {
2576
+ this.state.records.messages.push({
2577
+ id: this.state.records.messages.length.toString(),
2578
+ from: e,
2579
+ to: t,
2580
+ message: n.text,
2581
+ wrap: n.wrap ?? this.autoWrap(),
2582
+ answer: r
2583
+ });
2584
+ }
2585
+ addSignal(e, t, n, r, i = !1, a) {
2586
+ if (r === this.LINETYPE.ACTIVE_END && this.activationCount(e ?? "") < 1) {
2587
+ let t = /* @__PURE__ */ Error("Trying to inactivate an inactive participant (" + e + ")");
2588
+ throw t.hash = {
2589
+ text: "->>-",
2590
+ token: "->>-",
2591
+ line: "1",
2592
+ loc: {
2593
+ first_line: 1,
2594
+ last_line: 1,
2595
+ first_column: 1,
2596
+ last_column: 1
2597
+ },
2598
+ expected: ["'ACTIVE_PARTICIPANT'"]
2599
+ }, t;
2600
+ }
2601
+ return this.state.records.messages.push({
2602
+ id: this.state.records.messages.length.toString(),
2603
+ from: e,
2604
+ to: t,
2605
+ message: n?.text ?? "",
2606
+ wrap: n?.wrap ?? this.autoWrap(),
2607
+ type: r,
2608
+ activate: i,
2609
+ centralConnection: a ?? 0
2610
+ }), !0;
2611
+ }
2612
+ hasAtLeastOneBox() {
2613
+ return this.state.records.boxes.length > 0;
2614
+ }
2615
+ hasAtLeastOneBoxWithTitle() {
2616
+ return this.state.records.boxes.some((e) => e.name);
2617
+ }
2618
+ getMessages() {
2619
+ return this.state.records.messages;
2620
+ }
2621
+ getBoxes() {
2622
+ return this.state.records.boxes;
2623
+ }
2624
+ getActors() {
2625
+ return this.state.records.actors;
2626
+ }
2627
+ getCreatedActors() {
2628
+ return this.state.records.createdActors;
2629
+ }
2630
+ getDestroyedActors() {
2631
+ return this.state.records.destroyedActors;
2632
+ }
2633
+ getActor(e) {
2634
+ return this.state.records.actors.get(e);
2635
+ }
2636
+ getActorKeys() {
2637
+ return [...this.state.records.actors.keys()];
2638
+ }
2639
+ enableSequenceNumbers() {
2640
+ this.state.records.sequenceNumbersEnabled = !0;
2641
+ }
2642
+ disableSequenceNumbers() {
2643
+ this.state.records.sequenceNumbersEnabled = !1;
2644
+ }
2645
+ showSequenceNumbers() {
2646
+ return this.state.records.sequenceNumbersEnabled;
2647
+ }
2648
+ setWrap(e) {
2649
+ this.state.records.wrapEnabled = e;
2650
+ }
2651
+ extractWrap(e) {
2652
+ if (e === void 0) return {};
2653
+ e = e.trim();
2654
+ let t = /^:?wrap:/.exec(e) === null ? /^:?nowrap:/.exec(e) === null ? void 0 : !1 : !0;
2655
+ return {
2656
+ cleanedText: (t === void 0 ? e : e.replace(/^:?(?:no)?wrap:/, "")).trim(),
2657
+ wrap: t
2658
+ };
2659
+ }
2660
+ autoWrap() {
2661
+ return this.state.records.wrapEnabled === void 0 ? getConfig2().sequence?.wrap ?? !1 : this.state.records.wrapEnabled;
2662
+ }
2663
+ clear() {
2664
+ this.state.reset(), clear();
2665
+ }
2666
+ parseMessage(e) {
2667
+ let n = e.trim(), { wrap: r, cleanedText: i } = this.extractWrap(n), a = {
2668
+ text: i,
2669
+ wrap: r
2670
+ };
2671
+ return log.debug(`parseMessage: ${JSON.stringify(a)}`), a;
2672
+ }
2673
+ parseBoxData(e) {
2674
+ let t = /^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e), n = t?.[1] ? t[1].trim() : "transparent", r = t?.[2] ? t[2].trim() : void 0;
2675
+ if (window?.CSS) window.CSS.supports("color", n) || (n = "transparent", r = e.trim());
2676
+ else {
2677
+ let t = new Option().style;
2678
+ t.color = n, t.color !== n && (n = "transparent", r = e.trim());
2679
+ }
2680
+ let { wrap: i, cleanedText: a } = this.extractWrap(r);
2681
+ return {
2682
+ text: a ? sanitizeText(a, getConfig2()) : void 0,
2683
+ color: n,
2684
+ wrap: i
2685
+ };
2686
+ }
2687
+ addNote(e, t, n) {
2688
+ let r = {
2689
+ actor: e,
2690
+ placement: t,
2691
+ message: n.text,
2692
+ wrap: n.wrap ?? this.autoWrap()
2693
+ }, i = [].concat(e, e);
2694
+ this.state.records.notes.push(r), this.state.records.messages.push({
2695
+ id: this.state.records.messages.length.toString(),
2696
+ from: i[0],
2697
+ to: i[1],
2698
+ message: n.text,
2699
+ wrap: n.wrap ?? this.autoWrap(),
2700
+ type: this.LINETYPE.NOTE,
2701
+ placement: t
2702
+ });
2703
+ }
2704
+ addLinks(e, n) {
2705
+ let r = this.getActor(e);
2706
+ try {
2707
+ let e = sanitizeText(n.text, getConfig2());
2708
+ e = e.replace(/&equals;/g, "="), e = e.replace(/&amp;/g, "&");
2709
+ let t = JSON.parse(e);
2710
+ this.insertLinks(r, t);
2711
+ } catch (e) {
2712
+ log.error("error while parsing actor link text", e);
2713
+ }
2714
+ }
2715
+ addALink(e, n) {
2716
+ let r = this.getActor(e);
2717
+ try {
2718
+ let e = {}, t = sanitizeText(n.text, getConfig2()), i = t.indexOf("@");
2719
+ t = t.replace(/&equals;/g, "="), t = t.replace(/&amp;/g, "&");
2720
+ let a = t.slice(0, i - 1).trim();
2721
+ e[a] = t.slice(i + 1).trim(), this.insertLinks(r, e);
2722
+ } catch (e) {
2723
+ log.error("error while parsing actor link text", e);
2724
+ }
2725
+ }
2726
+ insertLinks(e, t) {
2727
+ if (e.links == null) e.links = t;
2728
+ else for (let n in t) e.links[n] = t[n];
2729
+ }
2730
+ addProperties(e, n) {
2731
+ let r = this.getActor(e);
2732
+ try {
2733
+ let e = sanitizeText(n.text, getConfig2()), t = JSON.parse(e);
2734
+ this.insertProperties(r, t);
2735
+ } catch (e) {
2736
+ log.error("error while parsing actor properties text", e);
2737
+ }
2738
+ }
2739
+ insertProperties(e, t) {
2740
+ if (e.properties == null) e.properties = t;
2741
+ else for (let n in t) e.properties[n] = t[n];
2742
+ }
2743
+ boxEnd() {
2744
+ this.state.records.currentBox = void 0;
2745
+ }
2746
+ addDetails(e, n) {
2747
+ let r = this.getActor(e), i = document.getElementById(n.text);
2748
+ try {
2749
+ let e = i.innerHTML, t = JSON.parse(e);
2750
+ t.properties && this.insertProperties(r, t.properties), t.links && this.insertLinks(r, t.links);
2751
+ } catch (e) {
2752
+ log.error("error while parsing actor details text", e);
2753
+ }
2754
+ }
2755
+ getActorProperty(e, t) {
2756
+ if (e?.properties !== void 0) return e.properties[t];
2757
+ }
2758
+ apply(e) {
2759
+ if (Array.isArray(e)) e.forEach((e) => {
2760
+ this.apply(e);
2761
+ });
2762
+ else switch (e.type) {
2763
+ case "sequenceIndex":
2764
+ this.state.records.messages.push({
2765
+ id: this.state.records.messages.length.toString(),
2766
+ from: void 0,
2767
+ to: void 0,
2768
+ message: {
2769
+ start: e.sequenceIndex,
2770
+ step: e.sequenceIndexStep,
2771
+ visible: e.sequenceVisible
2772
+ },
2773
+ wrap: !1,
2774
+ type: e.signalType
2775
+ });
2776
+ break;
2777
+ case "addParticipant":
2778
+ this.addActor(e.actor, e.actor, e.description, e.draw, e.config);
2779
+ break;
2780
+ case "createParticipant":
2781
+ if (this.state.records.actors.has(e.actor)) throw Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");
2782
+ this.state.records.lastCreated = e.actor, this.addActor(e.actor, e.actor, e.description, e.draw, e.config), this.state.records.createdActors.set(e.actor, this.state.records.messages.length);
2783
+ break;
2784
+ case "destroyParticipant":
2785
+ this.state.records.lastDestroyed = e.actor, this.state.records.destroyedActors.set(e.actor, this.state.records.messages.length);
2786
+ break;
2787
+ case "activeStart":
2788
+ this.addSignal(e.actor, void 0, void 0, e.signalType);
2789
+ break;
2790
+ case "centralConnection":
2791
+ this.addSignal(e.actor, void 0, void 0, e.signalType);
2792
+ break;
2793
+ case "centralConnectionReverse":
2794
+ this.addSignal(e.actor, void 0, void 0, e.signalType);
2795
+ break;
2796
+ case "activeEnd":
2797
+ this.addSignal(e.actor, void 0, void 0, e.signalType);
2798
+ break;
2799
+ case "addNote":
2800
+ this.addNote(e.actor, e.placement, e.text);
2801
+ break;
2802
+ case "addLinks":
2803
+ this.addLinks(e.actor, e.text);
2804
+ break;
2805
+ case "addALink":
2806
+ this.addALink(e.actor, e.text);
2807
+ break;
2808
+ case "addProperties":
2809
+ this.addProperties(e.actor, e.text);
2810
+ break;
2811
+ case "addDetails":
2812
+ this.addDetails(e.actor, e.text);
2813
+ break;
2814
+ case "addMessage":
2815
+ if (this.state.records.lastCreated) {
2816
+ if (e.to !== this.state.records.lastCreated) throw Error("The created participant " + this.state.records.lastCreated.name + " does not have an associated creating message after its declaration. Please check the sequence diagram.");
2817
+ this.state.records.lastCreated = void 0;
2818
+ } else if (this.state.records.lastDestroyed) {
2819
+ if (e.to !== this.state.records.lastDestroyed && e.from !== this.state.records.lastDestroyed) throw Error("The destroyed participant " + this.state.records.lastDestroyed.name + " does not have an associated destroying message after its declaration. Please check the sequence diagram.");
2820
+ this.state.records.lastDestroyed = void 0;
2821
+ }
2822
+ this.addSignal(e.from, e.to, e.msg, e.signalType, e.activate, e.centralConnection);
2823
+ break;
2824
+ case "boxStart":
2825
+ this.addBox(e.boxData);
2826
+ break;
2827
+ case "boxEnd":
2828
+ this.boxEnd();
2829
+ break;
2830
+ case "loopStart":
2831
+ this.addSignal(void 0, void 0, e.loopText, e.signalType);
2832
+ break;
2833
+ case "loopEnd":
2834
+ this.addSignal(void 0, void 0, void 0, e.signalType);
2835
+ break;
2836
+ case "rectStart":
2837
+ this.addSignal(void 0, void 0, e.color, e.signalType);
2838
+ break;
2839
+ case "rectEnd":
2840
+ this.addSignal(void 0, void 0, void 0, e.signalType);
2841
+ break;
2842
+ case "optStart":
2843
+ this.addSignal(void 0, void 0, e.optText, e.signalType);
2844
+ break;
2845
+ case "optEnd":
2846
+ this.addSignal(void 0, void 0, void 0, e.signalType);
2847
+ break;
2848
+ case "altStart":
2849
+ this.addSignal(void 0, void 0, e.altText, e.signalType);
2850
+ break;
2851
+ case "else":
2852
+ this.addSignal(void 0, void 0, e.altText, e.signalType);
2853
+ break;
2854
+ case "altEnd":
2855
+ this.addSignal(void 0, void 0, void 0, e.signalType);
2856
+ break;
2857
+ case "setAccTitle":
2858
+ setAccTitle(e.text);
2859
+ break;
2860
+ case "parStart":
2861
+ this.addSignal(void 0, void 0, e.parText, e.signalType);
2862
+ break;
2863
+ case "and":
2864
+ this.addSignal(void 0, void 0, e.parText, e.signalType);
2865
+ break;
2866
+ case "parEnd":
2867
+ this.addSignal(void 0, void 0, void 0, e.signalType);
2868
+ break;
2869
+ case "criticalStart":
2870
+ this.addSignal(void 0, void 0, e.criticalText, e.signalType);
2871
+ break;
2872
+ case "option":
2873
+ this.addSignal(void 0, void 0, e.optionText, e.signalType);
2874
+ break;
2875
+ case "criticalEnd":
2876
+ this.addSignal(void 0, void 0, void 0, e.signalType);
2877
+ break;
2878
+ case "breakStart":
2879
+ this.addSignal(void 0, void 0, e.breakText, e.signalType);
2880
+ break;
2881
+ case "breakEnd":
2882
+ this.addSignal(void 0, void 0, void 0, e.signalType);
2883
+ break;
2884
+ }
2885
+ }
2886
+ getConfig() {
2887
+ return getConfig2().sequence;
2888
+ }
2889
+ }, styles_default = /* @__PURE__ */ __name((e) => {
2890
+ let t = e.dropShadow ?? "none", { look: n } = getConfig2();
2891
+ return `.actor {
2892
+ stroke: ${e.actorBorder};
2893
+ fill: ${e.actorBkg};
2894
+ stroke-width: ${e.strokeWidth ?? 1};
2895
+ }
2896
+
2897
+ rect.actor.outer-path[data-look="neo"] {
2898
+ filter: ${t};
2899
+ }
2900
+
2901
+ rect.note[data-look="neo"] {
2902
+ stroke:${e.noteBorderColor};
2903
+ fill:${e.noteBkgColor};
2904
+ filter: ${t};
2905
+ }
2906
+
2907
+ text.actor > tspan {
2908
+ fill: ${e.actorTextColor};
2909
+ stroke: none;
2910
+ }
2911
+
2912
+ .actor-line {
2913
+ stroke: ${e.actorLineColor};
2914
+ }
2915
+
2916
+ .innerArc {
2917
+ stroke-width: 1.5;
2918
+ stroke-dasharray: none;
2919
+ }
2920
+
2921
+ .messageLine0 {
2922
+ stroke-width: 1.5;
2923
+ stroke-dasharray: none;
2924
+ stroke: ${e.signalColor};
2925
+ }
2926
+
2927
+ .messageLine1 {
2928
+ stroke-width: 1.5;
2929
+ stroke-dasharray: 2, 2;
2930
+ stroke: ${e.signalColor};
2931
+ }
2932
+
2933
+ [id$="-arrowhead"] path {
2934
+ fill: ${e.signalColor};
2935
+ stroke: ${e.signalColor};
2936
+ }
2937
+
2938
+ .sequenceNumber {
2939
+ fill: ${e.sequenceNumberColor};
2940
+ }
2941
+
2942
+ [id$="-sequencenumber"] {
2943
+ fill: ${e.signalColor};
2944
+ }
2945
+
2946
+ [id$="-crosshead"] path {
2947
+ fill: ${e.signalColor};
2948
+ stroke: ${e.signalColor};
2949
+ }
2950
+
2951
+ .messageText {
2952
+ fill: ${e.signalTextColor};
2953
+ stroke: none;
2954
+ }
2955
+
2956
+ .labelBox {
2957
+ stroke: ${e.labelBoxBorderColor};
2958
+ fill: ${e.labelBoxBkgColor};
2959
+ filter: ${n === "neo" ? t : "none"};
2960
+ }
2961
+
2962
+ .labelText, .labelText > tspan {
2963
+ fill: ${e.labelTextColor};
2964
+ stroke: none;
2965
+ }
2966
+
2967
+ .loopText, .loopText > tspan {
2968
+ fill: ${e.loopTextColor};
2969
+ stroke: none;
2970
+ }
2971
+
2972
+ .loopLine {
2973
+ stroke-width: 2px;
2974
+ stroke-dasharray: 2, 2;
2975
+ stroke: ${e.labelBoxBorderColor};
2976
+ fill: ${e.labelBoxBorderColor};
2977
+ }
2978
+
2979
+ .note {
2980
+ //stroke: #decc93;
2981
+ stroke: ${e.noteBorderColor};
2982
+ fill: ${e.noteBkgColor};
2983
+ }
2984
+
2985
+ .noteText, .noteText > tspan {
2986
+ fill: ${e.noteTextColor};
2987
+ stroke: none;
2988
+ ${e.noteFontWeight ? `font-weight: ${e.noteFontWeight};` : ""}
2989
+ }
2990
+
2991
+ .activation0 {
2992
+ fill: ${e.activationBkgColor};
2993
+ stroke: ${e.activationBorderColor};
2994
+ }
2995
+
2996
+ .activation1 {
2997
+ fill: ${e.activationBkgColor};
2998
+ stroke: ${e.activationBorderColor};
2999
+ }
3000
+
3001
+ .activation2 {
3002
+ fill: ${e.activationBkgColor};
3003
+ stroke: ${e.activationBorderColor};
3004
+ }
3005
+
3006
+ .actorPopupMenu {
3007
+ position: absolute;
3008
+ }
3009
+
3010
+ .actorPopupMenuPanel {
3011
+ position: absolute;
3012
+ fill: ${e.actorBkg};
3013
+ box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
3014
+ filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
3015
+ }
3016
+ .actor-man circle, line {
3017
+ fill: ${e.actorBkg};
3018
+ stroke-width: 2px;
3019
+ }
3020
+
3021
+ g rect.rect {
3022
+ filter: ${t};
3023
+ stroke: ${e.nodeBorder};
3024
+ }
3025
+ `;
3026
+ }, "getStyles"), ACTOR_TYPE_WIDTH = 36, TOP_ACTOR_CLASS = "actor-top", BOTTOM_ACTOR_CLASS = "actor-bottom", ACTOR_BOX_CLASS = "actor-box", ACTOR_MAN_FIGURE_CLASS = "actor-man", COLOR_THEMES = /* @__PURE__ */ new Set(["redux-color", "redux-dark-color"]), drawRect2 = /* @__PURE__ */ __name(function(e, t) {
3027
+ let n = drawRect(e, t);
3028
+ return getConfig().look === "neo" && n.attr("data-look", "neo"), n;
3029
+ }, "drawRect"), drawPopup = /* @__PURE__ */ __name(function(e, t, n, r, i) {
3030
+ if (t.links === void 0 || t.links === null || Object.keys(t.links).length === 0) return {
3031
+ height: 0,
3032
+ width: 0
3033
+ };
3034
+ let a = t.links, o = t.actorCnt, s = t.rectData;
3035
+ var c = "none";
3036
+ i && (c = "block !important");
3037
+ let l = e.append("g");
3038
+ l.attr("id", "actor" + o + "_popup"), l.attr("class", "actorPopupMenu"), l.attr("display", c);
3039
+ var u = "";
3040
+ s.class !== void 0 && (u = " " + s.class);
3041
+ let d = s.width > n ? s.width : n, f = l.append("rect");
3042
+ if (f.attr("class", "actorPopupMenuPanel" + u), f.attr("x", s.x), f.attr("y", s.height), f.attr("fill", s.fill), f.attr("stroke", s.stroke), f.attr("width", d), f.attr("height", s.height), f.attr("rx", s.rx), f.attr("ry", s.ry), a != null) {
3043
+ var p = 20;
3044
+ for (let e in a) {
3045
+ var m = l.append("a"), h = (0, import_dist.sanitizeUrl)(a[e]);
3046
+ m.attr("xlink:href", h), m.attr("target", "_blank"), _drawMenuItemTextCandidateFunc(r)(e, m, s.x + 10, s.height + p, d, 20, { class: "actor" }, r), p += 30;
3047
+ }
3048
+ }
3049
+ return f.attr("height", p), {
3050
+ height: s.height + p,
3051
+ width: d
3052
+ };
3053
+ }, "drawPopup"), popupMenuToggle = /* @__PURE__ */ __name(function(e) {
3054
+ return "var pu = document.getElementById('" + e + "'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }";
3055
+ }, "popupMenuToggle"), drawKatex = /* @__PURE__ */ __name(async function(e, t, n = null) {
3056
+ let r = e.append("foreignObject"), i = await renderKatexSanitized(t.text, getConfig()), a = r.append("xhtml:div").attr("style", "width: fit-content;").attr("xmlns", "http://www.w3.org/1999/xhtml").html(i).node().getBoundingClientRect();
3057
+ if (r.attr("height", Math.round(a.height)).attr("width", Math.round(a.width)), t.class === "noteText") {
3058
+ let n = e.node().firstChild;
3059
+ n.setAttribute("height", a.height + 2 * t.textMargin);
3060
+ let i = n.getBBox();
3061
+ r.attr("x", Math.round(i.x + i.width / 2 - a.width / 2)).attr("y", Math.round(i.y + i.height / 2 - a.height / 2));
3062
+ } else if (n) {
3063
+ let { startx: e, stopx: i, starty: o } = n;
3064
+ if (e > i) {
3065
+ let t = e;
3066
+ e = i, i = t;
3067
+ }
3068
+ r.attr("x", Math.round(e + Math.abs(e - i) / 2 - a.width / 2)), t.class === "loopText" ? r.attr("y", Math.round(o)) : r.attr("y", Math.round(o - a.height));
3069
+ }
3070
+ return [r];
3071
+ }, "drawKatex"), drawText = /* @__PURE__ */ __name(function(t, n) {
3072
+ let r = 0, i = 0, o = n.text.split(common_default.lineBreakRegex), [s, c] = parseFontSize(n.fontSize), l = [], u = 0, d = /* @__PURE__ */ __name(() => n.y, "yfunc");
3073
+ if (n.valign !== void 0 && n.textMargin !== void 0 && n.textMargin > 0) switch (n.valign) {
3074
+ case "top":
3075
+ case "start":
3076
+ d = /* @__PURE__ */ __name(() => Math.round(n.y + n.textMargin), "yfunc");
3077
+ break;
3078
+ case "middle":
3079
+ case "center":
3080
+ d = /* @__PURE__ */ __name(() => Math.round(n.y + (r + i + n.textMargin) / 2), "yfunc");
3081
+ break;
3082
+ case "bottom":
3083
+ case "end":
3084
+ d = /* @__PURE__ */ __name(() => Math.round(n.y + (r + i + 2 * n.textMargin) - n.textMargin), "yfunc");
3085
+ break;
3086
+ }
3087
+ if (n.anchor !== void 0 && n.textMargin !== void 0 && n.width !== void 0) switch (n.anchor) {
3088
+ case "left":
3089
+ case "start":
3090
+ n.x = Math.round(n.x + n.textMargin), n.anchor = "start", n.dominantBaseline = "middle", n.alignmentBaseline = "middle";
3091
+ break;
3092
+ case "middle":
3093
+ case "center":
3094
+ n.x = Math.round(n.x + n.width / 2), n.anchor = "middle", n.dominantBaseline = "middle", n.alignmentBaseline = "middle";
3095
+ break;
3096
+ case "right":
3097
+ case "end":
3098
+ n.x = Math.round(n.x + n.width - n.textMargin), n.anchor = "end", n.dominantBaseline = "middle", n.alignmentBaseline = "middle";
3099
+ break;
3100
+ }
3101
+ for (let [e, a] of o.entries()) {
3102
+ n.textMargin !== void 0 && n.textMargin === 0 && s !== void 0 && (u = e * s);
3103
+ let o = t.append("text");
3104
+ o.attr("x", n.x), o.attr("y", d()), n.anchor !== void 0 && o.attr("text-anchor", n.anchor).attr("dominant-baseline", n.dominantBaseline).attr("alignment-baseline", n.alignmentBaseline), n.fontFamily !== void 0 && o.style("font-family", n.fontFamily), c !== void 0 && o.style("font-size", c), n.fontWeight !== void 0 && o.style("font-weight", n.fontWeight), n.fill !== void 0 && o.attr("fill", n.fill), n.class !== void 0 && o.attr("class", n.class), n.dy === void 0 ? u !== 0 && o.attr("dy", u) : o.attr("dy", n.dy);
3105
+ let f = a || "​";
3106
+ if (n.tspan) {
3107
+ let e = o.append("tspan");
3108
+ e.attr("x", n.x), n.fill !== void 0 && e.attr("fill", n.fill), e.text(f);
3109
+ } else o.text(f);
3110
+ n.valign !== void 0 && n.textMargin !== void 0 && n.textMargin > 0 && (i += (o._groups || o)[0][0].getBBox().height, r = i), l.push(o);
3111
+ }
3112
+ return l;
3113
+ }, "drawText"), drawLabel = /* @__PURE__ */ __name(function(t, n) {
3114
+ function r(e, t, n, r, i) {
3115
+ return e + "," + t + " " + (e + n) + "," + t + " " + (e + n) + "," + (t + r - i) + " " + (e + n - i * 1.2) + "," + (t + r) + " " + e + "," + (t + r);
3116
+ }
3117
+ __name(r, "genPoints");
3118
+ let i = t.append("polygon");
3119
+ return i.attr("points", r(n.x, n.y, n.width, n.height, 7)), i.attr("class", "labelBox"), n.y += n.height / 2, drawText(t, n), i;
3120
+ }, "drawLabel"), actorCnt = -1, fixLifeLineHeights = /* @__PURE__ */ __name((e, t, n, r) => {
3121
+ e.select && n.forEach((n) => {
3122
+ let i = t.get(n), a = e.select("#actor" + i.actorCnt);
3123
+ !r.mirrorActors && i.stopy ? a.attr("y2", i.stopy + i.height / 2) : r.mirrorActors && a.attr("y2", i.stopy);
3124
+ });
3125
+ }, "fixLifeLineHeights"), drawActorTypeParticipant = /* @__PURE__ */ __name(function(e, t, n, r, i) {
3126
+ let a = r ? t.stopy : t.starty, o = t.x + t.width / 2, s = a + t.height, { look: c, theme: l, themeVariables: u } = n, { bkgColorArray: d, borderColorArray: f } = u, m = e.append("g").lower();
3127
+ var h = m;
3128
+ r || (actorCnt++, Object.keys(t.links || {}).length && !n.forceMenus && h.attr("onclick", popupMenuToggle(`actor${actorCnt}_popup`)).attr("cursor", "pointer"), h.append("line").attr("id", "actor" + actorCnt).attr("x1", o).attr("y1", s).attr("x2", o).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), h = m.append("g"), t.actorCnt = actorCnt, t.links != null && h.attr("id", "root-" + actorCnt), c === "neo" && h.attr("data-look", "neo"));
3129
+ let g = getNoteRect();
3130
+ var _ = "actor";
3131
+ t.properties?.class ? _ = t.properties.class : g.fill = "#eaeaea", r ? _ += ` ${BOTTOM_ACTOR_CLASS}` : _ += ` ${TOP_ACTOR_CLASS}`, g.x = t.x, g.y = a, g.width = t.width, g.height = t.height, g.class = _, g.rx = 3, g.ry = 3, g.name = t.name, c === "neo" && (g.rx = 6, g.ry = 6);
3132
+ let v = drawRect2(h, g), y = i.get(t.name) ?? 0;
3133
+ if (COLOR_THEMES.has(l) && (v.style("stroke", f[y % f.length]), v.style("fill", d[y % f.length])), c === "neo" && v.attr("filter", "url(#drop-shadow)"), t.rectData = g, t.properties?.icon) {
3134
+ let e = t.properties.icon.trim();
3135
+ e.charAt(0) === "@" ? drawEmbeddedImage(h, g.x + g.width - 20, g.y + 10, e.substr(1)) : drawImage(h, g.x + g.width - 20, g.y + 10, e);
3136
+ }
3137
+ r || (h.attr("data-et", "participant"), h.attr("data-type", "participant"), h.attr("data-id", t.name)), _drawTextCandidateFunc(n, hasKatex(t.description))(t.description, h, g.x, g.y, g.width, g.height, { class: `actor ${ACTOR_BOX_CLASS}` }, n);
3138
+ let b = t.height;
3139
+ if (v.node) {
3140
+ let e = v.node().getBBox();
3141
+ t.height = e.height, b = e.height;
3142
+ }
3143
+ return b;
3144
+ }, "drawActorTypeParticipant"), drawActorTypeCollections = /* @__PURE__ */ __name(function(e, t, n, r, i) {
3145
+ let a = r ? t.stopy : t.starty, o = t.x + t.width / 2, s = a + t.height, { look: c, theme: l, themeVariables: u } = n, { bkgColorArray: d, borderColorArray: f } = u, m = e.append("g").lower();
3146
+ var h = m;
3147
+ r || (actorCnt++, Object.keys(t.links || {}).length && !n.forceMenus && h.attr("onclick", popupMenuToggle(`actor${actorCnt}_popup`)).attr("cursor", "pointer"), h.append("line").attr("id", "actor" + actorCnt).attr("x1", o).attr("y1", s).attr("x2", o).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), h = m.append("g"), t.actorCnt = actorCnt, t.links != null && h.attr("id", "root-" + actorCnt), c === "neo" && h.attr("data-look", "neo"));
3148
+ let g = getNoteRect();
3149
+ var _ = "actor";
3150
+ t.properties?.class ? _ = t.properties.class : g.fill = "#eaeaea", r ? _ += ` ${BOTTOM_ACTOR_CLASS}` : _ += ` ${TOP_ACTOR_CLASS}`, g.x = t.x, g.y = a, g.width = t.width, g.height = t.height, g.class = _, g.name = t.name;
3151
+ let v = {
3152
+ ...g,
3153
+ x: g.x + -6,
3154
+ y: g.y + 6,
3155
+ class: "actor"
3156
+ }, y = drawRect2(h, g), b = drawRect2(h, v);
3157
+ t.rectData = g, c === "neo" && h.attr("filter", "url(#drop-shadow)");
3158
+ let x = i.get(t.name) ?? 0;
3159
+ if (COLOR_THEMES.has(l) && (y.style("stroke", f[x % f.length]), y.style("fill", d[x % f.length]), b.style("stroke", f[x % f.length]), b.style("fill", d[x % f.length])), t.properties?.icon) {
3160
+ let e = t.properties.icon.trim();
3161
+ e.charAt(0) === "@" ? drawEmbeddedImage(h, g.x + g.width - 20, g.y + 10, e.substr(1)) : drawImage(h, g.x + g.width - 20, g.y + 10, e);
3162
+ }
3163
+ _drawTextCandidateFunc(n, hasKatex(t.description))(t.description, h, g.x - 6, g.y + 6, g.width, g.height, { class: `actor ${ACTOR_BOX_CLASS}` }, n);
3164
+ let S = t.height;
3165
+ if (y.node) {
3166
+ let e = y.node().getBBox();
3167
+ t.height = e.height, S = e.height;
3168
+ }
3169
+ return r || (h.attr("data-et", "participant"), h.attr("data-type", "collections"), h.attr("data-id", t.name)), S;
3170
+ }, "drawActorTypeCollections"), drawActorTypeQueue = /* @__PURE__ */ __name(function(e, t, n, r, i) {
3171
+ let a = r ? t.stopy : t.starty, o = t.x + t.width / 2, s = a + t.height, { look: c, theme: l, themeVariables: u } = n, { bkgColorArray: d, borderColorArray: f } = u, m = e.append("g").lower(), h = m;
3172
+ r || (actorCnt++, Object.keys(t.links || {}).length && !n.forceMenus && h.attr("onclick", popupMenuToggle(`actor${actorCnt}_popup`)).attr("cursor", "pointer"), h.append("line").attr("id", "actor" + actorCnt).attr("x1", o).attr("y1", s).attr("x2", o).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), h = m.append("g"), t.actorCnt = actorCnt, t.links != null && h.attr("id", "root-" + actorCnt), c === "neo" && h.attr("data-look", "neo"));
3173
+ let g = getNoteRect(), _ = "actor";
3174
+ t.properties?.class ? _ = t.properties.class : g.fill = "#eaeaea", r ? _ += ` ${BOTTOM_ACTOR_CLASS}` : _ += ` ${TOP_ACTOR_CLASS}`, h.attr("class", _), g.x = t.x, g.y = a, g.width = t.width, g.height = t.height, g.name = t.name;
3175
+ let v = g.height / 2, y = v / (2.5 + g.height / 50), b = h.append("g"), x = h.append("g"), S = `M ${g.x},${g.y + v}
3176
+ a ${y},${v} 0 0 0 0,${g.height}
3177
+ h ${g.width - 2 * y}
3178
+ a ${y},${v} 0 0 0 0,-${g.height}
3179
+ Z
3180
+ `;
3181
+ b.append("path").attr("d", S), x.append("path").attr("d", `M ${g.x},${g.y + v}
3182
+ a ${y},${v} 0 0 0 0,${g.height}`), b.attr("transform", `translate(${y}, ${-(g.height / 2)})`), x.attr("transform", `translate(${g.width - y}, ${-g.height / 2})`), t.rectData = g, c === "neo" && b.attr("filter", "url(#drop-shadow)");
3183
+ let C = i.get(t.name) ?? 0;
3184
+ if (COLOR_THEMES.has(l) && (b.style("stroke", f[C % f.length]), b.style("fill", d[C % f.length]), x.style("stroke", f[C % f.length]), x.style("fill", d[C % f.length])), t.properties?.icon) {
3185
+ let e = t.properties.icon.trim(), n = g.x + g.width - 20, r = g.y + 10;
3186
+ e.charAt(0) === "@" ? drawEmbeddedImage(h, n, r, e.substr(1)) : drawImage(h, n, r, e);
3187
+ }
3188
+ _drawTextCandidateFunc(n, hasKatex(t.description))(t.description, h, g.x, g.y, g.width, g.height, { class: `actor ${ACTOR_BOX_CLASS}` }, n);
3189
+ let w = t.height, T = b.select("path:last-child");
3190
+ if (T.node()) {
3191
+ let e = T.node().getBBox();
3192
+ t.height = e.height, w = e.height;
3193
+ }
3194
+ return r || (h.attr("data-et", "participant"), h.attr("data-type", "queue"), h.attr("data-id", t.name)), w;
3195
+ }, "drawActorTypeQueue"), drawActorTypeControl = /* @__PURE__ */ __name(function(e, t, n, r, i, a) {
3196
+ let o = r ? t.stopy : t.starty, s = t.x + t.width / 2, c = o + 75, { look: l, theme: u, themeVariables: d } = n, { bkgColorArray: f, borderColorArray: m, actorBorder: h, actorBkg: g } = d, _ = e.append("g").lower();
3197
+ r || (actorCnt++, _.append("line").attr("id", "actor" + actorCnt).attr("x1", s).attr("y1", c).attr("x2", s).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), t.actorCnt = actorCnt);
3198
+ let v = e.append("g"), y = ACTOR_MAN_FIGURE_CLASS;
3199
+ r ? y += ` ${BOTTOM_ACTOR_CLASS}` : y += ` ${TOP_ACTOR_CLASS}`, v.attr("class", y), v.attr("name", t.name);
3200
+ let b = getNoteRect();
3201
+ b.x = t.x, b.y = o, b.fill = "#eaeaea", b.width = t.width, b.height = t.height, b.class = "actor";
3202
+ let x = t.x + t.width / 2, S = o + 32;
3203
+ v.append("defs").append("marker").attr("id", i + "-filled-head-control").attr("refX", 11).attr("refY", 5.8).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "172.5").attr("stroke-width", 1.2).append("path").attr("d", "M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"), v.append("circle").attr("cx", x).attr("cy", S).attr("r", 22).attr("filter", `${l === "neo" ? "url(#drop-shadow)" : ""}`), v.append("line").attr("marker-end", "url(#" + i + "-filled-head-control)").attr("transform", `translate(${x}, ${S - 22})`);
3204
+ let C = a.get(t.name) ?? 0;
3205
+ return COLOR_THEMES.has(u) ? (v.style("stroke", m[C % m.length]), v.style("fill", f[C % m.length])) : (v.style("stroke", h), v.style("fill", g)), t.height = v.node().getBBox().height + 2 * (n?.sequence?.labelBoxHeight ?? 0), _drawTextCandidateFunc(n, hasKatex(t.description))(t.description, v, b.x, b.y + 22 + (r ? 5 : 12), b.width, b.height, { class: `actor ${ACTOR_MAN_FIGURE_CLASS}` }, n), r || (v.attr("data-et", "participant"), v.attr("data-type", "control"), v.attr("data-id", t.name)), t.height;
3206
+ }, "drawActorTypeControl"), drawActorTypeEntity = /* @__PURE__ */ __name(function(e, t, n, r, i) {
3207
+ let a = r ? t.stopy : t.starty, o = t.x + t.width / 2, s = a + 75, { look: c, theme: l, themeVariables: u } = n, { bkgColorArray: d, borderColorArray: f } = u, m = e.append("g").lower(), h = e.append("g"), g = "actor";
3208
+ r ? g += ` ${BOTTOM_ACTOR_CLASS}` : g += ` ${TOP_ACTOR_CLASS}`, h.attr("class", g), h.attr("name", t.name);
3209
+ let _ = getNoteRect();
3210
+ _.x = t.x, _.y = a, _.fill = "#eaeaea", _.width = t.width, _.height = t.height, _.class = "actor";
3211
+ let v = t.x + t.width / 2, y = a + (r ? 10 : 25);
3212
+ h.append("circle").attr("cx", v).attr("cy", y).attr("r", 22).attr("width", t.width).attr("height", t.height), h.append("line").attr("x1", v - 22).attr("x2", v + 22).attr("y1", y + 22).attr("y2", y + 22).attr("stroke-width", 2), c === "neo" && h.attr("filter", "url(#drop-shadow)");
3213
+ let b = i.get(t.name) ?? 0;
3214
+ return COLOR_THEMES.has(l) && (h.style("stroke", f[b % f.length]), h.style("fill", d[b % f.length])), t.height = h.node().getBBox().height + (n?.sequence?.labelBoxHeight ?? 0), r || (actorCnt++, m.append("line").attr("id", "actor" + actorCnt).attr("x1", o).attr("y1", s).attr("x2", o).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), t.actorCnt = actorCnt), _drawTextCandidateFunc(n, hasKatex(t.description))(t.description, h, _.x, _.y + (r ? 15 : 30), _.width, _.height, { class: `actor ${ACTOR_MAN_FIGURE_CLASS}` }, n), r ? h.attr("transform", "translate(0, 22)") : (h.attr("transform", `translate(0, ${22 / 2 - 5})`), h.attr("data-et", "participant"), h.attr("data-type", "entity"), h.attr("data-id", t.name)), t.height;
3215
+ }, "drawActorTypeEntity"), drawActorTypeDatabase = /* @__PURE__ */ __name(function(e, t, n, r, i) {
3216
+ let a = r ? t.stopy : t.starty, o = t.x + t.width / 2, s = a + t.height + 2 * n.boxTextMargin, { theme: c, themeVariables: l, look: u } = n, { bkgColorArray: d, borderColorArray: f, actorBorder: m } = l, h = e.append("g").lower(), g = h;
3217
+ r || (actorCnt++, Object.keys(t.links || {}).length && !n.forceMenus && g.attr("onclick", popupMenuToggle(`actor${actorCnt}_popup`)).attr("cursor", "pointer"), g.append("line").attr("id", "actor" + actorCnt).attr("x1", o).attr("y1", s).attr("x2", o).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), g = h.append("g"), t.actorCnt = actorCnt, t.links != null && g.attr("id", "root-" + actorCnt), u === "neo" && g.attr("data-look", "neo"));
3218
+ let _ = getNoteRect(), v = "actor";
3219
+ t.properties?.class ? v = t.properties.class : _.fill = "#eaeaea", r ? v += ` ${BOTTOM_ACTOR_CLASS}` : v += ` ${TOP_ACTOR_CLASS}`, _.x = t.x, _.y = a, _.width = t.width, _.height = t.height, _.class = v, _.name = t.name, _.x = t.x, _.y = a;
3220
+ let y = _.width / 3, b = _.width / 3, x = y / 2, S = x / (2.5 + y / 50), C = g.append("g");
3221
+ C.attr("class", v);
3222
+ let w = `
3223
+ M ${_.x},${_.y + S}
3224
+ a ${x},${S} 0 0 0 ${y},0
3225
+ a ${x},${S} 0 0 0 -${y},0
3226
+ l 0,${b - 2 * S}
3227
+ a ${x},${S} 0 0 0 ${y},0
3228
+ l 0,-${b - 2 * S}
3229
+ `;
3230
+ C.append("path").attr("d", w), u === "neo" && C.attr("filter", "url(#drop-shadow)");
3231
+ let T = i.get(t.name) ?? 0;
3232
+ COLOR_THEMES.has(c) ? (C.style("stroke", f[T % f.length]), C.style("fill", d[T % f.length])) : C.style("stroke", m), C.attr("transform", `translate(${y}, ${S})`), t.rectData = _, _drawTextCandidateFunc(n, hasKatex(t.description))(t.description, g, _.x, _.y + 35, _.width, _.height, { class: `actor ${ACTOR_BOX_CLASS}` }, n);
3233
+ let E = C.select("path:last-child");
3234
+ return E.node() && (t.height = E.node().getBBox().height + (n.sequence.labelBoxHeight ?? 0)), r || (g.attr("data-et", "participant"), g.attr("data-type", "database"), g.attr("data-id", t.name)), t.height;
3235
+ }, "drawActorTypeDatabase"), drawActorTypeBoundary = /* @__PURE__ */ __name(function(e, t, n, r, i) {
3236
+ let a = r ? t.stopy : t.starty, o = t.x + t.width / 2, s = a + 80, c = e.append("g").lower(), { look: l, theme: u, themeVariables: d } = n, { bkgColorArray: f, borderColorArray: m, actorBorder: h } = d;
3237
+ r || (actorCnt++, c.append("line").attr("id", "actor" + actorCnt).attr("x1", o).attr("y1", s).attr("x2", o).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), t.actorCnt = actorCnt);
3238
+ let g = e.append("g"), _ = ACTOR_MAN_FIGURE_CLASS;
3239
+ r ? _ += ` ${BOTTOM_ACTOR_CLASS}` : _ += ` ${TOP_ACTOR_CLASS}`, g.attr("class", _), g.attr("name", t.name);
3240
+ let v = getNoteRect();
3241
+ v.x = t.x, v.y = a, v.fill = "#eaeaea", v.width = t.width, v.height = t.height, v.class = "actor", g.append("line").attr("id", "actor-man-torso" + actorCnt).attr("x1", t.x + t.width / 2 - 22 * 2.5).attr("y1", a + 12).attr("x2", t.x + t.width / 2 - 15).attr("y2", a + 12), g.append("line").attr("id", "actor-man-arms" + actorCnt).attr("x1", t.x + t.width / 2 - 22 * 2.5).attr("y1", a + 2).attr("x2", t.x + t.width / 2 - 22 * 2.5).attr("y2", a + 22), g.append("circle").attr("cx", t.x + t.width / 2).attr("cy", a + 12).attr("r", 22), l === "neo" && g.attr("filter", "url(#drop-shadow)");
3242
+ let y = i.get(t.name) ?? 0;
3243
+ return COLOR_THEMES.has(u) ? (g.style("stroke", m[y % m.length]), g.style("fill", f[y % m.length])) : g.style("stroke", h), t.height = g.node().getBBox().height + (n.sequence.labelBoxHeight ?? 0), _drawTextCandidateFunc(n, hasKatex(t.description))(t.description, g, v.x, v.y + 15, v.width, v.height, { class: `actor ${ACTOR_MAN_FIGURE_CLASS}` }, n), g.attr("transform", "translate(0,21)"), r || (g.attr("data-et", "participant"), g.attr("data-type", "boundary"), g.attr("data-id", t.name)), t.height;
3244
+ }, "drawActorTypeBoundary"), drawActorTypeActor = /* @__PURE__ */ __name(function(e, t, n, r, i) {
3245
+ let a = r ? t.stopy : t.starty, o = t.x + t.width / 2, s = a + 80, { look: c, theme: l, themeVariables: u } = n, { bkgColorArray: d, borderColorArray: f, actorBorder: m } = u, h = e.append("g").lower();
3246
+ r || (actorCnt++, h.append("line").attr("id", "actor" + actorCnt).attr("x1", o).attr("y1", s).attr("x2", o).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name).attr("data-et", "life-line").attr("data-id", t.name), t.actorCnt = actorCnt);
3247
+ let g = e.append("g"), _ = ACTOR_MAN_FIGURE_CLASS;
3248
+ r ? _ += ` ${BOTTOM_ACTOR_CLASS}` : _ += ` ${TOP_ACTOR_CLASS}`, g.attr("class", _), g.attr("name", t.name), r || g.attr("data-et", "participant").attr("data-type", "actor").attr("data-id", t.name);
3249
+ let v = c === "neo" ? .5 : 1, y = c === "neo" ? a + (1 - v) * 30 : a;
3250
+ g.append("line").attr("id", "actor-man-torso" + actorCnt).attr("x1", o).attr("y1", y + 25 * v).attr("x2", o).attr("y2", y + 45 * v), g.append("line").attr("id", "actor-man-arms" + actorCnt).attr("x1", o - ACTOR_TYPE_WIDTH / 2 * v).attr("y1", y + 33 * v).attr("x2", o + ACTOR_TYPE_WIDTH / 2 * v).attr("y2", y + 33 * v), g.append("line").attr("x1", o - ACTOR_TYPE_WIDTH / 2 * v).attr("y1", y + 60 * v).attr("x2", o).attr("y2", y + 45 * v), g.append("line").attr("x1", o).attr("y1", y + 45 * v).attr("x2", o + (ACTOR_TYPE_WIDTH / 2 - 2) * v).attr("y2", y + 60 * v);
3251
+ let b = g.append("circle");
3252
+ b.attr("cx", t.x + t.width / 2), b.attr("cy", y + 10 * v), b.attr("r", 15 * v), b.attr("width", t.width * v), b.attr("height", t.height * v), t.height = g.node().getBBox().height;
3253
+ let x = getNoteRect();
3254
+ x.x = t.x, x.y = y, x.fill = "#eaeaea", x.width = t.width, x.height = t.height / v, x.class = "actor", x.rx = 3, x.ry = 3;
3255
+ let S = i.get(t.name) ?? 0;
3256
+ return COLOR_THEMES.has(l) ? (g.style("stroke", f[S % f.length]), g.style("fill", d[S % f.length])) : g.style("stroke", m), _drawTextCandidateFunc(n, hasKatex(t.description))(t.description, g, x.x, y + 35 * v - (c === "neo" ? 10 : 0), x.width, x.height, { class: `actor ${ACTOR_MAN_FIGURE_CLASS}` }, n), t.height;
3257
+ }, "drawActorTypeActor"), drawActor = /* @__PURE__ */ __name(async function(e, t, n, r, i, a, o) {
3258
+ let s = o ?? new Map([...a.db.getActors().values()].map((e, t) => [e.name, t]));
3259
+ switch (t.type) {
3260
+ case "actor": return await drawActorTypeActor(e, t, n, r, s);
3261
+ case "participant": return await drawActorTypeParticipant(e, t, n, r, s);
3262
+ case "boundary": return await drawActorTypeBoundary(e, t, n, r, s);
3263
+ case "control": return await drawActorTypeControl(e, t, n, r, i, s);
3264
+ case "entity": return await drawActorTypeEntity(e, t, n, r, s);
3265
+ case "database": return await drawActorTypeDatabase(e, t, n, r, s);
3266
+ case "collections": return await drawActorTypeCollections(e, t, n, r, s);
3267
+ case "queue": return await drawActorTypeQueue(e, t, n, r, s);
3268
+ }
3269
+ }, "drawActor"), drawBox = /* @__PURE__ */ __name(function(e, t, n) {
3270
+ let r = e.append("g");
3271
+ drawBackgroundRect2(r, t), t.name && _drawTextCandidateFunc(n)(t.name, r, t.x, t.y + n.boxTextMargin + (t.textMaxHeight || 0) / 2, t.width, 0, { class: "text" }, n), r.lower();
3272
+ }, "drawBox"), anchorElement = /* @__PURE__ */ __name(function(e) {
3273
+ return e.append("g");
3274
+ }, "anchorElement"), drawActivation = /* @__PURE__ */ __name(function(e, t, n, r, i, a, o) {
3275
+ let { theme: s, themeVariables: c } = r, { bkgColorArray: l, borderColorArray: u, mainBkg: d } = c, f = getNoteRect(), p = t.anchored, m = t.actor;
3276
+ f.x = t.startx, f.y = t.starty, f.class = "activation" + i % 3, f.width = t.stopx - t.startx, f.height = n - t.starty;
3277
+ let h = drawRect2(p, f), g = (o ?? new Map([...a.db.getActors().values()].map((e, t) => [e.name, t]))).get(m) ?? 0;
3278
+ COLOR_THEMES.has(s) && (h.style("stroke", u[g % u.length]), h.style("fill", l[g % u.length] ?? d));
3279
+ }, "drawActivation"), drawLoop = /* @__PURE__ */ __name(async function(t, n, r, i, a) {
3280
+ let { boxMargin: o, boxTextMargin: s, labelBoxHeight: c, labelBoxWidth: l, messageFontFamily: u, messageFontSize: d, messageFontWeight: f } = i, m = t.append("g").attr("data-et", "control-structure").attr("data-id", "i" + a.id), h = /* @__PURE__ */ __name(function(e, t, n, r) {
3281
+ return m.append("line").attr("x1", e).attr("y1", t).attr("x2", n).attr("y2", r).attr("class", "loopLine");
3282
+ }, "drawLoopLine");
3283
+ h(n.startx, n.starty, n.stopx, n.starty), h(n.stopx, n.starty, n.stopx, n.stopy), h(n.startx, n.stopy, n.stopx, n.stopy), h(n.startx, n.starty, n.startx, n.stopy), n.sections !== void 0 && n.sections.forEach(function(e) {
3284
+ h(n.startx, e.y, n.stopx, e.y).style("stroke-dasharray", "3, 3");
3285
+ });
3286
+ let g = getTextObj();
3287
+ g.text = r, g.x = n.startx, g.y = n.starty, g.fontFamily = u, g.fontSize = d, g.fontWeight = f, g.anchor = "middle", g.valign = "middle", g.tspan = !1, g.width = Math.max(l ?? 0, 50), g.height = c + (i.look === "neo" ? 15 : 0) || 20, g.textMargin = s, g.class = "labelText", drawLabel(m, g), g = getTextObj2(), g.text = n.title, g.x = n.startx + l / 2 + (n.stopx - n.startx) / 2, g.y = n.starty + o + s, g.anchor = "middle", g.valign = "middle", g.textMargin = s, g.class = "loopText", g.fontFamily = u, g.fontSize = d, g.fontWeight = f, g.wrap = !0;
3288
+ let _ = hasKatex(g.text) ? await drawKatex(m, g, n) : drawText(m, g);
3289
+ if (n.sectionTitles !== void 0) {
3290
+ for (let [e, t] of Object.entries(n.sectionTitles)) if (t.message) {
3291
+ g.text = t.message, g.x = n.startx + (n.stopx - n.startx) / 2, g.y = n.sections[e].y + o + s, g.class = "loopText", g.anchor = "middle", g.valign = "middle", g.tspan = !1, g.fontFamily = u, g.fontSize = d, g.fontWeight = f, g.wrap = n.wrap, hasKatex(g.text) ? (n.starty = n.sections[e].y, await drawKatex(m, g, n)) : drawText(m, g);
3292
+ let r = Math.round(_.map((e) => (e._groups || e)[0][0].getBBox().height).reduce((e, t) => e + t));
3293
+ n.sections[e].height += r - (o + s);
3294
+ }
3295
+ }
3296
+ return n.height = Math.round(n.stopy - n.starty), m;
3297
+ }, "drawLoop"), drawBackgroundRect2 = /* @__PURE__ */ __name(function(e, t) {
3298
+ drawBackgroundRect(e, t);
3299
+ }, "drawBackgroundRect"), insertDatabaseIcon = /* @__PURE__ */ __name(function(e, t) {
3300
+ e.append("defs").append("symbol").attr("id", t + "-database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr("d", "M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z");
3301
+ }, "insertDatabaseIcon"), insertComputerIcon = /* @__PURE__ */ __name(function(e, t) {
3302
+ e.append("defs").append("symbol").attr("id", t + "-computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr("d", "M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z");
3303
+ }, "insertComputerIcon"), insertClockIcon = /* @__PURE__ */ __name(function(e, t) {
3304
+ e.append("defs").append("symbol").attr("id", t + "-clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr("d", "M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z");
3305
+ }, "insertClockIcon"), insertArrowHead = /* @__PURE__ */ __name(function(e, t) {
3306
+ e.append("defs").append("marker").attr("id", t + "-arrowhead").attr("refX", 7.9).attr("refY", 5).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto-start-reverse").append("path").attr("d", "M -1 0 L 10 5 L 0 10 z");
3307
+ }, "insertArrowHead"), insertArrowFilledHead = /* @__PURE__ */ __name(function(e, t) {
3308
+ e.append("defs").append("marker").attr("id", t + "-filled-head").attr("refX", 15.5).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
3309
+ }, "insertArrowFilledHead"), insertSequenceNumber = /* @__PURE__ */ __name(function(e, t) {
3310
+ e.append("defs").append("marker").attr("id", t + "-sequencenumber").attr("refX", 15).attr("refY", 15).attr("markerWidth", 60).attr("markerHeight", 40).attr("orient", "auto").append("circle").attr("cx", 15).attr("cy", 15).attr("r", 6);
3311
+ }, "insertSequenceNumber"), insertArrowCrossHead = /* @__PURE__ */ __name(function(e, t) {
3312
+ e.append("defs").append("marker").attr("id", t + "-crosshead").attr("markerWidth", 15).attr("markerHeight", 8).attr("orient", "auto").attr("refX", 4).attr("refY", 4.5).append("path").attr("fill", "none").attr("stroke", "#000000").style("stroke-dasharray", "0, 0").attr("stroke-width", "1pt").attr("d", "M 1,2 L 6,7 M 6,2 L 1,7");
3313
+ }, "insertArrowCrossHead"), insertDropShadow = /* @__PURE__ */ __name(function(e, t) {
3314
+ let { theme: n } = t;
3315
+ e.append("defs").append("filter").attr("id", "drop-shadow").attr("height", "130%").attr("width", "130%").append("feDropShadow").attr("dx", "4").attr("dy", "4").attr("stdDeviation", 0).attr("flood-opacity", "0.06").attr("flood-color", `${n === "redux" || n === "redux-color" ? "#000000" : "#FFFFFF"}`);
3316
+ }, "insertDropShadow"), getTextObj2 = /* @__PURE__ */ __name(function() {
3317
+ return {
3318
+ x: 0,
3319
+ y: 0,
3320
+ fill: void 0,
3321
+ anchor: void 0,
3322
+ style: "#666",
3323
+ width: void 0,
3324
+ height: void 0,
3325
+ textMargin: 0,
3326
+ rx: 0,
3327
+ ry: 0,
3328
+ tspan: !0,
3329
+ valign: void 0
3330
+ };
3331
+ }, "getTextObj"), getNoteRect2 = /* @__PURE__ */ __name(function() {
3332
+ return {
3333
+ x: 0,
3334
+ y: 0,
3335
+ fill: "#EDF2AE",
3336
+ stroke: "#666",
3337
+ width: 100,
3338
+ anchor: "start",
3339
+ height: 100,
3340
+ rx: 0,
3341
+ ry: 0
3342
+ };
3343
+ }, "getNoteRect"), _drawTextCandidateFunc = /* @__PURE__ */ (function() {
3344
+ function t(e, t, n, r, i, a, o) {
3345
+ s(t.append("text").attr("x", n + i / 2).attr("y", r + a / 2 + 5).style("text-anchor", "middle").text(e), o);
3346
+ }
3347
+ __name(t, "byText");
3348
+ function n(e, t, n, r, i, o, c, l) {
3349
+ let { actorFontSize: u, actorFontFamily: d, actorFontWeight: f } = l, [p, m] = parseFontSize(u), h = e.split(common_default.lineBreakRegex);
3350
+ for (let e = 0; e < h.length; e++) {
3351
+ let a = e * p - p * (h.length - 1) / 2, l = t.append("text").attr("x", n + i / 2).attr("y", r).style("text-anchor", "middle").style("font-size", m).style("font-weight", f).style("font-family", d);
3352
+ l.append("tspan").attr("x", n + i / 2).attr("dy", a).text(h[e]), l.attr("y", r + o / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), s(l, c);
3353
+ }
3354
+ }
3355
+ __name(n, "byTspan");
3356
+ function i(e, t, r, i, a, o, c, l) {
3357
+ let u = t.append("switch"), d = u.append("foreignObject").attr("x", r).attr("y", i).attr("width", a).attr("height", o).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
3358
+ d.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(e), n(e, u, r, i, a, o, c, l), s(d, c);
3359
+ }
3360
+ __name(i, "byFo");
3361
+ async function o(e, t, i, a, o, c, u, d) {
3362
+ let f = await calculateMathMLDimensions(e, getConfig()), p = t.append("switch"), h = p.append("foreignObject").attr("x", i + o / 2 - f.width / 2).attr("y", a + c / 2 - f.height / 2).attr("width", f.width).attr("height", f.height).append("xhtml:div").style("height", "100%").style("width", "100%");
3363
+ h.append("div").style("text-align", "center").style("vertical-align", "middle").html(await renderKatexSanitized(e, getConfig())), n(e, p, i, a, o, c, u, d), s(h, u);
3364
+ }
3365
+ __name(o, "byKatex");
3366
+ function s(e, t) {
3367
+ for (let n in t) t.hasOwnProperty(n) && e.attr(n, t[n]);
3368
+ }
3369
+ return __name(s, "_setTextAttrs"), function(e, r = !1) {
3370
+ return r ? o : e.textPlacement === "fo" ? i : e.textPlacement === "old" ? t : n;
3371
+ };
3372
+ })(), _drawMenuItemTextCandidateFunc = /* @__PURE__ */ (function() {
3373
+ function t(e, t, n, r, a, o, s) {
3374
+ i(t.append("text").attr("x", n).attr("y", r).style("text-anchor", "start").text(e), s);
3375
+ }
3376
+ __name(t, "byText");
3377
+ function n(e, t, n, r, o, s, c, l) {
3378
+ let { actorFontSize: u, actorFontFamily: d, actorFontWeight: f } = l, p = e.split(common_default.lineBreakRegex);
3379
+ for (let e = 0; e < p.length; e++) {
3380
+ let a = e * u - u * (p.length - 1) / 2, o = t.append("text").attr("x", n).attr("y", r).style("text-anchor", "start").style("font-size", u).style("font-weight", f).style("font-family", d);
3381
+ o.append("tspan").attr("x", n).attr("dy", a).text(p[e]), o.attr("y", r + s / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), i(o, c);
3382
+ }
3383
+ }
3384
+ __name(n, "byTspan");
3385
+ function r(e, t, r, a, o, s, c, l) {
3386
+ let u = t.append("switch"), d = u.append("foreignObject").attr("x", r).attr("y", a).attr("width", o).attr("height", s).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
3387
+ d.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(e), n(e, u, r, a, o, s, c, l), i(d, c);
3388
+ }
3389
+ __name(r, "byFo");
3390
+ function i(e, t) {
3391
+ for (let n in t) t.hasOwnProperty(n) && e.attr(n, t[n]);
3392
+ }
3393
+ return __name(i, "_setTextAttrs"), function(e) {
3394
+ return e.textPlacement === "fo" ? r : e.textPlacement === "old" ? t : n;
3395
+ };
3396
+ })(), svgDraw_default = {
3397
+ drawRect: drawRect2,
3398
+ drawText,
3399
+ drawLabel,
3400
+ drawActor,
3401
+ drawBox,
3402
+ drawPopup,
3403
+ anchorElement,
3404
+ drawActivation,
3405
+ drawLoop,
3406
+ drawBackgroundRect: drawBackgroundRect2,
3407
+ insertArrowHead,
3408
+ insertArrowFilledHead,
3409
+ insertSequenceNumber,
3410
+ insertArrowCrossHead,
3411
+ insertDatabaseIcon,
3412
+ insertComputerIcon,
3413
+ insertClockIcon,
3414
+ getTextObj: getTextObj2,
3415
+ getNoteRect: getNoteRect2,
3416
+ fixLifeLineHeights,
3417
+ sanitizeUrl: import_dist.sanitizeUrl,
3418
+ insertDropShadow,
3419
+ insertSolidTopArrowHead: /* @__PURE__ */ __name(function(e, t) {
3420
+ e.append("defs").append("marker").attr("id", t + "-solidTopArrowHead").attr("refX", 7.9).attr("refY", 7.25).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto-start-reverse").append("path").attr("d", "M 0 0 L 10 8 L 0 8 z");
3421
+ }, "insertSolidTopArrowHead"),
3422
+ insertSolidBottomArrowHead: /* @__PURE__ */ __name(function(e, t) {
3423
+ e.append("defs").append("marker").attr("id", t + "-solidBottomArrowHead").attr("refX", 7.9).attr("refY", .75).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto-start-reverse").append("path").attr("d", "M 0 0 L 10 0 L 0 8 z");
3424
+ }, "insertSolidBottomArrowHead"),
3425
+ insertStickTopArrowHead: /* @__PURE__ */ __name(function(e, t) {
3426
+ e.append("defs").append("marker").attr("id", t + "-stickTopArrowHead").attr("refX", 7.5).attr("refY", 7).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto-start-reverse").append("path").attr("d", "M 0 0 L 7 7").attr("stroke", "black").attr("stroke-width", 1.5).attr("fill", "none");
3427
+ }, "insertStickTopArrowHead"),
3428
+ insertStickBottomArrowHead: /* @__PURE__ */ __name(function(e, t) {
3429
+ e.append("defs").append("marker").attr("id", t + "-stickBottomArrowHead").attr("refX", 7.5).attr("refY", 0).attr("markerUnits", "userSpaceOnUse").attr("markerWidth", 12).attr("markerHeight", 12).attr("orient", "auto-start-reverse").append("path").attr("d", "M 0 7 L 7 0").attr("stroke", "black").attr("stroke-width", 1.5).attr("fill", "none");
3430
+ }, "insertStickBottomArrowHead")
3431
+ }, conf = {}, bounds = {
3432
+ data: {
3433
+ startx: void 0,
3434
+ stopx: void 0,
3435
+ starty: void 0,
3436
+ stopy: void 0
3437
+ },
3438
+ verticalPos: 0,
3439
+ sequenceItems: [],
3440
+ activations: [],
3441
+ models: {
3442
+ getHeight: /* @__PURE__ */ __name(function() {
3443
+ return Math.max.apply(null, this.actors.length === 0 ? [0] : this.actors.map((e) => e.height || 0)) + (this.loops.length === 0 ? 0 : this.loops.map((e) => e.height || 0).reduce((e, t) => e + t)) + (this.messages.length === 0 ? 0 : this.messages.map((e) => e.height || 0).reduce((e, t) => e + t)) + (this.notes.length === 0 ? 0 : this.notes.map((e) => e.height || 0).reduce((e, t) => e + t));
3444
+ }, "getHeight"),
3445
+ clear: /* @__PURE__ */ __name(function() {
3446
+ this.actors = [], this.boxes = [], this.loops = [], this.messages = [], this.notes = [];
3447
+ }, "clear"),
3448
+ addBox: /* @__PURE__ */ __name(function(e) {
3449
+ this.boxes.push(e);
3450
+ }, "addBox"),
3451
+ addActor: /* @__PURE__ */ __name(function(e) {
3452
+ this.actors.push(e);
3453
+ }, "addActor"),
3454
+ addLoop: /* @__PURE__ */ __name(function(e) {
3455
+ this.loops.push(e);
3456
+ }, "addLoop"),
3457
+ addMessage: /* @__PURE__ */ __name(function(e) {
3458
+ this.messages.push(e);
3459
+ }, "addMessage"),
3460
+ addNote: /* @__PURE__ */ __name(function(e) {
3461
+ this.notes.push(e);
3462
+ }, "addNote"),
3463
+ lastActor: /* @__PURE__ */ __name(function() {
3464
+ return this.actors[this.actors.length - 1];
3465
+ }, "lastActor"),
3466
+ lastLoop: /* @__PURE__ */ __name(function() {
3467
+ return this.loops[this.loops.length - 1];
3468
+ }, "lastLoop"),
3469
+ lastMessage: /* @__PURE__ */ __name(function() {
3470
+ return this.messages[this.messages.length - 1];
3471
+ }, "lastMessage"),
3472
+ lastNote: /* @__PURE__ */ __name(function() {
3473
+ return this.notes[this.notes.length - 1];
3474
+ }, "lastNote"),
3475
+ actors: [],
3476
+ boxes: [],
3477
+ loops: [],
3478
+ messages: [],
3479
+ notes: []
3480
+ },
3481
+ init: /* @__PURE__ */ __name(function() {
3482
+ this.sequenceItems = [], this.activations = [], this.models.clear(), this.data = {
3483
+ startx: void 0,
3484
+ stopx: void 0,
3485
+ starty: void 0,
3486
+ stopy: void 0
3487
+ }, this.verticalPos = 0, setConf(getConfig2());
3488
+ }, "init"),
3489
+ updateVal: /* @__PURE__ */ __name(function(e, t, n, r) {
3490
+ e[t] === void 0 ? e[t] = n : e[t] = r(n, e[t]);
3491
+ }, "updateVal"),
3492
+ updateBounds: /* @__PURE__ */ __name(function(t, n, r, i) {
3493
+ let a = this, o = 0;
3494
+ function s(s) {
3495
+ return /* @__PURE__ */ __name(function(e) {
3496
+ o++;
3497
+ let c = a.sequenceItems.length - o + 1;
3498
+ a.updateVal(e, "starty", n - c * conf.boxMargin, Math.min), a.updateVal(e, "stopy", i + c * conf.boxMargin, Math.max), a.updateVal(bounds.data, "startx", t - c * conf.boxMargin, Math.min), a.updateVal(bounds.data, "stopx", r + c * conf.boxMargin, Math.max), s !== "activation" && (a.updateVal(e, "startx", t - c * conf.boxMargin, Math.min), a.updateVal(e, "stopx", r + c * conf.boxMargin, Math.max), a.updateVal(bounds.data, "starty", n - c * conf.boxMargin, Math.min), a.updateVal(bounds.data, "stopy", i + c * conf.boxMargin, Math.max));
3499
+ }, "updateItemBounds");
3500
+ }
3501
+ __name(s, "updateFn"), this.sequenceItems.forEach(s()), this.activations.forEach(s("activation"));
3502
+ }, "updateBounds"),
3503
+ insert: /* @__PURE__ */ __name(function(e, t, n, r) {
3504
+ let i = common_default.getMin(e, n), o = common_default.getMax(e, n), s = common_default.getMin(t, r), c = common_default.getMax(t, r);
3505
+ this.updateVal(bounds.data, "startx", i, Math.min), this.updateVal(bounds.data, "starty", s, Math.min), this.updateVal(bounds.data, "stopx", o, Math.max), this.updateVal(bounds.data, "stopy", c, Math.max), this.updateBounds(i, s, o, c);
3506
+ }, "insert"),
3507
+ newActivation: /* @__PURE__ */ __name(function(e, t, n) {
3508
+ let r = n.get(e.from), i = actorActivations(e.from).length || 0, a = r.x + r.width / 2 + (i - 1) * conf.activationWidth / 2;
3509
+ this.activations.push({
3510
+ startx: a,
3511
+ starty: this.verticalPos + 2,
3512
+ stopx: a + conf.activationWidth,
3513
+ stopy: void 0,
3514
+ actor: e.from,
3515
+ anchored: svgDraw_default.anchorElement(t)
3516
+ });
3517
+ }, "newActivation"),
3518
+ endActivation: /* @__PURE__ */ __name(function(e) {
3519
+ let t = this.activations.map(function(e) {
3520
+ return e.actor;
3521
+ }).lastIndexOf(e.from);
3522
+ return this.activations.splice(t, 1)[0];
3523
+ }, "endActivation"),
3524
+ createLoop: /* @__PURE__ */ __name(function(e = {
3525
+ message: void 0,
3526
+ wrap: !1,
3527
+ width: void 0
3528
+ }, t) {
3529
+ return {
3530
+ startx: void 0,
3531
+ starty: this.verticalPos,
3532
+ stopx: void 0,
3533
+ stopy: void 0,
3534
+ title: e.message,
3535
+ wrap: e.wrap,
3536
+ width: e.width,
3537
+ height: 0,
3538
+ fill: t
3539
+ };
3540
+ }, "createLoop"),
3541
+ newLoop: /* @__PURE__ */ __name(function(e = {
3542
+ message: void 0,
3543
+ wrap: !1,
3544
+ width: void 0
3545
+ }, t) {
3546
+ this.sequenceItems.push(this.createLoop(e, t));
3547
+ }, "newLoop"),
3548
+ endLoop: /* @__PURE__ */ __name(function() {
3549
+ return this.sequenceItems.pop();
3550
+ }, "endLoop"),
3551
+ isLoopOverlap: /* @__PURE__ */ __name(function() {
3552
+ return this.sequenceItems.length ? this.sequenceItems[this.sequenceItems.length - 1].overlap : !1;
3553
+ }, "isLoopOverlap"),
3554
+ addSectionToLoop: /* @__PURE__ */ __name(function(e) {
3555
+ let t = this.sequenceItems.pop();
3556
+ t.sections = t.sections || [], t.sectionTitles = t.sectionTitles || [], t.sections.push({
3557
+ y: bounds.getVerticalPos(),
3558
+ height: 0
3559
+ }), t.sectionTitles.push(e), this.sequenceItems.push(t);
3560
+ }, "addSectionToLoop"),
3561
+ saveVerticalPos: /* @__PURE__ */ __name(function() {
3562
+ this.isLoopOverlap() && (this.savedVerticalPos = this.verticalPos);
3563
+ }, "saveVerticalPos"),
3564
+ resetVerticalPos: /* @__PURE__ */ __name(function() {
3565
+ this.isLoopOverlap() && (this.verticalPos = this.savedVerticalPos);
3566
+ }, "resetVerticalPos"),
3567
+ bumpVerticalPos: /* @__PURE__ */ __name(function(e) {
3568
+ this.verticalPos += e, this.data.stopy = common_default.getMax(this.data.stopy, this.verticalPos);
3569
+ }, "bumpVerticalPos"),
3570
+ getVerticalPos: /* @__PURE__ */ __name(function() {
3571
+ return this.verticalPos;
3572
+ }, "getVerticalPos"),
3573
+ getBounds: /* @__PURE__ */ __name(function() {
3574
+ return {
3575
+ bounds: this.data,
3576
+ models: this.models
3577
+ };
3578
+ }, "getBounds")
3579
+ }, drawNote = /* @__PURE__ */ __name(async function(e, t, n) {
3580
+ bounds.bumpVerticalPos(conf.boxMargin), t.height = conf.boxMargin, t.starty = bounds.getVerticalPos();
3581
+ let r = getNoteRect();
3582
+ r.x = t.startx, r.y = t.starty, r.width = t.width || conf.width, r.class = "note";
3583
+ let i = e.append("g");
3584
+ i.attr("data-et", "note"), i.attr("data-id", "i" + n);
3585
+ let a = svgDraw_default.drawRect(i, r), o = getTextObj();
3586
+ o.x = t.startx, o.y = t.starty, o.width = r.width, o.dy = "1em", o.text = t.message, o.class = "noteText", o.fontFamily = conf.noteFontFamily, o.fontSize = conf.noteFontSize, o.fontWeight = conf.noteFontWeight, o.anchor = conf.noteAlign, o.textMargin = conf.noteMargin, o.valign = "center";
3587
+ let s = hasKatex(o.text) ? await drawKatex(i, o) : drawText(i, o), c = Math.round(s.map((e) => (e._groups || e)[0][0].getBBox().height).reduce((e, t) => e + t));
3588
+ a.attr("height", c + 2 * conf.noteMargin), t.height += c + 2 * conf.noteMargin, bounds.bumpVerticalPos(c + 2 * conf.noteMargin), t.stopy = t.starty + c + 2 * conf.noteMargin, t.stopx = t.startx + r.width, bounds.insert(t.startx, t.starty, t.stopx, t.stopy), bounds.models.addNote(t);
3589
+ }, "drawNote"), drawCentralConnection = /* @__PURE__ */ __name(function(t, n, r, i, a, o, s) {
3590
+ let c = i.db.getActors(), l = c.get(n.from), u = c.get(n.to), d = r.sequenceVisible, f = l.x + l.width / 2, p = u.x + u.width / 2, m = f <= p, h = isReverseArrowType(n, i), g = t.append("g"), _ = 16.5, v = /* @__PURE__ */ __name((e, t) => {
3591
+ let n = e ? _ : -_;
3592
+ return t ? -n : n;
3593
+ }, "getCircleOffset"), y = /* @__PURE__ */ __name((e) => {
3594
+ g.append("circle").attr("cx", e).attr("cy", s).attr("r", 5).attr("width", 10).attr("height", 10);
3595
+ }, "drawCircle"), { CENTRAL_CONNECTION: b, CENTRAL_CONNECTION_REVERSE: x, CENTRAL_CONNECTION_DUAL: S } = i.db.LINETYPE;
3596
+ if (d) switch (n.centralConnection) {
3597
+ case b:
3598
+ h && (p += v(m, !0));
3599
+ break;
3600
+ case x:
3601
+ h || (f += v(m, !1));
3602
+ break;
3603
+ case S:
3604
+ h ? p += v(m, !0) : f += v(m, !1);
3605
+ break;
3606
+ }
3607
+ switch (n.centralConnection) {
3608
+ case b:
3609
+ y(p);
3610
+ break;
3611
+ case x:
3612
+ y(f);
3613
+ break;
3614
+ case S:
3615
+ y(f), y(p);
3616
+ break;
3617
+ }
3618
+ }, "drawCentralConnection"), messageFont = /* @__PURE__ */ __name((e) => ({
3619
+ fontFamily: e.messageFontFamily,
3620
+ fontSize: e.messageFontSize,
3621
+ fontWeight: e.messageFontWeight
3622
+ }), "messageFont"), noteFont = /* @__PURE__ */ __name((e) => ({
3623
+ fontFamily: e.noteFontFamily,
3624
+ fontSize: e.noteFontSize,
3625
+ fontWeight: e.noteFontWeight
3626
+ }), "noteFont"), actorFont = /* @__PURE__ */ __name((e) => ({
3627
+ fontFamily: e.actorFontFamily,
3628
+ fontSize: e.actorFontSize,
3629
+ fontWeight: e.actorFontWeight
3630
+ }), "actorFont");
3631
+ async function boundMessage(e, t) {
3632
+ bounds.bumpVerticalPos(10);
3633
+ let { startx: n, stopx: i, message: o } = t, s = common_default.splitBreaks(o).length, c = hasKatex(o), l = c ? await calculateMathMLDimensions(o, getConfig2()) : utils_default.calculateTextDimensions(o, messageFont(conf));
3634
+ if (!c) {
3635
+ let e = l.height / s;
3636
+ t.height += e, bounds.bumpVerticalPos(e);
3637
+ }
3638
+ let d, f = l.height - 10, m = l.width;
3639
+ if (n === i) {
3640
+ d = bounds.getVerticalPos() + f, conf.rightAngles || (f += conf.boxMargin, d = bounds.getVerticalPos() + f), f += 30;
3641
+ let e = common_default.getMax(m / 2, conf.width / 2);
3642
+ bounds.insert(n - e, bounds.getVerticalPos() - 10 + f, i + e, bounds.getVerticalPos() + 30 + f);
3643
+ } else f += conf.boxMargin, d = bounds.getVerticalPos() + f, bounds.insert(n, d - 10, i, d);
3644
+ return bounds.bumpVerticalPos(f), t.height += f, t.stopy = t.starty + t.height, bounds.insert(t.fromBounds, t.starty, t.toBounds, t.stopy), d;
3645
+ }
3646
+ __name(boundMessage, "boundMessage");
3647
+ var drawMessage = /* @__PURE__ */ __name(async function(e, t, n, r, i, o) {
3648
+ let { startx: s, stopx: c, starty: l, message: u, type: d, sequenceIndex: m, sequenceVisible: h } = t, g = utils_default.calculateTextDimensions(u, messageFont(conf)), _ = getTextObj();
3649
+ _.x = s, _.y = l + 10, _.width = c - s, _.class = "messageText", _.dy = "1em", _.text = u, _.fontFamily = conf.messageFontFamily, _.fontSize = conf.messageFontSize, _.fontWeight = conf.messageFontWeight, _.anchor = conf.messageAlign, _.valign = "center", _.textMargin = conf.wrapPadding, _.tspan = !1, hasKatex(_.text) ? await drawKatex(e, _, {
3650
+ startx: s,
3651
+ stopx: c,
3652
+ starty: n
3653
+ }) : drawText(e, _);
3654
+ let v = g.width, y;
3655
+ if (s === c) {
3656
+ let o = h || conf.showSequenceNumbers, l = isReverseArrowType(i, r), u = isBidirectionalArrowType(i, r), d = s + (o && (l || u) ? 10 : 0);
3657
+ y = conf.rightAngles ? e.append("path").attr("d", `M ${d},${n} H ${s + common_default.getMax(conf.width / 2, v / 2)} V ${n + 25} H ${s}`) : e.append("path").attr("d", "M " + d + "," + n + " C " + (d + 60) + "," + (n - 10) + " " + (s + 60) + "," + (n + 30) + " " + s + "," + (n + 20)), hasCentralConnection(i, r) && drawCentralConnection(e, i, t, r, s, c, n);
3658
+ } else y = e.append("line"), y.attr("x1", s), y.attr("y1", n), y.attr("x2", c), y.attr("y2", n), hasCentralConnection(i, r) && drawCentralConnection(e, i, t, r, s, c, n);
3659
+ d === r.db.LINETYPE.DOTTED || d === r.db.LINETYPE.DOTTED_CROSS || d === r.db.LINETYPE.DOTTED_POINT || d === r.db.LINETYPE.DOTTED_OPEN || d === r.db.LINETYPE.BIDIRECTIONAL_DOTTED || d === r.db.LINETYPE.SOLID_TOP_DOTTED || d === r.db.LINETYPE.SOLID_BOTTOM_DOTTED || d === r.db.LINETYPE.STICK_TOP_DOTTED || d === r.db.LINETYPE.STICK_BOTTOM_DOTTED || d === r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED || d === r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED || d === r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED || d === r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED ? (y.style("stroke-dasharray", "3, 3"), y.attr("class", "messageLine1")) : y.attr("class", "messageLine0"), y.attr("data-et", "message"), y.attr("data-id", "i" + t.id), y.attr("data-from", t.from), y.attr("data-to", t.to);
3660
+ let b = "";
3661
+ if (conf.arrowMarkerAbsolute && (b = getUrl(!0)), y.attr("stroke-width", 2), y.attr("stroke", "none"), y.style("fill", "none"), (d === r.db.LINETYPE.SOLID_TOP || d === r.db.LINETYPE.SOLID_TOP_DOTTED) && y.attr("marker-end", "url(" + b + "#" + o + "-solidTopArrowHead)"), (d === r.db.LINETYPE.SOLID_BOTTOM || d === r.db.LINETYPE.SOLID_BOTTOM_DOTTED) && y.attr("marker-end", "url(" + b + "#" + o + "-solidBottomArrowHead)"), (d === r.db.LINETYPE.STICK_TOP || d === r.db.LINETYPE.STICK_TOP_DOTTED) && y.attr("marker-end", "url(" + b + "#" + o + "-stickTopArrowHead)"), (d === r.db.LINETYPE.STICK_BOTTOM || d === r.db.LINETYPE.STICK_BOTTOM_DOTTED) && y.attr("marker-end", "url(" + b + "#" + o + "-stickBottomArrowHead)"), (d === r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE || d === r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED) && y.attr("marker-start", "url(" + b + "#" + o + "-solidBottomArrowHead)"), (d === r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE || d === r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED) && y.attr("marker-start", "url(" + b + "#" + o + "-solidTopArrowHead)"), (d === r.db.LINETYPE.STICK_ARROW_TOP_REVERSE || d === r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED) && y.attr("marker-start", "url(" + b + "#" + o + "-stickBottomArrowHead)"), (d === r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE || d === r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED) && y.attr("marker-start", "url(" + b + "#" + o + "-stickTopArrowHead)"), (d === r.db.LINETYPE.SOLID || d === r.db.LINETYPE.DOTTED) && y.attr("marker-end", "url(" + b + "#" + o + "-arrowhead)"), (d === r.db.LINETYPE.BIDIRECTIONAL_SOLID || d === r.db.LINETYPE.BIDIRECTIONAL_DOTTED) && (y.attr("marker-start", "url(" + b + "#" + o + "-arrowhead)"), y.attr("marker-end", "url(" + b + "#" + o + "-arrowhead)")), (d === r.db.LINETYPE.SOLID_POINT || d === r.db.LINETYPE.DOTTED_POINT) && y.attr("marker-end", "url(" + b + "#" + o + "-filled-head)"), (d === r.db.LINETYPE.SOLID_CROSS || d === r.db.LINETYPE.DOTTED_CROSS) && y.attr("marker-end", "url(" + b + "#" + o + "-crosshead)"), h || conf.showSequenceNumbers) {
3662
+ let a = d === r.db.LINETYPE.BIDIRECTIONAL_SOLID || d === r.db.LINETYPE.BIDIRECTIONAL_DOTTED, l = d === r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE || d === r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED || d === r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE || d === r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED || d === r.db.LINETYPE.STICK_ARROW_TOP_REVERSE || d === r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED || d === r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE || d === r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED, u = hasCentralConnection(i, r), f = s, p = c;
3663
+ a ? (s < c ? f = s + 12 : (f = s - 6 + (u ? -5 : 0), f += i?.centralConnection === r.db.LINETYPE.CENTRAL_CONNECTION_DUAL || i?.centralConnection === r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE ? -7.5 : 0), y.attr("x1", f)) : l ? (c > s ? p = c - 12 : (p = c - 6, f += i?.centralConnection === r.db.LINETYPE.CENTRAL_CONNECTION_DUAL || i?.centralConnection === r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE ? -7.5 : 0), p += u ? 15 : 0, y.attr("x2", p), y.attr("x1", f)) : y.attr("x1", s + 6);
3664
+ let h = 0, g = s === c, _ = s <= c;
3665
+ h = g ? t.fromBounds + 1 : l ? _ ? t.toBounds - 1 : t.fromBounds + 1 : _ ? t.fromBounds + 1 : t.toBounds - 1, e.append("line").attr("x1", h).attr("y1", n).attr("x2", h).attr("y2", n).attr("stroke-width", 0).attr("marker-start", "url(" + b + "#" + o + "-sequencenumber)"), e.append("text").attr("x", h).attr("y", n + 4).attr("font-family", "sans-serif").attr("font-size", "12px").attr("text-anchor", "middle").attr("class", "sequenceNumber").text(m);
3666
+ }
3667
+ }, "drawMessage"), addActorRenderingData = /* @__PURE__ */ __name(function(e, t, n, r, i, o, s) {
3668
+ let c = 0, l = 0, u, d = 0;
3669
+ for (let e of r) {
3670
+ let r = t.get(e), o = r.box;
3671
+ u && u != o && (s || bounds.models.addBox(u), l += conf.boxMargin + u.margin), o && o != u && (s || (o.x = c + l, o.y = i), l += o.margin), r.width = common_default.getMax(r.width || conf.width, conf.width), r.height = common_default.getMax(r.height || conf.height, conf.height), r.margin = r.margin || conf.actorMargin, d = common_default.getMax(d, r.height), n.get(r.name) && (l += r.width / 2), r.x = c + l, r.starty = bounds.getVerticalPos(), bounds.insert(r.x, i, r.x + r.width, r.height), c += r.width + l, r.box && (r.box.width = c + o.margin - r.box.x), l = r.margin, u = r.box, bounds.models.addActor(r);
3672
+ }
3673
+ u && !s && bounds.models.addBox(u), bounds.bumpVerticalPos(d);
3674
+ }, "addActorRenderingData"), drawActors = /* @__PURE__ */ __name(async function(e, t, n, r, i, o, s) {
3675
+ if (r) {
3676
+ let r = 0;
3677
+ bounds.bumpVerticalPos(conf.boxMargin * 2);
3678
+ for (let c of n) {
3679
+ let n = t.get(c);
3680
+ n.stopy ||= bounds.getVerticalPos();
3681
+ let l = await svgDraw_default.drawActor(e, n, conf, !0, i, o, s);
3682
+ r = common_default.getMax(r, l);
3683
+ }
3684
+ bounds.bumpVerticalPos(r + conf.boxMargin);
3685
+ } else for (let r of n) {
3686
+ let n = t.get(r);
3687
+ await svgDraw_default.drawActor(e, n, conf, !1, i, o, s);
3688
+ }
3689
+ }, "drawActors"), drawActorsPopup = /* @__PURE__ */ __name(function(e, t, n, r) {
3690
+ let i = 0, a = 0;
3691
+ for (let o of n) {
3692
+ let n = t.get(o), s = getRequiredPopupWidth(n), c = svgDraw_default.drawPopup(e, n, s, conf, conf.forceMenus, r);
3693
+ c.height > i && (i = c.height), c.width + n.x > a && (a = c.width + n.x);
3694
+ }
3695
+ return {
3696
+ maxHeight: i,
3697
+ maxWidth: a
3698
+ };
3699
+ }, "drawActorsPopup"), setConf = /* @__PURE__ */ __name(function(e) {
3700
+ assignWithDepth_default(conf, e), e.fontFamily && (conf.actorFontFamily = conf.noteFontFamily = conf.messageFontFamily = e.fontFamily), e.fontSize && (conf.actorFontSize = conf.noteFontSize = conf.messageFontSize = e.fontSize), e.fontWeight && (conf.actorFontWeight = conf.noteFontWeight = conf.messageFontWeight = e.fontWeight);
3701
+ }, "setConf"), actorActivations = /* @__PURE__ */ __name(function(e) {
3702
+ return bounds.activations.filter(function(t) {
3703
+ return t.actor === e;
3704
+ });
3705
+ }, "actorActivations"), activationBounds = /* @__PURE__ */ __name(function(e, t) {
3706
+ let n = t.get(e), r = actorActivations(e);
3707
+ return [r.reduce(function(e, t) {
3708
+ return common_default.getMin(e, t.startx);
3709
+ }, n.x + n.width / 2 - 1), r.reduce(function(e, t) {
3710
+ return common_default.getMax(e, t.stopx);
3711
+ }, n.x + n.width / 2 + 1)];
3712
+ }, "activationBounds");
3713
+ function adjustLoopHeightForWrap(e, n, r, i, o) {
3714
+ bounds.bumpVerticalPos(r);
3715
+ let s = i;
3716
+ if (n.id && n.message && e[n.id]) {
3717
+ let r = e[n.id].width, o = messageFont(conf);
3718
+ n.message = utils_default.wrapLabel(`[${n.message}]`, r - 2 * conf.wrapPadding, o), n.width = r, n.wrap = !0;
3719
+ let c = utils_default.calculateTextDimensions(n.message, o), l = common_default.getMax(c.height, conf.labelBoxHeight);
3720
+ s = i + l, log.debug(`${l} - ${n.message}`);
3721
+ }
3722
+ o(n), bounds.bumpVerticalPos(s);
3723
+ }
3724
+ __name(adjustLoopHeightForWrap, "adjustLoopHeightForWrap");
3725
+ function adjustCreatedDestroyedData(t, n, r, i, a, o, s) {
3726
+ function c(e, r) {
3727
+ e.x < a.get(t.from).x ? (bounds.insert(n.stopx - r, n.starty, n.startx, n.stopy + e.height / 2 + conf.noteMargin), n.stopx += r) : (bounds.insert(n.startx, n.starty, n.stopx + r, n.stopy + e.height / 2 + conf.noteMargin), n.stopx -= r);
3728
+ }
3729
+ __name(c, "receiverAdjustment");
3730
+ function l(e, r) {
3731
+ e.x < a.get(t.to).x ? (bounds.insert(n.startx - r, n.starty, n.stopx, n.stopy + e.height / 2 + conf.noteMargin), n.startx += r) : (bounds.insert(n.stopx, n.starty, n.startx + r, n.stopy + e.height / 2 + conf.noteMargin), n.startx -= r);
3732
+ }
3733
+ __name(l, "senderAdjustment");
3734
+ let u = [
3735
+ PARTICIPANT_TYPE.ACTOR,
3736
+ PARTICIPANT_TYPE.CONTROL,
3737
+ PARTICIPANT_TYPE.ENTITY,
3738
+ PARTICIPANT_TYPE.DATABASE
3739
+ ];
3740
+ if (o.get(t.to) == i) {
3741
+ let e = a.get(t.to);
3742
+ c(e, u.includes(e.type) ? ACTOR_TYPE_WIDTH / 2 + 3 : e.width / 2 + 3), e.starty = r - e.height / 2, bounds.bumpVerticalPos(e.height / 2);
3743
+ } else if (s.get(t.from) == i) {
3744
+ let e = a.get(t.from);
3745
+ conf.mirrorActors && l(e, u.includes(e.type) ? ACTOR_TYPE_WIDTH / 2 : e.width / 2), e.stopy = r - e.height / 2, bounds.bumpVerticalPos(e.height / 2);
3746
+ } else if (s.get(t.to) == i) {
3747
+ let e = a.get(t.to);
3748
+ conf.mirrorActors && c(e, u.includes(e.type) ? ACTOR_TYPE_WIDTH / 2 + 3 : e.width / 2 + 3), e.stopy = r - e.height / 2, bounds.bumpVerticalPos(e.height / 2);
3749
+ }
3750
+ }
3751
+ __name(adjustCreatedDestroyedData, "adjustCreatedDestroyedData");
3752
+ var draw = /* @__PURE__ */ __name(async function(n, r, i, a) {
3753
+ let { securityLevel: s, sequence: c, look: l } = getConfig2();
3754
+ conf = c;
3755
+ let d;
3756
+ s === "sandbox" && (d = select_default("#i" + r));
3757
+ let f = select_default(s === "sandbox" ? d.nodes()[0].contentDocument.body : "body"), p = s === "sandbox" ? d.nodes()[0].contentDocument : document;
3758
+ bounds.init(), log.debug(a.db);
3759
+ let m = s === "sandbox" ? f.select(`[id="${r}"]`) : select_default(`[id="${r}"]`), h = a.db.getActors(), g = a.db.getCreatedActors(), _ = a.db.getDestroyedActors(), v = a.db.getBoxes(), y = a.db.getActorKeys(), x = a.db.getMessages(), S = a.db.getDiagramTitle(), C = a.db.hasAtLeastOneBox(), w = a.db.hasAtLeastOneBoxWithTitle(), T = await getMaxMessageWidthPerActor(h, x, a);
3760
+ if (conf.height = await calculateActorMargins(h, T, v), svgDraw_default.insertComputerIcon(m, r), svgDraw_default.insertDatabaseIcon(m, r), svgDraw_default.insertClockIcon(m, r), C && (bounds.bumpVerticalPos(conf.boxMargin), w && bounds.bumpVerticalPos(v[0].textMaxHeight)), conf.hideUnusedParticipants === !0) {
3761
+ let e = /* @__PURE__ */ new Set();
3762
+ x.forEach((t) => {
3763
+ e.add(t.from), e.add(t.to);
3764
+ }), y = y.filter((t) => e.has(t));
3765
+ }
3766
+ let E = new Map(y.map((e, t) => [h.get(e)?.name ?? e, t]));
3767
+ addActorRenderingData(m, h, g, y, 0, x, !1);
3768
+ let D = await calculateLoopBounds(x, h, T, a);
3769
+ svgDraw_default.insertArrowHead(m, r), svgDraw_default.insertArrowCrossHead(m, r), svgDraw_default.insertArrowFilledHead(m, r), svgDraw_default.insertSequenceNumber(m, r), svgDraw_default.insertSolidTopArrowHead(m, r), svgDraw_default.insertSolidBottomArrowHead(m, r), svgDraw_default.insertStickTopArrowHead(m, r), svgDraw_default.insertStickBottomArrowHead(m, r), l === "neo" && svgDraw_default.insertDropShadow(m, conf);
3770
+ function O(e, t) {
3771
+ let n = bounds.endActivation(e);
3772
+ n.starty + 18 > t && (n.starty = t - 6, t += 12), svgDraw_default.drawActivation(m, n, t, conf, actorActivations(e.from).length, a, E), bounds.insert(n.startx, t - 10, n.stopx, t);
3773
+ }
3774
+ __name(O, "activeEnd");
3775
+ let k = 1, A = 1, j = [], M = [], N = 0;
3776
+ for (let e of x) {
3777
+ let n, r, i;
3778
+ switch (e.type) {
3779
+ case a.db.LINETYPE.NOTE:
3780
+ bounds.resetVerticalPos(), r = e.noteModel, await drawNote(m, r, e.id);
3781
+ break;
3782
+ case a.db.LINETYPE.ACTIVE_START:
3783
+ bounds.newActivation(e, m, h);
3784
+ break;
3785
+ case a.db.LINETYPE.CENTRAL_CONNECTION:
3786
+ bounds.newActivation(e, m, h);
3787
+ break;
3788
+ case a.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:
3789
+ bounds.newActivation(e, m, h);
3790
+ break;
3791
+ case a.db.LINETYPE.ACTIVE_END:
3792
+ O(e, bounds.getVerticalPos());
3793
+ break;
3794
+ case a.db.LINETYPE.LOOP_START:
3795
+ adjustLoopHeightForWrap(D, e, conf.boxMargin, conf.boxMargin + conf.boxTextMargin, (e) => bounds.newLoop(e));
3796
+ break;
3797
+ case a.db.LINETYPE.LOOP_END:
3798
+ n = bounds.endLoop(), await svgDraw_default.drawLoop(m, n, "loop", conf, e), bounds.bumpVerticalPos(n.stopy - bounds.getVerticalPos()), bounds.models.addLoop(n);
3799
+ break;
3800
+ case a.db.LINETYPE.RECT_START:
3801
+ adjustLoopHeightForWrap(D, e, conf.boxMargin, conf.boxMargin, (e) => bounds.newLoop(void 0, e.message));
3802
+ break;
3803
+ case a.db.LINETYPE.RECT_END:
3804
+ n = bounds.endLoop(), M.push(n), bounds.models.addLoop(n), bounds.bumpVerticalPos(n.stopy - bounds.getVerticalPos());
3805
+ break;
3806
+ case a.db.LINETYPE.OPT_START:
3807
+ adjustLoopHeightForWrap(D, e, conf.boxMargin, conf.boxMargin + conf.boxTextMargin, (e) => bounds.newLoop(e));
3808
+ break;
3809
+ case a.db.LINETYPE.OPT_END:
3810
+ n = bounds.endLoop(), await svgDraw_default.drawLoop(m, n, "opt", conf, e), bounds.bumpVerticalPos(n.stopy - bounds.getVerticalPos()), bounds.models.addLoop(n);
3811
+ break;
3812
+ case a.db.LINETYPE.ALT_START:
3813
+ adjustLoopHeightForWrap(D, e, conf.boxMargin, conf.boxMargin + conf.boxTextMargin, (e) => bounds.newLoop(e));
3814
+ break;
3815
+ case a.db.LINETYPE.ALT_ELSE:
3816
+ adjustLoopHeightForWrap(D, e, conf.boxMargin + conf.boxTextMargin, conf.boxMargin, (e) => bounds.addSectionToLoop(e));
3817
+ break;
3818
+ case a.db.LINETYPE.ALT_END:
3819
+ n = bounds.endLoop(), await svgDraw_default.drawLoop(m, n, "alt", conf, e), bounds.bumpVerticalPos(n.stopy - bounds.getVerticalPos()), bounds.models.addLoop(n);
3820
+ break;
3821
+ case a.db.LINETYPE.PAR_START:
3822
+ case a.db.LINETYPE.PAR_OVER_START:
3823
+ adjustLoopHeightForWrap(D, e, conf.boxMargin, conf.boxMargin + conf.boxTextMargin, (e) => bounds.newLoop(e)), bounds.saveVerticalPos();
3824
+ break;
3825
+ case a.db.LINETYPE.PAR_AND:
3826
+ adjustLoopHeightForWrap(D, e, conf.boxMargin + conf.boxTextMargin, conf.boxMargin, (e) => bounds.addSectionToLoop(e));
3827
+ break;
3828
+ case a.db.LINETYPE.PAR_END:
3829
+ n = bounds.endLoop(), await svgDraw_default.drawLoop(m, n, "par", conf, e), bounds.bumpVerticalPos(n.stopy - bounds.getVerticalPos()), bounds.models.addLoop(n);
3830
+ break;
3831
+ case a.db.LINETYPE.AUTONUMBER:
3832
+ k = e.message.start || k, A = e.message.step || A, e.message.visible ? a.db.enableSequenceNumbers() : a.db.disableSequenceNumbers();
3833
+ break;
3834
+ case a.db.LINETYPE.CRITICAL_START:
3835
+ adjustLoopHeightForWrap(D, e, conf.boxMargin, conf.boxMargin + conf.boxTextMargin, (e) => bounds.newLoop(e));
3836
+ break;
3837
+ case a.db.LINETYPE.CRITICAL_OPTION:
3838
+ adjustLoopHeightForWrap(D, e, conf.boxMargin + conf.boxTextMargin, conf.boxMargin, (e) => bounds.addSectionToLoop(e));
3839
+ break;
3840
+ case a.db.LINETYPE.CRITICAL_END:
3841
+ n = bounds.endLoop(), await svgDraw_default.drawLoop(m, n, "critical", conf, e), bounds.bumpVerticalPos(n.stopy - bounds.getVerticalPos()), bounds.models.addLoop(n);
3842
+ break;
3843
+ case a.db.LINETYPE.BREAK_START:
3844
+ adjustLoopHeightForWrap(D, e, conf.boxMargin, conf.boxMargin + conf.boxTextMargin, (e) => bounds.newLoop(e));
3845
+ break;
3846
+ case a.db.LINETYPE.BREAK_END:
3847
+ n = bounds.endLoop(), await svgDraw_default.drawLoop(m, n, "break", conf, e), bounds.bumpVerticalPos(n.stopy - bounds.getVerticalPos()), bounds.models.addLoop(n);
3848
+ break;
3849
+ default: try {
3850
+ i = e.msgModel, i.starty = bounds.getVerticalPos(), i.sequenceIndex = k, i.sequenceVisible = a.db.showSequenceNumbers(), i.id = e.id, i.from = e.from, i.to = e.to;
3851
+ let t = await boundMessage(m, i);
3852
+ adjustCreatedDestroyedData(e, i, t, N, h, g, _), j.push({
3853
+ messageModel: i,
3854
+ lineStartY: t,
3855
+ msg: e
3856
+ }), bounds.models.addMessage(i);
3857
+ } catch (e) {
3858
+ log.error("error while drawing message", e);
3859
+ }
3860
+ }
3861
+ [
3862
+ a.db.LINETYPE.SOLID_OPEN,
3863
+ a.db.LINETYPE.DOTTED_OPEN,
3864
+ a.db.LINETYPE.SOLID,
3865
+ a.db.LINETYPE.SOLID_TOP,
3866
+ a.db.LINETYPE.SOLID_BOTTOM,
3867
+ a.db.LINETYPE.STICK_TOP,
3868
+ a.db.LINETYPE.STICK_BOTTOM,
3869
+ a.db.LINETYPE.SOLID_TOP_DOTTED,
3870
+ a.db.LINETYPE.SOLID_BOTTOM_DOTTED,
3871
+ a.db.LINETYPE.STICK_TOP_DOTTED,
3872
+ a.db.LINETYPE.STICK_BOTTOM_DOTTED,
3873
+ a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,
3874
+ a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,
3875
+ a.db.LINETYPE.STICK_ARROW_TOP_REVERSE,
3876
+ a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,
3877
+ a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,
3878
+ a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,
3879
+ a.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,
3880
+ a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,
3881
+ a.db.LINETYPE.DOTTED,
3882
+ a.db.LINETYPE.SOLID_CROSS,
3883
+ a.db.LINETYPE.DOTTED_CROSS,
3884
+ a.db.LINETYPE.SOLID_POINT,
3885
+ a.db.LINETYPE.DOTTED_POINT,
3886
+ a.db.LINETYPE.BIDIRECTIONAL_SOLID,
3887
+ a.db.LINETYPE.BIDIRECTIONAL_DOTTED
3888
+ ].includes(e.type) && (k += A), N++;
3889
+ }
3890
+ log.debug("createdActors", g), log.debug("destroyedActors", _), await drawActors(m, h, y, !1, r, a, E);
3891
+ for (let e of j) await drawMessage(m, e.messageModel, e.lineStartY, a, e.msg, r);
3892
+ conf.mirrorActors && await drawActors(m, h, y, !0, r, a, E), M.forEach((e) => svgDraw_default.drawBackgroundRect(m, e)), fixLifeLineHeights(m, h, y, conf);
3893
+ for (let e of bounds.models.boxes) {
3894
+ e.height = bounds.getVerticalPos() - e.y, bounds.insert(e.x, e.y, e.x + e.width, e.height);
3895
+ let t = conf.boxMargin * 2;
3896
+ e.startx = e.x - t, e.starty = e.y - t * .25, e.stopx = e.startx + e.width + 2 * t, e.stopy = e.starty + e.height + t * .75, e.stroke = "rgb(0,0,0, 0.5)", svgDraw_default.drawBox(m, e, conf);
3897
+ }
3898
+ C && bounds.bumpVerticalPos(conf.boxMargin);
3899
+ let P = drawActorsPopup(m, h, y, p), { bounds: F } = bounds.getBounds();
3900
+ F.startx === void 0 && (F.startx = 0), F.starty === void 0 && (F.starty = 0), F.stopx === void 0 && (F.stopx = 0), F.stopy === void 0 && (F.stopy = 0);
3901
+ let I = F.stopy - F.starty;
3902
+ I < P.maxHeight && (I = P.maxHeight);
3903
+ let L = I + 2 * conf.diagramMarginY;
3904
+ conf.mirrorActors && (L = L - conf.boxMargin + conf.bottomMarginAdj);
3905
+ let R = F.stopx - F.startx;
3906
+ R < P.maxWidth && (R = P.maxWidth);
3907
+ let z = R + 2 * conf.diagramMarginX;
3908
+ S && m.append("text").text(S).attr("x", (F.stopx - F.startx) / 2 - 2 * conf.diagramMarginX).attr("y", -25), configureSvgSize(m, L, z, conf.useMaxWidth);
3909
+ let B = S ? 40 : 0, V = h.size && l === "neo" ? 30 : 0;
3910
+ m.attr("viewBox", F.startx - conf.diagramMarginX + " -" + (conf.diagramMarginY + B) + " " + z + " " + (L + B + V)), log.debug("models:", bounds.models);
3911
+ }, "draw");
3912
+ async function getMaxMessageWidthPerActor(e, n, i) {
3913
+ let o = {};
3914
+ for (let t of n) if (e.get(t.to) && e.get(t.from)) {
3915
+ let n = e.get(t.to);
3916
+ if (t.placement === i.db.PLACEMENT.LEFTOF && !n.prevActor || t.placement === i.db.PLACEMENT.RIGHTOF && !n.nextActor) continue;
3917
+ let s = t.placement !== void 0, c = !s, l = s ? noteFont(conf) : messageFont(conf), d = t.wrap ? utils_default.wrapLabel(t.message, conf.width - 2 * conf.wrapPadding, l) : t.message, f = (hasKatex(d) ? await calculateMathMLDimensions(t.message, getConfig2()) : utils_default.calculateTextDimensions(d, l)).width + 2 * conf.wrapPadding;
3918
+ c && t.from === n.nextActor ? o[t.to] = common_default.getMax(o[t.to] || 0, f) : c && t.from === n.prevActor ? o[t.from] = common_default.getMax(o[t.from] || 0, f) : c && t.from === t.to ? (o[t.from] = common_default.getMax(o[t.from] || 0, f / 2), o[t.to] = common_default.getMax(o[t.to] || 0, f / 2)) : t.placement === i.db.PLACEMENT.RIGHTOF ? o[t.from] = common_default.getMax(o[t.from] || 0, f) : t.placement === i.db.PLACEMENT.LEFTOF ? o[n.prevActor] = common_default.getMax(o[n.prevActor] || 0, f) : t.placement === i.db.PLACEMENT.OVER && (n.prevActor && (o[n.prevActor] = common_default.getMax(o[n.prevActor] || 0, f / 2)), n.nextActor && (o[t.from] = common_default.getMax(o[t.from] || 0, f / 2)));
3919
+ }
3920
+ return log.debug("maxMessageWidthPerActor:", o), o;
3921
+ }
3922
+ __name(getMaxMessageWidthPerActor, "getMaxMessageWidthPerActor");
3923
+ var getRequiredPopupWidth = /* @__PURE__ */ __name(function(e) {
3924
+ let t = 0, n = actorFont(conf);
3925
+ for (let r in e.links) {
3926
+ let e = utils_default.calculateTextDimensions(r, n).width + 2 * conf.wrapPadding + 2 * conf.boxMargin;
3927
+ t < e && (t = e);
3928
+ }
3929
+ return t;
3930
+ }, "getRequiredPopupWidth");
3931
+ async function calculateActorMargins(e, t, n) {
3932
+ let i = 0;
3933
+ for (let t of e.keys()) {
3934
+ let n = e.get(t);
3935
+ n.wrap && (n.description = utils_default.wrapLabel(n.description, conf.width - 2 * conf.wrapPadding, actorFont(conf)));
3936
+ let o = hasKatex(n.description) ? await calculateMathMLDimensions(n.description, getConfig2()) : utils_default.calculateTextDimensions(n.description, actorFont(conf));
3937
+ n.width = n.wrap ? conf.width : common_default.getMax(conf.width, o.width + 2 * conf.wrapPadding), n.height = n.wrap ? common_default.getMax(o.height, conf.height) : conf.height, i = common_default.getMax(i, n.height);
3938
+ }
3939
+ for (let n in t) {
3940
+ let r = e.get(n);
3941
+ if (!r) continue;
3942
+ let i = e.get(r.nextActor);
3943
+ if (!i) {
3944
+ let e = t[n] + conf.actorMargin - r.width / 2;
3945
+ r.margin = common_default.getMax(e, conf.actorMargin);
3946
+ continue;
3947
+ }
3948
+ let o = t[n] + conf.actorMargin - r.width / 2 - i.width / 2;
3949
+ r.margin = common_default.getMax(o, conf.actorMargin);
3950
+ }
3951
+ let o = 0;
3952
+ return n.forEach((t) => {
3953
+ let n = messageFont(conf), r = t.actorKeys.reduce((t, n) => t += e.get(n).width + (e.get(n).margin || 0), 0), i = conf.boxMargin * 8;
3954
+ r += i, r -= 2 * conf.boxTextMargin, t.wrap && (t.name = utils_default.wrapLabel(t.name, r - 2 * conf.wrapPadding, n));
3955
+ let s = utils_default.calculateTextDimensions(t.name, n);
3956
+ o = common_default.getMax(s.height, o);
3957
+ let c = common_default.getMax(r, s.width + 2 * conf.wrapPadding);
3958
+ if (t.margin = conf.boxTextMargin, r < c) {
3959
+ let e = (c - r) / 2;
3960
+ t.margin += e;
3961
+ }
3962
+ }), n.forEach((e) => e.textMaxHeight = o), common_default.getMax(i, conf.height);
3963
+ }
3964
+ __name(calculateActorMargins, "calculateActorMargins");
3965
+ var buildNoteModel = /* @__PURE__ */ __name(async function(e, n, i) {
3966
+ let o = n.get(e.from), s = n.get(e.to), c = o.x, l = s.x, d = e.wrap && e.message, f = hasKatex(e.message) ? await calculateMathMLDimensions(e.message, getConfig2()) : utils_default.calculateTextDimensions(d ? utils_default.wrapLabel(e.message, conf.width, noteFont(conf)) : e.message, noteFont(conf)), m = {
3967
+ width: d ? conf.width : common_default.getMax(conf.width, f.width + 2 * conf.noteMargin),
3968
+ height: 0,
3969
+ startx: o.x,
3970
+ stopx: 0,
3971
+ starty: 0,
3972
+ stopy: 0,
3973
+ message: e.message
3974
+ };
3975
+ return e.placement === i.db.PLACEMENT.RIGHTOF ? (m.width = d ? common_default.getMax(conf.width, f.width) : common_default.getMax(o.width / 2 + s.width / 2, f.width + 2 * conf.noteMargin), m.startx = c + (o.width + conf.actorMargin) / 2) : e.placement === i.db.PLACEMENT.LEFTOF ? (m.width = d ? common_default.getMax(conf.width, f.width + 2 * conf.noteMargin) : common_default.getMax(o.width / 2 + s.width / 2, f.width + 2 * conf.noteMargin), m.startx = c - m.width + (o.width - conf.actorMargin) / 2) : e.to === e.from ? (f = utils_default.calculateTextDimensions(d ? utils_default.wrapLabel(e.message, common_default.getMax(conf.width, o.width), noteFont(conf)) : e.message, noteFont(conf)), m.width = d ? common_default.getMax(conf.width, o.width) : common_default.getMax(o.width, conf.width, f.width + 2 * conf.noteMargin), m.startx = c + (o.width - m.width) / 2) : (m.width = Math.abs(c + o.width / 2 - (l + s.width / 2)) + conf.actorMargin, m.startx = c < l ? c + o.width / 2 - conf.actorMargin / 2 : l + s.width / 2 - conf.actorMargin / 2), d && (m.message = utils_default.wrapLabel(e.message, m.width - 2 * conf.wrapPadding, noteFont(conf))), log.debug(`NM:[${m.startx},${m.stopx},${m.starty},${m.stopy}:${m.width},${m.height}=${e.message}]`), m;
3976
+ }, "buildNoteModel"), CENTRAL_CONNECTION_BASE_OFFSET = 4, CENTRAL_CONNECTION_BIDIRECTIONAL_OFFSET = 6, hasCentralConnection = /* @__PURE__ */ __name(function(e, t) {
3977
+ let { CENTRAL_CONNECTION: n, CENTRAL_CONNECTION_REVERSE: r, CENTRAL_CONNECTION_DUAL: i } = t.db.LINETYPE;
3978
+ return [
3979
+ n,
3980
+ r,
3981
+ i
3982
+ ].includes(e.centralConnection);
3983
+ }, "hasCentralConnection"), calculateCentralConnectionOffset = /* @__PURE__ */ __name(function(e, t, n) {
3984
+ let { CENTRAL_CONNECTION_REVERSE: r, CENTRAL_CONNECTION_DUAL: i, BIDIRECTIONAL_SOLID: a, BIDIRECTIONAL_DOTTED: o } = t.db.LINETYPE, s = 0;
3985
+ return (e.centralConnection === r || e.centralConnection === i) && (s += CENTRAL_CONNECTION_BASE_OFFSET), (e.centralConnection === r || e.centralConnection === i) && (e.type === a || e.type === o) && (s += n ? 0 : -CENTRAL_CONNECTION_BIDIRECTIONAL_OFFSET), s;
3986
+ }, "calculateCentralConnectionOffset"), isReverseArrowType = /* @__PURE__ */ __name(function(e, t) {
3987
+ let { SOLID_ARROW_TOP_REVERSE: n, SOLID_ARROW_TOP_REVERSE_DOTTED: r, SOLID_ARROW_BOTTOM_REVERSE: i, SOLID_ARROW_BOTTOM_REVERSE_DOTTED: a, STICK_ARROW_TOP_REVERSE: o, STICK_ARROW_TOP_REVERSE_DOTTED: s, STICK_ARROW_BOTTOM_REVERSE: c, STICK_ARROW_BOTTOM_REVERSE_DOTTED: l } = t.db.LINETYPE;
3988
+ return [
3989
+ n,
3990
+ r,
3991
+ i,
3992
+ a,
3993
+ o,
3994
+ s,
3995
+ c,
3996
+ l
3997
+ ].includes(e.type);
3998
+ }, "isReverseArrowType"), isBidirectionalArrowType = /* @__PURE__ */ __name(function(e, t) {
3999
+ let { BIDIRECTIONAL_SOLID: n, BIDIRECTIONAL_DOTTED: r } = t.db.LINETYPE;
4000
+ return [n, r].includes(e.type);
4001
+ }, "isBidirectionalArrowType"), buildMessageModel = /* @__PURE__ */ __name(function(t, n, r) {
4002
+ let { look: i } = getConfig2();
4003
+ if (![
4004
+ r.db.LINETYPE.SOLID_OPEN,
4005
+ r.db.LINETYPE.DOTTED_OPEN,
4006
+ r.db.LINETYPE.SOLID,
4007
+ r.db.LINETYPE.SOLID_TOP,
4008
+ r.db.LINETYPE.SOLID_BOTTOM,
4009
+ r.db.LINETYPE.STICK_TOP,
4010
+ r.db.LINETYPE.STICK_BOTTOM,
4011
+ r.db.LINETYPE.SOLID_TOP_DOTTED,
4012
+ r.db.LINETYPE.SOLID_BOTTOM_DOTTED,
4013
+ r.db.LINETYPE.STICK_TOP_DOTTED,
4014
+ r.db.LINETYPE.STICK_BOTTOM_DOTTED,
4015
+ r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,
4016
+ r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,
4017
+ r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,
4018
+ r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,
4019
+ r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,
4020
+ r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,
4021
+ r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,
4022
+ r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,
4023
+ r.db.LINETYPE.DOTTED,
4024
+ r.db.LINETYPE.SOLID_CROSS,
4025
+ r.db.LINETYPE.DOTTED_CROSS,
4026
+ r.db.LINETYPE.SOLID_POINT,
4027
+ r.db.LINETYPE.DOTTED_POINT,
4028
+ r.db.LINETYPE.BIDIRECTIONAL_SOLID,
4029
+ r.db.LINETYPE.BIDIRECTIONAL_DOTTED
4030
+ ].includes(t.type)) return {};
4031
+ let [o, s] = activationBounds(t.from, n), [c, l] = activationBounds(t.to, n), d = o <= c, f = d ? s : o, p = d ? c : l;
4032
+ i === "neo" && (t.type !== r.db.LINETYPE.SOLID_OPEN && (p += d ? -3 : 3), (t.type === r.db.LINETYPE.BIDIRECTIONAL_SOLID || t.type === r.db.LINETYPE.BIDIRECTIONAL_DOTTED) && (f += d ? 3 : -3)), f += calculateCentralConnectionOffset(t, r, d);
4033
+ let m = Math.abs(c - l) > 2, h = /* @__PURE__ */ __name((e) => d ? -e : e, "adjustValue");
4034
+ t.from === t.to ? p = f : (t.activate && !m && (p += h(conf.activationWidth / 2 - 1)), [
4035
+ r.db.LINETYPE.SOLID_OPEN,
4036
+ r.db.LINETYPE.DOTTED_OPEN,
4037
+ r.db.LINETYPE.STICK_TOP,
4038
+ r.db.LINETYPE.STICK_BOTTOM,
4039
+ r.db.LINETYPE.STICK_TOP_DOTTED,
4040
+ r.db.LINETYPE.STICK_BOTTOM_DOTTED,
4041
+ r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,
4042
+ r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,
4043
+ r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,
4044
+ r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,
4045
+ r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,
4046
+ r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,
4047
+ r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,
4048
+ r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE
4049
+ ].includes(t.type) || (p += h(3)), [
4050
+ r.db.LINETYPE.BIDIRECTIONAL_SOLID,
4051
+ r.db.LINETYPE.BIDIRECTIONAL_DOTTED,
4052
+ r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,
4053
+ r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,
4054
+ r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,
4055
+ r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE
4056
+ ].includes(t.type) && (f -= h(3)));
4057
+ let g = [
4058
+ o,
4059
+ s,
4060
+ c,
4061
+ l
4062
+ ], _ = Math.abs(f - p);
4063
+ t.wrap && t.message && (t.message = utils_default.wrapLabel(t.message, common_default.getMax(_ + 2 * conf.wrapPadding, conf.width), messageFont(conf)));
4064
+ let v = utils_default.calculateTextDimensions(t.message, messageFont(conf));
4065
+ return {
4066
+ width: common_default.getMax(t.wrap ? 0 : v.width + 2 * conf.wrapPadding, _ + 2 * conf.wrapPadding, conf.width),
4067
+ height: 0,
4068
+ startx: f,
4069
+ stopx: p,
4070
+ starty: 0,
4071
+ stopy: 0,
4072
+ message: t.message,
4073
+ type: t.type,
4074
+ wrap: t.wrap,
4075
+ fromBounds: Math.min.apply(null, g),
4076
+ toBounds: Math.max.apply(null, g)
4077
+ };
4078
+ }, "buildMessageModel"), calculateLoopBounds = /* @__PURE__ */ __name(async function(e, n, r, i) {
4079
+ let o = {}, s = [], c, l, u;
4080
+ for (let t of e) {
4081
+ switch (t.type) {
4082
+ case i.db.LINETYPE.LOOP_START:
4083
+ case i.db.LINETYPE.ALT_START:
4084
+ case i.db.LINETYPE.OPT_START:
4085
+ case i.db.LINETYPE.PAR_START:
4086
+ case i.db.LINETYPE.PAR_OVER_START:
4087
+ case i.db.LINETYPE.CRITICAL_START:
4088
+ case i.db.LINETYPE.BREAK_START:
4089
+ s.push({
4090
+ id: t.id,
4091
+ msg: t.message,
4092
+ from: 2 ** 53 - 1,
4093
+ to: -(2 ** 53 - 1),
4094
+ width: 0
4095
+ });
4096
+ break;
4097
+ case i.db.LINETYPE.ALT_ELSE:
4098
+ case i.db.LINETYPE.PAR_AND:
4099
+ case i.db.LINETYPE.CRITICAL_OPTION:
4100
+ t.message && (c = s.pop(), o[c.id] = c, o[t.id] = c, s.push(c));
4101
+ break;
4102
+ case i.db.LINETYPE.LOOP_END:
4103
+ case i.db.LINETYPE.ALT_END:
4104
+ case i.db.LINETYPE.OPT_END:
4105
+ case i.db.LINETYPE.PAR_END:
4106
+ case i.db.LINETYPE.CRITICAL_END:
4107
+ case i.db.LINETYPE.BREAK_END:
4108
+ c = s.pop(), o[c.id] = c;
4109
+ break;
4110
+ case i.db.LINETYPE.ACTIVE_START:
4111
+ {
4112
+ let e = n.get(t.from ? t.from : t.to.actor), r = actorActivations(t.from ? t.from : t.to.actor).length, i = e.x + e.width / 2 + (r - 1) * conf.activationWidth / 2, a = {
4113
+ startx: i,
4114
+ stopx: i + conf.activationWidth,
4115
+ actor: t.from,
4116
+ enabled: !0
4117
+ };
4118
+ bounds.activations.push(a);
4119
+ }
4120
+ break;
4121
+ case i.db.LINETYPE.ACTIVE_END:
4122
+ {
4123
+ let e = bounds.activations.map((e) => e.actor).lastIndexOf(t.from);
4124
+ bounds.activations.splice(e, 1).splice(0, 1);
4125
+ }
4126
+ break;
4127
+ }
4128
+ t.placement === void 0 ? (u = buildMessageModel(t, n, i), t.msgModel = u, u.startx && u.stopx && s.length > 0 && s.forEach((e) => {
4129
+ if (c = e, u.startx === u.stopx) {
4130
+ let e = n.get(t.from), r = n.get(t.to);
4131
+ c.from = common_default.getMin(e.x - u.width / 2, e.x - e.width / 2, c.from), c.to = common_default.getMax(r.x + u.width / 2, r.x + e.width / 2, c.to), c.width = common_default.getMax(c.width, Math.abs(c.to - c.from)) - conf.labelBoxWidth;
4132
+ } else c.from = common_default.getMin(u.startx, c.from), c.to = common_default.getMax(u.stopx, c.to), c.width = common_default.getMax(c.width, u.width) - conf.labelBoxWidth;
4133
+ })) : (l = await buildNoteModel(t, n, i), t.noteModel = l, s.forEach((e) => {
4134
+ c = e, c.from = common_default.getMin(c.from, l.startx), c.to = common_default.getMax(c.to, l.startx + l.width), c.width = common_default.getMax(c.width, Math.abs(c.from - c.to)) - conf.labelBoxWidth;
4135
+ }));
4136
+ }
4137
+ return bounds.activations = [], log.debug("Loop type widths:", o), o;
4138
+ }, "calculateLoopBounds"), diagram = {
4139
+ parser: sequenceDiagram_default,
4140
+ get db() {
4141
+ return new SequenceDB();
4142
+ },
4143
+ renderer: {
4144
+ bounds,
4145
+ drawActors,
4146
+ drawActorsPopup,
4147
+ setConf,
4148
+ draw
4149
+ },
4150
+ styles: styles_default,
4151
+ init: /* @__PURE__ */ __name((e) => {
4152
+ e.sequence ||= {}, e.wrap && (e.sequence.wrap = e.wrap, setConfig2({ sequence: { wrap: e.wrap } }));
4153
+ }, "init")
4154
+ };
4155
+ export { diagram };