@leanspec/ui 0.2.20 → 0.2.21-dev.21575245759

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 (129) hide show
  1. package/dist/assets/_baseUniq-Bt-G8KSC-D27tYV3n.js +1 -0
  2. package/dist/assets/{_baseUniq-BsoaREqH.js → _baseUniq-nZPp3_pT.js} +1 -1
  3. package/dist/assets/{arc-6n79Tfx2.js → arc-CxsGLnmn.js} +1 -1
  4. package/dist/assets/arc-DZ2LCm0s-DPK_o6oK.js +1 -0
  5. package/dist/assets/{architectureDiagram-VXUJARFQ-P8sPUFFv.js → architectureDiagram-VXUJARFQ-I8x722zf.js} +1 -1
  6. package/dist/assets/architectureDiagram-VXUJARFQ-U-uGQw8X-DYC2qZNI.js +36 -0
  7. package/dist/assets/{blockDiagram-VD42YOAC-B_LH4ciH.js → blockDiagram-VD42YOAC-Bg1O-O95.js} +1 -1
  8. package/dist/assets/blockDiagram-VD42YOAC-BlLxEg73-DF3T8csB.js +122 -0
  9. package/dist/assets/c4Diagram-YG6GDRKO-CWDMR1_B-CXvvRsJe.js +10 -0
  10. package/dist/assets/{c4Diagram-YG6GDRKO-BbCoaLWc.js → c4Diagram-YG6GDRKO-pEqJtWMO.js} +1 -1
  11. package/dist/assets/channel-6eiInZuW-CgNgdRzb.js +1 -0
  12. package/dist/assets/channel-BJ5t0Etp.js +1 -0
  13. package/dist/assets/{chunk-4BX2VUAB-BnM4Ey-A.js → chunk-4BX2VUAB-B-w6f95H.js} +1 -1
  14. package/dist/assets/chunk-4BX2VUAB-CXaj02kc-C7T33H1t.js +1 -0
  15. package/dist/assets/{chunk-55IACEB6-DRuDSE6v.js → chunk-55IACEB6-DONj5PGh.js} +1 -1
  16. package/dist/assets/{chunk-55IACEB6-Dd3NjClm-2avamB6R.js → chunk-55IACEB6-o1l2wNNZ-B4eZtpxO.js} +1 -1
  17. package/dist/assets/{chunk-B4BG7PRW-BRJeNZka.js → chunk-B4BG7PRW-BiConymO.js} +1 -1
  18. package/dist/assets/{chunk-B4BG7PRW-DLUrgkJI-BIz-U-if.js → chunk-B4BG7PRW-ByP5AEXO-D7q5byqQ.js} +6 -6
  19. package/dist/assets/{chunk-DI55MBZ5-Deatey85.js → chunk-DI55MBZ5-5aEOOAh4.js} +1 -1
  20. package/dist/assets/chunk-DI55MBZ5-Cy8ug2Ot-BzD-RQbN.js +220 -0
  21. package/dist/assets/{chunk-FMBD7UC4-BRigiN-C.js → chunk-FMBD7UC4-CFCGkvlM.js} +1 -1
  22. package/dist/assets/{chunk-FMBD7UC4-6dsbMKM7-4LY1fre4.js → chunk-FMBD7UC4-D2V_FohP-C3CtLLXp.js} +1 -1
  23. package/dist/assets/chunk-QN33PNHL-BgDnNc7H-Dg0jsCmn.js +1 -0
  24. package/dist/assets/{chunk-QN33PNHL-C5mhxjvn.js → chunk-QN33PNHL-C3TYjKHt.js} +1 -1
  25. package/dist/assets/{chunk-QZHKN3VN-CVAEdzef-BFS0CidB.js → chunk-QZHKN3VN--CtIzUYG-COYF7kdN.js} +1 -1
  26. package/dist/assets/{chunk-QZHKN3VN-DxEo2WQL.js → chunk-QZHKN3VN-BTgIbPLF.js} +1 -1
  27. package/dist/assets/{chunk-TZMSLE5B-o_smO1ge.js → chunk-TZMSLE5B-BYa7dHNX.js} +1 -1
  28. package/dist/assets/{chunk-TZMSLE5B-Cc8_PJIq-BToSsQub.js → chunk-TZMSLE5B-Co2797zI-B0eGB9AN.js} +1 -1
  29. package/dist/assets/classDiagram-2ON5EDUG-BwW7Xsc6.js +1 -0
  30. package/dist/assets/classDiagram-2ON5EDUG-DuGJj6Wa-DhRoJudg.js +1 -0
  31. package/dist/assets/classDiagram-v2-WZHVMYZB-BwW7Xsc6.js +1 -0
  32. package/dist/assets/classDiagram-v2-WZHVMYZB-DuGJj6Wa-DhRoJudg.js +1 -0
  33. package/dist/assets/clone-CZsI6H4n.js +1 -0
  34. package/dist/assets/clone-Ctpto5BP-ESuTgnBA.js +1 -0
  35. package/dist/assets/code-block-37QAKDTI-CV0fNy9d-7-ZI8oN1.js +2 -0
  36. package/dist/assets/{cose-bilkent-S5V4N54A-D8QB8iVT.js → cose-bilkent-S5V4N54A-DeBB4jVj.js} +1 -1
  37. package/dist/assets/{cose-bilkent-S5V4N54A-0O3dLIoy-D4Dh8XlP.js → cose-bilkent-S5V4N54A-KnAtiu0m-COpUFhy5.js} +1 -1
  38. package/dist/assets/{cytoscape.esm-CjI2IsL8-U70Mzu-N.js → cytoscape.esm-Cvf3sx9F-DgU3JdRZ.js} +1 -1
  39. package/dist/assets/{dagre-6UL2VRFP-6Skhzr8u.js → dagre-6UL2VRFP-D23NtPEO.js} +1 -1
  40. package/dist/assets/dagre-6UL2VRFP-D51yjhSx-EqzQGkqV.js +4 -0
  41. package/dist/assets/diagram-PSM6KHXK-23_kzlwi-BpZ6Fb-v.js +24 -0
  42. package/dist/assets/{diagram-PSM6KHXK-OhkCexcT.js → diagram-PSM6KHXK-Ch_DZlT0.js} +1 -1
  43. package/dist/assets/diagram-QEK2KX5R-BKtrKu-S-DR2vXCUU.js +43 -0
  44. package/dist/assets/{diagram-QEK2KX5R-J9zMFFhj.js → diagram-QEK2KX5R-CrY0CKvn.js} +1 -1
  45. package/dist/assets/diagram-S2PKOQOG-DoEO8H2S-0b5T-ySZ.js +24 -0
  46. package/dist/assets/{diagram-S2PKOQOG-DBfX1nG_.js → diagram-S2PKOQOG-FgGua24R.js} +1 -1
  47. package/dist/assets/{erDiagram-Q2GNP2WA-CXv6THpi-jBM9oCgW.js → erDiagram-Q2GNP2WA-Brk8cDjC--fOBX-6o.js} +5 -5
  48. package/dist/assets/{erDiagram-Q2GNP2WA-C4xTfx7N.js → erDiagram-Q2GNP2WA-CXAB8RkT.js} +1 -1
  49. package/dist/assets/{flowDiagram-NV44I4VS-IQdR5afF.js → flowDiagram-NV44I4VS-BnzQkPfl.js} +1 -1
  50. package/dist/assets/flowDiagram-NV44I4VS-DlEP0pXZ-CkXOee12.js +162 -0
  51. package/dist/assets/{ganttDiagram-JELNMOA3-D2MQHjD7.js → ganttDiagram-JELNMOA3-B3bFmOWF.js} +1 -1
  52. package/dist/assets/{ganttDiagram-JELNMOA3-CqVYbgbk-CXxMuoGT.js → ganttDiagram-JELNMOA3-Bi3P37Jn-3K4cNggw.js} +1 -1
  53. package/dist/assets/{gitGraphDiagram-NY62KEGX-DT_U3GkJ.js → gitGraphDiagram-NY62KEGX-B0ee5fGK.js} +1 -1
  54. package/dist/assets/gitGraphDiagram-NY62KEGX-CTxAPzG3-Dt7-M6Il.js +65 -0
  55. package/dist/assets/{graph-rt_wscbL-BNjHDk3A.js → graph-BBwx-qRB-Bw-VVURa.js} +1 -1
  56. package/dist/assets/{graph-BP-Jibpj.js → graph-Dc_5IX9m.js} +1 -1
  57. package/dist/assets/index-Ct8vAKMN.js +2542 -0
  58. package/dist/assets/index-Dpvo-in9.css +1 -0
  59. package/dist/assets/{infoDiagram-WHAUD3N6-CibSXYXU.js → infoDiagram-WHAUD3N6-BEIQvzVL.js} +1 -1
  60. package/dist/assets/infoDiagram-WHAUD3N6-CuYFw1_3-DZl9eVid.js +2 -0
  61. package/dist/assets/{journeyDiagram-XKPGCS4Q-BzZgPZwu-Dq8-0uHr.js → journeyDiagram-XKPGCS4Q-DIhWLskT-D3mqQXDZ.js} +4 -4
  62. package/dist/assets/{journeyDiagram-XKPGCS4Q-D355rgh1.js → journeyDiagram-XKPGCS4Q-RyUDjBEd.js} +1 -1
  63. package/dist/assets/{kanban-definition-3W4ZIXB7-WFOS2NhM.js → kanban-definition-3W4ZIXB7-CeXULItR.js} +1 -1
  64. package/dist/assets/kanban-definition-3W4ZIXB7-DO-lQxEf-BZn7mE4M.js +89 -0
  65. package/dist/assets/{layout-CX9neEHw-BeASe-L2.js → layout-BzpSdQ1b-piwZFZhY.js} +1 -1
  66. package/dist/assets/{layout-Dz4cXAJl.js → layout-ZafNe8NA.js} +1 -1
  67. package/dist/assets/{linear-CkUVga7d-JN8zRlYV.js → linear-CeTmiU5L-DrCaNM8J.js} +1 -1
  68. package/dist/assets/{min-pYcMk-7s.js → min-BG6PRNYP.js} +1 -1
  69. package/dist/assets/min-DK0HBqAV-C6wdO-W-.js +1 -0
  70. package/dist/assets/{mindmap-definition-VGOIOE7T-5TYHgroK.js → mindmap-definition-VGOIOE7T-BEPp-fci.js} +1 -1
  71. package/dist/assets/mindmap-definition-VGOIOE7T-DuH7hBBA-nWu1G-Wa.js +68 -0
  72. package/dist/assets/pieDiagram-ADFJNKIX-C3qcL2xx-Crl6TO-T.js +30 -0
  73. package/dist/assets/{pieDiagram-ADFJNKIX-Cl9FemBR.js → pieDiagram-ADFJNKIX-Ckix0LGw.js} +1 -1
  74. package/dist/assets/quadrantDiagram-AYHSOK5B-CWcQ_rDh-DSoW8n0T.js +7 -0
  75. package/dist/assets/{quadrantDiagram-AYHSOK5B-BaMEGEnc.js → quadrantDiagram-AYHSOK5B-D7wPIJnr.js} +1 -1
  76. package/dist/assets/{requirementDiagram-UZGBJVZJ-MnXD59Yw-Dm-bbX5b.js → requirementDiagram-UZGBJVZJ-BwrtCkIe-DXNfmmRt.js} +7 -7
  77. package/dist/assets/{requirementDiagram-UZGBJVZJ-Cegg7hVN.js → requirementDiagram-UZGBJVZJ-vIebjgGs.js} +1 -1
  78. package/dist/assets/{sankeyDiagram-TZEHDZUN-DymCbMLh.js → sankeyDiagram-TZEHDZUN-Ca0uoUWB.js} +1 -1
  79. package/dist/assets/{sankeyDiagram-TZEHDZUN-Dfyu7oJ6-Brsza4C4.js → sankeyDiagram-TZEHDZUN-D0EYmAQl-wwDJ3KS4.js} +8 -8
  80. package/dist/assets/sequenceDiagram-WL72ISMW-B9ehIr-I-Cjp87WYq.js +145 -0
  81. package/dist/assets/{sequenceDiagram-WL72ISMW-B44Q2U-R.js → sequenceDiagram-WL72ISMW-DJhv-n8R.js} +1 -1
  82. package/dist/assets/{stateDiagram-FKZM4ZOC-BjCASZKu.js → stateDiagram-FKZM4ZOC-CCyyct-m.js} +1 -1
  83. package/dist/assets/{stateDiagram-FKZM4ZOC-DYV-na53-BvsNCcKw.js → stateDiagram-FKZM4ZOC-gpYbn_kg-AXqF50Pv.js} +1 -1
  84. package/dist/assets/stateDiagram-v2-4FDKWEC3-6INNq0Hu.js +1 -0
  85. package/dist/assets/stateDiagram-v2-4FDKWEC3-C4KMyOyW-BF6DY14F.js +1 -0
  86. package/dist/assets/timeline-definition-IT6M3QCI-B4IcdbBF-sHXwuTVu.js +61 -0
  87. package/dist/assets/{timeline-definition-IT6M3QCI-Dike3xBH.js → timeline-definition-IT6M3QCI-BNtl1Khg.js} +1 -1
  88. package/dist/assets/{treemap-KMMF4GRG-B6R0VeLI.js → treemap-KMMF4GRG-CYH0mpe_.js} +1 -1
  89. package/dist/assets/{treemap-KMMF4GRG-l6HrdCLC-BT57UjJR.js → treemap-KMMF4GRG-CcT4hm8S-BToKQPCO.js} +59 -59
  90. package/dist/assets/{xychartDiagram-PRI3JC2R-B2JxDynv.js → xychartDiagram-PRI3JC2R-CjiaqZ0I.js} +1 -1
  91. package/dist/assets/{xychartDiagram-PRI3JC2R-CkfCv2o_-2IOFmXBp.js → xychartDiagram-PRI3JC2R-U8S5ep3O-tw2WRWDG.js} +3 -3
  92. package/dist/index.html +2 -2
  93. package/package.json +3 -7
  94. package/dist/assets/_baseUniq-KSDS6tgF-C-4qFebV.js +0 -1
  95. package/dist/assets/arc-C-X5Xt_b-B3TYbMcz.js +0 -1
  96. package/dist/assets/architectureDiagram-VXUJARFQ-Bal8NTn4-BCL87o4h.js +0 -36
  97. package/dist/assets/blockDiagram-VD42YOAC-B2gTo5wW-rdjZT-6Z.js +0 -122
  98. package/dist/assets/c4Diagram-YG6GDRKO-dIf_vNCY-DL4DABj7.js +0 -10
  99. package/dist/assets/channel-Cg88UM7_.js +0 -1
  100. package/dist/assets/channel-klR7o7JB-BA92hgvh.js +0 -1
  101. package/dist/assets/chunk-4BX2VUAB-BQgzc1Sm-o9UeA92o.js +0 -1
  102. package/dist/assets/chunk-DI55MBZ5-BwHLqSW9-fLBLXYqu.js +0 -220
  103. package/dist/assets/chunk-QN33PNHL-DHNejhbC-Dzf1H1zL.js +0 -1
  104. package/dist/assets/classDiagram-2ON5EDUG-Coznyg-a.js +0 -1
  105. package/dist/assets/classDiagram-2ON5EDUG-D7bjndmT-Bp9Exnnr.js +0 -1
  106. package/dist/assets/classDiagram-v2-WZHVMYZB-Coznyg-a.js +0 -1
  107. package/dist/assets/classDiagram-v2-WZHVMYZB-D7bjndmT-Bp9Exnnr.js +0 -1
  108. package/dist/assets/clone-7srXemyd-ddPD0sbr.js +0 -1
  109. package/dist/assets/clone-BBL425Up.js +0 -1
  110. package/dist/assets/code-block-37QAKDTI-MRm4xHKr-DA5ypbc9.js +0 -2
  111. package/dist/assets/dagre-6UL2VRFP-BqaZre9N-CNJK18dO.js +0 -4
  112. package/dist/assets/diagram-PSM6KHXK-s2xYLlND-2NBcIWYg.js +0 -24
  113. package/dist/assets/diagram-QEK2KX5R-D700jvoY-CjoH4Z70.js +0 -43
  114. package/dist/assets/diagram-S2PKOQOG-BkgBSa1Q-BPjtcOco.js +0 -24
  115. package/dist/assets/flowDiagram-NV44I4VS-Dsrv00Gy-CDSCzPdF.js +0 -162
  116. package/dist/assets/gitGraphDiagram-NY62KEGX-DOanbk62-DfLJu9ZY.js +0 -65
  117. package/dist/assets/index-BffUh93D.js +0 -2540
  118. package/dist/assets/index-BmRah08N.css +0 -1
  119. package/dist/assets/infoDiagram-WHAUD3N6-Fq8ToFQ6-eXf-0eda.js +0 -2
  120. package/dist/assets/kanban-definition-3W4ZIXB7-CrmrjRAg-CQFMGdC-.js +0 -89
  121. package/dist/assets/min-Ar5ebLd--DAFAc3TM.js +0 -1
  122. package/dist/assets/mindmap-definition-VGOIOE7T-DeGZNL21-B7i2X052.js +0 -68
  123. package/dist/assets/pieDiagram-ADFJNKIX-C_V2NX6O-BCtYOnVn.js +0 -30
  124. package/dist/assets/quadrantDiagram-AYHSOK5B-B8fSnYQi-CsEq7CVM.js +0 -7
  125. package/dist/assets/sequenceDiagram-WL72ISMW-D2pgAoWi-B9cKeqh_.js +0 -145
  126. package/dist/assets/stateDiagram-v2-4FDKWEC3-DKcialcH.js +0 -1
  127. package/dist/assets/stateDiagram-v2-4FDKWEC3-Kp4sxr9o-Dn2HGh3T.js +0 -1
  128. package/dist/assets/timeline-definition-IT6M3QCI-621ePKJ0-ZE60CCox.js +0 -61
  129. /package/dist/assets/{ordinal-DfAQgscy-Pc8f3NoK.js → ordinal-B6-f3MAq-Pc8f3NoK.js} +0 -0
@@ -1,4 +1,4 @@
1
- import{bE as g,bZ as _t,b_ as xt,bF as vt,bG as bt,bI as St,bH as wt,bJ as lt,c4 as Lt,bK as X,d6 as Et,cJ as At,c3 as Tt,bS as Mt}from"./index-BffUh93D.js";function Nt(t){for(var e=t.length/6|0,i=new Array(e),a=0;a<e;)i[a]="#"+t.slice(a*6,++a*6);return i}const It=Nt("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function ct(t,e){let i;if(e===void 0)for(const a of t)a!=null&&(i<a||i===void 0&&a>=a)&&(i=a);else{let a=-1;for(let h of t)(h=e(h,++a,t))!=null&&(i<h||i===void 0&&h>=h)&&(i=h)}return i}function pt(t,e){let i;if(e===void 0)for(const a of t)a!=null&&(i>a||i===void 0&&a>=a)&&(i=a);else{let a=-1;for(let h of t)(h=e(h,++a,t))!=null&&(i>h||i===void 0&&h>=h)&&(i=h)}return i}function nt(t,e){let i=0;if(e===void 0)for(let a of t)(a=+a)&&(i+=a);else{let a=-1;for(let h of t)(h=+e(h,++a,t))&&(i+=h)}return i}function Pt(t){return t.target.depth}function Ct(t){return t.depth}function Ot(t,e){return e-1-t.height}function mt(t,e){return t.sourceLinks.length?t.depth:e-1}function Dt(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?pt(t.sourceLinks,Pt)-1:0}function q(t){return function(){return t}}function ut(t,e){return K(t.source,e.source)||t.index-e.index}function ht(t,e){return K(t.target,e.target)||t.index-e.index}function K(t,e){return t.y0-e.y0}function it(t){return t.value}function $t(t){return t.index}function zt(t){return t.nodes}function jt(t){return t.links}function ft(t,e){const i=t.get(e);if(!i)throw new Error("missing: "+e);return i}function yt({nodes:t}){for(const e of t){let i=e.y0,a=i;for(const h of e.sourceLinks)h.y0=i+h.width/2,i+=h.width;for(const h of e.targetLinks)h.y1=a+h.width/2,a+=h.width}}function Bt(){let t=0,e=0,i=1,a=1,h=24,b=8,p,k=$t,s=mt,o,l,_=zt,x=jt,y=6;function v(){const n={nodes:_.apply(null,arguments),links:x.apply(null,arguments)};return M(n),T(n),N(n),C(n),w(n),yt(n),n}v.update=function(n){return yt(n),n},v.nodeId=function(n){return arguments.length?(k=typeof n=="function"?n:q(n),v):k},v.nodeAlign=function(n){return arguments.length?(s=typeof n=="function"?n:q(n),v):s},v.nodeSort=function(n){return arguments.length?(o=n,v):o},v.nodeWidth=function(n){return arguments.length?(h=+n,v):h},v.nodePadding=function(n){return arguments.length?(b=p=+n,v):b},v.nodes=function(n){return arguments.length?(_=typeof n=="function"?n:q(n),v):_},v.links=function(n){return arguments.length?(x=typeof n=="function"?n:q(n),v):x},v.linkSort=function(n){return arguments.length?(l=n,v):l},v.size=function(n){return arguments.length?(t=e=0,i=+n[0],a=+n[1],v):[i-t,a-e]},v.extent=function(n){return arguments.length?(t=+n[0][0],i=+n[1][0],e=+n[0][1],a=+n[1][1],v):[[t,e],[i,a]]},v.iterations=function(n){return arguments.length?(y=+n,v):y};function M({nodes:n,links:f}){for(const[c,r]of n.entries())r.index=c,r.sourceLinks=[],r.targetLinks=[];const u=new Map(n.map((c,r)=>[k(c,r,n),c]));for(const[c,r]of f.entries()){r.index=c;let{source:m,target:S}=r;typeof m!="object"&&(m=r.source=ft(u,m)),typeof S!="object"&&(S=r.target=ft(u,S)),m.sourceLinks.push(r),S.targetLinks.push(r)}if(l!=null)for(const{sourceLinks:c,targetLinks:r}of n)c.sort(l),r.sort(l)}function T({nodes:n}){for(const f of n)f.value=f.fixedValue===void 0?Math.max(nt(f.sourceLinks,it),nt(f.targetLinks,it)):f.fixedValue}function N({nodes:n}){const f=n.length;let u=new Set(n),c=new Set,r=0;for(;u.size;){for(const m of u){m.depth=r;for(const{target:S}of m.sourceLinks)c.add(S)}if(++r>f)throw new Error("circular link");u=c,c=new Set}}function C({nodes:n}){const f=n.length;let u=new Set(n),c=new Set,r=0;for(;u.size;){for(const m of u){m.height=r;for(const{source:S}of m.targetLinks)c.add(S)}if(++r>f)throw new Error("circular link");u=c,c=new Set}}function $({nodes:n}){const f=ct(n,r=>r.depth)+1,u=(i-t-h)/(f-1),c=new Array(f);for(const r of n){const m=Math.max(0,Math.min(f-1,Math.floor(s.call(null,r,f))));r.layer=m,r.x0=t+m*u,r.x1=r.x0+h,c[m]?c[m].push(r):c[m]=[r]}if(o)for(const r of c)r.sort(o);return c}function F(n){const f=pt(n,u=>(a-e-(u.length-1)*p)/nt(u,it));for(const u of n){let c=e;for(const r of u){r.y0=c,r.y1=c+r.value*f,c=r.y1+p;for(const m of r.sourceLinks)m.width=m.value*f}c=(a-c+p)/(u.length+1);for(let r=0;r<u.length;++r){const m=u[r];m.y0+=c*(r+1),m.y1+=c*(r+1)}A(u)}}function w(n){const f=$(n);p=Math.min(b,(a-e)/(ct(f,u=>u.length)-1)),F(f);for(let u=0;u<y;++u){const c=Math.pow(.99,u),r=Math.max(1-c,(u+1)/y);B(f,c,r),P(f,c,r)}}function P(n,f,u){for(let c=1,r=n.length;c<r;++c){const m=n[c];for(const S of m){let L=0,R=0;for(const{source:H,value:et}of S.targetLinks){let Y=et*(S.layer-H.layer);L+=z(H,S)*Y,R+=Y}if(!(R>0))continue;let U=(L/R-S.y0)*f;S.y0+=U,S.y1+=U,E(S)}o===void 0&&m.sort(K),O(m,u)}}function B(n,f,u){for(let c=n.length,r=c-2;r>=0;--r){const m=n[r];for(const S of m){let L=0,R=0;for(const{target:H,value:et}of S.sourceLinks){let Y=et*(H.layer-S.layer);L+=I(S,H)*Y,R+=Y}if(!(R>0))continue;let U=(L/R-S.y0)*f;S.y0+=U,S.y1+=U,E(S)}o===void 0&&m.sort(K),O(m,u)}}function O(n,f){const u=n.length>>1,c=n[u];d(n,c.y0-p,u-1,f),D(n,c.y1+p,u+1,f),d(n,a,n.length-1,f),D(n,e,0,f)}function D(n,f,u,c){for(;u<n.length;++u){const r=n[u],m=(f-r.y0)*c;m>1e-6&&(r.y0+=m,r.y1+=m),f=r.y1+p}}function d(n,f,u,c){for(;u>=0;--u){const r=n[u],m=(r.y1-f)*c;m>1e-6&&(r.y0-=m,r.y1-=m),f=r.y0-p}}function E({sourceLinks:n,targetLinks:f}){if(l===void 0){for(const{source:{sourceLinks:u}}of f)u.sort(ht);for(const{target:{targetLinks:u}}of n)u.sort(ut)}}function A(n){if(l===void 0)for(const{sourceLinks:f,targetLinks:u}of n)f.sort(ht),u.sort(ut)}function z(n,f){let u=n.y0-(n.sourceLinks.length-1)*p/2;for(const{target:c,width:r}of n.sourceLinks){if(c===f)break;u+=r+p}for(const{source:c,width:r}of f.targetLinks){if(c===n)break;u-=r}return u}function I(n,f){let u=f.y0-(f.targetLinks.length-1)*p/2;for(const{source:c,width:r}of f.targetLinks){if(c===n)break;u+=r+p}for(const{target:c,width:r}of n.sourceLinks){if(c===f)break;u-=r}return u}return v}var st=Math.PI,rt=2*st,V=1e-6,Ft=rt-V;function ot(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function kt(){return new ot}ot.prototype=kt.prototype={constructor:ot,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,i,a){this._+="Q"+ +t+","+ +e+","+(this._x1=+i)+","+(this._y1=+a)},bezierCurveTo:function(t,e,i,a,h,b){this._+="C"+ +t+","+ +e+","+ +i+","+ +a+","+(this._x1=+h)+","+(this._y1=+b)},arcTo:function(t,e,i,a,h){t=+t,e=+e,i=+i,a=+a,h=+h;var b=this._x1,p=this._y1,k=i-t,s=a-e,o=b-t,l=p-e,_=o*o+l*l;if(h<0)throw new Error("negative radius: "+h);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(_>V)if(!(Math.abs(l*k-s*o)>V)||!h)this._+="L"+(this._x1=t)+","+(this._y1=e);else{var x=i-b,y=a-p,v=k*k+s*s,M=x*x+y*y,T=Math.sqrt(v),N=Math.sqrt(_),C=h*Math.tan((st-Math.acos((v+_-M)/(2*T*N)))/2),$=C/N,F=C/T;Math.abs($-1)>V&&(this._+="L"+(t+$*o)+","+(e+$*l)),this._+="A"+h+","+h+",0,0,"+ +(l*x>o*y)+","+(this._x1=t+F*k)+","+(this._y1=e+F*s)}},arc:function(t,e,i,a,h,b){t=+t,e=+e,i=+i,b=!!b;var p=i*Math.cos(a),k=i*Math.sin(a),s=t+p,o=e+k,l=1^b,_=b?a-h:h-a;if(i<0)throw new Error("negative radius: "+i);this._x1===null?this._+="M"+s+","+o:(Math.abs(this._x1-s)>V||Math.abs(this._y1-o)>V)&&(this._+="L"+s+","+o),i&&(_<0&&(_=_%rt+rt),_>Ft?this._+="A"+i+","+i+",0,1,"+l+","+(t-p)+","+(e-k)+"A"+i+","+i+",0,1,"+l+","+(this._x1=s)+","+(this._y1=o):_>V&&(this._+="A"+i+","+i+",0,"+ +(_>=st)+","+l+","+(this._x1=t+i*Math.cos(h))+","+(this._y1=e+i*Math.sin(h))))},rect:function(t,e,i,a){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +i+"v"+ +a+"h"+-i+"Z"},toString:function(){return this._}};function dt(t){return function(){return t}}function Rt(t){return t[0]}function Vt(t){return t[1]}var Wt=Array.prototype.slice;function Gt(t){return t.source}function Ut(t){return t.target}function Ht(t){var e=Gt,i=Ut,a=Rt,h=Vt,b=null;function p(){var k,s=Wt.call(arguments),o=e.apply(this,s),l=i.apply(this,s);if(b||(b=k=kt()),t(b,+a.apply(this,(s[0]=o,s)),+h.apply(this,s),+a.apply(this,(s[0]=l,s)),+h.apply(this,s)),k)return b=null,k+""||null}return p.source=function(k){return arguments.length?(e=k,p):e},p.target=function(k){return arguments.length?(i=k,p):i},p.x=function(k){return arguments.length?(a=typeof k=="function"?k:dt(+k),p):a},p.y=function(k){return arguments.length?(h=typeof k=="function"?k:dt(+k),p):h},p.context=function(k){return arguments.length?(b=k??null,p):b},p}function Yt(t,e,i,a,h){t.moveTo(e,i),t.bezierCurveTo(e=(e+a)/2,i,e,h,a,h)}function Xt(){return Ht(Yt)}function qt(t){return[t.source.x1,t.y0]}function Kt(t){return[t.target.x0,t.y1]}function Qt(){return Xt().source(qt).target(Kt)}var at=(function(){var t=g(function(k,s,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=s);return o},"o"),e=[1,9],i=[1,10],a=[1,5,10,12],h={trace:g(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:g(function(s,o,l,_,x,y,v){var M=y.length-1;switch(x){case 7:const T=_.findOrCreateNode(y[M-4].trim().replaceAll('""','"')),N=_.findOrCreateNode(y[M-2].trim().replaceAll('""','"')),C=parseFloat(y[M].trim());_.addLink(T,N,C);break;case 8:case 9:case 11:this.$=y[M];break;case 10:this.$=y[M-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:e,20:i},{1:[2,6],7:11,10:[1,12]},t(i,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(a,[2,8]),t(a,[2,9]),{19:[1,16]},t(a,[2,11]),{1:[2,1]},{1:[2,5]},t(i,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:e,20:i},{15:18,16:7,17:8,18:e,20:i},{18:[1,19]},t(i,[2,3]),{12:[1,20]},t(a,[2,10]),{15:21,16:7,17:8,18:e,20:i},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:g(function(s,o){if(o.recoverable)this.trace(s);else{var l=new Error(s);throw l.hash=o,l}},"parseError"),parse:g(function(s){var o=this,l=[0],_=[],x=[null],y=[],v=this.table,M="",T=0,N=0,C=2,$=1,F=y.slice.call(arguments,1),w=Object.create(this.lexer),P={yy:{}};for(var B in this.yy)Object.prototype.hasOwnProperty.call(this.yy,B)&&(P.yy[B]=this.yy[B]);w.setInput(s,P.yy),P.yy.lexer=w,P.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var O=w.yylloc;y.push(O);var D=w.options&&w.options.ranges;typeof P.yy.parseError=="function"?this.parseError=P.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function d(L){l.length=l.length-2*L,x.length=x.length-L,y.length=y.length-L}g(d,"popStack");function E(){var L;return L=_.pop()||w.lex()||$,typeof L!="number"&&(L instanceof Array&&(_=L,L=_.pop()),L=o.symbols_[L]||L),L}g(E,"lex");for(var A,z,I,n,f={},u,c,r,m;;){if(z=l[l.length-1],this.defaultActions[z]?I=this.defaultActions[z]:((A===null||typeof A>"u")&&(A=E()),I=v[z]&&v[z][A]),typeof I>"u"||!I.length||!I[0]){var S="";m=[];for(u in v[z])this.terminals_[u]&&u>C&&m.push("'"+this.terminals_[u]+"'");w.showPosition?S="Parse error on line "+(T+1)+`:
1
+ import{bE as g,bZ as _t,b_ as xt,bF as vt,bG as bt,bI as St,bH as wt,bJ as lt,c4 as Lt,bK as X,d6 as Et,cJ as At,c3 as Tt,bS as Mt}from"./index-Ct8vAKMN.js";function Nt(t){for(var e=t.length/6|0,i=new Array(e),a=0;a<e;)i[a]="#"+t.slice(a*6,++a*6);return i}const It=Nt("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function ct(t,e){let i;if(e===void 0)for(const a of t)a!=null&&(i<a||i===void 0&&a>=a)&&(i=a);else{let a=-1;for(let h of t)(h=e(h,++a,t))!=null&&(i<h||i===void 0&&h>=h)&&(i=h)}return i}function pt(t,e){let i;if(e===void 0)for(const a of t)a!=null&&(i>a||i===void 0&&a>=a)&&(i=a);else{let a=-1;for(let h of t)(h=e(h,++a,t))!=null&&(i>h||i===void 0&&h>=h)&&(i=h)}return i}function nt(t,e){let i=0;if(e===void 0)for(let a of t)(a=+a)&&(i+=a);else{let a=-1;for(let h of t)(h=+e(h,++a,t))&&(i+=h)}return i}function Pt(t){return t.target.depth}function Ct(t){return t.depth}function Ot(t,e){return e-1-t.height}function mt(t,e){return t.sourceLinks.length?t.depth:e-1}function Dt(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?pt(t.sourceLinks,Pt)-1:0}function q(t){return function(){return t}}function ut(t,e){return K(t.source,e.source)||t.index-e.index}function ht(t,e){return K(t.target,e.target)||t.index-e.index}function K(t,e){return t.y0-e.y0}function it(t){return t.value}function $t(t){return t.index}function zt(t){return t.nodes}function jt(t){return t.links}function ft(t,e){const i=t.get(e);if(!i)throw new Error("missing: "+e);return i}function yt({nodes:t}){for(const e of t){let i=e.y0,a=i;for(const h of e.sourceLinks)h.y0=i+h.width/2,i+=h.width;for(const h of e.targetLinks)h.y1=a+h.width/2,a+=h.width}}function Bt(){let t=0,e=0,i=1,a=1,h=24,b=8,p,k=$t,s=mt,o,l,_=zt,x=jt,y=6;function v(){const n={nodes:_.apply(null,arguments),links:x.apply(null,arguments)};return M(n),T(n),N(n),C(n),w(n),yt(n),n}v.update=function(n){return yt(n),n},v.nodeId=function(n){return arguments.length?(k=typeof n=="function"?n:q(n),v):k},v.nodeAlign=function(n){return arguments.length?(s=typeof n=="function"?n:q(n),v):s},v.nodeSort=function(n){return arguments.length?(o=n,v):o},v.nodeWidth=function(n){return arguments.length?(h=+n,v):h},v.nodePadding=function(n){return arguments.length?(b=p=+n,v):b},v.nodes=function(n){return arguments.length?(_=typeof n=="function"?n:q(n),v):_},v.links=function(n){return arguments.length?(x=typeof n=="function"?n:q(n),v):x},v.linkSort=function(n){return arguments.length?(l=n,v):l},v.size=function(n){return arguments.length?(t=e=0,i=+n[0],a=+n[1],v):[i-t,a-e]},v.extent=function(n){return arguments.length?(t=+n[0][0],i=+n[1][0],e=+n[0][1],a=+n[1][1],v):[[t,e],[i,a]]},v.iterations=function(n){return arguments.length?(y=+n,v):y};function M({nodes:n,links:f}){for(const[c,r]of n.entries())r.index=c,r.sourceLinks=[],r.targetLinks=[];const u=new Map(n.map((c,r)=>[k(c,r,n),c]));for(const[c,r]of f.entries()){r.index=c;let{source:m,target:S}=r;typeof m!="object"&&(m=r.source=ft(u,m)),typeof S!="object"&&(S=r.target=ft(u,S)),m.sourceLinks.push(r),S.targetLinks.push(r)}if(l!=null)for(const{sourceLinks:c,targetLinks:r}of n)c.sort(l),r.sort(l)}function T({nodes:n}){for(const f of n)f.value=f.fixedValue===void 0?Math.max(nt(f.sourceLinks,it),nt(f.targetLinks,it)):f.fixedValue}function N({nodes:n}){const f=n.length;let u=new Set(n),c=new Set,r=0;for(;u.size;){for(const m of u){m.depth=r;for(const{target:S}of m.sourceLinks)c.add(S)}if(++r>f)throw new Error("circular link");u=c,c=new Set}}function C({nodes:n}){const f=n.length;let u=new Set(n),c=new Set,r=0;for(;u.size;){for(const m of u){m.height=r;for(const{source:S}of m.targetLinks)c.add(S)}if(++r>f)throw new Error("circular link");u=c,c=new Set}}function $({nodes:n}){const f=ct(n,r=>r.depth)+1,u=(i-t-h)/(f-1),c=new Array(f);for(const r of n){const m=Math.max(0,Math.min(f-1,Math.floor(s.call(null,r,f))));r.layer=m,r.x0=t+m*u,r.x1=r.x0+h,c[m]?c[m].push(r):c[m]=[r]}if(o)for(const r of c)r.sort(o);return c}function F(n){const f=pt(n,u=>(a-e-(u.length-1)*p)/nt(u,it));for(const u of n){let c=e;for(const r of u){r.y0=c,r.y1=c+r.value*f,c=r.y1+p;for(const m of r.sourceLinks)m.width=m.value*f}c=(a-c+p)/(u.length+1);for(let r=0;r<u.length;++r){const m=u[r];m.y0+=c*(r+1),m.y1+=c*(r+1)}A(u)}}function w(n){const f=$(n);p=Math.min(b,(a-e)/(ct(f,u=>u.length)-1)),F(f);for(let u=0;u<y;++u){const c=Math.pow(.99,u),r=Math.max(1-c,(u+1)/y);B(f,c,r),P(f,c,r)}}function P(n,f,u){for(let c=1,r=n.length;c<r;++c){const m=n[c];for(const S of m){let L=0,R=0;for(const{source:H,value:et}of S.targetLinks){let Y=et*(S.layer-H.layer);L+=z(H,S)*Y,R+=Y}if(!(R>0))continue;let U=(L/R-S.y0)*f;S.y0+=U,S.y1+=U,E(S)}o===void 0&&m.sort(K),O(m,u)}}function B(n,f,u){for(let c=n.length,r=c-2;r>=0;--r){const m=n[r];for(const S of m){let L=0,R=0;for(const{target:H,value:et}of S.sourceLinks){let Y=et*(H.layer-S.layer);L+=I(S,H)*Y,R+=Y}if(!(R>0))continue;let U=(L/R-S.y0)*f;S.y0+=U,S.y1+=U,E(S)}o===void 0&&m.sort(K),O(m,u)}}function O(n,f){const u=n.length>>1,c=n[u];d(n,c.y0-p,u-1,f),D(n,c.y1+p,u+1,f),d(n,a,n.length-1,f),D(n,e,0,f)}function D(n,f,u,c){for(;u<n.length;++u){const r=n[u],m=(f-r.y0)*c;m>1e-6&&(r.y0+=m,r.y1+=m),f=r.y1+p}}function d(n,f,u,c){for(;u>=0;--u){const r=n[u],m=(r.y1-f)*c;m>1e-6&&(r.y0-=m,r.y1-=m),f=r.y0-p}}function E({sourceLinks:n,targetLinks:f}){if(l===void 0){for(const{source:{sourceLinks:u}}of f)u.sort(ht);for(const{target:{targetLinks:u}}of n)u.sort(ut)}}function A(n){if(l===void 0)for(const{sourceLinks:f,targetLinks:u}of n)f.sort(ht),u.sort(ut)}function z(n,f){let u=n.y0-(n.sourceLinks.length-1)*p/2;for(const{target:c,width:r}of n.sourceLinks){if(c===f)break;u+=r+p}for(const{source:c,width:r}of f.targetLinks){if(c===n)break;u-=r}return u}function I(n,f){let u=f.y0-(f.targetLinks.length-1)*p/2;for(const{source:c,width:r}of f.targetLinks){if(c===n)break;u+=r+p}for(const{target:c,width:r}of n.sourceLinks){if(c===f)break;u-=r}return u}return v}var st=Math.PI,rt=2*st,V=1e-6,Ft=rt-V;function ot(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function kt(){return new ot}ot.prototype=kt.prototype={constructor:ot,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,i,a){this._+="Q"+ +t+","+ +e+","+(this._x1=+i)+","+(this._y1=+a)},bezierCurveTo:function(t,e,i,a,h,b){this._+="C"+ +t+","+ +e+","+ +i+","+ +a+","+(this._x1=+h)+","+(this._y1=+b)},arcTo:function(t,e,i,a,h){t=+t,e=+e,i=+i,a=+a,h=+h;var b=this._x1,p=this._y1,k=i-t,s=a-e,o=b-t,l=p-e,_=o*o+l*l;if(h<0)throw new Error("negative radius: "+h);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(_>V)if(!(Math.abs(l*k-s*o)>V)||!h)this._+="L"+(this._x1=t)+","+(this._y1=e);else{var x=i-b,y=a-p,v=k*k+s*s,M=x*x+y*y,T=Math.sqrt(v),N=Math.sqrt(_),C=h*Math.tan((st-Math.acos((v+_-M)/(2*T*N)))/2),$=C/N,F=C/T;Math.abs($-1)>V&&(this._+="L"+(t+$*o)+","+(e+$*l)),this._+="A"+h+","+h+",0,0,"+ +(l*x>o*y)+","+(this._x1=t+F*k)+","+(this._y1=e+F*s)}},arc:function(t,e,i,a,h,b){t=+t,e=+e,i=+i,b=!!b;var p=i*Math.cos(a),k=i*Math.sin(a),s=t+p,o=e+k,l=1^b,_=b?a-h:h-a;if(i<0)throw new Error("negative radius: "+i);this._x1===null?this._+="M"+s+","+o:(Math.abs(this._x1-s)>V||Math.abs(this._y1-o)>V)&&(this._+="L"+s+","+o),i&&(_<0&&(_=_%rt+rt),_>Ft?this._+="A"+i+","+i+",0,1,"+l+","+(t-p)+","+(e-k)+"A"+i+","+i+",0,1,"+l+","+(this._x1=s)+","+(this._y1=o):_>V&&(this._+="A"+i+","+i+",0,"+ +(_>=st)+","+l+","+(this._x1=t+i*Math.cos(h))+","+(this._y1=e+i*Math.sin(h))))},rect:function(t,e,i,a){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +i+"v"+ +a+"h"+-i+"Z"},toString:function(){return this._}};function dt(t){return function(){return t}}function Rt(t){return t[0]}function Vt(t){return t[1]}var Wt=Array.prototype.slice;function Gt(t){return t.source}function Ut(t){return t.target}function Ht(t){var e=Gt,i=Ut,a=Rt,h=Vt,b=null;function p(){var k,s=Wt.call(arguments),o=e.apply(this,s),l=i.apply(this,s);if(b||(b=k=kt()),t(b,+a.apply(this,(s[0]=o,s)),+h.apply(this,s),+a.apply(this,(s[0]=l,s)),+h.apply(this,s)),k)return b=null,k+""||null}return p.source=function(k){return arguments.length?(e=k,p):e},p.target=function(k){return arguments.length?(i=k,p):i},p.x=function(k){return arguments.length?(a=typeof k=="function"?k:dt(+k),p):a},p.y=function(k){return arguments.length?(h=typeof k=="function"?k:dt(+k),p):h},p.context=function(k){return arguments.length?(b=k??null,p):b},p}function Yt(t,e,i,a,h){t.moveTo(e,i),t.bezierCurveTo(e=(e+a)/2,i,e,h,a,h)}function Xt(){return Ht(Yt)}function qt(t){return[t.source.x1,t.y0]}function Kt(t){return[t.target.x0,t.y1]}function Qt(){return Xt().source(qt).target(Kt)}var at=(function(){var t=g(function(k,s,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=s);return o},"o"),e=[1,9],i=[1,10],a=[1,5,10,12],h={trace:g(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:g(function(s,o,l,_,x,y,v){var M=y.length-1;switch(x){case 7:const T=_.findOrCreateNode(y[M-4].trim().replaceAll('""','"')),N=_.findOrCreateNode(y[M-2].trim().replaceAll('""','"')),C=parseFloat(y[M].trim());_.addLink(T,N,C);break;case 8:case 9:case 11:this.$=y[M];break;case 10:this.$=y[M-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:e,20:i},{1:[2,6],7:11,10:[1,12]},t(i,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(a,[2,8]),t(a,[2,9]),{19:[1,16]},t(a,[2,11]),{1:[2,1]},{1:[2,5]},t(i,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:e,20:i},{15:18,16:7,17:8,18:e,20:i},{18:[1,19]},t(i,[2,3]),{12:[1,20]},t(a,[2,10]),{15:21,16:7,17:8,18:e,20:i},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:g(function(s,o){if(o.recoverable)this.trace(s);else{var l=new Error(s);throw l.hash=o,l}},"parseError"),parse:g(function(s){var o=this,l=[0],_=[],x=[null],y=[],v=this.table,M="",T=0,N=0,C=2,$=1,F=y.slice.call(arguments,1),w=Object.create(this.lexer),P={yy:{}};for(var B in this.yy)Object.prototype.hasOwnProperty.call(this.yy,B)&&(P.yy[B]=this.yy[B]);w.setInput(s,P.yy),P.yy.lexer=w,P.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var O=w.yylloc;y.push(O);var D=w.options&&w.options.ranges;typeof P.yy.parseError=="function"?this.parseError=P.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function d(L){l.length=l.length-2*L,x.length=x.length-L,y.length=y.length-L}g(d,"popStack");function E(){var L;return L=_.pop()||w.lex()||$,typeof L!="number"&&(L instanceof Array&&(_=L,L=_.pop()),L=o.symbols_[L]||L),L}g(E,"lex");for(var A,z,I,n,f={},u,c,r,m;;){if(z=l[l.length-1],this.defaultActions[z]?I=this.defaultActions[z]:((A===null||typeof A>"u")&&(A=E()),I=v[z]&&v[z][A]),typeof I>"u"||!I.length||!I[0]){var S="";m=[];for(u in v[z])this.terminals_[u]&&u>C&&m.push("'"+this.terminals_[u]+"'");w.showPosition?S="Parse error on line "+(T+1)+`:
2
2
  `+w.showPosition()+`
3
3
  Expecting `+m.join(", ")+", got '"+(this.terminals_[A]||A)+"'":S="Parse error on line "+(T+1)+": Unexpected "+(A==$?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(S,{text:w.match,token:this.terminals_[A]||A,line:w.yylineno,loc:O,expected:m})}if(I[0]instanceof Array&&I.length>1)throw new Error("Parse Error: multiple actions possible at state: "+z+", token: "+A);switch(I[0]){case 1:l.push(A),x.push(w.yytext),y.push(w.yylloc),l.push(I[1]),A=null,N=w.yyleng,M=w.yytext,T=w.yylineno,O=w.yylloc;break;case 2:if(c=this.productions_[I[1]][1],f.$=x[x.length-c],f._$={first_line:y[y.length-(c||1)].first_line,last_line:y[y.length-1].last_line,first_column:y[y.length-(c||1)].first_column,last_column:y[y.length-1].last_column},D&&(f._$.range=[y[y.length-(c||1)].range[0],y[y.length-1].range[1]]),n=this.performAction.apply(f,[M,N,T,P.yy,I[1],x,y].concat(F)),typeof n<"u")return n;c&&(l=l.slice(0,-1*c*2),x=x.slice(0,-1*c),y=y.slice(0,-1*c)),l.push(this.productions_[I[1]][0]),x.push(f.$),y.push(f._$),r=v[l[l.length-2]][l[l.length-1]],l.push(r);break;case 3:return!0}}return!0},"parse")},b=(function(){var k={EOF:1,parseError:g(function(o,l){if(this.yy.parser)this.yy.parser.parseError(o,l);else throw new Error(o)},"parseError"),setInput:g(function(s,o){return this.yy=o||this.yy||{},this._input=s,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:g(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var o=s.match(/(?:\r\n?|\n).*/g);return o?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:g(function(s){var o=s.length,l=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-o),this.offset-=o;var _=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),l.length-1&&(this.yylineno-=l.length-1);var x=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:l?(l.length===_.length?this.yylloc.first_column:0)+_[_.length-l.length].length-l[0].length:this.yylloc.first_column-o},this.options.ranges&&(this.yylloc.range=[x[0],x[0]+this.yyleng-o]),this.yyleng=this.yytext.length,this},"unput"),more:g(function(){return this._more=!0,this},"more"),reject:g(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
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:g(function(s){this.unput(this.match.slice(s))},"less"),pastInput:g(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:g(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:g(function(){var s=this.pastInput(),o=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
@@ -1,10 +1,10 @@
1
- import{H as p,ao as xt,ap as kt,a7 as vt,a8 as bt,aa as wt,a9 as St,z as lt,av as Et,a5 as X,bh as Lt,au as Mt,ah as At}from"./index-BffUh93D.js";import{h as Tt}from"./ordinal-DfAQgscy-Pc8f3NoK.js";import"./init-DjUOC4st-DHuO7-vr.js";function Pt(t){for(var n=t.length/6|0,r=new Array(n),a=0;a<n;)r[a]="#"+t.slice(a*6,++a*6);return r}const Nt=Pt("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function ct(t,n){let r;if(n===void 0)for(const a of t)a!=null&&(r<a||r===void 0&&a>=a)&&(r=a);else{let a=-1;for(let c of t)(c=n(c,++a,t))!=null&&(r<c||r===void 0&&c>=c)&&(r=c)}return r}function pt(t,n){let r;if(n===void 0)for(const a of t)a!=null&&(r>a||r===void 0&&a>=a)&&(r=a);else{let a=-1;for(let c of t)(c=n(c,++a,t))!=null&&(r>c||r===void 0&&c>=c)&&(r=c)}return r}function tt(t,n){let r=0;if(n===void 0)for(let a of t)(a=+a)&&(r+=a);else{let a=-1;for(let c of t)(c=+n(c,++a,t))&&(r+=c)}return r}function Ot(t){return t.target.depth}function Ct(t){return t.depth}function Dt(t,n){return n-1-t.height}function _t(t,n){return t.sourceLinks.length?t.depth:n-1}function It(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?pt(t.sourceLinks,Ot)-1:0}function Z(t){return function(){return t}}function ht(t,n){return q(t.source,n.source)||t.index-n.index}function ut(t,n){return q(t.target,n.target)||t.index-n.index}function q(t,n){return t.y0-n.y0}function et(t){return t.value}function $t(t){return t.index}function jt(t){return t.nodes}function zt(t){return t.links}function ft(t,n){const r=t.get(n);if(!r)throw new Error("missing: "+n);return r}function yt({nodes:t}){for(const n of t){let r=n.y0,a=r;for(const c of n.sourceLinks)c.y0=r+c.width/2,r+=c.width;for(const c of n.targetLinks)c.y1=a+c.width/2,a+=c.width}}function Ft(){let t=0,n=0,r=1,a=1,c=24,k=8,_,m=$t,i=_t,o,f,d=jt,y=zt,w=6;function v(){const e={nodes:d.apply(null,arguments),links:y.apply(null,arguments)};return N(e),A(e),T(e),D(e),O(e),yt(e),e}v.update=function(e){return yt(e),e},v.nodeId=function(e){return arguments.length?(m=typeof e=="function"?e:Z(e),v):m},v.nodeAlign=function(e){return arguments.length?(i=typeof e=="function"?e:Z(e),v):i},v.nodeSort=function(e){return arguments.length?(o=e,v):o},v.nodeWidth=function(e){return arguments.length?(c=+e,v):c},v.nodePadding=function(e){return arguments.length?(k=_=+e,v):k},v.nodes=function(e){return arguments.length?(d=typeof e=="function"?e:Z(e),v):d},v.links=function(e){return arguments.length?(y=typeof e=="function"?e:Z(e),v):y},v.linkSort=function(e){return arguments.length?(f=e,v):f},v.size=function(e){return arguments.length?(t=n=0,r=+e[0],a=+e[1],v):[r-t,a-n]},v.extent=function(e){return arguments.length?(t=+e[0][0],r=+e[1][0],n=+e[0][1],a=+e[1][1],v):[[t,n],[r,a]]},v.iterations=function(e){return arguments.length?(w=+e,v):w};function N({nodes:e,links:u}){for(const[h,s]of e.entries())s.index=h,s.sourceLinks=[],s.targetLinks=[];const l=new Map(e.map((h,s)=>[m(h,s,e),h]));for(const[h,s]of u.entries()){s.index=h;let{source:x,target:b}=s;typeof x!="object"&&(x=s.source=ft(l,x)),typeof b!="object"&&(b=s.target=ft(l,b)),x.sourceLinks.push(s),b.targetLinks.push(s)}if(f!=null)for(const{sourceLinks:h,targetLinks:s}of e)h.sort(f),s.sort(f)}function A({nodes:e}){for(const u of e)u.value=u.fixedValue===void 0?Math.max(tt(u.sourceLinks,et),tt(u.targetLinks,et)):u.fixedValue}function T({nodes:e}){const u=e.length;let l=new Set(e),h=new Set,s=0;for(;l.size;){for(const x of l){x.depth=s;for(const{target:b}of x.sourceLinks)h.add(b)}if(++s>u)throw new Error("circular link");l=h,h=new Set}}function D({nodes:e}){const u=e.length;let l=new Set(e),h=new Set,s=0;for(;l.size;){for(const x of l){x.height=s;for(const{source:b}of x.targetLinks)h.add(b)}if(++s>u)throw new Error("circular link");l=h,h=new Set}}function P({nodes:e}){const u=ct(e,s=>s.depth)+1,l=(r-t-c)/(u-1),h=new Array(u);for(const s of e){const x=Math.max(0,Math.min(u-1,Math.floor(i.call(null,s,u))));s.layer=x,s.x0=t+x*l,s.x1=s.x0+c,h[x]?h[x].push(s):h[x]=[s]}if(o)for(const s of h)s.sort(o);return h}function S(e){const u=pt(e,l=>(a-n-(l.length-1)*_)/tt(l,et));for(const l of e){let h=n;for(const s of l){s.y0=h,s.y1=h+s.value*u,h=s.y1+_;for(const x of s.sourceLinks)x.width=x.value*u}h=(a-h+_)/(l.length+1);for(let s=0;s<l.length;++s){const x=l[s];x.y0+=h*(s+1),x.y1+=h*(s+1)}$(l)}}function O(e){const u=P(e);_=Math.min(k,(a-n)/(ct(u,l=>l.length)-1)),S(u);for(let l=0;l<w;++l){const h=Math.pow(.99,l),s=Math.max(1-h,(l+1)/w);C(u,h,s),I(u,h,s)}}function I(e,u,l){for(let h=1,s=e.length;h<s;++h){const x=e[h];for(const b of x){let W=0,j=0;for(const{source:Y,value:J}of b.targetLinks){let Q=J*(b.layer-Y.layer);W+=M(Y,b)*Q,j+=Q}if(!(j>0))continue;let V=(W/j-b.y0)*u;b.y0+=V,b.y1+=V,E(b)}o===void 0&&x.sort(q),g(x,l)}}function C(e,u,l){for(let h=e.length,s=h-2;s>=0;--s){const x=e[s];for(const b of x){let W=0,j=0;for(const{target:Y,value:J}of b.sourceLinks){let Q=J*(Y.layer-b.layer);W+=G(b,Y)*Q,j+=Q}if(!(j>0))continue;let V=(W/j-b.y0)*u;b.y0+=V,b.y1+=V,E(b)}o===void 0&&x.sort(q),g(x,l)}}function g(e,u){const l=e.length>>1,h=e[l];U(e,h.y0-_,l-1,u),L(e,h.y1+_,l+1,u),U(e,a,e.length-1,u),L(e,n,0,u)}function L(e,u,l,h){for(;l<e.length;++l){const s=e[l],x=(u-s.y0)*h;x>1e-6&&(s.y0+=x,s.y1+=x),u=s.y1+_}}function U(e,u,l,h){for(;l>=0;--l){const s=e[l],x=(s.y1-u)*h;x>1e-6&&(s.y0-=x,s.y1-=x),u=s.y0-_}}function E({sourceLinks:e,targetLinks:u}){if(f===void 0){for(const{source:{sourceLinks:l}}of u)l.sort(ut);for(const{target:{targetLinks:l}}of e)l.sort(ht)}}function $(e){if(f===void 0)for(const{sourceLinks:u,targetLinks:l}of e)u.sort(ut),l.sort(ht)}function M(e,u){let l=e.y0-(e.sourceLinks.length-1)*_/2;for(const{target:h,width:s}of e.sourceLinks){if(h===u)break;l+=s+_}for(const{source:h,width:s}of u.targetLinks){if(h===e)break;l-=s}return l}function G(e,u){let l=u.y0-(u.targetLinks.length-1)*_/2;for(const{source:h,width:s}of u.targetLinks){if(h===e)break;l+=s+_}for(const{target:h,width:s}of e.sourceLinks){if(h===u)break;l-=s}return l}return v}var rt=Math.PI,st=2*rt,z=1e-6,Ut=st-z;function ot(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function mt(){return new ot}ot.prototype=mt.prototype={constructor:ot,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,r,a){this._+="Q"+ +t+","+ +n+","+(this._x1=+r)+","+(this._y1=+a)},bezierCurveTo:function(t,n,r,a,c,k){this._+="C"+ +t+","+ +n+","+ +r+","+ +a+","+(this._x1=+c)+","+(this._y1=+k)},arcTo:function(t,n,r,a,c){t=+t,n=+n,r=+r,a=+a,c=+c;var k=this._x1,_=this._y1,m=r-t,i=a-n,o=k-t,f=_-n,d=o*o+f*f;if(c<0)throw new Error("negative radius: "+c);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(d>z)if(!(Math.abs(f*m-i*o)>z)||!c)this._+="L"+(this._x1=t)+","+(this._y1=n);else{var y=r-k,w=a-_,v=m*m+i*i,N=y*y+w*w,A=Math.sqrt(v),T=Math.sqrt(d),D=c*Math.tan((rt-Math.acos((v+d-N)/(2*A*T)))/2),P=D/T,S=D/A;Math.abs(P-1)>z&&(this._+="L"+(t+P*o)+","+(n+P*f)),this._+="A"+c+","+c+",0,0,"+ +(f*y>o*w)+","+(this._x1=t+S*m)+","+(this._y1=n+S*i)}},arc:function(t,n,r,a,c,k){t=+t,n=+n,r=+r,k=!!k;var _=r*Math.cos(a),m=r*Math.sin(a),i=t+_,o=n+m,f=1^k,d=k?a-c:c-a;if(r<0)throw new Error("negative radius: "+r);this._x1===null?this._+="M"+i+","+o:(Math.abs(this._x1-i)>z||Math.abs(this._y1-o)>z)&&(this._+="L"+i+","+o),r&&(d<0&&(d=d%st+st),d>Ut?this._+="A"+r+","+r+",0,1,"+f+","+(t-_)+","+(n-m)+"A"+r+","+r+",0,1,"+f+","+(this._x1=i)+","+(this._y1=o):d>z&&(this._+="A"+r+","+r+",0,"+ +(d>=rt)+","+f+","+(this._x1=t+r*Math.cos(c))+","+(this._y1=n+r*Math.sin(c))))},rect:function(t,n,r,a){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +r+"v"+ +a+"h"+-r+"Z"},toString:function(){return this._}};function gt(t){return function(){return t}}function Gt(t){return t[0]}function Wt(t){return t[1]}var Vt=Array.prototype.slice;function Yt(t){return t.source}function Qt(t){return t.target}function Xt(t){var n=Yt,r=Qt,a=Gt,c=Wt,k=null;function _(){var m,i=Vt.call(arguments),o=n.apply(this,i),f=r.apply(this,i);if(k||(k=m=mt()),t(k,+a.apply(this,(i[0]=o,i)),+c.apply(this,i),+a.apply(this,(i[0]=f,i)),+c.apply(this,i)),m)return k=null,m+""||null}return _.source=function(m){return arguments.length?(n=m,_):n},_.target=function(m){return arguments.length?(r=m,_):r},_.x=function(m){return arguments.length?(a=typeof m=="function"?m:gt(+m),_):a},_.y=function(m){return arguments.length?(c=typeof m=="function"?m:gt(+m),_):c},_.context=function(m){return arguments.length?(k=m??null,_):k},_}function Zt(t,n,r,a,c){t.moveTo(n,r),t.bezierCurveTo(n=(n+a)/2,r,n,c,a,c)}function qt(){return Xt(Zt)}function Kt(t){return[t.source.x1,t.y0]}function Rt(t){return[t.target.x0,t.y1]}function Ht(){return qt().source(Kt).target(Rt)}var at=(function(){var t=p(function(m,i,o,f){for(o=o||{},f=m.length;f--;o[m[f]]=i);return o},"o"),n=[1,9],r=[1,10],a=[1,5,10,12],c={trace:p(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:p(function(m,i,o,f,d,y,w){var v=y.length-1;switch(d){case 7:const N=f.findOrCreateNode(y[v-4].trim().replaceAll('""','"')),A=f.findOrCreateNode(y[v-2].trim().replaceAll('""','"')),T=parseFloat(y[v].trim());f.addLink(N,A,T);break;case 8:case 9:case 11:this.$=y[v];break;case 10:this.$=y[v-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:n,20:r},{1:[2,6],7:11,10:[1,12]},t(r,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(a,[2,8]),t(a,[2,9]),{19:[1,16]},t(a,[2,11]),{1:[2,1]},{1:[2,5]},t(r,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:r},{15:18,16:7,17:8,18:n,20:r},{18:[1,19]},t(r,[2,3]),{12:[1,20]},t(a,[2,10]),{15:21,16:7,17:8,18:n,20:r},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:p(function(m,i){if(i.recoverable)this.trace(m);else{var o=new Error(m);throw o.hash=i,o}},"parseError"),parse:p(function(m){var i=this,o=[0],f=[],d=[null],y=[],w=this.table,v="",N=0,A=0,T=2,D=1,P=y.slice.call(arguments,1),S=Object.create(this.lexer),O={yy:{}};for(var I in this.yy)Object.prototype.hasOwnProperty.call(this.yy,I)&&(O.yy[I]=this.yy[I]);S.setInput(m,O.yy),O.yy.lexer=S,O.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var C=S.yylloc;y.push(C);var g=S.options&&S.options.ranges;typeof O.yy.parseError=="function"?this.parseError=O.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function L(b){o.length=o.length-2*b,d.length=d.length-b,y.length=y.length-b}p(L,"popStack");function U(){var b;return b=f.pop()||S.lex()||D,typeof b!="number"&&(b instanceof Array&&(f=b,b=f.pop()),b=i.symbols_[b]||b),b}p(U,"lex");for(var E,$,M,G,e={},u,l,h,s;;){if($=o[o.length-1],this.defaultActions[$]?M=this.defaultActions[$]:((E===null||typeof E>"u")&&(E=U()),M=w[$]&&w[$][E]),typeof M>"u"||!M.length||!M[0]){var x="";s=[];for(u in w[$])this.terminals_[u]&&u>T&&s.push("'"+this.terminals_[u]+"'");S.showPosition?x="Parse error on line "+(N+1)+`:
1
+ import{H as d,ao as xt,ap as kt,a7 as vt,a8 as bt,aa as wt,a9 as St,b as lt,av as Et,a5 as Y,bh as Lt,au as Mt,ah as At}from"./index-Ct8vAKMN.js";import{h as Tt}from"./ordinal-B6-f3MAq-Pc8f3NoK.js";import"./init-DjUOC4st-DHuO7-vr.js";function Ct(t){for(var n=t.length/6|0,r=new Array(n),a=0;a<n;)r[a]="#"+t.slice(a*6,++a*6);return r}const Pt=Ct("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function ct(t,n){let r;if(n===void 0)for(const a of t)a!=null&&(r<a||r===void 0&&a>=a)&&(r=a);else{let a=-1;for(let c of t)(c=n(c,++a,t))!=null&&(r<c||r===void 0&&c>=c)&&(r=c)}return r}function dt(t,n){let r;if(n===void 0)for(const a of t)a!=null&&(r>a||r===void 0&&a>=a)&&(r=a);else{let a=-1;for(let c of t)(c=n(c,++a,t))!=null&&(r>c||r===void 0&&c>=c)&&(r=c)}return r}function tt(t,n){let r=0;if(n===void 0)for(let a of t)(a=+a)&&(r+=a);else{let a=-1;for(let c of t)(c=+n(c,++a,t))&&(r+=c)}return r}function Nt(t){return t.target.depth}function Ot(t){return t.depth}function Dt(t,n){return n-1-t.height}function _t(t,n){return t.sourceLinks.length?t.depth:n-1}function It(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?dt(t.sourceLinks,Nt)-1:0}function Z(t){return function(){return t}}function ht(t,n){return q(t.source,n.source)||t.index-n.index}function ut(t,n){return q(t.target,n.target)||t.index-n.index}function q(t,n){return t.y0-n.y0}function et(t){return t.value}function $t(t){return t.index}function jt(t){return t.nodes}function zt(t){return t.links}function ft(t,n){const r=t.get(n);if(!r)throw new Error("missing: "+n);return r}function yt({nodes:t}){for(const n of t){let r=n.y0,a=r;for(const c of n.sourceLinks)c.y0=r+c.width/2,r+=c.width;for(const c of n.targetLinks)c.y1=a+c.width/2,a+=c.width}}function Ft(){let t=0,n=0,r=1,a=1,c=24,b=8,_,m=$t,i=_t,o,f,p=jt,y=zt,w=6;function k(){const e={nodes:p.apply(null,arguments),links:y.apply(null,arguments)};return P(e),A(e),T(e),D(e),N(e),yt(e),e}k.update=function(e){return yt(e),e},k.nodeId=function(e){return arguments.length?(m=typeof e=="function"?e:Z(e),k):m},k.nodeAlign=function(e){return arguments.length?(i=typeof e=="function"?e:Z(e),k):i},k.nodeSort=function(e){return arguments.length?(o=e,k):o},k.nodeWidth=function(e){return arguments.length?(c=+e,k):c},k.nodePadding=function(e){return arguments.length?(b=_=+e,k):b},k.nodes=function(e){return arguments.length?(p=typeof e=="function"?e:Z(e),k):p},k.links=function(e){return arguments.length?(y=typeof e=="function"?e:Z(e),k):y},k.linkSort=function(e){return arguments.length?(f=e,k):f},k.size=function(e){return arguments.length?(t=n=0,r=+e[0],a=+e[1],k):[r-t,a-n]},k.extent=function(e){return arguments.length?(t=+e[0][0],r=+e[1][0],n=+e[0][1],a=+e[1][1],k):[[t,n],[r,a]]},k.iterations=function(e){return arguments.length?(w=+e,k):w};function P({nodes:e,links:u}){for(const[h,s]of e.entries())s.index=h,s.sourceLinks=[],s.targetLinks=[];const l=new Map(e.map((h,s)=>[m(h,s,e),h]));for(const[h,s]of u.entries()){s.index=h;let{source:x,target:v}=s;typeof x!="object"&&(x=s.source=ft(l,x)),typeof v!="object"&&(v=s.target=ft(l,v)),x.sourceLinks.push(s),v.targetLinks.push(s)}if(f!=null)for(const{sourceLinks:h,targetLinks:s}of e)h.sort(f),s.sort(f)}function A({nodes:e}){for(const u of e)u.value=u.fixedValue===void 0?Math.max(tt(u.sourceLinks,et),tt(u.targetLinks,et)):u.fixedValue}function T({nodes:e}){const u=e.length;let l=new Set(e),h=new Set,s=0;for(;l.size;){for(const x of l){x.depth=s;for(const{target:v}of x.sourceLinks)h.add(v)}if(++s>u)throw new Error("circular link");l=h,h=new Set}}function D({nodes:e}){const u=e.length;let l=new Set(e),h=new Set,s=0;for(;l.size;){for(const x of l){x.height=s;for(const{source:v}of x.targetLinks)h.add(v)}if(++s>u)throw new Error("circular link");l=h,h=new Set}}function C({nodes:e}){const u=ct(e,s=>s.depth)+1,l=(r-t-c)/(u-1),h=new Array(u);for(const s of e){const x=Math.max(0,Math.min(u-1,Math.floor(i.call(null,s,u))));s.layer=x,s.x0=t+x*l,s.x1=s.x0+c,h[x]?h[x].push(s):h[x]=[s]}if(o)for(const s of h)s.sort(o);return h}function S(e){const u=dt(e,l=>(a-n-(l.length-1)*_)/tt(l,et));for(const l of e){let h=n;for(const s of l){s.y0=h,s.y1=h+s.value*u,h=s.y1+_;for(const x of s.sourceLinks)x.width=x.value*u}h=(a-h+_)/(l.length+1);for(let s=0;s<l.length;++s){const x=l[s];x.y0+=h*(s+1),x.y1+=h*(s+1)}$(l)}}function N(e){const u=C(e);_=Math.min(b,(a-n)/(ct(u,l=>l.length)-1)),S(u);for(let l=0;l<w;++l){const h=Math.pow(.99,l),s=Math.max(1-h,(l+1)/w);O(u,h,s),I(u,h,s)}}function I(e,u,l){for(let h=1,s=e.length;h<s;++h){const x=e[h];for(const v of x){let G=0,j=0;for(const{source:V,value:J}of v.targetLinks){let X=J*(v.layer-V.layer);G+=M(V,v)*X,j+=X}if(!(j>0))continue;let Q=(G/j-v.y0)*u;v.y0+=Q,v.y1+=Q,E(v)}o===void 0&&x.sort(q),g(x,l)}}function O(e,u,l){for(let h=e.length,s=h-2;s>=0;--s){const x=e[s];for(const v of x){let G=0,j=0;for(const{target:V,value:J}of v.sourceLinks){let X=J*(V.layer-v.layer);G+=W(v,V)*X,j+=X}if(!(j>0))continue;let Q=(G/j-v.y0)*u;v.y0+=Q,v.y1+=Q,E(v)}o===void 0&&x.sort(q),g(x,l)}}function g(e,u){const l=e.length>>1,h=e[l];U(e,h.y0-_,l-1,u),L(e,h.y1+_,l+1,u),U(e,a,e.length-1,u),L(e,n,0,u)}function L(e,u,l,h){for(;l<e.length;++l){const s=e[l],x=(u-s.y0)*h;x>1e-6&&(s.y0+=x,s.y1+=x),u=s.y1+_}}function U(e,u,l,h){for(;l>=0;--l){const s=e[l],x=(s.y1-u)*h;x>1e-6&&(s.y0-=x,s.y1-=x),u=s.y0-_}}function E({sourceLinks:e,targetLinks:u}){if(f===void 0){for(const{source:{sourceLinks:l}}of u)l.sort(ut);for(const{target:{targetLinks:l}}of e)l.sort(ht)}}function $(e){if(f===void 0)for(const{sourceLinks:u,targetLinks:l}of e)u.sort(ut),l.sort(ht)}function M(e,u){let l=e.y0-(e.sourceLinks.length-1)*_/2;for(const{target:h,width:s}of e.sourceLinks){if(h===u)break;l+=s+_}for(const{source:h,width:s}of u.targetLinks){if(h===e)break;l-=s}return l}function W(e,u){let l=u.y0-(u.targetLinks.length-1)*_/2;for(const{source:h,width:s}of u.targetLinks){if(h===e)break;l+=s+_}for(const{target:h,width:s}of e.sourceLinks){if(h===u)break;l-=s}return l}return k}var rt=Math.PI,st=2*rt,z=1e-6,Ut=st-z;function ot(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function mt(){return new ot}ot.prototype=mt.prototype={constructor:ot,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,r,a){this._+="Q"+ +t+","+ +n+","+(this._x1=+r)+","+(this._y1=+a)},bezierCurveTo:function(t,n,r,a,c,b){this._+="C"+ +t+","+ +n+","+ +r+","+ +a+","+(this._x1=+c)+","+(this._y1=+b)},arcTo:function(t,n,r,a,c){t=+t,n=+n,r=+r,a=+a,c=+c;var b=this._x1,_=this._y1,m=r-t,i=a-n,o=b-t,f=_-n,p=o*o+f*f;if(c<0)throw new Error("negative radius: "+c);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(p>z)if(!(Math.abs(f*m-i*o)>z)||!c)this._+="L"+(this._x1=t)+","+(this._y1=n);else{var y=r-b,w=a-_,k=m*m+i*i,P=y*y+w*w,A=Math.sqrt(k),T=Math.sqrt(p),D=c*Math.tan((rt-Math.acos((k+p-P)/(2*A*T)))/2),C=D/T,S=D/A;Math.abs(C-1)>z&&(this._+="L"+(t+C*o)+","+(n+C*f)),this._+="A"+c+","+c+",0,0,"+ +(f*y>o*w)+","+(this._x1=t+S*m)+","+(this._y1=n+S*i)}},arc:function(t,n,r,a,c,b){t=+t,n=+n,r=+r,b=!!b;var _=r*Math.cos(a),m=r*Math.sin(a),i=t+_,o=n+m,f=1^b,p=b?a-c:c-a;if(r<0)throw new Error("negative radius: "+r);this._x1===null?this._+="M"+i+","+o:(Math.abs(this._x1-i)>z||Math.abs(this._y1-o)>z)&&(this._+="L"+i+","+o),r&&(p<0&&(p=p%st+st),p>Ut?this._+="A"+r+","+r+",0,1,"+f+","+(t-_)+","+(n-m)+"A"+r+","+r+",0,1,"+f+","+(this._x1=i)+","+(this._y1=o):p>z&&(this._+="A"+r+","+r+",0,"+ +(p>=rt)+","+f+","+(this._x1=t+r*Math.cos(c))+","+(this._y1=n+r*Math.sin(c))))},rect:function(t,n,r,a){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +r+"v"+ +a+"h"+-r+"Z"},toString:function(){return this._}};function gt(t){return function(){return t}}function Wt(t){return t[0]}function Gt(t){return t[1]}var Qt=Array.prototype.slice;function Vt(t){return t.source}function Xt(t){return t.target}function Yt(t){var n=Vt,r=Xt,a=Wt,c=Gt,b=null;function _(){var m,i=Qt.call(arguments),o=n.apply(this,i),f=r.apply(this,i);if(b||(b=m=mt()),t(b,+a.apply(this,(i[0]=o,i)),+c.apply(this,i),+a.apply(this,(i[0]=f,i)),+c.apply(this,i)),m)return b=null,m+""||null}return _.source=function(m){return arguments.length?(n=m,_):n},_.target=function(m){return arguments.length?(r=m,_):r},_.x=function(m){return arguments.length?(a=typeof m=="function"?m:gt(+m),_):a},_.y=function(m){return arguments.length?(c=typeof m=="function"?m:gt(+m),_):c},_.context=function(m){return arguments.length?(b=m??null,_):b},_}function Zt(t,n,r,a,c){t.moveTo(n,r),t.bezierCurveTo(n=(n+a)/2,r,n,c,a,c)}function qt(){return Yt(Zt)}function Ht(t){return[t.source.x1,t.y0]}function Kt(t){return[t.target.x0,t.y1]}function Rt(){return qt().source(Ht).target(Kt)}var at=(function(){var t=d(function(m,i,o,f){for(o=o||{},f=m.length;f--;o[m[f]]=i);return o},"o"),n=[1,9],r=[1,10],a=[1,5,10,12],c={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:d(function(m,i,o,f,p,y,w){var k=y.length-1;switch(p){case 7:const P=f.findOrCreateNode(y[k-4].trim().replaceAll('""','"')),A=f.findOrCreateNode(y[k-2].trim().replaceAll('""','"')),T=parseFloat(y[k].trim());f.addLink(P,A,T);break;case 8:case 9:case 11:this.$=y[k];break;case 10:this.$=y[k-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:n,20:r},{1:[2,6],7:11,10:[1,12]},t(r,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(a,[2,8]),t(a,[2,9]),{19:[1,16]},t(a,[2,11]),{1:[2,1]},{1:[2,5]},t(r,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:r},{15:18,16:7,17:8,18:n,20:r},{18:[1,19]},t(r,[2,3]),{12:[1,20]},t(a,[2,10]),{15:21,16:7,17:8,18:n,20:r},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:d(function(m,i){if(i.recoverable)this.trace(m);else{var o=new Error(m);throw o.hash=i,o}},"parseError"),parse:d(function(m){var i=this,o=[0],f=[],p=[null],y=[],w=this.table,k="",P=0,A=0,T=2,D=1,C=y.slice.call(arguments,1),S=Object.create(this.lexer),N={yy:{}};for(var I in this.yy)Object.prototype.hasOwnProperty.call(this.yy,I)&&(N.yy[I]=this.yy[I]);S.setInput(m,N.yy),N.yy.lexer=S,N.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var O=S.yylloc;y.push(O);var g=S.options&&S.options.ranges;typeof N.yy.parseError=="function"?this.parseError=N.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function L(v){o.length=o.length-2*v,p.length=p.length-v,y.length=y.length-v}d(L,"popStack");function U(){var v;return v=f.pop()||S.lex()||D,typeof v!="number"&&(v instanceof Array&&(f=v,v=f.pop()),v=i.symbols_[v]||v),v}d(U,"lex");for(var E,$,M,W,e={},u,l,h,s;;){if($=o[o.length-1],this.defaultActions[$]?M=this.defaultActions[$]:((E===null||typeof E>"u")&&(E=U()),M=w[$]&&w[$][E]),typeof M>"u"||!M.length||!M[0]){var x="";s=[];for(u in w[$])this.terminals_[u]&&u>T&&s.push("'"+this.terminals_[u]+"'");S.showPosition?x="Parse error on line "+(P+1)+`:
2
2
  `+S.showPosition()+`
3
- Expecting `+s.join(", ")+", got '"+(this.terminals_[E]||E)+"'":x="Parse error on line "+(N+1)+": Unexpected "+(E==D?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(x,{text:S.match,token:this.terminals_[E]||E,line:S.yylineno,loc:C,expected:s})}if(M[0]instanceof Array&&M.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+E);switch(M[0]){case 1:o.push(E),d.push(S.yytext),y.push(S.yylloc),o.push(M[1]),E=null,A=S.yyleng,v=S.yytext,N=S.yylineno,C=S.yylloc;break;case 2:if(l=this.productions_[M[1]][1],e.$=d[d.length-l],e._$={first_line:y[y.length-(l||1)].first_line,last_line:y[y.length-1].last_line,first_column:y[y.length-(l||1)].first_column,last_column:y[y.length-1].last_column},g&&(e._$.range=[y[y.length-(l||1)].range[0],y[y.length-1].range[1]]),G=this.performAction.apply(e,[v,A,N,O.yy,M[1],d,y].concat(P)),typeof G<"u")return G;l&&(o=o.slice(0,-1*l*2),d=d.slice(0,-1*l),y=y.slice(0,-1*l)),o.push(this.productions_[M[1]][0]),d.push(e.$),y.push(e._$),h=w[o[o.length-2]][o[o.length-1]],o.push(h);break;case 3:return!0}}return!0},"parse")},k=(function(){var m={EOF:1,parseError:p(function(i,o){if(this.yy.parser)this.yy.parser.parseError(i,o);else throw new Error(i)},"parseError"),setInput:p(function(i,o){return this.yy=o||this.yy||{},this._input=i,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:p(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var o=i.match(/(?:\r\n?|\n).*/g);return o?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},"input"),unput:p(function(i){var o=i.length,f=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-o),this.offset-=o;var d=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),f.length-1&&(this.yylineno-=f.length-1);var y=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:f?(f.length===d.length?this.yylloc.first_column:0)+d[d.length-f.length].length-f[0].length:this.yylloc.first_column-o},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-o]),this.yyleng=this.yytext.length,this},"unput"),more:p(function(){return this._more=!0,this},"more"),reject:p(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:p(function(i){this.unput(this.match.slice(i))},"less"),pastInput:p(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:p(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:p(function(){var i=this.pastInput(),o=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
5
- `+o+"^"},"showPosition"),test_match:p(function(i,o){var f,d,y;if(this.options.backtrack_lexer&&(y={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&&(y.yylloc.range=this.yylloc.range.slice(0))),d=i[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,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(i[0].length),this.matched+=i[0],f=this.performAction.call(this,this.yy,this,o,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),f)return f;if(this._backtrack){for(var w in y)this[w]=y[w];return!1}return!1},"test_match"),next:p(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var i,o,f,d;this._more||(this.yytext="",this.match="");for(var y=this._currentRules(),w=0;w<y.length;w++)if(f=this._input.match(this.rules[y[w]]),f&&(!o||f[0].length>o[0].length)){if(o=f,d=w,this.options.backtrack_lexer){if(i=this.test_match(f,y[w]),i!==!1)return i;if(this._backtrack){o=!1;continue}else return!1}else if(!this.options.flex)break}return o?(i=this.test_match(o,y[d]),i!==!1?i:!1):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:p(function(){var i=this.next();return i||this.lex()},"lex"),begin:p(function(i){this.conditionStack.push(i)},"begin"),popState:p(function(){var i=this.conditionStack.length-1;return i>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:p(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:p(function(i){return i=this.conditionStack.length-1-Math.abs(i||0),i>=0?this.conditionStack[i]:"INITIAL"},"topState"),pushState:p(function(i){this.begin(i)},"pushState"),stateStackSize:p(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:p(function(i,o,f,d){switch(f){case 0:return this.pushState("csv"),4;case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return m})();c.lexer=k;function _(){this.yy={}}return p(_,"Parser"),_.prototype=c,c.Parser=_,new _})();at.parser=at;var K=at,H=[],B=[],R=new Map,Bt=p(()=>{H=[],B=[],R=new Map,Mt()},"clear"),nt,Jt=(nt=class{constructor(t,n,r=0){this.source=t,this.target=n,this.value=r}},p(nt,"SankeyLink"),nt),te=p((t,n,r)=>{H.push(new Jt(t,n,r))},"addLink"),it,ee=(it=class{constructor(t){this.ID=t}},p(it,"SankeyNode"),it),ne=p(t=>{t=At.sanitizeText(t,lt());let n=R.get(t);return n===void 0&&(n=new ee(t),R.set(t,n),B.push(n)),n},"findOrCreateNode"),ie=p(()=>B,"getNodes"),re=p(()=>H,"getLinks"),se=p(()=>({nodes:B.map(t=>({id:t.ID})),links:H.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),oe={nodesMap:R,getConfig:p(()=>lt().sankey,"getConfig"),getNodes:ie,getLinks:re,getGraph:se,addLink:te,findOrCreateNode:ne,getAccTitle:St,setAccTitle:wt,getAccDescription:bt,setAccDescription:vt,getDiagramTitle:kt,setDiagramTitle:xt,clear:Bt},F,dt=(F=class{static next(t){return new F(t+ ++F.count)}constructor(t){this.id=t,this.href=`#${t}`}toString(){return"url("+this.href+")"}},p(F,"Uid"),F.count=0,F),ae={left:Ct,right:Dt,center:It,justify:_t},le=p(function(t,n,r,a){const{securityLevel:c,sankey:k}=lt(),_=Et.sankey;let m;c==="sandbox"&&(m=X("#i"+n));const i=c==="sandbox"?X(m.nodes()[0].contentDocument.body):X("body"),o=c==="sandbox"?i.select(`[id="${n}"]`):X(`[id="${n}"]`),f=k?.width??_.width,d=k?.height??_.width,y=k?.useMaxWidth??_.useMaxWidth,w=k?.nodeAlignment??_.nodeAlignment,v=k?.prefix??_.prefix,N=k?.suffix??_.suffix,A=k?.showValues??_.showValues,T=a.db.getGraph(),D=ae[w];Ft().nodeId(g=>g.id).nodeWidth(10).nodePadding(10+(A?15:0)).nodeAlign(D).extent([[0,0],[f,d]])(T);const P=Tt(Nt);o.append("g").attr("class","nodes").selectAll(".node").data(T.nodes).join("g").attr("class","node").attr("id",g=>(g.uid=dt.next("node-")).id).attr("transform",function(g){return"translate("+g.x0+","+g.y0+")"}).attr("x",g=>g.x0).attr("y",g=>g.y0).append("rect").attr("height",g=>g.y1-g.y0).attr("width",g=>g.x1-g.x0).attr("fill",g=>P(g.id));const S=p(({id:g,value:L})=>A?`${g}
7
- ${v}${Math.round(L*100)/100}${N}`:g,"getText");o.append("g").attr("class","node-labels").attr("font-size",14).selectAll("text").data(T.nodes).join("text").attr("x",g=>g.x0<f/2?g.x1+6:g.x0-6).attr("y",g=>(g.y1+g.y0)/2).attr("dy",`${A?"0":"0.35"}em`).attr("text-anchor",g=>g.x0<f/2?"start":"end").text(S);const O=o.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(T.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),I=k?.linkColor??"gradient";if(I==="gradient"){const g=O.append("linearGradient").attr("id",L=>(L.uid=dt.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",L=>L.source.x1).attr("x2",L=>L.target.x0);g.append("stop").attr("offset","0%").attr("stop-color",L=>P(L.source.id)),g.append("stop").attr("offset","100%").attr("stop-color",L=>P(L.target.id))}let C;switch(I){case"gradient":C=p(g=>g.uid,"coloring");break;case"source":C=p(g=>P(g.source.id),"coloring");break;case"target":C=p(g=>P(g.target.id),"coloring");break;default:C=I}O.append("path").attr("d",Ht()).attr("stroke",C).attr("stroke-width",g=>Math.max(1,g.width)),Lt(void 0,o,0,y)},"draw"),ce={draw:le},he=p(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,`
8
- `).trim(),"prepareTextForParsing"),ue=p(t=>`.label {
3
+ Expecting `+s.join(", ")+", got '"+(this.terminals_[E]||E)+"'":x="Parse error on line "+(P+1)+": Unexpected "+(E==D?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(x,{text:S.match,token:this.terminals_[E]||E,line:S.yylineno,loc:O,expected:s})}if(M[0]instanceof Array&&M.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+E);switch(M[0]){case 1:o.push(E),p.push(S.yytext),y.push(S.yylloc),o.push(M[1]),E=null,A=S.yyleng,k=S.yytext,P=S.yylineno,O=S.yylloc;break;case 2:if(l=this.productions_[M[1]][1],e.$=p[p.length-l],e._$={first_line:y[y.length-(l||1)].first_line,last_line:y[y.length-1].last_line,first_column:y[y.length-(l||1)].first_column,last_column:y[y.length-1].last_column},g&&(e._$.range=[y[y.length-(l||1)].range[0],y[y.length-1].range[1]]),W=this.performAction.apply(e,[k,A,P,N.yy,M[1],p,y].concat(C)),typeof W<"u")return W;l&&(o=o.slice(0,-1*l*2),p=p.slice(0,-1*l),y=y.slice(0,-1*l)),o.push(this.productions_[M[1]][0]),p.push(e.$),y.push(e._$),h=w[o[o.length-2]][o[o.length-1]],o.push(h);break;case 3:return!0}}return!0},"parse")},b=(function(){var m={EOF:1,parseError:d(function(i,o){if(this.yy.parser)this.yy.parser.parseError(i,o);else throw new Error(i)},"parseError"),setInput:d(function(i,o){return this.yy=o||this.yy||{},this._input=i,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:d(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var o=i.match(/(?:\r\n?|\n).*/g);return o?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},"input"),unput:d(function(i){var o=i.length,f=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-o),this.offset-=o;var p=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),f.length-1&&(this.yylineno-=f.length-1);var y=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:f?(f.length===p.length?this.yylloc.first_column:0)+p[p.length-f.length].length-f[0].length:this.yylloc.first_column-o},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-o]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(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:d(function(i){this.unput(this.match.slice(i))},"less"),pastInput:d(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var i=this.pastInput(),o=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
5
+ `+o+"^"},"showPosition"),test_match:d(function(i,o){var f,p,y;if(this.options.backtrack_lexer&&(y={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&&(y.yylloc.range=this.yylloc.range.slice(0))),p=i[0].match(/(?:\r\n?|\n).*/g),p&&(this.yylineno+=p.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:p?p[p.length-1].length-p[p.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,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(i[0].length),this.matched+=i[0],f=this.performAction.call(this,this.yy,this,o,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),f)return f;if(this._backtrack){for(var w in y)this[w]=y[w];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var i,o,f,p;this._more||(this.yytext="",this.match="");for(var y=this._currentRules(),w=0;w<y.length;w++)if(f=this._input.match(this.rules[y[w]]),f&&(!o||f[0].length>o[0].length)){if(o=f,p=w,this.options.backtrack_lexer){if(i=this.test_match(f,y[w]),i!==!1)return i;if(this._backtrack){o=!1;continue}else return!1}else if(!this.options.flex)break}return o?(i=this.test_match(o,y[p]),i!==!1?i:!1):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:d(function(){var i=this.next();return i||this.lex()},"lex"),begin:d(function(i){this.conditionStack.push(i)},"begin"),popState:d(function(){var i=this.conditionStack.length-1;return i>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(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:d(function(i){return i=this.conditionStack.length-1-Math.abs(i||0),i>=0?this.conditionStack[i]:"INITIAL"},"topState"),pushState:d(function(i){this.begin(i)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:d(function(i,o,f,p){switch(f){case 0:return this.pushState("csv"),4;case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return m})();c.lexer=b;function _(){this.yy={}}return d(_,"Parser"),_.prototype=c,c.Parser=_,new _})();at.parser=at;var H=at,R=[],B=[],K=new Map,Bt=d(()=>{R=[],B=[],K=new Map,Mt()},"clear"),nt,Jt=(nt=class{constructor(t,n,r=0){this.source=t,this.target=n,this.value=r}},d(nt,"SankeyLink"),nt),te=d((t,n,r)=>{R.push(new Jt(t,n,r))},"addLink"),it,ee=(it=class{constructor(t){this.ID=t}},d(it,"SankeyNode"),it),ne=d(t=>{t=At.sanitizeText(t,lt());let n=K.get(t);return n===void 0&&(n=new ee(t),K.set(t,n),B.push(n)),n},"findOrCreateNode"),ie=d(()=>B,"getNodes"),re=d(()=>R,"getLinks"),se=d(()=>({nodes:B.map(t=>({id:t.ID})),links:R.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),oe={nodesMap:K,getConfig:d(()=>lt().sankey,"getConfig"),getNodes:ie,getLinks:re,getGraph:se,addLink:te,findOrCreateNode:ne,getAccTitle:St,setAccTitle:wt,getAccDescription:bt,setAccDescription:vt,getDiagramTitle:kt,setDiagramTitle:xt,clear:Bt},F,pt=(F=class{static next(t){return new F(t+ ++F.count)}constructor(t){this.id=t,this.href=`#${t}`}toString(){return"url("+this.href+")"}},d(F,"Uid"),F.count=0,F),ae={left:Ot,right:Dt,center:It,justify:_t},le=d(function(t,n,r,a){const{securityLevel:c,sankey:b}=lt(),_=Et.sankey;let m;c==="sandbox"&&(m=Y("#i"+n));const i=c==="sandbox"?Y(m.nodes()[0].contentDocument.body):Y("body"),o=c==="sandbox"?i.select(`[id="${n}"]`):Y(`[id="${n}"]`),f=b?.width??_.width,p=b?.height??_.width,y=b?.useMaxWidth??_.useMaxWidth,w=b?.nodeAlignment??_.nodeAlignment,k=b?.prefix??_.prefix,P=b?.suffix??_.suffix,A=b?.showValues??_.showValues,T=a.db.getGraph(),D=ae[w];Ft().nodeId(g=>g.id).nodeWidth(10).nodePadding(10+(A?15:0)).nodeAlign(D).extent([[0,0],[f,p]])(T);const C=Tt(Pt);o.append("g").attr("class","nodes").selectAll(".node").data(T.nodes).join("g").attr("class","node").attr("id",g=>(g.uid=pt.next("node-")).id).attr("transform",function(g){return"translate("+g.x0+","+g.y0+")"}).attr("x",g=>g.x0).attr("y",g=>g.y0).append("rect").attr("height",g=>g.y1-g.y0).attr("width",g=>g.x1-g.x0).attr("fill",g=>C(g.id));const S=d(({id:g,value:L})=>A?`${g}
7
+ ${k}${Math.round(L*100)/100}${P}`:g,"getText");o.append("g").attr("class","node-labels").attr("font-size",14).selectAll("text").data(T.nodes).join("text").attr("x",g=>g.x0<f/2?g.x1+6:g.x0-6).attr("y",g=>(g.y1+g.y0)/2).attr("dy",`${A?"0":"0.35"}em`).attr("text-anchor",g=>g.x0<f/2?"start":"end").text(S);const N=o.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(T.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),I=b?.linkColor??"gradient";if(I==="gradient"){const g=N.append("linearGradient").attr("id",L=>(L.uid=pt.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",L=>L.source.x1).attr("x2",L=>L.target.x0);g.append("stop").attr("offset","0%").attr("stop-color",L=>C(L.source.id)),g.append("stop").attr("offset","100%").attr("stop-color",L=>C(L.target.id))}let O;switch(I){case"gradient":O=d(g=>g.uid,"coloring");break;case"source":O=d(g=>C(g.source.id),"coloring");break;case"target":O=d(g=>C(g.target.id),"coloring");break;default:O=I}N.append("path").attr("d",Rt()).attr("stroke",O).attr("stroke-width",g=>Math.max(1,g.width)),Lt(void 0,o,0,y)},"draw"),ce={draw:le},he=d(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,`
8
+ `).trim(),"prepareTextForParsing"),ue=d(t=>`.label {
9
9
  font-family: ${t.fontFamily};
10
- }`,"getStyles"),fe=ue,ye=K.parse.bind(K);K.parse=t=>ye(he(t));var _e={styles:fe,parser:K,db:oe,renderer:ce};export{_e as diagram};
10
+ }`,"getStyles"),fe=ue,ye=H.parse.bind(H);H.parse=t=>ye(he(t));var _e={styles:fe,parser:H,db:oe,renderer:ce};export{_e as diagram};
@@ -0,0 +1,145 @@
1
+ import{d as Ee,p as Ut,y as lt,x as we,m as Gt,h as Kt}from"./chunk-TZMSLE5B-Co2797zI-B0eGB9AN.js";import{H as y,ak as Ie,b as at,a5 as Nt,z as X,af as re,ab as ke,ac as Le,ah as L,aa as ee,a7 as Pe,ao as _e,a9 as Ae,a8 as Ne,ap as ve,aq as Me,ar as Oe,au as Se,ae as vt,an as Y,b9 as kt,ba as W,aR as se,bb as De,bc as $e,bd as ie,aC as qt}from"./index-Ct8vAKMN.js";import{e as Re}from"./chunk-QZHKN3VN--CtIzUYG-COYF7kdN.js";var zt=(function(){var e=y(function(ct,w,k,b){for(k=k||{},b=ct.length;b--;k[ct[b]]=w);return k},"o"),t=[1,2],o=[1,3],a=[1,4],s=[2,4],i=[1,9],c=[1,11],h=[1,13],n=[1,14],r=[1,16],p=[1,17],x=[1,18],u=[1,24],m=[1,25],E=[1,26],I=[1,27],A=[1,28],v=[1,29],N=[1,30],$=[1,31],R=[1,32],F=[1,33],q=[1,34],Z=[1,35],rt=[1,36],z=[1,37],H=[1,38],V=[1,39],D=[1,41],Q=[1,42],j=[1,43],J=[1,44],st=[1,45],S=[1,46],f=[1,4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,48,49,50,52,53,55,60,61,62,63,71],P=[2,71],U=[4,5,16,50,52,53],tt=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,55,60,61,62,63,71],O=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,49,50,52,53,55,60,61,62,63,71],Rt=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,48,50,52,53,55,60,61,62,63,71],Xt=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,50,52,53,55,60,61,62,63,71],nt=[69,70,71],ht=[1,127],Ct={trace:y(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,box_section:10,box_line:11,participant_statement:12,create:13,box:14,restOfLine:15,end:16,signal:17,autonumber:18,NUM:19,off:20,activate:21,actor:22,deactivate:23,note_statement:24,links_statement:25,link_statement:26,properties_statement:27,details_statement:28,title:29,legacy_title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,loop:36,rect:37,opt:38,alt:39,else_sections:40,par:41,par_sections:42,par_over:43,critical:44,option_sections:45,break:46,option:47,and:48,else:49,participant:50,AS:51,participant_actor:52,destroy:53,actor_with_config:54,note:55,placement:56,text2:57,over:58,actor_pair:59,links:60,link:61,properties:62,details:63,spaceList:64,",":65,left_of:66,right_of:67,signaltype:68,"+":69,"-":70,ACTOR:71,config_object:72,CONFIG_START:73,CONFIG_CONTENT:74,CONFIG_END:75,SOLID_OPEN_ARROW:76,DOTTED_OPEN_ARROW:77,SOLID_ARROW:78,BIDIRECTIONAL_SOLID_ARROW:79,DOTTED_ARROW:80,BIDIRECTIONAL_DOTTED_ARROW:81,SOLID_CROSS:82,DOTTED_CROSS:83,SOLID_POINT:84,DOTTED_POINT:85,TXT:86,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",13:"create",14:"box",15:"restOfLine",16:"end",18:"autonumber",19:"NUM",20:"off",21:"activate",23:"deactivate",29:"title",30:"legacy_title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"loop",37:"rect",38:"opt",39:"alt",41:"par",43:"par_over",44:"critical",46:"break",47:"option",48:"and",49:"else",50:"participant",51:"AS",52:"participant_actor",53:"destroy",55:"note",58:"over",60:"links",61:"link",62:"properties",63:"details",65:",",66:"left_of",67:"right_of",69:"+",70:"-",71:"ACTOR",73:"CONFIG_START",74:"CONFIG_CONTENT",75:"CONFIG_END",76:"SOLID_OPEN_ARROW",77:"DOTTED_OPEN_ARROW",78:"SOLID_ARROW",79:"BIDIRECTIONAL_SOLID_ARROW",80:"DOTTED_ARROW",81:"BIDIRECTIONAL_DOTTED_ARROW",82:"SOLID_CROSS",83:"DOTTED_CROSS",84:"SOLID_POINT",85:"DOTTED_POINT",86:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[10,0],[10,2],[11,2],[11,1],[11,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[45,1],[45,4],[42,1],[42,4],[40,1],[40,4],[12,5],[12,3],[12,5],[12,3],[12,3],[12,3],[24,4],[24,4],[25,3],[26,3],[27,3],[28,3],[64,2],[64,1],[59,3],[59,1],[56,1],[56,1],[17,5],[17,5],[17,4],[54,2],[72,3],[22,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[57,1]],performAction:y(function(ct,w,k,b,M,d,G){var g=d.length-1;switch(M){case 3:return b.apply(d[g]),d[g];case 4:case 9:this.$=[];break;case 5:case 10:d[g-1].push(d[g]),this.$=d[g-1];break;case 6:case 7:case 11:case 12:this.$=d[g];break;case 8:case 13:this.$=[];break;case 15:d[g].type="createParticipant",this.$=d[g];break;case 16:d[g-1].unshift({type:"boxStart",boxData:b.parseBoxData(d[g-2])}),d[g-1].push({type:"boxEnd",boxText:d[g-2]}),this.$=d[g-1];break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(d[g-2]),sequenceIndexStep:Number(d[g-1]),sequenceVisible:!0,signalType:b.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(d[g-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:b.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:b.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:b.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"activeStart",signalType:b.LINETYPE.ACTIVE_START,actor:d[g-1].actor};break;case 23:this.$={type:"activeEnd",signalType:b.LINETYPE.ACTIVE_END,actor:d[g-1].actor};break;case 29:b.setDiagramTitle(d[g].substring(6)),this.$=d[g].substring(6);break;case 30:b.setDiagramTitle(d[g].substring(7)),this.$=d[g].substring(7);break;case 31:this.$=d[g].trim(),b.setAccTitle(this.$);break;case 32:case 33:this.$=d[g].trim(),b.setAccDescription(this.$);break;case 34:d[g-1].unshift({type:"loopStart",loopText:b.parseMessage(d[g-2]),signalType:b.LINETYPE.LOOP_START}),d[g-1].push({type:"loopEnd",loopText:d[g-2],signalType:b.LINETYPE.LOOP_END}),this.$=d[g-1];break;case 35:d[g-1].unshift({type:"rectStart",color:b.parseMessage(d[g-2]),signalType:b.LINETYPE.RECT_START}),d[g-1].push({type:"rectEnd",color:b.parseMessage(d[g-2]),signalType:b.LINETYPE.RECT_END}),this.$=d[g-1];break;case 36:d[g-1].unshift({type:"optStart",optText:b.parseMessage(d[g-2]),signalType:b.LINETYPE.OPT_START}),d[g-1].push({type:"optEnd",optText:b.parseMessage(d[g-2]),signalType:b.LINETYPE.OPT_END}),this.$=d[g-1];break;case 37:d[g-1].unshift({type:"altStart",altText:b.parseMessage(d[g-2]),signalType:b.LINETYPE.ALT_START}),d[g-1].push({type:"altEnd",signalType:b.LINETYPE.ALT_END}),this.$=d[g-1];break;case 38:d[g-1].unshift({type:"parStart",parText:b.parseMessage(d[g-2]),signalType:b.LINETYPE.PAR_START}),d[g-1].push({type:"parEnd",signalType:b.LINETYPE.PAR_END}),this.$=d[g-1];break;case 39:d[g-1].unshift({type:"parStart",parText:b.parseMessage(d[g-2]),signalType:b.LINETYPE.PAR_OVER_START}),d[g-1].push({type:"parEnd",signalType:b.LINETYPE.PAR_END}),this.$=d[g-1];break;case 40:d[g-1].unshift({type:"criticalStart",criticalText:b.parseMessage(d[g-2]),signalType:b.LINETYPE.CRITICAL_START}),d[g-1].push({type:"criticalEnd",signalType:b.LINETYPE.CRITICAL_END}),this.$=d[g-1];break;case 41:d[g-1].unshift({type:"breakStart",breakText:b.parseMessage(d[g-2]),signalType:b.LINETYPE.BREAK_START}),d[g-1].push({type:"breakEnd",optText:b.parseMessage(d[g-2]),signalType:b.LINETYPE.BREAK_END}),this.$=d[g-1];break;case 43:this.$=d[g-3].concat([{type:"option",optionText:b.parseMessage(d[g-1]),signalType:b.LINETYPE.CRITICAL_OPTION},d[g]]);break;case 45:this.$=d[g-3].concat([{type:"and",parText:b.parseMessage(d[g-1]),signalType:b.LINETYPE.PAR_AND},d[g]]);break;case 47:this.$=d[g-3].concat([{type:"else",altText:b.parseMessage(d[g-1]),signalType:b.LINETYPE.ALT_ELSE},d[g]]);break;case 48:d[g-3].draw="participant",d[g-3].type="addParticipant",d[g-3].description=b.parseMessage(d[g-1]),this.$=d[g-3];break;case 49:d[g-1].draw="participant",d[g-1].type="addParticipant",this.$=d[g-1];break;case 50:d[g-3].draw="actor",d[g-3].type="addParticipant",d[g-3].description=b.parseMessage(d[g-1]),this.$=d[g-3];break;case 51:d[g-1].draw="actor",d[g-1].type="addParticipant",this.$=d[g-1];break;case 52:d[g-1].type="destroyParticipant",this.$=d[g-1];break;case 53:d[g-1].draw="participant",d[g-1].type="addParticipant",this.$=d[g-1];break;case 54:this.$=[d[g-1],{type:"addNote",placement:d[g-2],actor:d[g-1].actor,text:d[g]}];break;case 55:d[g-2]=[].concat(d[g-1],d[g-1]).slice(0,2),d[g-2][0]=d[g-2][0].actor,d[g-2][1]=d[g-2][1].actor,this.$=[d[g-1],{type:"addNote",placement:b.PLACEMENT.OVER,actor:d[g-2].slice(0,2),text:d[g]}];break;case 56:this.$=[d[g-1],{type:"addLinks",actor:d[g-1].actor,text:d[g]}];break;case 57:this.$=[d[g-1],{type:"addALink",actor:d[g-1].actor,text:d[g]}];break;case 58:this.$=[d[g-1],{type:"addProperties",actor:d[g-1].actor,text:d[g]}];break;case 59:this.$=[d[g-1],{type:"addDetails",actor:d[g-1].actor,text:d[g]}];break;case 62:this.$=[d[g-2],d[g]];break;case 63:this.$=d[g];break;case 64:this.$=b.PLACEMENT.LEFTOF;break;case 65:this.$=b.PLACEMENT.RIGHTOF;break;case 66:this.$=[d[g-4],d[g-1],{type:"addMessage",from:d[g-4].actor,to:d[g-1].actor,signalType:d[g-3],msg:d[g],activate:!0},{type:"activeStart",signalType:b.LINETYPE.ACTIVE_START,actor:d[g-1].actor}];break;case 67:this.$=[d[g-4],d[g-1],{type:"addMessage",from:d[g-4].actor,to:d[g-1].actor,signalType:d[g-3],msg:d[g]},{type:"activeEnd",signalType:b.LINETYPE.ACTIVE_END,actor:d[g-4].actor}];break;case 68:this.$=[d[g-3],d[g-1],{type:"addMessage",from:d[g-3].actor,to:d[g-1].actor,signalType:d[g-2],msg:d[g]}];break;case 69:this.$={type:"addParticipant",actor:d[g-1],config:d[g]};break;case 70:this.$=d[g-1].trim();break;case 71:this.$={type:"addParticipant",actor:d[g]};break;case 72:this.$=b.LINETYPE.SOLID_OPEN;break;case 73:this.$=b.LINETYPE.DOTTED_OPEN;break;case 74:this.$=b.LINETYPE.SOLID;break;case 75:this.$=b.LINETYPE.BIDIRECTIONAL_SOLID;break;case 76:this.$=b.LINETYPE.DOTTED;break;case 77:this.$=b.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 78:this.$=b.LINETYPE.SOLID_CROSS;break;case 79:this.$=b.LINETYPE.DOTTED_CROSS;break;case 80:this.$=b.LINETYPE.SOLID_POINT;break;case 81:this.$=b.LINETYPE.DOTTED_POINT;break;case 82:this.$=b.parseMessage(d[g].trim().substring(1));break}},"anonymous"),table:[{3:1,4:t,5:o,6:a},{1:[3]},{3:5,4:t,5:o,6:a},{3:6,4:t,5:o,6:a},e([1,4,5,13,14,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,55,60,61,62,63,71],s,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:i,5:c,8:8,9:10,12:12,13:h,14:n,17:15,18:r,21:p,22:40,23:x,24:19,25:20,26:21,27:22,28:23,29:u,30:m,31:E,33:I,35:A,36:v,37:N,38:$,39:R,41:F,43:q,44:Z,46:rt,50:z,52:H,53:V,55:D,60:Q,61:j,62:J,63:st,71:S},e(f,[2,5]),{9:47,12:12,13:h,14:n,17:15,18:r,21:p,22:40,23:x,24:19,25:20,26:21,27:22,28:23,29:u,30:m,31:E,33:I,35:A,36:v,37:N,38:$,39:R,41:F,43:q,44:Z,46:rt,50:z,52:H,53:V,55:D,60:Q,61:j,62:J,63:st,71:S},e(f,[2,7]),e(f,[2,8]),e(f,[2,14]),{12:48,50:z,52:H,53:V},{15:[1,49]},{5:[1,50]},{5:[1,53],19:[1,51],20:[1,52]},{22:54,71:S},{22:55,71:S},{5:[1,56]},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},e(f,[2,29]),e(f,[2,30]),{32:[1,61]},{34:[1,62]},e(f,[2,33]),{15:[1,63]},{15:[1,64]},{15:[1,65]},{15:[1,66]},{15:[1,67]},{15:[1,68]},{15:[1,69]},{15:[1,70]},{22:71,54:72,71:[1,73]},{22:74,71:S},{22:75,71:S},{68:76,76:[1,77],77:[1,78],78:[1,79],79:[1,80],80:[1,81],81:[1,82],82:[1,83],83:[1,84],84:[1,85],85:[1,86]},{56:87,58:[1,88],66:[1,89],67:[1,90]},{22:91,71:S},{22:92,71:S},{22:93,71:S},{22:94,71:S},e([5,51,65,76,77,78,79,80,81,82,83,84,85,86],P),e(f,[2,6]),e(f,[2,15]),e(U,[2,9],{10:95}),e(f,[2,17]),{5:[1,97],19:[1,96]},{5:[1,98]},e(f,[2,21]),{5:[1,99]},{5:[1,100]},e(f,[2,24]),e(f,[2,25]),e(f,[2,26]),e(f,[2,27]),e(f,[2,28]),e(f,[2,31]),e(f,[2,32]),e(tt,s,{7:101}),e(tt,s,{7:102}),e(tt,s,{7:103}),e(O,s,{40:104,7:105}),e(Rt,s,{42:106,7:107}),e(Rt,s,{7:107,42:108}),e(Xt,s,{45:109,7:110}),e(tt,s,{7:111}),{5:[1,113],51:[1,112]},{5:[1,114]},e([5,51],P,{72:115,73:[1,116]}),{5:[1,118],51:[1,117]},{5:[1,119]},{22:122,69:[1,120],70:[1,121],71:S},e(nt,[2,72]),e(nt,[2,73]),e(nt,[2,74]),e(nt,[2,75]),e(nt,[2,76]),e(nt,[2,77]),e(nt,[2,78]),e(nt,[2,79]),e(nt,[2,80]),e(nt,[2,81]),{22:123,71:S},{22:125,59:124,71:S},{71:[2,64]},{71:[2,65]},{57:126,86:ht},{57:128,86:ht},{57:129,86:ht},{57:130,86:ht},{4:[1,133],5:[1,135],11:132,12:134,16:[1,131],50:z,52:H,53:V},{5:[1,136]},e(f,[2,19]),e(f,[2,20]),e(f,[2,22]),e(f,[2,23]),{4:i,5:c,8:8,9:10,12:12,13:h,14:n,16:[1,137],17:15,18:r,21:p,22:40,23:x,24:19,25:20,26:21,27:22,28:23,29:u,30:m,31:E,33:I,35:A,36:v,37:N,38:$,39:R,41:F,43:q,44:Z,46:rt,50:z,52:H,53:V,55:D,60:Q,61:j,62:J,63:st,71:S},{4:i,5:c,8:8,9:10,12:12,13:h,14:n,16:[1,138],17:15,18:r,21:p,22:40,23:x,24:19,25:20,26:21,27:22,28:23,29:u,30:m,31:E,33:I,35:A,36:v,37:N,38:$,39:R,41:F,43:q,44:Z,46:rt,50:z,52:H,53:V,55:D,60:Q,61:j,62:J,63:st,71:S},{4:i,5:c,8:8,9:10,12:12,13:h,14:n,16:[1,139],17:15,18:r,21:p,22:40,23:x,24:19,25:20,26:21,27:22,28:23,29:u,30:m,31:E,33:I,35:A,36:v,37:N,38:$,39:R,41:F,43:q,44:Z,46:rt,50:z,52:H,53:V,55:D,60:Q,61:j,62:J,63:st,71:S},{16:[1,140]},{4:i,5:c,8:8,9:10,12:12,13:h,14:n,16:[2,46],17:15,18:r,21:p,22:40,23:x,24:19,25:20,26:21,27:22,28:23,29:u,30:m,31:E,33:I,35:A,36:v,37:N,38:$,39:R,41:F,43:q,44:Z,46:rt,49:[1,141],50:z,52:H,53:V,55:D,60:Q,61:j,62:J,63:st,71:S},{16:[1,142]},{4:i,5:c,8:8,9:10,12:12,13:h,14:n,16:[2,44],17:15,18:r,21:p,22:40,23:x,24:19,25:20,26:21,27:22,28:23,29:u,30:m,31:E,33:I,35:A,36:v,37:N,38:$,39:R,41:F,43:q,44:Z,46:rt,48:[1,143],50:z,52:H,53:V,55:D,60:Q,61:j,62:J,63:st,71:S},{16:[1,144]},{16:[1,145]},{4:i,5:c,8:8,9:10,12:12,13:h,14:n,16:[2,42],17:15,18:r,21:p,22:40,23:x,24:19,25:20,26:21,27:22,28:23,29:u,30:m,31:E,33:I,35:A,36:v,37:N,38:$,39:R,41:F,43:q,44:Z,46:rt,47:[1,146],50:z,52:H,53:V,55:D,60:Q,61:j,62:J,63:st,71:S},{4:i,5:c,8:8,9:10,12:12,13:h,14:n,16:[1,147],17:15,18:r,21:p,22:40,23:x,24:19,25:20,26:21,27:22,28:23,29:u,30:m,31:E,33:I,35:A,36:v,37:N,38:$,39:R,41:F,43:q,44:Z,46:rt,50:z,52:H,53:V,55:D,60:Q,61:j,62:J,63:st,71:S},{15:[1,148]},e(f,[2,49]),e(f,[2,53]),{5:[2,69]},{74:[1,149]},{15:[1,150]},e(f,[2,51]),e(f,[2,52]),{22:151,71:S},{22:152,71:S},{57:153,86:ht},{57:154,86:ht},{57:155,86:ht},{65:[1,156],86:[2,63]},{5:[2,56]},{5:[2,82]},{5:[2,57]},{5:[2,58]},{5:[2,59]},e(f,[2,16]),e(U,[2,10]),{12:157,50:z,52:H,53:V},e(U,[2,12]),e(U,[2,13]),e(f,[2,18]),e(f,[2,34]),e(f,[2,35]),e(f,[2,36]),e(f,[2,37]),{15:[1,158]},e(f,[2,38]),{15:[1,159]},e(f,[2,39]),e(f,[2,40]),{15:[1,160]},e(f,[2,41]),{5:[1,161]},{75:[1,162]},{5:[1,163]},{57:164,86:ht},{57:165,86:ht},{5:[2,68]},{5:[2,54]},{5:[2,55]},{22:166,71:S},e(U,[2,11]),e(O,s,{7:105,40:167}),e(Rt,s,{7:107,42:168}),e(Xt,s,{7:110,45:169}),e(f,[2,48]),{5:[2,70]},e(f,[2,50]),{5:[2,66]},{5:[2,67]},{86:[2,62]},{16:[2,47]},{16:[2,45]},{16:[2,43]}],defaultActions:{5:[2,1],6:[2,2],89:[2,64],90:[2,65],115:[2,69],126:[2,56],127:[2,82],128:[2,57],129:[2,58],130:[2,59],153:[2,68],154:[2,54],155:[2,55],162:[2,70],164:[2,66],165:[2,67],166:[2,62],167:[2,47],168:[2,45],169:[2,43]},parseError:y(function(ct,w){if(w.recoverable)this.trace(ct);else{var k=new Error(ct);throw k.hash=w,k}},"parseError"),parse:y(function(ct){var w=this,k=[0],b=[],M=[null],d=[],G=this.table,g="",Pt=0,Zt=0,me=2,Qt=1,Te=d.slice.call(arguments,1),B=Object.create(this.lexer),yt={yy:{}};for(var Bt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Bt)&&(yt.yy[Bt]=this.yy[Bt]);B.setInput(ct,yt.yy),yt.yy.lexer=B,yt.yy.parser=this,typeof B.yylloc>"u"&&(B.yylloc={});var Yt=B.yylloc;d.push(Yt);var fe=B.options&&B.options.ranges;typeof yt.yy.parseError=="function"?this.parseError=yt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function be(et){k.length=k.length-2*et,M.length=M.length-et,d.length=d.length-et}y(be,"popStack");function Jt(){var et;return et=b.pop()||B.lex()||Qt,typeof et!="number"&&(et instanceof Array&&(b=et,et=b.pop()),et=w.symbols_[et]||et),et}y(Jt,"lex");for(var K,mt,it,Vt,bt={},_t,dt,te,At;;){if(mt=k[k.length-1],this.defaultActions[mt]?it=this.defaultActions[mt]:((K===null||typeof K>"u")&&(K=Jt()),it=G[mt]&&G[mt][K]),typeof it>"u"||!it.length||!it[0]){var Ft="";At=[];for(_t in G[mt])this.terminals_[_t]&&_t>me&&At.push("'"+this.terminals_[_t]+"'");B.showPosition?Ft="Parse error on line "+(Pt+1)+`:
2
+ `+B.showPosition()+`
3
+ Expecting `+At.join(", ")+", got '"+(this.terminals_[K]||K)+"'":Ft="Parse error on line "+(Pt+1)+": Unexpected "+(K==Qt?"end of input":"'"+(this.terminals_[K]||K)+"'"),this.parseError(Ft,{text:B.match,token:this.terminals_[K]||K,line:B.yylineno,loc:Yt,expected:At})}if(it[0]instanceof Array&&it.length>1)throw new Error("Parse Error: multiple actions possible at state: "+mt+", token: "+K);switch(it[0]){case 1:k.push(K),M.push(B.yytext),d.push(B.yylloc),k.push(it[1]),K=null,Zt=B.yyleng,g=B.yytext,Pt=B.yylineno,Yt=B.yylloc;break;case 2:if(dt=this.productions_[it[1]][1],bt.$=M[M.length-dt],bt._$={first_line:d[d.length-(dt||1)].first_line,last_line:d[d.length-1].last_line,first_column:d[d.length-(dt||1)].first_column,last_column:d[d.length-1].last_column},fe&&(bt._$.range=[d[d.length-(dt||1)].range[0],d[d.length-1].range[1]]),Vt=this.performAction.apply(bt,[g,Zt,Pt,yt.yy,it[1],M,d].concat(Te)),typeof Vt<"u")return Vt;dt&&(k=k.slice(0,-1*dt*2),M=M.slice(0,-1*dt),d=d.slice(0,-1*dt)),k.push(this.productions_[it[1]][0]),M.push(bt.$),d.push(bt._$),te=G[k[k.length-2]][k[k.length-1]],k.push(te);break;case 3:return!0}}return!0},"parse")},ye=(function(){var ct={EOF:1,parseError:y(function(w,k){if(this.yy.parser)this.yy.parser.parseError(w,k);else throw new Error(w)},"parseError"),setInput:y(function(w,k){return this.yy=k||this.yy||{},this._input=w,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:y(function(){var w=this._input[0];this.yytext+=w,this.yyleng++,this.offset++,this.match+=w,this.matched+=w;var k=w.match(/(?:\r\n?|\n).*/g);return k?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),w},"input"),unput:y(function(w){var k=w.length,b=w.split(/(?:\r\n?|\n)/g);this._input=w+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-k),this.offset-=k;var M=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),b.length-1&&(this.yylineno-=b.length-1);var d=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:b?(b.length===M.length?this.yylloc.first_column:0)+M[M.length-b.length].length-b[0].length:this.yylloc.first_column-k},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-k]),this.yyleng=this.yytext.length,this},"unput"),more:y(function(){return this._more=!0,this},"more"),reject:y(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:y(function(w){this.unput(this.match.slice(w))},"less"),pastInput:y(function(){var w=this.matched.substr(0,this.matched.length-this.match.length);return(w.length>20?"...":"")+w.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:y(function(){var w=this.match;return w.length<20&&(w+=this._input.substr(0,20-w.length)),(w.substr(0,20)+(w.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:y(function(){var w=this.pastInput(),k=new Array(w.length+1).join("-");return w+this.upcomingInput()+`
5
+ `+k+"^"},"showPosition"),test_match:y(function(w,k){var b,M,d;if(this.options.backtrack_lexer&&(d={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&&(d.yylloc.range=this.yylloc.range.slice(0))),M=w[0].match(/(?:\r\n?|\n).*/g),M&&(this.yylineno+=M.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:M?M[M.length-1].length-M[M.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+w[0].length},this.yytext+=w[0],this.match+=w[0],this.matches=w,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(w[0].length),this.matched+=w[0],b=this.performAction.call(this,this.yy,this,k,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),b)return b;if(this._backtrack){for(var G in d)this[G]=d[G];return!1}return!1},"test_match"),next:y(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var w,k,b,M;this._more||(this.yytext="",this.match="");for(var d=this._currentRules(),G=0;G<d.length;G++)if(b=this._input.match(this.rules[d[G]]),b&&(!k||b[0].length>k[0].length)){if(k=b,M=G,this.options.backtrack_lexer){if(w=this.test_match(b,d[G]),w!==!1)return w;if(this._backtrack){k=!1;continue}else return!1}else if(!this.options.flex)break}return k?(w=this.test_match(k,d[M]),w!==!1?w:!1):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:y(function(){var w=this.next();return w||this.lex()},"lex"),begin:y(function(w){this.conditionStack.push(w)},"begin"),popState:y(function(){var w=this.conditionStack.length-1;return w>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:y(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:y(function(w){return w=this.conditionStack.length-1-Math.abs(w||0),w>=0?this.conditionStack[w]:"INITIAL"},"topState"),pushState:y(function(w){this.begin(w)},"pushState"),stateStackSize:y(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:y(function(w,k,b,M){switch(b){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 19;case 7:return this.begin("CONFIG"),73;case 8:return 74;case 9:return this.popState(),this.popState(),75;case 10:return k.yytext=k.yytext.trim(),71;case 11:return k.yytext=k.yytext.trim(),this.begin("ALIAS"),71;case 12:return this.begin("LINE"),14;case 13:return this.begin("ID"),50;case 14:return this.begin("ID"),52;case 15:return 13;case 16:return this.begin("ID"),53;case 17:return k.yytext=k.yytext.trim(),this.begin("ALIAS"),71;case 18:return this.popState(),this.popState(),this.begin("LINE"),51;case 19:return this.popState(),this.popState(),5;case 20:return this.begin("LINE"),36;case 21:return this.begin("LINE"),37;case 22:return this.begin("LINE"),38;case 23:return this.begin("LINE"),39;case 24:return this.begin("LINE"),49;case 25:return this.begin("LINE"),41;case 26:return this.begin("LINE"),43;case 27:return this.begin("LINE"),48;case 28:return this.begin("LINE"),44;case 29:return this.begin("LINE"),47;case 30:return this.begin("LINE"),46;case 31:return this.popState(),15;case 32:return 16;case 33:return 66;case 34:return 67;case 35:return 60;case 36:return 61;case 37:return 62;case 38:return 63;case 39:return 58;case 40:return 55;case 41:return this.begin("ID"),21;case 42:return this.begin("ID"),23;case 43:return 29;case 44:return 30;case 45:return this.begin("acc_title"),31;case 46:return this.popState(),"acc_title_value";case 47:return this.begin("acc_descr"),33;case 48:return this.popState(),"acc_descr_value";case 49:this.begin("acc_descr_multiline");break;case 50:this.popState();break;case 51:return"acc_descr_multiline_value";case 52:return 6;case 53:return 18;case 54:return 20;case 55:return 65;case 56:return 5;case 57:return k.yytext=k.yytext.trim(),71;case 58:return 78;case 59:return 79;case 60:return 80;case 61:return 81;case 62:return 76;case 63:return 77;case 64:return 82;case 65:return 83;case 66:return 84;case 67:return 85;case 68:return 86;case 69:return 86;case 70:return 69;case 71:return 70;case 72:return 5;case 73:return"INVALID"}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^\<->\->:\n,;@]+?([\-]*[^\<->\->:\n,;@]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:[^<\->\->:\n,;]+?([\-]*[^<\->\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[50,51],inclusive:!1},acc_descr:{rules:[48],inclusive:!1},acc_title:{rules:[46],inclusive:!1},ID:{rules:[2,3,7,10,11,17],inclusive:!1},ALIAS:{rules:[2,3,18,19],inclusive:!1},LINE:{rules:[2,3,31],inclusive:!1},CONFIG:{rules:[8,9],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,12,13,14,15,16,20,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,47,49,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73],inclusive:!0}}};return ct})();Ct.lexer=ye;function Lt(){this.yy={}}return y(Lt,"Parser"),Lt.prototype=Ct,Ct.Parser=Lt,new Lt})();zt.parser=zt;var Ce=zt,Be={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},Ye={FILLED:0,OPEN:1},Ve={LEFTOF:0,RIGHTOF:1,OVER:2},Mt={ACTOR:"actor",CONTROL:"control",DATABASE:"database",ENTITY:"entity"},Wt,Fe=(Wt=class{constructor(){this.state=new Re(()=>({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=ee,this.setAccDescription=Pe,this.setDiagramTitle=_e,this.getAccTitle=Ae,this.getAccDescription=Ne,this.getDiagramTitle=ve,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(at().wrap),this.LINETYPE=Be,this.ARROWTYPE=Ye,this.PLACEMENT=Ve}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,o,a,s){let i=this.state.records.currentBox,c;if(s!==void 0){let n;s.includes(`
7
+ `)?n=s+`
8
+ `:n=`{
9
+ `+s+`
10
+ }`,c=Me(n,{schema:Oe})}a=c?.type??a;const h=this.state.records.actors.get(e);if(h){if(this.state.records.currentBox&&h.box&&this.state.records.currentBox!==h.box)throw new Error(`A same participant should only be defined in one Box: ${h.name} can't be in '${h.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(i=h.box?h.box:this.state.records.currentBox,h.box=i,h&&t===h.name&&o==null)return}if(o?.text==null&&(o={text:t,type:a}),(a==null||o.text==null)&&(o={text:t,type:a}),this.state.records.actors.set(e,{box:i,name:t,description:o.text,wrap:o.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:a??"participant"}),this.state.records.prevActor){const n=this.state.records.actors.get(this.state.records.prevActor);n&&(n.nextActor=e)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(e),this.state.records.prevActor=e}activationCount(e){let t,o=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&&o++,this.state.records.messages[t].type===this.LINETYPE.ACTIVE_END&&this.state.records.messages[t].from===e&&o--;return o}addMessage(e,t,o,a){this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:t,message:o.text,wrap:o.wrap??this.autoWrap(),answer:a})}addSignal(e,t,o,a,s=!1){if(a===this.LINETYPE.ACTIVE_END&&this.activationCount(e??"")<1){const i=new Error("Trying to inactivate an inactive participant ("+e+")");throw i.hash={text:"->>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},i}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:e,to:t,message:o?.text??"",wrap:o?.wrap??this.autoWrap(),type:a,activate:s}),!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();const t=/^:?wrap:/.exec(e)!==null?!0:/^:?nowrap:/.exec(e)!==null?!1:void 0;return{cleanedText:(t===void 0?e:e.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:t}}autoWrap(){return this.state.records.wrapEnabled!==void 0?this.state.records.wrapEnabled:at().sequence?.wrap??!1}clear(){this.state.reset(),Se()}parseMessage(e){const t=e.trim(),{wrap:o,cleanedText:a}=this.extractWrap(t),s={text:a,wrap:o};return X.debug(`parseMessage: ${JSON.stringify(s)}`),s}parseBoxData(e){const t=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(e);let o=t?.[1]?t[1].trim():"transparent",a=t?.[2]?t[2].trim():void 0;if(window?.CSS)window.CSS.supports("color",o)||(o="transparent",a=e.trim());else{const c=new Option().style;c.color=o,c.color!==o&&(o="transparent",a=e.trim())}const{wrap:s,cleanedText:i}=this.extractWrap(a);return{text:i?vt(i,at()):void 0,color:o,wrap:s}}addNote(e,t,o){const a={actor:e,placement:t,message:o.text,wrap:o.wrap??this.autoWrap()},s=[].concat(e,e);this.state.records.notes.push(a),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:s[0],to:s[1],message:o.text,wrap:o.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:t})}addLinks(e,t){const o=this.getActor(e);try{let a=vt(t.text,at());a=a.replace(/&equals;/g,"="),a=a.replace(/&amp;/g,"&");const s=JSON.parse(a);this.insertLinks(o,s)}catch(a){X.error("error while parsing actor link text",a)}}addALink(e,t){const o=this.getActor(e);try{const a={};let s=vt(t.text,at());const i=s.indexOf("@");s=s.replace(/&equals;/g,"="),s=s.replace(/&amp;/g,"&");const c=s.slice(0,i-1).trim(),h=s.slice(i+1).trim();a[c]=h,this.insertLinks(o,a)}catch(a){X.error("error while parsing actor link text",a)}}insertLinks(e,t){if(e.links==null)e.links=t;else for(const o in t)e.links[o]=t[o]}addProperties(e,t){const o=this.getActor(e);try{const a=vt(t.text,at()),s=JSON.parse(a);this.insertProperties(o,s)}catch(a){X.error("error while parsing actor properties text",a)}}insertProperties(e,t){if(e.properties==null)e.properties=t;else for(const o in t)e.properties[o]=t[o]}boxEnd(){this.state.records.currentBox=void 0}addDetails(e,t){const o=this.getActor(e),a=document.getElementById(t.text);try{const s=a.innerHTML,i=JSON.parse(s);i.properties&&this.insertProperties(o,i.properties),i.links&&this.insertLinks(o,i.links)}catch(s){X.error("error while parsing actor details text",s)}}getActorProperty(e,t){if(e?.properties!==void 0)return e.properties[t]}apply(e){if(Array.isArray(e))e.forEach(t=>{this.apply(t)});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 new 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"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 new 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 new 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);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":ee(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 at().sequence}},y(Wt,"SequenceDB"),Wt),We=y(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"),qe=We,Tt=36,ut="actor-top",xt="actor-bottom",St="actor-box",gt="actor-man",It=y(function(e,t){return we(e,t)},"drawRect"),ze=y(function(e,t,o,a,s){if(t.links===void 0||t.links===null||Object.keys(t.links).length===0)return{height:0,width:0};const i=t.links,c=t.actorCnt,h=t.rectData;var n="none";s&&(n="block !important");const r=e.append("g");r.attr("id","actor"+c+"_popup"),r.attr("class","actorPopupMenu"),r.attr("display",n);var p="";h.class!==void 0&&(p=" "+h.class);let x=h.width>o?h.width:o;const u=r.append("rect");if(u.attr("class","actorPopupMenuPanel"+p),u.attr("x",h.x),u.attr("y",h.height),u.attr("fill",h.fill),u.attr("stroke",h.stroke),u.attr("width",x),u.attr("height",h.height),u.attr("rx",h.rx),u.attr("ry",h.ry),i!=null){var m=20;for(let A in i){var E=r.append("a"),I=re.sanitizeUrl(i[A]);E.attr("xlink:href",I),E.attr("target","_blank"),pa(a)(A,E,h.x+10,h.height+m,x,20,{class:"actor"},a),m+=30}}return u.attr("height",m),{height:h.height+m,width:x}},"drawPopup"),Dt=y(function(e){return"var pu = document.getElementById('"+e+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),Ot=y(async function(e,t,o=null){let a=e.append("foreignObject");const s=await ie(t.text,qt()),i=a.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(s).node().getBoundingClientRect();if(a.attr("height",Math.round(i.height)).attr("width",Math.round(i.width)),t.class==="noteText"){const c=e.node().firstChild;c.setAttribute("height",i.height+2*t.textMargin);const h=c.getBBox();a.attr("x",Math.round(h.x+h.width/2-i.width/2)).attr("y",Math.round(h.y+h.height/2-i.height/2))}else if(o){let{startx:c,stopx:h,starty:n}=o;if(c>h){const r=c;c=h,h=r}a.attr("x",Math.round(c+Math.abs(c-h)/2-i.width/2)),t.class==="loopText"?a.attr("y",Math.round(n)):a.attr("y",Math.round(n-i.height))}return[a]},"drawKatex"),wt=y(function(e,t){let o=0,a=0;const s=t.text.split(L.lineBreakRegex),[i,c]=se(t.fontSize);let h=[],n=0,r=y(()=>t.y,"yfunc");if(t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0)switch(t.valign){case"top":case"start":r=y(()=>Math.round(t.y+t.textMargin),"yfunc");break;case"middle":case"center":r=y(()=>Math.round(t.y+(o+a+t.textMargin)/2),"yfunc");break;case"bottom":case"end":r=y(()=>Math.round(t.y+(o+a+2*t.textMargin)-t.textMargin),"yfunc");break}if(t.anchor!==void 0&&t.textMargin!==void 0&&t.width!==void 0)switch(t.anchor){case"left":case"start":t.x=Math.round(t.x+t.textMargin),t.anchor="start",t.dominantBaseline="middle",t.alignmentBaseline="middle";break;case"middle":case"center":t.x=Math.round(t.x+t.width/2),t.anchor="middle",t.dominantBaseline="middle",t.alignmentBaseline="middle";break;case"right":case"end":t.x=Math.round(t.x+t.width-t.textMargin),t.anchor="end",t.dominantBaseline="middle",t.alignmentBaseline="middle";break}for(let[p,x]of s.entries()){t.textMargin!==void 0&&t.textMargin===0&&i!==void 0&&(n=p*i);const u=e.append("text");u.attr("x",t.x),u.attr("y",r()),t.anchor!==void 0&&u.attr("text-anchor",t.anchor).attr("dominant-baseline",t.dominantBaseline).attr("alignment-baseline",t.alignmentBaseline),t.fontFamily!==void 0&&u.style("font-family",t.fontFamily),c!==void 0&&u.style("font-size",c),t.fontWeight!==void 0&&u.style("font-weight",t.fontWeight),t.fill!==void 0&&u.attr("fill",t.fill),t.class!==void 0&&u.attr("class",t.class),t.dy!==void 0?u.attr("dy",t.dy):n!==0&&u.attr("dy",n);const m=x||De;if(t.tspan){const E=u.append("tspan");E.attr("x",t.x),t.fill!==void 0&&E.attr("fill",t.fill),E.text(m)}else u.text(m);t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0&&(a+=(u._groups||u)[0][0].getBBox().height,o=a),h.push(u)}return h},"drawText"),oe=y(function(e,t){function o(s,i,c,h,n){return s+","+i+" "+(s+c)+","+i+" "+(s+c)+","+(i+h-n)+" "+(s+c-n*1.2)+","+(i+h)+" "+s+","+(i+h)}y(o,"genPoints");const a=e.append("polygon");return a.attr("points",o(t.x,t.y,t.width,t.height,7)),a.attr("class","labelBox"),t.y=t.y+t.height/2,wt(e,t),a},"drawLabel"),_=-1,ne=y((e,t,o,a)=>{e.select&&o.forEach(s=>{const i=t.get(s),c=e.select("#actor"+i.actorCnt);!a.mirrorActors&&i.stopy?c.attr("y2",i.stopy+i.height/2):a.mirrorActors&&c.attr("y2",i.stopy)})},"fixLifeLineHeights"),He=y(function(e,t,o,a){const s=a?t.stopy:t.starty,i=t.x+t.width/2,c=s+t.height,h=e.append("g").lower();var n=h;a||(_++,Object.keys(t.links||{}).length&&!o.forceMenus&&n.attr("onclick",Dt(`actor${_}_popup`)).attr("cursor","pointer"),n.append("line").attr("id","actor"+_).attr("x1",i).attr("y1",c).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),n=h.append("g"),t.actorCnt=_,t.links!=null&&n.attr("id","root-"+_));const r=lt();var p="actor";t.properties?.class?p=t.properties.class:r.fill="#eaeaea",a?p+=` ${xt}`:p+=` ${ut}`,r.x=t.x,r.y=s,r.width=t.width,r.height=t.height,r.class=p,r.rx=3,r.ry=3,r.name=t.name;const x=It(n,r);if(t.rectData=r,t.properties?.icon){const m=t.properties.icon.trim();m.charAt(0)==="@"?Gt(n,r.x+r.width-20,r.y+10,m.substr(1)):Kt(n,r.x+r.width-20,r.y+10,m)}pt(o,W(t.description))(t.description,n,r.x,r.y,r.width,r.height,{class:`actor ${St}`},o);let u=t.height;if(x.node){const m=x.node().getBBox();t.height=m.height,u=m.height}return u},"drawActorTypeParticipant"),je=y(function(e,t,o,a){const s=a?t.stopy:t.starty,i=t.x+t.width/2,c=s+t.height,h=e.append("g").lower();var n=h;a||(_++,Object.keys(t.links||{}).length&&!o.forceMenus&&n.attr("onclick",Dt(`actor${_}_popup`)).attr("cursor","pointer"),n.append("line").attr("id","actor"+_).attr("x1",i).attr("y1",c).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),n=h.append("g"),t.actorCnt=_,t.links!=null&&n.attr("id","root-"+_));const r=lt();var p="actor";t.properties?.class?p=t.properties.class:r.fill="#eaeaea",a?p+=` ${xt}`:p+=` ${ut}`,r.x=t.x,r.y=s,r.width=t.width,r.height=t.height,r.class=p,r.name=t.name;const x=6,u={...r,x:r.x+-x,y:r.y+ +x,class:"actor"},m=It(n,r);if(It(n,u),t.rectData=r,t.properties?.icon){const I=t.properties.icon.trim();I.charAt(0)==="@"?Gt(n,r.x+r.width-20,r.y+10,I.substr(1)):Kt(n,r.x+r.width-20,r.y+10,I)}pt(o,W(t.description))(t.description,n,r.x-x,r.y+x,r.width,r.height,{class:`actor ${St}`},o);let E=t.height;if(m.node){const I=m.node().getBBox();t.height=I.height,E=I.height}return E},"drawActorTypeCollections"),Ue=y(function(e,t,o,a){const s=a?t.stopy:t.starty,i=t.x+t.width/2,c=s+t.height,h=e.append("g").lower();let n=h;a||(_++,Object.keys(t.links||{}).length&&!o.forceMenus&&n.attr("onclick",Dt(`actor${_}_popup`)).attr("cursor","pointer"),n.append("line").attr("id","actor"+_).attr("x1",i).attr("y1",c).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),n=h.append("g"),t.actorCnt=_,t.links!=null&&n.attr("id","root-"+_));const r=lt();let p="actor";t.properties?.class?p=t.properties.class:r.fill="#eaeaea",a?p+=` ${xt}`:p+=` ${ut}`,r.x=t.x,r.y=s,r.width=t.width,r.height=t.height,r.class=p,r.name=t.name;const x=r.height/2,u=x/(2.5+r.height/50),m=n.append("g"),E=n.append("g");if(m.append("path").attr("d",`M ${r.x},${r.y+x}
133
+ a ${u},${x} 0 0 0 0,${r.height}
134
+ h ${r.width-2*u}
135
+ a ${u},${x} 0 0 0 0,-${r.height}
136
+ Z
137
+ `).attr("class",p),E.append("path").attr("d",`M ${r.x},${r.y+x}
138
+ a ${u},${x} 0 0 0 0,${r.height}`).attr("stroke","#666").attr("stroke-width","1px").attr("class",p),m.attr("transform",`translate(${u}, ${-(r.height/2)})`),E.attr("transform",`translate(${r.width-u}, ${-r.height/2})`),t.rectData=r,t.properties?.icon){const v=t.properties.icon.trim(),N=r.x+r.width-20,$=r.y+10;v.charAt(0)==="@"?Gt(n,N,$,v.substr(1)):Kt(n,N,$,v)}pt(o,W(t.description))(t.description,n,r.x,r.y,r.width,r.height,{class:`actor ${St}`},o);let I=t.height;const A=m.select("path:last-child");if(A.node()){const v=A.node().getBBox();t.height=v.height,I=v.height}return I},"drawActorTypeQueue"),Ge=y(function(e,t,o,a){const s=a?t.stopy:t.starty,i=t.x+t.width/2,c=s+75,h=e.append("g").lower();a||(_++,h.append("line").attr("id","actor"+_).attr("x1",i).attr("y1",c).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),t.actorCnt=_);const n=e.append("g");let r=gt;a?r+=` ${xt}`:r+=` ${ut}`,n.attr("class",r),n.attr("name",t.name);const p=lt();p.x=t.x,p.y=s,p.fill="#eaeaea",p.width=t.width,p.height=t.height,p.class="actor";const x=t.x+t.width/2,u=s+30,m=18;n.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"),n.append("circle").attr("cx",x).attr("cy",u).attr("r",m).attr("fill","#eaeaf7").attr("stroke","#666").attr("stroke-width",1.2),n.append("line").attr("marker-end","url(#filled-head-control)").attr("transform",`translate(${x}, ${u-m})`);const E=n.node().getBBox();return t.height=E.height+2*(o?.sequence?.labelBoxHeight??0),pt(o,W(t.description))(t.description,n,p.x,p.y+m+(a?5:10),p.width,p.height,{class:`actor ${gt}`},o),t.height},"drawActorTypeControl"),Ke=y(function(e,t,o,a){const s=a?t.stopy:t.starty,i=t.x+t.width/2,c=s+75,h=e.append("g").lower(),n=e.append("g");let r=gt;a?r+=` ${xt}`:r+=` ${ut}`,n.attr("class",r),n.attr("name",t.name);const p=lt();p.x=t.x,p.y=s,p.fill="#eaeaea",p.width=t.width,p.height=t.height,p.class="actor";const x=t.x+t.width/2,u=s+(a?10:25),m=18;n.append("circle").attr("cx",x).attr("cy",u).attr("r",m).attr("width",t.width).attr("height",t.height),n.append("line").attr("x1",x-m).attr("x2",x+m).attr("y1",u+m).attr("y2",u+m).attr("stroke","#333").attr("stroke-width",2);const E=n.node().getBBox();return t.height=E.height+(o?.sequence?.labelBoxHeight??0),a||(_++,h.append("line").attr("id","actor"+_).attr("x1",i).attr("y1",c).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),t.actorCnt=_),pt(o,W(t.description))(t.description,n,p.x,p.y+(a?(u-s+m-5)/2:(u+m-s)/2),p.width,p.height,{class:`actor ${gt}`},o),a?n.attr("transform",`translate(0, ${m/2})`):n.attr("transform",`translate(0, ${m/2})`),t.height},"drawActorTypeEntity"),Xe=y(function(e,t,o,a){const s=a?t.stopy:t.starty,i=t.x+t.width/2,c=s+t.height+2*o.boxTextMargin,h=e.append("g").lower();let n=h;a||(_++,Object.keys(t.links||{}).length&&!o.forceMenus&&n.attr("onclick",Dt(`actor${_}_popup`)).attr("cursor","pointer"),n.append("line").attr("id","actor"+_).attr("x1",i).attr("y1",c).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),n=h.append("g"),t.actorCnt=_,t.links!=null&&n.attr("id","root-"+_));const r=lt();let p="actor";t.properties?.class?p=t.properties.class:r.fill="#eaeaea",a?p+=` ${xt}`:p+=` ${ut}`,r.x=t.x,r.y=s,r.width=t.width,r.height=t.height,r.class=p,r.name=t.name,r.x=t.x,r.y=s;const x=r.width/4,u=r.width/4,m=x/2,E=m/(2.5+x/50),I=n.append("g"),A=`
139
+ M ${r.x},${r.y+E}
140
+ a ${m},${E} 0 0 0 ${x},0
141
+ a ${m},${E} 0 0 0 -${x},0
142
+ l 0,${u-2*E}
143
+ a ${m},${E} 0 0 0 ${x},0
144
+ l 0,-${u-2*E}
145
+ `;I.append("path").attr("d",A).attr("fill","#eaeaea").attr("stroke","#000").attr("stroke-width",1).attr("class",p),a?I.attr("transform",`translate(${x*1.5}, ${r.height/4-2*E})`):I.attr("transform",`translate(${x*1.5}, ${(r.height+E)/4})`),t.rectData=r,pt(o,W(t.description))(t.description,n,r.x,r.y+(a?(r.height+u)/4:(r.height+E)/2),r.width,r.height,{class:`actor ${St}`},o);const v=I.select("path:last-child");if(v.node()){const N=v.node().getBBox();t.height=N.height+(o.sequence.labelBoxHeight??0)}return t.height},"drawActorTypeDatabase"),Ze=y(function(e,t,o,a){const s=a?t.stopy:t.starty,i=t.x+t.width/2,c=s+80,h=30,n=e.append("g").lower();a||(_++,n.append("line").attr("id","actor"+_).attr("x1",i).attr("y1",c).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),t.actorCnt=_);const r=e.append("g");let p=gt;a?p+=` ${xt}`:p+=` ${ut}`,r.attr("class",p),r.attr("name",t.name);const x=lt();x.x=t.x,x.y=s,x.fill="#eaeaea",x.width=t.width,x.height=t.height,x.class="actor",r.append("line").attr("id","actor-man-torso"+_).attr("x1",t.x+t.width/2-h*2.5).attr("y1",s+10).attr("x2",t.x+t.width/2-15).attr("y2",s+10),r.append("line").attr("id","actor-man-arms"+_).attr("x1",t.x+t.width/2-h*2.5).attr("y1",s+0).attr("x2",t.x+t.width/2-h*2.5).attr("y2",s+20),r.append("circle").attr("cx",t.x+t.width/2).attr("cy",s+10).attr("r",h);const u=r.node().getBBox();return t.height=u.height+(o.sequence.labelBoxHeight??0),pt(o,W(t.description))(t.description,r,x.x,x.y+(a?h/2-4:h/2+3),x.width,x.height,{class:`actor ${gt}`},o),a?r.attr("transform",`translate(0,${h/2+7})`):r.attr("transform",`translate(0,${h/2+7})`),t.height},"drawActorTypeBoundary"),Qe=y(function(e,t,o,a){const s=a?t.stopy:t.starty,i=t.x+t.width/2,c=s+80,h=e.append("g").lower();a||(_++,h.append("line").attr("id","actor"+_).attr("x1",i).attr("y1",c).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name),t.actorCnt=_);const n=e.append("g");let r=gt;a?r+=` ${xt}`:r+=` ${ut}`,n.attr("class",r),n.attr("name",t.name);const p=lt();p.x=t.x,p.y=s,p.fill="#eaeaea",p.width=t.width,p.height=t.height,p.class="actor",p.rx=3,p.ry=3,n.append("line").attr("id","actor-man-torso"+_).attr("x1",i).attr("y1",s+25).attr("x2",i).attr("y2",s+45),n.append("line").attr("id","actor-man-arms"+_).attr("x1",i-Tt/2).attr("y1",s+33).attr("x2",i+Tt/2).attr("y2",s+33),n.append("line").attr("x1",i-Tt/2).attr("y1",s+60).attr("x2",i).attr("y2",s+45),n.append("line").attr("x1",i).attr("y1",s+45).attr("x2",i+Tt/2-2).attr("y2",s+60);const x=n.append("circle");x.attr("cx",t.x+t.width/2),x.attr("cy",s+10),x.attr("r",15),x.attr("width",t.width),x.attr("height",t.height);const u=n.node().getBBox();return t.height=u.height,pt(o,W(t.description))(t.description,n,p.x,p.y+35,p.width,p.height,{class:`actor ${gt}`},o),t.height},"drawActorTypeActor"),Je=y(async function(e,t,o,a){switch(t.type){case"actor":return await Qe(e,t,o,a);case"participant":return await He(e,t,o,a);case"boundary":return await Ze(e,t,o,a);case"control":return await Ge(e,t,o,a);case"entity":return await Ke(e,t,o,a);case"database":return await Xe(e,t,o,a);case"collections":return await je(e,t,o,a);case"queue":return await Ue(e,t,o,a)}},"drawActor"),ta=y(function(e,t,o){const a=e.append("g");ce(a,t),t.name&&pt(o)(t.name,a,t.x,t.y+o.boxTextMargin+(t.textMaxHeight||0)/2,t.width,0,{class:"text"},o),a.lower()},"drawBox"),ea=y(function(e){return e.append("g")},"anchorElement"),aa=y(function(e,t,o,a,s){const i=lt(),c=t.anchored;i.x=t.startx,i.y=t.starty,i.class="activation"+s%3,i.width=t.stopx-t.startx,i.height=o-t.starty,It(c,i)},"drawActivation"),ra=y(async function(e,t,o,a){const{boxMargin:s,boxTextMargin:i,labelBoxHeight:c,labelBoxWidth:h,messageFontFamily:n,messageFontSize:r,messageFontWeight:p}=a,x=e.append("g"),u=y(function(I,A,v,N){return x.append("line").attr("x1",I).attr("y1",A).attr("x2",v).attr("y2",N).attr("class","loopLine")},"drawLoopLine");u(t.startx,t.starty,t.stopx,t.starty),u(t.stopx,t.starty,t.stopx,t.stopy),u(t.startx,t.stopy,t.stopx,t.stopy),u(t.startx,t.starty,t.startx,t.stopy),t.sections!==void 0&&t.sections.forEach(function(I){u(t.startx,I.y,t.stopx,I.y).style("stroke-dasharray","3, 3")});let m=Ut();m.text=o,m.x=t.startx,m.y=t.starty,m.fontFamily=n,m.fontSize=r,m.fontWeight=p,m.anchor="middle",m.valign="middle",m.tspan=!1,m.width=h||50,m.height=c||20,m.textMargin=i,m.class="labelText",oe(x,m),m=le(),m.text=t.title,m.x=t.startx+h/2+(t.stopx-t.startx)/2,m.y=t.starty+s+i,m.anchor="middle",m.valign="middle",m.textMargin=i,m.class="loopText",m.fontFamily=n,m.fontSize=r,m.fontWeight=p,m.wrap=!0;let E=W(m.text)?await Ot(x,m,t):wt(x,m);if(t.sectionTitles!==void 0){for(const[I,A]of Object.entries(t.sectionTitles))if(A.message){m.text=A.message,m.x=t.startx+(t.stopx-t.startx)/2,m.y=t.sections[I].y+s+i,m.class="loopText",m.anchor="middle",m.valign="middle",m.tspan=!1,m.fontFamily=n,m.fontSize=r,m.fontWeight=p,m.wrap=t.wrap,W(m.text)?(t.starty=t.sections[I].y,await Ot(x,m,t)):wt(x,m);let v=Math.round(E.map(N=>(N._groups||N)[0][0].getBBox().height).reduce((N,$)=>N+$));t.sections[I].height+=v-(s+i)}}return t.height=Math.round(t.stopy-t.starty),x},"drawLoop"),ce=y(function(e,t){Ee(e,t)},"drawBackgroundRect"),sa=y(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"),ia=y(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"),oa=y(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"),na=y(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"),ca=y(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"),la=y(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"),ha=y(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"),le=y(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"),da=y(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),pt=(function(){function e(i,c,h,n,r,p,x){const u=c.append("text").attr("x",h+r/2).attr("y",n+p/2+5).style("text-anchor","middle").text(i);s(u,x)}y(e,"byText");function t(i,c,h,n,r,p,x,u){const{actorFontSize:m,actorFontFamily:E,actorFontWeight:I}=u,[A,v]=se(m),N=i.split(L.lineBreakRegex);for(let $=0;$<N.length;$++){const R=$*A-A*(N.length-1)/2,F=c.append("text").attr("x",h+r/2).attr("y",n).style("text-anchor","middle").style("font-size",v).style("font-weight",I).style("font-family",E);F.append("tspan").attr("x",h+r/2).attr("dy",R).text(N[$]),F.attr("y",n+p/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),s(F,x)}}y(t,"byTspan");function o(i,c,h,n,r,p,x,u){const m=c.append("switch"),E=m.append("foreignObject").attr("x",h).attr("y",n).attr("width",r).attr("height",p).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");E.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(i),t(i,m,h,n,r,p,x,u),s(E,x)}y(o,"byFo");async function a(i,c,h,n,r,p,x,u){const m=await kt(i,qt()),E=c.append("switch"),I=E.append("foreignObject").attr("x",h+r/2-m.width/2).attr("y",n+p/2-m.height/2).attr("width",m.width).attr("height",m.height).append("xhtml:div").style("height","100%").style("width","100%");I.append("div").style("text-align","center").style("vertical-align","middle").html(await ie(i,qt())),t(i,E,h,n,r,p,x,u),s(I,x)}y(a,"byKatex");function s(i,c){for(const h in c)c.hasOwnProperty(h)&&i.attr(h,c[h])}return y(s,"_setTextAttrs"),function(i,c=!1){return c?a:i.textPlacement==="fo"?o:i.textPlacement==="old"?e:t}})(),pa=(function(){function e(s,i,c,h,n,r,p){const x=i.append("text").attr("x",c).attr("y",h).style("text-anchor","start").text(s);a(x,p)}y(e,"byText");function t(s,i,c,h,n,r,p,x){const{actorFontSize:u,actorFontFamily:m,actorFontWeight:E}=x,I=s.split(L.lineBreakRegex);for(let A=0;A<I.length;A++){const v=A*u-u*(I.length-1)/2,N=i.append("text").attr("x",c).attr("y",h).style("text-anchor","start").style("font-size",u).style("font-weight",E).style("font-family",m);N.append("tspan").attr("x",c).attr("dy",v).text(I[A]),N.attr("y",h+r/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),a(N,p)}}y(t,"byTspan");function o(s,i,c,h,n,r,p,x){const u=i.append("switch"),m=u.append("foreignObject").attr("x",c).attr("y",h).attr("width",n).attr("height",r).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");m.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(s),t(s,u,c,h,n,r,p,x),a(m,p)}y(o,"byFo");function a(s,i){for(const c in i)i.hasOwnProperty(c)&&s.attr(c,i[c])}return y(a,"_setTextAttrs"),function(s){return s.textPlacement==="fo"?o:s.textPlacement==="old"?e:t}})(),C={drawRect:It,drawText:wt,drawLabel:oe,drawActor:Je,drawBox:ta,drawPopup:ze,anchorElement:ea,drawActivation:aa,drawLoop:ra,drawBackgroundRect:ce,insertArrowHead:na,insertArrowFilledHead:ca,insertSequenceNumber:la,insertArrowCrossHead:ha,insertDatabaseIcon:sa,insertComputerIcon:ia,insertClockIcon:oa,getTextObj:le,getNoteRect:da,fixLifeLineHeights:ne,sanitizeUrl:re.sanitizeUrl},l={},T={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:y(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:y(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:y(function(e){this.boxes.push(e)},"addBox"),addActor:y(function(e){this.actors.push(e)},"addActor"),addLoop:y(function(e){this.loops.push(e)},"addLoop"),addMessage:y(function(e){this.messages.push(e)},"addMessage"),addNote:y(function(e){this.notes.push(e)},"addNote"),lastActor:y(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:y(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:y(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:y(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:y(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,pe(at())},"init"),updateVal:y(function(e,t,o,a){e[t]===void 0?e[t]=o:e[t]=a(o,e[t])},"updateVal"),updateBounds:y(function(e,t,o,a){const s=this;let i=0;function c(h){return y(function(n){i++;const r=s.sequenceItems.length-i+1;s.updateVal(n,"starty",t-r*l.boxMargin,Math.min),s.updateVal(n,"stopy",a+r*l.boxMargin,Math.max),s.updateVal(T.data,"startx",e-r*l.boxMargin,Math.min),s.updateVal(T.data,"stopx",o+r*l.boxMargin,Math.max),h!=="activation"&&(s.updateVal(n,"startx",e-r*l.boxMargin,Math.min),s.updateVal(n,"stopx",o+r*l.boxMargin,Math.max),s.updateVal(T.data,"starty",t-r*l.boxMargin,Math.min),s.updateVal(T.data,"stopy",a+r*l.boxMargin,Math.max))},"updateItemBounds")}y(c,"updateFn"),this.sequenceItems.forEach(c()),this.activations.forEach(c("activation"))},"updateBounds"),insert:y(function(e,t,o,a){const s=L.getMin(e,o),i=L.getMax(e,o),c=L.getMin(t,a),h=L.getMax(t,a);this.updateVal(T.data,"startx",s,Math.min),this.updateVal(T.data,"starty",c,Math.min),this.updateVal(T.data,"stopx",i,Math.max),this.updateVal(T.data,"stopy",h,Math.max),this.updateBounds(s,c,i,h)},"insert"),newActivation:y(function(e,t,o){const a=o.get(e.from),s=$t(e.from).length||0,i=a.x+a.width/2+(s-1)*l.activationWidth/2;this.activations.push({startx:i,starty:this.verticalPos+2,stopx:i+l.activationWidth,stopy:void 0,actor:e.from,anchored:C.anchorElement(t)})},"newActivation"),endActivation:y(function(e){const t=this.activations.map(function(o){return o.actor}).lastIndexOf(e.from);return this.activations.splice(t,1)[0]},"endActivation"),createLoop:y(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:y(function(e={message:void 0,wrap:!1,width:void 0},t){this.sequenceItems.push(this.createLoop(e,t))},"newLoop"),endLoop:y(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:y(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:y(function(e){const t=this.sequenceItems.pop();t.sections=t.sections||[],t.sectionTitles=t.sectionTitles||[],t.sections.push({y:T.getVerticalPos(),height:0}),t.sectionTitles.push(e),this.sequenceItems.push(t)},"addSectionToLoop"),saveVerticalPos:y(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:y(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:y(function(e){this.verticalPos=this.verticalPos+e,this.data.stopy=L.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:y(function(){return this.verticalPos},"getVerticalPos"),getBounds:y(function(){return{bounds:this.data,models:this.models}},"getBounds")},ga=y(async function(e,t){T.bumpVerticalPos(l.boxMargin),t.height=l.boxMargin,t.starty=T.getVerticalPos();const o=lt();o.x=t.startx,o.y=t.starty,o.width=t.width||l.width,o.class="note";const a=e.append("g"),s=C.drawRect(a,o),i=Ut();i.x=t.startx,i.y=t.starty,i.width=o.width,i.dy="1em",i.text=t.message,i.class="noteText",i.fontFamily=l.noteFontFamily,i.fontSize=l.noteFontSize,i.fontWeight=l.noteFontWeight,i.anchor=l.noteAlign,i.textMargin=l.noteMargin,i.valign="center";const c=W(i.text)?await Ot(a,i):wt(a,i),h=Math.round(c.map(n=>(n._groups||n)[0][0].getBBox().height).reduce((n,r)=>n+r));s.attr("height",h+2*l.noteMargin),t.height+=h+2*l.noteMargin,T.bumpVerticalPos(h+2*l.noteMargin),t.stopy=t.starty+h+2*l.noteMargin,t.stopx=t.startx+o.width,T.insert(t.startx,t.starty,t.stopx,t.stopy),T.models.addNote(t)},"drawNote"),ft=y(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),"messageFont"),Et=y(e=>({fontFamily:e.noteFontFamily,fontSize:e.noteFontSize,fontWeight:e.noteFontWeight}),"noteFont"),Ht=y(e=>({fontFamily:e.actorFontFamily,fontSize:e.actorFontSize,fontWeight:e.actorFontWeight}),"actorFont");async function he(e,t){T.bumpVerticalPos(10);const{startx:o,stopx:a,message:s}=t,i=L.splitBreaks(s).length,c=W(s),h=c?await kt(s,at()):Y.calculateTextDimensions(s,ft(l));if(!c){const x=h.height/i;t.height+=x,T.bumpVerticalPos(x)}let n,r=h.height-10;const p=h.width;if(o===a){n=T.getVerticalPos()+r,l.rightAngles||(r+=l.boxMargin,n=T.getVerticalPos()+r),r+=30;const x=L.getMax(p/2,l.width/2);T.insert(o-x,T.getVerticalPos()-10+r,a+x,T.getVerticalPos()+30+r)}else r+=l.boxMargin,n=T.getVerticalPos()+r,T.insert(o,n-10,a,n);return T.bumpVerticalPos(r),t.height+=r,t.stopy=t.starty+t.height,T.insert(t.fromBounds,t.starty,t.toBounds,t.stopy),n}y(he,"boundMessage");var ua=y(async function(e,t,o,a){const{startx:s,stopx:i,starty:c,message:h,type:n,sequenceIndex:r,sequenceVisible:p}=t,x=Y.calculateTextDimensions(h,ft(l)),u=Ut();u.x=s,u.y=c+10,u.width=i-s,u.class="messageText",u.dy="1em",u.text=h,u.fontFamily=l.messageFontFamily,u.fontSize=l.messageFontSize,u.fontWeight=l.messageFontWeight,u.anchor=l.messageAlign,u.valign="center",u.textMargin=l.wrapPadding,u.tspan=!1,W(u.text)?await Ot(e,u,{startx:s,stopx:i,starty:o}):wt(e,u);const m=x.width;let E;s===i?l.rightAngles?E=e.append("path").attr("d",`M ${s},${o} H ${s+L.getMax(l.width/2,m/2)} V ${o+25} H ${s}`):E=e.append("path").attr("d","M "+s+","+o+" C "+(s+60)+","+(o-10)+" "+(s+60)+","+(o+30)+" "+s+","+(o+20)):(E=e.append("line"),E.attr("x1",s),E.attr("y1",o),E.attr("x2",i),E.attr("y2",o)),n===a.db.LINETYPE.DOTTED||n===a.db.LINETYPE.DOTTED_CROSS||n===a.db.LINETYPE.DOTTED_POINT||n===a.db.LINETYPE.DOTTED_OPEN||n===a.db.LINETYPE.BIDIRECTIONAL_DOTTED?(E.style("stroke-dasharray","3, 3"),E.attr("class","messageLine1")):E.attr("class","messageLine0");let I="";l.arrowMarkerAbsolute&&(I=$e(!0)),E.attr("stroke-width",2),E.attr("stroke","none"),E.style("fill","none"),(n===a.db.LINETYPE.SOLID||n===a.db.LINETYPE.DOTTED)&&E.attr("marker-end","url("+I+"#arrowhead)"),(n===a.db.LINETYPE.BIDIRECTIONAL_SOLID||n===a.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(E.attr("marker-start","url("+I+"#arrowhead)"),E.attr("marker-end","url("+I+"#arrowhead)")),(n===a.db.LINETYPE.SOLID_POINT||n===a.db.LINETYPE.DOTTED_POINT)&&E.attr("marker-end","url("+I+"#filled-head)"),(n===a.db.LINETYPE.SOLID_CROSS||n===a.db.LINETYPE.DOTTED_CROSS)&&E.attr("marker-end","url("+I+"#crosshead)"),(p||l.showSequenceNumbers)&&((n===a.db.LINETYPE.BIDIRECTIONAL_SOLID||n===a.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(s<i?E.attr("x1",s+12):E.attr("x1",s+6)),e.append("line").attr("x1",s).attr("y1",o).attr("x2",s).attr("y2",o).attr("stroke-width",0).attr("marker-start","url("+I+"#sequencenumber)"),e.append("text").attr("x",s).attr("y",o+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(r))},"drawMessage"),xa=y(function(e,t,o,a,s,i,c){let h=0,n=0,r,p=0;for(const x of a){const u=t.get(x),m=u.box;r&&r!=m&&(c||T.models.addBox(r),n+=l.boxMargin+r.margin),m&&m!=r&&(c||(m.x=h+n,m.y=s),n+=m.margin),u.width=u.width||l.width,u.height=L.getMax(u.height||l.height,l.height),u.margin=u.margin||l.actorMargin,p=L.getMax(p,u.height),o.get(u.name)&&(n+=u.width/2),u.x=h+n,u.starty=T.getVerticalPos(),T.insert(u.x,s,u.x+u.width,u.height),h+=u.width+n,u.box&&(u.box.width=h+m.margin-u.box.x),n=u.margin,r=u.box,T.models.addActor(u)}r&&!c&&T.models.addBox(r),T.bumpVerticalPos(p)},"addActorRenderingData"),jt=y(async function(e,t,o,a){if(a){let s=0;T.bumpVerticalPos(l.boxMargin*2);for(const i of o){const c=t.get(i);c.stopy||(c.stopy=T.getVerticalPos());const h=await C.drawActor(e,c,l,!0);s=L.getMax(s,h)}T.bumpVerticalPos(s+l.boxMargin)}else for(const s of o){const i=t.get(s);await C.drawActor(e,i,l,!1)}},"drawActors"),de=y(function(e,t,o,a){let s=0,i=0;for(const c of o){const h=t.get(c),n=ma(h),r=C.drawPopup(e,h,n,l,l.forceMenus,a);r.height>s&&(s=r.height),r.width+h.x>i&&(i=r.width+h.x)}return{maxHeight:s,maxWidth:i}},"drawActorsPopup"),pe=y(function(e){Le(l,e),e.fontFamily&&(l.actorFontFamily=l.noteFontFamily=l.messageFontFamily=e.fontFamily),e.fontSize&&(l.actorFontSize=l.noteFontSize=l.messageFontSize=e.fontSize),e.fontWeight&&(l.actorFontWeight=l.noteFontWeight=l.messageFontWeight=e.fontWeight)},"setConf"),$t=y(function(e){return T.activations.filter(function(t){return t.actor===e})},"actorActivations"),ae=y(function(e,t){const o=t.get(e),a=$t(e),s=a.reduce(function(c,h){return L.getMin(c,h.startx)},o.x+o.width/2-1),i=a.reduce(function(c,h){return L.getMax(c,h.stopx)},o.x+o.width/2+1);return[s,i]},"activationBounds");function ot(e,t,o,a,s){T.bumpVerticalPos(o);let i=a;if(t.id&&t.message&&e[t.id]){const c=e[t.id].width,h=ft(l);t.message=Y.wrapLabel(`[${t.message}]`,c-2*l.wrapPadding,h),t.width=c,t.wrap=!0;const n=Y.calculateTextDimensions(t.message,h),r=L.getMax(n.height,l.labelBoxHeight);i=a+r,X.debug(`${r} - ${t.message}`)}s(t),T.bumpVerticalPos(i)}y(ot,"adjustLoopHeightForWrap");function ge(e,t,o,a,s,i,c){function h(p,x){p.x<s.get(e.from).x?(T.insert(t.stopx-x,t.starty,t.startx,t.stopy+p.height/2+l.noteMargin),t.stopx=t.stopx+x):(T.insert(t.startx,t.starty,t.stopx+x,t.stopy+p.height/2+l.noteMargin),t.stopx=t.stopx-x)}y(h,"receiverAdjustment");function n(p,x){p.x<s.get(e.to).x?(T.insert(t.startx-x,t.starty,t.stopx,t.stopy+p.height/2+l.noteMargin),t.startx=t.startx+x):(T.insert(t.stopx,t.starty,t.startx+x,t.stopy+p.height/2+l.noteMargin),t.startx=t.startx-x)}y(n,"senderAdjustment");const r=[Mt.ACTOR,Mt.CONTROL,Mt.ENTITY,Mt.DATABASE];if(i.get(e.to)==a){const p=s.get(e.to),x=r.includes(p.type)?Tt/2+3:p.width/2+3;h(p,x),p.starty=o-p.height/2,T.bumpVerticalPos(p.height/2)}else if(c.get(e.from)==a){const p=s.get(e.from);if(l.mirrorActors){const x=r.includes(p.type)?Tt/2:p.width/2;n(p,x)}p.stopy=o-p.height/2,T.bumpVerticalPos(p.height/2)}else if(c.get(e.to)==a){const p=s.get(e.to);if(l.mirrorActors){const x=r.includes(p.type)?Tt/2+3:p.width/2+3;h(p,x)}p.stopy=o-p.height/2,T.bumpVerticalPos(p.height/2)}}y(ge,"adjustCreatedDestroyedData");var ya=y(async function(e,t,o,a){const{securityLevel:s,sequence:i}=at();l=i;let c;s==="sandbox"&&(c=Nt("#i"+t));const h=s==="sandbox"?Nt(c.nodes()[0].contentDocument.body):Nt("body"),n=s==="sandbox"?c.nodes()[0].contentDocument:document;T.init(),X.debug(a.db);const r=s==="sandbox"?h.select(`[id="${t}"]`):Nt(`[id="${t}"]`),p=a.db.getActors(),x=a.db.getCreatedActors(),u=a.db.getDestroyedActors(),m=a.db.getBoxes();let E=a.db.getActorKeys();const I=a.db.getMessages(),A=a.db.getDiagramTitle(),v=a.db.hasAtLeastOneBox(),N=a.db.hasAtLeastOneBoxWithTitle(),$=await ue(p,I,a);if(l.height=await xe(p,$,m),C.insertComputerIcon(r),C.insertDatabaseIcon(r),C.insertClockIcon(r),v&&(T.bumpVerticalPos(l.boxMargin),N&&T.bumpVerticalPos(m[0].textMaxHeight)),l.hideUnusedParticipants===!0){const f=new Set;I.forEach(P=>{f.add(P.from),f.add(P.to)}),E=E.filter(P=>f.has(P))}xa(r,p,x,E,0,I,!1);const R=await ba(I,p,$,a);C.insertArrowHead(r),C.insertArrowCrossHead(r),C.insertArrowFilledHead(r),C.insertSequenceNumber(r);function F(f,P){const U=T.endActivation(f);U.starty+18>P&&(U.starty=P-6,P+=12),C.drawActivation(r,U,P,l,$t(f.from).length),T.insert(U.startx,P-10,U.stopx,P)}y(F,"activeEnd");let q=1,Z=1;const rt=[],z=[];let H=0;for(const f of I){let P,U,tt;switch(f.type){case a.db.LINETYPE.NOTE:T.resetVerticalPos(),U=f.noteModel,await ga(r,U);break;case a.db.LINETYPE.ACTIVE_START:T.newActivation(f,r,p);break;case a.db.LINETYPE.ACTIVE_END:F(f,T.getVerticalPos());break;case a.db.LINETYPE.LOOP_START:ot(R,f,l.boxMargin,l.boxMargin+l.boxTextMargin,O=>T.newLoop(O));break;case a.db.LINETYPE.LOOP_END:P=T.endLoop(),await C.drawLoop(r,P,"loop",l),T.bumpVerticalPos(P.stopy-T.getVerticalPos()),T.models.addLoop(P);break;case a.db.LINETYPE.RECT_START:ot(R,f,l.boxMargin,l.boxMargin,O=>T.newLoop(void 0,O.message));break;case a.db.LINETYPE.RECT_END:P=T.endLoop(),z.push(P),T.models.addLoop(P),T.bumpVerticalPos(P.stopy-T.getVerticalPos());break;case a.db.LINETYPE.OPT_START:ot(R,f,l.boxMargin,l.boxMargin+l.boxTextMargin,O=>T.newLoop(O));break;case a.db.LINETYPE.OPT_END:P=T.endLoop(),await C.drawLoop(r,P,"opt",l),T.bumpVerticalPos(P.stopy-T.getVerticalPos()),T.models.addLoop(P);break;case a.db.LINETYPE.ALT_START:ot(R,f,l.boxMargin,l.boxMargin+l.boxTextMargin,O=>T.newLoop(O));break;case a.db.LINETYPE.ALT_ELSE:ot(R,f,l.boxMargin+l.boxTextMargin,l.boxMargin,O=>T.addSectionToLoop(O));break;case a.db.LINETYPE.ALT_END:P=T.endLoop(),await C.drawLoop(r,P,"alt",l),T.bumpVerticalPos(P.stopy-T.getVerticalPos()),T.models.addLoop(P);break;case a.db.LINETYPE.PAR_START:case a.db.LINETYPE.PAR_OVER_START:ot(R,f,l.boxMargin,l.boxMargin+l.boxTextMargin,O=>T.newLoop(O)),T.saveVerticalPos();break;case a.db.LINETYPE.PAR_AND:ot(R,f,l.boxMargin+l.boxTextMargin,l.boxMargin,O=>T.addSectionToLoop(O));break;case a.db.LINETYPE.PAR_END:P=T.endLoop(),await C.drawLoop(r,P,"par",l),T.bumpVerticalPos(P.stopy-T.getVerticalPos()),T.models.addLoop(P);break;case a.db.LINETYPE.AUTONUMBER:q=f.message.start||q,Z=f.message.step||Z,f.message.visible?a.db.enableSequenceNumbers():a.db.disableSequenceNumbers();break;case a.db.LINETYPE.CRITICAL_START:ot(R,f,l.boxMargin,l.boxMargin+l.boxTextMargin,O=>T.newLoop(O));break;case a.db.LINETYPE.CRITICAL_OPTION:ot(R,f,l.boxMargin+l.boxTextMargin,l.boxMargin,O=>T.addSectionToLoop(O));break;case a.db.LINETYPE.CRITICAL_END:P=T.endLoop(),await C.drawLoop(r,P,"critical",l),T.bumpVerticalPos(P.stopy-T.getVerticalPos()),T.models.addLoop(P);break;case a.db.LINETYPE.BREAK_START:ot(R,f,l.boxMargin,l.boxMargin+l.boxTextMargin,O=>T.newLoop(O));break;case a.db.LINETYPE.BREAK_END:P=T.endLoop(),await C.drawLoop(r,P,"break",l),T.bumpVerticalPos(P.stopy-T.getVerticalPos()),T.models.addLoop(P);break;default:try{tt=f.msgModel,tt.starty=T.getVerticalPos(),tt.sequenceIndex=q,tt.sequenceVisible=a.db.showSequenceNumbers();const O=await he(r,tt);ge(f,tt,O,H,p,x,u),rt.push({messageModel:tt,lineStartY:O}),T.models.addMessage(tt)}catch(O){X.error("error while drawing message",O)}}[a.db.LINETYPE.SOLID_OPEN,a.db.LINETYPE.DOTTED_OPEN,a.db.LINETYPE.SOLID,a.db.LINETYPE.DOTTED,a.db.LINETYPE.SOLID_CROSS,a.db.LINETYPE.DOTTED_CROSS,a.db.LINETYPE.SOLID_POINT,a.db.LINETYPE.DOTTED_POINT,a.db.LINETYPE.BIDIRECTIONAL_SOLID,a.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(f.type)&&(q=q+Z),H++}X.debug("createdActors",x),X.debug("destroyedActors",u),await jt(r,p,E,!1);for(const f of rt)await ua(r,f.messageModel,f.lineStartY,a);l.mirrorActors&&await jt(r,p,E,!0),z.forEach(f=>C.drawBackgroundRect(r,f)),ne(r,p,E,l);for(const f of T.models.boxes){f.height=T.getVerticalPos()-f.y,T.insert(f.x,f.y,f.x+f.width,f.height);const P=l.boxMargin*2;f.startx=f.x-P,f.starty=f.y-P*.25,f.stopx=f.startx+f.width+2*P,f.stopy=f.starty+f.height+P*.75,f.stroke="rgb(0,0,0, 0.5)",C.drawBox(r,f,l)}v&&T.bumpVerticalPos(l.boxMargin);const V=de(r,p,E,n),{bounds:D}=T.getBounds();D.startx===void 0&&(D.startx=0),D.starty===void 0&&(D.starty=0),D.stopx===void 0&&(D.stopx=0),D.stopy===void 0&&(D.stopy=0);let Q=D.stopy-D.starty;Q<V.maxHeight&&(Q=V.maxHeight);let j=Q+2*l.diagramMarginY;l.mirrorActors&&(j=j-l.boxMargin+l.bottomMarginAdj);let J=D.stopx-D.startx;J<V.maxWidth&&(J=V.maxWidth);const st=J+2*l.diagramMarginX;A&&r.append("text").text(A).attr("x",(D.stopx-D.startx)/2-2*l.diagramMarginX).attr("y",-25),ke(r,j,st,l.useMaxWidth);const S=A?40:0;r.attr("viewBox",D.startx-l.diagramMarginX+" -"+(l.diagramMarginY+S)+" "+st+" "+(j+S)),X.debug("models:",T.models)},"draw");async function ue(e,t,o){const a={};for(const s of t)if(e.get(s.to)&&e.get(s.from)){const i=e.get(s.to);if(s.placement===o.db.PLACEMENT.LEFTOF&&!i.prevActor||s.placement===o.db.PLACEMENT.RIGHTOF&&!i.nextActor)continue;const c=s.placement!==void 0,h=!c,n=c?Et(l):ft(l),r=s.wrap?Y.wrapLabel(s.message,l.width-2*l.wrapPadding,n):s.message,p=(W(r)?await kt(s.message,at()):Y.calculateTextDimensions(r,n)).width+2*l.wrapPadding;h&&s.from===i.nextActor?a[s.to]=L.getMax(a[s.to]||0,p):h&&s.from===i.prevActor?a[s.from]=L.getMax(a[s.from]||0,p):h&&s.from===s.to?(a[s.from]=L.getMax(a[s.from]||0,p/2),a[s.to]=L.getMax(a[s.to]||0,p/2)):s.placement===o.db.PLACEMENT.RIGHTOF?a[s.from]=L.getMax(a[s.from]||0,p):s.placement===o.db.PLACEMENT.LEFTOF?a[i.prevActor]=L.getMax(a[i.prevActor]||0,p):s.placement===o.db.PLACEMENT.OVER&&(i.prevActor&&(a[i.prevActor]=L.getMax(a[i.prevActor]||0,p/2)),i.nextActor&&(a[s.from]=L.getMax(a[s.from]||0,p/2)))}return X.debug("maxMessageWidthPerActor:",a),a}y(ue,"getMaxMessageWidthPerActor");var ma=y(function(e){let t=0;const o=Ht(l);for(const a in e.links){const s=Y.calculateTextDimensions(a,o).width+2*l.wrapPadding+2*l.boxMargin;t<s&&(t=s)}return t},"getRequiredPopupWidth");async function xe(e,t,o){let a=0;for(const i of e.keys()){const c=e.get(i);c.wrap&&(c.description=Y.wrapLabel(c.description,l.width-2*l.wrapPadding,Ht(l)));const h=W(c.description)?await kt(c.description,at()):Y.calculateTextDimensions(c.description,Ht(l));c.width=c.wrap?l.width:L.getMax(l.width,h.width+2*l.wrapPadding),c.height=c.wrap?L.getMax(h.height,l.height):l.height,a=L.getMax(a,c.height)}for(const i in t){const c=e.get(i);if(!c)continue;const h=e.get(c.nextActor);if(!h){const r=t[i]+l.actorMargin-c.width/2;c.margin=L.getMax(r,l.actorMargin);continue}const n=t[i]+l.actorMargin-c.width/2-h.width/2;c.margin=L.getMax(n,l.actorMargin)}let s=0;return o.forEach(i=>{const c=ft(l);let h=i.actorKeys.reduce((x,u)=>x+=e.get(u).width+(e.get(u).margin||0),0);const n=l.boxMargin*8;h+=n,h-=2*l.boxTextMargin,i.wrap&&(i.name=Y.wrapLabel(i.name,h-2*l.wrapPadding,c));const r=Y.calculateTextDimensions(i.name,c);s=L.getMax(r.height,s);const p=L.getMax(h,r.width+2*l.wrapPadding);if(i.margin=l.boxTextMargin,h<p){const x=(p-h)/2;i.margin+=x}}),o.forEach(i=>i.textMaxHeight=s),L.getMax(a,l.height)}y(xe,"calculateActorMargins");var Ta=y(async function(e,t,o){const a=t.get(e.from),s=t.get(e.to),i=a.x,c=s.x,h=e.wrap&&e.message;let n=W(e.message)?await kt(e.message,at()):Y.calculateTextDimensions(h?Y.wrapLabel(e.message,l.width,Et(l)):e.message,Et(l));const r={width:h?l.width:L.getMax(l.width,n.width+2*l.noteMargin),height:0,startx:a.x,stopx:0,starty:0,stopy:0,message:e.message};return e.placement===o.db.PLACEMENT.RIGHTOF?(r.width=h?L.getMax(l.width,n.width):L.getMax(a.width/2+s.width/2,n.width+2*l.noteMargin),r.startx=i+(a.width+l.actorMargin)/2):e.placement===o.db.PLACEMENT.LEFTOF?(r.width=h?L.getMax(l.width,n.width+2*l.noteMargin):L.getMax(a.width/2+s.width/2,n.width+2*l.noteMargin),r.startx=i-r.width+(a.width-l.actorMargin)/2):e.to===e.from?(n=Y.calculateTextDimensions(h?Y.wrapLabel(e.message,L.getMax(l.width,a.width),Et(l)):e.message,Et(l)),r.width=h?L.getMax(l.width,a.width):L.getMax(a.width,l.width,n.width+2*l.noteMargin),r.startx=i+(a.width-r.width)/2):(r.width=Math.abs(i+a.width/2-(c+s.width/2))+l.actorMargin,r.startx=i<c?i+a.width/2-l.actorMargin/2:c+s.width/2-l.actorMargin/2),h&&(r.message=Y.wrapLabel(e.message,r.width-2*l.wrapPadding,Et(l))),X.debug(`NM:[${r.startx},${r.stopx},${r.starty},${r.stopy}:${r.width},${r.height}=${e.message}]`),r},"buildNoteModel"),fa=y(function(e,t,o){if(![o.db.LINETYPE.SOLID_OPEN,o.db.LINETYPE.DOTTED_OPEN,o.db.LINETYPE.SOLID,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))return{};const[a,s]=ae(e.from,t),[i,c]=ae(e.to,t),h=a<=i;let n=h?s:a,r=h?i:c;const p=Math.abs(i-c)>2,x=y(I=>h?-I:I,"adjustValue");e.from===e.to?r=n:(e.activate&&!p&&(r+=x(l.activationWidth/2-1)),[o.db.LINETYPE.SOLID_OPEN,o.db.LINETYPE.DOTTED_OPEN].includes(e.type)||(r+=x(3)),[o.db.LINETYPE.BIDIRECTIONAL_SOLID,o.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(e.type)&&(n-=x(3)));const u=[a,s,i,c],m=Math.abs(n-r);e.wrap&&e.message&&(e.message=Y.wrapLabel(e.message,L.getMax(m+2*l.wrapPadding,l.width),ft(l)));const E=Y.calculateTextDimensions(e.message,ft(l));return{width:L.getMax(e.wrap?0:E.width+2*l.wrapPadding,m+2*l.wrapPadding,l.width),height:0,startx:n,stopx:r,starty:0,stopy:0,message:e.message,type:e.type,wrap:e.wrap,fromBounds:Math.min.apply(null,u),toBounds:Math.max.apply(null,u)}},"buildMessageModel"),ba=y(async function(e,t,o,a){const s={},i=[];let c,h,n;for(const r of e){switch(r.type){case a.db.LINETYPE.LOOP_START:case a.db.LINETYPE.ALT_START:case a.db.LINETYPE.OPT_START:case a.db.LINETYPE.PAR_START:case a.db.LINETYPE.PAR_OVER_START:case a.db.LINETYPE.CRITICAL_START:case a.db.LINETYPE.BREAK_START:i.push({id:r.id,msg:r.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case a.db.LINETYPE.ALT_ELSE:case a.db.LINETYPE.PAR_AND:case a.db.LINETYPE.CRITICAL_OPTION:r.message&&(c=i.pop(),s[c.id]=c,s[r.id]=c,i.push(c));break;case a.db.LINETYPE.LOOP_END:case a.db.LINETYPE.ALT_END:case a.db.LINETYPE.OPT_END:case a.db.LINETYPE.PAR_END:case a.db.LINETYPE.CRITICAL_END:case a.db.LINETYPE.BREAK_END:c=i.pop(),s[c.id]=c;break;case a.db.LINETYPE.ACTIVE_START:{const p=t.get(r.from?r.from:r.to.actor),x=$t(r.from?r.from:r.to.actor).length,u=p.x+p.width/2+(x-1)*l.activationWidth/2,m={startx:u,stopx:u+l.activationWidth,actor:r.from,enabled:!0};T.activations.push(m)}break;case a.db.LINETYPE.ACTIVE_END:{const p=T.activations.map(x=>x.actor).lastIndexOf(r.from);T.activations.splice(p,1).splice(0,1)}break}r.placement!==void 0?(h=await Ta(r,t,a),r.noteModel=h,i.forEach(p=>{c=p,c.from=L.getMin(c.from,h.startx),c.to=L.getMax(c.to,h.startx+h.width),c.width=L.getMax(c.width,Math.abs(c.from-c.to))-l.labelBoxWidth})):(n=fa(r,t,a),r.msgModel=n,n.startx&&n.stopx&&i.length>0&&i.forEach(p=>{if(c=p,n.startx===n.stopx){const x=t.get(r.from),u=t.get(r.to);c.from=L.getMin(x.x-n.width/2,x.x-x.width/2,c.from),c.to=L.getMax(u.x+n.width/2,u.x+x.width/2,c.to),c.width=L.getMax(c.width,Math.abs(c.to-c.from))-l.labelBoxWidth}else c.from=L.getMin(n.startx,c.from),c.to=L.getMax(n.stopx,c.to),c.width=L.getMax(c.width,n.width)-l.labelBoxWidth}))}return T.activations=[],X.debug("Loop type widths:",s),s},"calculateLoopBounds"),Ea={bounds:T,drawActors:jt,drawActorsPopup:de,setConf:pe,draw:ya},La={parser:Ce,get db(){return new Fe},renderer:Ea,styles:qe,init:y(e=>{e.sequence||(e.sequence={}),e.wrap&&(e.sequence.wrap=e.wrap,Ie({sequence:{wrap:e.wrap}}))},"init")};export{La as diagram};