@hienlh/ppm 0.8.53 → 0.8.55

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 (165) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/bun.lock +250 -1
  3. package/dist/web/assets/_basePickBy-CZovQgWd.js +1 -0
  4. package/dist/web/assets/_baseUniq-ClnvscgW.js +1 -0
  5. package/dist/web/assets/{api-client-TUmacMRS.js → api-client-DpGMOZNf.js} +1 -1
  6. package/dist/web/assets/api-settings--eVrUeZM.js +1 -0
  7. package/dist/web/assets/arc-C2Qaz-ch.js +1 -0
  8. package/dist/web/assets/architecture-PBZL5I3N-ChOahOB7.js +1 -0
  9. package/dist/web/assets/architectureDiagram-2XIMDMQ5-Jq91S_rs.js +36 -0
  10. package/dist/web/assets/array-BGFCBI0e.js +1 -0
  11. package/dist/web/assets/blockDiagram-WCTKOSBZ-CKGufRTy.js +132 -0
  12. package/dist/web/assets/c4Diagram-IC4MRINW-BNP2L9r_.js +10 -0
  13. package/dist/web/assets/channel-w7yboq56.js +1 -0
  14. package/dist/web/assets/chat-tab-BUOCxR2G.js +7 -0
  15. package/dist/web/assets/chunk-4BX2VUAB-BptTlTyl.js +1 -0
  16. package/dist/web/assets/chunk-55IACEB6-C4mUdyio.js +1 -0
  17. package/dist/web/assets/chunk-7E7YKBS2-6xAQfBwa.js +1 -0
  18. package/dist/web/assets/chunk-7R4GIKGN-DXaGAn_K.js +80 -0
  19. package/dist/web/assets/chunk-C72U2L5F-DOtEiN5f.js +1 -0
  20. package/dist/web/assets/chunk-CFjPhJqf.js +1 -0
  21. package/dist/web/assets/chunk-EGIJ26TM-D0KJTa_T.js +1 -0
  22. package/dist/web/assets/chunk-FMBD7UC4-C_1aG0eb.js +15 -0
  23. package/dist/web/assets/chunk-GEFDOKGD-DwVPiYfW.js +2 -0
  24. package/dist/web/assets/chunk-GLR3WWYH-D9pZakqr.js +2 -0
  25. package/dist/web/assets/chunk-HHEYEP7N-Dld5BpGB.js +1 -0
  26. package/dist/web/assets/chunk-JSJVCQXG-BSrqCL_3.js +1 -0
  27. package/dist/web/assets/chunk-KX2RTZJC-BCxGmbzy.js +1 -0
  28. package/dist/web/assets/chunk-KYZI473N-BKO5gMeU.js +53 -0
  29. package/dist/web/assets/chunk-L3YUKLVL-3wBgkSvL.js +1 -0
  30. package/dist/web/assets/chunk-MX3YWQON-BgjSEzus.js +1 -0
  31. package/dist/web/assets/chunk-NQ4KR5QH-DLrZwBEm.js +220 -0
  32. package/dist/web/assets/chunk-O4XLMI2P-BurQy8tt.js +7 -0
  33. package/dist/web/assets/chunk-OZEHJAEY-YTn24bGg.js +1 -0
  34. package/dist/web/assets/chunk-PQ6SQG4A-BxtUGYhW.js +1 -0
  35. package/dist/web/assets/chunk-PU5JKC2W-B66ELkQm.js +70 -0
  36. package/dist/web/assets/chunk-QZHKN3VN-DwSXwtjH.js +1 -0
  37. package/dist/web/assets/chunk-R5LLSJPH-euR2RxLN.js +1 -0
  38. package/dist/web/assets/chunk-WL4C6EOR-_2CBOJdI.js +189 -0
  39. package/dist/web/assets/chunk-XIRO2GV7-kqQ0g6wW.js +1 -0
  40. package/dist/web/assets/chunk-XPW4576I-CtcaMb09.js +32 -0
  41. package/dist/web/assets/chunk-XZSTWKYB-BYxFzZwS.js +94 -0
  42. package/dist/web/assets/chunk-YBOYWFTD-Dx_fX35n.js +1 -0
  43. package/dist/web/assets/classDiagram-VBA2DB6C-BpJ6Oog2.js +1 -0
  44. package/dist/web/assets/classDiagram-v2-RAHNMMFH-Bj8gIhkP.js +1 -0
  45. package/dist/web/assets/clone-BSi6cgDh.js +1 -0
  46. package/dist/web/assets/code-editor-os78eUN8.js +1 -0
  47. package/dist/web/assets/columns-2-ChOTgl3e.js +1 -0
  48. package/dist/web/assets/cose-bilkent-S5V4N54A-CHHjH2dV.js +1 -0
  49. package/dist/web/assets/cytoscape.esm-Ccan6xou.js +321 -0
  50. package/dist/web/assets/dagre-CNtSxiE_.js +1 -0
  51. package/dist/web/assets/dagre-KLK3FWXG-ChenfPp1.js +4 -0
  52. package/dist/web/assets/database-viewer-DTwe0h8F.js +1 -0
  53. package/dist/web/assets/defaultLocale-CRZydyG6.js +1 -0
  54. package/dist/web/assets/diagram-E7M64L7V-CzKYZM0Y.js +24 -0
  55. package/dist/web/assets/diagram-IFDJBPK2-ChB_paPo.js +43 -0
  56. package/dist/web/assets/diagram-P4PSJMXO-D1eW1dkL.js +24 -0
  57. package/dist/web/assets/diff-viewer-CSyOOmS2.js +4 -0
  58. package/dist/web/assets/dist-Cce3efmT.js +1 -0
  59. package/dist/web/assets/{dist-QgqOdSYG.js → dist-T0Vhi0Mh.js} +1 -1
  60. package/dist/web/assets/erDiagram-INFDFZHY-mCvUFSn6.js +70 -0
  61. package/dist/web/assets/flowDiagram-PKNHOUZH-14ohZ1M1.js +162 -0
  62. package/dist/web/assets/ganttDiagram-A5KZAMGK-DIX0pLbk.js +292 -0
  63. package/dist/web/assets/git-graph-CwYW3F4P.js +1 -0
  64. package/dist/web/assets/gitGraph-HDMCJU4V-CEee2FCA.js +1 -0
  65. package/dist/web/assets/gitGraphDiagram-K3NZZRJ6-yEWZbdf_.js +65 -0
  66. package/dist/web/assets/graphlib-DhOZxqsh.js +1 -0
  67. package/dist/web/assets/index-WKLuYsBY.css +2 -0
  68. package/dist/web/assets/index-yMR7OUDx.js +37 -0
  69. package/dist/web/assets/info-3K5VOQVL-ce_pi3En.js +1 -0
  70. package/dist/web/assets/infoDiagram-LFFYTUFH-BzqyoqXw.js +2 -0
  71. package/dist/web/assets/init-B8gtcn7T.js +1 -0
  72. package/dist/web/assets/input-Brjz2Vv-.js +41 -0
  73. package/dist/web/assets/isArrayLikeObject-B4pdpV8V.js +1 -0
  74. package/dist/web/assets/isEmpty-C0YYdhYj.js +1 -0
  75. package/dist/web/assets/ishikawaDiagram-PHBUUO56-olazD6dZ.js +70 -0
  76. package/dist/web/assets/journeyDiagram-4ABVD52K-CttDH9bb.js +139 -0
  77. package/dist/web/assets/jsx-runtime-BRW_vwa9.js +1 -0
  78. package/dist/web/assets/kanban-definition-K7BYSVSG-BBXbI37U.js +89 -0
  79. package/dist/web/assets/katex-Bbu770d9.js +265 -0
  80. package/dist/web/assets/keybindings-store-B-BLLKiZ.js +1 -0
  81. package/dist/web/assets/line-DBLLF7lH.js +1 -0
  82. package/dist/web/assets/linear-BLFWatDe.js +1 -0
  83. package/dist/web/assets/markdown-renderer-DQWY7QvX.js +69 -0
  84. package/dist/web/assets/math-DwgHI-Cu.js +1 -0
  85. package/dist/web/assets/mermaid-parser.core-BKiGOTjR.js +4 -0
  86. package/dist/web/assets/mindmap-definition-YRQLILUH-DoT7m4Sz.js +68 -0
  87. package/dist/web/assets/ordinal-CCj7PWgZ.js +1 -0
  88. package/dist/web/assets/packet-RMMSAZCW-CdYSLjRL.js +1 -0
  89. package/dist/web/assets/path-DZF-JdEe.js +1 -0
  90. package/dist/web/assets/pie-UPGHQEXC-Bm5LiD-6.js +1 -0
  91. package/dist/web/assets/pieDiagram-SKSYHLDU-Bkh2E4zE.js +30 -0
  92. package/dist/web/assets/postgres-viewer-Ctv7NTI_.js +1 -0
  93. package/dist/web/assets/preload-helper-qlgyTAkD.js +1 -0
  94. package/dist/web/assets/quadrantDiagram-337W2JSQ-B7zgALOL.js +7 -0
  95. package/dist/web/assets/radar-KQ55EAFF-C4PnyG7_.js +1 -0
  96. package/dist/web/assets/react-BGf7KNLk.js +1 -0
  97. package/dist/web/assets/react-nm2Ru1Pt.js +1 -0
  98. package/dist/web/assets/requirementDiagram-Z7DCOOCP-D_5GXNRo.js +73 -0
  99. package/dist/web/assets/rough.esm-VLpapkIG.js +1 -0
  100. package/dist/web/assets/sankeyDiagram-WA2Y5GQK-BA9EFAAe.js +10 -0
  101. package/dist/web/assets/sequenceDiagram-2WXFIKYE-fyWIrHiG.js +145 -0
  102. package/dist/web/assets/settings-store-Bbhg_ptG.js +2 -0
  103. package/dist/web/assets/settings-tab-Daap0c_B.js +1 -0
  104. package/dist/web/assets/sqlite-viewer-DtNk76CE.js +1 -0
  105. package/dist/web/assets/src-BoSBNdA_.js +1 -0
  106. package/dist/web/assets/stateDiagram-RAJIS63D-DfRBcaBu.js +1 -0
  107. package/dist/web/assets/stateDiagram-v2-FVOUBMTO-CMN4M2Em.js +1 -0
  108. package/dist/web/assets/{tab-store-NOBndc0_.js → tab-store-dpsCvqhH.js} +1 -1
  109. package/dist/web/assets/{table-B6neW6Hr.js → table-Yo02WRH-.js} +1 -1
  110. package/dist/web/assets/{tag-DJUYe5BQ.js → tag-CaC1ng2E.js} +1 -1
  111. package/dist/web/assets/{terminal-tab-DAFbT7Sv.js → terminal-tab-JEpjt3RD.js} +2 -2
  112. package/dist/web/assets/timeline-definition-YZTLITO2-DYfwJ1jM.js +61 -0
  113. package/dist/web/assets/treemap-KZPCXAKY-2_y-mhkz.js +1 -0
  114. package/dist/web/assets/{use-monaco-theme-DwP4EHdO.js → use-monaco-theme-DHbyUrzJ.js} +1 -1
  115. package/dist/web/assets/vennDiagram-LZ73GAT5-DqbKNRD9.js +34 -0
  116. package/dist/web/assets/xychartDiagram-JWTSCODW-DhUL86qT.js +7 -0
  117. package/dist/web/index.html +13 -11
  118. package/dist/web/sw.js +1 -1
  119. package/docs/project-changelog.md +78 -0
  120. package/docs/project-roadmap.md +1 -0
  121. package/docs/system-architecture.md +13 -1
  122. package/package.json +2 -1
  123. package/src/cli/commands/stop.ts +3 -2
  124. package/src/cli/commands/upgrade.ts +49 -0
  125. package/src/index.ts +9 -0
  126. package/src/providers/claude-agent-sdk.ts +7 -0
  127. package/src/server/index.ts +31 -18
  128. package/src/server/routes/accounts.ts +3 -8
  129. package/src/server/routes/upgrade.ts +57 -0
  130. package/src/services/account-selector.service.ts +52 -9
  131. package/src/services/db.service.ts +1 -1
  132. package/src/services/fs-browse.service.ts +10 -7
  133. package/src/services/supervisor.ts +83 -1
  134. package/src/services/upgrade.service.ts +115 -0
  135. package/src/web/app.tsx +12 -0
  136. package/src/web/components/chat/account-dialogs.tsx +377 -0
  137. package/src/web/components/chat/message-list.tsx +196 -45
  138. package/src/web/components/chat/usage-badge.tsx +56 -20
  139. package/src/web/components/layout/upgrade-banner.tsx +102 -0
  140. package/src/web/components/settings/settings-tab.tsx +2 -5
  141. package/src/web/components/shared/diagram-overlay.tsx +139 -0
  142. package/src/web/components/shared/image-overlay.tsx +45 -0
  143. package/src/web/components/shared/markdown-renderer.tsx +55 -2
  144. package/src/web/stores/diagram-overlay-store.ts +16 -0
  145. package/src/web/stores/image-overlay-store.ts +18 -0
  146. package/dist/web/assets/api-settings-D4bgXrLU.js +0 -1
  147. package/dist/web/assets/chat-tab-wunayDmr.js +0 -7
  148. package/dist/web/assets/code-editor-Fw_VrmHT.js +0 -1
  149. package/dist/web/assets/columns-2-BZ5wv2wA.js +0 -1
  150. package/dist/web/assets/database-viewer-CZjxdELm.js +0 -1
  151. package/dist/web/assets/diff-viewer-B51YfMeK.js +0 -4
  152. package/dist/web/assets/git-graph-fCVmtbaj.js +0 -1
  153. package/dist/web/assets/index-CoyMn-Mj.css +0 -2
  154. package/dist/web/assets/index-DMlEKjZt.js +0 -37
  155. package/dist/web/assets/input-CE3bFwLk.js +0 -41
  156. package/dist/web/assets/jsx-runtime-wQxeESYQ.js +0 -1
  157. package/dist/web/assets/keybindings-store-BzXZa5uC.js +0 -1
  158. package/dist/web/assets/markdown-renderer-D_OeJdOH.js +0 -59
  159. package/dist/web/assets/postgres-viewer-BlEIES7N.js +0 -1
  160. package/dist/web/assets/react-CYzKIDNi.js +0 -1
  161. package/dist/web/assets/react-rgzL83kk.js +0 -1
  162. package/dist/web/assets/settings-store-DL2KEbtc.js +0 -2
  163. package/dist/web/assets/settings-tab-DnU5t6Fy.js +0 -1
  164. package/dist/web/assets/sqlite-viewer-BJ2s8Dng.js +0 -1
  165. /package/dist/web/assets/{utils-DC-bdPS3.js → utils-btZ8C8-R.js} +0 -0
@@ -0,0 +1,145 @@
1
+ import{f as e,h as t}from"./chunk-GEFDOKGD-DwVPiYfW.js";import{g as n,h as r,p as i}from"./src-BoSBNdA_.js";import{B as a,C as o,D as s,L as c,P as l,U as u,V as d,W as f,_ as p,a as m,b as h,c as g,i as _,k as v,r as y,s as b,v as x,y as S}from"./chunk-7R4GIKGN-DXaGAn_K.js";import{t as C}from"./dist-Cce3efmT.js";import{a as w,c as T,i as E,n as D,r as O,s as k}from"./chunk-JSJVCQXG-BSrqCL_3.js";import{n as A,t as j}from"./chunk-XPW4576I-CtcaMb09.js";import{t as M}from"./chunk-QZHKN3VN-DwSXwtjH.js";var N=C(),P=(function(){var e=r(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),t=[1,2],n=[1,3],i=[1,4],a=[2,4],o=[1,9],s=[1,11],c=[1,12],l=[1,14],u=[1,15],d=[1,17],f=[1,18],p=[1,19],m=[1,25],h=[1,26],g=[1,27],_=[1,28],v=[1,29],y=[1,30],b=[1,31],x=[1,32],S=[1,33],C=[1,34],w=[1,35],T=[1,36],E=[1,37],D=[1,38],O=[1,39],k=[1,40],A=[1,42],j=[1,43],M=[1,44],N=[1,45],P=[1,46],F=[1,47],I=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],ee=[1,74],te=[1,80],ne=[1,81],re=[1,82],ie=[1,83],L=[1,84],R=[1,85],z=[1,86],ae=[1,87],B=[1,88],V=[1,89],oe=[1,90],H=[1,91],U=[1,92],W=[1,93],se=[1,94],G=[1,95],ce=[1,96],le=[1,97],ue=[1,98],de=[1,99],fe=[1,100],pe=[1,101],me=[1,102],he=[1,103],ge=[1,104],_e=[1,105],ve=[2,78],ye=[4,5,17,51,53,54],be=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],xe=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],Se=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],Ce=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],we=[5,52],K=[70,71,72,73],q=[1,151],Te={trace:r(function(){},`trace`),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement: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:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:`error`,4:`SPACE`,5:`NEWLINE`,6:`SD`,10:`INVALID`,14:`create`,15:`box`,16:`restOfLine`,17:`end`,19:`autonumber`,20:`NUM`,21:`off`,22:`activate`,24:`deactivate`,30:`title`,31:`legacy_title`,32:`acc_title`,33:`acc_title_value`,34:`acc_descr`,35:`acc_descr_value`,36:`acc_descr_multiline_value`,37:`loop`,38:`rect`,39:`opt`,40:`alt`,42:`par`,44:`par_over`,45:`critical`,47:`break`,48:`option`,49:`and`,50:`else`,51:`participant`,52:`AS`,53:`participant_actor`,54:`destroy`,56:`note`,59:`over`,61:`links`,62:`link`,63:`properties`,64:`details`,66:`,`,67:`left_of`,68:`right_of`,70:`+`,71:`-`,72:`()`,73:`ACTOR`,75:`CONFIG_START`,76:`CONFIG_CONTENT`,77:`CONFIG_END`,78:`SOLID_OPEN_ARROW`,79:`DOTTED_OPEN_ARROW`,80:`SOLID_ARROW`,81:`SOLID_ARROW_TOP`,82:`SOLID_ARROW_BOTTOM`,83:`STICK_ARROW_TOP`,84:`STICK_ARROW_BOTTOM`,85:`SOLID_ARROW_TOP_DOTTED`,86:`SOLID_ARROW_BOTTOM_DOTTED`,87:`STICK_ARROW_TOP_DOTTED`,88:`STICK_ARROW_BOTTOM_DOTTED`,89:`SOLID_ARROW_TOP_REVERSE`,90:`SOLID_ARROW_BOTTOM_REVERSE`,91:`STICK_ARROW_TOP_REVERSE`,92:`STICK_ARROW_BOTTOM_REVERSE`,93:`SOLID_ARROW_TOP_REVERSE_DOTTED`,94:`SOLID_ARROW_BOTTOM_REVERSE_DOTTED`,95:`STICK_ARROW_TOP_REVERSE_DOTTED`,96:`STICK_ARROW_BOTTOM_REVERSE_DOTTED`,97:`BIDIRECTIONAL_SOLID_ARROW`,98:`DOTTED_ARROW`,99:`BIDIRECTIONAL_DOTTED_ARROW`,100:`SOLID_CROSS`,101:`DOTTED_CROSS`,102:`SOLID_POINT`,103:`DOTTED_POINT`,104:`TXT`},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,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],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:r(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 3:return r.apply(a[s]),a[s];case 4:case 10:this.$=[];break;case 5:case 11:a[s-1].push(a[s]),this.$=a[s-1];break;case 6:case 7:case 12:case 13:this.$=a[s];break;case 8:case 9:case 14:this.$=[];break;case 16:a[s].type=`createParticipant`,this.$=a[s];break;case 17:a[s-1].unshift({type:`boxStart`,boxData:r.parseBoxData(a[s-2])}),a[s-1].push({type:`boxEnd`,boxText:a[s-2]}),this.$=a[s-1];break;case 19:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-2]),sequenceIndexStep:Number(a[s-1]),sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 20:this.$={type:`sequenceIndex`,sequenceIndex:Number(a[s-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 21:this.$={type:`sequenceIndex`,sequenceVisible:!1,signalType:r.LINETYPE.AUTONUMBER};break;case 22:this.$={type:`sequenceIndex`,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 23:this.$={type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor};break;case 24:this.$={type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-1].actor};break;case 30:r.setDiagramTitle(a[s].substring(6)),this.$=a[s].substring(6);break;case 31:r.setDiagramTitle(a[s].substring(7)),this.$=a[s].substring(7);break;case 32:this.$=a[s].trim(),r.setAccTitle(this.$);break;case 33:case 34:this.$=a[s].trim(),r.setAccDescription(this.$);break;case 35:a[s-1].unshift({type:`loopStart`,loopText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.LOOP_START}),a[s-1].push({type:`loopEnd`,loopText:a[s-2],signalType:r.LINETYPE.LOOP_END}),this.$=a[s-1];break;case 36:a[s-1].unshift({type:`rectStart`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_START}),a[s-1].push({type:`rectEnd`,color:r.parseMessage(a[s-2]),signalType:r.LINETYPE.RECT_END}),this.$=a[s-1];break;case 37:a[s-1].unshift({type:`optStart`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_START}),a[s-1].push({type:`optEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.OPT_END}),this.$=a[s-1];break;case 38:a[s-1].unshift({type:`altStart`,altText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.ALT_START}),a[s-1].push({type:`altEnd`,signalType:r.LINETYPE.ALT_END}),this.$=a[s-1];break;case 39:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 40:a[s-1].unshift({type:`parStart`,parText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.PAR_OVER_START}),a[s-1].push({type:`parEnd`,signalType:r.LINETYPE.PAR_END}),this.$=a[s-1];break;case 41:a[s-1].unshift({type:`criticalStart`,criticalText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.CRITICAL_START}),a[s-1].push({type:`criticalEnd`,signalType:r.LINETYPE.CRITICAL_END}),this.$=a[s-1];break;case 42:a[s-1].unshift({type:`breakStart`,breakText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_START}),a[s-1].push({type:`breakEnd`,optText:r.parseMessage(a[s-2]),signalType:r.LINETYPE.BREAK_END}),this.$=a[s-1];break;case 44:this.$=a[s-3].concat([{type:`option`,optionText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.CRITICAL_OPTION},a[s]]);break;case 46:this.$=a[s-3].concat([{type:`and`,parText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.PAR_AND},a[s]]);break;case 48:this.$=a[s-3].concat([{type:`else`,altText:r.parseMessage(a[s-1]),signalType:r.LINETYPE.ALT_ELSE},a[s]]);break;case 49:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 50:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 51:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 52:case 57:a[s-1].draw=`actor`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 53:a[s-1].type=`destroyParticipant`,this.$=a[s-1];break;case 54:a[s-3].draw=`participant`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 55:a[s-1].draw=`participant`,a[s-1].type=`addParticipant`,this.$=a[s-1];break;case 56:a[s-3].draw=`actor`,a[s-3].type=`addParticipant`,a[s-3].description=r.parseMessage(a[s-1]),this.$=a[s-3];break;case 58:this.$=[a[s-1],{type:`addNote`,placement:a[s-2],actor:a[s-1].actor,text:a[s]}];break;case 59:a[s-2]=[].concat(a[s-1],a[s-1]).slice(0,2),a[s-2][0]=a[s-2][0].actor,a[s-2][1]=a[s-2][1].actor,this.$=[a[s-1],{type:`addNote`,placement:r.PLACEMENT.OVER,actor:a[s-2].slice(0,2),text:a[s]}];break;case 60:this.$=[a[s-1],{type:`addLinks`,actor:a[s-1].actor,text:a[s]}];break;case 61:this.$=[a[s-1],{type:`addALink`,actor:a[s-1].actor,text:a[s]}];break;case 62:this.$=[a[s-1],{type:`addProperties`,actor:a[s-1].actor,text:a[s]}];break;case 63:this.$=[a[s-1],{type:`addDetails`,actor:a[s-1].actor,text:a[s]}];break;case 66:this.$=[a[s-2],a[s]];break;case 67:this.$=a[s];break;case 68:this.$=r.PLACEMENT.LEFTOF;break;case 69:this.$=r.PLACEMENT.RIGHTOF;break;case 70:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0},{type:`activeStart`,signalType:r.LINETYPE.ACTIVE_START,actor:a[s-1].actor}];break;case 71:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s]},{type:`activeEnd`,signalType:r.LINETYPE.ACTIVE_END,actor:a[s-4].actor}];break;case 72:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor}];break;case 73:this.$=[a[s-4],a[s-1],{type:`addMessage`,from:a[s-4].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s],activate:!1,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-4].actor}];break;case 74:this.$=[a[s-5],a[s-1],{type:`addMessage`,from:a[s-5].actor,to:a[s-1].actor,signalType:a[s-3],msg:a[s],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:`centralConnection`,signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:a[s-1].actor},{type:`centralConnectionReverse`,signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:a[s-5].actor}];break;case 75:this.$=[a[s-3],a[s-1],{type:`addMessage`,from:a[s-3].actor,to:a[s-1].actor,signalType:a[s-2],msg:a[s]}];break;case 76:this.$={type:`addParticipant`,actor:a[s-1],config:a[s]};break;case 77:this.$=a[s-1].trim();break;case 78:this.$={type:`addParticipant`,actor:a[s]};break;case 79:this.$=r.LINETYPE.SOLID_OPEN;break;case 80:this.$=r.LINETYPE.DOTTED_OPEN;break;case 81:this.$=r.LINETYPE.SOLID;break;case 82:this.$=r.LINETYPE.SOLID_TOP;break;case 83:this.$=r.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=r.LINETYPE.STICK_TOP;break;case 85:this.$=r.LINETYPE.STICK_BOTTOM;break;case 86:this.$=r.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=r.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=r.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=r.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=r.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=r.LINETYPE.DOTTED;break;case 100:this.$=r.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=r.LINETYPE.SOLID_CROSS;break;case 102:this.$=r.LINETYPE.DOTTED_CROSS;break;case 103:this.$=r.LINETYPE.SOLID_POINT;break;case 104:this.$=r.LINETYPE.DOTTED_POINT;break;case 105:this.$=r.parseMessage(a[s].trim().substring(1));break}},`anonymous`),table:[{3:1,4:t,5:n,6:i},{1:[3]},{3:5,4:t,5:n,6:i},{3:6,4:t,5:n,6:i},e([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},e(I,[2,5]),{9:48,13:13,14:l,15:u,18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},e(I,[2,7]),e(I,[2,8]),e(I,[2,9]),e(I,[2,15]),{13:49,51:D,53:O,54:k},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:F},{23:56,73:F},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},e(I,[2,30]),e(I,[2,31]),{33:[1,62]},{35:[1,63]},e(I,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:ee},{23:75,55:76,73:ee},{23:77,73:F},{69:78,72:[1,79],78:te,79:ne,80:re,81:ie,82:L,83:R,84:z,85:ae,86:B,87:V,88:oe,89:H,90:U,91:W,92:se,93:G,94:ce,95:le,96:ue,97:de,98:fe,99:pe,100:me,101:he,102:ge,103:_e},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:F},{23:111,73:F},{23:112,73:F},{23:113,73:F},e([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],ve),e(I,[2,6]),e(I,[2,16]),e(ye,[2,10],{11:114}),e(I,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},e(I,[2,22]),{5:[1,118]},{5:[1,119]},e(I,[2,25]),e(I,[2,26]),e(I,[2,27]),e(I,[2,28]),e(I,[2,29]),e(I,[2,32]),e(I,[2,33]),e(be,a,{7:120}),e(be,a,{7:121}),e(be,a,{7:122}),e(xe,a,{41:123,7:124}),e(Se,a,{43:125,7:126}),e(Se,a,{7:126,43:127}),e(Ce,a,{46:128,7:129}),e(be,a,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(we,ve,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:F},{69:146,78:te,79:ne,80:re,81:ie,82:L,83:R,84:z,85:ae,86:B,87:V,88:oe,89:H,90:U,91:W,92:se,93:G,94:ce,95:le,96:ue,97:de,98:fe,99:pe,100:me,101:he,102:ge,103:_e},e(K,[2,79]),e(K,[2,80]),e(K,[2,81]),e(K,[2,82]),e(K,[2,83]),e(K,[2,84]),e(K,[2,85]),e(K,[2,86]),e(K,[2,87]),e(K,[2,88]),e(K,[2,89]),e(K,[2,90]),e(K,[2,91]),e(K,[2,92]),e(K,[2,93]),e(K,[2,94]),e(K,[2,95]),e(K,[2,96]),e(K,[2,97]),e(K,[2,98]),e(K,[2,99]),e(K,[2,100]),e(K,[2,101]),e(K,[2,102]),e(K,[2,103]),e(K,[2,104]),{23:147,73:F},{23:149,60:148,73:F},{73:[2,68]},{73:[2,69]},{58:150,104:q},{58:152,104:q},{58:153,104:q},{58:154,104:q},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:D,53:O,54:k},{5:[1,160]},e(I,[2,20]),e(I,[2,21]),e(I,[2,23]),e(I,[2,24]),{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,161],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,162],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,163],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,164]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,47],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,50:[1,165],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,166]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,45],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,49:[1,167],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{17:[1,168]},{17:[1,169]},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[2,43],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,48:[1,170],51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{4:o,5:s,8:8,9:10,10:c,13:13,14:l,15:u,17:[1,171],18:16,19:d,22:f,23:41,24:p,25:20,26:21,27:22,28:23,29:24,30:m,31:h,32:g,34:_,36:v,37:y,38:b,39:x,40:S,42:C,44:w,45:T,47:E,51:D,53:O,54:k,56:A,61:j,62:M,63:N,64:P,73:F},{16:[1,172]},e(I,[2,50]),{16:[1,173]},e(I,[2,55]),e(we,[2,76]),{76:[1,174]},{16:[1,175]},e(I,[2,52]),{16:[1,176]},e(I,[2,57]),e(I,[2,53]),{23:177,73:F},{23:178,73:F},{23:179,73:F},{58:180,104:q},{23:181,72:[1,182],73:F},{58:183,104:q},{58:184,104:q},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(I,[2,17]),e(ye,[2,11]),{13:186,51:D,53:O,54:k},e(ye,[2,13]),e(ye,[2,14]),e(I,[2,19]),e(I,[2,35]),e(I,[2,36]),e(I,[2,37]),e(I,[2,38]),{16:[1,187]},e(I,[2,39]),{16:[1,188]},e(I,[2,40]),e(I,[2,41]),{16:[1,189]},e(I,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:q},{58:196,104:q},{58:197,104:q},{5:[2,75]},{58:198,104:q},{23:199,73:F},{5:[2,58]},{5:[2,59]},{23:200,73:F},e(ye,[2,12]),e(xe,a,{7:124,41:201}),e(Se,a,{7:126,43:202}),e(Ce,a,{7:129,46:203}),e(I,[2,49]),e(I,[2,54]),e(we,[2,77]),e(I,[2,51]),e(I,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:q},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:r(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:r(function(e){var t=this,n=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(e,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){n.length-=2*e,a.length-=e,o.length-=e}r(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=t.symbols_[e]||e),e}r(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=n[n.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
2
+ `+h.showPosition()+`
3
+ Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:n.push(S),a.push(h.yytext),o.push(h.yylloc),n.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(n=n.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),n.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[n[n.length-2]][n[n.length-1]],n.push(A);break;case 3:return!0}}return!0},`parse`)};Te.lexer=(function(){return{EOF:1,parseError:r(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:r(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:r(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:r(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:r(function(){return this._more=!0,this},`more`),reject:r(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
+ `+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:r(function(e){this.unput(this.match.slice(e))},`less`),pastInput:r(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:r(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:r(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
5
+ `+t+`^`},`showPosition`),test_match:r(function(e,t){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=e[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],n=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},`test_match`),next:r(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext=``,this.match=``);for(var i=this._currentRules(),a=0;a<i.length;a++)if(n=this._input.match(this.rules[i[a]]),n&&(!t||n[0].length>t[0].length)){if(t=n,r=a,this.options.backtrack_lexer){if(e=this.test_match(n,i[a]),e!==!1)return e;if(this._backtrack){t=!1;continue}else return!1}else if(!this.options.flex)break}return t?(e=this.test_match(t,i[r]),e===!1?!1:e):this._input===``?this.EOF:this.parseError(`Lexical error on line `+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:``,token:null,line:this.yylineno})},`next`),lex:r(function(){return this.next()||this.lex()},`lex`),begin:r(function(e){this.conditionStack.push(e)},`begin`),popState:r(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},`popState`),_currentRules:r(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},`_currentRules`),topState:r(function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:`INITIAL`},`topState`),pushState:r(function(e){this.begin(e)},`pushState`),stateStackSize:r(function(){return this.conditionStack.length},`stateStackSize`),options:{"case-insensitive":!0},performAction:r(function(e,t,n,r){switch(n){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 20;case 7:return this.begin(`CONFIG`),75;case 8:return 76;case 9:return this.popState(),this.begin(`ALIAS`),77;case 10:return this.popState(),this.popState(),77;case 11:return t.yytext=t.yytext.trim(),73;case 12:return t.yytext=t.yytext.trim(),this.begin(`ALIAS`),73;case 13:return t.yytext=t.yytext.trim(),this.popState(),73;case 14:return this.popState(),10;case 15:return this.begin(`LINE`),15;case 16:return this.begin(`ID`),51;case 17:return this.begin(`ID`),53;case 18:return 14;case 19:return this.begin(`ID`),54;case 20:return this.popState(),this.popState(),this.begin(`LINE`),52;case 21:return this.popState(),this.popState(),5;case 22:return this.begin(`LINE`),37;case 23:return this.begin(`LINE`),38;case 24:return this.begin(`LINE`),39;case 25:return this.begin(`LINE`),40;case 26:return this.begin(`LINE`),50;case 27:return this.begin(`LINE`),42;case 28:return this.begin(`LINE`),44;case 29:return this.begin(`LINE`),49;case 30:return this.begin(`LINE`),45;case 31:return this.begin(`LINE`),48;case 32:return this.begin(`LINE`),47;case 33:return this.popState(),16;case 34:return 17;case 35:return 67;case 36:return 68;case 37:return 61;case 38:return 62;case 39:return 63;case 40:return 64;case 41:return 59;case 42:return 56;case 43:return this.begin(`ID`),22;case 44:return this.begin(`ID`),24;case 45:return 30;case 46:return 31;case 47:return this.begin(`acc_title`),32;case 48:return this.popState(),`acc_title_value`;case 49:return this.begin(`acc_descr`),34;case 50:return this.popState(),`acc_descr_value`;case 51:this.begin(`acc_descr_multiline`);break;case 52:this.popState();break;case 53:return`acc_descr_multiline_value`;case 54:return 6;case 55:return 19;case 56:return 21;case 57:return 66;case 58:return 5;case 59:return t.yytext=t.yytext.trim(),73;case 60:return 80;case 61:return 97;case 62:return 98;case 63:return 99;case 64:return 78;case 65:return 79;case 66:return 100;case 67:return 101;case 68:return 102;case 69:return 103;case 70:return 85;case 71:return 86;case 72:return 87;case 73:return 88;case 74:return 93;case 75:return 94;case 76:return 95;case 77:return 96;case 78:return 81;case 79:return 82;case 80:return 83;case 81:return 84;case 82:return 89;case 83:return 90;case 84:return 91;case 85:return 92;case 86:return 104;case 87:return 104;case 88:return 70;case 89:return 71;case 90:return 72;case 91:return 5;case 92:return 10}},`anonymous`),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\}(?=\s+as\s))/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i,/^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i,/^(?:[^<>:\n,;@]*<[^\n]*)/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/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,/^(?:--\|\\)/i,/^(?:--\|\/)/i,/^(?:--\\\\)/i,/^(?:--\/\/)/i,/^(?:\/\|--)/i,/^(?:\\\|--)/i,/^(?:\/\/--)/i,/^(?:\\\\--)/i,/^(?:-\|\\)/i,/^(?:-\|\/)/i,/^(?:-\\\\)/i,/^(?:-\/\/)/i,/^(?:\/\|-)/i,/^(?:\\\|-)/i,/^(?:\/\/-)/i,/^(?:\\\\-)/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:\(\))/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[52,53],inclusive:!1},acc_descr:{rules:[50],inclusive:!1},acc_title:{rules:[48],inclusive:!1},ID:{rules:[2,3,7,11,12,13,14],inclusive:!1},ALIAS:{rules:[2,3,20,21],inclusive:!1},LINE:{rules:[2,3,33],inclusive:!1},CONFIG:{rules:[8,9,10],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,15,16,17,18,19,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,38,39,40,41,42,43,44,45,46,47,49,51,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92],inclusive:!0}}}})();function Ee(){this.yy={}}return r(Ee,`Parser`),Ee.prototype=Te,Te.Parser=Ee,new Ee})();P.parser=P;var F=P,I={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34,SOLID_TOP:41,SOLID_BOTTOM:42,STICK_TOP:43,STICK_BOTTOM:44,SOLID_ARROW_TOP_REVERSE:45,SOLID_ARROW_BOTTOM_REVERSE:46,STICK_ARROW_TOP_REVERSE:47,STICK_ARROW_BOTTOM_REVERSE:48,SOLID_TOP_DOTTED:51,SOLID_BOTTOM_DOTTED:52,STICK_TOP_DOTTED:53,STICK_BOTTOM_DOTTED:54,SOLID_ARROW_TOP_REVERSE_DOTTED:55,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:56,STICK_ARROW_TOP_REVERSE_DOTTED:57,STICK_ARROW_BOTTOM_REVERSE_DOTTED:58,CENTRAL_CONNECTION:59,CENTRAL_CONNECTION_REVERSE:60,CENTRAL_CONNECTION_DUAL:61},ee={FILLED:0,OPEN:1},te={LEFTOF:0,RIGHTOF:1,OVER:2},ne={ACTOR:`actor`,BOUNDARY:`boundary`,COLLECTIONS:`collections`,CONTROL:`control`,DATABASE:`database`,ENTITY:`entity`,PARTICIPANT:`participant`,QUEUE:`queue`},re=class{constructor(){this.state=new M(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=d,this.setAccDescription=a,this.setDiagramTitle=f,this.getAccTitle=x,this.getAccDescription=p,this.getDiagramTitle=o,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(h().wrap),this.LINETYPE=I,this.ARROWTYPE=ee,this.PLACEMENT=te}static{r(this,`SequenceDB`)}addBox(e){this.state.records.boxes.push({name:e.text,wrap:e.wrap??this.autoWrap(),fill:e.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(e,t,n,r,i){let a=this.state.records.currentBox,o;if(i!==void 0){let e;e=i.includes(`
7
+ `)?i+`
8
+ `:`{
9
+ `+i+`
10
+ }`,o=A(e,{schema:j})}r=o?.type??r,o?.alias&&(!n||n.text===t)&&(n={text:o.alias,wrap:n?.wrap,type:r});let s=this.state.records.actors.get(e);if(s){if(this.state.records.currentBox&&s.box&&this.state.records.currentBox!==s.box)throw Error(`A same participant should only be defined in one Box: ${s.name} can't be in '${s.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(a=s.box?s.box:this.state.records.currentBox,s.box=a,s&&t===s.name&&n==null)return}if(n?.text??(n={text:t,type:r}),(r==null||n.text==null)&&(n={text:t,type:r}),this.state.records.actors.set(e,{box:a,name:t,description:n.text,wrap:n.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:r??`participant`}),this.state.records.prevActor){let t=this.state.records.actors.get(this.state.records.prevActor);t&&(t.nextActor=e)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(e),this.state.records.prevActor=e}activationCount(e){let t,n=0;if(!e)return 0;for(t=0;t<this.state.records.messages.length;t++)this.state.records.messages[t].type===this.LINETYPE.ACTIVE_START&&this.state.records.messages[t].from===e&&n++,this.state.records.messages[t].type===this.LINETYPE.ACTIVE_END&&this.state.records.messages[t].from===e&&n--;return n}addMessage(e,t,n,r){this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:t,message:n.text,wrap:n.wrap??this.autoWrap(),answer:r})}addSignal(e,t,n,r,i=!1,a){if(r===this.LINETYPE.ACTIVE_END&&this.activationCount(e??``)<1){let t=Error(`Trying to inactivate an inactive participant (`+e+`)`);throw t.hash={text:`->>-`,token:`->>-`,line:`1`,loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:[`'ACTIVE_PARTICIPANT'`]},t}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:t,message:n?.text??``,wrap:n?.wrap??this.autoWrap(),type:r,activate:i,centralConnection:a??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(e=>e.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(e){return this.state.records.actors.get(e)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(e){this.state.records.wrapEnabled=e}extractWrap(e){if(e===void 0)return{};e=e.trim();let t=/^:?wrap:/.exec(e)===null?/^:?nowrap:/.exec(e)===null?void 0:!1:!0;return{cleanedText:(t===void 0?e:e.replace(/^:?(?:no)?wrap:/,``)).trim(),wrap:t}}autoWrap(){return this.state.records.wrapEnabled===void 0?h().sequence?.wrap??!1:this.state.records.wrapEnabled}clear(){this.state.reset(),m()}parseMessage(e){let t=e.trim(),{wrap:r,cleanedText:i}=this.extractWrap(t),a={text:i,wrap:r};return n.debug(`parseMessage: ${JSON.stringify(a)}`),a}parseBoxData(e){let t=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e),n=t?.[1]?t[1].trim():`transparent`,r=t?.[2]?t[2].trim():void 0;if(window?.CSS)window.CSS.supports(`color`,n)||(n=`transparent`,r=e.trim());else{let t=new Option().style;t.color=n,t.color!==n&&(n=`transparent`,r=e.trim())}let{wrap:i,cleanedText:a}=this.extractWrap(r);return{text:a?c(a,h()):void 0,color:n,wrap:i}}addNote(e,t,n){let r={actor:e,placement:t,message:n.text,wrap:n.wrap??this.autoWrap()},i=[].concat(e,e);this.state.records.notes.push(r),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:i[0],to:i[1],message:n.text,wrap:n.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:t})}addLinks(e,t){let r=this.getActor(e);try{let e=c(t.text,h());e=e.replace(/&equals;/g,`=`),e=e.replace(/&amp;/g,`&`);let n=JSON.parse(e);this.insertLinks(r,n)}catch(e){n.error(`error while parsing actor link text`,e)}}addALink(e,t){let r=this.getActor(e);try{let e={},n=c(t.text,h()),i=n.indexOf(`@`);n=n.replace(/&equals;/g,`=`),n=n.replace(/&amp;/g,`&`);let a=n.slice(0,i-1).trim();e[a]=n.slice(i+1).trim(),this.insertLinks(r,e)}catch(e){n.error(`error while parsing actor link text`,e)}}insertLinks(e,t){if(e.links==null)e.links=t;else for(let n in t)e.links[n]=t[n]}addProperties(e,t){let r=this.getActor(e);try{let e=c(t.text,h()),n=JSON.parse(e);this.insertProperties(r,n)}catch(e){n.error(`error while parsing actor properties text`,e)}}insertProperties(e,t){if(e.properties==null)e.properties=t;else for(let n in t)e.properties[n]=t[n]}boxEnd(){this.state.records.currentBox=void 0}addDetails(e,t){let r=this.getActor(e),i=document.getElementById(t.text);try{let e=i.innerHTML,t=JSON.parse(e);t.properties&&this.insertProperties(r,t.properties),t.links&&this.insertLinks(r,t.links)}catch(e){n.error(`error while parsing actor details text`,e)}}getActorProperty(e,t){if(e?.properties!==void 0)return e.properties[t]}apply(e){if(Array.isArray(e))e.forEach(e=>{this.apply(e)});else switch(e.type){case`sequenceIndex`:this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:e.sequenceIndex,step:e.sequenceIndexStep,visible:e.sequenceVisible},wrap:!1,type:e.signalType});break;case`addParticipant`:this.addActor(e.actor,e.actor,e.description,e.draw,e.config);break;case`createParticipant`:if(this.state.records.actors.has(e.actor))throw Error(`It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior`);this.state.records.lastCreated=e.actor,this.addActor(e.actor,e.actor,e.description,e.draw,e.config),this.state.records.createdActors.set(e.actor,this.state.records.messages.length);break;case`destroyParticipant`:this.state.records.lastDestroyed=e.actor,this.state.records.destroyedActors.set(e.actor,this.state.records.messages.length);break;case`activeStart`:this.addSignal(e.actor,void 0,void 0,e.signalType);break;case`centralConnection`:this.addSignal(e.actor,void 0,void 0,e.signalType);break;case`centralConnectionReverse`:this.addSignal(e.actor,void 0,void 0,e.signalType);break;case`activeEnd`:this.addSignal(e.actor,void 0,void 0,e.signalType);break;case`addNote`:this.addNote(e.actor,e.placement,e.text);break;case`addLinks`:this.addLinks(e.actor,e.text);break;case`addALink`:this.addALink(e.actor,e.text);break;case`addProperties`:this.addProperties(e.actor,e.text);break;case`addDetails`:this.addDetails(e.actor,e.text);break;case`addMessage`:if(this.state.records.lastCreated){if(e.to!==this.state.records.lastCreated)throw Error(`The created participant `+this.state.records.lastCreated.name+` does not have an associated creating message after its declaration. Please check the sequence diagram.`);this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(e.to!==this.state.records.lastDestroyed&&e.from!==this.state.records.lastDestroyed)throw Error(`The destroyed participant `+this.state.records.lastDestroyed.name+` does not have an associated destroying message after its declaration. Please check the sequence diagram.`);this.state.records.lastDestroyed=void 0}this.addSignal(e.from,e.to,e.msg,e.signalType,e.activate,e.centralConnection);break;case`boxStart`:this.addBox(e.boxData);break;case`boxEnd`:this.boxEnd();break;case`loopStart`:this.addSignal(void 0,void 0,e.loopText,e.signalType);break;case`loopEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`rectStart`:this.addSignal(void 0,void 0,e.color,e.signalType);break;case`rectEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`optStart`:this.addSignal(void 0,void 0,e.optText,e.signalType);break;case`optEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`altStart`:this.addSignal(void 0,void 0,e.altText,e.signalType);break;case`else`:this.addSignal(void 0,void 0,e.altText,e.signalType);break;case`altEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`setAccTitle`:d(e.text);break;case`parStart`:this.addSignal(void 0,void 0,e.parText,e.signalType);break;case`and`:this.addSignal(void 0,void 0,e.parText,e.signalType);break;case`parEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`criticalStart`:this.addSignal(void 0,void 0,e.criticalText,e.signalType);break;case`option`:this.addSignal(void 0,void 0,e.optionText,e.signalType);break;case`criticalEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break;case`breakStart`:this.addSignal(void 0,void 0,e.breakText,e.signalType);break;case`breakEnd`:this.addSignal(void 0,void 0,void 0,e.signalType);break}}getConfig(){return h().sequence}},ie=r(e=>`.actor {
11
+ stroke: ${e.actorBorder};
12
+ fill: ${e.actorBkg};
13
+ }
14
+
15
+ text.actor > tspan {
16
+ fill: ${e.actorTextColor};
17
+ stroke: none;
18
+ }
19
+
20
+ .actor-line {
21
+ stroke: ${e.actorLineColor};
22
+ }
23
+
24
+ .innerArc {
25
+ stroke-width: 1.5;
26
+ stroke-dasharray: none;
27
+ }
28
+
29
+ .messageLine0 {
30
+ stroke-width: 1.5;
31
+ stroke-dasharray: none;
32
+ stroke: ${e.signalColor};
33
+ }
34
+
35
+ .messageLine1 {
36
+ stroke-width: 1.5;
37
+ stroke-dasharray: 2, 2;
38
+ stroke: ${e.signalColor};
39
+ }
40
+
41
+ #arrowhead path {
42
+ fill: ${e.signalColor};
43
+ stroke: ${e.signalColor};
44
+ }
45
+
46
+ .sequenceNumber {
47
+ fill: ${e.sequenceNumberColor};
48
+ }
49
+
50
+ #sequencenumber {
51
+ fill: ${e.signalColor};
52
+ }
53
+
54
+ #crosshead path {
55
+ fill: ${e.signalColor};
56
+ stroke: ${e.signalColor};
57
+ }
58
+
59
+ .messageText {
60
+ fill: ${e.signalTextColor};
61
+ stroke: none;
62
+ }
63
+
64
+ .labelBox {
65
+ stroke: ${e.labelBoxBorderColor};
66
+ fill: ${e.labelBoxBkgColor};
67
+ }
68
+
69
+ .labelText, .labelText > tspan {
70
+ fill: ${e.labelTextColor};
71
+ stroke: none;
72
+ }
73
+
74
+ .loopText, .loopText > tspan {
75
+ fill: ${e.loopTextColor};
76
+ stroke: none;
77
+ }
78
+
79
+ .loopLine {
80
+ stroke-width: 2px;
81
+ stroke-dasharray: 2, 2;
82
+ stroke: ${e.labelBoxBorderColor};
83
+ fill: ${e.labelBoxBorderColor};
84
+ }
85
+
86
+ .note {
87
+ //stroke: #decc93;
88
+ stroke: ${e.noteBorderColor};
89
+ fill: ${e.noteBkgColor};
90
+ }
91
+
92
+ .noteText, .noteText > tspan {
93
+ fill: ${e.noteTextColor};
94
+ stroke: none;
95
+ }
96
+
97
+ .activation0 {
98
+ fill: ${e.activationBkgColor};
99
+ stroke: ${e.activationBorderColor};
100
+ }
101
+
102
+ .activation1 {
103
+ fill: ${e.activationBkgColor};
104
+ stroke: ${e.activationBorderColor};
105
+ }
106
+
107
+ .activation2 {
108
+ fill: ${e.activationBkgColor};
109
+ stroke: ${e.activationBorderColor};
110
+ }
111
+
112
+ .actorPopupMenu {
113
+ position: absolute;
114
+ }
115
+
116
+ .actorPopupMenuPanel {
117
+ position: absolute;
118
+ fill: ${e.actorBkg};
119
+ box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
120
+ filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
121
+ }
122
+ .actor-man line {
123
+ stroke: ${e.actorBorder};
124
+ fill: ${e.actorBkg};
125
+ }
126
+ .actor-man circle, line {
127
+ stroke: ${e.actorBorder};
128
+ fill: ${e.actorBkg};
129
+ stroke-width: 2px;
130
+ }
131
+
132
+ `,`getStyles`),L=36,R=`actor-top`,z=`actor-bottom`,ae=`actor-box`,B=`actor-man`,V=r(function(e,t){return w(e,t)},`drawRect`),oe=r(function(e,t,n,r,i){if(t.links===void 0||t.links===null||Object.keys(t.links).length===0)return{height:0,width:0};let a=t.links,o=t.actorCnt,s=t.rectData;var c=`none`;i&&(c=`block !important`);let l=e.append(`g`);l.attr(`id`,`actor`+o+`_popup`),l.attr(`class`,`actorPopupMenu`),l.attr(`display`,c);var u=``;s.class!==void 0&&(u=` `+s.class);let d=s.width>n?s.width:n,f=l.append(`rect`);if(f.attr(`class`,`actorPopupMenuPanel`+u),f.attr(`x`,s.x),f.attr(`y`,s.height),f.attr(`fill`,s.fill),f.attr(`stroke`,s.stroke),f.attr(`width`,d),f.attr(`height`,s.height),f.attr(`rx`,s.rx),f.attr(`ry`,s.ry),a!=null){var p=20;for(let e in a){var m=l.append(`a`),h=(0,N.sanitizeUrl)(a[e]);m.attr(`xlink:href`,h),m.attr(`target`,`_blank`),Ae(r)(e,m,s.x+10,s.height+p,d,20,{class:`actor`},r),p+=30}}return f.attr(`height`,p),{height:s.height+p,width:d}},`drawPopup`),H=r(function(e){return`var pu = document.getElementById('`+e+`'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }`},`popupMenuToggle`),U=r(async function(e,t,n=null){let r=e.append(`foreignObject`),i=await l(t.text,S()),a=r.append(`xhtml:div`).attr(`style`,`width: fit-content;`).attr(`xmlns`,`http://www.w3.org/1999/xhtml`).html(i).node().getBoundingClientRect();if(r.attr(`height`,Math.round(a.height)).attr(`width`,Math.round(a.width)),t.class===`noteText`){let n=e.node().firstChild;n.setAttribute(`height`,a.height+2*t.textMargin);let i=n.getBBox();r.attr(`x`,Math.round(i.x+i.width/2-a.width/2)).attr(`y`,Math.round(i.y+i.height/2-a.height/2))}else if(n){let{startx:e,stopx:i,starty:o}=n;if(e>i){let t=e;e=i,i=t}r.attr(`x`,Math.round(e+Math.abs(e-i)/2-a.width/2)),t.class===`loopText`?r.attr(`y`,Math.round(o)):r.attr(`y`,Math.round(o-a.height))}return[r]},`drawKatex`),W=r(function(t,n){let i=0,a=0,o=n.text.split(b.lineBreakRegex),[s,c]=e(n.fontSize),l=[],u=0,d=r(()=>n.y,`yfunc`);if(n.valign!==void 0&&n.textMargin!==void 0&&n.textMargin>0)switch(n.valign){case`top`:case`start`:d=r(()=>Math.round(n.y+n.textMargin),`yfunc`);break;case`middle`:case`center`:d=r(()=>Math.round(n.y+(i+a+n.textMargin)/2),`yfunc`);break;case`bottom`:case`end`:d=r(()=>Math.round(n.y+(i+a+2*n.textMargin)-n.textMargin),`yfunc`);break}if(n.anchor!==void 0&&n.textMargin!==void 0&&n.width!==void 0)switch(n.anchor){case`left`:case`start`:n.x=Math.round(n.x+n.textMargin),n.anchor=`start`,n.dominantBaseline=`middle`,n.alignmentBaseline=`middle`;break;case`middle`:case`center`:n.x=Math.round(n.x+n.width/2),n.anchor=`middle`,n.dominantBaseline=`middle`,n.alignmentBaseline=`middle`;break;case`right`:case`end`:n.x=Math.round(n.x+n.width-n.textMargin),n.anchor=`end`,n.dominantBaseline=`middle`,n.alignmentBaseline=`middle`;break}for(let[e,r]of o.entries()){n.textMargin!==void 0&&n.textMargin===0&&s!==void 0&&(u=e*s);let o=t.append(`text`);o.attr(`x`,n.x),o.attr(`y`,d()),n.anchor!==void 0&&o.attr(`text-anchor`,n.anchor).attr(`dominant-baseline`,n.dominantBaseline).attr(`alignment-baseline`,n.alignmentBaseline),n.fontFamily!==void 0&&o.style(`font-family`,n.fontFamily),c!==void 0&&o.style(`font-size`,c),n.fontWeight!==void 0&&o.style(`font-weight`,n.fontWeight),n.fill!==void 0&&o.attr(`fill`,n.fill),n.class!==void 0&&o.attr(`class`,n.class),n.dy===void 0?u!==0&&o.attr(`dy`,u):o.attr(`dy`,n.dy);let f=r||`​`;if(n.tspan){let e=o.append(`tspan`);e.attr(`x`,n.x),n.fill!==void 0&&e.attr(`fill`,n.fill),e.text(f)}else o.text(f);n.valign!==void 0&&n.textMargin!==void 0&&n.textMargin>0&&(a+=(o._groups||o)[0][0].getBBox().height,i=a),l.push(o)}return l},`drawText`),se=r(function(e,t){function n(e,t,n,r,i){return e+`,`+t+` `+(e+n)+`,`+t+` `+(e+n)+`,`+(t+r-i)+` `+(e+n-i*1.2)+`,`+(t+r)+` `+e+`,`+(t+r)}r(n,`genPoints`);let i=e.append(`polygon`);return i.attr(`points`,n(t.x,t.y,t.width,t.height,7)),i.attr(`class`,`labelBox`),t.y+=t.height/2,W(e,t),i},`drawLabel`),G=-1,ce=r((e,t,n,r)=>{e.select&&n.forEach(n=>{let i=t.get(n),a=e.select(`#actor`+i.actorCnt);!r.mirrorActors&&i.stopy?a.attr(`y2`,i.stopy+i.height/2):r.mirrorActors&&a.attr(`y2`,i.stopy)})},`fixLifeLineHeights`),le=r(function(e,t,n,r){let i=r?t.stopy:t.starty,a=t.x+t.width/2,o=i+t.height,s=e.append(`g`).lower();var c=s;r||(G++,Object.keys(t.links||{}).length&&!n.forceMenus&&c.attr(`onclick`,H(`actor${G}_popup`)).attr(`cursor`,`pointer`),c.append(`line`).attr(`id`,`actor`+G).attr(`x1`,a).attr(`y1`,o).attr(`x2`,a).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name),c=s.append(`g`),t.actorCnt=G,t.links!=null&&c.attr(`id`,`root-`+G));let l=k();var u=`actor`;t.properties?.class?u=t.properties.class:l.fill=`#eaeaea`,r?u+=` ${z}`:u+=` ${R}`,l.x=t.x,l.y=i,l.width=t.width,l.height=t.height,l.class=u,l.rx=3,l.ry=3,l.name=t.name;let d=V(c,l);if(t.rectData=l,t.properties?.icon){let e=t.properties.icon.trim();e.charAt(0)===`@`?O(c,l.x+l.width-20,l.y+10,e.substr(1)):E(c,l.x+l.width-20,l.y+10,e)}J(n,v(t.description))(t.description,c,l.x,l.y,l.width,l.height,{class:`actor ${ae}`},n);let f=t.height;if(d.node){let e=d.node().getBBox();t.height=e.height,f=e.height}return f},`drawActorTypeParticipant`),ue=r(function(e,t,n,r){let i=r?t.stopy:t.starty,a=t.x+t.width/2,o=i+t.height,s=e.append(`g`).lower();var c=s;r||(G++,Object.keys(t.links||{}).length&&!n.forceMenus&&c.attr(`onclick`,H(`actor${G}_popup`)).attr(`cursor`,`pointer`),c.append(`line`).attr(`id`,`actor`+G).attr(`x1`,a).attr(`y1`,o).attr(`x2`,a).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name),c=s.append(`g`),t.actorCnt=G,t.links!=null&&c.attr(`id`,`root-`+G));let l=k();var u=`actor`;t.properties?.class?u=t.properties.class:l.fill=`#eaeaea`,r?u+=` ${z}`:u+=` ${R}`,l.x=t.x,l.y=i,l.width=t.width,l.height=t.height,l.class=u,l.name=t.name;let d={...l,x:l.x+-6,y:l.y+6,class:`actor`},f=V(c,l);if(V(c,d),t.rectData=l,t.properties?.icon){let e=t.properties.icon.trim();e.charAt(0)===`@`?O(c,l.x+l.width-20,l.y+10,e.substr(1)):E(c,l.x+l.width-20,l.y+10,e)}J(n,v(t.description))(t.description,c,l.x-6,l.y+6,l.width,l.height,{class:`actor ${ae}`},n);let p=t.height;if(f.node){let e=f.node().getBBox();t.height=e.height,p=e.height}return p},`drawActorTypeCollections`),de=r(function(e,t,n,r){let i=r?t.stopy:t.starty,a=t.x+t.width/2,o=i+t.height,s=e.append(`g`).lower(),c=s;r||(G++,Object.keys(t.links||{}).length&&!n.forceMenus&&c.attr(`onclick`,H(`actor${G}_popup`)).attr(`cursor`,`pointer`),c.append(`line`).attr(`id`,`actor`+G).attr(`x1`,a).attr(`y1`,o).attr(`x2`,a).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name),c=s.append(`g`),t.actorCnt=G,t.links!=null&&c.attr(`id`,`root-`+G));let l=k(),u=`actor`;t.properties?.class?u=t.properties.class:l.fill=`#eaeaea`,r?u+=` ${z}`:u+=` ${R}`,l.x=t.x,l.y=i,l.width=t.width,l.height=t.height,l.class=u,l.name=t.name;let d=l.height/2,f=d/(2.5+l.height/50),p=c.append(`g`),m=c.append(`g`);if(p.append(`path`).attr(`d`,`M ${l.x},${l.y+d}
133
+ a ${f},${d} 0 0 0 0,${l.height}
134
+ h ${l.width-2*f}
135
+ a ${f},${d} 0 0 0 0,-${l.height}
136
+ Z
137
+ `).attr(`class`,u),m.append(`path`).attr(`d`,`M ${l.x},${l.y+d}
138
+ a ${f},${d} 0 0 0 0,${l.height}`).attr(`stroke`,`#666`).attr(`stroke-width`,`1px`).attr(`class`,u),p.attr(`transform`,`translate(${f}, ${-(l.height/2)})`),m.attr(`transform`,`translate(${l.width-f}, ${-l.height/2})`),t.rectData=l,t.properties?.icon){let e=t.properties.icon.trim(),n=l.x+l.width-20,r=l.y+10;e.charAt(0)===`@`?O(c,n,r,e.substr(1)):E(c,n,r,e)}J(n,v(t.description))(t.description,c,l.x,l.y,l.width,l.height,{class:`actor ${ae}`},n);let h=t.height,g=p.select(`path:last-child`);if(g.node()){let e=g.node().getBBox();t.height=e.height,h=e.height}return h},`drawActorTypeQueue`),fe=r(function(e,t,n,r){let i=r?t.stopy:t.starty,a=t.x+t.width/2,o=i+75,s=e.append(`g`).lower();r||(G++,s.append(`line`).attr(`id`,`actor`+G).attr(`x1`,a).attr(`y1`,o).attr(`x2`,a).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name),t.actorCnt=G);let c=e.append(`g`),l=B;r?l+=` ${z}`:l+=` ${R}`,c.attr(`class`,l),c.attr(`name`,t.name);let u=k();u.x=t.x,u.y=i,u.fill=`#eaeaea`,u.width=t.width,u.height=t.height,u.class=`actor`;let d=t.x+t.width/2,f=i+32;return c.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`),c.append(`circle`).attr(`cx`,d).attr(`cy`,f).attr(`r`,22).attr(`fill`,`#eaeaf7`).attr(`stroke`,`#666`).attr(`stroke-width`,1.2),c.append(`line`).attr(`marker-end`,`url(#filled-head-control)`).attr(`transform`,`translate(${d}, ${f-22})`),t.height=c.node().getBBox().height+2*(n?.sequence?.labelBoxHeight??0),J(n,v(t.description))(t.description,c,u.x,u.y+22+(r?5:12),u.width,u.height,{class:`actor ${B}`},n),t.height},`drawActorTypeControl`),pe=r(function(e,t,n,r){let i=r?t.stopy:t.starty,a=t.x+t.width/2,o=i+75,s=e.append(`g`).lower(),c=e.append(`g`),l=`actor`;r?l+=` ${z}`:l+=` ${R}`,c.attr(`class`,l),c.attr(`name`,t.name);let u=k();u.x=t.x,u.y=i,u.fill=`#eaeaea`,u.width=t.width,u.height=t.height,u.class=`actor`;let d=t.x+t.width/2,f=i+(r?10:25);return c.append(`circle`).attr(`cx`,d).attr(`cy`,f).attr(`r`,22).attr(`width`,t.width).attr(`height`,t.height),c.append(`line`).attr(`x1`,d-22).attr(`x2`,d+22).attr(`y1`,f+22).attr(`y2`,f+22).attr(`stroke-width`,2),t.height=c.node().getBBox().height+(n?.sequence?.labelBoxHeight??0),r||(G++,s.append(`line`).attr(`id`,`actor`+G).attr(`x1`,a).attr(`y1`,o).attr(`x2`,a).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name),t.actorCnt=G),J(n,v(t.description))(t.description,c,u.x,u.y+(r?15:30),u.width,u.height,{class:`actor ${B}`},n),r?c.attr(`transform`,`translate(0, 22)`):c.attr(`transform`,`translate(0, ${22/2-5})`),t.height},`drawActorTypeEntity`),me=r(function(e,t,n,r){let i=r?t.stopy:t.starty,a=t.x+t.width/2,o=i+t.height+2*n.boxTextMargin,s=e.append(`g`).lower(),c=s;r||(G++,Object.keys(t.links||{}).length&&!n.forceMenus&&c.attr(`onclick`,H(`actor${G}_popup`)).attr(`cursor`,`pointer`),c.append(`line`).attr(`id`,`actor`+G).attr(`x1`,a).attr(`y1`,o).attr(`x2`,a).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name),c=s.append(`g`),t.actorCnt=G,t.links!=null&&c.attr(`id`,`root-`+G));let l=k(),u=`actor`;t.properties?.class?u=t.properties.class:l.fill=`#eaeaea`,r?u+=` ${z}`:u+=` ${R}`,l.x=t.x,l.y=i,l.width=t.width,l.height=t.height,l.class=u,l.name=t.name,l.x=t.x,l.y=i;let d=l.width/3,f=l.width/3,p=d/2,m=p/(2.5+d/50),h=c.append(`g`),g=`
139
+ M ${l.x},${l.y+m}
140
+ a ${p},${m} 0 0 0 ${d},0
141
+ a ${p},${m} 0 0 0 -${d},0
142
+ l 0,${f-2*m}
143
+ a ${p},${m} 0 0 0 ${d},0
144
+ l 0,-${f-2*m}
145
+ `;h.append(`path`).attr(`d`,g).attr(`fill`,`#eaeaea`).attr(`stroke`,`#000`).attr(`stroke-width`,1).attr(`class`,u),h.attr(`transform`,`translate(${d}, ${m})`),t.rectData=l,J(n,v(t.description))(t.description,c,l.x,l.y+35,l.width,l.height,{class:`actor ${ae}`},n);let _=h.select(`path:last-child`);return _.node()&&(t.height=_.node().getBBox().height+(n.sequence.labelBoxHeight??0)),t.height},`drawActorTypeDatabase`),he=r(function(e,t,n,r){let i=r?t.stopy:t.starty,a=t.x+t.width/2,o=i+80,s=e.append(`g`).lower();r||(G++,s.append(`line`).attr(`id`,`actor`+G).attr(`x1`,a).attr(`y1`,o).attr(`x2`,a).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name),t.actorCnt=G);let c=e.append(`g`),l=B;r?l+=` ${z}`:l+=` ${R}`,c.attr(`class`,l),c.attr(`name`,t.name);let u=k();return u.x=t.x,u.y=i,u.fill=`#eaeaea`,u.width=t.width,u.height=t.height,u.class=`actor`,c.append(`line`).attr(`id`,`actor-man-torso`+G).attr(`x1`,t.x+t.width/2-22*2.5).attr(`y1`,i+12).attr(`x2`,t.x+t.width/2-15).attr(`y2`,i+12),c.append(`line`).attr(`id`,`actor-man-arms`+G).attr(`x1`,t.x+t.width/2-22*2.5).attr(`y1`,i+2).attr(`x2`,t.x+t.width/2-22*2.5).attr(`y2`,i+22),c.append(`circle`).attr(`cx`,t.x+t.width/2).attr(`cy`,i+12).attr(`r`,22),t.height=c.node().getBBox().height+(n.sequence.labelBoxHeight??0),J(n,v(t.description))(t.description,c,u.x,u.y+15,u.width,u.height,{class:`actor ${B}`},n),c.attr(`transform`,`translate(0,21)`),t.height},`drawActorTypeBoundary`),ge=r(function(e,t,n,r){let i=r?t.stopy:t.starty,a=t.x+t.width/2,o=i+80,s=e.append(`g`).lower();r||(G++,s.append(`line`).attr(`id`,`actor`+G).attr(`x1`,a).attr(`y1`,o).attr(`x2`,a).attr(`y2`,2e3).attr(`class`,`actor-line 200`).attr(`stroke-width`,`0.5px`).attr(`stroke`,`#999`).attr(`name`,t.name),t.actorCnt=G);let c=e.append(`g`),l=B;r?l+=` ${z}`:l+=` ${R}`,c.attr(`class`,l),c.attr(`name`,t.name);let u=k();u.x=t.x,u.y=i,u.fill=`#eaeaea`,u.width=t.width,u.height=t.height,u.class=`actor`,u.rx=3,u.ry=3,c.append(`line`).attr(`id`,`actor-man-torso`+G).attr(`x1`,a).attr(`y1`,i+25).attr(`x2`,a).attr(`y2`,i+45),c.append(`line`).attr(`id`,`actor-man-arms`+G).attr(`x1`,a-L/2).attr(`y1`,i+33).attr(`x2`,a+L/2).attr(`y2`,i+33),c.append(`line`).attr(`x1`,a-L/2).attr(`y1`,i+60).attr(`x2`,a).attr(`y2`,i+45),c.append(`line`).attr(`x1`,a).attr(`y1`,i+45).attr(`x2`,a+L/2-2).attr(`y2`,i+60);let d=c.append(`circle`);return d.attr(`cx`,t.x+t.width/2),d.attr(`cy`,i+10),d.attr(`r`,15),d.attr(`width`,t.width),d.attr(`height`,t.height),t.height=c.node().getBBox().height,J(n,v(t.description))(t.description,c,u.x,u.y+35,u.width,u.height,{class:`actor ${B}`},n),t.height},`drawActorTypeActor`),_e=r(async function(e,t,n,r){switch(t.type){case`actor`:return await ge(e,t,n,r);case`participant`:return await le(e,t,n,r);case`boundary`:return await he(e,t,n,r);case`control`:return await fe(e,t,n,r);case`entity`:return await pe(e,t,n,r);case`database`:return await me(e,t,n,r);case`collections`:return await ue(e,t,n,r);case`queue`:return await de(e,t,n,r)}},`drawActor`),ve=r(function(e,t,n){let r=e.append(`g`);Se(r,t),t.name&&J(n)(t.name,r,t.x,t.y+n.boxTextMargin+(t.textMaxHeight||0)/2,t.width,0,{class:`text`},n),r.lower()},`drawBox`),ye=r(function(e){return e.append(`g`)},`anchorElement`),be=r(function(e,t,n,r,i){let a=k(),o=t.anchored;a.x=t.startx,a.y=t.starty,a.class=`activation`+i%3,a.width=t.stopx-t.startx,a.height=n-t.starty,V(o,a)},`drawActivation`),xe=r(async function(e,t,n,i){let{boxMargin:a,boxTextMargin:o,labelBoxHeight:s,labelBoxWidth:c,messageFontFamily:l,messageFontSize:u,messageFontWeight:d}=i,f=e.append(`g`),p=r(function(e,t,n,r){return f.append(`line`).attr(`x1`,e).attr(`y1`,t).attr(`x2`,n).attr(`y2`,r).attr(`class`,`loopLine`)},`drawLoopLine`);p(t.startx,t.starty,t.stopx,t.starty),p(t.stopx,t.starty,t.stopx,t.stopy),p(t.startx,t.stopy,t.stopx,t.stopy),p(t.startx,t.starty,t.startx,t.stopy),t.sections!==void 0&&t.sections.forEach(function(e){p(t.startx,e.y,t.stopx,e.y).style(`stroke-dasharray`,`3, 3`)});let m=T();m.text=n,m.x=t.startx,m.y=t.starty,m.fontFamily=l,m.fontSize=u,m.fontWeight=d,m.anchor=`middle`,m.valign=`middle`,m.tspan=!1,m.width=c||50,m.height=s||20,m.textMargin=o,m.class=`labelText`,se(f,m),m=Oe(),m.text=t.title,m.x=t.startx+c/2+(t.stopx-t.startx)/2,m.y=t.starty+a+o,m.anchor=`middle`,m.valign=`middle`,m.textMargin=o,m.class=`loopText`,m.fontFamily=l,m.fontSize=u,m.fontWeight=d,m.wrap=!0;let h=v(m.text)?await U(f,m,t):W(f,m);if(t.sectionTitles!==void 0){for(let[e,n]of Object.entries(t.sectionTitles))if(n.message){m.text=n.message,m.x=t.startx+(t.stopx-t.startx)/2,m.y=t.sections[e].y+a+o,m.class=`loopText`,m.anchor=`middle`,m.valign=`middle`,m.tspan=!1,m.fontFamily=l,m.fontSize=u,m.fontWeight=d,m.wrap=t.wrap,v(m.text)?(t.starty=t.sections[e].y,await U(f,m,t)):W(f,m);let r=Math.round(h.map(e=>(e._groups||e)[0][0].getBBox().height).reduce((e,t)=>e+t));t.sections[e].height+=r-(a+o)}}return t.height=Math.round(t.stopy-t.starty),f},`drawLoop`),Se=r(function(e,t){D(e,t)},`drawBackgroundRect`),Ce=r(function(e){e.append(`defs`).append(`symbol`).attr(`id`,`database`).attr(`fill-rule`,`evenodd`).attr(`clip-rule`,`evenodd`).append(`path`).attr(`transform`,`scale(.5)`).attr(`d`,`M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z`)},`insertDatabaseIcon`),we=r(function(e){e.append(`defs`).append(`symbol`).attr(`id`,`computer`).attr(`width`,`24`).attr(`height`,`24`).append(`path`).attr(`transform`,`scale(.5)`).attr(`d`,`M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z`)},`insertComputerIcon`),K=r(function(e){e.append(`defs`).append(`symbol`).attr(`id`,`clock`).attr(`width`,`24`).attr(`height`,`24`).append(`path`).attr(`transform`,`scale(.5)`).attr(`d`,`M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z`)},`insertClockIcon`),q=r(function(e){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`)},`insertArrowHead`),Te=r(function(e){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`)},`insertArrowFilledHead`),Ee=r(function(e){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)},`insertSequenceNumber`),De=r(function(e){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`)},`insertArrowCrossHead`),Oe=r(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:`#666`,width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},`getTextObj`),ke=r(function(){return{x:0,y:0,fill:`#EDF2AE`,stroke:`#666`,width:100,anchor:`start`,height:100,rx:0,ry:0}},`getNoteRect`),J=(function(){function t(e,t,n,r,i,a,s){o(t.append(`text`).attr(`x`,n+i/2).attr(`y`,r+a/2+5).style(`text-anchor`,`middle`).text(e),s)}r(t,`byText`);function n(t,n,r,i,a,s,c,l){let{actorFontSize:u,actorFontFamily:d,actorFontWeight:f}=l,[p,m]=e(u),h=t.split(b.lineBreakRegex);for(let e=0;e<h.length;e++){let t=e*p-p*(h.length-1)/2,l=n.append(`text`).attr(`x`,r+a/2).attr(`y`,i).style(`text-anchor`,`middle`).style(`font-size`,m).style(`font-weight`,f).style(`font-family`,d);l.append(`tspan`).attr(`x`,r+a/2).attr(`dy`,t).text(h[e]),l.attr(`y`,i+s/2).attr(`dominant-baseline`,`central`).attr(`alignment-baseline`,`central`),o(l,c)}}r(n,`byTspan`);function i(e,t,r,i,a,s,c,l){let u=t.append(`switch`),d=u.append(`foreignObject`).attr(`x`,r).attr(`y`,i).attr(`width`,a).attr(`height`,s).append(`xhtml:div`).style(`display`,`table`).style(`height`,`100%`).style(`width`,`100%`);d.append(`div`).style(`display`,`table-cell`).style(`text-align`,`center`).style(`vertical-align`,`middle`).text(e),n(e,u,r,i,a,s,c,l),o(d,c)}r(i,`byFo`);async function a(e,t,r,i,a,s,c,u){let d=await _(e,S()),f=t.append(`switch`),p=f.append(`foreignObject`).attr(`x`,r+a/2-d.width/2).attr(`y`,i+s/2-d.height/2).attr(`width`,d.width).attr(`height`,d.height).append(`xhtml:div`).style(`height`,`100%`).style(`width`,`100%`);p.append(`div`).style(`text-align`,`center`).style(`vertical-align`,`middle`).html(await l(e,S())),n(e,f,r,i,a,s,c,u),o(p,c)}r(a,`byKatex`);function o(e,t){for(let n in t)t.hasOwnProperty(n)&&e.attr(n,t[n])}return r(o,`_setTextAttrs`),function(e,r=!1){return r?a:e.textPlacement===`fo`?i:e.textPlacement===`old`?t:n}})(),Ae=(function(){function e(e,t,n,r,a,o,s){i(t.append(`text`).attr(`x`,n).attr(`y`,r).style(`text-anchor`,`start`).text(e),s)}r(e,`byText`);function t(e,t,n,r,a,o,s,c){let{actorFontSize:l,actorFontFamily:u,actorFontWeight:d}=c,f=e.split(b.lineBreakRegex);for(let e=0;e<f.length;e++){let a=e*l-l*(f.length-1)/2,c=t.append(`text`).attr(`x`,n).attr(`y`,r).style(`text-anchor`,`start`).style(`font-size`,l).style(`font-weight`,d).style(`font-family`,u);c.append(`tspan`).attr(`x`,n).attr(`dy`,a).text(f[e]),c.attr(`y`,r+o/2).attr(`dominant-baseline`,`central`).attr(`alignment-baseline`,`central`),i(c,s)}}r(t,`byTspan`);function n(e,n,r,a,o,s,c,l){let u=n.append(`switch`),d=u.append(`foreignObject`).attr(`x`,r).attr(`y`,a).attr(`width`,o).attr(`height`,s).append(`xhtml:div`).style(`display`,`table`).style(`height`,`100%`).style(`width`,`100%`);d.append(`div`).style(`display`,`table-cell`).style(`text-align`,`center`).style(`vertical-align`,`middle`).text(e),t(e,u,r,a,o,s,c,l),i(d,c)}r(n,`byFo`);function i(e,t){for(let n in t)t.hasOwnProperty(n)&&e.attr(n,t[n])}return r(i,`_setTextAttrs`),function(r){return r.textPlacement===`fo`?n:r.textPlacement===`old`?e:t}})(),Y={drawRect:V,drawText:W,drawLabel:se,drawActor:_e,drawBox:ve,drawPopup:oe,anchorElement:ye,drawActivation:be,drawLoop:xe,drawBackgroundRect:Se,insertArrowHead:q,insertArrowFilledHead:Te,insertSequenceNumber:Ee,insertArrowCrossHead:De,insertDatabaseIcon:Ce,insertComputerIcon:we,insertClockIcon:K,getTextObj:Oe,getNoteRect:ke,fixLifeLineHeights:ce,sanitizeUrl:N.sanitizeUrl,insertSolidTopArrowHead:r(function(e){e.append(`defs`).append(`marker`).attr(`id`,`solidTopArrowHead`).attr(`refX`,7.9).attr(`refY`,7.25).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto-start-reverse`).append(`path`).attr(`d`,`M 0 0 L 10 8 L 0 8 z`)},`insertSolidTopArrowHead`),insertSolidBottomArrowHead:r(function(e){e.append(`defs`).append(`marker`).attr(`id`,`solidBottomArrowHead`).attr(`refX`,7.9).attr(`refY`,.75).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto-start-reverse`).append(`path`).attr(`d`,`M 0 0 L 10 0 L 0 8 z`)},`insertSolidBottomArrowHead`),insertStickTopArrowHead:r(function(e){e.append(`defs`).append(`marker`).attr(`id`,`stickTopArrowHead`).attr(`refX`,7.5).attr(`refY`,7).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto-start-reverse`).append(`path`).attr(`d`,`M 0 0 L 7 7`).attr(`stroke`,`black`).attr(`stroke-width`,1.5).attr(`fill`,`none`)},`insertStickTopArrowHead`),insertStickBottomArrowHead:r(function(e){e.append(`defs`).append(`marker`).attr(`id`,`stickBottomArrowHead`).attr(`refX`,7.5).attr(`refY`,0).attr(`markerUnits`,`userSpaceOnUse`).attr(`markerWidth`,12).attr(`markerHeight`,12).attr(`orient`,`auto-start-reverse`).append(`path`).attr(`d`,`M 0 7 L 7 0`).attr(`stroke`,`black`).attr(`stroke-width`,1.5).attr(`fill`,`none`)},`insertStickBottomArrowHead`)},X={},Z={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:r(function(){return Math.max.apply(null,this.actors.length===0?[0]:this.actors.map(e=>e.height||0))+(this.loops.length===0?0:this.loops.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.messages.length===0?0:this.messages.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.notes.length===0?0:this.notes.map(e=>e.height||0).reduce((e,t)=>e+t))},`getHeight`),clear:r(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},`clear`),addBox:r(function(e){this.boxes.push(e)},`addBox`),addActor:r(function(e){this.actors.push(e)},`addActor`),addLoop:r(function(e){this.loops.push(e)},`addLoop`),addMessage:r(function(e){this.messages.push(e)},`addMessage`),addNote:r(function(e){this.notes.push(e)},`addNote`),lastActor:r(function(){return this.actors[this.actors.length-1]},`lastActor`),lastLoop:r(function(){return this.loops[this.loops.length-1]},`lastLoop`),lastMessage:r(function(){return this.messages[this.messages.length-1]},`lastMessage`),lastNote:r(function(){return this.notes[this.notes.length-1]},`lastNote`),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:r(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,Be(h())},`init`),updateVal:r(function(e,t,n,r){e[t]===void 0?e[t]=n:e[t]=r(n,e[t])},`updateVal`),updateBounds:r(function(e,t,n,i){let a=this,o=0;function s(s){return r(function(r){o++;let c=a.sequenceItems.length-o+1;a.updateVal(r,`starty`,t-c*X.boxMargin,Math.min),a.updateVal(r,`stopy`,i+c*X.boxMargin,Math.max),a.updateVal(Z.data,`startx`,e-c*X.boxMargin,Math.min),a.updateVal(Z.data,`stopx`,n+c*X.boxMargin,Math.max),s!==`activation`&&(a.updateVal(r,`startx`,e-c*X.boxMargin,Math.min),a.updateVal(r,`stopx`,n+c*X.boxMargin,Math.max),a.updateVal(Z.data,`starty`,t-c*X.boxMargin,Math.min),a.updateVal(Z.data,`stopy`,i+c*X.boxMargin,Math.max))},`updateItemBounds`)}r(s,`updateFn`),this.sequenceItems.forEach(s()),this.activations.forEach(s(`activation`))},`updateBounds`),insert:r(function(e,t,n,r){let i=b.getMin(e,n),a=b.getMax(e,n),o=b.getMin(t,r),s=b.getMax(t,r);this.updateVal(Z.data,`startx`,i,Math.min),this.updateVal(Z.data,`starty`,o,Math.min),this.updateVal(Z.data,`stopx`,a,Math.max),this.updateVal(Z.data,`stopy`,s,Math.max),this.updateBounds(i,o,a,s)},`insert`),newActivation:r(function(e,t,n){let r=n.get(e.from),i=Ve(e.from).length||0,a=r.x+r.width/2+(i-1)*X.activationWidth/2;this.activations.push({startx:a,starty:this.verticalPos+2,stopx:a+X.activationWidth,stopy:void 0,actor:e.from,anchored:Y.anchorElement(t)})},`newActivation`),endActivation:r(function(e){let t=this.activations.map(function(e){return e.actor}).lastIndexOf(e.from);return this.activations.splice(t,1)[0]},`endActivation`),createLoop:r(function(e={message:void 0,wrap:!1,width:void 0},t){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:e.message,wrap:e.wrap,width:e.width,height:0,fill:t}},`createLoop`),newLoop:r(function(e={message:void 0,wrap:!1,width:void 0},t){this.sequenceItems.push(this.createLoop(e,t))},`newLoop`),endLoop:r(function(){return this.sequenceItems.pop()},`endLoop`),isLoopOverlap:r(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},`isLoopOverlap`),addSectionToLoop:r(function(e){let t=this.sequenceItems.pop();t.sections=t.sections||[],t.sectionTitles=t.sectionTitles||[],t.sections.push({y:Z.getVerticalPos(),height:0}),t.sectionTitles.push(e),this.sequenceItems.push(t)},`addSectionToLoop`),saveVerticalPos:r(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},`saveVerticalPos`),resetVerticalPos:r(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},`resetVerticalPos`),bumpVerticalPos:r(function(e){this.verticalPos+=e,this.data.stopy=b.getMax(this.data.stopy,this.verticalPos)},`bumpVerticalPos`),getVerticalPos:r(function(){return this.verticalPos},`getVerticalPos`),getBounds:r(function(){return{bounds:this.data,models:this.models}},`getBounds`)},je=r(async function(e,t){Z.bumpVerticalPos(X.boxMargin),t.height=X.boxMargin,t.starty=Z.getVerticalPos();let n=k();n.x=t.startx,n.y=t.starty,n.width=t.width||X.width,n.class=`note`;let r=e.append(`g`),i=Y.drawRect(r,n),a=T();a.x=t.startx,a.y=t.starty,a.width=n.width,a.dy=`1em`,a.text=t.message,a.class=`noteText`,a.fontFamily=X.noteFontFamily,a.fontSize=X.noteFontSize,a.fontWeight=X.noteFontWeight,a.anchor=X.noteAlign,a.textMargin=X.noteMargin,a.valign=`center`;let o=v(a.text)?await U(r,a):W(r,a),s=Math.round(o.map(e=>(e._groups||e)[0][0].getBBox().height).reduce((e,t)=>e+t));i.attr(`height`,s+2*X.noteMargin),t.height+=s+2*X.noteMargin,Z.bumpVerticalPos(s+2*X.noteMargin),t.stopy=t.starty+s+2*X.noteMargin,t.stopx=t.startx+n.width,Z.insert(t.startx,t.starty,t.stopx,t.stopy),Z.models.addNote(t)},`drawNote`),Me=r(function(e,t,n,i,a,o,s){let c=i.db.getActors(),l=c.get(t.from),u=c.get(t.to),d=n.sequenceVisible,f=l.x+l.width/2,p=u.x+u.width/2,m=f<=p,h=$e(t,i),g=e.append(`g`),_=16.5,v=r((e,t)=>{let n=e?_:-_;return t?-n:n},`getCircleOffset`),y=r(e=>{g.append(`circle`).attr(`cx`,e).attr(`cy`,s).attr(`r`,5).attr(`width`,10).attr(`height`,10)},`drawCircle`),{CENTRAL_CONNECTION:b,CENTRAL_CONNECTION_REVERSE:x,CENTRAL_CONNECTION_DUAL:S}=i.db.LINETYPE;if(d)switch(t.centralConnection){case b:h&&(p+=v(m,!0));break;case x:h||(f+=v(m,!1));break;case S:h?p+=v(m,!0):f+=v(m,!1);break}switch(t.centralConnection){case b:y(p);break;case x:y(f);break;case S:y(f),y(p);break}},`drawCentralConnection`),Q=r(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),`messageFont`),Ne=r(e=>({fontFamily:e.noteFontFamily,fontSize:e.noteFontSize,fontWeight:e.noteFontWeight}),`noteFont`),Pe=r(e=>({fontFamily:e.actorFontFamily,fontSize:e.actorFontSize,fontWeight:e.actorFontWeight}),`actorFont`);async function Fe(e,n){Z.bumpVerticalPos(10);let{startx:r,stopx:i,message:a}=n,o=b.splitBreaks(a).length,s=v(a),c=s?await _(a,h()):t.calculateTextDimensions(a,Q(X));if(!s){let e=c.height/o;n.height+=e,Z.bumpVerticalPos(e)}let l,u=c.height-10,d=c.width;if(r===i){l=Z.getVerticalPos()+u,X.rightAngles||(u+=X.boxMargin,l=Z.getVerticalPos()+u),u+=30;let e=b.getMax(d/2,X.width/2);Z.insert(r-e,Z.getVerticalPos()-10+u,i+e,Z.getVerticalPos()+30+u)}else u+=X.boxMargin,l=Z.getVerticalPos()+u,Z.insert(r,l-10,i,l);return Z.bumpVerticalPos(u),n.height+=u,n.stopy=n.starty+n.height,Z.insert(n.fromBounds,n.starty,n.toBounds,n.stopy),l}r(Fe,`boundMessage`);var Ie=r(async function(e,n,r,i,a){let{startx:o,stopx:c,starty:l,message:u,type:d,sequenceIndex:f,sequenceVisible:p}=n,m=t.calculateTextDimensions(u,Q(X)),h=T();h.x=o,h.y=l+10,h.width=c-o,h.class=`messageText`,h.dy=`1em`,h.text=u,h.fontFamily=X.messageFontFamily,h.fontSize=X.messageFontSize,h.fontWeight=X.messageFontWeight,h.anchor=X.messageAlign,h.valign=`center`,h.textMargin=X.wrapPadding,h.tspan=!1,v(h.text)?await U(e,h,{startx:o,stopx:c,starty:r}):W(e,h);let g=m.width,_;if(o===c){let t=p||X.showSequenceNumbers,n=$e(a,i),s=et(a,i),c=o+(t&&(n||s)?10:0);_=X.rightAngles?e.append(`path`).attr(`d`,`M ${c},${r} H ${o+b.getMax(X.width/2,g/2)} V ${r+25} H ${o}`):e.append(`path`).attr(`d`,`M `+c+`,`+r+` C `+(c+60)+`,`+(r-10)+` `+(o+60)+`,`+(r+30)+` `+o+`,`+(r+20))}else _=e.append(`line`),_.attr(`x1`,o),_.attr(`y1`,r),_.attr(`x2`,c),_.attr(`y2`,r),Ze(a,i)&&Me(e,a,n,i,o,c,r);d===i.db.LINETYPE.DOTTED||d===i.db.LINETYPE.DOTTED_CROSS||d===i.db.LINETYPE.DOTTED_POINT||d===i.db.LINETYPE.DOTTED_OPEN||d===i.db.LINETYPE.BIDIRECTIONAL_DOTTED||d===i.db.LINETYPE.SOLID_TOP_DOTTED||d===i.db.LINETYPE.SOLID_BOTTOM_DOTTED||d===i.db.LINETYPE.STICK_TOP_DOTTED||d===i.db.LINETYPE.STICK_BOTTOM_DOTTED||d===i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||d===i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||d===i.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||d===i.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(_.style(`stroke-dasharray`,`3, 3`),_.attr(`class`,`messageLine1`)):_.attr(`class`,`messageLine0`);let y=``;if(X.arrowMarkerAbsolute&&(y=s(!0)),_.attr(`stroke-width`,2),_.attr(`stroke`,`none`),_.style(`fill`,`none`),(d===i.db.LINETYPE.SOLID_TOP||d===i.db.LINETYPE.SOLID_TOP_DOTTED)&&_.attr(`marker-end`,`url(`+y+`#solidTopArrowHead)`),(d===i.db.LINETYPE.SOLID_BOTTOM||d===i.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&_.attr(`marker-end`,`url(`+y+`#solidBottomArrowHead)`),(d===i.db.LINETYPE.STICK_TOP||d===i.db.LINETYPE.STICK_TOP_DOTTED)&&_.attr(`marker-end`,`url(`+y+`#stickTopArrowHead)`),(d===i.db.LINETYPE.STICK_BOTTOM||d===i.db.LINETYPE.STICK_BOTTOM_DOTTED)&&_.attr(`marker-end`,`url(`+y+`#stickBottomArrowHead)`),(d===i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||d===i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&_.attr(`marker-start`,`url(`+y+`#solidBottomArrowHead)`),(d===i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||d===i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&_.attr(`marker-start`,`url(`+y+`#solidTopArrowHead)`),(d===i.db.LINETYPE.STICK_ARROW_TOP_REVERSE||d===i.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&_.attr(`marker-start`,`url(`+y+`#stickBottomArrowHead)`),(d===i.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||d===i.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&_.attr(`marker-start`,`url(`+y+`#stickTopArrowHead)`),(d===i.db.LINETYPE.SOLID||d===i.db.LINETYPE.DOTTED)&&_.attr(`marker-end`,`url(`+y+`#arrowhead)`),(d===i.db.LINETYPE.BIDIRECTIONAL_SOLID||d===i.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(_.attr(`marker-start`,`url(`+y+`#arrowhead)`),_.attr(`marker-end`,`url(`+y+`#arrowhead)`)),(d===i.db.LINETYPE.SOLID_POINT||d===i.db.LINETYPE.DOTTED_POINT)&&_.attr(`marker-end`,`url(`+y+`#filled-head)`),(d===i.db.LINETYPE.SOLID_CROSS||d===i.db.LINETYPE.DOTTED_CROSS)&&_.attr(`marker-end`,`url(`+y+`#crosshead)`),p||X.showSequenceNumbers){let t=d===i.db.LINETYPE.BIDIRECTIONAL_SOLID||d===i.db.LINETYPE.BIDIRECTIONAL_DOTTED,s=d===i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||d===i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||d===i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||d===i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||d===i.db.LINETYPE.STICK_ARROW_TOP_REVERSE||d===i.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||d===i.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||d===i.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,l=Ze(a,i),u=o,p=c;t?(o<c?u=o+12:(u=o-6+(l?-5:0),u+=a?.centralConnection===i.db.LINETYPE.CENTRAL_CONNECTION_DUAL||a?.centralConnection===i.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),_.attr(`x1`,u)):s?(c>o?p=c-12:(p=c-6,u+=a?.centralConnection===i.db.LINETYPE.CENTRAL_CONNECTION_DUAL||a?.centralConnection===i.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),p+=l?15:0,_.attr(`x2`,p),_.attr(`x1`,u)):_.attr(`x1`,o+6);let m=0,h=o===c,g=o<=c;m=h?n.fromBounds+1:s?g?n.toBounds-1:n.fromBounds+1:g?n.fromBounds+1:n.toBounds-1,e.append(`line`).attr(`x1`,m).attr(`y1`,r).attr(`x2`,m).attr(`y2`,r).attr(`stroke-width`,0).attr(`marker-start`,`url(`+y+`#sequencenumber)`),e.append(`text`).attr(`x`,m).attr(`y`,r+4).attr(`font-family`,`sans-serif`).attr(`font-size`,`12px`).attr(`text-anchor`,`middle`).attr(`class`,`sequenceNumber`).text(f)}},`drawMessage`),Le=r(function(e,t,n,r,i,a,o){let s=0,c=0,l,u=0;for(let e of r){let r=t.get(e),a=r.box;l&&l!=a&&(o||Z.models.addBox(l),c+=X.boxMargin+l.margin),a&&a!=l&&(o||(a.x=s+c,a.y=i),c+=a.margin),r.width=r.width||X.width,r.height=b.getMax(r.height||X.height,X.height),r.margin=r.margin||X.actorMargin,u=b.getMax(u,r.height),n.get(r.name)&&(c+=r.width/2),r.x=s+c,r.starty=Z.getVerticalPos(),Z.insert(r.x,i,r.x+r.width,r.height),s+=r.width+c,r.box&&(r.box.width=s+a.margin-r.box.x),c=r.margin,l=r.box,Z.models.addActor(r)}l&&!o&&Z.models.addBox(l),Z.bumpVerticalPos(u)},`addActorRenderingData`),Re=r(async function(e,t,n,r){if(r){let r=0;Z.bumpVerticalPos(X.boxMargin*2);for(let i of n){let n=t.get(i);n.stopy||=Z.getVerticalPos();let a=await Y.drawActor(e,n,X,!0);r=b.getMax(r,a)}Z.bumpVerticalPos(r+X.boxMargin)}else for(let r of n){let n=t.get(r);await Y.drawActor(e,n,X,!1)}},`drawActors`),ze=r(function(e,t,n,r){let i=0,a=0;for(let o of n){let n=t.get(o),s=Ke(n),c=Y.drawPopup(e,n,s,X,X.forceMenus,r);c.height>i&&(i=c.height),c.width+n.x>a&&(a=c.width+n.x)}return{maxHeight:i,maxWidth:a}},`drawActorsPopup`),Be=r(function(e){y(X,e),e.fontFamily&&(X.actorFontFamily=X.noteFontFamily=X.messageFontFamily=e.fontFamily),e.fontSize&&(X.actorFontSize=X.noteFontSize=X.messageFontSize=e.fontSize),e.fontWeight&&(X.actorFontWeight=X.noteFontWeight=X.messageFontWeight=e.fontWeight)},`setConf`),Ve=r(function(e){return Z.activations.filter(function(t){return t.actor===e})},`actorActivations`),He=r(function(e,t){let n=t.get(e),r=Ve(e);return[r.reduce(function(e,t){return b.getMin(e,t.startx)},n.x+n.width/2-1),r.reduce(function(e,t){return b.getMax(e,t.stopx)},n.x+n.width/2+1)]},`activationBounds`);function $(e,r,i,a,o){Z.bumpVerticalPos(i);let s=a;if(r.id&&r.message&&e[r.id]){let i=e[r.id].width,o=Q(X);r.message=t.wrapLabel(`[${r.message}]`,i-2*X.wrapPadding,o),r.width=i,r.wrap=!0;let c=t.calculateTextDimensions(r.message,o),l=b.getMax(c.height,X.labelBoxHeight);s=a+l,n.debug(`${l} - ${r.message}`)}o(r),Z.bumpVerticalPos(s)}r($,`adjustLoopHeightForWrap`);function Ue(e,t,n,i,a,o,s){function c(n,r){n.x<a.get(e.from).x?(Z.insert(t.stopx-r,t.starty,t.startx,t.stopy+n.height/2+X.noteMargin),t.stopx+=r):(Z.insert(t.startx,t.starty,t.stopx+r,t.stopy+n.height/2+X.noteMargin),t.stopx-=r)}r(c,`receiverAdjustment`);function l(n,r){n.x<a.get(e.to).x?(Z.insert(t.startx-r,t.starty,t.stopx,t.stopy+n.height/2+X.noteMargin),t.startx+=r):(Z.insert(t.stopx,t.starty,t.startx+r,t.stopy+n.height/2+X.noteMargin),t.startx-=r)}r(l,`senderAdjustment`);let u=[ne.ACTOR,ne.CONTROL,ne.ENTITY,ne.DATABASE];if(o.get(e.to)==i){let t=a.get(e.to);c(t,u.includes(t.type)?L/2+3:t.width/2+3),t.starty=n-t.height/2,Z.bumpVerticalPos(t.height/2)}else if(s.get(e.from)==i){let t=a.get(e.from);X.mirrorActors&&l(t,u.includes(t.type)?L/2:t.width/2),t.stopy=n-t.height/2,Z.bumpVerticalPos(t.height/2)}else if(s.get(e.to)==i){let t=a.get(e.to);X.mirrorActors&&c(t,u.includes(t.type)?L/2+3:t.width/2+3),t.stopy=n-t.height/2,Z.bumpVerticalPos(t.height/2)}}r(Ue,`adjustCreatedDestroyedData`);var We=r(async function(e,t,a,o){let{securityLevel:s,sequence:c}=h();X=c;let l;s===`sandbox`&&(l=i(`#i`+t));let u=i(s===`sandbox`?l.nodes()[0].contentDocument.body:`body`),d=s===`sandbox`?l.nodes()[0].contentDocument:document;Z.init(),n.debug(o.db);let f=s===`sandbox`?u.select(`[id="${t}"]`):i(`[id="${t}"]`),p=o.db.getActors(),m=o.db.getCreatedActors(),_=o.db.getDestroyedActors(),v=o.db.getBoxes(),y=o.db.getActorKeys(),b=o.db.getMessages(),x=o.db.getDiagramTitle(),S=o.db.hasAtLeastOneBox(),C=o.db.hasAtLeastOneBoxWithTitle(),w=await Ge(p,b,o);if(X.height=await qe(p,w,v),Y.insertComputerIcon(f),Y.insertDatabaseIcon(f),Y.insertClockIcon(f),S&&(Z.bumpVerticalPos(X.boxMargin),C&&Z.bumpVerticalPos(v[0].textMaxHeight)),X.hideUnusedParticipants===!0){let e=new Set;b.forEach(t=>{e.add(t.from),e.add(t.to)}),y=y.filter(t=>e.has(t))}Le(f,p,m,y,0,b,!1);let T=await nt(b,p,w,o);Y.insertArrowHead(f),Y.insertArrowCrossHead(f),Y.insertArrowFilledHead(f),Y.insertSequenceNumber(f),Y.insertSolidTopArrowHead(f),Y.insertSolidBottomArrowHead(f),Y.insertStickTopArrowHead(f),Y.insertStickBottomArrowHead(f);function E(e,t){let n=Z.endActivation(e);n.starty+18>t&&(n.starty=t-6,t+=12),Y.drawActivation(f,n,t,X,Ve(e.from).length),Z.insert(n.startx,t-10,n.stopx,t)}r(E,`activeEnd`);let D=1,O=1,k=[],A=[],j=0;for(let e of b){let t,r,i;switch(e.type){case o.db.LINETYPE.NOTE:Z.resetVerticalPos(),r=e.noteModel,await je(f,r);break;case o.db.LINETYPE.ACTIVE_START:Z.newActivation(e,f,p);break;case o.db.LINETYPE.CENTRAL_CONNECTION:Z.newActivation(e,f,p);break;case o.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:Z.newActivation(e,f,p);break;case o.db.LINETYPE.ACTIVE_END:E(e,Z.getVerticalPos());break;case o.db.LINETYPE.LOOP_START:$(T,e,X.boxMargin,X.boxMargin+X.boxTextMargin,e=>Z.newLoop(e));break;case o.db.LINETYPE.LOOP_END:t=Z.endLoop(),await Y.drawLoop(f,t,`loop`,X),Z.bumpVerticalPos(t.stopy-Z.getVerticalPos()),Z.models.addLoop(t);break;case o.db.LINETYPE.RECT_START:$(T,e,X.boxMargin,X.boxMargin,e=>Z.newLoop(void 0,e.message));break;case o.db.LINETYPE.RECT_END:t=Z.endLoop(),A.push(t),Z.models.addLoop(t),Z.bumpVerticalPos(t.stopy-Z.getVerticalPos());break;case o.db.LINETYPE.OPT_START:$(T,e,X.boxMargin,X.boxMargin+X.boxTextMargin,e=>Z.newLoop(e));break;case o.db.LINETYPE.OPT_END:t=Z.endLoop(),await Y.drawLoop(f,t,`opt`,X),Z.bumpVerticalPos(t.stopy-Z.getVerticalPos()),Z.models.addLoop(t);break;case o.db.LINETYPE.ALT_START:$(T,e,X.boxMargin,X.boxMargin+X.boxTextMargin,e=>Z.newLoop(e));break;case o.db.LINETYPE.ALT_ELSE:$(T,e,X.boxMargin+X.boxTextMargin,X.boxMargin,e=>Z.addSectionToLoop(e));break;case o.db.LINETYPE.ALT_END:t=Z.endLoop(),await Y.drawLoop(f,t,`alt`,X),Z.bumpVerticalPos(t.stopy-Z.getVerticalPos()),Z.models.addLoop(t);break;case o.db.LINETYPE.PAR_START:case o.db.LINETYPE.PAR_OVER_START:$(T,e,X.boxMargin,X.boxMargin+X.boxTextMargin,e=>Z.newLoop(e)),Z.saveVerticalPos();break;case o.db.LINETYPE.PAR_AND:$(T,e,X.boxMargin+X.boxTextMargin,X.boxMargin,e=>Z.addSectionToLoop(e));break;case o.db.LINETYPE.PAR_END:t=Z.endLoop(),await Y.drawLoop(f,t,`par`,X),Z.bumpVerticalPos(t.stopy-Z.getVerticalPos()),Z.models.addLoop(t);break;case o.db.LINETYPE.AUTONUMBER:D=e.message.start||D,O=e.message.step||O,e.message.visible?o.db.enableSequenceNumbers():o.db.disableSequenceNumbers();break;case o.db.LINETYPE.CRITICAL_START:$(T,e,X.boxMargin,X.boxMargin+X.boxTextMargin,e=>Z.newLoop(e));break;case o.db.LINETYPE.CRITICAL_OPTION:$(T,e,X.boxMargin+X.boxTextMargin,X.boxMargin,e=>Z.addSectionToLoop(e));break;case o.db.LINETYPE.CRITICAL_END:t=Z.endLoop(),await Y.drawLoop(f,t,`critical`,X),Z.bumpVerticalPos(t.stopy-Z.getVerticalPos()),Z.models.addLoop(t);break;case o.db.LINETYPE.BREAK_START:$(T,e,X.boxMargin,X.boxMargin+X.boxTextMargin,e=>Z.newLoop(e));break;case o.db.LINETYPE.BREAK_END:t=Z.endLoop(),await Y.drawLoop(f,t,`break`,X),Z.bumpVerticalPos(t.stopy-Z.getVerticalPos()),Z.models.addLoop(t);break;default:try{i=e.msgModel,i.starty=Z.getVerticalPos(),i.sequenceIndex=D,i.sequenceVisible=o.db.showSequenceNumbers();let t=await Fe(f,i);Ue(e,i,t,j,p,m,_),k.push({messageModel:i,lineStartY:t,msg:e}),Z.models.addMessage(i)}catch(e){n.error(`error while drawing message`,e)}}[o.db.LINETYPE.SOLID_OPEN,o.db.LINETYPE.DOTTED_OPEN,o.db.LINETYPE.SOLID,o.db.LINETYPE.SOLID_TOP,o.db.LINETYPE.SOLID_BOTTOM,o.db.LINETYPE.STICK_TOP,o.db.LINETYPE.STICK_BOTTOM,o.db.LINETYPE.SOLID_TOP_DOTTED,o.db.LINETYPE.SOLID_BOTTOM_DOTTED,o.db.LINETYPE.STICK_TOP_DOTTED,o.db.LINETYPE.STICK_BOTTOM_DOTTED,o.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,o.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,o.db.LINETYPE.STICK_ARROW_TOP_REVERSE,o.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,o.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,o.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,o.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,o.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,o.db.LINETYPE.DOTTED,o.db.LINETYPE.SOLID_CROSS,o.db.LINETYPE.DOTTED_CROSS,o.db.LINETYPE.SOLID_POINT,o.db.LINETYPE.DOTTED_POINT,o.db.LINETYPE.BIDIRECTIONAL_SOLID,o.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(e.type)&&(D+=O),j++}n.debug(`createdActors`,m),n.debug(`destroyedActors`,_),await Re(f,p,y,!1);for(let e of k)await Ie(f,e.messageModel,e.lineStartY,o,e.msg);X.mirrorActors&&await Re(f,p,y,!0),A.forEach(e=>Y.drawBackgroundRect(f,e)),ce(f,p,y,X);for(let e of Z.models.boxes){e.height=Z.getVerticalPos()-e.y,Z.insert(e.x,e.y,e.x+e.width,e.height);let t=X.boxMargin*2;e.startx=e.x-t,e.starty=e.y-t*.25,e.stopx=e.startx+e.width+2*t,e.stopy=e.starty+e.height+t*.75,e.stroke=`rgb(0,0,0, 0.5)`,Y.drawBox(f,e,X)}S&&Z.bumpVerticalPos(X.boxMargin);let M=ze(f,p,y,d),{bounds:N}=Z.getBounds();N.startx===void 0&&(N.startx=0),N.starty===void 0&&(N.starty=0),N.stopx===void 0&&(N.stopx=0),N.stopy===void 0&&(N.stopy=0);let P=N.stopy-N.starty;P<M.maxHeight&&(P=M.maxHeight);let F=P+2*X.diagramMarginY;X.mirrorActors&&(F=F-X.boxMargin+X.bottomMarginAdj);let I=N.stopx-N.startx;I<M.maxWidth&&(I=M.maxWidth);let ee=I+2*X.diagramMarginX;x&&f.append(`text`).text(x).attr(`x`,(N.stopx-N.startx)/2-2*X.diagramMarginX).attr(`y`,-25),g(f,F,ee,X.useMaxWidth);let te=x?40:0;f.attr(`viewBox`,N.startx-X.diagramMarginX+` -`+(X.diagramMarginY+te)+` `+ee+` `+(F+te)),n.debug(`models:`,Z.models)},`draw`);async function Ge(e,r,i){let a={};for(let n of r)if(e.get(n.to)&&e.get(n.from)){let r=e.get(n.to);if(n.placement===i.db.PLACEMENT.LEFTOF&&!r.prevActor||n.placement===i.db.PLACEMENT.RIGHTOF&&!r.nextActor)continue;let o=n.placement!==void 0,s=!o,c=o?Ne(X):Q(X),l=n.wrap?t.wrapLabel(n.message,X.width-2*X.wrapPadding,c):n.message,u=(v(l)?await _(n.message,h()):t.calculateTextDimensions(l,c)).width+2*X.wrapPadding;s&&n.from===r.nextActor?a[n.to]=b.getMax(a[n.to]||0,u):s&&n.from===r.prevActor?a[n.from]=b.getMax(a[n.from]||0,u):s&&n.from===n.to?(a[n.from]=b.getMax(a[n.from]||0,u/2),a[n.to]=b.getMax(a[n.to]||0,u/2)):n.placement===i.db.PLACEMENT.RIGHTOF?a[n.from]=b.getMax(a[n.from]||0,u):n.placement===i.db.PLACEMENT.LEFTOF?a[r.prevActor]=b.getMax(a[r.prevActor]||0,u):n.placement===i.db.PLACEMENT.OVER&&(r.prevActor&&(a[r.prevActor]=b.getMax(a[r.prevActor]||0,u/2)),r.nextActor&&(a[n.from]=b.getMax(a[n.from]||0,u/2)))}return n.debug(`maxMessageWidthPerActor:`,a),a}r(Ge,`getMaxMessageWidthPerActor`);var Ke=r(function(e){let n=0,r=Pe(X);for(let i in e.links){let e=t.calculateTextDimensions(i,r).width+2*X.wrapPadding+2*X.boxMargin;n<e&&(n=e)}return n},`getRequiredPopupWidth`);async function qe(e,n,r){let i=0;for(let n of e.keys()){let r=e.get(n);r.wrap&&(r.description=t.wrapLabel(r.description,X.width-2*X.wrapPadding,Pe(X)));let a=v(r.description)?await _(r.description,h()):t.calculateTextDimensions(r.description,Pe(X));r.width=r.wrap?X.width:b.getMax(X.width,a.width+2*X.wrapPadding),r.height=r.wrap?b.getMax(a.height,X.height):X.height,i=b.getMax(i,r.height)}for(let t in n){let r=e.get(t);if(!r)continue;let i=e.get(r.nextActor);if(!i){let e=n[t]+X.actorMargin-r.width/2;r.margin=b.getMax(e,X.actorMargin);continue}let a=n[t]+X.actorMargin-r.width/2-i.width/2;r.margin=b.getMax(a,X.actorMargin)}let a=0;return r.forEach(n=>{let r=Q(X),i=n.actorKeys.reduce((t,n)=>t+=e.get(n).width+(e.get(n).margin||0),0),o=X.boxMargin*8;i+=o,i-=2*X.boxTextMargin,n.wrap&&(n.name=t.wrapLabel(n.name,i-2*X.wrapPadding,r));let s=t.calculateTextDimensions(n.name,r);a=b.getMax(s.height,a);let c=b.getMax(i,s.width+2*X.wrapPadding);if(n.margin=X.boxTextMargin,i<c){let e=(c-i)/2;n.margin+=e}}),r.forEach(e=>e.textMaxHeight=a),b.getMax(i,X.height)}r(qe,`calculateActorMargins`);var Je=r(async function(e,r,i){let a=r.get(e.from),o=r.get(e.to),s=a.x,c=o.x,l=e.wrap&&e.message,u=v(e.message)?await _(e.message,h()):t.calculateTextDimensions(l?t.wrapLabel(e.message,X.width,Ne(X)):e.message,Ne(X)),d={width:l?X.width:b.getMax(X.width,u.width+2*X.noteMargin),height:0,startx:a.x,stopx:0,starty:0,stopy:0,message:e.message};return e.placement===i.db.PLACEMENT.RIGHTOF?(d.width=l?b.getMax(X.width,u.width):b.getMax(a.width/2+o.width/2,u.width+2*X.noteMargin),d.startx=s+(a.width+X.actorMargin)/2):e.placement===i.db.PLACEMENT.LEFTOF?(d.width=l?b.getMax(X.width,u.width+2*X.noteMargin):b.getMax(a.width/2+o.width/2,u.width+2*X.noteMargin),d.startx=s-d.width+(a.width-X.actorMargin)/2):e.to===e.from?(u=t.calculateTextDimensions(l?t.wrapLabel(e.message,b.getMax(X.width,a.width),Ne(X)):e.message,Ne(X)),d.width=l?b.getMax(X.width,a.width):b.getMax(a.width,X.width,u.width+2*X.noteMargin),d.startx=s+(a.width-d.width)/2):(d.width=Math.abs(s+a.width/2-(c+o.width/2))+X.actorMargin,d.startx=s<c?s+a.width/2-X.actorMargin/2:c+o.width/2-X.actorMargin/2),l&&(d.message=t.wrapLabel(e.message,d.width-2*X.wrapPadding,Ne(X))),n.debug(`NM:[${d.startx},${d.stopx},${d.starty},${d.stopy}:${d.width},${d.height}=${e.message}]`),d},`buildNoteModel`),Ye=4,Xe=6,Ze=r(function(e,t){let{CENTRAL_CONNECTION:n,CENTRAL_CONNECTION_REVERSE:r,CENTRAL_CONNECTION_DUAL:i}=t.db.LINETYPE;return[n,r,i].includes(e.centralConnection)},`hasCentralConnection`),Qe=r(function(e,t,n){let{CENTRAL_CONNECTION_REVERSE:r,CENTRAL_CONNECTION_DUAL:i,BIDIRECTIONAL_SOLID:a,BIDIRECTIONAL_DOTTED:o}=t.db.LINETYPE,s=0;return(e.centralConnection===r||e.centralConnection===i)&&(s+=Ye),(e.centralConnection===r||e.centralConnection===i)&&(e.type===a||e.type===o)&&(s+=n?0:-Xe),s},`calculateCentralConnectionOffset`),$e=r(function(e,t){let{SOLID_ARROW_TOP_REVERSE:n,SOLID_ARROW_TOP_REVERSE_DOTTED:r,SOLID_ARROW_BOTTOM_REVERSE:i,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:a,STICK_ARROW_TOP_REVERSE:o,STICK_ARROW_TOP_REVERSE_DOTTED:s,STICK_ARROW_BOTTOM_REVERSE:c,STICK_ARROW_BOTTOM_REVERSE_DOTTED:l}=t.db.LINETYPE;return[n,r,i,a,o,s,c,l].includes(e.type)},`isReverseArrowType`),et=r(function(e,t){let{BIDIRECTIONAL_SOLID:n,BIDIRECTIONAL_DOTTED:r}=t.db.LINETYPE;return[n,r].includes(e.type)},`isBidirectionalArrowType`),tt=r(function(e,n,i){if(![i.db.LINETYPE.SOLID_OPEN,i.db.LINETYPE.DOTTED_OPEN,i.db.LINETYPE.SOLID,i.db.LINETYPE.SOLID_TOP,i.db.LINETYPE.SOLID_BOTTOM,i.db.LINETYPE.STICK_TOP,i.db.LINETYPE.STICK_BOTTOM,i.db.LINETYPE.SOLID_TOP_DOTTED,i.db.LINETYPE.SOLID_BOTTOM_DOTTED,i.db.LINETYPE.STICK_TOP_DOTTED,i.db.LINETYPE.STICK_BOTTOM_DOTTED,i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,i.db.LINETYPE.STICK_ARROW_TOP_REVERSE,i.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,i.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,i.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,i.db.LINETYPE.DOTTED,i.db.LINETYPE.SOLID_CROSS,i.db.LINETYPE.DOTTED_CROSS,i.db.LINETYPE.SOLID_POINT,i.db.LINETYPE.DOTTED_POINT,i.db.LINETYPE.BIDIRECTIONAL_SOLID,i.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(e.type))return{};let[a,o]=He(e.from,n),[s,c]=He(e.to,n),l=a<=s,u=l?o:a,d=l?s:c;u+=Qe(e,i,l);let f=Math.abs(s-c)>2,p=r(e=>l?-e:e,`adjustValue`);e.from===e.to?d=u:(e.activate&&!f&&(d+=p(X.activationWidth/2-1)),[i.db.LINETYPE.SOLID_OPEN,i.db.LINETYPE.DOTTED_OPEN,i.db.LINETYPE.STICK_TOP,i.db.LINETYPE.STICK_BOTTOM,i.db.LINETYPE.STICK_TOP_DOTTED,i.db.LINETYPE.STICK_BOTTOM_DOTTED,i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,i.db.LINETYPE.STICK_ARROW_TOP_REVERSE,i.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,i.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,i.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(e.type)||(d+=p(3)),[i.db.LINETYPE.BIDIRECTIONAL_SOLID,i.db.LINETYPE.BIDIRECTIONAL_DOTTED,i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,i.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,i.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(e.type)&&(u-=p(3)));let m=[a,o,s,c],h=Math.abs(u-d);e.wrap&&e.message&&(e.message=t.wrapLabel(e.message,b.getMax(h+2*X.wrapPadding,X.width),Q(X)));let g=t.calculateTextDimensions(e.message,Q(X));return{width:b.getMax(e.wrap?0:g.width+2*X.wrapPadding,h+2*X.wrapPadding,X.width),height:0,startx:u,stopx:d,starty:0,stopy:0,message:e.message,type:e.type,wrap:e.wrap,fromBounds:Math.min.apply(null,m),toBounds:Math.max.apply(null,m)}},`buildMessageModel`),nt=r(async function(e,t,r,i){let a={},o=[],s,c,l;for(let n of e){switch(n.type){case i.db.LINETYPE.LOOP_START:case i.db.LINETYPE.ALT_START:case i.db.LINETYPE.OPT_START:case i.db.LINETYPE.PAR_START:case i.db.LINETYPE.PAR_OVER_START:case i.db.LINETYPE.CRITICAL_START:case i.db.LINETYPE.BREAK_START:o.push({id:n.id,msg:n.message,from:2**53-1,to:-(2**53-1),width:0});break;case i.db.LINETYPE.ALT_ELSE:case i.db.LINETYPE.PAR_AND:case i.db.LINETYPE.CRITICAL_OPTION:n.message&&(s=o.pop(),a[s.id]=s,a[n.id]=s,o.push(s));break;case i.db.LINETYPE.LOOP_END:case i.db.LINETYPE.ALT_END:case i.db.LINETYPE.OPT_END:case i.db.LINETYPE.PAR_END:case i.db.LINETYPE.CRITICAL_END:case i.db.LINETYPE.BREAK_END:s=o.pop(),a[s.id]=s;break;case i.db.LINETYPE.ACTIVE_START:{let e=t.get(n.from?n.from:n.to.actor),r=Ve(n.from?n.from:n.to.actor).length,i=e.x+e.width/2+(r-1)*X.activationWidth/2,a={startx:i,stopx:i+X.activationWidth,actor:n.from,enabled:!0};Z.activations.push(a)}break;case i.db.LINETYPE.ACTIVE_END:{let e=Z.activations.map(e=>e.actor).lastIndexOf(n.from);Z.activations.splice(e,1).splice(0,1)}break}n.placement===void 0?(l=tt(n,t,i),n.msgModel=l,l.startx&&l.stopx&&o.length>0&&o.forEach(e=>{if(s=e,l.startx===l.stopx){let e=t.get(n.from),r=t.get(n.to);s.from=b.getMin(e.x-l.width/2,e.x-e.width/2,s.from),s.to=b.getMax(r.x+l.width/2,r.x+e.width/2,s.to),s.width=b.getMax(s.width,Math.abs(s.to-s.from))-X.labelBoxWidth}else s.from=b.getMin(l.startx,s.from),s.to=b.getMax(l.stopx,s.to),s.width=b.getMax(s.width,l.width)-X.labelBoxWidth})):(c=await Je(n,t,i),n.noteModel=c,o.forEach(e=>{s=e,s.from=b.getMin(s.from,c.startx),s.to=b.getMax(s.to,c.startx+c.width),s.width=b.getMax(s.width,Math.abs(s.from-s.to))-X.labelBoxWidth}))}return Z.activations=[],n.debug(`Loop type widths:`,a),a},`calculateLoopBounds`),rt={parser:F,get db(){return new re},renderer:{bounds:Z,drawActors:Re,drawActorsPopup:ze,setConf:Be,draw:We},styles:ie,init:r(e=>{e.sequence||={},e.wrap&&(e.sequence.wrap=e.wrap,u({sequence:{wrap:e.wrap}}))},`init`)};export{rt as diagram};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/api-settings--eVrUeZM.js","assets/chunk-CFjPhJqf.js","assets/api-client-DpGMOZNf.js"])))=>i.map(i=>d[i]);
2
+ import{t as e}from"./react-BGf7KNLk.js";import{t}from"./preload-helper-qlgyTAkD.js";var n=`ppm-settings`;function r(){try{let e=localStorage.getItem(n);if(e)return JSON.parse(e)}catch{}return{}}function i(e){let t=r();localStorage.setItem(n,JSON.stringify({...t,...e}))}function a(e){let t=e===`system`?window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:e;document.documentElement.classList.toggle(`dark`,t===`dark`),document.documentElement.classList.toggle(`light`,t===`light`);let n=document.querySelector(`meta[name="theme-color"]`);n&&n.setAttribute(`content`,t===`dark`?`#0f1419`:`#ffffff`)}var o=r(),s=e((e,n)=>({theme:o.theme===`light`||o.theme===`dark`||o.theme===`system`?o.theme:`system`,sidebarCollapsed:o.sidebarCollapsed??!1,sidebarWidth:o.sidebarWidth??280,gitStatusViewMode:o.gitStatusViewMode===`flat`?`flat`:`tree`,wordWrap:o.wordWrap??!1,sidebarActiveTab:[`git`,`settings`,`database`,`search`].includes(o.sidebarActiveTab)?o.sidebarActiveTab:`explorer`,deviceName:null,version:null,setTheme:t=>{i({theme:t}),a(t),e({theme:t}),fetch(`/api/settings/theme`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({theme:t})}).catch(()=>{})},setDeviceName:async n=>{let r=n.trim();e({deviceName:r||null}),r?document.title=`PPM — ${r}`:document.title=`PPM`;try{let{updateDeviceName:e}=await t(async()=>{let{updateDeviceName:e}=await import(`./api-settings--eVrUeZM.js`).then(e=>e.n);return{updateDeviceName:e}},__vite__mapDeps([0,1,2]));await e(r)}catch{}},toggleSidebar:()=>{let t=!n().sidebarCollapsed;i({sidebarCollapsed:t}),e({sidebarCollapsed:t})},setSidebarWidth:t=>{let n=Math.max(200,Math.min(600,t));i({sidebarWidth:n}),e({sidebarWidth:n})},setGitStatusViewMode:t=>{i({gitStatusViewMode:t}),e({gitStatusViewMode:t})},toggleWordWrap:()=>{let t=!n().wordWrap;i({wordWrap:t}),e({wordWrap:t})},setSidebarActiveTab:t=>{i({sidebarActiveTab:t}),e({sidebarActiveTab:t})},fetchServerInfo:async()=>{try{let[t,n]=await Promise.all([fetch(`/api/info`),fetch(`/api/settings/theme`)]),r=await t.json();if(r.ok){let{device_name:t,version:n}=r.data;e({deviceName:t||null,version:n||null}),t&&(document.title=`PPM — ${t}`)}let o=await n.json();if(o.ok&&o.data?.theme){let t=o.data.theme;i({theme:t}),a(t),e({theme:t})}}catch{}}}));export{s as n,a as t};
@@ -0,0 +1 @@
1
+ import"./react-nm2Ru1Pt.js";import"./input-Brjz2Vv-.js";import"./jsx-runtime-BRW_vwa9.js";import"./settings-store-Bbhg_ptG.js";import"./api-client-DpGMOZNf.js";import"./api-settings--eVrUeZM.js";import{i as e}from"./index-yMR7OUDx.js";export{e as SettingsTab};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-CFjPhJqf.js";import{t}from"./react-nm2Ru1Pt.js";import{t as n}from"./jsx-runtime-BRW_vwa9.js";import{a as r,c as i,i as a,n as o,o as s,r as c,s as l}from"./dist-T0Vhi0Mh.js";import{t as u}from"./table-Yo02WRH-.js";import{i as d,t as f}from"./api-client-DpGMOZNf.js";import{J as p,N as m,Q as h,et as g,tt as _,z as v}from"./index-yMR7OUDx.js";var y=e(t(),1);function b(e,t,n){let[r,i]=(0,y.useState)([]),[a,o]=(0,y.useState)(null),[s,c]=(0,y.useState)(null),[l,u]=(0,y.useState)([]),[p,m]=(0,y.useState)(!1),[h,g]=(0,y.useState)(null),[_,v]=(0,y.useState)(1),[b,x]=(0,y.useState)(null),[S,C]=(0,y.useState)(null),[w,T]=(0,y.useState)(!1),E=n?`/api/db/connections/${n}`:null,D=E??`${d(e)}/sqlite`,O=E?``:`path=${encodeURIComponent(t)}`,k=(0,y.useCallback)(async()=>{m(!0),g(null);try{let e=E?`?cached=1`:O?`?${O}`:``,t=await f.get(`${D}/tables${e}`);i(t),!E&&t.length>0&&!a&&o(t[0].name)}catch(e){g(e.message)}finally{m(!1)}},[D,O,E]);(0,y.useEffect)(()=>{k()},[k]);let A=(0,y.useCallback)(async()=>{if(a){m(!0);try{let e=O?`${O}&`:``,[t,n]=await Promise.all([f.get(`${D}/data?${e}table=${encodeURIComponent(a)}&page=${_}&limit=100`),f.get(`${D}/schema?${e}table=${encodeURIComponent(a)}`)]);c(t),u(n)}catch(e){g(e.message)}finally{m(!1)}}},[D,O,a,_]);return(0,y.useEffect)(()=>{A()},[A]),{tables:r,selectedTable:a,selectTable:(0,y.useCallback)(e=>{o(e),v(1),x(null)},[]),tableData:s,schema:l,loading:p,error:h,page:_,setPage:v,queryResult:b,queryError:S,queryLoading:w,executeQuery:(0,y.useCallback)(async e=>{T(!0),C(null);try{let n=E?{sql:e}:{path:t,sql:e},r=await f.post(`${D}/query`,n);x(r),r.changeType===`modify`&&A()}catch(e){C(e.message)}finally{T(!1)}},[D,E,t,A]),updateCell:(0,y.useCallback)(async(e,n,r)=>{if(a)try{E?await f.put(`${D}/cell`,{table:a,pkColumn:`rowid`,pkValue:e,column:n,value:r}):await f.put(`${D}/cell`,{path:t,table:a,rowid:e,column:n,value:r}),A()}catch(e){g(e.message)}},[D,E,t,a,A]),refreshTables:k,refreshData:A}}var x=n();function S({tables:e,selectedTable:t,onSelect:n,onRefresh:r}){return(0,x.jsxs)(`div`,{className:`w-48 shrink-0 flex flex-col bg-background overflow-hidden`,children:[(0,x.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 border-b border-border`,children:[(0,x.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground uppercase tracking-wider`,children:`Tables`}),(0,x.jsx)(`button`,{type:`button`,onClick:r,className:`text-muted-foreground hover:text-foreground transition-colors`,title:`Refresh tables`,children:(0,x.jsx)(m,{className:`size-3`})})]}),(0,x.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[e.map(e=>(0,x.jsxs)(`button`,{type:`button`,onClick:()=>n(e.name),className:`w-full flex items-center gap-2 px-3 py-1.5 text-left text-xs transition-colors ${t===e.name?`bg-muted text-foreground`:`text-muted-foreground hover:bg-muted/50 hover:text-foreground`}`,children:[(0,x.jsx)(u,{className:`size-3 shrink-0`}),(0,x.jsx)(`span`,{className:`truncate flex-1`,children:e.name}),(0,x.jsx)(`span`,{className:`text-[10px] opacity-60`,children:e.rowCount})]},e.name)),e.length===0&&(0,x.jsx)(`p`,{className:`px-3 py-4 text-xs text-muted-foreground text-center`,children:`No tables found`})]})]})}function C({tableData:e,schema:t,loading:n,page:r,onPageChange:i,onCellUpdate:a}){if(!e)return(0,x.jsx)(`div`,{className:`flex items-center justify-center h-full text-xs text-muted-foreground`,children:n?(0,x.jsx)(v,{className:`size-4 animate-spin`}):`Select a table`});let o=Math.ceil(e.total/e.limit)||1;return(0,x.jsxs)(`div`,{className:`flex flex-col h-full overflow-hidden`,children:[(0,x.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,x.jsx)(w,{columns:e.columns,rows:e.rows,schema:t,onCellUpdate:a})}),(0,x.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-1.5 border-t border-border bg-background shrink-0 text-xs text-muted-foreground`,children:[(0,x.jsxs)(`span`,{children:[e.total.toLocaleString(),` rows`]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsx)(`button`,{type:`button`,disabled:r<=1,onClick:()=>i(r-1),className:`p-0.5 rounded hover:bg-muted disabled:opacity-30`,children:(0,x.jsx)(_,{className:`size-3.5`})}),(0,x.jsxs)(`span`,{children:[r,` / `,o]}),(0,x.jsx)(`button`,{type:`button`,disabled:r>=o,onClick:()=>i(r+1),className:`p-0.5 rounded hover:bg-muted disabled:opacity-30`,children:(0,x.jsx)(g,{className:`size-3.5`})})]})]})]})}function w({columns:e,rows:t,schema:n,onCellUpdate:i}){let[a,o]=(0,y.useState)(null),[c,u]=(0,y.useState)(``),d=(0,y.useMemo)(()=>new Set(n.filter(e=>e.pk).map(e=>e.name)),[n]),f=(0,y.useCallback)((e,t,n)=>{t!==`rowid`&&(o({rowIdx:e,col:t}),u(n==null?``:String(n)))},[]),p=(0,y.useCallback)(()=>{if(!a)return;let e=t[a.rowIdx];if(!e)return;let n=e.rowid,r=e[a.col];String(r??``)!==c&&i(n,a.col,c===``?null:c),o(null)},[a,c,t,i]),m=(0,y.useCallback)(()=>o(null),[]),h=s({data:t,columns:(0,y.useMemo)(()=>e.map(e=>({id:e,accessorFn:t=>t[e],header:()=>(0,x.jsx)(`span`,{className:`${d.has(e)?`font-bold`:``} ${e===`rowid`?`text-muted-foreground/50`:``}`,children:e}),cell:({row:t,getValue:n})=>{let r=t.index,i=a?.rowIdx===r&&a?.col===e,o=n();return i?(0,x.jsx)(`input`,{autoFocus:!0,className:`w-full bg-transparent border border-primary/50 rounded px-1 py-0 text-xs outline-none`,value:c,onChange:e=>u(e.target.value),onBlur:p,onKeyDown:e=>{e.key===`Enter`&&p(),e.key===`Escape`&&m()}}):(0,x.jsx)(`span`,{className:`cursor-pointer truncate block ${o==null?`text-muted-foreground/40 italic`:``} ${e===`rowid`?`text-muted-foreground/50`:``}`,onDoubleClick:()=>f(r,e,o),title:o==null?`NULL`:String(o),children:o==null?`NULL`:String(o)})}})),[e,d,a,c,p,m,f]),getCoreRowModel:l()});return(0,x.jsxs)(`table`,{className:`w-full text-xs border-collapse`,children:[(0,x.jsx)(`thead`,{className:`sticky top-0 z-10 bg-muted`,children:h.getHeaderGroups().map(e=>(0,x.jsx)(`tr`,{children:e.headers.map(e=>(0,x.jsx)(`th`,{className:`px-2 py-1.5 text-left font-medium text-muted-foreground border-b border-border whitespace-nowrap`,children:r(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,x.jsxs)(`tbody`,{children:[h.getRowModel().rows.map(e=>(0,x.jsx)(`tr`,{className:`hover:bg-muted/30 border-b border-border/50`,children:e.getVisibleCells().map(e=>(0,x.jsx)(`td`,{className:`px-2 py-1 max-w-[300px]`,children:r(e.column.columnDef.cell,e.getContext())},e.id))},e.id)),t.length===0&&(0,x.jsx)(`tr`,{children:(0,x.jsx)(`td`,{colSpan:e.length,className:`px-2 py-8 text-center text-muted-foreground`,children:`No data`})})]})]})}function T({onExecute:e,result:t,error:n,loading:r}){let[s,l]=(0,y.useState)(`SELECT * FROM `),u=(0,y.useCallback)(()=>{let t=s.trim();t&&e(t)},[s,e]);return(0,x.jsxs)(`div`,{className:`flex flex-col h-full overflow-hidden`,children:[(0,x.jsxs)(`div`,{className:`flex items-start gap-1 border-b border-border bg-background`,onKeyDown:(0,y.useCallback)(e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),u())},[u]),children:[(0,x.jsx)(`div`,{className:`flex-1 max-h-[120px] overflow-auto`,children:(0,x.jsx)(a,{value:s,onChange:l,extensions:[c({dialect:o})],basicSetup:{lineNumbers:!1,foldGutter:!1,highlightActiveLine:!1},className:`text-xs [&_.cm-editor]:!outline-none [&_.cm-scroller]:!overflow-auto`})}),(0,x.jsx)(`button`,{type:`button`,onClick:u,disabled:r,className:`shrink-0 m-1 p-1.5 rounded bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50 transition-colors`,title:`Execute (Cmd+Enter)`,children:r?(0,x.jsx)(v,{className:`size-3.5 animate-spin`}):(0,x.jsx)(i,{className:`size-3.5`})})]}),(0,x.jsxs)(`div`,{className:`flex-1 overflow-auto text-xs`,children:[n&&(0,x.jsx)(`div`,{className:`px-3 py-2 text-destructive bg-destructive/5`,children:n}),t&&t.changeType===`modify`&&(0,x.jsxs)(`div`,{className:`px-3 py-2 text-green-500`,children:[`Query executed. `,t.rowsAffected,` row(s) affected.`]}),t&&t.changeType===`select`&&t.rows.length>0&&(0,x.jsxs)(`table`,{className:`w-full border-collapse`,children:[(0,x.jsx)(`thead`,{className:`sticky top-0 bg-muted`,children:(0,x.jsx)(`tr`,{children:t.columns.map(e=>(0,x.jsx)(`th`,{className:`px-2 py-1 text-left font-medium text-muted-foreground border-b border-border whitespace-nowrap`,children:e},e))})}),(0,x.jsx)(`tbody`,{children:t.rows.map((e,n)=>(0,x.jsx)(`tr`,{className:`hover:bg-muted/30 border-b border-border/50`,children:t.columns.map(t=>(0,x.jsx)(`td`,{className:`px-2 py-1 max-w-[300px] truncate`,title:e[t]==null?`NULL`:String(e[t]),children:e[t]==null?(0,x.jsx)(`span`,{className:`text-muted-foreground/40 italic`,children:`NULL`}):String(e[t])},t))},n))})]}),t&&t.changeType===`select`&&t.rows.length===0&&(0,x.jsx)(`div`,{className:`px-3 py-2 text-muted-foreground`,children:`No results`})]})]})}function E({metadata:e}){let t=e?.filePath,n=e?.projectName,r=e?.connectionId,i=e?.tableName,[a,o]=(0,y.useState)(!1);return r?(0,x.jsx)(D,{projectName:``,dbPath:``,connectionId:r,connectionName:e?.connectionName,initialTable:i,queryPanelOpen:a,onToggleQueryPanel:()=>o(e=>!e),hideTableList:!0}):!t||!n?(0,x.jsxs)(`div`,{className:`flex items-center justify-center h-full text-text-secondary text-sm`,children:[(0,x.jsx)(p,{className:`size-5 mr-2`}),` No database file selected.`]}):(0,x.jsx)(D,{projectName:n,dbPath:t,queryPanelOpen:a,onToggleQueryPanel:()=>o(e=>!e)})}function D({projectName:e,dbPath:t,connectionId:n,connectionName:r,initialTable:i,queryPanelOpen:a,onToggleQueryPanel:o,hideTableList:s}){let c=b(e,t,n),l=(0,y.useRef)(!1);return(0,y.useEffect)(()=>{i&&!l.current&&c.tables.length>0&&(l.current=!0,c.selectTable(i))},[i,c.tables]),c.error&&c.tables.length===0?(0,x.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-3 text-text-secondary`,children:[(0,x.jsx)(h,{className:`size-10 text-destructive`}),(0,x.jsx)(`p`,{className:`text-sm`,children:c.error})]}):c.loading&&c.tables.length===0?(0,x.jsxs)(`div`,{className:`flex items-center justify-center h-full gap-2 text-text-secondary`,children:[(0,x.jsx)(v,{className:`size-5 animate-spin`}),(0,x.jsx)(`span`,{className:`text-sm`,children:`Loading database...`})]}):(0,x.jsxs)(`div`,{className:`flex h-full w-full overflow-hidden`,children:[!s&&(0,x.jsx)(S,{tables:c.tables,selectedTable:c.selectedTable,onSelect:c.selectTable,onRefresh:c.refreshTables}),(0,x.jsxs)(`div`,{className:`flex-1 flex flex-col overflow-hidden ${s?``:`border-l border-border`}`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5 border-b border-border bg-background shrink-0`,children:[(0,x.jsx)(p,{className:`size-3.5 text-muted-foreground`}),(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground truncate`,children:r??t}),(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:c.selectedTable&&`/ ${c.selectedTable}`}),(0,x.jsx)(`div`,{className:`ml-auto`,children:(0,x.jsx)(`button`,{type:`button`,onClick:o,className:`px-2 py-1 rounded text-xs transition-colors ${a?`bg-muted text-foreground`:`text-muted-foreground hover:text-foreground`}`,children:`SQL`})})]}),(0,x.jsx)(`div`,{className:`flex-1 overflow-hidden ${a?`max-h-[60%]`:``}`,children:(0,x.jsx)(C,{tableData:c.tableData,schema:c.schema,loading:c.loading,page:c.page,onPageChange:c.setPage,onCellUpdate:c.updateCell})}),a&&(0,x.jsx)(`div`,{className:`border-t border-border h-[40%] shrink-0`,children:(0,x.jsx)(T,{onExecute:c.executeQuery,result:c.queryResult,error:c.queryError,loading:c.queryLoading})})]})]})}export{E as SqliteViewer};
@@ -0,0 +1 @@
1
+ import{o as e,t}from"./chunk-CFjPhJqf.js";var n=t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),D=E.prototype;return w.prototype=D,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){D[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,E,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))})),r=e(n(),1),i=Object.defineProperty,a=(e,t)=>i(e,`name`,{value:t,configurable:!0}),o=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})},s={trace:0,debug:1,info:2,warn:3,error:4,fatal:5},c={trace:a((...e)=>{},`trace`),debug:a((...e)=>{},`debug`),info:a((...e)=>{},`info`),warn:a((...e)=>{},`warn`),error:a((...e)=>{},`error`),fatal:a((...e)=>{},`fatal`)},l=a(function(e=`fatal`){let t=s.fatal;typeof e==`string`?e.toLowerCase()in s&&(t=s[e]):typeof e==`number`&&(t=e),c.trace=()=>{},c.debug=()=>{},c.info=()=>{},c.warn=()=>{},c.error=()=>{},c.fatal=()=>{},t<=s.fatal&&(c.fatal=console.error?console.error.bind(console,u(`FATAL`),`color: orange`):console.log.bind(console,`\x1B[35m`,u(`FATAL`))),t<=s.error&&(c.error=console.error?console.error.bind(console,u(`ERROR`),`color: orange`):console.log.bind(console,`\x1B[31m`,u(`ERROR`))),t<=s.warn&&(c.warn=console.warn?console.warn.bind(console,u(`WARN`),`color: orange`):console.log.bind(console,`\x1B[33m`,u(`WARN`))),t<=s.info&&(c.info=console.info?console.info.bind(console,u(`INFO`),`color: lightblue`):console.log.bind(console,`\x1B[34m`,u(`INFO`))),t<=s.debug&&(c.debug=console.debug?console.debug.bind(console,u(`DEBUG`),`color: lightgreen`):console.log.bind(console,`\x1B[32m`,u(`DEBUG`))),t<=s.trace&&(c.trace=console.debug?console.debug.bind(console,u(`TRACE`),`color: lightgreen`):console.log.bind(console,`\x1B[32m`,u(`TRACE`)))},`setLogLevel`),u=a(e=>`%c${(0,r.default)().format(`ss.SSS`)} : ${e} : `,`format`),d={value:()=>{}};function f(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new p(n)}function p(e){this._=e}function m(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}p.prototype=f.prototype={constructor:p,on:function(e,t){var n=this._,r=m(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=h(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=g(n[i],e.name,t);else if(t==null)for(i in n)n[i]=g(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new p(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function h(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function g(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=d,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var _={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function v(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),_.hasOwnProperty(t)?{space:_[t],local:e}:e}function y(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function b(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function x(e){var t=v(e);return(t.local?b:y)(t)}function S(){}function C(e){return e==null?S:function(){return this.querySelector(e)}}function w(e){typeof e!=`function`&&(e=C(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new A(r,this._parents)}function T(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function E(){return[]}function D(e){return e==null?E:function(){return this.querySelectorAll(e)}}function ee(e){return function(){return T(e.apply(this,arguments))}}function te(e){e=typeof e==`function`?ee(e):D(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new A(r,i)}function ne(e){return function(){return this.matches(e)}}function re(e){return function(t){return t.matches(e)}}var ie=Array.prototype.find;function ae(e){return function(){return ie.call(this.children,e)}}function oe(){return this.firstElementChild}function se(e){return this.select(e==null?oe:ae(typeof e==`function`?e:re(e)))}var ce=Array.prototype.filter;function le(){return Array.from(this.children)}function ue(e){return function(){return ce.call(this.children,e)}}function de(e){return this.selectAll(e==null?le:ue(typeof e==`function`?e:re(e)))}function fe(e){typeof e!=`function`&&(e=ne(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new A(r,this._parents)}function pe(e){return Array(e.length)}function me(){return new A(this._enter||this._groups.map(pe),this._parents)}function O(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}O.prototype={constructor:O,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function he(e){return function(){return e}}function ge(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new O(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function _e(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new O(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function ve(e){return e.__data__}function ye(e,t){if(!arguments.length)return Array.from(this,ve);var n=t?_e:ge,r=this._parents,i=this._groups;typeof e!=`function`&&(e=he(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=be(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new A(o,r),o._enter=s,o._exit=c,o}function be(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function xe(){return new A(this._exit||this._groups.map(pe),this._parents)}function Se(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function Ce(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new A(s,this._parents)}function we(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function Te(e){e||=Ee;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new A(i,this._parents).order()}function Ee(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function De(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Oe(){return Array.from(this)}function ke(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function Ae(){let e=0;for(let t of this)++e;return e}function je(){return!this.node()}function Me(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function Ne(e){return function(){this.removeAttribute(e)}}function Pe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Fe(e,t){return function(){this.setAttribute(e,t)}}function Ie(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Le(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Re(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function ze(e,t){var n=v(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Pe:Ne:typeof t==`function`?n.local?Re:Le:n.local?Ie:Fe)(n,t))}function Be(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Ve(e){return function(){this.style.removeProperty(e)}}function He(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Ue(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function We(e,t,n){return arguments.length>1?this.each((t==null?Ve:typeof t==`function`?Ue:He)(e,t,n??``)):k(this.node(),e)}function k(e,t){return e.style.getPropertyValue(t)||Be(e).getComputedStyle(e,null).getPropertyValue(t)}function Ge(e){return function(){delete this[e]}}function Ke(e,t){return function(){this[e]=t}}function qe(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Je(e,t){return arguments.length>1?this.each((t==null?Ge:typeof t==`function`?qe:Ke)(e,t)):this.node()[e]}function Ye(e){return e.trim().split(/^|\s+/)}function Xe(e){return e.classList||new Ze(e)}function Ze(e){this._node=e,this._names=Ye(e.getAttribute(`class`)||``)}Ze.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function Qe(e,t){for(var n=Xe(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function $e(e,t){for(var n=Xe(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function et(e){return function(){Qe(this,e)}}function tt(e){return function(){$e(this,e)}}function nt(e,t){return function(){(t.apply(this,arguments)?Qe:$e)(this,e)}}function rt(e,t){var n=Ye(e+``);if(arguments.length<2){for(var r=Xe(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?nt:t?et:tt)(n,t))}function it(){this.textContent=``}function at(e){return function(){this.textContent=e}}function ot(e){return function(){this.textContent=e.apply(this,arguments)??``}}function st(e){return arguments.length?this.each(e==null?it:(typeof e==`function`?ot:at)(e)):this.node().textContent}function ct(){this.innerHTML=``}function lt(e){return function(){this.innerHTML=e}}function ut(e){return function(){this.innerHTML=e.apply(this,arguments)??``}}function dt(e){return arguments.length?this.each(e==null?ct:(typeof e==`function`?ut:lt)(e)):this.node().innerHTML}function ft(){this.nextSibling&&this.parentNode.appendChild(this)}function pt(){return this.each(ft)}function mt(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ht(){return this.each(mt)}function gt(e){var t=typeof e==`function`?e:x(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function _t(){return null}function vt(e,t){var n=typeof e==`function`?e:x(e),r=t==null?_t:typeof t==`function`?t:C(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function yt(){var e=this.parentNode;e&&e.removeChild(this)}function bt(){return this.each(yt)}function xt(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function St(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ct(e){return this.select(e?St:xt)}function wt(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function Tt(e){return function(t){e.call(this,t,this.__data__)}}function Et(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function Dt(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function Ot(e,t,n){return function(){var r=this.__on,i,a=Tt(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function kt(e,t,n){var r=Et(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?Ot:Dt,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function At(e,t,n){var r=Be(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function jt(e,t){return function(){return At(this,e,t)}}function Mt(e,t){return function(){return At(this,e,t.apply(this,arguments))}}function Nt(e,t){return this.each((typeof t==`function`?Mt:jt)(e,t))}function*Pt(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var Ft=[null];function A(e,t){this._groups=e,this._parents=t}function j(){return new A([[document.documentElement]],Ft)}function It(){return this}A.prototype=j.prototype={constructor:A,select:w,selectAll:te,selectChild:se,selectChildren:de,filter:fe,data:ye,enter:me,exit:xe,join:Se,merge:Ce,selection:It,order:we,sort:Te,call:De,nodes:Oe,node:ke,size:Ae,empty:je,each:Me,attr:ze,style:We,property:Je,classed:rt,text:st,html:dt,raise:pt,lower:ht,append:gt,insert:vt,remove:bt,clone:Ct,datum:wt,on:kt,dispatch:Nt,[Symbol.iterator]:Pt};function Lt(e){return typeof e==`string`?new A([[document.querySelector(e)]],[document.documentElement]):new A([[e]],Ft)}function Rt(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function zt(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function M(){}var N=.7,Bt=1/N,P=`\\s*([+-]?\\d+)\\s*`,F=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,I=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,Vt=/^#([0-9a-f]{3,8})$/,Ht=RegExp(`^rgb\\(${P},${P},${P}\\)$`),Ut=RegExp(`^rgb\\(${I},${I},${I}\\)$`),Wt=RegExp(`^rgba\\(${P},${P},${P},${F}\\)$`),Gt=RegExp(`^rgba\\(${I},${I},${I},${F}\\)$`),Kt=RegExp(`^hsl\\(${F},${I},${I}\\)$`),qt=RegExp(`^hsla\\(${F},${I},${I},${F}\\)$`),Jt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Rt(M,L,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Yt,formatHex:Yt,formatHex8:Xt,formatHsl:Zt,formatRgb:Qt,toString:Qt});function Yt(){return this.rgb().formatHex()}function Xt(){return this.rgb().formatHex8()}function Zt(){return sn(this).formatHsl()}function Qt(){return this.rgb().formatRgb()}function L(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=Vt.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?$t(t):n===3?new z(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?R(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?R(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Ht.exec(e))?new z(t[1],t[2],t[3],1):(t=Ut.exec(e))?new z(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Wt.exec(e))?R(t[1],t[2],t[3],t[4]):(t=Gt.exec(e))?R(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Kt.exec(e))?on(t[1],t[2]/100,t[3]/100,1):(t=qt.exec(e))?on(t[1],t[2]/100,t[3]/100,t[4]):Jt.hasOwnProperty(e)?$t(Jt[e]):e===`transparent`?new z(NaN,NaN,NaN,0):null}function $t(e){return new z(e>>16&255,e>>8&255,e&255,1)}function R(e,t,n,r){return r<=0&&(e=t=n=NaN),new z(e,t,n,r)}function en(e){return e instanceof M||(e=L(e)),e?(e=e.rgb(),new z(e.r,e.g,e.b,e.opacity)):new z}function tn(e,t,n,r){return arguments.length===1?en(e):new z(e,t,n,r??1)}function z(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Rt(z,tn,zt(M,{brighter(e){return e=e==null?Bt:Bt**+e,new z(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?N:N**+e,new z(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new z(V(this.r),V(this.g),V(this.b),B(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:nn,formatHex:nn,formatHex8:rn,formatRgb:an,toString:an}));function nn(){return`#${H(this.r)}${H(this.g)}${H(this.b)}`}function rn(){return`#${H(this.r)}${H(this.g)}${H(this.b)}${H((isNaN(this.opacity)?1:this.opacity)*255)}`}function an(){let e=B(this.opacity);return`${e===1?`rgb(`:`rgba(`}${V(this.r)}, ${V(this.g)}, ${V(this.b)}${e===1?`)`:`, ${e})`}`}function B(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function V(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function H(e){return e=V(e),(e<16?`0`:``)+e.toString(16)}function on(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new U(e,t,n,r)}function sn(e){if(e instanceof U)return new U(e.h,e.s,e.l,e.opacity);if(e instanceof M||(e=L(e)),!e)return new U;if(e instanceof U)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new U(o,s,c,e.opacity)}function cn(e,t,n,r){return arguments.length===1?sn(e):new U(e,t,n,r??1)}function U(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Rt(U,cn,zt(M,{brighter(e){return e=e==null?Bt:Bt**+e,new U(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?N:N**+e,new U(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new z(dn(e>=240?e-240:e+120,i,r),dn(e,i,r),dn(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new U(ln(this.h),un(this.s),un(this.l),B(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=B(this.opacity);return`${e===1?`hsl(`:`hsla(`}${ln(this.h)}, ${un(this.s)*100}%, ${un(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function ln(e){return e=(e||0)%360,e<0?e+360:e}function un(e){return Math.max(0,Math.min(1,e||0))}function dn(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var fn=e=>()=>e;function pn(e,t){return function(n){return e+n*t}}function mn(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function hn(e,t){var n=t-e;return n?pn(e,n>180||n<-180?n-360*Math.round(n/360):n):fn(isNaN(e)?t:e)}function gn(e){return(e=+e)==1?_n:function(t,n){return n-t?mn(t,n,e):fn(isNaN(t)?n:t)}}function _n(e,t){var n=t-e;return n?pn(e,n):fn(isNaN(e)?t:e)}var vn=(function e(t){var n=gn(t);function r(e,t){var r=n((e=tn(e)).r,(t=tn(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=_n(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function W(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var yn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,bn=new RegExp(yn.source,`g`);function xn(e){return function(){return e}}function Sn(e){return function(t){return e(t)+``}}function Cn(e,t){var n=yn.lastIndex=bn.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=yn.exec(e))&&(i=bn.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:W(r,i)})),n=bn.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?Sn(c[0].x):xn(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}var wn=180/Math.PI,Tn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function En(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*wn,skewX:Math.atan(c)*wn,scaleX:o,scaleY:s}}var Dn;function On(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?Tn:En(t.a,t.b,t.c,t.d,t.e,t.f)}function kn(e){return e==null||(Dn||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),Dn.setAttribute(`transform`,e),!(e=Dn.transform.baseVal.consolidate()))?Tn:(e=e.matrix,En(e.a,e.b,e.c,e.d,e.e,e.f))}function An(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:W(e,i)},{i:c-2,x:W(r,a)})}else (i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:W(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:W(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:W(e,n)},{i:s-2,x:W(t,r)})}else (n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var jn=An(On,`px, `,`px)`,`deg)`),Mn=An(kn,`, `,`)`,`)`),G=0,Nn=0,Pn=0,Fn=1e3,In,K,Ln=0,q=0,Rn=0,J=typeof performance==`object`&&performance.now?performance:Date,zn=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Bn(){return q||=(zn(Vn),J.now()+Rn)}function Vn(){q=0}function Hn(){this._call=this._time=this._next=null}Hn.prototype=Un.prototype={constructor:Hn,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?Bn():+n)+(t==null?0:+t),!this._next&&K!==this&&(K?K._next=this:In=this,K=this),this._call=e,this._time=n,Jn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Jn())}};function Un(e,t,n){var r=new Hn;return r.restart(e,t,n),r}function Wn(){Bn(),++G;for(var e=In,t;e;)(t=q-e._time)>=0&&e._call.call(void 0,t),e=e._next;--G}function Gn(){q=(Ln=J.now())+Rn,G=Nn=0;try{Wn()}finally{G=0,qn(),q=0}}function Kn(){var e=J.now(),t=e-Ln;t>Fn&&(Rn-=t,Ln=e)}function qn(){for(var e,t=In,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:In=n);K=e,Jn(r)}function Jn(e){G||(Nn&&=clearTimeout(Nn),e-q>24?(e<1/0&&(Nn=setTimeout(Gn,e-J.now()-Rn)),Pn&&=clearInterval(Pn)):(Pn||=(Ln=J.now(),setInterval(Kn,Fn)),G=1,zn(Gn)))}function Yn(e,t,n){var r=new Hn;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var Xn=f(`start`,`end`,`cancel`,`interrupt`),Zn=[];function Qn(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;er(e,n,{name:t,index:r,group:i,on:Xn,tween:Zn,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function $n(e,t){var n=X(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function Y(e,t){var n=X(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function X(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function er(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Un(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return Yn(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(Yn(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function tr(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function nr(e){return this.each(function(){tr(this,e)})}function rr(e,t){var n,r;return function(){var i=Y(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function ir(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=Y(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function ar(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=X(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?rr:ir)(n,e,t))}function or(e,t,n){var r=e._id;return e.each(function(){var e=Y(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return X(e,r).value[t]}}function sr(e,t){var n;return(typeof t==`number`?W:t instanceof L?vn:(n=L(t))?(t=n,vn):Cn)(e,t)}function cr(e){return function(){this.removeAttribute(e)}}function lr(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ur(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function dr(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function fr(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function pr(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function mr(e,t){var n=v(e),r=n===`transform`?Mn:sr;return this.attrTween(e,typeof t==`function`?(n.local?pr:fr)(n,r,or(this,`attr.`+e,t)):t==null?(n.local?lr:cr)(n):(n.local?dr:ur)(n,r,t))}function hr(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function gr(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function _r(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&gr(e,i)),n}return i._value=t,i}function vr(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&hr(e,i)),n}return i._value=t,i}function yr(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=v(e);return this.tween(n,(r.local?_r:vr)(r,t))}function br(e,t){return function(){$n(this,e).delay=+t.apply(this,arguments)}}function xr(e,t){return t=+t,function(){$n(this,e).delay=t}}function Sr(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?br:xr)(t,e)):X(this.node(),t).delay}function Cr(e,t){return function(){Y(this,e).duration=+t.apply(this,arguments)}}function wr(e,t){return t=+t,function(){Y(this,e).duration=t}}function Tr(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Cr:wr)(t,e)):X(this.node(),t).duration}function Er(e,t){if(typeof t!=`function`)throw Error();return function(){Y(this,e).ease=t}}function Dr(e){var t=this._id;return arguments.length?this.each(Er(t,e)):X(this.node(),t).ease}function Or(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();Y(this,e).ease=n}}function kr(e){if(typeof e!=`function`)throw Error();return this.each(Or(this._id,e))}function Ar(e){typeof e!=`function`&&(e=ne(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Z(r,this._parents,this._name,this._id)}function jr(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new Z(o,this._parents,this._name,this._id)}function Mr(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function Nr(e,t,n){var r,i,a=Mr(t)?$n:Y;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function Pr(e,t){var n=this._id;return arguments.length<2?X(this.node(),n).on.on(e):this.each(Nr(n,e,t))}function Fr(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Ir(){return this.on(`end.remove`,Fr(this._id))}function Lr(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=C(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,Qn(l[f],t,n,f,l,X(u,n)));return new Z(a,this._parents,t,n)}function Rr(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=D(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=X(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&Qn(p,t,n,h,f,m);a.push(f),o.push(u)}return new Z(a,o,t,n)}var zr=j.prototype.constructor;function Br(){return new zr(this._groups,this._parents)}function Vr(e,t){var n,r,i;return function(){var a=k(this,e),o=(this.style.removeProperty(e),k(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function Hr(e){return function(){this.style.removeProperty(e)}}function Ur(e,t,n){var r,i=n+``,a;return function(){var o=k(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function Wr(e,t,n){var r,i,a;return function(){var o=k(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),k(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function Gr(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=Y(this,e),l=c.on,u=c.value[a]==null?s||=Hr(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function Kr(e,t,n){var r=(e+=``)==`transform`?jn:sr;return t==null?this.styleTween(e,Vr(e,r)).on(`end.style.`+e,Hr(e)):typeof t==`function`?this.styleTween(e,Wr(e,r,or(this,`style.`+e,t))).each(Gr(this._id,e)):this.styleTween(e,Ur(e,r,t),n).on(`end.style.`+e,null)}function qr(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Jr(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&qr(e,a,n)),r}return a._value=t,a}function Yr(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,Jr(e,t,n??``))}function Xr(e){return function(){this.textContent=e}}function Zr(e){return function(){this.textContent=e(this)??``}}function Qr(e){return this.tween(`text`,typeof e==`function`?Zr(or(this,`text`,e)):Xr(e==null?``:e+``))}function $r(e){return function(t){this.textContent=e.call(this,t)}}function ei(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&$r(r)),t}return r._value=e,r}function ti(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,ei(e))}function ni(){for(var e=this._name,t=this._id,n=oi(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=X(c,t);Qn(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Z(r,this._parents,e,n)}function ri(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=Y(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var ii=0;function Z(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function ai(e){return j().transition(e)}function oi(){return++ii}var Q=j.prototype;Z.prototype=ai.prototype={constructor:Z,select:Lr,selectAll:Rr,selectChild:Q.selectChild,selectChildren:Q.selectChildren,filter:Ar,merge:jr,selection:Br,transition:ni,call:Q.call,nodes:Q.nodes,node:Q.node,size:Q.size,empty:Q.empty,each:Q.each,on:Pr,attr:mr,attrTween:yr,style:Kr,styleTween:Yr,text:Qr,textTween:ti,remove:Ir,tween:ar,delay:Sr,duration:Tr,ease:Dr,easeVarying:kr,end:ri,[Symbol.iterator]:Q[Symbol.iterator]};function si(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var ci={time:null,delay:0,duration:250,ease:si};function li(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function ui(e){var t,n;e instanceof Z?(t=e._id,e=e._name):(t=oi(),(n=ci).time=Bn(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&Qn(c,e,t,l,o,n||li(c,t));return new Z(r,this._parents,e,t)}j.prototype.interrupt=nr,j.prototype.transition=ui;var{abs:di,max:fi,min:pi}=Math;[`w`,`e`].map(mi),[`n`,`s`].map(mi),[`n`,`w`,`e`,`s`,`nw`,`ne`,`sw`,`se`].map(mi);function mi(e){return{type:e}}function $(e,t,n){this.k=e,this.x=t,this.y=n}$.prototype={constructor:$,scale:function(e){return e===1?this:new $(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new $(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var hi=new $(1,0,0);gi.prototype=$.prototype;function gi(e){for(;!e.__zoom;)if(!(e=e.parentNode))return hi;return e.__zoom}export{l as _,_n as a,z as c,Rt as d,zt as f,c as g,a as h,hn as i,L as l,o as m,W as n,fn as o,Lt as p,vn as r,M as s,Cn as t,en as u,n as v};
@@ -0,0 +1 @@
1
+ import{t as e}from"./dagre-CNtSxiE_.js";import{T as t,h as n}from"./chunk-GEFDOKGD-DwVPiYfW.js";import{t as r}from"./graphlib-DhOZxqsh.js";import{g as i,h as a,p as o}from"./src-BoSBNdA_.js";import{D as s,b as c,c as l,s as u}from"./chunk-7R4GIKGN-DXaGAn_K.js";import{t as d}from"./line-DBLLF7lH.js";import"./dist-Cce3efmT.js";import"./chunk-PU5JKC2W-B66ELkQm.js";import"./chunk-MX3YWQON-BgjSEzus.js";import"./chunk-YBOYWFTD-Dx_fX35n.js";import"./chunk-55IACEB6-C4mUdyio.js";import"./chunk-KX2RTZJC-BCxGmbzy.js";import"./chunk-PQ6SQG4A-BxtUGYhW.js";import"./chunk-KYZI473N-BKO5gMeU.js";import"./chunk-O4XLMI2P-BurQy8tt.js";import"./chunk-GLR3WWYH-D9pZakqr.js";import{i as f,n as p,t as m}from"./chunk-NQ4KR5QH-DLrZwBEm.js";var h=a(e=>e.append(`circle`).attr(`class`,`start-state`).attr(`r`,c().state.sizeUnit).attr(`cx`,c().state.padding+c().state.sizeUnit).attr(`cy`,c().state.padding+c().state.sizeUnit),`drawStartState`),g=a(e=>e.append(`line`).style(`stroke`,`grey`).style(`stroke-dasharray`,`3`).attr(`x1`,c().state.textHeight).attr(`class`,`divider`).attr(`x2`,c().state.textHeight*2).attr(`y1`,0).attr(`y2`,0),`drawDivider`),_=a((e,t)=>{let n=e.append(`text`).attr(`x`,2*c().state.padding).attr(`y`,c().state.textHeight+2*c().state.padding).attr(`font-size`,c().state.fontSize).attr(`class`,`state-title`).text(t.id),r=n.node().getBBox();return e.insert(`rect`,`:first-child`).attr(`x`,c().state.padding).attr(`y`,c().state.padding).attr(`width`,r.width+2*c().state.padding).attr(`height`,r.height+2*c().state.padding).attr(`rx`,c().state.radius),n},`drawSimpleState`),v=a((e,t)=>{let n=a(function(e,t,n){let r=e.append(`tspan`).attr(`x`,2*c().state.padding).text(t);n||r.attr(`dy`,c().state.textHeight)},`addTspan`),r=e.append(`text`).attr(`x`,2*c().state.padding).attr(`y`,c().state.textHeight+1.3*c().state.padding).attr(`font-size`,c().state.fontSize).attr(`class`,`state-title`).text(t.descriptions[0]).node().getBBox(),i=r.height,o=e.append(`text`).attr(`x`,c().state.padding).attr(`y`,i+c().state.padding*.4+c().state.dividerMargin+c().state.textHeight).attr(`class`,`state-description`),s=!0,l=!0;t.descriptions.forEach(function(e){s||(n(o,e,l),l=!1),s=!1});let u=e.append(`line`).attr(`x1`,c().state.padding).attr(`y1`,c().state.padding+i+c().state.dividerMargin/2).attr(`y2`,c().state.padding+i+c().state.dividerMargin/2).attr(`class`,`descr-divider`),d=o.node().getBBox(),f=Math.max(d.width,r.width);return u.attr(`x2`,f+3*c().state.padding),e.insert(`rect`,`:first-child`).attr(`x`,c().state.padding).attr(`y`,c().state.padding).attr(`width`,f+2*c().state.padding).attr(`height`,d.height+i+2*c().state.padding).attr(`rx`,c().state.radius),e},`drawDescrState`),y=a((e,t,n)=>{let r=c().state.padding,i=2*c().state.padding,a=e.node().getBBox(),o=a.width,s=a.x,l=e.append(`text`).attr(`x`,0).attr(`y`,c().state.titleShift).attr(`font-size`,c().state.fontSize).attr(`class`,`state-title`).text(t.id),u=l.node().getBBox().width+i,d=Math.max(u,o);d===o&&(d+=i);let f,p=e.node().getBBox();t.doc,f=s-r,u>o&&(f=(o-d)/2+r),Math.abs(s-p.x)<r&&u>o&&(f=s-(u-o)/2);let m=1-c().state.textHeight;return e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,m).attr(`class`,n?`alt-composit`:`composit`).attr(`width`,d).attr(`height`,p.height+c().state.textHeight+c().state.titleShift+1).attr(`rx`,`0`),l.attr(`x`,f+r),u<=o&&l.attr(`x`,s+(d-i)/2-u/2+r),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,c().state.titleShift-c().state.textHeight-c().state.padding).attr(`width`,d).attr(`height`,c().state.textHeight*3).attr(`rx`,c().state.radius),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,c().state.titleShift-c().state.textHeight-c().state.padding).attr(`width`,d).attr(`height`,p.height+3+2*c().state.textHeight).attr(`rx`,c().state.radius),e},`addTitleAndBox`),b=a(e=>(e.append(`circle`).attr(`class`,`end-state-outer`).attr(`r`,c().state.sizeUnit+c().state.miniPadding).attr(`cx`,c().state.padding+c().state.sizeUnit+c().state.miniPadding).attr(`cy`,c().state.padding+c().state.sizeUnit+c().state.miniPadding),e.append(`circle`).attr(`class`,`end-state-inner`).attr(`r`,c().state.sizeUnit).attr(`cx`,c().state.padding+c().state.sizeUnit+2).attr(`cy`,c().state.padding+c().state.sizeUnit+2)),`drawEndState`),x=a((e,t)=>{let n=c().state.forkWidth,r=c().state.forkHeight;if(t.parentId){let e=n;n=r,r=e}return e.append(`rect`).style(`stroke`,`black`).style(`fill`,`black`).attr(`width`,n).attr(`height`,r).attr(`x`,c().state.padding).attr(`y`,c().state.padding)},`drawForkJoinState`),S=a((e,t,n,r)=>{let i=0,a=r.append(`text`);a.style(`text-anchor`,`start`),a.attr(`class`,`noteText`);let o=e.replace(/\r\n/g,`<br/>`);o=o.replace(/\n/g,`<br/>`);let s=o.split(u.lineBreakRegex),l=1.25*c().state.noteMargin;for(let e of s){let r=e.trim();if(r.length>0){let e=a.append(`tspan`);if(e.text(r),l===0){let t=e.node().getBBox();l+=t.height}i+=l,e.attr(`x`,t+c().state.noteMargin),e.attr(`y`,n+i+1.25*c().state.noteMargin)}}return{textWidth:a.node().getBBox().width,textHeight:i}},`_drawLongText`),C=a((e,t)=>{t.attr(`class`,`state-note`);let n=t.append(`rect`).attr(`x`,0).attr(`y`,c().state.padding),{textWidth:r,textHeight:i}=S(e,0,0,t.append(`g`));return n.attr(`height`,i+2*c().state.noteMargin),n.attr(`width`,r+c().state.noteMargin*2),n},`drawNote`),w=a(function(e,t){let n=t.id,r={id:n,label:t.id,width:0,height:0},i=e.append(`g`).attr(`id`,n).attr(`class`,`stateGroup`);t.type===`start`&&h(i),t.type===`end`&&b(i),(t.type===`fork`||t.type===`join`)&&x(i,t),t.type===`note`&&C(t.note.text,i),t.type===`divider`&&g(i),t.type===`default`&&t.descriptions.length===0&&_(i,t),t.type===`default`&&t.descriptions.length>0&&v(i,t);let a=i.node().getBBox();return r.width=a.width+2*c().state.padding,r.height=a.height+2*c().state.padding,r},`drawState`),T=0,E=a(function(e,r,o){let l=a(function(e){switch(e){case m.relationType.AGGREGATION:return`aggregation`;case m.relationType.EXTENSION:return`extension`;case m.relationType.COMPOSITION:return`composition`;case m.relationType.DEPENDENCY:return`dependency`}},`getRelationType`);r.points=r.points.filter(e=>!Number.isNaN(e.y));let f=r.points,p=d().x(function(e){return e.x}).y(function(e){return e.y}).curve(t),h=e.append(`path`).attr(`d`,p(f)).attr(`id`,`edge`+T).attr(`class`,`transition`),g=``;if(c().state.arrowMarkerAbsolute&&(g=s(!0)),h.attr(`marker-end`,`url(`+g+`#`+l(m.relationType.DEPENDENCY)+`End)`),o.title!==void 0){let t=e.append(`g`).attr(`class`,`stateLabel`),{x:a,y:s}=n.calcLabelPosition(r.points),l=u.getRows(o.title),d=0,f=[],p=0,m=0;for(let e=0;e<=l.length;e++){let n=t.append(`text`).attr(`text-anchor`,`middle`).text(l[e]).attr(`x`,a).attr(`y`,s+d),r=n.node().getBBox();p=Math.max(p,r.width),m=Math.min(m,r.x),i.info(r.x,a,s+d),d===0&&(d=n.node().getBBox().height,i.info(`Title height`,d,s)),f.push(n)}let h=d*l.length;if(l.length>1){let e=(l.length-1)*d*.5;f.forEach((t,n)=>t.attr(`y`,s+n*d-e)),h=d*l.length}let g=t.node().getBBox();t.insert(`rect`,`:first-child`).attr(`class`,`box`).attr(`x`,a-p/2-c().state.padding/2).attr(`y`,s-h/2-c().state.padding/2-3.5).attr(`width`,p+c().state.padding).attr(`height`,h+c().state.padding),i.info(g)}T++},`drawEdge`),D,O={},k=a(function(){},`setConf`),A=a(function(e){e.append(`defs`).append(`marker`).attr(`id`,`dependencyEnd`).attr(`refX`,19).attr(`refY`,7).attr(`markerWidth`,20).attr(`markerHeight`,28).attr(`orient`,`auto`).append(`path`).attr(`d`,`M 19,7 L9,13 L14,7 L9,1 Z`)},`insertMarkers`),j=a(function(e,t,n,r){D=c().state;let a=c().securityLevel,s;a===`sandbox`&&(s=o(`#i`+t));let u=o(a===`sandbox`?s.nodes()[0].contentDocument.body:`body`),d=a===`sandbox`?s.nodes()[0].contentDocument:document;i.debug(`Rendering diagram `+e);let f=u.select(`[id='${t}']`);A(f),N(r.db.getRootDoc(),f,void 0,!1,u,d,r);let p=D.padding,m=f.node().getBBox(),h=m.width+p*2,g=m.height+p*2;l(f,g,h*1.75,D.useMaxWidth),f.attr(`viewBox`,`${m.x-D.padding} ${m.y-D.padding} `+h+` `+g)},`draw`),M=a(e=>e?e.length*D.fontSizeFactor:1,`getLabelWidth`),N=a((t,n,a,o,s,c,l)=>{let d=new r({compound:!0,multigraph:!0}),f,p=!0;for(f=0;f<t.length;f++)if(t[f].stmt===`relation`){p=!1;break}a?d.setGraph({rankdir:`LR`,multigraph:!0,compound:!0,ranker:`tight-tree`,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,isMultiGraph:!0}):d.setGraph({rankdir:`TB`,multigraph:!0,compound:!0,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,ranker:`tight-tree`,isMultiGraph:!0}),d.setDefaultEdgeLabel(function(){return{}});let m=l.db.getStates(),h=l.db.getRelations(),g=Object.keys(m);for(let e of g){let t=m[e];a&&(t.parentId=a);let r;if(t.doc){let e=n.append(`g`).attr(`id`,t.id).attr(`class`,`stateGroup`);r=N(t.doc,e,t.id,!o,s,c,l);{e=y(e,t,o);let n=e.node().getBBox();r.width=n.width,r.height=n.height+D.padding/2,O[t.id]={y:D.compositTitleSize}}}else r=w(n,t,d);if(t.note){let e=w(n,{descriptions:[],id:t.id+`-note`,note:t.note,type:`note`},d);t.note.position===`left of`?(d.setNode(r.id+`-note`,e),d.setNode(r.id,r)):(d.setNode(r.id,r),d.setNode(r.id+`-note`,e)),d.setParent(r.id,r.id+`-group`),d.setParent(r.id+`-note`,r.id+`-group`)}else d.setNode(r.id,r)}i.debug(`Count=`,d.nodeCount(),d);let _=0;h.forEach(function(e){_++,i.debug(`Setting edge`,e),d.setEdge(e.id1,e.id2,{relation:e,width:M(e.title),height:D.labelHeight*u.getRows(e.title).length,labelpos:`c`},`id`+_)}),e(d),i.debug(`Graph after layout`,d.nodes());let v=n.node();d.nodes().forEach(function(e){e!==void 0&&d.node(e)!==void 0?(i.warn(`Node `+e+`: `+JSON.stringify(d.node(e))),s.select(`#`+v.id+` #`+e).attr(`transform`,`translate(`+(d.node(e).x-d.node(e).width/2)+`,`+(d.node(e).y+(O[e]?O[e].y:0)-d.node(e).height/2)+` )`),s.select(`#`+v.id+` #`+e).attr(`data-x-shift`,d.node(e).x-d.node(e).width/2),c.querySelectorAll(`#`+v.id+` #`+e+` .divider`).forEach(e=>{let t=e.parentElement,n=0,r=0;t&&(t.parentElement&&(n=t.parentElement.getBBox().width),r=parseInt(t.getAttribute(`data-x-shift`),10),Number.isNaN(r)&&(r=0)),e.setAttribute(`x1`,0-r+8),e.setAttribute(`x2`,n-r-8)})):i.debug(`No Node `+e+`: `+JSON.stringify(d.node(e)))});let b=v.getBBox();d.edges().forEach(function(e){e!==void 0&&d.edge(e)!==void 0&&(i.debug(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(d.edge(e))),E(n,d.edge(e),d.edge(e).relation))}),b=v.getBBox();let x={id:a||`root`,label:a||`root`,width:0,height:0};return x.width=b.width+2*D.padding,x.height=b.height+2*D.padding,i.debug(`Doc rendered`,x,d),x},`renderDoc`),P={parser:p,get db(){return new m(1)},renderer:{setConf:k,draw:j},styles:f,init:a(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{P as diagram};
@@ -0,0 +1 @@
1
+ import"./chunk-GEFDOKGD-DwVPiYfW.js";import{h as e}from"./src-BoSBNdA_.js";import"./chunk-7R4GIKGN-DXaGAn_K.js";import"./dist-Cce3efmT.js";import"./chunk-PU5JKC2W-B66ELkQm.js";import"./chunk-MX3YWQON-BgjSEzus.js";import"./chunk-YBOYWFTD-Dx_fX35n.js";import"./chunk-55IACEB6-C4mUdyio.js";import"./chunk-KX2RTZJC-BCxGmbzy.js";import"./chunk-PQ6SQG4A-BxtUGYhW.js";import"./chunk-KYZI473N-BKO5gMeU.js";import"./chunk-O4XLMI2P-BurQy8tt.js";import"./chunk-GLR3WWYH-D9pZakqr.js";import{i as t,n,r,t as i}from"./chunk-NQ4KR5QH-DLrZwBEm.js";var a={parser:n,get db(){return new i(2)},renderer:r,styles:t,init:e(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};