@altimateai/ui-components 0.0.77-beta.4 → 0.0.77-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (405) hide show
  1. package/dist/CoachForm.css +1 -1
  2. package/dist/CoachForm.js +62488 -24049
  3. package/dist/DbtDocsRenderer.js +1 -1
  4. package/dist/Stack.js +2826 -2276
  5. package/dist/Switch.js +128 -87
  6. package/dist/ToggleGroup.js +5956 -4781
  7. package/dist/_basePickBy.js +60 -60
  8. package/dist/_baseUniq.js +152 -152
  9. package/dist/abap.js +6 -0
  10. package/dist/actionscript-3.js +6 -0
  11. package/dist/ada.js +6 -0
  12. package/dist/andromeeda.js +4 -0
  13. package/dist/angular-html.js +32 -0
  14. package/dist/angular-ts.js +21 -0
  15. package/dist/apache.js +6 -0
  16. package/dist/apex.js +6 -0
  17. package/dist/apl.js +16 -0
  18. package/dist/applescript.js +6 -0
  19. package/dist/ara.js +6 -0
  20. package/dist/arc.js +53 -53
  21. package/dist/architectureDiagram-VXUJARFQ.js +480 -4315
  22. package/dist/architectureDiagram-VXUJARFQ2.js +831 -0
  23. package/dist/asciidoc.js +6 -0
  24. package/dist/asm.js +6 -0
  25. package/dist/assets/icons/index.js +1 -1
  26. package/dist/astro.js +18 -0
  27. package/dist/aurora-x.js +4 -0
  28. package/dist/awk.js +6 -0
  29. package/dist/ayu-dark.js +4 -0
  30. package/dist/ballerina.js +6 -0
  31. package/dist/band.js +46 -0
  32. package/dist/bat.js +6 -0
  33. package/dist/beancount.js +6 -0
  34. package/dist/berry.js +6 -0
  35. package/dist/bibtex.js +6 -0
  36. package/dist/bicep.js +6 -0
  37. package/dist/blade.js +20 -0
  38. package/dist/blockDiagram-VD42YOAC.js +1 -1
  39. package/dist/blockDiagram-VD42YOAC2.js +2266 -0
  40. package/dist/bsl.js +8 -0
  41. package/dist/c.js +6 -0
  42. package/dist/c3.js +6 -0
  43. package/dist/c4Diagram-YG6GDRKO.js +22 -22
  44. package/dist/c4Diagram-YG6GDRKO2.js +1582 -0
  45. package/dist/cadence.js +6 -0
  46. package/dist/cairo.js +8 -0
  47. package/dist/catppuccin-frappe.js +4 -0
  48. package/dist/catppuccin-latte.js +4 -0
  49. package/dist/catppuccin-macchiato.js +4 -0
  50. package/dist/catppuccin-mocha.js +4 -0
  51. package/dist/channel.js +2 -2
  52. package/dist/chatbotV2/index.d.ts +57 -19
  53. package/dist/chatbotV2/index.js +120 -56
  54. package/dist/chunk-4BX2VUAB.js +1 -1
  55. package/dist/chunk-4BX2VUAB2.js +9 -0
  56. package/dist/chunk-55IACEB6.js +2 -2
  57. package/dist/chunk-55IACEB62.js +9 -0
  58. package/dist/chunk-B4BG7PRW.js +1 -1
  59. package/dist/chunk-B4BG7PRW2.js +1377 -0
  60. package/dist/chunk-DI55MBZ5.js +14 -14
  61. package/dist/chunk-DI55MBZ52.js +1382 -0
  62. package/dist/chunk-FMBD7UC4.js +1 -1
  63. package/dist/chunk-FMBD7UC42.js +19 -0
  64. package/dist/chunk-QN33PNHL.js +5 -5
  65. package/dist/chunk-QN33PNHL2.js +20 -0
  66. package/dist/chunk-QZHKN3VN.js +1 -1
  67. package/dist/chunk-QZHKN3VN2.js +15 -0
  68. package/dist/chunk-TZMSLE5B.js +1 -1
  69. package/dist/chunk-TZMSLE5B2.js +64 -0
  70. package/dist/clarity.js +6 -0
  71. package/dist/classDiagram-2ON5EDUG.js +1 -1
  72. package/dist/classDiagram-2ON5EDUG2.js +17 -0
  73. package/dist/classDiagram-v2-WZHVMYZB.js +1 -1
  74. package/dist/classDiagram-v2-WZHVMYZB2.js +17 -0
  75. package/dist/clojure.js +6 -0
  76. package/dist/cmake.js +6 -0
  77. package/dist/cobol.js +10 -0
  78. package/dist/code-block-37QAKDTI.js +27 -0
  79. package/dist/codeowners.js +6 -0
  80. package/dist/codeql.js +6 -0
  81. package/dist/coffee.js +8 -0
  82. package/dist/common-lisp.js +6 -0
  83. package/dist/coq.js +6 -0
  84. package/dist/cose-bilkent-S5V4N54A.js +160 -2535
  85. package/dist/cose-bilkent-S5V4N54A2.js +231 -0
  86. package/dist/cpp.js +18 -0
  87. package/dist/crystal.js +18 -0
  88. package/dist/csharp.js +6 -0
  89. package/dist/css.js +6 -0
  90. package/dist/csv.js +6 -0
  91. package/dist/cue.js +6 -0
  92. package/dist/cypher.js +6 -0
  93. package/dist/cytoscape-cose-bilkent.js +2380 -0
  94. package/dist/cytoscape-fcose.js +3840 -0
  95. package/dist/d.js +6 -0
  96. package/dist/dagre-6UL2VRFP.js +44 -44
  97. package/dist/dagre-6UL2VRFP2.js +447 -0
  98. package/dist/dark-plus.js +4 -0
  99. package/dist/dart.js +6 -0
  100. package/dist/dax.js +6 -0
  101. package/dist/dayjs.min.js +2 -2
  102. package/dist/defaultLocale.js +3 -3
  103. package/dist/desktop.js +6 -0
  104. package/dist/diagram-PSM6KHXK.js +198 -414
  105. package/dist/diagram-PSM6KHXK2.js +319 -0
  106. package/dist/diagram-QEK2KX5R.js +26 -26
  107. package/dist/diagram-QEK2KX5R2.js +221 -0
  108. package/dist/diagram-S2PKOQOG.js +12 -12
  109. package/dist/diagram-S2PKOQOG2.js +143 -0
  110. package/dist/diff.js +6 -0
  111. package/dist/docker.js +6 -0
  112. package/dist/dotenv.js +6 -0
  113. package/dist/dracula-soft.js +4 -0
  114. package/dist/dracula.js +4 -0
  115. package/dist/dream-maker.js +6 -0
  116. package/dist/edge.js +12 -0
  117. package/dist/elixir.js +8 -0
  118. package/dist/elm.js +8 -0
  119. package/dist/emacs-lisp.js +6 -0
  120. package/dist/erDiagram-Q2GNP2WA.js +1 -1
  121. package/dist/erDiagram-Q2GNP2WA2.js +843 -0
  122. package/dist/erb.js +10 -0
  123. package/dist/erlang.js +8 -0
  124. package/dist/everforest-dark.js +4 -0
  125. package/dist/everforest-light.js +4 -0
  126. package/dist/fennel.js +6 -0
  127. package/dist/fish.js +6 -0
  128. package/dist/flowDiagram-NV44I4VS.js +6 -6
  129. package/dist/flowDiagram-NV44I4VS2.js +1628 -0
  130. package/dist/fluent.js +6 -0
  131. package/dist/fortran-fixed-form.js +8 -0
  132. package/dist/fortran-free-form.js +6 -0
  133. package/dist/fsharp.js +8 -0
  134. package/dist/ganttDiagram-JELNMOA3.js +1788 -0
  135. package/dist/ganttDiagram-LVOFAZNH.js +843 -1718
  136. package/dist/gdresource.js +10 -0
  137. package/dist/gdscript.js +6 -0
  138. package/dist/gdshader.js +6 -0
  139. package/dist/genie.js +6 -0
  140. package/dist/gherkin.js +6 -0
  141. package/dist/git-commit.js +8 -0
  142. package/dist/git-rebase.js +8 -0
  143. package/dist/gitGraphDiagram-NY62KEGX.js +13 -13
  144. package/dist/gitGraphDiagram-NY62KEGX2.js +713 -0
  145. package/dist/github-dark-default.js +4 -0
  146. package/dist/github-dark-dimmed.js +4 -0
  147. package/dist/github-dark-high-contrast.js +4 -0
  148. package/dist/github-dark.js +4 -0
  149. package/dist/github-light-default.js +4 -0
  150. package/dist/github-light-high-contrast.js +4 -0
  151. package/dist/github-light.js +4 -0
  152. package/dist/gleam.js +6 -0
  153. package/dist/glimmer-js.js +14 -0
  154. package/dist/glimmer-ts.js +14 -0
  155. package/dist/glsl.js +8 -0
  156. package/dist/gn.js +6 -0
  157. package/dist/gnuplot.js +6 -0
  158. package/dist/go.js +6 -0
  159. package/dist/graph.js +17 -18
  160. package/dist/graph2.js +246 -0
  161. package/dist/graphql.js +14 -0
  162. package/dist/groovy.js +6 -0
  163. package/dist/gruvbox-dark-hard.js +4 -0
  164. package/dist/gruvbox-dark-medium.js +4 -0
  165. package/dist/gruvbox-dark-soft.js +4 -0
  166. package/dist/gruvbox-light-hard.js +4 -0
  167. package/dist/gruvbox-light-medium.js +4 -0
  168. package/dist/gruvbox-light-soft.js +4 -0
  169. package/dist/hack.js +10 -0
  170. package/dist/haml.js +10 -0
  171. package/dist/handlebars.js +14 -0
  172. package/dist/haskell.js +6 -0
  173. package/dist/haxe.js +6 -0
  174. package/dist/hcl.js +6 -0
  175. package/dist/hjson.js +6 -0
  176. package/dist/hlsl.js +6 -0
  177. package/dist/houston.js +4 -0
  178. package/dist/html-derivative.js +8 -0
  179. package/dist/html.js +10 -0
  180. package/dist/http.js +14 -0
  181. package/dist/hurl.js +12 -0
  182. package/dist/hxml.js +8 -0
  183. package/dist/hy.js +6 -0
  184. package/dist/imba.js +6 -0
  185. package/dist/index.d.ts +2 -2
  186. package/dist/index.js +37 -37
  187. package/dist/index2.js +216 -684
  188. package/dist/index3.js +689 -0
  189. package/dist/infoDiagram-F6ZHWCRC.js +14 -14
  190. package/dist/infoDiagram-WHAUD3N6.js +24 -0
  191. package/dist/ini.js +6 -0
  192. package/dist/java.js +6 -0
  193. package/dist/javascript.js +6 -0
  194. package/dist/jinja.js +11 -0
  195. package/dist/jison.js +8 -0
  196. package/dist/journeyDiagram-XKPGCS4Q.js +1 -1
  197. package/dist/journeyDiagram-XKPGCS4Q2.js +837 -0
  198. package/dist/json.js +6 -0
  199. package/dist/json5.js +6 -0
  200. package/dist/jsonc.js +6 -0
  201. package/dist/jsonl.js +6 -0
  202. package/dist/jsonnet.js +6 -0
  203. package/dist/jssm.js +6 -0
  204. package/dist/jsx.js +6 -0
  205. package/dist/julia.js +16 -0
  206. package/dist/kanagawa-dragon.js +4 -0
  207. package/dist/kanagawa-lotus.js +4 -0
  208. package/dist/kanagawa-wave.js +4 -0
  209. package/dist/kanban-definition-3W4ZIXB7.js +42 -42
  210. package/dist/kanban-definition-3W4ZIXB72.js +720 -0
  211. package/dist/katex2.js +11691 -0
  212. package/dist/kdl.js +6 -0
  213. package/dist/kotlin.js +6 -0
  214. package/dist/kusto.js +6 -0
  215. package/dist/laserwave.js +4 -0
  216. package/dist/latex.js +8 -0
  217. package/dist/layout.js +567 -678
  218. package/dist/layout2.js +1224 -0
  219. package/dist/lean.js +6 -0
  220. package/dist/less.js +6 -0
  221. package/dist/light-plus.js +4 -0
  222. package/dist/lineage/index.js +1234 -1241
  223. package/dist/linear.js +1 -1
  224. package/dist/liquid.js +14 -0
  225. package/dist/llvm.js +6 -0
  226. package/dist/log.js +6 -0
  227. package/dist/logo.js +6 -0
  228. package/dist/lua.js +8 -0
  229. package/dist/luau.js +6 -0
  230. package/dist/main.css +1 -1
  231. package/dist/main.js +82 -82
  232. package/dist/make.js +6 -0
  233. package/dist/markdown.js +6 -0
  234. package/dist/marko.js +14 -0
  235. package/dist/material-theme-darker.js +4 -0
  236. package/dist/material-theme-lighter.js +4 -0
  237. package/dist/material-theme-ocean.js +4 -0
  238. package/dist/material-theme-palenight.js +4 -0
  239. package/dist/material-theme.js +4 -0
  240. package/dist/matlab.js +6 -0
  241. package/dist/mdc.js +12 -0
  242. package/dist/mdx.js +6 -0
  243. package/dist/mermaid-4DMBBIKO.js +4 -0
  244. package/dist/mermaid-parser.core.js +155 -155
  245. package/dist/mermaid.js +6 -0
  246. package/dist/min-dark.js +4 -0
  247. package/dist/min-light.js +4 -0
  248. package/dist/mindmap-definition-VGOIOE7T.js +28 -28
  249. package/dist/mindmap-definition-VGOIOE7T2.js +786 -0
  250. package/dist/mipsasm.js +6 -0
  251. package/dist/mojo.js +6 -0
  252. package/dist/monokai.js +4 -0
  253. package/dist/moonbit.js +6 -0
  254. package/dist/move.js +6 -0
  255. package/dist/narrat.js +6 -0
  256. package/dist/nextflow.js +6 -0
  257. package/dist/nginx.js +8 -0
  258. package/dist/night-owl.js +4 -0
  259. package/dist/nim.js +20 -0
  260. package/dist/nix.js +9 -0
  261. package/dist/nord.js +4 -0
  262. package/dist/nushell.js +6 -0
  263. package/dist/objective-c.js +6 -0
  264. package/dist/objective-cpp.js +6 -0
  265. package/dist/ocaml.js +6 -0
  266. package/dist/one-dark-pro.js +4 -0
  267. package/dist/one-light.js +4 -0
  268. package/dist/openscad.js +6 -0
  269. package/dist/pascal.js +6 -0
  270. package/dist/perl.js +16 -0
  271. package/dist/php.js +18 -0
  272. package/dist/pie.js +45 -0
  273. package/dist/pieDiagram-ADFJNKIX.js +68 -108
  274. package/dist/pieDiagram-ADFJNKIX2.js +123 -0
  275. package/dist/pkl.js +6 -0
  276. package/dist/plastic.js +4 -0
  277. package/dist/plsql.js +6 -0
  278. package/dist/po.js +6 -0
  279. package/dist/poimandres.js +4 -0
  280. package/dist/polar.js +6 -0
  281. package/dist/postcss.js +6 -0
  282. package/dist/powerquery.js +6 -0
  283. package/dist/powershell.js +6 -0
  284. package/dist/prisma.js +6 -0
  285. package/dist/prolog.js +6 -0
  286. package/dist/proto.js +6 -0
  287. package/dist/pug.js +12 -0
  288. package/dist/puppet.js +6 -0
  289. package/dist/purescript.js +6 -0
  290. package/dist/python.js +6 -0
  291. package/dist/qml.js +8 -0
  292. package/dist/qmldir.js +6 -0
  293. package/dist/qss.js +6 -0
  294. package/dist/quadrantDiagram-AYHSOK5B.js +1 -1
  295. package/dist/quadrantDiagram-AYHSOK5B2.js +1025 -0
  296. package/dist/r.js +6 -0
  297. package/dist/racket.js +6 -0
  298. package/dist/raku.js +6 -0
  299. package/dist/razor.js +10 -0
  300. package/dist/red.js +4 -0
  301. package/dist/redux-toolkit.modern.js +563 -555
  302. package/dist/reg.js +6 -0
  303. package/dist/regexp.js +6 -0
  304. package/dist/rel.js +6 -0
  305. package/dist/requirementDiagram-UZGBJVZJ.js +14 -14
  306. package/dist/requirementDiagram-UZGBJVZJ2.js +852 -0
  307. package/dist/riscv.js +6 -0
  308. package/dist/rose-pine-dawn.js +4 -0
  309. package/dist/rose-pine-moon.js +4 -0
  310. package/dist/rose-pine.js +4 -0
  311. package/dist/rosmsg.js +6 -0
  312. package/dist/rst.js +22 -0
  313. package/dist/ruby.js +30 -0
  314. package/dist/rust.js +6 -0
  315. package/dist/sankeyDiagram-TZEHDZUN.js +229 -622
  316. package/dist/sankeyDiagram-TZEHDZUN2.js +418 -0
  317. package/dist/sankeyLinkHorizontal.js +403 -0
  318. package/dist/sas.js +8 -0
  319. package/dist/sass.js +6 -0
  320. package/dist/scala.js +6 -0
  321. package/dist/scheme.js +6 -0
  322. package/dist/scss.js +8 -0
  323. package/dist/sdbl.js +6 -0
  324. package/dist/sequenceDiagram-WL72ISMW.js +1 -1
  325. package/dist/sequenceDiagram-WL72ISMW2.js +2523 -0
  326. package/dist/shadcn/index.d.ts +24 -40
  327. package/dist/shadcn/index.js +7330 -5516
  328. package/dist/shaderlab.js +8 -0
  329. package/dist/shellscript.js +6 -0
  330. package/dist/shellsession.js +8 -0
  331. package/dist/slack-dark.js +4 -0
  332. package/dist/slack-ochin.js +4 -0
  333. package/dist/smalltalk.js +6 -0
  334. package/dist/snazzy-light.js +4 -0
  335. package/dist/solarized-dark.js +4 -0
  336. package/dist/solarized-light.js +4 -0
  337. package/dist/solidity.js +6 -0
  338. package/dist/soy.js +8 -0
  339. package/dist/sparql.js +8 -0
  340. package/dist/splunk.js +6 -0
  341. package/dist/sql.js +6 -0
  342. package/dist/ssh-config.js +6 -0
  343. package/dist/stata.js +8 -0
  344. package/dist/stateDiagram-FKZM4ZOC.js +33 -33
  345. package/dist/stateDiagram-FKZM4ZOC2.js +264 -0
  346. package/dist/stateDiagram-v2-4FDKWEC3.js +6 -6
  347. package/dist/stateDiagram-v2-4FDKWEC32.js +17 -0
  348. package/dist/storybook/Typography.stories.tsx +93 -120
  349. package/dist/stylus.js +6 -0
  350. package/dist/svelte.js +14 -0
  351. package/dist/swift.js +6 -0
  352. package/dist/synthwave-84.js +4 -0
  353. package/dist/system-verilog.js +6 -0
  354. package/dist/systemd.js +6 -0
  355. package/dist/talonscript.js +6 -0
  356. package/dist/tasl.js +6 -0
  357. package/dist/tcl.js +6 -0
  358. package/dist/templ.js +12 -0
  359. package/dist/terraform.js +6 -0
  360. package/dist/tex.js +8 -0
  361. package/dist/time.js +900 -0
  362. package/dist/timeline-definition-IT6M3QCI.js +63 -63
  363. package/dist/timeline-definition-IT6M3QCI2.js +802 -0
  364. package/dist/tokyo-night.js +4 -0
  365. package/dist/toml.js +6 -0
  366. package/dist/ts-tags.js +41 -0
  367. package/dist/tsv.js +6 -0
  368. package/dist/tsx.js +6 -0
  369. package/dist/turtle.js +6 -0
  370. package/dist/twig.js +18 -0
  371. package/dist/{types-ByRPUpXR.d.ts → types-BZH4Xw79.d.ts} +1 -1
  372. package/dist/typescript.js +6 -0
  373. package/dist/typespec.js +6 -0
  374. package/dist/typst.js +6 -0
  375. package/dist/union.js +8 -0
  376. package/dist/v.js +6 -0
  377. package/dist/vala.js +6 -0
  378. package/dist/vb.js +6 -0
  379. package/dist/verilog.js +6 -0
  380. package/dist/vesper.js +4 -0
  381. package/dist/vhdl.js +6 -0
  382. package/dist/viml.js +6 -0
  383. package/dist/vitesse-black.js +4 -0
  384. package/dist/vitesse-dark.js +4 -0
  385. package/dist/vitesse-light.js +4 -0
  386. package/dist/vue-html.js +8 -0
  387. package/dist/vue-vine.js +18 -0
  388. package/dist/vue.js +31 -0
  389. package/dist/vyper.js +6 -0
  390. package/dist/wasm.js +6 -0
  391. package/dist/wasm2.js +7 -0
  392. package/dist/wenyan.js +6 -0
  393. package/dist/wgsl.js +6 -0
  394. package/dist/wikitext.js +6 -0
  395. package/dist/wit.js +6 -0
  396. package/dist/wolfram.js +6 -0
  397. package/dist/xml.js +8 -0
  398. package/dist/xsl.js +8 -0
  399. package/dist/xychartDiagram-PRI3JC2R.js +449 -491
  400. package/dist/xychartDiagram-PRI3JC2R2.js +1299 -0
  401. package/dist/yaml.js +6 -0
  402. package/dist/zenscript.js +6 -0
  403. package/dist/zig.js +6 -0
  404. package/dist/zipObject.js +128 -0
  405. package/package.json +1 -1
@@ -0,0 +1,2523 @@
1
+ import { g as ct, a as Xt, d as we, b as ve, c as Jt, e as Qt } from "./chunk-TZMSLE5B2.js";
2
+ import { aG as f, aI as se, aL as Ie, aV as Le, aJ as Ae, aK as _e, aW as ke, aM as st, aX as Pe, aY as Ne, b0 as Se, aS as Q, aR as St, b2 as Me, aO as I, bg as z, bh as At, a$ as F, aH as Re, aT as De, k as re, bi as Ce, bj as ie, b8 as Ht, bd as ne, bk as Oe } from "./CoachForm.js";
3
+ import { I as Be } from "./chunk-QZHKN3VN2.js";
4
+ import { s as Mt } from "./redux-toolkit.modern.js";
5
+ var Ut = function() {
6
+ var e = /* @__PURE__ */ f(function(pt, v, _, L) {
7
+ for (_ = _ || {}, L = pt.length; L--; _[pt[L]] = v) ;
8
+ return _;
9
+ }, "o"), t = [1, 2], n = [1, 3], s = [1, 4], r = [2, 4], i = [1, 9], c = [1, 11], h = [1, 13], o = [1, 14], a = [1, 16], p = [1, 17], g = [1, 18], x = [1, 24], T = [1, 25], b = [1, 26], w = [1, 27], k = [1, 28], N = [1, 29], S = [1, 30], M = [1, 31], C = [1, 32], Y = [1, 33], H = [1, 34], Z = [1, 35], at = [1, 36], U = [1, 37], G = [1, 38], q = [1, 39], O = [1, 41], $ = [1, 42], K = [1, 43], j = [1, 44], rt = [1, 45], D = [1, 46], E = [1, 4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 47, 48, 49, 50, 52, 53, 55, 60, 61, 62, 63, 71], A = [2, 71], X = [4, 5, 16, 50, 52, 53], tt = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 55, 60, 61, 62, 63, 71], R = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 49, 50, 52, 53, 55, 60, 61, 62, 63, 71], Vt = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 48, 50, 52, 53, 55, 60, 61, 62, 63, 71], Zt = [4, 5, 13, 14, 16, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 47, 50, 52, 53, 55, 60, 61, 62, 63, 71], ot = [69, 70, 71], lt = [1, 127], Yt = {
10
+ trace: /* @__PURE__ */ f(function() {
11
+ }, "trace"),
12
+ yy: {},
13
+ symbols_: { error: 2, start: 3, SPACE: 4, NEWLINE: 5, SD: 6, document: 7, line: 8, statement: 9, box_section: 10, box_line: 11, participant_statement: 12, create: 13, box: 14, restOfLine: 15, end: 16, signal: 17, autonumber: 18, NUM: 19, off: 20, activate: 21, actor: 22, deactivate: 23, note_statement: 24, links_statement: 25, link_statement: 26, properties_statement: 27, details_statement: 28, title: 29, legacy_title: 30, acc_title: 31, acc_title_value: 32, acc_descr: 33, acc_descr_value: 34, acc_descr_multiline_value: 35, loop: 36, rect: 37, opt: 38, alt: 39, else_sections: 40, par: 41, par_sections: 42, par_over: 43, critical: 44, option_sections: 45, break: 46, option: 47, and: 48, else: 49, participant: 50, AS: 51, participant_actor: 52, destroy: 53, actor_with_config: 54, note: 55, placement: 56, text2: 57, over: 58, actor_pair: 59, links: 60, link: 61, properties: 62, details: 63, spaceList: 64, ",": 65, left_of: 66, right_of: 67, signaltype: 68, "+": 69, "-": 70, ACTOR: 71, config_object: 72, CONFIG_START: 73, CONFIG_CONTENT: 74, CONFIG_END: 75, SOLID_OPEN_ARROW: 76, DOTTED_OPEN_ARROW: 77, SOLID_ARROW: 78, BIDIRECTIONAL_SOLID_ARROW: 79, DOTTED_ARROW: 80, BIDIRECTIONAL_DOTTED_ARROW: 81, SOLID_CROSS: 82, DOTTED_CROSS: 83, SOLID_POINT: 84, DOTTED_POINT: 85, TXT: 86, $accept: 0, $end: 1 },
14
+ terminals_: { 2: "error", 4: "SPACE", 5: "NEWLINE", 6: "SD", 13: "create", 14: "box", 15: "restOfLine", 16: "end", 18: "autonumber", 19: "NUM", 20: "off", 21: "activate", 23: "deactivate", 29: "title", 30: "legacy_title", 31: "acc_title", 32: "acc_title_value", 33: "acc_descr", 34: "acc_descr_value", 35: "acc_descr_multiline_value", 36: "loop", 37: "rect", 38: "opt", 39: "alt", 41: "par", 43: "par_over", 44: "critical", 46: "break", 47: "option", 48: "and", 49: "else", 50: "participant", 51: "AS", 52: "participant_actor", 53: "destroy", 55: "note", 58: "over", 60: "links", 61: "link", 62: "properties", 63: "details", 65: ",", 66: "left_of", 67: "right_of", 69: "+", 70: "-", 71: "ACTOR", 73: "CONFIG_START", 74: "CONFIG_CONTENT", 75: "CONFIG_END", 76: "SOLID_OPEN_ARROW", 77: "DOTTED_OPEN_ARROW", 78: "SOLID_ARROW", 79: "BIDIRECTIONAL_SOLID_ARROW", 80: "DOTTED_ARROW", 81: "BIDIRECTIONAL_DOTTED_ARROW", 82: "SOLID_CROSS", 83: "DOTTED_CROSS", 84: "SOLID_POINT", 85: "DOTTED_POINT", 86: "TXT" },
15
+ productions_: [0, [3, 2], [3, 2], [3, 2], [7, 0], [7, 2], [8, 2], [8, 1], [8, 1], [10, 0], [10, 2], [11, 2], [11, 1], [11, 1], [9, 1], [9, 2], [9, 4], [9, 2], [9, 4], [9, 3], [9, 3], [9, 2], [9, 3], [9, 3], [9, 2], [9, 2], [9, 2], [9, 2], [9, 2], [9, 1], [9, 1], [9, 2], [9, 2], [9, 1], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [9, 4], [45, 1], [45, 4], [42, 1], [42, 4], [40, 1], [40, 4], [12, 5], [12, 3], [12, 5], [12, 3], [12, 3], [12, 3], [24, 4], [24, 4], [25, 3], [26, 3], [27, 3], [28, 3], [64, 2], [64, 1], [59, 3], [59, 1], [56, 1], [56, 1], [17, 5], [17, 5], [17, 4], [54, 2], [72, 3], [22, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [68, 1], [57, 1]],
16
+ performAction: /* @__PURE__ */ f(function(v, _, L, m, B, d, It) {
17
+ var u = d.length - 1;
18
+ switch (B) {
19
+ case 3:
20
+ return m.apply(d[u]), d[u];
21
+ case 4:
22
+ case 9:
23
+ this.$ = [];
24
+ break;
25
+ case 5:
26
+ case 10:
27
+ d[u - 1].push(d[u]), this.$ = d[u - 1];
28
+ break;
29
+ case 6:
30
+ case 7:
31
+ case 11:
32
+ case 12:
33
+ this.$ = d[u];
34
+ break;
35
+ case 8:
36
+ case 13:
37
+ this.$ = [];
38
+ break;
39
+ case 15:
40
+ d[u].type = "createParticipant", this.$ = d[u];
41
+ break;
42
+ case 16:
43
+ d[u - 1].unshift({ type: "boxStart", boxData: m.parseBoxData(d[u - 2]) }), d[u - 1].push({ type: "boxEnd", boxText: d[u - 2] }), this.$ = d[u - 1];
44
+ break;
45
+ case 18:
46
+ this.$ = { type: "sequenceIndex", sequenceIndex: Number(d[u - 2]), sequenceIndexStep: Number(d[u - 1]), sequenceVisible: !0, signalType: m.LINETYPE.AUTONUMBER };
47
+ break;
48
+ case 19:
49
+ this.$ = { type: "sequenceIndex", sequenceIndex: Number(d[u - 1]), sequenceIndexStep: 1, sequenceVisible: !0, signalType: m.LINETYPE.AUTONUMBER };
50
+ break;
51
+ case 20:
52
+ this.$ = { type: "sequenceIndex", sequenceVisible: !1, signalType: m.LINETYPE.AUTONUMBER };
53
+ break;
54
+ case 21:
55
+ this.$ = { type: "sequenceIndex", sequenceVisible: !0, signalType: m.LINETYPE.AUTONUMBER };
56
+ break;
57
+ case 22:
58
+ this.$ = { type: "activeStart", signalType: m.LINETYPE.ACTIVE_START, actor: d[u - 1].actor };
59
+ break;
60
+ case 23:
61
+ this.$ = { type: "activeEnd", signalType: m.LINETYPE.ACTIVE_END, actor: d[u - 1].actor };
62
+ break;
63
+ case 29:
64
+ m.setDiagramTitle(d[u].substring(6)), this.$ = d[u].substring(6);
65
+ break;
66
+ case 30:
67
+ m.setDiagramTitle(d[u].substring(7)), this.$ = d[u].substring(7);
68
+ break;
69
+ case 31:
70
+ this.$ = d[u].trim(), m.setAccTitle(this.$);
71
+ break;
72
+ case 32:
73
+ case 33:
74
+ this.$ = d[u].trim(), m.setAccDescription(this.$);
75
+ break;
76
+ case 34:
77
+ d[u - 1].unshift({ type: "loopStart", loopText: m.parseMessage(d[u - 2]), signalType: m.LINETYPE.LOOP_START }), d[u - 1].push({ type: "loopEnd", loopText: d[u - 2], signalType: m.LINETYPE.LOOP_END }), this.$ = d[u - 1];
78
+ break;
79
+ case 35:
80
+ d[u - 1].unshift({ type: "rectStart", color: m.parseMessage(d[u - 2]), signalType: m.LINETYPE.RECT_START }), d[u - 1].push({ type: "rectEnd", color: m.parseMessage(d[u - 2]), signalType: m.LINETYPE.RECT_END }), this.$ = d[u - 1];
81
+ break;
82
+ case 36:
83
+ d[u - 1].unshift({ type: "optStart", optText: m.parseMessage(d[u - 2]), signalType: m.LINETYPE.OPT_START }), d[u - 1].push({ type: "optEnd", optText: m.parseMessage(d[u - 2]), signalType: m.LINETYPE.OPT_END }), this.$ = d[u - 1];
84
+ break;
85
+ case 37:
86
+ d[u - 1].unshift({ type: "altStart", altText: m.parseMessage(d[u - 2]), signalType: m.LINETYPE.ALT_START }), d[u - 1].push({ type: "altEnd", signalType: m.LINETYPE.ALT_END }), this.$ = d[u - 1];
87
+ break;
88
+ case 38:
89
+ d[u - 1].unshift({ type: "parStart", parText: m.parseMessage(d[u - 2]), signalType: m.LINETYPE.PAR_START }), d[u - 1].push({ type: "parEnd", signalType: m.LINETYPE.PAR_END }), this.$ = d[u - 1];
90
+ break;
91
+ case 39:
92
+ d[u - 1].unshift({ type: "parStart", parText: m.parseMessage(d[u - 2]), signalType: m.LINETYPE.PAR_OVER_START }), d[u - 1].push({ type: "parEnd", signalType: m.LINETYPE.PAR_END }), this.$ = d[u - 1];
93
+ break;
94
+ case 40:
95
+ d[u - 1].unshift({ type: "criticalStart", criticalText: m.parseMessage(d[u - 2]), signalType: m.LINETYPE.CRITICAL_START }), d[u - 1].push({ type: "criticalEnd", signalType: m.LINETYPE.CRITICAL_END }), this.$ = d[u - 1];
96
+ break;
97
+ case 41:
98
+ d[u - 1].unshift({ type: "breakStart", breakText: m.parseMessage(d[u - 2]), signalType: m.LINETYPE.BREAK_START }), d[u - 1].push({ type: "breakEnd", optText: m.parseMessage(d[u - 2]), signalType: m.LINETYPE.BREAK_END }), this.$ = d[u - 1];
99
+ break;
100
+ case 43:
101
+ this.$ = d[u - 3].concat([{ type: "option", optionText: m.parseMessage(d[u - 1]), signalType: m.LINETYPE.CRITICAL_OPTION }, d[u]]);
102
+ break;
103
+ case 45:
104
+ this.$ = d[u - 3].concat([{ type: "and", parText: m.parseMessage(d[u - 1]), signalType: m.LINETYPE.PAR_AND }, d[u]]);
105
+ break;
106
+ case 47:
107
+ this.$ = d[u - 3].concat([{ type: "else", altText: m.parseMessage(d[u - 1]), signalType: m.LINETYPE.ALT_ELSE }, d[u]]);
108
+ break;
109
+ case 48:
110
+ d[u - 3].draw = "participant", d[u - 3].type = "addParticipant", d[u - 3].description = m.parseMessage(d[u - 1]), this.$ = d[u - 3];
111
+ break;
112
+ case 49:
113
+ d[u - 1].draw = "participant", d[u - 1].type = "addParticipant", this.$ = d[u - 1];
114
+ break;
115
+ case 50:
116
+ d[u - 3].draw = "actor", d[u - 3].type = "addParticipant", d[u - 3].description = m.parseMessage(d[u - 1]), this.$ = d[u - 3];
117
+ break;
118
+ case 51:
119
+ d[u - 1].draw = "actor", d[u - 1].type = "addParticipant", this.$ = d[u - 1];
120
+ break;
121
+ case 52:
122
+ d[u - 1].type = "destroyParticipant", this.$ = d[u - 1];
123
+ break;
124
+ case 53:
125
+ d[u - 1].draw = "participant", d[u - 1].type = "addParticipant", this.$ = d[u - 1];
126
+ break;
127
+ case 54:
128
+ this.$ = [d[u - 1], { type: "addNote", placement: d[u - 2], actor: d[u - 1].actor, text: d[u] }];
129
+ break;
130
+ case 55:
131
+ d[u - 2] = [].concat(d[u - 1], d[u - 1]).slice(0, 2), d[u - 2][0] = d[u - 2][0].actor, d[u - 2][1] = d[u - 2][1].actor, this.$ = [d[u - 1], { type: "addNote", placement: m.PLACEMENT.OVER, actor: d[u - 2].slice(0, 2), text: d[u] }];
132
+ break;
133
+ case 56:
134
+ this.$ = [d[u - 1], { type: "addLinks", actor: d[u - 1].actor, text: d[u] }];
135
+ break;
136
+ case 57:
137
+ this.$ = [d[u - 1], { type: "addALink", actor: d[u - 1].actor, text: d[u] }];
138
+ break;
139
+ case 58:
140
+ this.$ = [d[u - 1], { type: "addProperties", actor: d[u - 1].actor, text: d[u] }];
141
+ break;
142
+ case 59:
143
+ this.$ = [d[u - 1], { type: "addDetails", actor: d[u - 1].actor, text: d[u] }];
144
+ break;
145
+ case 62:
146
+ this.$ = [d[u - 2], d[u]];
147
+ break;
148
+ case 63:
149
+ this.$ = d[u];
150
+ break;
151
+ case 64:
152
+ this.$ = m.PLACEMENT.LEFTOF;
153
+ break;
154
+ case 65:
155
+ this.$ = m.PLACEMENT.RIGHTOF;
156
+ break;
157
+ case 66:
158
+ this.$ = [
159
+ d[u - 4],
160
+ d[u - 1],
161
+ { type: "addMessage", from: d[u - 4].actor, to: d[u - 1].actor, signalType: d[u - 3], msg: d[u], activate: !0 },
162
+ { type: "activeStart", signalType: m.LINETYPE.ACTIVE_START, actor: d[u - 1].actor }
163
+ ];
164
+ break;
165
+ case 67:
166
+ this.$ = [
167
+ d[u - 4],
168
+ d[u - 1],
169
+ { type: "addMessage", from: d[u - 4].actor, to: d[u - 1].actor, signalType: d[u - 3], msg: d[u] },
170
+ { type: "activeEnd", signalType: m.LINETYPE.ACTIVE_END, actor: d[u - 4].actor }
171
+ ];
172
+ break;
173
+ case 68:
174
+ this.$ = [d[u - 3], d[u - 1], { type: "addMessage", from: d[u - 3].actor, to: d[u - 1].actor, signalType: d[u - 2], msg: d[u] }];
175
+ break;
176
+ case 69:
177
+ this.$ = {
178
+ type: "addParticipant",
179
+ actor: d[u - 1],
180
+ config: d[u]
181
+ };
182
+ break;
183
+ case 70:
184
+ this.$ = d[u - 1].trim();
185
+ break;
186
+ case 71:
187
+ this.$ = { type: "addParticipant", actor: d[u] };
188
+ break;
189
+ case 72:
190
+ this.$ = m.LINETYPE.SOLID_OPEN;
191
+ break;
192
+ case 73:
193
+ this.$ = m.LINETYPE.DOTTED_OPEN;
194
+ break;
195
+ case 74:
196
+ this.$ = m.LINETYPE.SOLID;
197
+ break;
198
+ case 75:
199
+ this.$ = m.LINETYPE.BIDIRECTIONAL_SOLID;
200
+ break;
201
+ case 76:
202
+ this.$ = m.LINETYPE.DOTTED;
203
+ break;
204
+ case 77:
205
+ this.$ = m.LINETYPE.BIDIRECTIONAL_DOTTED;
206
+ break;
207
+ case 78:
208
+ this.$ = m.LINETYPE.SOLID_CROSS;
209
+ break;
210
+ case 79:
211
+ this.$ = m.LINETYPE.DOTTED_CROSS;
212
+ break;
213
+ case 80:
214
+ this.$ = m.LINETYPE.SOLID_POINT;
215
+ break;
216
+ case 81:
217
+ this.$ = m.LINETYPE.DOTTED_POINT;
218
+ break;
219
+ case 82:
220
+ this.$ = m.parseMessage(d[u].trim().substring(1));
221
+ break;
222
+ }
223
+ }, "anonymous"),
224
+ table: [{ 3: 1, 4: t, 5: n, 6: s }, { 1: [3] }, { 3: 5, 4: t, 5: n, 6: s }, { 3: 6, 4: t, 5: n, 6: s }, e([1, 4, 5, 13, 14, 18, 21, 23, 29, 30, 31, 33, 35, 36, 37, 38, 39, 41, 43, 44, 46, 50, 52, 53, 55, 60, 61, 62, 63, 71], r, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: T, 31: b, 33: w, 35: k, 36: N, 37: S, 38: M, 39: C, 41: Y, 43: H, 44: Z, 46: at, 50: U, 52: G, 53: q, 55: O, 60: $, 61: K, 62: j, 63: rt, 71: D }, e(E, [2, 5]), { 9: 47, 12: 12, 13: h, 14: o, 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: T, 31: b, 33: w, 35: k, 36: N, 37: S, 38: M, 39: C, 41: Y, 43: H, 44: Z, 46: at, 50: U, 52: G, 53: q, 55: O, 60: $, 61: K, 62: j, 63: rt, 71: D }, e(E, [2, 7]), e(E, [2, 8]), e(E, [2, 14]), { 12: 48, 50: U, 52: G, 53: q }, { 15: [1, 49] }, { 5: [1, 50] }, { 5: [1, 53], 19: [1, 51], 20: [1, 52] }, { 22: 54, 71: D }, { 22: 55, 71: D }, { 5: [1, 56] }, { 5: [1, 57] }, { 5: [1, 58] }, { 5: [1, 59] }, { 5: [1, 60] }, e(E, [2, 29]), e(E, [2, 30]), { 32: [1, 61] }, { 34: [1, 62] }, e(E, [2, 33]), { 15: [1, 63] }, { 15: [1, 64] }, { 15: [1, 65] }, { 15: [1, 66] }, { 15: [1, 67] }, { 15: [1, 68] }, { 15: [1, 69] }, { 15: [1, 70] }, { 22: 71, 54: 72, 71: [1, 73] }, { 22: 74, 71: D }, { 22: 75, 71: D }, { 68: 76, 76: [1, 77], 77: [1, 78], 78: [1, 79], 79: [1, 80], 80: [1, 81], 81: [1, 82], 82: [1, 83], 83: [1, 84], 84: [1, 85], 85: [1, 86] }, { 56: 87, 58: [1, 88], 66: [1, 89], 67: [1, 90] }, { 22: 91, 71: D }, { 22: 92, 71: D }, { 22: 93, 71: D }, { 22: 94, 71: D }, e([5, 51, 65, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86], A), e(E, [2, 6]), e(E, [2, 15]), e(X, [2, 9], { 10: 95 }), e(E, [2, 17]), { 5: [1, 97], 19: [1, 96] }, { 5: [1, 98] }, e(E, [2, 21]), { 5: [1, 99] }, { 5: [1, 100] }, e(E, [2, 24]), e(E, [2, 25]), e(E, [2, 26]), e(E, [2, 27]), e(E, [2, 28]), e(E, [2, 31]), e(E, [2, 32]), e(tt, r, { 7: 101 }), e(tt, r, { 7: 102 }), e(tt, r, { 7: 103 }), e(R, r, { 40: 104, 7: 105 }), e(Vt, r, { 42: 106, 7: 107 }), e(Vt, r, { 7: 107, 42: 108 }), e(Zt, r, { 45: 109, 7: 110 }), e(tt, r, { 7: 111 }), { 5: [1, 113], 51: [1, 112] }, { 5: [1, 114] }, e([5, 51], A, { 72: 115, 73: [1, 116] }), { 5: [1, 118], 51: [1, 117] }, { 5: [1, 119] }, { 22: 122, 69: [1, 120], 70: [1, 121], 71: D }, e(ot, [2, 72]), e(ot, [2, 73]), e(ot, [2, 74]), e(ot, [2, 75]), e(ot, [2, 76]), e(ot, [2, 77]), e(ot, [2, 78]), e(ot, [2, 79]), e(ot, [2, 80]), e(ot, [2, 81]), { 22: 123, 71: D }, { 22: 125, 59: 124, 71: D }, { 71: [2, 64] }, { 71: [2, 65] }, { 57: 126, 86: lt }, { 57: 128, 86: lt }, { 57: 129, 86: lt }, { 57: 130, 86: lt }, { 4: [1, 133], 5: [1, 135], 11: 132, 12: 134, 16: [1, 131], 50: U, 52: G, 53: q }, { 5: [1, 136] }, e(E, [2, 19]), e(E, [2, 20]), e(E, [2, 22]), e(E, [2, 23]), { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [1, 137], 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: T, 31: b, 33: w, 35: k, 36: N, 37: S, 38: M, 39: C, 41: Y, 43: H, 44: Z, 46: at, 50: U, 52: G, 53: q, 55: O, 60: $, 61: K, 62: j, 63: rt, 71: D }, { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [1, 138], 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: T, 31: b, 33: w, 35: k, 36: N, 37: S, 38: M, 39: C, 41: Y, 43: H, 44: Z, 46: at, 50: U, 52: G, 53: q, 55: O, 60: $, 61: K, 62: j, 63: rt, 71: D }, { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [1, 139], 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: T, 31: b, 33: w, 35: k, 36: N, 37: S, 38: M, 39: C, 41: Y, 43: H, 44: Z, 46: at, 50: U, 52: G, 53: q, 55: O, 60: $, 61: K, 62: j, 63: rt, 71: D }, { 16: [1, 140] }, { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [2, 46], 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: T, 31: b, 33: w, 35: k, 36: N, 37: S, 38: M, 39: C, 41: Y, 43: H, 44: Z, 46: at, 49: [1, 141], 50: U, 52: G, 53: q, 55: O, 60: $, 61: K, 62: j, 63: rt, 71: D }, { 16: [1, 142] }, { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [2, 44], 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: T, 31: b, 33: w, 35: k, 36: N, 37: S, 38: M, 39: C, 41: Y, 43: H, 44: Z, 46: at, 48: [1, 143], 50: U, 52: G, 53: q, 55: O, 60: $, 61: K, 62: j, 63: rt, 71: D }, { 16: [1, 144] }, { 16: [1, 145] }, { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [2, 42], 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: T, 31: b, 33: w, 35: k, 36: N, 37: S, 38: M, 39: C, 41: Y, 43: H, 44: Z, 46: at, 47: [1, 146], 50: U, 52: G, 53: q, 55: O, 60: $, 61: K, 62: j, 63: rt, 71: D }, { 4: i, 5: c, 8: 8, 9: 10, 12: 12, 13: h, 14: o, 16: [1, 147], 17: 15, 18: a, 21: p, 22: 40, 23: g, 24: 19, 25: 20, 26: 21, 27: 22, 28: 23, 29: x, 30: T, 31: b, 33: w, 35: k, 36: N, 37: S, 38: M, 39: C, 41: Y, 43: H, 44: Z, 46: at, 50: U, 52: G, 53: q, 55: O, 60: $, 61: K, 62: j, 63: rt, 71: D }, { 15: [1, 148] }, e(E, [2, 49]), e(E, [2, 53]), { 5: [2, 69] }, { 74: [1, 149] }, { 15: [1, 150] }, e(E, [2, 51]), e(E, [2, 52]), { 22: 151, 71: D }, { 22: 152, 71: D }, { 57: 153, 86: lt }, { 57: 154, 86: lt }, { 57: 155, 86: lt }, { 65: [1, 156], 86: [2, 63] }, { 5: [2, 56] }, { 5: [2, 82] }, { 5: [2, 57] }, { 5: [2, 58] }, { 5: [2, 59] }, e(E, [2, 16]), e(X, [2, 10]), { 12: 157, 50: U, 52: G, 53: q }, e(X, [2, 12]), e(X, [2, 13]), e(E, [2, 18]), e(E, [2, 34]), e(E, [2, 35]), e(E, [2, 36]), e(E, [2, 37]), { 15: [1, 158] }, e(E, [2, 38]), { 15: [1, 159] }, e(E, [2, 39]), e(E, [2, 40]), { 15: [1, 160] }, e(E, [2, 41]), { 5: [1, 161] }, { 75: [1, 162] }, { 5: [1, 163] }, { 57: 164, 86: lt }, { 57: 165, 86: lt }, { 5: [2, 68] }, { 5: [2, 54] }, { 5: [2, 55] }, { 22: 166, 71: D }, e(X, [2, 11]), e(R, r, { 7: 105, 40: 167 }), e(Vt, r, { 7: 107, 42: 168 }), e(Zt, r, { 7: 110, 45: 169 }), e(E, [2, 48]), { 5: [2, 70] }, e(E, [2, 50]), { 5: [2, 66] }, { 5: [2, 67] }, { 86: [2, 62] }, { 16: [2, 47] }, { 16: [2, 45] }, { 16: [2, 43] }],
225
+ defaultActions: { 5: [2, 1], 6: [2, 2], 89: [2, 64], 90: [2, 65], 115: [2, 69], 126: [2, 56], 127: [2, 82], 128: [2, 57], 129: [2, 58], 130: [2, 59], 153: [2, 68], 154: [2, 54], 155: [2, 55], 162: [2, 70], 164: [2, 66], 165: [2, 67], 166: [2, 62], 167: [2, 47], 168: [2, 45], 169: [2, 43] },
226
+ parseError: /* @__PURE__ */ f(function(v, _) {
227
+ if (_.recoverable)
228
+ this.trace(v);
229
+ else {
230
+ var L = new Error(v);
231
+ throw L.hash = _, L;
232
+ }
233
+ }, "parseError"),
234
+ parse: /* @__PURE__ */ f(function(v) {
235
+ var _ = this, L = [0], m = [], B = [null], d = [], It = this.table, u = "", kt = 0, $t = 0, ye = 2, jt = 1, Ee = d.slice.call(arguments, 1), W = Object.create(this.lexer), ft = { yy: {} };
236
+ for (var Wt in this.yy)
237
+ Object.prototype.hasOwnProperty.call(this.yy, Wt) && (ft.yy[Wt] = this.yy[Wt]);
238
+ W.setInput(v, ft.yy), ft.yy.lexer = W, ft.yy.parser = this, typeof W.yylloc > "u" && (W.yylloc = {});
239
+ var Ft = W.yylloc;
240
+ d.push(Ft);
241
+ var be = W.options && W.options.ranges;
242
+ typeof ft.yy.parseError == "function" ? this.parseError = ft.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
243
+ function me(et) {
244
+ L.length = L.length - 2 * et, B.length = B.length - et, d.length = d.length - et;
245
+ }
246
+ f(me, "popStack");
247
+ function te() {
248
+ var et;
249
+ return et = m.pop() || W.lex() || jt, typeof et != "number" && (et instanceof Array && (m = et, et = m.pop()), et = _.symbols_[et] || et), et;
250
+ }
251
+ f(te, "lex");
252
+ for (var J, Tt, it, qt, bt = {}, Pt, ht, ee, Nt; ; ) {
253
+ if (Tt = L[L.length - 1], this.defaultActions[Tt] ? it = this.defaultActions[Tt] : ((J === null || typeof J > "u") && (J = te()), it = It[Tt] && It[Tt][J]), typeof it > "u" || !it.length || !it[0]) {
254
+ var zt = "";
255
+ Nt = [];
256
+ for (Pt in It[Tt])
257
+ this.terminals_[Pt] && Pt > ye && Nt.push("'" + this.terminals_[Pt] + "'");
258
+ W.showPosition ? zt = "Parse error on line " + (kt + 1) + `:
259
+ ` + W.showPosition() + `
260
+ Expecting ` + Nt.join(", ") + ", got '" + (this.terminals_[J] || J) + "'" : zt = "Parse error on line " + (kt + 1) + ": Unexpected " + (J == jt ? "end of input" : "'" + (this.terminals_[J] || J) + "'"), this.parseError(zt, {
261
+ text: W.match,
262
+ token: this.terminals_[J] || J,
263
+ line: W.yylineno,
264
+ loc: Ft,
265
+ expected: Nt
266
+ });
267
+ }
268
+ if (it[0] instanceof Array && it.length > 1)
269
+ throw new Error("Parse Error: multiple actions possible at state: " + Tt + ", token: " + J);
270
+ switch (it[0]) {
271
+ case 1:
272
+ L.push(J), B.push(W.yytext), d.push(W.yylloc), L.push(it[1]), J = null, $t = W.yyleng, u = W.yytext, kt = W.yylineno, Ft = W.yylloc;
273
+ break;
274
+ case 2:
275
+ if (ht = this.productions_[it[1]][1], bt.$ = B[B.length - ht], bt._$ = {
276
+ first_line: d[d.length - (ht || 1)].first_line,
277
+ last_line: d[d.length - 1].last_line,
278
+ first_column: d[d.length - (ht || 1)].first_column,
279
+ last_column: d[d.length - 1].last_column
280
+ }, be && (bt._$.range = [
281
+ d[d.length - (ht || 1)].range[0],
282
+ d[d.length - 1].range[1]
283
+ ]), qt = this.performAction.apply(bt, [
284
+ u,
285
+ $t,
286
+ kt,
287
+ ft.yy,
288
+ it[1],
289
+ B,
290
+ d
291
+ ].concat(Ee)), typeof qt < "u")
292
+ return qt;
293
+ ht && (L = L.slice(0, -1 * ht * 2), B = B.slice(0, -1 * ht), d = d.slice(0, -1 * ht)), L.push(this.productions_[it[1]][0]), B.push(bt.$), d.push(bt._$), ee = It[L[L.length - 2]][L[L.length - 1]], L.push(ee);
294
+ break;
295
+ case 3:
296
+ return !0;
297
+ }
298
+ }
299
+ return !0;
300
+ }, "parse")
301
+ }, Te = /* @__PURE__ */ function() {
302
+ var pt = {
303
+ EOF: 1,
304
+ parseError: /* @__PURE__ */ f(function(_, L) {
305
+ if (this.yy.parser)
306
+ this.yy.parser.parseError(_, L);
307
+ else
308
+ throw new Error(_);
309
+ }, "parseError"),
310
+ // resets the lexer, sets new input
311
+ setInput: /* @__PURE__ */ f(function(v, _) {
312
+ return this.yy = _ || this.yy || {}, this._input = v, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
313
+ first_line: 1,
314
+ first_column: 0,
315
+ last_line: 1,
316
+ last_column: 0
317
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
318
+ }, "setInput"),
319
+ // consumes and returns one char from the input
320
+ input: /* @__PURE__ */ f(function() {
321
+ var v = this._input[0];
322
+ this.yytext += v, this.yyleng++, this.offset++, this.match += v, this.matched += v;
323
+ var _ = v.match(/(?:\r\n?|\n).*/g);
324
+ return _ ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), v;
325
+ }, "input"),
326
+ // unshifts one char (or a string) into the input
327
+ unput: /* @__PURE__ */ f(function(v) {
328
+ var _ = v.length, L = v.split(/(?:\r\n?|\n)/g);
329
+ this._input = v + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - _), this.offset -= _;
330
+ var m = this.match.split(/(?:\r\n?|\n)/g);
331
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), L.length - 1 && (this.yylineno -= L.length - 1);
332
+ var B = this.yylloc.range;
333
+ return this.yylloc = {
334
+ first_line: this.yylloc.first_line,
335
+ last_line: this.yylineno + 1,
336
+ first_column: this.yylloc.first_column,
337
+ last_column: L ? (L.length === m.length ? this.yylloc.first_column : 0) + m[m.length - L.length].length - L[0].length : this.yylloc.first_column - _
338
+ }, this.options.ranges && (this.yylloc.range = [B[0], B[0] + this.yyleng - _]), this.yyleng = this.yytext.length, this;
339
+ }, "unput"),
340
+ // When called from action, caches matched text and appends it on next action
341
+ more: /* @__PURE__ */ f(function() {
342
+ return this._more = !0, this;
343
+ }, "more"),
344
+ // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
345
+ reject: /* @__PURE__ */ f(function() {
346
+ if (this.options.backtrack_lexer)
347
+ this._backtrack = !0;
348
+ else
349
+ 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).
350
+ ` + this.showPosition(), {
351
+ text: "",
352
+ token: null,
353
+ line: this.yylineno
354
+ });
355
+ return this;
356
+ }, "reject"),
357
+ // retain first n characters of the match
358
+ less: /* @__PURE__ */ f(function(v) {
359
+ this.unput(this.match.slice(v));
360
+ }, "less"),
361
+ // displays already matched input, i.e. for error messages
362
+ pastInput: /* @__PURE__ */ f(function() {
363
+ var v = this.matched.substr(0, this.matched.length - this.match.length);
364
+ return (v.length > 20 ? "..." : "") + v.substr(-20).replace(/\n/g, "");
365
+ }, "pastInput"),
366
+ // displays upcoming input, i.e. for error messages
367
+ upcomingInput: /* @__PURE__ */ f(function() {
368
+ var v = this.match;
369
+ return v.length < 20 && (v += this._input.substr(0, 20 - v.length)), (v.substr(0, 20) + (v.length > 20 ? "..." : "")).replace(/\n/g, "");
370
+ }, "upcomingInput"),
371
+ // displays the character position where the lexing error occurred, i.e. for error messages
372
+ showPosition: /* @__PURE__ */ f(function() {
373
+ var v = this.pastInput(), _ = new Array(v.length + 1).join("-");
374
+ return v + this.upcomingInput() + `
375
+ ` + _ + "^";
376
+ }, "showPosition"),
377
+ // test the lexed token: return FALSE when not a match, otherwise return token
378
+ test_match: /* @__PURE__ */ f(function(v, _) {
379
+ var L, m, B;
380
+ if (this.options.backtrack_lexer && (B = {
381
+ yylineno: this.yylineno,
382
+ yylloc: {
383
+ first_line: this.yylloc.first_line,
384
+ last_line: this.last_line,
385
+ first_column: this.yylloc.first_column,
386
+ last_column: this.yylloc.last_column
387
+ },
388
+ yytext: this.yytext,
389
+ match: this.match,
390
+ matches: this.matches,
391
+ matched: this.matched,
392
+ yyleng: this.yyleng,
393
+ offset: this.offset,
394
+ _more: this._more,
395
+ _input: this._input,
396
+ yy: this.yy,
397
+ conditionStack: this.conditionStack.slice(0),
398
+ done: this.done
399
+ }, this.options.ranges && (B.yylloc.range = this.yylloc.range.slice(0))), m = v[0].match(/(?:\r\n?|\n).*/g), m && (this.yylineno += m.length), this.yylloc = {
400
+ first_line: this.yylloc.last_line,
401
+ last_line: this.yylineno + 1,
402
+ first_column: this.yylloc.last_column,
403
+ last_column: m ? m[m.length - 1].length - m[m.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + v[0].length
404
+ }, this.yytext += v[0], this.match += v[0], this.matches = v, 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(v[0].length), this.matched += v[0], L = this.performAction.call(this, this.yy, this, _, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), L)
405
+ return L;
406
+ if (this._backtrack) {
407
+ for (var d in B)
408
+ this[d] = B[d];
409
+ return !1;
410
+ }
411
+ return !1;
412
+ }, "test_match"),
413
+ // return next match in input
414
+ next: /* @__PURE__ */ f(function() {
415
+ if (this.done)
416
+ return this.EOF;
417
+ this._input || (this.done = !0);
418
+ var v, _, L, m;
419
+ this._more || (this.yytext = "", this.match = "");
420
+ for (var B = this._currentRules(), d = 0; d < B.length; d++)
421
+ if (L = this._input.match(this.rules[B[d]]), L && (!_ || L[0].length > _[0].length)) {
422
+ if (_ = L, m = d, this.options.backtrack_lexer) {
423
+ if (v = this.test_match(L, B[d]), v !== !1)
424
+ return v;
425
+ if (this._backtrack) {
426
+ _ = !1;
427
+ continue;
428
+ } else
429
+ return !1;
430
+ } else if (!this.options.flex)
431
+ break;
432
+ }
433
+ return _ ? (v = this.test_match(_, B[m]), v !== !1 ? v : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
434
+ ` + this.showPosition(), {
435
+ text: "",
436
+ token: null,
437
+ line: this.yylineno
438
+ });
439
+ }, "next"),
440
+ // return next match that has a token
441
+ lex: /* @__PURE__ */ f(function() {
442
+ var _ = this.next();
443
+ return _ || this.lex();
444
+ }, "lex"),
445
+ // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
446
+ begin: /* @__PURE__ */ f(function(_) {
447
+ this.conditionStack.push(_);
448
+ }, "begin"),
449
+ // pop the previously active lexer condition state off the condition stack
450
+ popState: /* @__PURE__ */ f(function() {
451
+ var _ = this.conditionStack.length - 1;
452
+ return _ > 0 ? this.conditionStack.pop() : this.conditionStack[0];
453
+ }, "popState"),
454
+ // produce the lexer rule set which is active for the currently active lexer condition state
455
+ _currentRules: /* @__PURE__ */ f(function() {
456
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
457
+ }, "_currentRules"),
458
+ // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
459
+ topState: /* @__PURE__ */ f(function(_) {
460
+ return _ = this.conditionStack.length - 1 - Math.abs(_ || 0), _ >= 0 ? this.conditionStack[_] : "INITIAL";
461
+ }, "topState"),
462
+ // alias for begin(condition)
463
+ pushState: /* @__PURE__ */ f(function(_) {
464
+ this.begin(_);
465
+ }, "pushState"),
466
+ // return the number of states currently on the stack
467
+ stateStackSize: /* @__PURE__ */ f(function() {
468
+ return this.conditionStack.length;
469
+ }, "stateStackSize"),
470
+ options: { "case-insensitive": !0 },
471
+ performAction: /* @__PURE__ */ f(function(_, L, m, B) {
472
+ switch (m) {
473
+ case 0:
474
+ return 5;
475
+ case 1:
476
+ break;
477
+ case 2:
478
+ break;
479
+ case 3:
480
+ break;
481
+ case 4:
482
+ break;
483
+ case 5:
484
+ break;
485
+ case 6:
486
+ return 19;
487
+ case 7:
488
+ return this.begin("CONFIG"), 73;
489
+ case 8:
490
+ return 74;
491
+ case 9:
492
+ return this.popState(), this.popState(), 75;
493
+ case 10:
494
+ return L.yytext = L.yytext.trim(), 71;
495
+ case 11:
496
+ return L.yytext = L.yytext.trim(), this.begin("ALIAS"), 71;
497
+ case 12:
498
+ return this.begin("LINE"), 14;
499
+ case 13:
500
+ return this.begin("ID"), 50;
501
+ case 14:
502
+ return this.begin("ID"), 52;
503
+ case 15:
504
+ return 13;
505
+ case 16:
506
+ return this.begin("ID"), 53;
507
+ case 17:
508
+ return L.yytext = L.yytext.trim(), this.begin("ALIAS"), 71;
509
+ case 18:
510
+ return this.popState(), this.popState(), this.begin("LINE"), 51;
511
+ case 19:
512
+ return this.popState(), this.popState(), 5;
513
+ case 20:
514
+ return this.begin("LINE"), 36;
515
+ case 21:
516
+ return this.begin("LINE"), 37;
517
+ case 22:
518
+ return this.begin("LINE"), 38;
519
+ case 23:
520
+ return this.begin("LINE"), 39;
521
+ case 24:
522
+ return this.begin("LINE"), 49;
523
+ case 25:
524
+ return this.begin("LINE"), 41;
525
+ case 26:
526
+ return this.begin("LINE"), 43;
527
+ case 27:
528
+ return this.begin("LINE"), 48;
529
+ case 28:
530
+ return this.begin("LINE"), 44;
531
+ case 29:
532
+ return this.begin("LINE"), 47;
533
+ case 30:
534
+ return this.begin("LINE"), 46;
535
+ case 31:
536
+ return this.popState(), 15;
537
+ case 32:
538
+ return 16;
539
+ case 33:
540
+ return 66;
541
+ case 34:
542
+ return 67;
543
+ case 35:
544
+ return 60;
545
+ case 36:
546
+ return 61;
547
+ case 37:
548
+ return 62;
549
+ case 38:
550
+ return 63;
551
+ case 39:
552
+ return 58;
553
+ case 40:
554
+ return 55;
555
+ case 41:
556
+ return this.begin("ID"), 21;
557
+ case 42:
558
+ return this.begin("ID"), 23;
559
+ case 43:
560
+ return 29;
561
+ case 44:
562
+ return 30;
563
+ case 45:
564
+ return this.begin("acc_title"), 31;
565
+ case 46:
566
+ return this.popState(), "acc_title_value";
567
+ case 47:
568
+ return this.begin("acc_descr"), 33;
569
+ case 48:
570
+ return this.popState(), "acc_descr_value";
571
+ case 49:
572
+ this.begin("acc_descr_multiline");
573
+ break;
574
+ case 50:
575
+ this.popState();
576
+ break;
577
+ case 51:
578
+ return "acc_descr_multiline_value";
579
+ case 52:
580
+ return 6;
581
+ case 53:
582
+ return 18;
583
+ case 54:
584
+ return 20;
585
+ case 55:
586
+ return 65;
587
+ case 56:
588
+ return 5;
589
+ case 57:
590
+ return L.yytext = L.yytext.trim(), 71;
591
+ case 58:
592
+ return 78;
593
+ case 59:
594
+ return 79;
595
+ case 60:
596
+ return 80;
597
+ case 61:
598
+ return 81;
599
+ case 62:
600
+ return 76;
601
+ case 63:
602
+ return 77;
603
+ case 64:
604
+ return 82;
605
+ case 65:
606
+ return 83;
607
+ case 66:
608
+ return 84;
609
+ case 67:
610
+ return 85;
611
+ case 68:
612
+ return 86;
613
+ case 69:
614
+ return 86;
615
+ case 70:
616
+ return 69;
617
+ case 71:
618
+ return 70;
619
+ case 72:
620
+ return 5;
621
+ case 73:
622
+ return "INVALID";
623
+ }
624
+ }, "anonymous"),
625
+ rules: [/^(?:[\n]+)/i, /^(?:\s+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[0-9]+(?=[ \n]+))/i, /^(?:@\{)/i, /^(?:[^\}]+)/i, /^(?:\})/i, /^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i, /^(?:[^\<->\->:\n,;@]+?([\-]*[^\<->\->:\n,;@]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i, /^(?:box\b)/i, /^(?:participant\b)/i, /^(?:actor\b)/i, /^(?:create\b)/i, /^(?:destroy\b)/i, /^(?:[^<\->\->:\n,;]+?([\-]*[^<\->\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i, /^(?:as\b)/i, /^(?:(?:))/i, /^(?:loop\b)/i, /^(?:rect\b)/i, /^(?:opt\b)/i, /^(?:alt\b)/i, /^(?:else\b)/i, /^(?:par\b)/i, /^(?:par_over\b)/i, /^(?:and\b)/i, /^(?:critical\b)/i, /^(?:option\b)/i, /^(?:break\b)/i, /^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i, /^(?:end\b)/i, /^(?:left of\b)/i, /^(?:right of\b)/i, /^(?:links\b)/i, /^(?:link\b)/i, /^(?:properties\b)/i, /^(?:details\b)/i, /^(?:over\b)/i, /^(?:note\b)/i, /^(?:activate\b)/i, /^(?:deactivate\b)/i, /^(?:title\s[^#\n;]+)/i, /^(?:title:\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:sequenceDiagram\b)/i, /^(?:autonumber\b)/i, /^(?:off\b)/i, /^(?:,)/i, /^(?:;)/i, /^(?:[^+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+<\->\->:\n,;]+)*)/i, /^(?:->>)/i, /^(?:<<->>)/i, /^(?:-->>)/i, /^(?:<<-->>)/i, /^(?:->)/i, /^(?:-->)/i, /^(?:-[x])/i, /^(?:--[x])/i, /^(?:-[\)])/i, /^(?:--[\)])/i, /^(?::(?:(?:no)?wrap)?[^#\n;]*)/i, /^(?::)/i, /^(?:\+)/i, /^(?:-)/i, /^(?:$)/i, /^(?:.)/i],
626
+ conditions: { acc_descr_multiline: { rules: [50, 51], inclusive: !1 }, acc_descr: { rules: [48], inclusive: !1 }, acc_title: { rules: [46], inclusive: !1 }, ID: { rules: [2, 3, 7, 10, 11, 17], inclusive: !1 }, ALIAS: { rules: [2, 3, 18, 19], inclusive: !1 }, LINE: { rules: [2, 3, 31], inclusive: !1 }, CONFIG: { rules: [8, 9], inclusive: !1 }, CONFIG_DATA: { rules: [], inclusive: !1 }, INITIAL: { rules: [0, 1, 3, 4, 5, 6, 12, 13, 14, 15, 16, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 47, 49, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73], inclusive: !0 } }
627
+ };
628
+ return pt;
629
+ }();
630
+ Yt.lexer = Te;
631
+ function _t() {
632
+ this.yy = {};
633
+ }
634
+ return f(_t, "Parser"), _t.prototype = Yt, Yt.Parser = _t, new _t();
635
+ }();
636
+ Ut.parser = Ut;
637
+ var Ve = Ut, Ye = {
638
+ SOLID: 0,
639
+ DOTTED: 1,
640
+ NOTE: 2,
641
+ SOLID_CROSS: 3,
642
+ DOTTED_CROSS: 4,
643
+ SOLID_OPEN: 5,
644
+ DOTTED_OPEN: 6,
645
+ LOOP_START: 10,
646
+ LOOP_END: 11,
647
+ ALT_START: 12,
648
+ ALT_ELSE: 13,
649
+ ALT_END: 14,
650
+ OPT_START: 15,
651
+ OPT_END: 16,
652
+ ACTIVE_START: 17,
653
+ ACTIVE_END: 18,
654
+ PAR_START: 19,
655
+ PAR_AND: 20,
656
+ PAR_END: 21,
657
+ RECT_START: 22,
658
+ RECT_END: 23,
659
+ SOLID_POINT: 24,
660
+ DOTTED_POINT: 25,
661
+ AUTONUMBER: 26,
662
+ CRITICAL_START: 27,
663
+ CRITICAL_OPTION: 28,
664
+ CRITICAL_END: 29,
665
+ BREAK_START: 30,
666
+ BREAK_END: 31,
667
+ PAR_OVER_START: 32,
668
+ BIDIRECTIONAL_SOLID: 33,
669
+ BIDIRECTIONAL_DOTTED: 34
670
+ }, We = {
671
+ FILLED: 0,
672
+ OPEN: 1
673
+ }, Fe = {
674
+ LEFTOF: 0,
675
+ RIGHTOF: 1,
676
+ OVER: 2
677
+ }, Rt = {
678
+ ACTOR: "actor",
679
+ BOUNDARY: "boundary",
680
+ COLLECTIONS: "collections",
681
+ CONTROL: "control",
682
+ DATABASE: "database",
683
+ ENTITY: "entity",
684
+ PARTICIPANT: "participant",
685
+ QUEUE: "queue"
686
+ }, wt, qe = (wt = class {
687
+ constructor() {
688
+ this.state = new Be(() => ({
689
+ prevActor: void 0,
690
+ actors: /* @__PURE__ */ new Map(),
691
+ createdActors: /* @__PURE__ */ new Map(),
692
+ destroyedActors: /* @__PURE__ */ new Map(),
693
+ boxes: [],
694
+ messages: [],
695
+ notes: [],
696
+ sequenceNumbersEnabled: !1,
697
+ wrapEnabled: void 0,
698
+ currentBox: void 0,
699
+ lastCreated: void 0,
700
+ lastDestroyed: void 0
701
+ })), this.setAccTitle = se, this.setAccDescription = Ie, this.setDiagramTitle = Le, this.getAccTitle = Ae, this.getAccDescription = _e, this.getDiagramTitle = ke, this.apply = this.apply.bind(this), this.parseBoxData = this.parseBoxData.bind(this), this.parseMessage = this.parseMessage.bind(this), this.clear(), this.setWrap(st().wrap), this.LINETYPE = Ye, this.ARROWTYPE = We, this.PLACEMENT = Fe;
702
+ }
703
+ addBox(t) {
704
+ this.state.records.boxes.push({
705
+ name: t.text,
706
+ wrap: t.wrap ?? this.autoWrap(),
707
+ fill: t.color,
708
+ actorKeys: []
709
+ }), this.state.records.currentBox = this.state.records.boxes.slice(-1)[0];
710
+ }
711
+ addActor(t, n, s, r, i) {
712
+ let c = this.state.records.currentBox, h;
713
+ if (i !== void 0) {
714
+ let a;
715
+ i.includes(`
716
+ `) ? a = i + `
717
+ ` : a = `{
718
+ ` + i + `
719
+ }`, h = Pe(a, { schema: Ne });
720
+ }
721
+ r = (h == null ? void 0 : h.type) ?? r;
722
+ const o = this.state.records.actors.get(t);
723
+ if (o) {
724
+ if (this.state.records.currentBox && o.box && this.state.records.currentBox !== o.box)
725
+ throw new Error(
726
+ `A same participant should only be defined in one Box: ${o.name} can't be in '${o.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`
727
+ );
728
+ if (c = o.box ? o.box : this.state.records.currentBox, o.box = c, o && n === o.name && s == null)
729
+ return;
730
+ }
731
+ if ((s == null ? void 0 : s.text) == null && (s = { text: n, type: r }), (r == null || s.text == null) && (s = { text: n, type: r }), this.state.records.actors.set(t, {
732
+ box: c,
733
+ name: n,
734
+ description: s.text,
735
+ wrap: s.wrap ?? this.autoWrap(),
736
+ prevActor: this.state.records.prevActor,
737
+ links: {},
738
+ properties: {},
739
+ actorCnt: null,
740
+ rectData: null,
741
+ type: r ?? "participant"
742
+ }), this.state.records.prevActor) {
743
+ const a = this.state.records.actors.get(this.state.records.prevActor);
744
+ a && (a.nextActor = t);
745
+ }
746
+ this.state.records.currentBox && this.state.records.currentBox.actorKeys.push(t), this.state.records.prevActor = t;
747
+ }
748
+ activationCount(t) {
749
+ let n, s = 0;
750
+ if (!t)
751
+ return 0;
752
+ for (n = 0; n < this.state.records.messages.length; n++)
753
+ this.state.records.messages[n].type === this.LINETYPE.ACTIVE_START && this.state.records.messages[n].from === t && s++, this.state.records.messages[n].type === this.LINETYPE.ACTIVE_END && this.state.records.messages[n].from === t && s--;
754
+ return s;
755
+ }
756
+ addMessage(t, n, s, r) {
757
+ this.state.records.messages.push({
758
+ id: this.state.records.messages.length.toString(),
759
+ from: t,
760
+ to: n,
761
+ message: s.text,
762
+ wrap: s.wrap ?? this.autoWrap(),
763
+ answer: r
764
+ });
765
+ }
766
+ addSignal(t, n, s, r, i = !1) {
767
+ if (r === this.LINETYPE.ACTIVE_END && this.activationCount(t ?? "") < 1) {
768
+ const h = new Error("Trying to inactivate an inactive participant (" + t + ")");
769
+ throw h.hash = {
770
+ text: "->>-",
771
+ token: "->>-",
772
+ line: "1",
773
+ loc: { first_line: 1, last_line: 1, first_column: 1, last_column: 1 },
774
+ expected: ["'ACTIVE_PARTICIPANT'"]
775
+ }, h;
776
+ }
777
+ return this.state.records.messages.push({
778
+ id: this.state.records.messages.length.toString(),
779
+ from: t,
780
+ to: n,
781
+ message: (s == null ? void 0 : s.text) ?? "",
782
+ wrap: (s == null ? void 0 : s.wrap) ?? this.autoWrap(),
783
+ type: r,
784
+ activate: i
785
+ }), !0;
786
+ }
787
+ hasAtLeastOneBox() {
788
+ return this.state.records.boxes.length > 0;
789
+ }
790
+ hasAtLeastOneBoxWithTitle() {
791
+ return this.state.records.boxes.some((t) => t.name);
792
+ }
793
+ getMessages() {
794
+ return this.state.records.messages;
795
+ }
796
+ getBoxes() {
797
+ return this.state.records.boxes;
798
+ }
799
+ getActors() {
800
+ return this.state.records.actors;
801
+ }
802
+ getCreatedActors() {
803
+ return this.state.records.createdActors;
804
+ }
805
+ getDestroyedActors() {
806
+ return this.state.records.destroyedActors;
807
+ }
808
+ getActor(t) {
809
+ return this.state.records.actors.get(t);
810
+ }
811
+ getActorKeys() {
812
+ return [...this.state.records.actors.keys()];
813
+ }
814
+ enableSequenceNumbers() {
815
+ this.state.records.sequenceNumbersEnabled = !0;
816
+ }
817
+ disableSequenceNumbers() {
818
+ this.state.records.sequenceNumbersEnabled = !1;
819
+ }
820
+ showSequenceNumbers() {
821
+ return this.state.records.sequenceNumbersEnabled;
822
+ }
823
+ setWrap(t) {
824
+ this.state.records.wrapEnabled = t;
825
+ }
826
+ extractWrap(t) {
827
+ if (t === void 0)
828
+ return {};
829
+ t = t.trim();
830
+ const n = /^:?wrap:/.exec(t) !== null ? !0 : /^:?nowrap:/.exec(t) !== null ? !1 : void 0;
831
+ return { cleanedText: (n === void 0 ? t : t.replace(/^:?(?:no)?wrap:/, "")).trim(), wrap: n };
832
+ }
833
+ autoWrap() {
834
+ var t;
835
+ return this.state.records.wrapEnabled !== void 0 ? this.state.records.wrapEnabled : ((t = st().sequence) == null ? void 0 : t.wrap) ?? !1;
836
+ }
837
+ clear() {
838
+ this.state.reset(), Se();
839
+ }
840
+ parseMessage(t) {
841
+ const n = t.trim(), { wrap: s, cleanedText: r } = this.extractWrap(n), i = {
842
+ text: r,
843
+ wrap: s
844
+ };
845
+ return Q.debug(`parseMessage: ${JSON.stringify(i)}`), i;
846
+ }
847
+ // We expect the box statement to be color first then description
848
+ // The color can be rgb,rgba,hsl,hsla, or css code names #hex codes are not supported for now because of the way the char # is handled
849
+ // We extract first segment as color, the rest of the line is considered as text
850
+ parseBoxData(t) {
851
+ const n = /^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t);
852
+ let s = n != null && n[1] ? n[1].trim() : "transparent", r = n != null && n[2] ? n[2].trim() : void 0;
853
+ if (window != null && window.CSS)
854
+ window.CSS.supports("color", s) || (s = "transparent", r = t.trim());
855
+ else {
856
+ const h = new Option().style;
857
+ h.color = s, h.color !== s && (s = "transparent", r = t.trim());
858
+ }
859
+ const { wrap: i, cleanedText: c } = this.extractWrap(r);
860
+ return {
861
+ text: c ? St(c, st()) : void 0,
862
+ color: s,
863
+ wrap: i
864
+ };
865
+ }
866
+ addNote(t, n, s) {
867
+ const r = {
868
+ actor: t,
869
+ placement: n,
870
+ message: s.text,
871
+ wrap: s.wrap ?? this.autoWrap()
872
+ }, i = [].concat(t, t);
873
+ this.state.records.notes.push(r), this.state.records.messages.push({
874
+ id: this.state.records.messages.length.toString(),
875
+ from: i[0],
876
+ to: i[1],
877
+ message: s.text,
878
+ wrap: s.wrap ?? this.autoWrap(),
879
+ type: this.LINETYPE.NOTE,
880
+ placement: n
881
+ });
882
+ }
883
+ addLinks(t, n) {
884
+ const s = this.getActor(t);
885
+ try {
886
+ let r = St(n.text, st());
887
+ r = r.replace(/&equals;/g, "="), r = r.replace(/&amp;/g, "&");
888
+ const i = JSON.parse(r);
889
+ this.insertLinks(s, i);
890
+ } catch (r) {
891
+ Q.error("error while parsing actor link text", r);
892
+ }
893
+ }
894
+ addALink(t, n) {
895
+ const s = this.getActor(t);
896
+ try {
897
+ const r = {};
898
+ let i = St(n.text, st());
899
+ const c = i.indexOf("@");
900
+ i = i.replace(/&equals;/g, "="), i = i.replace(/&amp;/g, "&");
901
+ const h = i.slice(0, c - 1).trim(), o = i.slice(c + 1).trim();
902
+ r[h] = o, this.insertLinks(s, r);
903
+ } catch (r) {
904
+ Q.error("error while parsing actor link text", r);
905
+ }
906
+ }
907
+ insertLinks(t, n) {
908
+ if (t.links == null)
909
+ t.links = n;
910
+ else
911
+ for (const s in n)
912
+ t.links[s] = n[s];
913
+ }
914
+ addProperties(t, n) {
915
+ const s = this.getActor(t);
916
+ try {
917
+ const r = St(n.text, st()), i = JSON.parse(r);
918
+ this.insertProperties(s, i);
919
+ } catch (r) {
920
+ Q.error("error while parsing actor properties text", r);
921
+ }
922
+ }
923
+ insertProperties(t, n) {
924
+ if (t.properties == null)
925
+ t.properties = n;
926
+ else
927
+ for (const s in n)
928
+ t.properties[s] = n[s];
929
+ }
930
+ boxEnd() {
931
+ this.state.records.currentBox = void 0;
932
+ }
933
+ addDetails(t, n) {
934
+ const s = this.getActor(t), r = document.getElementById(n.text);
935
+ try {
936
+ const i = r.innerHTML, c = JSON.parse(i);
937
+ c.properties && this.insertProperties(s, c.properties), c.links && this.insertLinks(s, c.links);
938
+ } catch (i) {
939
+ Q.error("error while parsing actor details text", i);
940
+ }
941
+ }
942
+ getActorProperty(t, n) {
943
+ if ((t == null ? void 0 : t.properties) !== void 0)
944
+ return t.properties[n];
945
+ }
946
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-redundant-type-constituents
947
+ apply(t) {
948
+ if (Array.isArray(t))
949
+ t.forEach((n) => {
950
+ this.apply(n);
951
+ });
952
+ else
953
+ switch (t.type) {
954
+ case "sequenceIndex":
955
+ this.state.records.messages.push({
956
+ id: this.state.records.messages.length.toString(),
957
+ from: void 0,
958
+ to: void 0,
959
+ message: {
960
+ start: t.sequenceIndex,
961
+ step: t.sequenceIndexStep,
962
+ visible: t.sequenceVisible
963
+ },
964
+ wrap: !1,
965
+ type: t.signalType
966
+ });
967
+ break;
968
+ case "addParticipant":
969
+ this.addActor(t.actor, t.actor, t.description, t.draw, t.config);
970
+ break;
971
+ case "createParticipant":
972
+ if (this.state.records.actors.has(t.actor))
973
+ throw new Error(
974
+ "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"
975
+ );
976
+ this.state.records.lastCreated = t.actor, this.addActor(t.actor, t.actor, t.description, t.draw, t.config), this.state.records.createdActors.set(t.actor, this.state.records.messages.length);
977
+ break;
978
+ case "destroyParticipant":
979
+ this.state.records.lastDestroyed = t.actor, this.state.records.destroyedActors.set(t.actor, this.state.records.messages.length);
980
+ break;
981
+ case "activeStart":
982
+ this.addSignal(t.actor, void 0, void 0, t.signalType);
983
+ break;
984
+ case "activeEnd":
985
+ this.addSignal(t.actor, void 0, void 0, t.signalType);
986
+ break;
987
+ case "addNote":
988
+ this.addNote(t.actor, t.placement, t.text);
989
+ break;
990
+ case "addLinks":
991
+ this.addLinks(t.actor, t.text);
992
+ break;
993
+ case "addALink":
994
+ this.addALink(t.actor, t.text);
995
+ break;
996
+ case "addProperties":
997
+ this.addProperties(t.actor, t.text);
998
+ break;
999
+ case "addDetails":
1000
+ this.addDetails(t.actor, t.text);
1001
+ break;
1002
+ case "addMessage":
1003
+ if (this.state.records.lastCreated) {
1004
+ if (t.to !== this.state.records.lastCreated)
1005
+ throw new Error(
1006
+ "The created participant " + this.state.records.lastCreated.name + " does not have an associated creating message after its declaration. Please check the sequence diagram."
1007
+ );
1008
+ this.state.records.lastCreated = void 0;
1009
+ } else if (this.state.records.lastDestroyed) {
1010
+ if (t.to !== this.state.records.lastDestroyed && t.from !== this.state.records.lastDestroyed)
1011
+ throw new Error(
1012
+ "The destroyed participant " + this.state.records.lastDestroyed.name + " does not have an associated destroying message after its declaration. Please check the sequence diagram."
1013
+ );
1014
+ this.state.records.lastDestroyed = void 0;
1015
+ }
1016
+ this.addSignal(t.from, t.to, t.msg, t.signalType, t.activate);
1017
+ break;
1018
+ case "boxStart":
1019
+ this.addBox(t.boxData);
1020
+ break;
1021
+ case "boxEnd":
1022
+ this.boxEnd();
1023
+ break;
1024
+ case "loopStart":
1025
+ this.addSignal(void 0, void 0, t.loopText, t.signalType);
1026
+ break;
1027
+ case "loopEnd":
1028
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1029
+ break;
1030
+ case "rectStart":
1031
+ this.addSignal(void 0, void 0, t.color, t.signalType);
1032
+ break;
1033
+ case "rectEnd":
1034
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1035
+ break;
1036
+ case "optStart":
1037
+ this.addSignal(void 0, void 0, t.optText, t.signalType);
1038
+ break;
1039
+ case "optEnd":
1040
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1041
+ break;
1042
+ case "altStart":
1043
+ this.addSignal(void 0, void 0, t.altText, t.signalType);
1044
+ break;
1045
+ case "else":
1046
+ this.addSignal(void 0, void 0, t.altText, t.signalType);
1047
+ break;
1048
+ case "altEnd":
1049
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1050
+ break;
1051
+ case "setAccTitle":
1052
+ se(t.text);
1053
+ break;
1054
+ case "parStart":
1055
+ this.addSignal(void 0, void 0, t.parText, t.signalType);
1056
+ break;
1057
+ case "and":
1058
+ this.addSignal(void 0, void 0, t.parText, t.signalType);
1059
+ break;
1060
+ case "parEnd":
1061
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1062
+ break;
1063
+ case "criticalStart":
1064
+ this.addSignal(void 0, void 0, t.criticalText, t.signalType);
1065
+ break;
1066
+ case "option":
1067
+ this.addSignal(void 0, void 0, t.optionText, t.signalType);
1068
+ break;
1069
+ case "criticalEnd":
1070
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1071
+ break;
1072
+ case "breakStart":
1073
+ this.addSignal(void 0, void 0, t.breakText, t.signalType);
1074
+ break;
1075
+ case "breakEnd":
1076
+ this.addSignal(void 0, void 0, void 0, t.signalType);
1077
+ break;
1078
+ }
1079
+ }
1080
+ getConfig() {
1081
+ return st().sequence;
1082
+ }
1083
+ }, f(wt, "SequenceDB"), wt), ze = /* @__PURE__ */ f((e) => `.actor {
1084
+ stroke: ${e.actorBorder};
1085
+ fill: ${e.actorBkg};
1086
+ }
1087
+
1088
+ text.actor > tspan {
1089
+ fill: ${e.actorTextColor};
1090
+ stroke: none;
1091
+ }
1092
+
1093
+ .actor-line {
1094
+ stroke: ${e.actorLineColor};
1095
+ }
1096
+
1097
+ .innerArc {
1098
+ stroke-width: 1.5;
1099
+ stroke-dasharray: none;
1100
+ }
1101
+
1102
+ .messageLine0 {
1103
+ stroke-width: 1.5;
1104
+ stroke-dasharray: none;
1105
+ stroke: ${e.signalColor};
1106
+ }
1107
+
1108
+ .messageLine1 {
1109
+ stroke-width: 1.5;
1110
+ stroke-dasharray: 2, 2;
1111
+ stroke: ${e.signalColor};
1112
+ }
1113
+
1114
+ #arrowhead path {
1115
+ fill: ${e.signalColor};
1116
+ stroke: ${e.signalColor};
1117
+ }
1118
+
1119
+ .sequenceNumber {
1120
+ fill: ${e.sequenceNumberColor};
1121
+ }
1122
+
1123
+ #sequencenumber {
1124
+ fill: ${e.signalColor};
1125
+ }
1126
+
1127
+ #crosshead path {
1128
+ fill: ${e.signalColor};
1129
+ stroke: ${e.signalColor};
1130
+ }
1131
+
1132
+ .messageText {
1133
+ fill: ${e.signalTextColor};
1134
+ stroke: none;
1135
+ }
1136
+
1137
+ .labelBox {
1138
+ stroke: ${e.labelBoxBorderColor};
1139
+ fill: ${e.labelBoxBkgColor};
1140
+ }
1141
+
1142
+ .labelText, .labelText > tspan {
1143
+ fill: ${e.labelTextColor};
1144
+ stroke: none;
1145
+ }
1146
+
1147
+ .loopText, .loopText > tspan {
1148
+ fill: ${e.loopTextColor};
1149
+ stroke: none;
1150
+ }
1151
+
1152
+ .loopLine {
1153
+ stroke-width: 2px;
1154
+ stroke-dasharray: 2, 2;
1155
+ stroke: ${e.labelBoxBorderColor};
1156
+ fill: ${e.labelBoxBorderColor};
1157
+ }
1158
+
1159
+ .note {
1160
+ //stroke: #decc93;
1161
+ stroke: ${e.noteBorderColor};
1162
+ fill: ${e.noteBkgColor};
1163
+ }
1164
+
1165
+ .noteText, .noteText > tspan {
1166
+ fill: ${e.noteTextColor};
1167
+ stroke: none;
1168
+ }
1169
+
1170
+ .activation0 {
1171
+ fill: ${e.activationBkgColor};
1172
+ stroke: ${e.activationBorderColor};
1173
+ }
1174
+
1175
+ .activation1 {
1176
+ fill: ${e.activationBkgColor};
1177
+ stroke: ${e.activationBorderColor};
1178
+ }
1179
+
1180
+ .activation2 {
1181
+ fill: ${e.activationBkgColor};
1182
+ stroke: ${e.activationBorderColor};
1183
+ }
1184
+
1185
+ .actorPopupMenu {
1186
+ position: absolute;
1187
+ }
1188
+
1189
+ .actorPopupMenuPanel {
1190
+ position: absolute;
1191
+ fill: ${e.actorBkg};
1192
+ box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
1193
+ filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
1194
+ }
1195
+ .actor-man line {
1196
+ stroke: ${e.actorBorder};
1197
+ fill: ${e.actorBkg};
1198
+ }
1199
+ .actor-man circle, line {
1200
+ stroke: ${e.actorBorder};
1201
+ fill: ${e.actorBkg};
1202
+ stroke-width: 2px;
1203
+ }
1204
+
1205
+ `, "getStyles"), He = ze, yt = 18 * 2, gt = "actor-top", xt = "actor-bottom", Ct = "actor-box", ut = "actor-man", Lt = /* @__PURE__ */ f(function(e, t) {
1206
+ return we(e, t);
1207
+ }, "drawRect"), Ue = /* @__PURE__ */ f(function(e, t, n, s, r) {
1208
+ if (t.links === void 0 || t.links === null || Object.keys(t.links).length === 0)
1209
+ return { height: 0, width: 0 };
1210
+ const i = t.links, c = t.actorCnt, h = t.rectData;
1211
+ var o = "none";
1212
+ r && (o = "block !important");
1213
+ const a = e.append("g");
1214
+ a.attr("id", "actor" + c + "_popup"), a.attr("class", "actorPopupMenu"), a.attr("display", o);
1215
+ var p = "";
1216
+ h.class !== void 0 && (p = " " + h.class);
1217
+ let g = h.width > n ? h.width : n;
1218
+ const x = a.append("rect");
1219
+ if (x.attr("class", "actorPopupMenuPanel" + p), x.attr("x", h.x), x.attr("y", h.height), x.attr("fill", h.fill), x.attr("stroke", h.stroke), x.attr("width", g), x.attr("height", h.height), x.attr("rx", h.rx), x.attr("ry", h.ry), i != null) {
1220
+ var T = 20;
1221
+ for (let k in i) {
1222
+ var b = a.append("a"), w = re(i[k]);
1223
+ b.attr("xlink:href", w), b.attr("target", "_blank"), us(s)(
1224
+ k,
1225
+ b,
1226
+ h.x + 10,
1227
+ h.height + T,
1228
+ g,
1229
+ 20,
1230
+ { class: "actor" },
1231
+ s
1232
+ ), T += 30;
1233
+ }
1234
+ }
1235
+ return x.attr("height", T), { height: h.height + T, width: g };
1236
+ }, "drawPopup"), Ot = /* @__PURE__ */ f(function(e) {
1237
+ return "var pu = document.getElementById('" + e + "'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }";
1238
+ }, "popupMenuToggle"), Dt = /* @__PURE__ */ f(async function(e, t, n = null) {
1239
+ let s = e.append("foreignObject");
1240
+ const r = await ie(t.text, Ht()), c = s.append("xhtml:div").attr("style", "width: fit-content;").attr("xmlns", "http://www.w3.org/1999/xhtml").html(r).node().getBoundingClientRect();
1241
+ if (s.attr("height", Math.round(c.height)).attr("width", Math.round(c.width)), t.class === "noteText") {
1242
+ const h = e.node().firstChild;
1243
+ h.setAttribute("height", c.height + 2 * t.textMargin);
1244
+ const o = h.getBBox();
1245
+ s.attr("x", Math.round(o.x + o.width / 2 - c.width / 2)).attr("y", Math.round(o.y + o.height / 2 - c.height / 2));
1246
+ } else if (n) {
1247
+ let { startx: h, stopx: o, starty: a } = n;
1248
+ if (h > o) {
1249
+ const p = h;
1250
+ h = o, o = p;
1251
+ }
1252
+ s.attr("x", Math.round(h + Math.abs(h - o) / 2 - c.width / 2)), t.class === "loopText" ? s.attr("y", Math.round(a)) : s.attr("y", Math.round(a - c.height));
1253
+ }
1254
+ return [s];
1255
+ }, "drawKatex"), vt = /* @__PURE__ */ f(function(e, t) {
1256
+ let n = 0, s = 0;
1257
+ const r = t.text.split(I.lineBreakRegex), [i, c] = ne(t.fontSize);
1258
+ let h = [], o = 0, a = /* @__PURE__ */ f(() => t.y, "yfunc");
1259
+ if (t.valign !== void 0 && t.textMargin !== void 0 && t.textMargin > 0)
1260
+ switch (t.valign) {
1261
+ case "top":
1262
+ case "start":
1263
+ a = /* @__PURE__ */ f(() => Math.round(t.y + t.textMargin), "yfunc");
1264
+ break;
1265
+ case "middle":
1266
+ case "center":
1267
+ a = /* @__PURE__ */ f(() => Math.round(t.y + (n + s + t.textMargin) / 2), "yfunc");
1268
+ break;
1269
+ case "bottom":
1270
+ case "end":
1271
+ a = /* @__PURE__ */ f(() => Math.round(
1272
+ t.y + (n + s + 2 * t.textMargin) - t.textMargin
1273
+ ), "yfunc");
1274
+ break;
1275
+ }
1276
+ if (t.anchor !== void 0 && t.textMargin !== void 0 && t.width !== void 0)
1277
+ switch (t.anchor) {
1278
+ case "left":
1279
+ case "start":
1280
+ t.x = Math.round(t.x + t.textMargin), t.anchor = "start", t.dominantBaseline = "middle", t.alignmentBaseline = "middle";
1281
+ break;
1282
+ case "middle":
1283
+ case "center":
1284
+ t.x = Math.round(t.x + t.width / 2), t.anchor = "middle", t.dominantBaseline = "middle", t.alignmentBaseline = "middle";
1285
+ break;
1286
+ case "right":
1287
+ case "end":
1288
+ t.x = Math.round(t.x + t.width - t.textMargin), t.anchor = "end", t.dominantBaseline = "middle", t.alignmentBaseline = "middle";
1289
+ break;
1290
+ }
1291
+ for (let [p, g] of r.entries()) {
1292
+ t.textMargin !== void 0 && t.textMargin === 0 && i !== void 0 && (o = p * i);
1293
+ const x = e.append("text");
1294
+ x.attr("x", t.x), x.attr("y", a()), t.anchor !== void 0 && x.attr("text-anchor", t.anchor).attr("dominant-baseline", t.dominantBaseline).attr("alignment-baseline", t.alignmentBaseline), t.fontFamily !== void 0 && x.style("font-family", t.fontFamily), c !== void 0 && x.style("font-size", c), t.fontWeight !== void 0 && x.style("font-weight", t.fontWeight), t.fill !== void 0 && x.attr("fill", t.fill), t.class !== void 0 && x.attr("class", t.class), t.dy !== void 0 ? x.attr("dy", t.dy) : o !== 0 && x.attr("dy", o);
1295
+ const T = g || Oe;
1296
+ if (t.tspan) {
1297
+ const b = x.append("tspan");
1298
+ b.attr("x", t.x), t.fill !== void 0 && b.attr("fill", t.fill), b.text(T);
1299
+ } else
1300
+ x.text(T);
1301
+ t.valign !== void 0 && t.textMargin !== void 0 && t.textMargin > 0 && (s += (x._groups || x)[0][0].getBBox().height, n = s), h.push(x);
1302
+ }
1303
+ return h;
1304
+ }, "drawText"), oe = /* @__PURE__ */ f(function(e, t) {
1305
+ function n(r, i, c, h, o) {
1306
+ return r + "," + i + " " + (r + c) + "," + i + " " + (r + c) + "," + (i + h - o) + " " + (r + c - o * 1.2) + "," + (i + h) + " " + r + "," + (i + h);
1307
+ }
1308
+ f(n, "genPoints");
1309
+ const s = e.append("polygon");
1310
+ return s.attr("points", n(t.x, t.y, t.width, t.height, 7)), s.attr("class", "labelBox"), t.y = t.y + t.height / 2, vt(e, t), s;
1311
+ }, "drawLabel"), P = -1, ce = /* @__PURE__ */ f((e, t, n, s) => {
1312
+ e.select && n.forEach((r) => {
1313
+ const i = t.get(r), c = e.select("#actor" + i.actorCnt);
1314
+ !s.mirrorActors && i.stopy ? c.attr("y2", i.stopy + i.height / 2) : s.mirrorActors && c.attr("y2", i.stopy);
1315
+ });
1316
+ }, "fixLifeLineHeights"), Ge = /* @__PURE__ */ f(function(e, t, n, s) {
1317
+ var T, b;
1318
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + t.height, h = e.append("g").lower();
1319
+ var o = h;
1320
+ s || (P++, Object.keys(t.links || {}).length && !n.forceMenus && o.attr("onclick", Ot(`actor${P}_popup`)).attr("cursor", "pointer"), o.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), o = h.append("g"), t.actorCnt = P, t.links != null && o.attr("id", "root-" + P));
1321
+ const a = ct();
1322
+ var p = "actor";
1323
+ (T = t.properties) != null && T.class ? p = t.properties.class : a.fill = "#eaeaea", s ? p += ` ${xt}` : p += ` ${gt}`, a.x = t.x, a.y = r, a.width = t.width, a.height = t.height, a.class = p, a.rx = 3, a.ry = 3, a.name = t.name;
1324
+ const g = Lt(o, a);
1325
+ if (t.rectData = a, (b = t.properties) != null && b.icon) {
1326
+ const w = t.properties.icon.trim();
1327
+ w.charAt(0) === "@" ? Jt(o, a.x + a.width - 20, a.y + 10, w.substr(1)) : Qt(o, a.x + a.width - 20, a.y + 10, w);
1328
+ }
1329
+ dt(n, z(t.description))(
1330
+ t.description,
1331
+ o,
1332
+ a.x,
1333
+ a.y,
1334
+ a.width,
1335
+ a.height,
1336
+ { class: `actor ${Ct}` },
1337
+ n
1338
+ );
1339
+ let x = t.height;
1340
+ if (g.node) {
1341
+ const w = g.node().getBBox();
1342
+ t.height = w.height, x = w.height;
1343
+ }
1344
+ return x;
1345
+ }, "drawActorTypeParticipant"), Ke = /* @__PURE__ */ f(function(e, t, n, s) {
1346
+ var w, k;
1347
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + t.height, h = e.append("g").lower();
1348
+ var o = h;
1349
+ s || (P++, Object.keys(t.links || {}).length && !n.forceMenus && o.attr("onclick", Ot(`actor${P}_popup`)).attr("cursor", "pointer"), o.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), o = h.append("g"), t.actorCnt = P, t.links != null && o.attr("id", "root-" + P));
1350
+ const a = ct();
1351
+ var p = "actor";
1352
+ (w = t.properties) != null && w.class ? p = t.properties.class : a.fill = "#eaeaea", s ? p += ` ${xt}` : p += ` ${gt}`, a.x = t.x, a.y = r, a.width = t.width, a.height = t.height, a.class = p, a.name = t.name;
1353
+ const g = 6, x = {
1354
+ ...a,
1355
+ x: a.x + -g,
1356
+ y: a.y + +g,
1357
+ class: "actor"
1358
+ }, T = Lt(o, a);
1359
+ if (Lt(o, x), t.rectData = a, (k = t.properties) != null && k.icon) {
1360
+ const N = t.properties.icon.trim();
1361
+ N.charAt(0) === "@" ? Jt(o, a.x + a.width - 20, a.y + 10, N.substr(1)) : Qt(o, a.x + a.width - 20, a.y + 10, N);
1362
+ }
1363
+ dt(n, z(t.description))(
1364
+ t.description,
1365
+ o,
1366
+ a.x - g,
1367
+ a.y + g,
1368
+ a.width,
1369
+ a.height,
1370
+ { class: `actor ${Ct}` },
1371
+ n
1372
+ );
1373
+ let b = t.height;
1374
+ if (T.node) {
1375
+ const N = T.node().getBBox();
1376
+ t.height = N.height, b = N.height;
1377
+ }
1378
+ return b;
1379
+ }, "drawActorTypeCollections"), Xe = /* @__PURE__ */ f(function(e, t, n, s) {
1380
+ var N, S;
1381
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + t.height, h = e.append("g").lower();
1382
+ let o = h;
1383
+ s || (P++, Object.keys(t.links || {}).length && !n.forceMenus && o.attr("onclick", Ot(`actor${P}_popup`)).attr("cursor", "pointer"), o.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), o = h.append("g"), t.actorCnt = P, t.links != null && o.attr("id", "root-" + P));
1384
+ const a = ct();
1385
+ let p = "actor";
1386
+ (N = t.properties) != null && N.class ? p = t.properties.class : a.fill = "#eaeaea", s ? p += ` ${xt}` : p += ` ${gt}`, a.x = t.x, a.y = r, a.width = t.width, a.height = t.height, a.class = p, a.name = t.name;
1387
+ const g = a.height / 2, x = g / (2.5 + a.height / 50), T = o.append("g"), b = o.append("g");
1388
+ if (T.append("path").attr(
1389
+ "d",
1390
+ `M ${a.x},${a.y + g}
1391
+ a ${x},${g} 0 0 0 0,${a.height}
1392
+ h ${a.width - 2 * x}
1393
+ a ${x},${g} 0 0 0 0,-${a.height}
1394
+ Z
1395
+ `
1396
+ ).attr("class", p), b.append("path").attr(
1397
+ "d",
1398
+ `M ${a.x},${a.y + g}
1399
+ a ${x},${g} 0 0 0 0,${a.height}`
1400
+ ).attr("stroke", "#666").attr("stroke-width", "1px").attr("class", p), T.attr("transform", `translate(${x}, ${-(a.height / 2)})`), b.attr("transform", `translate(${a.width - x}, ${-a.height / 2})`), t.rectData = a, (S = t.properties) != null && S.icon) {
1401
+ const M = t.properties.icon.trim(), C = a.x + a.width - 20, Y = a.y + 10;
1402
+ M.charAt(0) === "@" ? Jt(o, C, Y, M.substr(1)) : Qt(o, C, Y, M);
1403
+ }
1404
+ dt(n, z(t.description))(
1405
+ t.description,
1406
+ o,
1407
+ a.x,
1408
+ a.y,
1409
+ a.width,
1410
+ a.height,
1411
+ { class: `actor ${Ct}` },
1412
+ n
1413
+ );
1414
+ let w = t.height;
1415
+ const k = T.select("path:last-child");
1416
+ if (k.node()) {
1417
+ const M = k.node().getBBox();
1418
+ t.height = M.height, w = M.height;
1419
+ }
1420
+ return w;
1421
+ }, "drawActorTypeQueue"), Je = /* @__PURE__ */ f(function(e, t, n, s) {
1422
+ var w;
1423
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + 75, h = e.append("g").lower();
1424
+ s || (P++, h.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), t.actorCnt = P);
1425
+ const o = e.append("g");
1426
+ let a = ut;
1427
+ s ? a += ` ${xt}` : a += ` ${gt}`, o.attr("class", a), o.attr("name", t.name);
1428
+ const p = ct();
1429
+ p.x = t.x, p.y = r, p.fill = "#eaeaea", p.width = t.width, p.height = t.height, p.class = "actor";
1430
+ const g = t.x + t.width / 2, x = r + 30, T = 18;
1431
+ o.append("defs").append("marker").attr("id", "filled-head-control").attr("refX", 11).attr("refY", 5.8).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "172.5").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"), o.append("circle").attr("cx", g).attr("cy", x).attr("r", T).attr("fill", "#eaeaf7").attr("stroke", "#666").attr("stroke-width", 1.2), o.append("line").attr("marker-end", "url(#filled-head-control)").attr("transform", `translate(${g}, ${x - T})`);
1432
+ const b = o.node().getBBox();
1433
+ return t.height = b.height + 2 * (((w = n == null ? void 0 : n.sequence) == null ? void 0 : w.labelBoxHeight) ?? 0), dt(n, z(t.description))(
1434
+ t.description,
1435
+ o,
1436
+ p.x,
1437
+ p.y + T + (s ? 5 : 10),
1438
+ p.width,
1439
+ p.height,
1440
+ { class: `actor ${ut}` },
1441
+ n
1442
+ ), t.height;
1443
+ }, "drawActorTypeControl"), Qe = /* @__PURE__ */ f(function(e, t, n, s) {
1444
+ var w;
1445
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + 75, h = e.append("g").lower(), o = e.append("g");
1446
+ let a = ut;
1447
+ s ? a += ` ${xt}` : a += ` ${gt}`, o.attr("class", a), o.attr("name", t.name);
1448
+ const p = ct();
1449
+ p.x = t.x, p.y = r, p.fill = "#eaeaea", p.width = t.width, p.height = t.height, p.class = "actor";
1450
+ const g = t.x + t.width / 2, x = r + (s ? 10 : 25), T = 18;
1451
+ o.append("circle").attr("cx", g).attr("cy", x).attr("r", T).attr("width", t.width).attr("height", t.height), o.append("line").attr("x1", g - T).attr("x2", g + T).attr("y1", x + T).attr("y2", x + T).attr("stroke", "#333").attr("stroke-width", 2);
1452
+ const b = o.node().getBBox();
1453
+ return t.height = b.height + (((w = n == null ? void 0 : n.sequence) == null ? void 0 : w.labelBoxHeight) ?? 0), s || (P++, h.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), t.actorCnt = P), dt(n, z(t.description))(
1454
+ t.description,
1455
+ o,
1456
+ p.x,
1457
+ p.y + (s ? (x - r + T - 5) / 2 : (x + T - r) / 2),
1458
+ p.width,
1459
+ p.height,
1460
+ { class: `actor ${ut}` },
1461
+ n
1462
+ ), s ? o.attr("transform", `translate(0, ${T / 2})`) : o.attr("transform", `translate(0, ${T / 2})`), t.height;
1463
+ }, "drawActorTypeEntity"), Ze = /* @__PURE__ */ f(function(e, t, n, s) {
1464
+ var S;
1465
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + t.height + 2 * n.boxTextMargin, h = e.append("g").lower();
1466
+ let o = h;
1467
+ s || (P++, Object.keys(t.links || {}).length && !n.forceMenus && o.attr("onclick", Ot(`actor${P}_popup`)).attr("cursor", "pointer"), o.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), o = h.append("g"), t.actorCnt = P, t.links != null && o.attr("id", "root-" + P));
1468
+ const a = ct();
1469
+ let p = "actor";
1470
+ (S = t.properties) != null && S.class ? p = t.properties.class : a.fill = "#eaeaea", s ? p += ` ${xt}` : p += ` ${gt}`, a.x = t.x, a.y = r, a.width = t.width, a.height = t.height, a.class = p, a.name = t.name, a.x = t.x, a.y = r;
1471
+ const g = a.width / 4, x = a.width / 4, T = g / 2, b = T / (2.5 + g / 50), w = o.append("g"), k = `
1472
+ M ${a.x},${a.y + b}
1473
+ a ${T},${b} 0 0 0 ${g},0
1474
+ a ${T},${b} 0 0 0 -${g},0
1475
+ l 0,${x - 2 * b}
1476
+ a ${T},${b} 0 0 0 ${g},0
1477
+ l 0,-${x - 2 * b}
1478
+ `;
1479
+ w.append("path").attr("d", k).attr("fill", "#eaeaea").attr("stroke", "#000").attr("stroke-width", 1).attr("class", p), s ? w.attr("transform", `translate(${g * 1.5}, ${a.height / 4 - 2 * b})`) : w.attr("transform", `translate(${g * 1.5}, ${(a.height + b) / 4})`), t.rectData = a, dt(n, z(t.description))(
1480
+ t.description,
1481
+ o,
1482
+ a.x,
1483
+ a.y + (s ? (a.height + x) / 4 : (a.height + b) / 2),
1484
+ a.width,
1485
+ a.height,
1486
+ { class: `actor ${Ct}` },
1487
+ n
1488
+ );
1489
+ const N = w.select("path:last-child");
1490
+ if (N.node()) {
1491
+ const M = N.node().getBBox();
1492
+ t.height = M.height + (n.sequence.labelBoxHeight ?? 0);
1493
+ }
1494
+ return t.height;
1495
+ }, "drawActorTypeDatabase"), $e = /* @__PURE__ */ f(function(e, t, n, s) {
1496
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + 80, h = 30, o = e.append("g").lower();
1497
+ s || (P++, o.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), t.actorCnt = P);
1498
+ const a = e.append("g");
1499
+ let p = ut;
1500
+ s ? p += ` ${xt}` : p += ` ${gt}`, a.attr("class", p), a.attr("name", t.name);
1501
+ const g = ct();
1502
+ g.x = t.x, g.y = r, g.fill = "#eaeaea", g.width = t.width, g.height = t.height, g.class = "actor", a.append("line").attr("id", "actor-man-torso" + P).attr("x1", t.x + t.width / 2 - h * 2.5).attr("y1", r + 10).attr("x2", t.x + t.width / 2 - 15).attr("y2", r + 10), a.append("line").attr("id", "actor-man-arms" + P).attr("x1", t.x + t.width / 2 - h * 2.5).attr("y1", r + 0).attr("x2", t.x + t.width / 2 - h * 2.5).attr("y2", r + 20), a.append("circle").attr("cx", t.x + t.width / 2).attr("cy", r + 10).attr("r", h);
1503
+ const x = a.node().getBBox();
1504
+ return t.height = x.height + (n.sequence.labelBoxHeight ?? 0), dt(n, z(t.description))(
1505
+ t.description,
1506
+ a,
1507
+ g.x,
1508
+ g.y + (s ? h / 2 - 4 : h / 2 + 3),
1509
+ g.width,
1510
+ g.height,
1511
+ { class: `actor ${ut}` },
1512
+ n
1513
+ ), s ? a.attr("transform", `translate(0,${h / 2 + 7})`) : a.attr("transform", `translate(0,${h / 2 + 7})`), t.height;
1514
+ }, "drawActorTypeBoundary"), je = /* @__PURE__ */ f(function(e, t, n, s) {
1515
+ const r = s ? t.stopy : t.starty, i = t.x + t.width / 2, c = r + 80, h = e.append("g").lower();
1516
+ s || (P++, h.append("line").attr("id", "actor" + P).attr("x1", i).attr("y1", c).attr("x2", i).attr("y2", 2e3).attr("class", "actor-line 200").attr("stroke-width", "0.5px").attr("stroke", "#999").attr("name", t.name), t.actorCnt = P);
1517
+ const o = e.append("g");
1518
+ let a = ut;
1519
+ s ? a += ` ${xt}` : a += ` ${gt}`, o.attr("class", a), o.attr("name", t.name);
1520
+ const p = ct();
1521
+ p.x = t.x, p.y = r, p.fill = "#eaeaea", p.width = t.width, p.height = t.height, p.class = "actor", p.rx = 3, p.ry = 3, o.append("line").attr("id", "actor-man-torso" + P).attr("x1", i).attr("y1", r + 25).attr("x2", i).attr("y2", r + 45), o.append("line").attr("id", "actor-man-arms" + P).attr("x1", i - yt / 2).attr("y1", r + 33).attr("x2", i + yt / 2).attr("y2", r + 33), o.append("line").attr("x1", i - yt / 2).attr("y1", r + 60).attr("x2", i).attr("y2", r + 45), o.append("line").attr("x1", i).attr("y1", r + 45).attr("x2", i + yt / 2 - 2).attr("y2", r + 60);
1522
+ const g = o.append("circle");
1523
+ g.attr("cx", t.x + t.width / 2), g.attr("cy", r + 10), g.attr("r", 15), g.attr("width", t.width), g.attr("height", t.height);
1524
+ const x = o.node().getBBox();
1525
+ return t.height = x.height, dt(n, z(t.description))(
1526
+ t.description,
1527
+ o,
1528
+ p.x,
1529
+ p.y + 35,
1530
+ p.width,
1531
+ p.height,
1532
+ { class: `actor ${ut}` },
1533
+ n
1534
+ ), t.height;
1535
+ }, "drawActorTypeActor"), ts = /* @__PURE__ */ f(async function(e, t, n, s) {
1536
+ switch (t.type) {
1537
+ case "actor":
1538
+ return await je(e, t, n, s);
1539
+ case "participant":
1540
+ return await Ge(e, t, n, s);
1541
+ case "boundary":
1542
+ return await $e(e, t, n, s);
1543
+ case "control":
1544
+ return await Je(e, t, n, s);
1545
+ case "entity":
1546
+ return await Qe(e, t, n, s);
1547
+ case "database":
1548
+ return await Ze(e, t, n, s);
1549
+ case "collections":
1550
+ return await Ke(e, t, n, s);
1551
+ case "queue":
1552
+ return await Xe(e, t, n, s);
1553
+ }
1554
+ }, "drawActor"), es = /* @__PURE__ */ f(function(e, t, n) {
1555
+ const r = e.append("g");
1556
+ le(r, t), t.name && dt(n)(
1557
+ t.name,
1558
+ r,
1559
+ t.x,
1560
+ t.y + n.boxTextMargin + (t.textMaxHeight || 0) / 2,
1561
+ t.width,
1562
+ 0,
1563
+ { class: "text" },
1564
+ n
1565
+ ), r.lower();
1566
+ }, "drawBox"), ss = /* @__PURE__ */ f(function(e) {
1567
+ return e.append("g");
1568
+ }, "anchorElement"), as = /* @__PURE__ */ f(function(e, t, n, s, r) {
1569
+ const i = ct(), c = t.anchored;
1570
+ i.x = t.startx, i.y = t.starty, i.class = "activation" + r % 3, i.width = t.stopx - t.startx, i.height = n - t.starty, Lt(c, i);
1571
+ }, "drawActivation"), rs = /* @__PURE__ */ f(async function(e, t, n, s) {
1572
+ const {
1573
+ boxMargin: r,
1574
+ boxTextMargin: i,
1575
+ labelBoxHeight: c,
1576
+ labelBoxWidth: h,
1577
+ messageFontFamily: o,
1578
+ messageFontSize: a,
1579
+ messageFontWeight: p
1580
+ } = s, g = e.append("g"), x = /* @__PURE__ */ f(function(w, k, N, S) {
1581
+ return g.append("line").attr("x1", w).attr("y1", k).attr("x2", N).attr("y2", S).attr("class", "loopLine");
1582
+ }, "drawLoopLine");
1583
+ x(t.startx, t.starty, t.stopx, t.starty), x(t.stopx, t.starty, t.stopx, t.stopy), x(t.startx, t.stopy, t.stopx, t.stopy), x(t.startx, t.starty, t.startx, t.stopy), t.sections !== void 0 && t.sections.forEach(function(w) {
1584
+ x(t.startx, w.y, t.stopx, w.y).style(
1585
+ "stroke-dasharray",
1586
+ "3, 3"
1587
+ );
1588
+ });
1589
+ let T = Xt();
1590
+ T.text = n, T.x = t.startx, T.y = t.starty, T.fontFamily = o, T.fontSize = a, T.fontWeight = p, T.anchor = "middle", T.valign = "middle", T.tspan = !1, T.width = h || 50, T.height = c || 20, T.textMargin = i, T.class = "labelText", oe(g, T), T = he(), T.text = t.title, T.x = t.startx + h / 2 + (t.stopx - t.startx) / 2, T.y = t.starty + r + i, T.anchor = "middle", T.valign = "middle", T.textMargin = i, T.class = "loopText", T.fontFamily = o, T.fontSize = a, T.fontWeight = p, T.wrap = !0;
1591
+ let b = z(T.text) ? await Dt(g, T, t) : vt(g, T);
1592
+ if (t.sectionTitles !== void 0) {
1593
+ for (const [w, k] of Object.entries(t.sectionTitles))
1594
+ if (k.message) {
1595
+ T.text = k.message, T.x = t.startx + (t.stopx - t.startx) / 2, T.y = t.sections[w].y + r + i, T.class = "loopText", T.anchor = "middle", T.valign = "middle", T.tspan = !1, T.fontFamily = o, T.fontSize = a, T.fontWeight = p, T.wrap = t.wrap, z(T.text) ? (t.starty = t.sections[w].y, await Dt(g, T, t)) : vt(g, T);
1596
+ let N = Math.round(
1597
+ b.map((S) => (S._groups || S)[0][0].getBBox().height).reduce((S, M) => S + M)
1598
+ );
1599
+ t.sections[w].height += N - (r + i);
1600
+ }
1601
+ }
1602
+ return t.height = Math.round(t.stopy - t.starty), g;
1603
+ }, "drawLoop"), le = /* @__PURE__ */ f(function(e, t) {
1604
+ ve(e, t);
1605
+ }, "drawBackgroundRect"), is = /* @__PURE__ */ f(function(e) {
1606
+ e.append("defs").append("symbol").attr("id", "database").attr("fill-rule", "evenodd").attr("clip-rule", "evenodd").append("path").attr("transform", "scale(.5)").attr(
1607
+ "d",
1608
+ "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"
1609
+ );
1610
+ }, "insertDatabaseIcon"), ns = /* @__PURE__ */ f(function(e) {
1611
+ e.append("defs").append("symbol").attr("id", "computer").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1612
+ "d",
1613
+ "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"
1614
+ );
1615
+ }, "insertComputerIcon"), os = /* @__PURE__ */ f(function(e) {
1616
+ e.append("defs").append("symbol").attr("id", "clock").attr("width", "24").attr("height", "24").append("path").attr("transform", "scale(.5)").attr(
1617
+ "d",
1618
+ "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"
1619
+ );
1620
+ }, "insertClockIcon"), cs = /* @__PURE__ */ f(function(e) {
1621
+ e.append("defs").append("marker").attr("id", "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");
1622
+ }, "insertArrowHead"), ls = /* @__PURE__ */ f(function(e) {
1623
+ e.append("defs").append("marker").attr("id", "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");
1624
+ }, "insertArrowFilledHead"), hs = /* @__PURE__ */ f(function(e) {
1625
+ e.append("defs").append("marker").attr("id", "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);
1626
+ }, "insertSequenceNumber"), ds = /* @__PURE__ */ f(function(e) {
1627
+ e.append("defs").append("marker").attr("id", "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");
1628
+ }, "insertArrowCrossHead"), he = /* @__PURE__ */ f(function() {
1629
+ return {
1630
+ x: 0,
1631
+ y: 0,
1632
+ fill: void 0,
1633
+ anchor: void 0,
1634
+ style: "#666",
1635
+ width: void 0,
1636
+ height: void 0,
1637
+ textMargin: 0,
1638
+ rx: 0,
1639
+ ry: 0,
1640
+ tspan: !0,
1641
+ valign: void 0
1642
+ };
1643
+ }, "getTextObj"), ps = /* @__PURE__ */ f(function() {
1644
+ return {
1645
+ x: 0,
1646
+ y: 0,
1647
+ fill: "#EDF2AE",
1648
+ stroke: "#666",
1649
+ width: 100,
1650
+ anchor: "start",
1651
+ height: 100,
1652
+ rx: 0,
1653
+ ry: 0
1654
+ };
1655
+ }, "getNoteRect"), dt = /* @__PURE__ */ function() {
1656
+ function e(i, c, h, o, a, p, g) {
1657
+ const x = c.append("text").attr("x", h + a / 2).attr("y", o + p / 2 + 5).style("text-anchor", "middle").text(i);
1658
+ r(x, g);
1659
+ }
1660
+ f(e, "byText");
1661
+ function t(i, c, h, o, a, p, g, x) {
1662
+ const { actorFontSize: T, actorFontFamily: b, actorFontWeight: w } = x, [k, N] = ne(T), S = i.split(I.lineBreakRegex);
1663
+ for (let M = 0; M < S.length; M++) {
1664
+ const C = M * k - k * (S.length - 1) / 2, Y = c.append("text").attr("x", h + a / 2).attr("y", o).style("text-anchor", "middle").style("font-size", N).style("font-weight", w).style("font-family", b);
1665
+ Y.append("tspan").attr("x", h + a / 2).attr("dy", C).text(S[M]), Y.attr("y", o + p / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), r(Y, g);
1666
+ }
1667
+ }
1668
+ f(t, "byTspan");
1669
+ function n(i, c, h, o, a, p, g, x) {
1670
+ const T = c.append("switch"), w = T.append("foreignObject").attr("x", h).attr("y", o).attr("width", a).attr("height", p).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1671
+ w.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(i), t(i, T, h, o, a, p, g, x), r(w, g);
1672
+ }
1673
+ f(n, "byFo");
1674
+ async function s(i, c, h, o, a, p, g, x) {
1675
+ const T = await At(i, Ht()), b = c.append("switch"), k = b.append("foreignObject").attr("x", h + a / 2 - T.width / 2).attr("y", o + p / 2 - T.height / 2).attr("width", T.width).attr("height", T.height).append("xhtml:div").style("height", "100%").style("width", "100%");
1676
+ k.append("div").style("text-align", "center").style("vertical-align", "middle").html(await ie(i, Ht())), t(i, b, h, o, a, p, g, x), r(k, g);
1677
+ }
1678
+ f(s, "byKatex");
1679
+ function r(i, c) {
1680
+ for (const h in c)
1681
+ c.hasOwnProperty(h) && i.attr(h, c[h]);
1682
+ }
1683
+ return f(r, "_setTextAttrs"), function(i, c = !1) {
1684
+ return c ? s : i.textPlacement === "fo" ? n : i.textPlacement === "old" ? e : t;
1685
+ };
1686
+ }(), us = /* @__PURE__ */ function() {
1687
+ function e(r, i, c, h, o, a, p) {
1688
+ const g = i.append("text").attr("x", c).attr("y", h).style("text-anchor", "start").text(r);
1689
+ s(g, p);
1690
+ }
1691
+ f(e, "byText");
1692
+ function t(r, i, c, h, o, a, p, g) {
1693
+ const { actorFontSize: x, actorFontFamily: T, actorFontWeight: b } = g, w = r.split(I.lineBreakRegex);
1694
+ for (let k = 0; k < w.length; k++) {
1695
+ const N = k * x - x * (w.length - 1) / 2, S = i.append("text").attr("x", c).attr("y", h).style("text-anchor", "start").style("font-size", x).style("font-weight", b).style("font-family", T);
1696
+ S.append("tspan").attr("x", c).attr("dy", N).text(w[k]), S.attr("y", h + a / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), s(S, p);
1697
+ }
1698
+ }
1699
+ f(t, "byTspan");
1700
+ function n(r, i, c, h, o, a, p, g) {
1701
+ const x = i.append("switch"), b = x.append("foreignObject").attr("x", c).attr("y", h).attr("width", o).attr("height", a).append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
1702
+ b.append("div").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(r), t(r, x, c, h, o, a, p, g), s(b, p);
1703
+ }
1704
+ f(n, "byFo");
1705
+ function s(r, i) {
1706
+ for (const c in i)
1707
+ i.hasOwnProperty(c) && r.attr(c, i[c]);
1708
+ }
1709
+ return f(s, "_setTextAttrs"), function(r) {
1710
+ return r.textPlacement === "fo" ? n : r.textPlacement === "old" ? e : t;
1711
+ };
1712
+ }(), V = {
1713
+ drawRect: Lt,
1714
+ drawText: vt,
1715
+ drawLabel: oe,
1716
+ drawActor: ts,
1717
+ drawBox: es,
1718
+ drawPopup: Ue,
1719
+ anchorElement: ss,
1720
+ drawActivation: as,
1721
+ drawLoop: rs,
1722
+ drawBackgroundRect: le,
1723
+ insertArrowHead: cs,
1724
+ insertArrowFilledHead: ls,
1725
+ insertSequenceNumber: hs,
1726
+ insertArrowCrossHead: ds,
1727
+ insertDatabaseIcon: is,
1728
+ insertComputerIcon: ns,
1729
+ insertClockIcon: os,
1730
+ getTextObj: he,
1731
+ getNoteRect: ps,
1732
+ fixLifeLineHeights: ce,
1733
+ sanitizeUrl: re
1734
+ }, l = {}, y = {
1735
+ data: {
1736
+ startx: void 0,
1737
+ stopx: void 0,
1738
+ starty: void 0,
1739
+ stopy: void 0
1740
+ },
1741
+ verticalPos: 0,
1742
+ sequenceItems: [],
1743
+ activations: [],
1744
+ models: {
1745
+ getHeight: /* @__PURE__ */ f(function() {
1746
+ return Math.max.apply(
1747
+ null,
1748
+ this.actors.length === 0 ? [0] : this.actors.map((e) => e.height || 0)
1749
+ ) + (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));
1750
+ }, "getHeight"),
1751
+ clear: /* @__PURE__ */ f(function() {
1752
+ this.actors = [], this.boxes = [], this.loops = [], this.messages = [], this.notes = [];
1753
+ }, "clear"),
1754
+ addBox: /* @__PURE__ */ f(function(e) {
1755
+ this.boxes.push(e);
1756
+ }, "addBox"),
1757
+ addActor: /* @__PURE__ */ f(function(e) {
1758
+ this.actors.push(e);
1759
+ }, "addActor"),
1760
+ addLoop: /* @__PURE__ */ f(function(e) {
1761
+ this.loops.push(e);
1762
+ }, "addLoop"),
1763
+ addMessage: /* @__PURE__ */ f(function(e) {
1764
+ this.messages.push(e);
1765
+ }, "addMessage"),
1766
+ addNote: /* @__PURE__ */ f(function(e) {
1767
+ this.notes.push(e);
1768
+ }, "addNote"),
1769
+ lastActor: /* @__PURE__ */ f(function() {
1770
+ return this.actors[this.actors.length - 1];
1771
+ }, "lastActor"),
1772
+ lastLoop: /* @__PURE__ */ f(function() {
1773
+ return this.loops[this.loops.length - 1];
1774
+ }, "lastLoop"),
1775
+ lastMessage: /* @__PURE__ */ f(function() {
1776
+ return this.messages[this.messages.length - 1];
1777
+ }, "lastMessage"),
1778
+ lastNote: /* @__PURE__ */ f(function() {
1779
+ return this.notes[this.notes.length - 1];
1780
+ }, "lastNote"),
1781
+ actors: [],
1782
+ boxes: [],
1783
+ loops: [],
1784
+ messages: [],
1785
+ notes: []
1786
+ },
1787
+ init: /* @__PURE__ */ f(function() {
1788
+ this.sequenceItems = [], this.activations = [], this.models.clear(), this.data = {
1789
+ startx: void 0,
1790
+ stopx: void 0,
1791
+ starty: void 0,
1792
+ stopy: void 0
1793
+ }, this.verticalPos = 0, ue(st());
1794
+ }, "init"),
1795
+ updateVal: /* @__PURE__ */ f(function(e, t, n, s) {
1796
+ e[t] === void 0 ? e[t] = n : e[t] = s(n, e[t]);
1797
+ }, "updateVal"),
1798
+ updateBounds: /* @__PURE__ */ f(function(e, t, n, s) {
1799
+ const r = this;
1800
+ let i = 0;
1801
+ function c(h) {
1802
+ return /* @__PURE__ */ f(function(a) {
1803
+ i++;
1804
+ const p = r.sequenceItems.length - i + 1;
1805
+ r.updateVal(a, "starty", t - p * l.boxMargin, Math.min), r.updateVal(a, "stopy", s + p * l.boxMargin, Math.max), r.updateVal(y.data, "startx", e - p * l.boxMargin, Math.min), r.updateVal(y.data, "stopx", n + p * l.boxMargin, Math.max), h !== "activation" && (r.updateVal(a, "startx", e - p * l.boxMargin, Math.min), r.updateVal(a, "stopx", n + p * l.boxMargin, Math.max), r.updateVal(y.data, "starty", t - p * l.boxMargin, Math.min), r.updateVal(y.data, "stopy", s + p * l.boxMargin, Math.max));
1806
+ }, "updateItemBounds");
1807
+ }
1808
+ f(c, "updateFn"), this.sequenceItems.forEach(c()), this.activations.forEach(c("activation"));
1809
+ }, "updateBounds"),
1810
+ insert: /* @__PURE__ */ f(function(e, t, n, s) {
1811
+ const r = I.getMin(e, n), i = I.getMax(e, n), c = I.getMin(t, s), h = I.getMax(t, s);
1812
+ this.updateVal(y.data, "startx", r, Math.min), this.updateVal(y.data, "starty", c, Math.min), this.updateVal(y.data, "stopx", i, Math.max), this.updateVal(y.data, "stopy", h, Math.max), this.updateBounds(r, c, i, h);
1813
+ }, "insert"),
1814
+ newActivation: /* @__PURE__ */ f(function(e, t, n) {
1815
+ const s = n.get(e.from), r = Bt(e.from).length || 0, i = s.x + s.width / 2 + (r - 1) * l.activationWidth / 2;
1816
+ this.activations.push({
1817
+ startx: i,
1818
+ starty: this.verticalPos + 2,
1819
+ stopx: i + l.activationWidth,
1820
+ stopy: void 0,
1821
+ actor: e.from,
1822
+ anchored: V.anchorElement(t)
1823
+ });
1824
+ }, "newActivation"),
1825
+ endActivation: /* @__PURE__ */ f(function(e) {
1826
+ const t = this.activations.map(function(n) {
1827
+ return n.actor;
1828
+ }).lastIndexOf(e.from);
1829
+ return this.activations.splice(t, 1)[0];
1830
+ }, "endActivation"),
1831
+ createLoop: /* @__PURE__ */ f(function(e = { message: void 0, wrap: !1, width: void 0 }, t) {
1832
+ return {
1833
+ startx: void 0,
1834
+ starty: this.verticalPos,
1835
+ stopx: void 0,
1836
+ stopy: void 0,
1837
+ title: e.message,
1838
+ wrap: e.wrap,
1839
+ width: e.width,
1840
+ height: 0,
1841
+ fill: t
1842
+ };
1843
+ }, "createLoop"),
1844
+ newLoop: /* @__PURE__ */ f(function(e = { message: void 0, wrap: !1, width: void 0 }, t) {
1845
+ this.sequenceItems.push(this.createLoop(e, t));
1846
+ }, "newLoop"),
1847
+ endLoop: /* @__PURE__ */ f(function() {
1848
+ return this.sequenceItems.pop();
1849
+ }, "endLoop"),
1850
+ isLoopOverlap: /* @__PURE__ */ f(function() {
1851
+ return this.sequenceItems.length ? this.sequenceItems[this.sequenceItems.length - 1].overlap : !1;
1852
+ }, "isLoopOverlap"),
1853
+ addSectionToLoop: /* @__PURE__ */ f(function(e) {
1854
+ const t = this.sequenceItems.pop();
1855
+ t.sections = t.sections || [], t.sectionTitles = t.sectionTitles || [], t.sections.push({ y: y.getVerticalPos(), height: 0 }), t.sectionTitles.push(e), this.sequenceItems.push(t);
1856
+ }, "addSectionToLoop"),
1857
+ saveVerticalPos: /* @__PURE__ */ f(function() {
1858
+ this.isLoopOverlap() && (this.savedVerticalPos = this.verticalPos);
1859
+ }, "saveVerticalPos"),
1860
+ resetVerticalPos: /* @__PURE__ */ f(function() {
1861
+ this.isLoopOverlap() && (this.verticalPos = this.savedVerticalPos);
1862
+ }, "resetVerticalPos"),
1863
+ bumpVerticalPos: /* @__PURE__ */ f(function(e) {
1864
+ this.verticalPos = this.verticalPos + e, this.data.stopy = I.getMax(this.data.stopy, this.verticalPos);
1865
+ }, "bumpVerticalPos"),
1866
+ getVerticalPos: /* @__PURE__ */ f(function() {
1867
+ return this.verticalPos;
1868
+ }, "getVerticalPos"),
1869
+ getBounds: /* @__PURE__ */ f(function() {
1870
+ return { bounds: this.data, models: this.models };
1871
+ }, "getBounds")
1872
+ }, gs = /* @__PURE__ */ f(async function(e, t) {
1873
+ y.bumpVerticalPos(l.boxMargin), t.height = l.boxMargin, t.starty = y.getVerticalPos();
1874
+ const n = ct();
1875
+ n.x = t.startx, n.y = t.starty, n.width = t.width || l.width, n.class = "note";
1876
+ const s = e.append("g"), r = V.drawRect(s, n), i = Xt();
1877
+ i.x = t.startx, i.y = t.starty, i.width = n.width, i.dy = "1em", i.text = t.message, i.class = "noteText", i.fontFamily = l.noteFontFamily, i.fontSize = l.noteFontSize, i.fontWeight = l.noteFontWeight, i.anchor = l.noteAlign, i.textMargin = l.noteMargin, i.valign = "center";
1878
+ const c = z(i.text) ? await Dt(s, i) : vt(s, i), h = Math.round(
1879
+ c.map((o) => (o._groups || o)[0][0].getBBox().height).reduce((o, a) => o + a)
1880
+ );
1881
+ r.attr("height", h + 2 * l.noteMargin), t.height += h + 2 * l.noteMargin, y.bumpVerticalPos(h + 2 * l.noteMargin), t.stopy = t.starty + h + 2 * l.noteMargin, t.stopx = t.startx + n.width, y.insert(t.startx, t.starty, t.stopx, t.stopy), y.models.addNote(t);
1882
+ }, "drawNote"), Et = /* @__PURE__ */ f((e) => ({
1883
+ fontFamily: e.messageFontFamily,
1884
+ fontSize: e.messageFontSize,
1885
+ fontWeight: e.messageFontWeight
1886
+ }), "messageFont"), mt = /* @__PURE__ */ f((e) => ({
1887
+ fontFamily: e.noteFontFamily,
1888
+ fontSize: e.noteFontSize,
1889
+ fontWeight: e.noteFontWeight
1890
+ }), "noteFont"), Gt = /* @__PURE__ */ f((e) => ({
1891
+ fontFamily: e.actorFontFamily,
1892
+ fontSize: e.actorFontSize,
1893
+ fontWeight: e.actorFontWeight
1894
+ }), "actorFont");
1895
+ async function de(e, t) {
1896
+ y.bumpVerticalPos(10);
1897
+ const { startx: n, stopx: s, message: r } = t, i = I.splitBreaks(r).length, c = z(r), h = c ? await At(r, st()) : F.calculateTextDimensions(r, Et(l));
1898
+ if (!c) {
1899
+ const g = h.height / i;
1900
+ t.height += g, y.bumpVerticalPos(g);
1901
+ }
1902
+ let o, a = h.height - 10;
1903
+ const p = h.width;
1904
+ if (n === s) {
1905
+ o = y.getVerticalPos() + a, l.rightAngles || (a += l.boxMargin, o = y.getVerticalPos() + a), a += 30;
1906
+ const g = I.getMax(p / 2, l.width / 2);
1907
+ y.insert(
1908
+ n - g,
1909
+ y.getVerticalPos() - 10 + a,
1910
+ s + g,
1911
+ y.getVerticalPos() + 30 + a
1912
+ );
1913
+ } else
1914
+ a += l.boxMargin, o = y.getVerticalPos() + a, y.insert(n, o - 10, s, o);
1915
+ return y.bumpVerticalPos(a), t.height += a, t.stopy = t.starty + t.height, y.insert(t.fromBounds, t.starty, t.toBounds, t.stopy), o;
1916
+ }
1917
+ f(de, "boundMessage");
1918
+ var xs = /* @__PURE__ */ f(async function(e, t, n, s) {
1919
+ const { startx: r, stopx: i, starty: c, message: h, type: o, sequenceIndex: a, sequenceVisible: p } = t, g = F.calculateTextDimensions(h, Et(l)), x = Xt();
1920
+ x.x = r, x.y = c + 10, x.width = i - r, x.class = "messageText", x.dy = "1em", x.text = h, x.fontFamily = l.messageFontFamily, x.fontSize = l.messageFontSize, x.fontWeight = l.messageFontWeight, x.anchor = l.messageAlign, x.valign = "center", x.textMargin = l.wrapPadding, x.tspan = !1, z(x.text) ? await Dt(e, x, { startx: r, stopx: i, starty: n }) : vt(e, x);
1921
+ const T = g.width;
1922
+ let b;
1923
+ r === i ? l.rightAngles ? b = e.append("path").attr(
1924
+ "d",
1925
+ `M ${r},${n} H ${r + I.getMax(l.width / 2, T / 2)} V ${n + 25} H ${r}`
1926
+ ) : b = e.append("path").attr(
1927
+ "d",
1928
+ "M " + r + "," + n + " C " + (r + 60) + "," + (n - 10) + " " + (r + 60) + "," + (n + 30) + " " + r + "," + (n + 20)
1929
+ ) : (b = e.append("line"), b.attr("x1", r), b.attr("y1", n), b.attr("x2", i), b.attr("y2", n)), o === s.db.LINETYPE.DOTTED || o === s.db.LINETYPE.DOTTED_CROSS || o === s.db.LINETYPE.DOTTED_POINT || o === s.db.LINETYPE.DOTTED_OPEN || o === s.db.LINETYPE.BIDIRECTIONAL_DOTTED ? (b.style("stroke-dasharray", "3, 3"), b.attr("class", "messageLine1")) : b.attr("class", "messageLine0");
1930
+ let w = "";
1931
+ l.arrowMarkerAbsolute && (w = Ce(!0)), b.attr("stroke-width", 2), b.attr("stroke", "none"), b.style("fill", "none"), (o === s.db.LINETYPE.SOLID || o === s.db.LINETYPE.DOTTED) && b.attr("marker-end", "url(" + w + "#arrowhead)"), (o === s.db.LINETYPE.BIDIRECTIONAL_SOLID || o === s.db.LINETYPE.BIDIRECTIONAL_DOTTED) && (b.attr("marker-start", "url(" + w + "#arrowhead)"), b.attr("marker-end", "url(" + w + "#arrowhead)")), (o === s.db.LINETYPE.SOLID_POINT || o === s.db.LINETYPE.DOTTED_POINT) && b.attr("marker-end", "url(" + w + "#filled-head)"), (o === s.db.LINETYPE.SOLID_CROSS || o === s.db.LINETYPE.DOTTED_CROSS) && b.attr("marker-end", "url(" + w + "#crosshead)"), (p || l.showSequenceNumbers) && ((o === s.db.LINETYPE.BIDIRECTIONAL_SOLID || o === s.db.LINETYPE.BIDIRECTIONAL_DOTTED) && (r < i ? b.attr("x1", r + 2 * 6) : b.attr("x1", r + 6)), e.append("line").attr("x1", r).attr("y1", n).attr("x2", r).attr("y2", n).attr("stroke-width", 0).attr("marker-start", "url(" + w + "#sequencenumber)"), e.append("text").attr("x", r).attr("y", n + 4).attr("font-family", "sans-serif").attr("font-size", "12px").attr("text-anchor", "middle").attr("class", "sequenceNumber").text(a));
1932
+ }, "drawMessage"), fs = /* @__PURE__ */ f(function(e, t, n, s, r, i, c) {
1933
+ let h = 0, o = 0, a, p = 0;
1934
+ for (const g of s) {
1935
+ const x = t.get(g), T = x.box;
1936
+ a && a != T && (c || y.models.addBox(a), o += l.boxMargin + a.margin), T && T != a && (c || (T.x = h + o, T.y = r), o += T.margin), x.width = x.width || l.width, x.height = I.getMax(x.height || l.height, l.height), x.margin = x.margin || l.actorMargin, p = I.getMax(p, x.height), n.get(x.name) && (o += x.width / 2), x.x = h + o, x.starty = y.getVerticalPos(), y.insert(x.x, r, x.x + x.width, x.height), h += x.width + o, x.box && (x.box.width = h + T.margin - x.box.x), o = x.margin, a = x.box, y.models.addActor(x);
1937
+ }
1938
+ a && !c && y.models.addBox(a), y.bumpVerticalPos(p);
1939
+ }, "addActorRenderingData"), Kt = /* @__PURE__ */ f(async function(e, t, n, s) {
1940
+ if (s) {
1941
+ let r = 0;
1942
+ y.bumpVerticalPos(l.boxMargin * 2);
1943
+ for (const i of n) {
1944
+ const c = t.get(i);
1945
+ c.stopy || (c.stopy = y.getVerticalPos());
1946
+ const h = await V.drawActor(e, c, l, !0);
1947
+ r = I.getMax(r, h);
1948
+ }
1949
+ y.bumpVerticalPos(r + l.boxMargin);
1950
+ } else
1951
+ for (const r of n) {
1952
+ const i = t.get(r);
1953
+ await V.drawActor(e, i, l, !1);
1954
+ }
1955
+ }, "drawActors"), pe = /* @__PURE__ */ f(function(e, t, n, s) {
1956
+ let r = 0, i = 0;
1957
+ for (const c of n) {
1958
+ const h = t.get(c), o = ys(h), a = V.drawPopup(
1959
+ e,
1960
+ h,
1961
+ o,
1962
+ l,
1963
+ l.forceMenus,
1964
+ s
1965
+ );
1966
+ a.height > r && (r = a.height), a.width + h.x > i && (i = a.width + h.x);
1967
+ }
1968
+ return { maxHeight: r, maxWidth: i };
1969
+ }, "drawActorsPopup"), ue = /* @__PURE__ */ f(function(e) {
1970
+ Re(l, e), e.fontFamily && (l.actorFontFamily = l.noteFontFamily = l.messageFontFamily = e.fontFamily), e.fontSize && (l.actorFontSize = l.noteFontSize = l.messageFontSize = e.fontSize), e.fontWeight && (l.actorFontWeight = l.noteFontWeight = l.messageFontWeight = e.fontWeight);
1971
+ }, "setConf"), Bt = /* @__PURE__ */ f(function(e) {
1972
+ return y.activations.filter(function(t) {
1973
+ return t.actor === e;
1974
+ });
1975
+ }, "actorActivations"), ae = /* @__PURE__ */ f(function(e, t) {
1976
+ const n = t.get(e), s = Bt(e), r = s.reduce(
1977
+ function(c, h) {
1978
+ return I.getMin(c, h.startx);
1979
+ },
1980
+ n.x + n.width / 2 - 1
1981
+ ), i = s.reduce(
1982
+ function(c, h) {
1983
+ return I.getMax(c, h.stopx);
1984
+ },
1985
+ n.x + n.width / 2 + 1
1986
+ );
1987
+ return [r, i];
1988
+ }, "activationBounds");
1989
+ function nt(e, t, n, s, r) {
1990
+ y.bumpVerticalPos(n);
1991
+ let i = s;
1992
+ if (t.id && t.message && e[t.id]) {
1993
+ const c = e[t.id].width, h = Et(l);
1994
+ t.message = F.wrapLabel(`[${t.message}]`, c - 2 * l.wrapPadding, h), t.width = c, t.wrap = !0;
1995
+ const o = F.calculateTextDimensions(t.message, h), a = I.getMax(o.height, l.labelBoxHeight);
1996
+ i = s + a, Q.debug(`${a} - ${t.message}`);
1997
+ }
1998
+ r(t), y.bumpVerticalPos(i);
1999
+ }
2000
+ f(nt, "adjustLoopHeightForWrap");
2001
+ function ge(e, t, n, s, r, i, c) {
2002
+ function h(p, g) {
2003
+ p.x < r.get(e.from).x ? (y.insert(
2004
+ t.stopx - g,
2005
+ t.starty,
2006
+ t.startx,
2007
+ t.stopy + p.height / 2 + l.noteMargin
2008
+ ), t.stopx = t.stopx + g) : (y.insert(
2009
+ t.startx,
2010
+ t.starty,
2011
+ t.stopx + g,
2012
+ t.stopy + p.height / 2 + l.noteMargin
2013
+ ), t.stopx = t.stopx - g);
2014
+ }
2015
+ f(h, "receiverAdjustment");
2016
+ function o(p, g) {
2017
+ p.x < r.get(e.to).x ? (y.insert(
2018
+ t.startx - g,
2019
+ t.starty,
2020
+ t.stopx,
2021
+ t.stopy + p.height / 2 + l.noteMargin
2022
+ ), t.startx = t.startx + g) : (y.insert(
2023
+ t.stopx,
2024
+ t.starty,
2025
+ t.startx + g,
2026
+ t.stopy + p.height / 2 + l.noteMargin
2027
+ ), t.startx = t.startx - g);
2028
+ }
2029
+ f(o, "senderAdjustment");
2030
+ const a = [
2031
+ Rt.ACTOR,
2032
+ Rt.CONTROL,
2033
+ Rt.ENTITY,
2034
+ Rt.DATABASE
2035
+ ];
2036
+ if (i.get(e.to) == s) {
2037
+ const p = r.get(e.to), g = a.includes(p.type) ? yt / 2 + 3 : p.width / 2 + 3;
2038
+ h(p, g), p.starty = n - p.height / 2, y.bumpVerticalPos(p.height / 2);
2039
+ } else if (c.get(e.from) == s) {
2040
+ const p = r.get(e.from);
2041
+ if (l.mirrorActors) {
2042
+ const g = a.includes(p.type) ? yt / 2 : p.width / 2;
2043
+ o(p, g);
2044
+ }
2045
+ p.stopy = n - p.height / 2, y.bumpVerticalPos(p.height / 2);
2046
+ } else if (c.get(e.to) == s) {
2047
+ const p = r.get(e.to);
2048
+ if (l.mirrorActors) {
2049
+ const g = a.includes(p.type) ? yt / 2 + 3 : p.width / 2 + 3;
2050
+ h(p, g);
2051
+ }
2052
+ p.stopy = n - p.height / 2, y.bumpVerticalPos(p.height / 2);
2053
+ }
2054
+ }
2055
+ f(ge, "adjustCreatedDestroyedData");
2056
+ var Ts = /* @__PURE__ */ f(async function(e, t, n, s) {
2057
+ const { securityLevel: r, sequence: i } = st();
2058
+ l = i;
2059
+ let c;
2060
+ r === "sandbox" && (c = Mt("#i" + t));
2061
+ const h = r === "sandbox" ? Mt(c.nodes()[0].contentDocument.body) : Mt("body"), o = r === "sandbox" ? c.nodes()[0].contentDocument : document;
2062
+ y.init(), Q.debug(s.db);
2063
+ const a = r === "sandbox" ? h.select(`[id="${t}"]`) : Mt(`[id="${t}"]`), p = s.db.getActors(), g = s.db.getCreatedActors(), x = s.db.getDestroyedActors(), T = s.db.getBoxes();
2064
+ let b = s.db.getActorKeys();
2065
+ const w = s.db.getMessages(), k = s.db.getDiagramTitle(), N = s.db.hasAtLeastOneBox(), S = s.db.hasAtLeastOneBoxWithTitle(), M = await xe(p, w, s);
2066
+ if (l.height = await fe(p, M, T), V.insertComputerIcon(a), V.insertDatabaseIcon(a), V.insertClockIcon(a), N && (y.bumpVerticalPos(l.boxMargin), S && y.bumpVerticalPos(T[0].textMaxHeight)), l.hideUnusedParticipants === !0) {
2067
+ const E = /* @__PURE__ */ new Set();
2068
+ w.forEach((A) => {
2069
+ E.add(A.from), E.add(A.to);
2070
+ }), b = b.filter((A) => E.has(A));
2071
+ }
2072
+ fs(a, p, g, b, 0, w, !1);
2073
+ const C = await ms(w, p, M, s);
2074
+ V.insertArrowHead(a), V.insertArrowCrossHead(a), V.insertArrowFilledHead(a), V.insertSequenceNumber(a);
2075
+ function Y(E, A) {
2076
+ const X = y.endActivation(E);
2077
+ X.starty + 18 > A && (X.starty = A - 6, A += 12), V.drawActivation(
2078
+ a,
2079
+ X,
2080
+ A,
2081
+ l,
2082
+ Bt(E.from).length
2083
+ ), y.insert(X.startx, A - 10, X.stopx, A);
2084
+ }
2085
+ f(Y, "activeEnd");
2086
+ let H = 1, Z = 1;
2087
+ const at = [], U = [];
2088
+ let G = 0;
2089
+ for (const E of w) {
2090
+ let A, X, tt;
2091
+ switch (E.type) {
2092
+ case s.db.LINETYPE.NOTE:
2093
+ y.resetVerticalPos(), X = E.noteModel, await gs(a, X);
2094
+ break;
2095
+ case s.db.LINETYPE.ACTIVE_START:
2096
+ y.newActivation(E, a, p);
2097
+ break;
2098
+ case s.db.LINETYPE.ACTIVE_END:
2099
+ Y(E, y.getVerticalPos());
2100
+ break;
2101
+ case s.db.LINETYPE.LOOP_START:
2102
+ nt(
2103
+ C,
2104
+ E,
2105
+ l.boxMargin,
2106
+ l.boxMargin + l.boxTextMargin,
2107
+ (R) => y.newLoop(R)
2108
+ );
2109
+ break;
2110
+ case s.db.LINETYPE.LOOP_END:
2111
+ A = y.endLoop(), await V.drawLoop(a, A, "loop", l), y.bumpVerticalPos(A.stopy - y.getVerticalPos()), y.models.addLoop(A);
2112
+ break;
2113
+ case s.db.LINETYPE.RECT_START:
2114
+ nt(
2115
+ C,
2116
+ E,
2117
+ l.boxMargin,
2118
+ l.boxMargin,
2119
+ (R) => y.newLoop(void 0, R.message)
2120
+ );
2121
+ break;
2122
+ case s.db.LINETYPE.RECT_END:
2123
+ A = y.endLoop(), U.push(A), y.models.addLoop(A), y.bumpVerticalPos(A.stopy - y.getVerticalPos());
2124
+ break;
2125
+ case s.db.LINETYPE.OPT_START:
2126
+ nt(
2127
+ C,
2128
+ E,
2129
+ l.boxMargin,
2130
+ l.boxMargin + l.boxTextMargin,
2131
+ (R) => y.newLoop(R)
2132
+ );
2133
+ break;
2134
+ case s.db.LINETYPE.OPT_END:
2135
+ A = y.endLoop(), await V.drawLoop(a, A, "opt", l), y.bumpVerticalPos(A.stopy - y.getVerticalPos()), y.models.addLoop(A);
2136
+ break;
2137
+ case s.db.LINETYPE.ALT_START:
2138
+ nt(
2139
+ C,
2140
+ E,
2141
+ l.boxMargin,
2142
+ l.boxMargin + l.boxTextMargin,
2143
+ (R) => y.newLoop(R)
2144
+ );
2145
+ break;
2146
+ case s.db.LINETYPE.ALT_ELSE:
2147
+ nt(
2148
+ C,
2149
+ E,
2150
+ l.boxMargin + l.boxTextMargin,
2151
+ l.boxMargin,
2152
+ (R) => y.addSectionToLoop(R)
2153
+ );
2154
+ break;
2155
+ case s.db.LINETYPE.ALT_END:
2156
+ A = y.endLoop(), await V.drawLoop(a, A, "alt", l), y.bumpVerticalPos(A.stopy - y.getVerticalPos()), y.models.addLoop(A);
2157
+ break;
2158
+ case s.db.LINETYPE.PAR_START:
2159
+ case s.db.LINETYPE.PAR_OVER_START:
2160
+ nt(
2161
+ C,
2162
+ E,
2163
+ l.boxMargin,
2164
+ l.boxMargin + l.boxTextMargin,
2165
+ (R) => y.newLoop(R)
2166
+ ), y.saveVerticalPos();
2167
+ break;
2168
+ case s.db.LINETYPE.PAR_AND:
2169
+ nt(
2170
+ C,
2171
+ E,
2172
+ l.boxMargin + l.boxTextMargin,
2173
+ l.boxMargin,
2174
+ (R) => y.addSectionToLoop(R)
2175
+ );
2176
+ break;
2177
+ case s.db.LINETYPE.PAR_END:
2178
+ A = y.endLoop(), await V.drawLoop(a, A, "par", l), y.bumpVerticalPos(A.stopy - y.getVerticalPos()), y.models.addLoop(A);
2179
+ break;
2180
+ case s.db.LINETYPE.AUTONUMBER:
2181
+ H = E.message.start || H, Z = E.message.step || Z, E.message.visible ? s.db.enableSequenceNumbers() : s.db.disableSequenceNumbers();
2182
+ break;
2183
+ case s.db.LINETYPE.CRITICAL_START:
2184
+ nt(
2185
+ C,
2186
+ E,
2187
+ l.boxMargin,
2188
+ l.boxMargin + l.boxTextMargin,
2189
+ (R) => y.newLoop(R)
2190
+ );
2191
+ break;
2192
+ case s.db.LINETYPE.CRITICAL_OPTION:
2193
+ nt(
2194
+ C,
2195
+ E,
2196
+ l.boxMargin + l.boxTextMargin,
2197
+ l.boxMargin,
2198
+ (R) => y.addSectionToLoop(R)
2199
+ );
2200
+ break;
2201
+ case s.db.LINETYPE.CRITICAL_END:
2202
+ A = y.endLoop(), await V.drawLoop(a, A, "critical", l), y.bumpVerticalPos(A.stopy - y.getVerticalPos()), y.models.addLoop(A);
2203
+ break;
2204
+ case s.db.LINETYPE.BREAK_START:
2205
+ nt(
2206
+ C,
2207
+ E,
2208
+ l.boxMargin,
2209
+ l.boxMargin + l.boxTextMargin,
2210
+ (R) => y.newLoop(R)
2211
+ );
2212
+ break;
2213
+ case s.db.LINETYPE.BREAK_END:
2214
+ A = y.endLoop(), await V.drawLoop(a, A, "break", l), y.bumpVerticalPos(A.stopy - y.getVerticalPos()), y.models.addLoop(A);
2215
+ break;
2216
+ default:
2217
+ try {
2218
+ tt = E.msgModel, tt.starty = y.getVerticalPos(), tt.sequenceIndex = H, tt.sequenceVisible = s.db.showSequenceNumbers();
2219
+ const R = await de(a, tt);
2220
+ ge(
2221
+ E,
2222
+ tt,
2223
+ R,
2224
+ G,
2225
+ p,
2226
+ g,
2227
+ x
2228
+ ), at.push({ messageModel: tt, lineStartY: R }), y.models.addMessage(tt);
2229
+ } catch (R) {
2230
+ Q.error("error while drawing message", R);
2231
+ }
2232
+ }
2233
+ [
2234
+ s.db.LINETYPE.SOLID_OPEN,
2235
+ s.db.LINETYPE.DOTTED_OPEN,
2236
+ s.db.LINETYPE.SOLID,
2237
+ s.db.LINETYPE.DOTTED,
2238
+ s.db.LINETYPE.SOLID_CROSS,
2239
+ s.db.LINETYPE.DOTTED_CROSS,
2240
+ s.db.LINETYPE.SOLID_POINT,
2241
+ s.db.LINETYPE.DOTTED_POINT,
2242
+ s.db.LINETYPE.BIDIRECTIONAL_SOLID,
2243
+ s.db.LINETYPE.BIDIRECTIONAL_DOTTED
2244
+ ].includes(E.type) && (H = H + Z), G++;
2245
+ }
2246
+ Q.debug("createdActors", g), Q.debug("destroyedActors", x), await Kt(a, p, b, !1);
2247
+ for (const E of at)
2248
+ await xs(a, E.messageModel, E.lineStartY, s);
2249
+ l.mirrorActors && await Kt(a, p, b, !0), U.forEach((E) => V.drawBackgroundRect(a, E)), ce(a, p, b, l);
2250
+ for (const E of y.models.boxes) {
2251
+ E.height = y.getVerticalPos() - E.y, y.insert(E.x, E.y, E.x + E.width, E.height);
2252
+ const A = l.boxMargin * 2;
2253
+ E.startx = E.x - A, E.starty = E.y - A * 0.25, E.stopx = E.startx + E.width + 2 * A, E.stopy = E.starty + E.height + A * 0.75, E.stroke = "rgb(0,0,0, 0.5)", V.drawBox(a, E, l);
2254
+ }
2255
+ N && y.bumpVerticalPos(l.boxMargin);
2256
+ const q = pe(a, p, b, o), { bounds: O } = y.getBounds();
2257
+ O.startx === void 0 && (O.startx = 0), O.starty === void 0 && (O.starty = 0), O.stopx === void 0 && (O.stopx = 0), O.stopy === void 0 && (O.stopy = 0);
2258
+ let $ = O.stopy - O.starty;
2259
+ $ < q.maxHeight && ($ = q.maxHeight);
2260
+ let K = $ + 2 * l.diagramMarginY;
2261
+ l.mirrorActors && (K = K - l.boxMargin + l.bottomMarginAdj);
2262
+ let j = O.stopx - O.startx;
2263
+ j < q.maxWidth && (j = q.maxWidth);
2264
+ const rt = j + 2 * l.diagramMarginX;
2265
+ k && a.append("text").text(k).attr("x", (O.stopx - O.startx) / 2 - 2 * l.diagramMarginX).attr("y", -25), De(a, K, rt, l.useMaxWidth);
2266
+ const D = k ? 40 : 0;
2267
+ a.attr(
2268
+ "viewBox",
2269
+ O.startx - l.diagramMarginX + " -" + (l.diagramMarginY + D) + " " + rt + " " + (K + D)
2270
+ ), Q.debug("models:", y.models);
2271
+ }, "draw");
2272
+ async function xe(e, t, n) {
2273
+ const s = {};
2274
+ for (const r of t)
2275
+ if (e.get(r.to) && e.get(r.from)) {
2276
+ const i = e.get(r.to);
2277
+ if (r.placement === n.db.PLACEMENT.LEFTOF && !i.prevActor || r.placement === n.db.PLACEMENT.RIGHTOF && !i.nextActor)
2278
+ continue;
2279
+ const c = r.placement !== void 0, h = !c, o = c ? mt(l) : Et(l), a = r.wrap ? F.wrapLabel(r.message, l.width - 2 * l.wrapPadding, o) : r.message, g = (z(a) ? await At(r.message, st()) : F.calculateTextDimensions(a, o)).width + 2 * l.wrapPadding;
2280
+ h && r.from === i.nextActor ? s[r.to] = I.getMax(
2281
+ s[r.to] || 0,
2282
+ g
2283
+ ) : h && r.from === i.prevActor ? s[r.from] = I.getMax(
2284
+ s[r.from] || 0,
2285
+ g
2286
+ ) : h && r.from === r.to ? (s[r.from] = I.getMax(
2287
+ s[r.from] || 0,
2288
+ g / 2
2289
+ ), s[r.to] = I.getMax(
2290
+ s[r.to] || 0,
2291
+ g / 2
2292
+ )) : r.placement === n.db.PLACEMENT.RIGHTOF ? s[r.from] = I.getMax(
2293
+ s[r.from] || 0,
2294
+ g
2295
+ ) : r.placement === n.db.PLACEMENT.LEFTOF ? s[i.prevActor] = I.getMax(
2296
+ s[i.prevActor] || 0,
2297
+ g
2298
+ ) : r.placement === n.db.PLACEMENT.OVER && (i.prevActor && (s[i.prevActor] = I.getMax(
2299
+ s[i.prevActor] || 0,
2300
+ g / 2
2301
+ )), i.nextActor && (s[r.from] = I.getMax(
2302
+ s[r.from] || 0,
2303
+ g / 2
2304
+ )));
2305
+ }
2306
+ return Q.debug("maxMessageWidthPerActor:", s), s;
2307
+ }
2308
+ f(xe, "getMaxMessageWidthPerActor");
2309
+ var ys = /* @__PURE__ */ f(function(e) {
2310
+ let t = 0;
2311
+ const n = Gt(l);
2312
+ for (const s in e.links) {
2313
+ const i = F.calculateTextDimensions(s, n).width + 2 * l.wrapPadding + 2 * l.boxMargin;
2314
+ t < i && (t = i);
2315
+ }
2316
+ return t;
2317
+ }, "getRequiredPopupWidth");
2318
+ async function fe(e, t, n) {
2319
+ let s = 0;
2320
+ for (const i of e.keys()) {
2321
+ const c = e.get(i);
2322
+ c.wrap && (c.description = F.wrapLabel(
2323
+ c.description,
2324
+ l.width - 2 * l.wrapPadding,
2325
+ Gt(l)
2326
+ ));
2327
+ const h = z(c.description) ? await At(c.description, st()) : F.calculateTextDimensions(c.description, Gt(l));
2328
+ c.width = c.wrap ? l.width : I.getMax(l.width, h.width + 2 * l.wrapPadding), c.height = c.wrap ? I.getMax(h.height, l.height) : l.height, s = I.getMax(s, c.height);
2329
+ }
2330
+ for (const i in t) {
2331
+ const c = e.get(i);
2332
+ if (!c)
2333
+ continue;
2334
+ const h = e.get(c.nextActor);
2335
+ if (!h) {
2336
+ const g = t[i] + l.actorMargin - c.width / 2;
2337
+ c.margin = I.getMax(g, l.actorMargin);
2338
+ continue;
2339
+ }
2340
+ const a = t[i] + l.actorMargin - c.width / 2 - h.width / 2;
2341
+ c.margin = I.getMax(a, l.actorMargin);
2342
+ }
2343
+ let r = 0;
2344
+ return n.forEach((i) => {
2345
+ const c = Et(l);
2346
+ let h = i.actorKeys.reduce((g, x) => g += e.get(x).width + (e.get(x).margin || 0), 0);
2347
+ const o = l.boxMargin * 8;
2348
+ h += o, h -= 2 * l.boxTextMargin, i.wrap && (i.name = F.wrapLabel(i.name, h - 2 * l.wrapPadding, c));
2349
+ const a = F.calculateTextDimensions(i.name, c);
2350
+ r = I.getMax(a.height, r);
2351
+ const p = I.getMax(h, a.width + 2 * l.wrapPadding);
2352
+ if (i.margin = l.boxTextMargin, h < p) {
2353
+ const g = (p - h) / 2;
2354
+ i.margin += g;
2355
+ }
2356
+ }), n.forEach((i) => i.textMaxHeight = r), I.getMax(s, l.height);
2357
+ }
2358
+ f(fe, "calculateActorMargins");
2359
+ var Es = /* @__PURE__ */ f(async function(e, t, n) {
2360
+ const s = t.get(e.from), r = t.get(e.to), i = s.x, c = r.x, h = e.wrap && e.message;
2361
+ let o = z(e.message) ? await At(e.message, st()) : F.calculateTextDimensions(
2362
+ h ? F.wrapLabel(e.message, l.width, mt(l)) : e.message,
2363
+ mt(l)
2364
+ );
2365
+ const a = {
2366
+ width: h ? l.width : I.getMax(l.width, o.width + 2 * l.noteMargin),
2367
+ height: 0,
2368
+ startx: s.x,
2369
+ stopx: 0,
2370
+ starty: 0,
2371
+ stopy: 0,
2372
+ message: e.message
2373
+ };
2374
+ return e.placement === n.db.PLACEMENT.RIGHTOF ? (a.width = h ? I.getMax(l.width, o.width) : I.getMax(
2375
+ s.width / 2 + r.width / 2,
2376
+ o.width + 2 * l.noteMargin
2377
+ ), a.startx = i + (s.width + l.actorMargin) / 2) : e.placement === n.db.PLACEMENT.LEFTOF ? (a.width = h ? I.getMax(l.width, o.width + 2 * l.noteMargin) : I.getMax(
2378
+ s.width / 2 + r.width / 2,
2379
+ o.width + 2 * l.noteMargin
2380
+ ), a.startx = i - a.width + (s.width - l.actorMargin) / 2) : e.to === e.from ? (o = F.calculateTextDimensions(
2381
+ h ? F.wrapLabel(e.message, I.getMax(l.width, s.width), mt(l)) : e.message,
2382
+ mt(l)
2383
+ ), a.width = h ? I.getMax(l.width, s.width) : I.getMax(s.width, l.width, o.width + 2 * l.noteMargin), a.startx = i + (s.width - a.width) / 2) : (a.width = Math.abs(i + s.width / 2 - (c + r.width / 2)) + l.actorMargin, a.startx = i < c ? i + s.width / 2 - l.actorMargin / 2 : c + r.width / 2 - l.actorMargin / 2), h && (a.message = F.wrapLabel(
2384
+ e.message,
2385
+ a.width - 2 * l.wrapPadding,
2386
+ mt(l)
2387
+ )), Q.debug(
2388
+ `NM:[${a.startx},${a.stopx},${a.starty},${a.stopy}:${a.width},${a.height}=${e.message}]`
2389
+ ), a;
2390
+ }, "buildNoteModel"), bs = /* @__PURE__ */ f(function(e, t, n) {
2391
+ if (![
2392
+ n.db.LINETYPE.SOLID_OPEN,
2393
+ n.db.LINETYPE.DOTTED_OPEN,
2394
+ n.db.LINETYPE.SOLID,
2395
+ n.db.LINETYPE.DOTTED,
2396
+ n.db.LINETYPE.SOLID_CROSS,
2397
+ n.db.LINETYPE.DOTTED_CROSS,
2398
+ n.db.LINETYPE.SOLID_POINT,
2399
+ n.db.LINETYPE.DOTTED_POINT,
2400
+ n.db.LINETYPE.BIDIRECTIONAL_SOLID,
2401
+ n.db.LINETYPE.BIDIRECTIONAL_DOTTED
2402
+ ].includes(e.type))
2403
+ return {};
2404
+ const [s, r] = ae(e.from, t), [i, c] = ae(e.to, t), h = s <= i;
2405
+ let o = h ? r : s, a = h ? i : c;
2406
+ const p = Math.abs(i - c) > 2, g = /* @__PURE__ */ f((w) => h ? -w : w, "adjustValue");
2407
+ e.from === e.to ? a = o : (e.activate && !p && (a += g(l.activationWidth / 2 - 1)), [n.db.LINETYPE.SOLID_OPEN, n.db.LINETYPE.DOTTED_OPEN].includes(e.type) || (a += g(3)), [n.db.LINETYPE.BIDIRECTIONAL_SOLID, n.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(
2408
+ e.type
2409
+ ) && (o -= g(3)));
2410
+ const x = [s, r, i, c], T = Math.abs(o - a);
2411
+ e.wrap && e.message && (e.message = F.wrapLabel(
2412
+ e.message,
2413
+ I.getMax(T + 2 * l.wrapPadding, l.width),
2414
+ Et(l)
2415
+ ));
2416
+ const b = F.calculateTextDimensions(e.message, Et(l));
2417
+ return {
2418
+ width: I.getMax(
2419
+ e.wrap ? 0 : b.width + 2 * l.wrapPadding,
2420
+ T + 2 * l.wrapPadding,
2421
+ l.width
2422
+ ),
2423
+ height: 0,
2424
+ startx: o,
2425
+ stopx: a,
2426
+ starty: 0,
2427
+ stopy: 0,
2428
+ message: e.message,
2429
+ type: e.type,
2430
+ wrap: e.wrap,
2431
+ fromBounds: Math.min.apply(null, x),
2432
+ toBounds: Math.max.apply(null, x)
2433
+ };
2434
+ }, "buildMessageModel"), ms = /* @__PURE__ */ f(async function(e, t, n, s) {
2435
+ const r = {}, i = [];
2436
+ let c, h, o;
2437
+ for (const a of e) {
2438
+ switch (a.type) {
2439
+ case s.db.LINETYPE.LOOP_START:
2440
+ case s.db.LINETYPE.ALT_START:
2441
+ case s.db.LINETYPE.OPT_START:
2442
+ case s.db.LINETYPE.PAR_START:
2443
+ case s.db.LINETYPE.PAR_OVER_START:
2444
+ case s.db.LINETYPE.CRITICAL_START:
2445
+ case s.db.LINETYPE.BREAK_START:
2446
+ i.push({
2447
+ id: a.id,
2448
+ msg: a.message,
2449
+ from: Number.MAX_SAFE_INTEGER,
2450
+ to: Number.MIN_SAFE_INTEGER,
2451
+ width: 0
2452
+ });
2453
+ break;
2454
+ case s.db.LINETYPE.ALT_ELSE:
2455
+ case s.db.LINETYPE.PAR_AND:
2456
+ case s.db.LINETYPE.CRITICAL_OPTION:
2457
+ a.message && (c = i.pop(), r[c.id] = c, r[a.id] = c, i.push(c));
2458
+ break;
2459
+ case s.db.LINETYPE.LOOP_END:
2460
+ case s.db.LINETYPE.ALT_END:
2461
+ case s.db.LINETYPE.OPT_END:
2462
+ case s.db.LINETYPE.PAR_END:
2463
+ case s.db.LINETYPE.CRITICAL_END:
2464
+ case s.db.LINETYPE.BREAK_END:
2465
+ c = i.pop(), r[c.id] = c;
2466
+ break;
2467
+ case s.db.LINETYPE.ACTIVE_START:
2468
+ {
2469
+ const g = t.get(a.from ? a.from : a.to.actor), x = Bt(a.from ? a.from : a.to.actor).length, T = g.x + g.width / 2 + (x - 1) * l.activationWidth / 2, b = {
2470
+ startx: T,
2471
+ stopx: T + l.activationWidth,
2472
+ actor: a.from,
2473
+ enabled: !0
2474
+ };
2475
+ y.activations.push(b);
2476
+ }
2477
+ break;
2478
+ case s.db.LINETYPE.ACTIVE_END:
2479
+ {
2480
+ const g = y.activations.map((x) => x.actor).lastIndexOf(a.from);
2481
+ y.activations.splice(g, 1).splice(0, 1);
2482
+ }
2483
+ break;
2484
+ }
2485
+ a.placement !== void 0 ? (h = await Es(a, t, s), a.noteModel = h, i.forEach((g) => {
2486
+ c = g, c.from = I.getMin(c.from, h.startx), c.to = I.getMax(c.to, h.startx + h.width), c.width = I.getMax(c.width, Math.abs(c.from - c.to)) - l.labelBoxWidth;
2487
+ })) : (o = bs(a, t, s), a.msgModel = o, o.startx && o.stopx && i.length > 0 && i.forEach((g) => {
2488
+ if (c = g, o.startx === o.stopx) {
2489
+ const x = t.get(a.from), T = t.get(a.to);
2490
+ c.from = I.getMin(
2491
+ x.x - o.width / 2,
2492
+ x.x - x.width / 2,
2493
+ c.from
2494
+ ), c.to = I.getMax(
2495
+ T.x + o.width / 2,
2496
+ T.x + x.width / 2,
2497
+ c.to
2498
+ ), c.width = I.getMax(c.width, Math.abs(c.to - c.from)) - l.labelBoxWidth;
2499
+ } else
2500
+ c.from = I.getMin(o.startx, c.from), c.to = I.getMax(o.stopx, c.to), c.width = I.getMax(c.width, o.width) - l.labelBoxWidth;
2501
+ }));
2502
+ }
2503
+ return y.activations = [], Q.debug("Loop type widths:", r), r;
2504
+ }, "calculateLoopBounds"), ws = {
2505
+ bounds: y,
2506
+ drawActors: Kt,
2507
+ drawActorsPopup: pe,
2508
+ setConf: ue,
2509
+ draw: Ts
2510
+ }, _s = {
2511
+ parser: Ve,
2512
+ get db() {
2513
+ return new qe();
2514
+ },
2515
+ renderer: ws,
2516
+ styles: He,
2517
+ init: /* @__PURE__ */ f((e) => {
2518
+ e.sequence || (e.sequence = {}), e.wrap && (e.sequence.wrap = e.wrap, Me({ sequence: { wrap: e.wrap } }));
2519
+ }, "init")
2520
+ };
2521
+ export {
2522
+ _s as diagram
2523
+ };