@marimo-team/frontend 0.12.1-dev7 → 0.12.2-dev0

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 (126) hide show
  1. package/dist/assets/{ConnectedDataExplorerComponent-CJruiifD.js → ConnectedDataExplorerComponent-DH5ZbYrC.js} +3 -3
  2. package/dist/assets/{VegaLite-BE8iaI6d.js → VegaLite-CqOylRLI.js} +1 -1
  3. package/dist/assets/{_baseEach-CHGr95h3.js → _baseEach-BzH38Sp_.js} +1 -1
  4. package/dist/assets/_baseMap-DjT4lYOc.js +1 -0
  5. package/dist/assets/{_baseUniq-DBsNFMLI.js → _baseUniq-CY3x7HaT.js} +1 -1
  6. package/dist/assets/any-language-editor-DLIQ9my5.js +1 -0
  7. package/dist/assets/architectureDiagram-IEHRJDOE-CB56_o2R.js +1 -0
  8. package/dist/assets/{blockDiagram-ZHA2E4KO-9FMsNisX.js → blockDiagram-JOT3LUYC-DMeY-hk_.js} +1 -1
  9. package/dist/assets/{c4Diagram-6F5ED5ID-Bbqvpa8H.js → c4Diagram-VJAJSXHY-hRpC0S1O.js} +1 -1
  10. package/dist/assets/channel-DmtkKWTN.js +1 -0
  11. package/dist/assets/{chunk-TMUBEWPD-D_YLueZ5.js → chunk-4BMEZGHF-CVdVWGhL.js} +1 -1
  12. package/dist/assets/chunk-A2AXSNBT-OizHFng3.js +1 -0
  13. package/dist/assets/chunk-AEK57VVT-w-eOM2q4.js +1 -0
  14. package/dist/assets/{chunk-ASOPGD6M-DewGTxkr.js → chunk-D6G4REZN-C73OEprJ.js} +1 -1
  15. package/dist/assets/{chunk-5HRBRIJM-X4M2qmib.js → chunk-RZ5BOZE2-DqIGT4rs.js} +1 -1
  16. package/dist/assets/{chunk-KFBOBJHC-DOfnAPal.js → chunk-XZIHB7SX-CG0-CWOU.js} +1 -1
  17. package/dist/assets/classDiagram-GIVACNV2-CfeZvByo.js +1 -0
  18. package/dist/assets/classDiagram-v2-COTLJTTW-CfeZvByo.js +1 -0
  19. package/dist/assets/{clike-D5G9EsPi.js → clike-BgBwzOhw.js} +1 -1
  20. package/dist/assets/clone-DTEBEvnL.js +1 -0
  21. package/dist/assets/compile-nrUCUaEj.js +1 -0
  22. package/dist/assets/{dagre-4EVJKHTY-DiF_5n5x.js → dagre-OKDRZEBW-wmlnyGhA.js} +1 -1
  23. package/dist/assets/{data-editor-CGJ9_7_q.js → data-editor-UuJmRWnv.js} +1 -1
  24. package/dist/assets/diagram-SSKATNLV-B_7NdPs4.js +1 -0
  25. package/dist/assets/diagram-VNBRO52H-DV58Md1i.js +1 -0
  26. package/dist/assets/{dockerfile-DbSFhNEh.js → dockerfile-knGOOxt4.js} +1 -1
  27. package/dist/assets/edit-page-D23cAA_b.js +8 -0
  28. package/dist/assets/erDiagram-Q7BY3M3F-CCsx5S8S.js +1 -0
  29. package/dist/assets/{factor-D9hSz2Dc.js → factor-CFXhaUWb.js} +1 -1
  30. package/dist/assets/flowDiagram-4HSFHLVR-Cmw4InAv.js +1 -0
  31. package/dist/assets/ganttDiagram-APWFNJXF-CUXoJvZi.js +1 -0
  32. package/dist/assets/gitGraphDiagram-7IBYFJ6S-bVhXoX-A.js +1 -0
  33. package/dist/assets/{graph-4-Vg1Aiz.js → graph-BKTSw2wq.js} +1 -1
  34. package/dist/assets/groovy-DnIzCrpZ.js +1 -0
  35. package/dist/assets/home-page-DpLd23-7.js +7 -0
  36. package/dist/assets/{index-CYjr_k0H.js → index-B0UUwW95.js} +1 -1
  37. package/dist/assets/{index-DKriXlXA.js → index-BGdPp0Cn.js} +1 -1
  38. package/dist/assets/{index-CZQNf_us.js → index-BVO5Z1by.js} +1 -1
  39. package/dist/assets/{index-DwShl_Rl.js → index-BvYl2Yh7.js} +1 -1
  40. package/dist/assets/{index-CkAdNdK9.js → index-C74BbPKL.js} +1 -1
  41. package/dist/assets/index-CO0_ST9I.css +1 -0
  42. package/dist/assets/{index-BEGeiwsG.js → index-COhzp1RT.js} +1 -1
  43. package/dist/assets/index-CgOL2ukR.js +80 -0
  44. package/dist/assets/{index-Ddv63gQw.js → index-D0ZBBPL4.js} +1 -1
  45. package/dist/assets/{index-DxHC9_BU.js → index-D8itExYe.js} +1 -1
  46. package/dist/assets/{index-DoaFBt3g.js → index-DBzmtCf-.js} +1 -1
  47. package/dist/assets/{index-CO1xz3xH.js → index-DHkQBGm2.js} +1 -1
  48. package/dist/assets/{index-CHAfPpeC.js → index-DLxTLMes.js} +1 -1
  49. package/dist/assets/{index-DRtvMp6Z.js → index-Da4CPBUq.js} +1 -1
  50. package/dist/assets/{index-DuktNpRm.js → index-DsIW4wXy.js} +1 -1
  51. package/dist/assets/{index-BiPdUed2.js → index-lw90K3eA.js} +1 -1
  52. package/dist/assets/{index-CWohOS_e.js → index-xCxEAfll.js} +1 -1
  53. package/dist/assets/{index-BH9A8KuI.js → index-xexrMY4N.js} +1 -1
  54. package/dist/assets/infoDiagram-PH2N3AL5-D4FnotP8.js +1 -0
  55. package/dist/assets/journeyDiagram-U35MCT3I-D0WSgJfQ.js +1 -0
  56. package/dist/assets/{kanban-definition-QRCXZQQD-ELngktM2.js → kanban-definition-NDS4AKOZ-aemz4AVh.js} +1 -1
  57. package/dist/assets/{layout-CGBTZO_E.js → layout-L7EZG6r9.js} +1 -1
  58. package/dist/assets/{linear-BbegsqX1.js → linear-CZJIBoI7.js} +1 -1
  59. package/dist/assets/mermaid-CW33B1NW.js +7 -0
  60. package/dist/assets/{min-CABlFD1H.js → min-DNMLpmWf.js} +1 -1
  61. package/dist/assets/{mindmap-definition-GWI6TPTV-DLlhxG7q.js → mindmap-definition-ALO5MXBD-MJZJ01ZR.js} +1 -1
  62. package/dist/assets/{nsis-CKXvuz-E.js → nsis-BvKfQ9lQ.js} +1 -1
  63. package/dist/assets/{pascal-CZ0JYm71.js → pascal-CafrKXZF.js} +1 -1
  64. package/dist/assets/pieDiagram-IB7DONF6-CZggFvpv.js +1 -0
  65. package/dist/assets/{quadrantDiagram-OS5C2QUG-DNcT7n4n.js → quadrantDiagram-7GDLP6J5-rC8fvq5g.js} +1 -1
  66. package/dist/assets/radar-MK3ICKWK-DpC3zQeN.js +1 -0
  67. package/dist/assets/{react-plotly-D49PuaDp.js → react-plotly-CkRRqO-d.js} +1 -1
  68. package/dist/assets/requirementDiagram-KVF5MWMF-DRNBxk2d.js +1 -0
  69. package/dist/assets/{run-page-_t2pqoib.js → run-page-CAKIohPx.js} +1 -1
  70. package/dist/assets/sankeyDiagram-QLVOVGJD-BAoPWYvb.js +1 -0
  71. package/dist/assets/{save-worker-0eT1yQHS.js → save-worker-B6ZkLmYM.js} +1 -1
  72. package/dist/assets/sequenceDiagram-X6HHIX6F-C9p2rQOg.js +1 -0
  73. package/dist/assets/simple-mode-C3vEBAcb.js +1 -0
  74. package/dist/assets/slides-component-l11PxgwQ.js +1 -0
  75. package/dist/assets/{sortBy-DeAoOjrt.js → sortBy-DmL0RP-s.js} +1 -1
  76. package/dist/assets/stateDiagram-DGXRK772-DFE330Og.js +1 -0
  77. package/dist/assets/stateDiagram-v2-YXO3MK2T-BQH2L1vE.js +1 -0
  78. package/dist/assets/{terminal-B5M_jESV.js → terminal-mBVRpajm.js} +1 -1
  79. package/dist/assets/{time-Cg9ECQUX.js → time-RSZWRAwt.js} +1 -1
  80. package/dist/assets/{timeline-definition-U7ZMHBDA-bNrrM9Xd.js → timeline-definition-BDJGKUSR-CFGxLo_L.js} +1 -1
  81. package/dist/assets/tree-DEJQppfu.js +8 -0
  82. package/dist/assets/trino-DFsJbQoT.svg +1 -0
  83. package/dist/assets/useMarimoWebSocket-STdOtLS2.js +15 -0
  84. package/dist/assets/{vega-component-DBMPlOJo.js → vega-component-OFtEUb_m.js} +1 -1
  85. package/dist/assets/{worker-BRIXAPM-.js → worker-7jWLhkbK.js} +1 -1
  86. package/dist/assets/{worker-DDT5omi0.js → worker-BIkRtffW.js} +1 -1
  87. package/dist/assets/xquery-CVDBqZPY.js +1 -0
  88. package/dist/assets/{xychartDiagram-6QU3TZC5-vQAUXteB.js → xychartDiagram-VJFVF3MP-iGAMdGFC.js} +1 -1
  89. package/dist/index.html +2 -2
  90. package/package.json +26 -24
  91. package/dist/assets/_baseMap-CJD4EB23.js +0 -1
  92. package/dist/assets/any-language-editor-C44KD8Jd.js +0 -1
  93. package/dist/assets/architectureDiagram-UYN6MBPD-BgbOosfX.js +0 -1
  94. package/dist/assets/channel-Cr4w4fr-.js +0 -1
  95. package/dist/assets/chunk-7U56Z5CX-C5qQ_O2_.js +0 -1
  96. package/dist/assets/chunk-T2TOU4HS-DrSTkPX7.js +0 -1
  97. package/dist/assets/classDiagram-LNE6IOMH-D--jW1ZB.js +0 -1
  98. package/dist/assets/classDiagram-v2-MQ7JQ4JX-D--jW1ZB.js +0 -1
  99. package/dist/assets/clone-D6AulMZy.js +0 -1
  100. package/dist/assets/compile-Cb-2V0aD.js +0 -1
  101. package/dist/assets/diagram-QW4FP2JN-fVKWzjDQ.js +0 -1
  102. package/dist/assets/edit-page-DX4QoMwC.js +0 -8
  103. package/dist/assets/erDiagram-6RL3IURR-tkYxbOwJ.js +0 -1
  104. package/dist/assets/flowDiagram-7ASYPVHJ-wCWrRB02.js +0 -1
  105. package/dist/assets/ganttDiagram-NTVNEXSI-CipIDMvM.js +0 -1
  106. package/dist/assets/gitGraph-YCYPL57B-B2gBFbEc.js +0 -1
  107. package/dist/assets/gitGraphDiagram-NRZ2UAAF-CzfIrjrb.js +0 -1
  108. package/dist/assets/groovy-BfRUB6GO.js +0 -1
  109. package/dist/assets/home-page-DHrqvZ5M.js +0 -7
  110. package/dist/assets/index-CuNK5XUR.css +0 -1
  111. package/dist/assets/index-M-fa6gqH.js +0 -80
  112. package/dist/assets/infoDiagram-A4XQUW5V-Cq17uMjs.js +0 -1
  113. package/dist/assets/journeyDiagram-G5WM74LC-CTXVfGIj.js +0 -1
  114. package/dist/assets/mermaid-NCa4Btby.js +0 -13
  115. package/dist/assets/pieDiagram-YF2LJOPJ-BPY4ab3U.js +0 -1
  116. package/dist/assets/requirementDiagram-MIRIMTAZ-BiwgQpI6.js +0 -1
  117. package/dist/assets/sankeyDiagram-Y46BX6SQ-Yek58mqV.js +0 -1
  118. package/dist/assets/sequenceDiagram-G6AWOVSC-CS1ohKZS.js +0 -1
  119. package/dist/assets/simple-mode-VRHOsiuL.js +0 -1
  120. package/dist/assets/slides-component-BhUqdm2K.js +0 -1
  121. package/dist/assets/stateDiagram-MAYHULR4-C25IIyJY.js +0 -1
  122. package/dist/assets/stateDiagram-v2-4JROLMXI-Du1ne-Iw.js +0 -1
  123. package/dist/assets/stex-Ba7Sj9VR.js +0 -1
  124. package/dist/assets/tree-DXPs25GO.js +0 -8
  125. package/dist/assets/useMarimoWebSocket-UUW24I6P.js +0 -15
  126. package/dist/assets/xquery-BZBLoTvf.js +0 -1
@@ -1 +0,0 @@
1
- import{p as t}from"./chunk-TMUBEWPD-D_YLueZ5.js";import{_ as e,g as a,s as n,a as i,b as r,n as o,o as s,l,c as p,D as c,H as d,N as u,d as f,v as m,F as g}from"./mermaid-NCa4Btby.js";import{p as h}from"./gitGraph-YCYPL57B-B2gBFbEc.js";import"./transform-CdY8z5kT.js";import{d as x}from"./arc-B5qYPUYs.js";import{o as y}from"./ordinal-DDUp3AbE.js";import{b as w,t as S,n as $}from"./step-xJWGRC3d.js";import"./index-M-fa6gqH.js";import"./_baseEach-CHGr95h3.js";import"./_baseUniq-DBsNFMLI.js";import"./min-CABlFD1H.js";import"./_baseMap-CJD4EB23.js";import"./clone-D6AulMZy.js";import"./init-DLRA0X12.js";function b(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function D(t){return t}var T=g.pie,v={sections:new Map,showData:!1},A=v.sections,C=v.showData,j=structuredClone(T),k={getConfig:e((()=>structuredClone(j)),"getConfig"),clear:e((()=>{A=new Map,C=v.showData,m()}),"clear"),setDiagramTitle:s,getDiagramTitle:o,setAccTitle:r,getAccTitle:i,setAccDescription:n,getAccDescription:a,addSection:e((({label:t,value:e})=>{A.has(t)||(A.set(t,e),l.debug(`added new section: ${t}, with value: ${e}`))}),"addSection"),getSections:e((()=>A),"getSections"),setShowData:e((t=>{C=t}),"setShowData"),getShowData:e((()=>C),"getShowData")},M=e(((e,a)=>{t(e,a),a.setShowData(e.showData),e.sections.map(a.addSection)}),"populateDb"),z={parse:e((async t=>{const e=await h("pie",t);l.debug(e),M(e,k)}),"parse")},O=e((t=>`\n .pieCircle{\n stroke: ${t.pieStrokeColor};\n stroke-width : ${t.pieStrokeWidth};\n opacity : ${t.pieOpacity};\n }\n .pieOuterCircle{\n stroke: ${t.pieOuterStrokeColor};\n stroke-width: ${t.pieOuterStrokeWidth};\n fill: none;\n }\n .pieTitleText {\n text-anchor: middle;\n font-size: ${t.pieTitleTextSize};\n fill: ${t.pieTitleTextColor};\n font-family: ${t.fontFamily};\n }\n .slice {\n font-family: ${t.fontFamily};\n fill: ${t.pieSectionTextColor};\n font-size:${t.pieSectionTextSize};\n // fill: white;\n }\n .legend text {\n fill: ${t.pieLegendTextColor};\n font-family: ${t.fontFamily};\n font-size: ${t.pieLegendTextSize};\n }\n`),"getStyles"),W=e((t=>{const e=[...t.entries()].map((t=>({label:t[0],value:t[1]}))).sort(((t,e)=>e.value-t.value));return function(){var t=D,e=b,a=null,n=w(0),i=w(S),r=w(0);function o(o){var s,l,p,c,d,u=(o=$(o)).length,f=0,m=new Array(u),g=new Array(u),h=+n.apply(this,arguments),x=Math.min(S,Math.max(-S,i.apply(this,arguments)-h)),y=Math.min(Math.abs(x)/u,r.apply(this,arguments)),w=y*(x<0?-1:1);for(s=0;s<u;++s)(d=g[m[s]=s]=+t(o[s],s,o))>0&&(f+=d);for(null!=e?m.sort((function(t,a){return e(g[t],g[a])})):null!=a&&m.sort((function(t,e){return a(o[t],o[e])})),s=0,p=f?(x-u*w)/f:0;s<u;++s,h=c)l=m[s],c=h+((d=g[l])>0?d*p:0)+w,g[l]={data:o[l],index:s,value:d,startAngle:h,endAngle:c,padAngle:y};return g}return o.value=function(e){return arguments.length?(t="function"==typeof e?e:w(+e),o):t},o.sortValues=function(t){return arguments.length?(e=t,a=null,o):e},o.sort=function(t){return arguments.length?(a=t,e=null,o):a},o.startAngle=function(t){return arguments.length?(n="function"==typeof t?t:w(+t),o):n},o.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:w(+t),o):i},o.padAngle=function(t){return arguments.length?(r="function"==typeof t?t:w(+t),o):r},o}().value((t=>t.value))(e)}),"createPieArcs"),F={parser:z,db:k,renderer:{draw:e(((t,e,a,n)=>{l.debug("rendering pie chart\n"+t);const i=n.db,r=p(),o=c(i.getConfig(),r.pie),s=18,m=450,g=m,h=d(e),w=h.append("g");w.attr("transform","translate(225,225)");const{themeVariables:S}=r;let[$]=u(S.pieOuterStrokeWidth);$??($=2);const b=o.textPosition,D=Math.min(g,m)/2-40,T=x().innerRadius(0).outerRadius(D),v=x().innerRadius(D*b).outerRadius(D*b);w.append("circle").attr("cx",0).attr("cy",0).attr("r",D+$/2).attr("class","pieOuterCircle");const A=i.getSections(),C=W(A),j=[S.pie1,S.pie2,S.pie3,S.pie4,S.pie5,S.pie6,S.pie7,S.pie8,S.pie9,S.pie10,S.pie11,S.pie12],k=y(j);w.selectAll("mySlices").data(C).enter().append("path").attr("d",T).attr("fill",(t=>k(t.data.label))).attr("class","pieCircle");let M=0;A.forEach((t=>{M+=t})),w.selectAll("mySlices").data(C).enter().append("text").text((t=>(t.data.value/M*100).toFixed(0)+"%")).attr("transform",(t=>"translate("+v.centroid(t)+")")).style("text-anchor","middle").attr("class","slice"),w.append("text").text(i.getDiagramTitle()).attr("x",0).attr("y",-200).attr("class","pieTitleText");const z=w.selectAll(".legend").data(k.domain()).enter().append("g").attr("class","legend").attr("transform",((t,e)=>"translate(216,"+(22*e-22*k.domain().length/2)+")"));z.append("rect").attr("width",s).attr("height",s).style("fill",k).style("stroke",k),z.data(C).append("text").attr("x",22).attr("y",14).text((t=>{const{label:e,value:a}=t.data;return i.getShowData()?`${e} [${a}]`:e}));const O=512+Math.max(...z.selectAll("text").nodes().map((t=>(null==t?void 0:t.getBoundingClientRect().width)??0)));h.attr("viewBox",`0 0 ${O} 450`),f(h,m,O,o.useMaxWidth)}),"draw")},styles:O};export{F as diagram};
@@ -1 +0,0 @@
1
- import{_ as t,g as e,s as i,a as n,b as r,c as s,d as a,v as o,l,j as h}from"./mermaid-NCa4Btby.js";import{s as c}from"./transform-CdY8z5kT.js";import{G as u}from"./graph-4-Vg1Aiz.js";import{l as d}from"./layout-CGBTZO_E.js";import{l as p}from"./step-xJWGRC3d.js";import"./index-M-fa6gqH.js";import"./_baseUniq-DBsNFMLI.js";import"./_baseEach-CHGr95h3.js";import"./min-CABlFD1H.js";import"./_baseMap-CJD4EB23.js";import"./sortBy-DeAoOjrt.js";var y=function(){var e=t((function(t,e,i,n){for(i=i||{},n=t.length;n--;i[t[n]]=e);return i}),"o"),i=[1,3],n=[1,4],r=[1,5],s=[1,6],a=[5,6,8,9,11,13,31,32,33,34,35,36,44,62,63],o=[1,18],l=[2,7],h=[1,22],c=[1,23],u=[1,24],d=[1,25],p=[1,26],y=[1,27],_=[1,20],g=[1,28],E=[1,29],m=[62,63],R=[5,8,9,11,13,31,32,33,34,35,36,44,51,53,62,63],f=[1,47],I=[1,48],S=[1,49],b=[1,50],N=[1,51],T=[1,52],k=[1,53],x=[53,54],A=[1,64],w=[1,60],q=[1,61],v=[1,62],$=[1,63],O=[1,65],L=[1,69],C=[1,70],M=[1,67],F=[1,68],D=[5,8,9,11,13,31,32,33,34,35,36,44,62,63],P={trace:t((function(){}),"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,requirementType:17,requirementName:18,STRUCT_START:19,requirementBody:20,ID:21,COLONSEP:22,id:23,TEXT:24,text:25,RISK:26,riskLevel:27,VERIFYMTHD:28,verifyType:29,STRUCT_STOP:30,REQUIREMENT:31,FUNCTIONAL_REQUIREMENT:32,INTERFACE_REQUIREMENT:33,PERFORMANCE_REQUIREMENT:34,PHYSICAL_REQUIREMENT:35,DESIGN_CONSTRAINT:36,LOW_RISK:37,MED_RISK:38,HIGH_RISK:39,VERIFY_ANALYSIS:40,VERIFY_DEMONSTRATION:41,VERIFY_INSPECTION:42,VERIFY_TEST:43,ELEMENT:44,elementName:45,elementBody:46,TYPE:47,type:48,DOCREF:49,ref:50,END_ARROW_L:51,relationship:52,LINE:53,END_ARROW_R:54,CONTAINS:55,COPIES:56,DERIVES:57,SATISFIES:58,VERIFIES:59,REFINES:60,TRACES:61,unqString:62,qString:63,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",19:"STRUCT_START",21:"ID",22:"COLONSEP",24:"TEXT",26:"RISK",28:"VERIFYMTHD",30:"STRUCT_STOP",31:"REQUIREMENT",32:"FUNCTIONAL_REQUIREMENT",33:"INTERFACE_REQUIREMENT",34:"PERFORMANCE_REQUIREMENT",35:"PHYSICAL_REQUIREMENT",36:"DESIGN_CONSTRAINT",37:"LOW_RISK",38:"MED_RISK",39:"HIGH_RISK",40:"VERIFY_ANALYSIS",41:"VERIFY_DEMONSTRATION",42:"VERIFY_INSPECTION",43:"VERIFY_TEST",44:"ELEMENT",47:"TYPE",49:"DOCREF",51:"END_ARROW_L",53:"LINE",54:"END_ARROW_R",55:"CONTAINS",56:"COPIES",57:"DERIVES",58:"SATISFIES",59:"VERIFIES",60:"REFINES",61:"TRACES",62:"unqString",63:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[14,5],[20,5],[20,5],[20,5],[20,5],[20,2],[20,1],[17,1],[17,1],[17,1],[17,1],[17,1],[17,1],[27,1],[27,1],[27,1],[29,1],[29,1],[29,1],[29,1],[15,5],[46,5],[46,5],[46,2],[46,1],[16,5],[16,5],[52,1],[52,1],[52,1],[52,1],[52,1],[52,1],[52,1],[18,1],[18,1],[23,1],[23,1],[25,1],[25,1],[45,1],[45,1],[48,1],[48,1],[50,1],[50,1]],performAction:t((function(t,e,i,n,r,s,a){var o=s.length-1;switch(r){case 4:this.$=s[o].trim(),n.setAccTitle(this.$);break;case 5:case 6:this.$=s[o].trim(),n.setAccDescription(this.$);break;case 7:this.$=[];break;case 13:n.addRequirement(s[o-3],s[o-4]);break;case 14:n.setNewReqId(s[o-2]);break;case 15:n.setNewReqText(s[o-2]);break;case 16:n.setNewReqRisk(s[o-2]);break;case 17:n.setNewReqVerifyMethod(s[o-2]);break;case 20:this.$=n.RequirementType.REQUIREMENT;break;case 21:this.$=n.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 22:this.$=n.RequirementType.INTERFACE_REQUIREMENT;break;case 23:this.$=n.RequirementType.PERFORMANCE_REQUIREMENT;break;case 24:this.$=n.RequirementType.PHYSICAL_REQUIREMENT;break;case 25:this.$=n.RequirementType.DESIGN_CONSTRAINT;break;case 26:this.$=n.RiskLevel.LOW_RISK;break;case 27:this.$=n.RiskLevel.MED_RISK;break;case 28:this.$=n.RiskLevel.HIGH_RISK;break;case 29:this.$=n.VerifyType.VERIFY_ANALYSIS;break;case 30:this.$=n.VerifyType.VERIFY_DEMONSTRATION;break;case 31:this.$=n.VerifyType.VERIFY_INSPECTION;break;case 32:this.$=n.VerifyType.VERIFY_TEST;break;case 33:n.addElement(s[o-3]);break;case 34:n.setNewElementType(s[o-2]);break;case 35:n.setNewElementDocRef(s[o-2]);break;case 38:n.addRelationship(s[o-2],s[o],s[o-4]);break;case 39:n.addRelationship(s[o-2],s[o-4],s[o]);break;case 40:this.$=n.Relationships.CONTAINS;break;case 41:this.$=n.Relationships.COPIES;break;case 42:this.$=n.Relationships.DERIVES;break;case 43:this.$=n.Relationships.SATISFIES;break;case 44:this.$=n.Relationships.VERIFIES;break;case 45:this.$=n.Relationships.REFINES;break;case 46:this.$=n.Relationships.TRACES}}),"anonymous"),table:[{3:1,4:2,6:i,9:n,11:r,13:s},{1:[3]},{3:8,4:2,5:[1,7],6:i,9:n,11:r,13:s},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(a,[2,6]),{3:12,4:2,6:i,9:n,11:r,13:s},{1:[2,2]},{4:17,5:o,7:13,8:l,9:n,11:r,13:s,14:14,15:15,16:16,17:19,23:21,31:h,32:c,33:u,34:d,35:p,36:y,44:_,62:g,63:E},e(a,[2,4]),e(a,[2,5]),{1:[2,1]},{8:[1,30]},{4:17,5:o,7:31,8:l,9:n,11:r,13:s,14:14,15:15,16:16,17:19,23:21,31:h,32:c,33:u,34:d,35:p,36:y,44:_,62:g,63:E},{4:17,5:o,7:32,8:l,9:n,11:r,13:s,14:14,15:15,16:16,17:19,23:21,31:h,32:c,33:u,34:d,35:p,36:y,44:_,62:g,63:E},{4:17,5:o,7:33,8:l,9:n,11:r,13:s,14:14,15:15,16:16,17:19,23:21,31:h,32:c,33:u,34:d,35:p,36:y,44:_,62:g,63:E},{4:17,5:o,7:34,8:l,9:n,11:r,13:s,14:14,15:15,16:16,17:19,23:21,31:h,32:c,33:u,34:d,35:p,36:y,44:_,62:g,63:E},{4:17,5:o,7:35,8:l,9:n,11:r,13:s,14:14,15:15,16:16,17:19,23:21,31:h,32:c,33:u,34:d,35:p,36:y,44:_,62:g,63:E},{18:36,62:[1,37],63:[1,38]},{45:39,62:[1,40],63:[1,41]},{51:[1,42],53:[1,43]},e(m,[2,20]),e(m,[2,21]),e(m,[2,22]),e(m,[2,23]),e(m,[2,24]),e(m,[2,25]),e(R,[2,49]),e(R,[2,50]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{19:[1,44]},{19:[2,47]},{19:[2,48]},{19:[1,45]},{19:[2,53]},{19:[2,54]},{52:46,55:f,56:I,57:S,58:b,59:N,60:T,61:k},{52:54,55:f,56:I,57:S,58:b,59:N,60:T,61:k},{5:[1,55]},{5:[1,56]},{53:[1,57]},e(x,[2,40]),e(x,[2,41]),e(x,[2,42]),e(x,[2,43]),e(x,[2,44]),e(x,[2,45]),e(x,[2,46]),{54:[1,58]},{5:A,20:59,21:w,24:q,26:v,28:$,30:O},{5:L,30:C,46:66,47:M,49:F},{23:71,62:g,63:E},{23:72,62:g,63:E},e(D,[2,13]),{22:[1,73]},{22:[1,74]},{22:[1,75]},{22:[1,76]},{5:A,20:77,21:w,24:q,26:v,28:$,30:O},e(D,[2,19]),e(D,[2,33]),{22:[1,78]},{22:[1,79]},{5:L,30:C,46:80,47:M,49:F},e(D,[2,37]),e(D,[2,38]),e(D,[2,39]),{23:81,62:g,63:E},{25:82,62:[1,83],63:[1,84]},{27:85,37:[1,86],38:[1,87],39:[1,88]},{29:89,40:[1,90],41:[1,91],42:[1,92],43:[1,93]},e(D,[2,18]),{48:94,62:[1,95],63:[1,96]},{50:97,62:[1,98],63:[1,99]},e(D,[2,36]),{5:[1,100]},{5:[1,101]},{5:[2,51]},{5:[2,52]},{5:[1,102]},{5:[2,26]},{5:[2,27]},{5:[2,28]},{5:[1,103]},{5:[2,29]},{5:[2,30]},{5:[2,31]},{5:[2,32]},{5:[1,104]},{5:[2,55]},{5:[2,56]},{5:[1,105]},{5:[2,57]},{5:[2,58]},{5:A,20:106,21:w,24:q,26:v,28:$,30:O},{5:A,20:107,21:w,24:q,26:v,28:$,30:O},{5:A,20:108,21:w,24:q,26:v,28:$,30:O},{5:A,20:109,21:w,24:q,26:v,28:$,30:O},{5:L,30:C,46:110,47:M,49:F},{5:L,30:C,46:111,47:M,49:F},e(D,[2,14]),e(D,[2,15]),e(D,[2,16]),e(D,[2,17]),e(D,[2,34]),e(D,[2,35])],defaultActions:{8:[2,2],12:[2,1],30:[2,3],31:[2,8],32:[2,9],33:[2,10],34:[2,11],35:[2,12],37:[2,47],38:[2,48],40:[2,53],41:[2,54],83:[2,51],84:[2,52],86:[2,26],87:[2,27],88:[2,28],90:[2,29],91:[2,30],92:[2,31],93:[2,32],95:[2,55],96:[2,56],98:[2,57],99:[2,58]},parseError:t((function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)}),"parseError"),parse:t((function(e){var i=this,n=[0],r=[],s=[null],a=[],o=this.table,l="",h=0,c=0,u=a.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(p.yy[y]=this.yy[y]);d.setInput(e,p.yy),p.yy.lexer=d,p.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var _=d.yylloc;a.push(_);var g=d.options&&d.options.ranges;function E(){var t;return"number"!=typeof(t=r.pop()||d.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=i.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,t((function(t){n.length=n.length-2*t,s.length=s.length-t,a.length=a.length-t}),"popStack"),t(E,"lex");for(var m,R,f,I,S,b,N,T,k={};;){if(R=n[n.length-1],this.defaultActions[R]?f=this.defaultActions[R]:(null==m&&(m=E()),f=o[R]&&o[R][m]),void 0===f||!f.length||!f[0]){var x="";for(S in T=[],o[R])this.terminals_[S]&&S>2&&T.push("'"+this.terminals_[S]+"'");x=d.showPosition?"Parse error on line "+(h+1)+":\n"+d.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(h+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(x,{text:d.match,token:this.terminals_[m]||m,line:d.yylineno,loc:_,expected:T})}if(f[0]instanceof Array&&f.length>1)throw new Error("Parse Error: multiple actions possible at state: "+R+", token: "+m);switch(f[0]){case 1:n.push(m),s.push(d.yytext),a.push(d.yylloc),n.push(f[1]),m=null,c=d.yyleng,l=d.yytext,h=d.yylineno,_=d.yylloc;break;case 2:if(b=this.productions_[f[1]][1],k.$=s[s.length-b],k._$={first_line:a[a.length-(b||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(b||1)].first_column,last_column:a[a.length-1].last_column},g&&(k._$.range=[a[a.length-(b||1)].range[0],a[a.length-1].range[1]]),void 0!==(I=this.performAction.apply(k,[l,c,h,p.yy,f[1],s,a].concat(u))))return I;b&&(n=n.slice(0,-1*b*2),s=s.slice(0,-1*b),a=a.slice(0,-1*b)),n.push(this.productions_[f[1]][0]),s.push(k.$),a.push(k._$),N=o[n[n.length-2]][n[n.length-1]],n.push(N);break;case 3:return!0}}return!0}),"parse")},V=function(){return{EOF:1,parseError:t((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:t((function(t,e){return this.yy=e||this.yy||{},this._input=t,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:t((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:t((function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=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),i.length-1&&(this.yylineno-=i.length-1);var r=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:i?(i.length===n.length?this.yylloc.first_column:0)+n[n.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:t((function(){return this._more=!0,this}),"more"),reject:t((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:t((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:t((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:t((function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:t((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:t((function(t,e){var i,n,r;if(this.options.backtrack_lexer&&(r={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&&(r.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,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(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var s in r)this[s]=r[s];return!1}return!1}),"test_match"),next:t((function(){if(this.done)return this.EOF;var t,e,i,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),s=0;s<r.length;s++)if((i=this._input.match(this.rules[r[s]]))&&(!e||i[0].length>e[0].length)){if(e=i,n=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,r[s])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:t((function(){var t=this.next();return t||this.lex()}),"lex"),begin:t((function(t){this.conditionStack.push(t)}),"begin"),popState:t((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:t((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:t((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:t((function(t){this.begin(t)}),"pushState"),stateStackSize:t((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:t((function(t,e,i,n){switch(i){case 0:return"title";case 1:return this.begin("acc_title"),9;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),11;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:case 48:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 5;case 9:case 10:case 11:break;case 12:return 8;case 13:return 6;case 14:return 19;case 15:return 30;case 16:return 22;case 17:return 21;case 18:return 24;case 19:return 26;case 20:return 28;case 21:return 31;case 22:return 32;case 23:return 33;case 24:return 34;case 25:return 35;case 26:return 36;case 27:return 37;case 28:return 38;case 29:return 39;case 30:return 40;case 31:return 41;case 32:return 42;case 33:return 43;case 34:return 44;case 35:return 55;case 36:return 56;case 37:return 57;case 38:return 58;case 39:return 59;case 40:return 60;case 41:return 61;case 42:return 47;case 43:return 49;case 44:return 51;case 45:return 54;case 46:return 53;case 47:this.begin("string");break;case 49:return"qString";case 50:return e.yytext=e.yytext.trim(),62}}),"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^\r\n\{\<\>\-\=]*)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:!1},acc_descr:{rules:[4],inclusive:!1},acc_title:{rules:[2],inclusive:!1},unqString:{rules:[],inclusive:!1},token:{rules:[],inclusive:!1},string:{rules:[48,49],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,50],inclusive:!0}}}}();function U(){this.yy={}}return P.lexer=V,t(U,"Parser"),U.prototype=P,P.Parser=U,new U}();y.parser=y;var _=y,g=[],E={},m=new Map,R={},f=new Map,I=t(((t,e)=>(m.has(t)||m.set(t,{name:t,type:e,id:E.id,text:E.text,risk:E.risk,verifyMethod:E.verifyMethod}),E={},m.get(t))),"addRequirement"),S=t((()=>m),"getRequirements"),b=t((t=>{void 0!==E&&(E.id=t)}),"setNewReqId"),N=t((t=>{void 0!==E&&(E.text=t)}),"setNewReqText"),T=t((t=>{void 0!==E&&(E.risk=t)}),"setNewReqRisk"),k=t((t=>{void 0!==E&&(E.verifyMethod=t)}),"setNewReqVerifyMethod"),x=t((t=>(f.has(t)||(f.set(t,{name:t,type:R.type,docRef:R.docRef}),l.info("Added new requirement: ",t)),R={},f.get(t))),"addElement"),A=t((()=>f),"getElements"),w=t((t=>{void 0!==R&&(R.type=t)}),"setNewElementType"),q=t((t=>{void 0!==R&&(R.docRef=t)}),"setNewElementDocRef"),v=t(((t,e,i)=>{g.push({type:t,src:e,dst:i})}),"addRelationship"),$=t((()=>g),"getRelationships"),O=t((()=>{g=[],E={},m=new Map,R={},f=new Map,o()}),"clear"),L={RequirementType:{REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},RiskLevel:{LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},VerifyType:{VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},Relationships:{CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},getConfig:t((()=>s().req),"getConfig"),addRequirement:I,getRequirements:S,setNewReqId:b,setNewReqText:N,setNewReqRisk:T,setNewReqVerifyMethod:k,setAccTitle:r,getAccTitle:n,setAccDescription:i,getAccDescription:e,addElement:x,getElements:A,setNewElementType:w,setNewElementDocRef:q,addRelationship:v,getRelationships:$,clear:O},C=t((t=>`\n\n marker {\n fill: ${t.relationColor};\n stroke: ${t.relationColor};\n }\n\n marker.cross {\n stroke: ${t.lineColor};\n }\n\n svg {\n font-family: ${t.fontFamily};\n font-size: ${t.fontSize};\n }\n\n .reqBox {\n fill: ${t.requirementBackground};\n fill-opacity: 1.0;\n stroke: ${t.requirementBorderColor};\n stroke-width: ${t.requirementBorderSize};\n }\n \n .reqTitle, .reqLabel{\n fill: ${t.requirementTextColor};\n }\n .reqLabelBox {\n fill: ${t.relationLabelBackground};\n fill-opacity: 1.0;\n }\n\n .req-title-line {\n stroke: ${t.requirementBorderColor};\n stroke-width: ${t.requirementBorderSize};\n }\n .relationshipLine {\n stroke: ${t.relationColor};\n stroke-width: 1;\n }\n .relationshipLabel {\n fill: ${t.relationLabelColor};\n }\n\n`),"getStyles"),M={CONTAINS:"contains",ARROW:"arrow"},F={ReqMarkers:M,insertLineEndings:t(((t,e)=>{let i=t.append("defs").append("marker").attr("id",M.CONTAINS+"_line_ending").attr("refX",0).attr("refY",e.line_height/2).attr("markerWidth",e.line_height).attr("markerHeight",e.line_height).attr("orient","auto").append("g");i.append("circle").attr("cx",e.line_height/2).attr("cy",e.line_height/2).attr("r",e.line_height/2).attr("fill","none"),i.append("line").attr("x1",0).attr("x2",e.line_height).attr("y1",e.line_height/2).attr("y2",e.line_height/2).attr("stroke-width",1),i.append("line").attr("y1",0).attr("y2",e.line_height).attr("x1",e.line_height/2).attr("x2",e.line_height/2).attr("stroke-width",1),t.append("defs").append("marker").attr("id",M.ARROW+"_line_ending").attr("refX",e.line_height).attr("refY",.5*e.line_height).attr("markerWidth",e.line_height).attr("markerHeight",e.line_height).attr("orient","auto").append("path").attr("d",`M0,0\n L${e.line_height},${e.line_height/2}\n M${e.line_height},${e.line_height/2}\n L0,${e.line_height}`).attr("stroke-width",1)}),"insertLineEndings")},D={},P=0,V=t(((t,e)=>t.insert("rect","#"+e).attr("class","req reqBox").attr("x",0).attr("y",0).attr("width",D.rect_min_width+"px").attr("height",D.rect_min_height+"px")),"newRectNode"),U=t(((t,e,i)=>{let n=D.rect_min_width/2,r=t.append("text").attr("class","req reqLabel reqTitle").attr("id",e).attr("x",n).attr("y",D.rect_padding).attr("dominant-baseline","hanging"),s=0;i.forEach((t=>{0==s?r.append("tspan").attr("text-anchor","middle").attr("x",D.rect_min_width/2).attr("dy",0).text(t):r.append("tspan").attr("text-anchor","middle").attr("x",D.rect_min_width/2).attr("dy",.75*D.line_height).text(t),s++}));let a=1.5*D.rect_padding+s*D.line_height*.75;return t.append("line").attr("class","req-title-line").attr("x1","0").attr("x2",D.rect_min_width).attr("y1",a).attr("y2",a),{titleNode:r,y:a}}),"newTitleNode"),Y=t(((t,e,i,n)=>{let r=t.append("text").attr("class","req reqLabel").attr("id",e).attr("x",D.rect_padding).attr("y",n).attr("dominant-baseline","hanging"),s=0;let a=[];return i.forEach((t=>{let e=t.length;for(;e>30&&s<3;){let i=t.substring(0,30);e=(t=t.substring(30,t.length)).length,a[a.length]=i,s++}if(3==s){let t=a[a.length-1];a[a.length-1]=t.substring(0,t.length-4)+"..."}else a[a.length]=t;s=0})),a.forEach((t=>{r.append("tspan").attr("x",D.rect_padding).attr("dy",D.line_height).text(t)})),r}),"newBodyNode"),B=t(((t,e,i,n)=>{const r=e.node().getTotalLength(),s=e.node().getPointAtLength(.5*r),a="rel"+P;P++;const o=t.append("text").attr("class","req relationshipLabel").attr("id",a).attr("x",s.x).attr("y",s.y).attr("text-anchor","middle").attr("dominant-baseline","middle").text(n).node().getBBox();t.insert("rect","#"+a).attr("class","req reqLabelBox").attr("x",s.x-o.width/2).attr("y",s.y-o.height/2).attr("width",o.width).attr("height",o.height).attr("fill","white").attr("fill-opacity","85%")}),"addEdgeLabel"),j=t((function(t,e,i,n,r){const s=i.edge(G(e.src),G(e.dst)),a=p().x((function(t){return t.x})).y((function(t){return t.y})),o=t.insert("path","#"+n).attr("class","er relationshipLine").attr("d",a(s.points)).attr("fill","none");e.type==r.db.Relationships.CONTAINS?o.attr("marker-start","url("+h.getUrl(D.arrowMarkerAbsolute)+"#"+e.type+"_line_ending)"):(o.attr("stroke-dasharray","10,7"),o.attr("marker-end","url("+h.getUrl(D.arrowMarkerAbsolute)+"#"+F.ReqMarkers.ARROW+"_line_ending)")),B(t,o,D,`<<${e.type}>>`)}),"drawRelationshipFromLayout"),Q=t(((t,e,i)=>{t.forEach(((t,n)=>{n=G(n),l.info("Added new requirement: ",n);const r=i.append("g").attr("id",n),s=V(r,"req-"+n);let a=[],o=U(r,n+"_title",[`<<${t.type}>>`,`${t.name}`]);a.push(o.titleNode);let h=Y(r,n+"_body",[`Id: ${t.id}`,`Text: ${t.text}`,`Risk: ${t.risk}`,`Verification: ${t.verifyMethod}`],o.y);a.push(h);const c=s.node().getBBox();e.setNode(n,{width:c.width,height:c.height,shape:"rect",id:n})}))}),"drawReqs"),H=t(((t,e,i)=>{t.forEach(((t,n)=>{const r=G(n),s=i.append("g").attr("id",r),a="element-"+r,o=V(s,a);let l=[],h=U(s,a+"_title",["<<Element>>",`${n}`]);l.push(h.titleNode);let c=Y(s,a+"_body",[`Type: ${t.type||"Not Specified"}`,`Doc Ref: ${t.docRef||"None"}`],h.y);l.push(c);const u=o.node().getBBox();e.setNode(r,{width:u.width,height:u.height,shape:"rect",id:r})}))}),"drawElements"),W=t(((t,e)=>(t.forEach((function(t){let i=G(t.src),n=G(t.dst);e.setEdge(i,n,{relationship:t})})),t)),"addRelationships"),K=t((function(t,e){e.nodes().forEach((function(i){void 0!==i&&void 0!==e.node(i)&&(t.select("#"+i),t.select("#"+i).attr("transform","translate("+(e.node(i).x-e.node(i).width/2)+","+(e.node(i).y-e.node(i).height/2)+" )"))}))}),"adjustEntities"),G=t((t=>t.replace(/\s/g,"").replace(/\./g,"_")),"elementString"),z={parser:_,db:L,renderer:{draw:t(((t,e,i,n)=>{const r=(D=s().requirement).securityLevel;let o;"sandbox"===r&&(o=c("#i"+e));const l=c("sandbox"===r?o.nodes()[0].contentDocument.body:"body").select(`[id='${e}']`);F.insertLineEndings(l,D);const h=new u({multigraph:!1,compound:!1,directed:!0}).setGraph({rankdir:D.layoutDirection,marginx:20,marginy:20,nodesep:100,edgesep:100,ranksep:100}).setDefaultEdgeLabel((function(){return{}}));let p=n.db.getRequirements(),y=n.db.getElements(),_=n.db.getRelationships();Q(p,h,l),H(y,h,l),W(_,h),d(h),K(l,h),_.forEach((function(t){j(l,t,h,e,n)}));const g=D.rect_padding,E=l.node().getBBox(),m=E.width+2*g,R=E.height+2*g;a(l,R,m,D.useMaxWidth),l.attr("viewBox",`${E.x-g} ${E.y-g} ${m} ${R}`)}),"draw")},styles:C};export{z as diagram};
@@ -1 +0,0 @@
1
- var t,n,e;import{_ as i,o as r,n as s,s as o,g as a,b as l,a as c,c as h,t as u,R as f,v as y,j as d}from"./mermaid-NCa4Btby.js";import{s as p}from"./transform-CdY8z5kT.js";import{o as g}from"./ordinal-DDUp3AbE.js";import{c as _}from"./colors-bszWmPJw.js";import"./index-M-fa6gqH.js";import"./step-xJWGRC3d.js";import"./init-DLRA0X12.js";const m=_("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function x(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}var k,v;function b(t,n){var e,i,r=t.length,s=-1;if(null==n){for(;++s<r;)if(null!=(e=t[s])&&e>=e)for(i=e;++s<r;)null!=(e=t[s])&&e>i&&(i=e)}else for(;++s<r;)if(null!=(e=n(t[s],s,t))&&e>=e)for(i=e;++s<r;)null!=(e=n(t[s],s,t))&&e>i&&(i=e);return i}function w(t,n){var e,i,r=t.length,s=-1;if(null==n){for(;++s<r;)if(null!=(e=t[s])&&e>=e)for(i=e;++s<r;)null!=(e=t[s])&&i>e&&(i=e)}else for(;++s<r;)if(null!=(e=n(t[s],s,t))&&e>=e)for(i=e;++s<r;)null!=(e=n(t[s],s,t))&&i>e&&(i=e);return i}function S(t,n){var e,i=t.length,r=-1,s=0;if(null==n)for(;++r<i;)(e=+t[r])&&(s+=e);else for(;++r<i;)(e=+n(t[r],r,t))&&(s+=e);return s}function E(t){return t.target.depth}function L(t,n){return t.sourceLinks.length?t.depth:n-1}function A(t){return function(){return t}}function M(t,n){return T(t.source,n.source)||t.index-n.index}function I(t,n){return T(t.target,n.target)||t.index-n.index}function T(t,n){return t.y0-n.y0}function N(t){return t.value}function j(t){return t.index}function P(t){return t.nodes}function O(t){return t.links}function C(t,n){const e=t.get(n);if(!e)throw new Error("missing: "+n);return e}function D({nodes:t}){for(const n of t){let t=n.y0,e=t;for(const i of n.sourceLinks)i.y0=t+i.width/2,t+=i.width;for(const i of n.targetLinks)i.y1=e+i.width/2,e+=i.width}}function $(){let t,n,e,i=0,r=0,s=1,o=1,a=24,l=8,c=j,h=L,u=P,f=O,y=6;function d(){const d={nodes:u.apply(null,arguments),links:f.apply(null,arguments)};return function({nodes:t,links:n}){for(const[e,r]of t.entries())r.index=e,r.sourceLinks=[],r.targetLinks=[];const i=new Map(t.map(((n,e)=>[c(n,e,t),n])));for(const[e,r]of n.entries()){r.index=e;let{source:t,target:n}=r;"object"!=typeof t&&(t=r.source=C(i,t)),"object"!=typeof n&&(n=r.target=C(i,n)),t.sourceLinks.push(r),n.targetLinks.push(r)}if(null!=e)for(const{sourceLinks:r,targetLinks:s}of t)r.sort(e),s.sort(e)}(d),function({nodes:t}){for(const n of t)n.value=void 0===n.fixedValue?Math.max(S(n.sourceLinks,N),S(n.targetLinks,N)):n.fixedValue}(d),function({nodes:t}){const n=t.length;let e=new Set(t),i=new Set,r=0;for(;e.size;){for(const t of e){t.depth=r;for(const{target:n}of t.sourceLinks)i.add(n)}if(++r>n)throw new Error("circular link");e=i,i=new Set}}(d),function({nodes:t}){const n=t.length;let e=new Set(t),i=new Set,r=0;for(;e.size;){for(const t of e){t.height=r;for(const{source:n}of t.targetLinks)i.add(n)}if(++r>n)throw new Error("circular link");e=i,i=new Set}}(d),function(e){const c=function({nodes:t}){const e=b(t,(t=>t.depth))+1,r=(s-i-a)/(e-1),o=new Array(e);for(const n of t){const t=Math.max(0,Math.min(e-1,Math.floor(h.call(null,n,e))));n.layer=t,n.x0=i+t*r,n.x1=n.x0+a,o[t]?o[t].push(n):o[t]=[n]}if(n)for(const i of o)i.sort(n);return o}(e);t=Math.min(l,(o-r)/(b(c,(t=>t.length))-1)),function(n){const e=w(n,(n=>(o-r-(n.length-1)*t)/S(n,N)));for(const i of n){let n=r;for(const r of i){r.y0=n,r.y1=n+r.value*e,n=r.y1+t;for(const t of r.sourceLinks)t.width=t.value*e}n=(o-n+t)/(i.length+1);for(let t=0;t<i.length;++t){const e=i[t];e.y0+=n*(t+1),e.y1+=n*(t+1)}v(i)}}(c);for(let t=0;t<y;++t){const n=Math.pow(.99,t),e=Math.max(1-n,(t+1)/y);g(c,n,e),p(c,n,e)}}(d),D(d),d}function p(t,e,i){for(let r=1,s=t.length;r<s;++r){const s=t[r];for(const t of s){let n=0,i=0;for(const{source:e,value:s}of t.targetLinks){let r=s*(t.layer-e.layer);n+=E(e,t)*r,i+=r}if(!(i>0))continue;let r=(n/i-t.y0)*e;t.y0+=r,t.y1+=r,k(t)}void 0===n&&s.sort(T),_(s,i)}}function g(t,e,i){for(let r=t.length-2;r>=0;--r){const s=t[r];for(const t of s){let n=0,i=0;for(const{target:e,value:s}of t.sourceLinks){let r=s*(e.layer-t.layer);n+=$(t,e)*r,i+=r}if(!(i>0))continue;let r=(n/i-t.y0)*e;t.y0+=r,t.y1+=r,k(t)}void 0===n&&s.sort(T),_(s,i)}}function _(n,e){const i=n.length>>1,s=n[i];x(n,s.y0-t,i-1,e),m(n,s.y1+t,i+1,e),x(n,o,n.length-1,e),m(n,r,0,e)}function m(n,e,i,r){for(;i<n.length;++i){const s=n[i],o=(e-s.y0)*r;o>1e-6&&(s.y0+=o,s.y1+=o),e=s.y1+t}}function x(n,e,i,r){for(;i>=0;--i){const s=n[i],o=(s.y1-e)*r;o>1e-6&&(s.y0-=o,s.y1-=o),e=s.y0-t}}function k({sourceLinks:t,targetLinks:n}){if(void 0===e){for(const{source:{sourceLinks:t}}of n)t.sort(I);for(const{target:{targetLinks:n}}of t)n.sort(M)}}function v(t){if(void 0===e)for(const{sourceLinks:n,targetLinks:e}of t)n.sort(I),e.sort(M)}function E(n,e){let i=n.y0-(n.sourceLinks.length-1)*t/2;for(const{target:r,width:s}of n.sourceLinks){if(r===e)break;i+=s+t}for(const{source:t,width:r}of e.targetLinks){if(t===n)break;i-=r}return i}function $(n,e){let i=e.y0-(e.targetLinks.length-1)*t/2;for(const{source:r,width:s}of e.targetLinks){if(r===n)break;i+=s+t}for(const{target:t,width:r}of n.sourceLinks){if(t===e)break;i-=r}return i}return d.update=function(t){return D(t),t},d.nodeId=function(t){return arguments.length?(c="function"==typeof t?t:A(t),d):c},d.nodeAlign=function(t){return arguments.length?(h="function"==typeof t?t:A(t),d):h},d.nodeSort=function(t){return arguments.length?(n=t,d):n},d.nodeWidth=function(t){return arguments.length?(a=+t,d):a},d.nodePadding=function(n){return arguments.length?(l=t=+n,d):l},d.nodes=function(t){return arguments.length?(u="function"==typeof t?t:A(t),d):u},d.links=function(t){return arguments.length?(f="function"==typeof t?t:A(t),d):f},d.linkSort=function(t){return arguments.length?(e=t,d):e},d.size=function(t){return arguments.length?(i=r=0,s=+t[0],o=+t[1],d):[s-i,o-r]},d.extent=function(t){return arguments.length?(i=+t[0][0],s=+t[1][0],r=+t[0][1],o=+t[1][1],d):[[i,r],[s,o]]},d.iterations=function(t){return arguments.length?(y=+t,d):y},d}1===(k=x).length&&(v=k,k=function(t,n){return x(v(t),n)});var z=Math.PI,F=2*z,U=1e-6,W=F-U;function G(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function X(){return new G}function R(t){return function(){return t}}function V(t){return t[0]}function q(t){return t[1]}G.prototype=X.prototype={constructor:G,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){null!==this._x1&&(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,e,i){this._+="Q"+ +t+","+ +n+","+(this._x1=+e)+","+(this._y1=+i)},bezierCurveTo:function(t,n,e,i,r,s){this._+="C"+ +t+","+ +n+","+ +e+","+ +i+","+(this._x1=+r)+","+(this._y1=+s)},arcTo:function(t,n,e,i,r){t=+t,n=+n,e=+e,i=+i,r=+r;var s=this._x1,o=this._y1,a=e-t,l=i-n,c=s-t,h=o-n,u=c*c+h*h;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(u>U)if(Math.abs(h*a-l*c)>U&&r){var f=e-s,y=i-o,d=a*a+l*l,p=f*f+y*y,g=Math.sqrt(d),_=Math.sqrt(u),m=r*Math.tan((z-Math.acos((d+u-p)/(2*g*_)))/2),x=m/_,k=m/g;Math.abs(x-1)>U&&(this._+="L"+(t+x*c)+","+(n+x*h)),this._+="A"+r+","+r+",0,0,"+ +(h*f>c*y)+","+(this._x1=t+k*a)+","+(this._y1=n+k*l)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,n,e,i,r,s){t=+t,n=+n,s=!!s;var o=(e=+e)*Math.cos(i),a=e*Math.sin(i),l=t+o,c=n+a,h=1^s,u=s?i-r:r-i;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>U||Math.abs(this._y1-c)>U)&&(this._+="L"+l+","+c),e&&(u<0&&(u=u%F+F),u>W?this._+="A"+e+","+e+",0,1,"+h+","+(t-o)+","+(n-a)+"A"+e+","+e+",0,1,"+h+","+(this._x1=l)+","+(this._y1=c):u>U&&(this._+="A"+e+","+e+",0,"+ +(u>=z)+","+h+","+(this._x1=t+e*Math.cos(r))+","+(this._y1=n+e*Math.sin(r))))},rect:function(t,n,e,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +i+"h"+-e+"Z"},toString:function(){return this._}};var Q=Array.prototype.slice;function Y(t){return t.source}function B(t){return t.target}function K(t,n,e,i,r){t.moveTo(n,e),t.bezierCurveTo(n=(n+i)/2,e,n,r,i,r)}function Z(){return function(t){var n=Y,e=B,i=V,r=q,s=null;function o(){var o,a=Q.call(arguments),l=n.apply(this,a),c=e.apply(this,a);if(s||(s=o=X()),t(s,+i.apply(this,(a[0]=l,a)),+r.apply(this,a),+i.apply(this,(a[0]=c,a)),+r.apply(this,a)),o)return s=null,o+""||null}return o.source=function(t){return arguments.length?(n=t,o):n},o.target=function(t){return arguments.length?(e=t,o):e},o.x=function(t){return arguments.length?(i="function"==typeof t?t:R(+t),o):i},o.y=function(t){return arguments.length?(r="function"==typeof t?t:R(+t),o):r},o.context=function(t){return arguments.length?(s=null==t?null:t,o):s},o}(K)}function H(t){return[t.source.x1,t.y0]}function J(t){return[t.target.x0,t.y1]}var tt=function(){var t=i((function(t,n,e,i){for(e=e||{},i=t.length;i--;e[t[i]]=n);return e}),"o"),n=[1,9],e=[1,10],r=[1,5,10,12],s={trace:i((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:i((function(t,n,e,i,r,s,o){var a=s.length-1;switch(r){case 7:const t=i.findOrCreateNode(s[a-4].trim().replaceAll('""','"')),n=i.findOrCreateNode(s[a-2].trim().replaceAll('""','"')),e=parseFloat(s[a].trim());i.addLink(t,n,e);break;case 8:case 9:case 11:this.$=s[a];break;case 10:this.$=s[a-1]}}),"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:e},{1:[2,6],7:11,10:[1,12]},t(e,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(r,[2,8]),t(r,[2,9]),{19:[1,16]},t(r,[2,11]),{1:[2,1]},{1:[2,5]},t(e,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:e},{15:18,16:7,17:8,18:n,20:e},{18:[1,19]},t(e,[2,3]),{12:[1,20]},t(r,[2,10]),{15:21,16:7,17:8,18:n,20:e},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:i((function(t,n){if(!n.recoverable){var e=new Error(t);throw e.hash=n,e}this.trace(t)}),"parseError"),parse:i((function(t){var n=this,e=[0],r=[],s=[null],o=[],a=this.table,l="",c=0,h=0,u=o.slice.call(arguments,1),f=Object.create(this.lexer),y={yy:{}};for(var d in this.yy)Object.prototype.hasOwnProperty.call(this.yy,d)&&(y.yy[d]=this.yy[d]);f.setInput(t,y.yy),y.yy.lexer=f,y.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var p=f.yylloc;o.push(p);var g=f.options&&f.options.ranges;function _(){var t;return"number"!=typeof(t=r.pop()||f.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=n.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,i((function(t){e.length=e.length-2*t,s.length=s.length-t,o.length=o.length-t}),"popStack"),i(_,"lex");for(var m,x,k,v,b,w,S,E,L={};;){if(x=e[e.length-1],this.defaultActions[x]?k=this.defaultActions[x]:(null==m&&(m=_()),k=a[x]&&a[x][m]),void 0===k||!k.length||!k[0]){var A="";for(b in E=[],a[x])this.terminals_[b]&&b>2&&E.push("'"+this.terminals_[b]+"'");A=f.showPosition?"Parse error on line "+(c+1)+":\n"+f.showPosition()+"\nExpecting "+E.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==m?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(A,{text:f.match,token:this.terminals_[m]||m,line:f.yylineno,loc:p,expected:E})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+m);switch(k[0]){case 1:e.push(m),s.push(f.yytext),o.push(f.yylloc),e.push(k[1]),m=null,h=f.yyleng,l=f.yytext,c=f.yylineno,p=f.yylloc;break;case 2:if(w=this.productions_[k[1]][1],L.$=s[s.length-w],L._$={first_line:o[o.length-(w||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(w||1)].first_column,last_column:o[o.length-1].last_column},g&&(L._$.range=[o[o.length-(w||1)].range[0],o[o.length-1].range[1]]),void 0!==(v=this.performAction.apply(L,[l,h,c,y.yy,k[1],s,o].concat(u))))return v;w&&(e=e.slice(0,-1*w*2),s=s.slice(0,-1*w),o=o.slice(0,-1*w)),e.push(this.productions_[k[1]][0]),s.push(L.$),o.push(L._$),S=a[e[e.length-2]][e[e.length-1]],e.push(S);break;case 3:return!0}}return!0}),"parse")},o=function(){return{EOF:1,parseError:i((function(t,n){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,n)}),"parseError"),setInput:i((function(t,n){return this.yy=n||this.yy||{},this._input=t,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:i((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:i((function(t){var n=t.length,e=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var i=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),e.length-1&&(this.yylineno-=e.length-1);var r=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:e?(e.length===i.length?this.yylloc.first_column:0)+i[i.length-e.length].length-e[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this}),"unput"),more:i((function(){return this._more=!0,this}),"more"),reject:i((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:i((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:i((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:i((function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:i((function(){var t=this.pastInput(),n=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+n+"^"}),"showPosition"),test_match:i((function(t,n){var e,i,r;if(this.options.backtrack_lexer&&(r={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&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,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(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e)return e;if(this._backtrack){for(var s in r)this[s]=r[s];return!1}return!1}),"test_match"),next:i((function(){if(this.done)return this.EOF;var t,n,e,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),s=0;s<r.length;s++)if((e=this._input.match(this.rules[r[s]]))&&(!n||e[0].length>n[0].length)){if(n=e,i=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(e,r[s])))return t;if(this._backtrack){n=!1;continue}return!1}if(!this.options.flex)break}return n?!1!==(t=this.test_match(n,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:i((function(){var t=this.next();return t||this.lex()}),"lex"),begin:i((function(t){this.conditionStack.push(t)}),"begin"),popState:i((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:i((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:i((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:i((function(t){this.begin(t)}),"pushState"),stateStackSize:i((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:i((function(t,n,e,i){switch(e){case 0:return this.pushState("csv"),4;case 1:return 10;case 2:return 5;case 3:return 12;case 4:return this.pushState("escaped_text"),18;case 5:return 20;case 6:return this.popState("escaped_text"),18;case 7:return 19}}),"anonymous"),rules:[/^(?:sankey-beta\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:[1,2,3,4,5,6,7],inclusive:!1},escaped_text:{rules:[6,7],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}}}();function a(){this.yy={}}return s.lexer=o,i(a,"Parser"),a.prototype=s,s.Parser=a,new a}();tt.parser=tt;var nt=tt,et=[],it=[],rt=new Map,st=i((()=>{et=[],it=[],rt=new Map,y()}),"clear"),ot=(i(t=class{constructor(t,n,e=0){this.source=t,this.target=n,this.value=e}},"SankeyLink"),t),at=i(((t,n,e)=>{et.push(new ot(t,n,e))}),"addLink"),lt=(i(n=class{constructor(t){this.ID=t}},"SankeyNode"),n),ct=i((t=>{t=d.sanitizeText(t,h());let n=rt.get(t);return void 0===n&&(n=new lt(t),rt.set(t,n),it.push(n)),n}),"findOrCreateNode"),ht=i((()=>it),"getNodes"),ut=i((()=>et),"getLinks"),ft=i((()=>({nodes:it.map((t=>({id:t.ID}))),links:et.map((t=>({source:t.source.ID,target:t.target.ID,value:t.value})))})),"getGraph"),yt={nodesMap:rt,getConfig:i((()=>h().sankey),"getConfig"),getNodes:ht,getLinks:ut,getGraph:ft,addLink:at,findOrCreateNode:ct,getAccTitle:c,setAccTitle:l,getAccDescription:a,setAccDescription:o,getDiagramTitle:s,setDiagramTitle:r,clear:st},dt=(i(e=class{static next(t){return new e(t+ ++e.count)}constructor(t){this.id=t,this.href=`#${t}`}toString(){return"url("+this.href+")"}},"Uid"),e.count=0,e),pt={left:function(t){return t.depth},right:function(t,n){return n-1-t.height},center:function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?w(t.sourceLinks,E)-1:0},justify:L},gt={draw:i((function(t,n,e,r){const{securityLevel:s,sankey:o}=h(),a=u.sankey;let l;"sandbox"===s&&(l=p("#i"+n));const c=p("sandbox"===s?l.nodes()[0].contentDocument.body:"body"),y="sandbox"===s?c.select(`[id="${n}"]`):p(`[id="${n}"]`),d=(null==o?void 0:o.width)??a.width,_=(null==o?void 0:o.height)??a.width,x=(null==o?void 0:o.useMaxWidth)??a.useMaxWidth,k=(null==o?void 0:o.nodeAlignment)??a.nodeAlignment,v=(null==o?void 0:o.prefix)??a.prefix,b=(null==o?void 0:o.suffix)??a.suffix,w=(null==o?void 0:o.showValues)??a.showValues,S=r.db.getGraph(),E=pt[k];$().nodeId((t=>t.id)).nodeWidth(10).nodePadding(10+(w?15:0)).nodeAlign(E).extent([[0,0],[d,_]])(S);const L=g(m);y.append("g").attr("class","nodes").selectAll(".node").data(S.nodes).join("g").attr("class","node").attr("id",(t=>(t.uid=dt.next("node-")).id)).attr("transform",(function(t){return"translate("+t.x0+","+t.y0+")"})).attr("x",(t=>t.x0)).attr("y",(t=>t.y0)).append("rect").attr("height",(t=>t.y1-t.y0)).attr("width",(t=>t.x1-t.x0)).attr("fill",(t=>L(t.id)));const A=i((({id:t,value:n})=>w?`${t}\n${v}${Math.round(100*n)/100}${b}`:t),"getText");y.append("g").attr("class","node-labels").attr("font-family","sans-serif").attr("font-size",14).selectAll("text").data(S.nodes).join("text").attr("x",(t=>t.x0<d/2?t.x1+6:t.x0-6)).attr("y",(t=>(t.y1+t.y0)/2)).attr("dy",(w?"0":"0.35")+"em").attr("text-anchor",(t=>t.x0<d/2?"start":"end")).text(A);const M=y.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(S.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),I=(null==o?void 0:o.linkColor)??"gradient";if("gradient"===I){const t=M.append("linearGradient").attr("id",(t=>(t.uid=dt.next("linearGradient-")).id)).attr("gradientUnits","userSpaceOnUse").attr("x1",(t=>t.source.x1)).attr("x2",(t=>t.target.x0));t.append("stop").attr("offset","0%").attr("stop-color",(t=>L(t.source.id))),t.append("stop").attr("offset","100%").attr("stop-color",(t=>L(t.target.id)))}let T;switch(I){case"gradient":T=i((t=>t.uid),"coloring");break;case"source":T=i((t=>L(t.source.id)),"coloring");break;case"target":T=i((t=>L(t.target.id)),"coloring");break;default:T=I}M.append("path").attr("d",Z().source(H).target(J)).attr("stroke",T).attr("stroke-width",(t=>Math.max(1,t.width))),f(void 0,y,0,x)}),"draw")},_t=i((t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,"\n").trim()),"prepareTextForParsing"),mt=nt.parse.bind(nt);nt.parse=t=>mt(_t(t));var xt={parser:nt,db:yt,renderer:gt};export{xt as diagram};
@@ -1 +0,0 @@
1
- import{a as t,b as e,g as a,d as r,c as s,e as i}from"./chunk-ASOPGD6M-DewGTxkr.js";import{I as n}from"./chunk-KFBOBJHC-DOfnAPal.js";import{_ as o,g as c,s as l,b as d,o as h,n as p,a as g,c as u,l as x,i as y,d as m,e as b,j as T,h as f,v as E,u as w,L as I,M as L,N as P,Z as _,O as v,E as A}from"./mermaid-NCa4Btby.js";import{s as N}from"./transform-CdY8z5kT.js";import"./index-M-fa6gqH.js";import"./step-xJWGRC3d.js";var k=function(){var t=o((function(t,e,a,r){for(a=a||{},r=t.length;r--;a[t[r]]=e);return a}),"o"),e=[1,2],a=[1,3],r=[1,4],s=[2,4],i=[1,9],n=[1,11],c=[1,13],l=[1,14],d=[1,16],h=[1,17],p=[1,18],g=[1,24],u=[1,25],x=[1,26],y=[1,27],m=[1,28],b=[1,29],T=[1,30],f=[1,31],E=[1,32],w=[1,33],I=[1,34],L=[1,35],P=[1,36],_=[1,37],v=[1,38],A=[1,39],N=[1,41],k=[1,42],M=[1,43],O=[1,44],D=[1,45],S=[1,46],R=[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,54,59,60,61,62,70],C=[4,5,16,50,52,53],B=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],$=[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,54,59,60,61,62,70],Y=[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,54,59,60,61,62,70],V=[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,54,59,60,61,62,70],F=[68,69,70],W=[1,122],q={trace:o((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,note:54,placement:55,text2:56,over:57,actor_pair:58,links:59,link:60,properties:61,details:62,spaceList:63,",":64,left_of:65,right_of:66,signaltype:67,"+":68,"-":69,ACTOR:70,SOLID_OPEN_ARROW:71,DOTTED_OPEN_ARROW:72,SOLID_ARROW:73,BIDIRECTIONAL_SOLID_ARROW:74,DOTTED_ARROW:75,BIDIRECTIONAL_DOTTED_ARROW:76,SOLID_CROSS:77,DOTTED_CROSS:78,SOLID_POINT:79,DOTTED_POINT:80,TXT:81,$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",54:"note",57:"over",59:"links",60:"link",61:"properties",62:"details",64:",",65:"left_of",66:"right_of",68:"+",69:"-",70:"ACTOR",71:"SOLID_OPEN_ARROW",72:"DOTTED_OPEN_ARROW",73:"SOLID_ARROW",74:"BIDIRECTIONAL_SOLID_ARROW",75:"DOTTED_ARROW",76:"BIDIRECTIONAL_DOTTED_ARROW",77:"SOLID_CROSS",78:"DOTTED_CROSS",79:"SOLID_POINT",80:"DOTTED_POINT",81:"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],[24,4],[24,4],[25,3],[26,3],[27,3],[28,3],[63,2],[63,1],[58,3],[58,1],[55,1],[55,1],[17,5],[17,5],[17,4],[22,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[56,1]],performAction:o((function(t,e,a,r,s,i,n){var o=i.length-1;switch(s){case 3:return r.apply(i[o]),i[o];case 4:case 9:case 8:case 13:this.$=[];break;case 5:case 10:i[o-1].push(i[o]),this.$=i[o-1];break;case 6:case 7:case 11:case 12:case 62:this.$=i[o];break;case 15:i[o].type="createParticipant",this.$=i[o];break;case 16:i[o-1].unshift({type:"boxStart",boxData:r.parseBoxData(i[o-2])}),i[o-1].push({type:"boxEnd",boxText:i[o-2]}),this.$=i[o-1];break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(i[o-2]),sequenceIndexStep:Number(i[o-1]),sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(i[o-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:r.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"activeStart",signalType:r.LINETYPE.ACTIVE_START,actor:i[o-1].actor};break;case 23:this.$={type:"activeEnd",signalType:r.LINETYPE.ACTIVE_END,actor:i[o-1].actor};break;case 29:r.setDiagramTitle(i[o].substring(6)),this.$=i[o].substring(6);break;case 30:r.setDiagramTitle(i[o].substring(7)),this.$=i[o].substring(7);break;case 31:this.$=i[o].trim(),r.setAccTitle(this.$);break;case 32:case 33:this.$=i[o].trim(),r.setAccDescription(this.$);break;case 34:i[o-1].unshift({type:"loopStart",loopText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.LOOP_START}),i[o-1].push({type:"loopEnd",loopText:i[o-2],signalType:r.LINETYPE.LOOP_END}),this.$=i[o-1];break;case 35:i[o-1].unshift({type:"rectStart",color:r.parseMessage(i[o-2]),signalType:r.LINETYPE.RECT_START}),i[o-1].push({type:"rectEnd",color:r.parseMessage(i[o-2]),signalType:r.LINETYPE.RECT_END}),this.$=i[o-1];break;case 36:i[o-1].unshift({type:"optStart",optText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.OPT_START}),i[o-1].push({type:"optEnd",optText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.OPT_END}),this.$=i[o-1];break;case 37:i[o-1].unshift({type:"altStart",altText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.ALT_START}),i[o-1].push({type:"altEnd",signalType:r.LINETYPE.ALT_END}),this.$=i[o-1];break;case 38:i[o-1].unshift({type:"parStart",parText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.PAR_START}),i[o-1].push({type:"parEnd",signalType:r.LINETYPE.PAR_END}),this.$=i[o-1];break;case 39:i[o-1].unshift({type:"parStart",parText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.PAR_OVER_START}),i[o-1].push({type:"parEnd",signalType:r.LINETYPE.PAR_END}),this.$=i[o-1];break;case 40:i[o-1].unshift({type:"criticalStart",criticalText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.CRITICAL_START}),i[o-1].push({type:"criticalEnd",signalType:r.LINETYPE.CRITICAL_END}),this.$=i[o-1];break;case 41:i[o-1].unshift({type:"breakStart",breakText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.BREAK_START}),i[o-1].push({type:"breakEnd",optText:r.parseMessage(i[o-2]),signalType:r.LINETYPE.BREAK_END}),this.$=i[o-1];break;case 43:this.$=i[o-3].concat([{type:"option",optionText:r.parseMessage(i[o-1]),signalType:r.LINETYPE.CRITICAL_OPTION},i[o]]);break;case 45:this.$=i[o-3].concat([{type:"and",parText:r.parseMessage(i[o-1]),signalType:r.LINETYPE.PAR_AND},i[o]]);break;case 47:this.$=i[o-3].concat([{type:"else",altText:r.parseMessage(i[o-1]),signalType:r.LINETYPE.ALT_ELSE},i[o]]);break;case 48:i[o-3].draw="participant",i[o-3].type="addParticipant",i[o-3].description=r.parseMessage(i[o-1]),this.$=i[o-3];break;case 49:i[o-1].draw="participant",i[o-1].type="addParticipant",this.$=i[o-1];break;case 50:i[o-3].draw="actor",i[o-3].type="addParticipant",i[o-3].description=r.parseMessage(i[o-1]),this.$=i[o-3];break;case 51:i[o-1].draw="actor",i[o-1].type="addParticipant",this.$=i[o-1];break;case 52:i[o-1].type="destroyParticipant",this.$=i[o-1];break;case 53:this.$=[i[o-1],{type:"addNote",placement:i[o-2],actor:i[o-1].actor,text:i[o]}];break;case 54:i[o-2]=[].concat(i[o-1],i[o-1]).slice(0,2),i[o-2][0]=i[o-2][0].actor,i[o-2][1]=i[o-2][1].actor,this.$=[i[o-1],{type:"addNote",placement:r.PLACEMENT.OVER,actor:i[o-2].slice(0,2),text:i[o]}];break;case 55:this.$=[i[o-1],{type:"addLinks",actor:i[o-1].actor,text:i[o]}];break;case 56:this.$=[i[o-1],{type:"addALink",actor:i[o-1].actor,text:i[o]}];break;case 57:this.$=[i[o-1],{type:"addProperties",actor:i[o-1].actor,text:i[o]}];break;case 58:this.$=[i[o-1],{type:"addDetails",actor:i[o-1].actor,text:i[o]}];break;case 61:this.$=[i[o-2],i[o]];break;case 63:this.$=r.PLACEMENT.LEFTOF;break;case 64:this.$=r.PLACEMENT.RIGHTOF;break;case 65:this.$=[i[o-4],i[o-1],{type:"addMessage",from:i[o-4].actor,to:i[o-1].actor,signalType:i[o-3],msg:i[o],activate:!0},{type:"activeStart",signalType:r.LINETYPE.ACTIVE_START,actor:i[o-1].actor}];break;case 66:this.$=[i[o-4],i[o-1],{type:"addMessage",from:i[o-4].actor,to:i[o-1].actor,signalType:i[o-3],msg:i[o]},{type:"activeEnd",signalType:r.LINETYPE.ACTIVE_END,actor:i[o-4].actor}];break;case 67:this.$=[i[o-3],i[o-1],{type:"addMessage",from:i[o-3].actor,to:i[o-1].actor,signalType:i[o-2],msg:i[o]}];break;case 68:this.$={type:"addParticipant",actor:i[o]};break;case 69:this.$=r.LINETYPE.SOLID_OPEN;break;case 70:this.$=r.LINETYPE.DOTTED_OPEN;break;case 71:this.$=r.LINETYPE.SOLID;break;case 72:this.$=r.LINETYPE.BIDIRECTIONAL_SOLID;break;case 73:this.$=r.LINETYPE.DOTTED;break;case 74:this.$=r.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 75:this.$=r.LINETYPE.SOLID_CROSS;break;case 76:this.$=r.LINETYPE.DOTTED_CROSS;break;case 77:this.$=r.LINETYPE.SOLID_POINT;break;case 78:this.$=r.LINETYPE.DOTTED_POINT;break;case 79:this.$=r.parseMessage(i[o].trim().substring(1))}}),"anonymous"),table:[{3:1,4:e,5:a,6:r},{1:[3]},{3:5,4:e,5:a,6:r},{3:6,4:e,5:a,6:r},t([1,4,5,13,14,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],s,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:i,5:n,8:8,9:10,12:12,13:c,14:l,17:15,18:d,21:h,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:f,39:E,41:w,43:I,44:L,46:P,50:_,52:v,53:A,54:N,59:k,60:M,61:O,62:D,70:S},t(R,[2,5]),{9:47,12:12,13:c,14:l,17:15,18:d,21:h,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:f,39:E,41:w,43:I,44:L,46:P,50:_,52:v,53:A,54:N,59:k,60:M,61:O,62:D,70:S},t(R,[2,7]),t(R,[2,8]),t(R,[2,14]),{12:48,50:_,52:v,53:A},{15:[1,49]},{5:[1,50]},{5:[1,53],19:[1,51],20:[1,52]},{22:54,70:S},{22:55,70:S},{5:[1,56]},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},t(R,[2,29]),t(R,[2,30]),{32:[1,61]},{34:[1,62]},t(R,[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,70:S},{22:72,70:S},{22:73,70:S},{67:74,71:[1,75],72:[1,76],73:[1,77],74:[1,78],75:[1,79],76:[1,80],77:[1,81],78:[1,82],79:[1,83],80:[1,84]},{55:85,57:[1,86],65:[1,87],66:[1,88]},{22:89,70:S},{22:90,70:S},{22:91,70:S},{22:92,70:S},t([5,51,64,71,72,73,74,75,76,77,78,79,80,81],[2,68]),t(R,[2,6]),t(R,[2,15]),t(C,[2,9],{10:93}),t(R,[2,17]),{5:[1,95],19:[1,94]},{5:[1,96]},t(R,[2,21]),{5:[1,97]},{5:[1,98]},t(R,[2,24]),t(R,[2,25]),t(R,[2,26]),t(R,[2,27]),t(R,[2,28]),t(R,[2,31]),t(R,[2,32]),t(B,s,{7:99}),t(B,s,{7:100}),t(B,s,{7:101}),t($,s,{40:102,7:103}),t(Y,s,{42:104,7:105}),t(Y,s,{7:105,42:106}),t(V,s,{45:107,7:108}),t(B,s,{7:109}),{5:[1,111],51:[1,110]},{5:[1,113],51:[1,112]},{5:[1,114]},{22:117,68:[1,115],69:[1,116],70:S},t(F,[2,69]),t(F,[2,70]),t(F,[2,71]),t(F,[2,72]),t(F,[2,73]),t(F,[2,74]),t(F,[2,75]),t(F,[2,76]),t(F,[2,77]),t(F,[2,78]),{22:118,70:S},{22:120,58:119,70:S},{70:[2,63]},{70:[2,64]},{56:121,81:W},{56:123,81:W},{56:124,81:W},{56:125,81:W},{4:[1,128],5:[1,130],11:127,12:129,16:[1,126],50:_,52:v,53:A},{5:[1,131]},t(R,[2,19]),t(R,[2,20]),t(R,[2,22]),t(R,[2,23]),{4:i,5:n,8:8,9:10,12:12,13:c,14:l,16:[1,132],17:15,18:d,21:h,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:f,39:E,41:w,43:I,44:L,46:P,50:_,52:v,53:A,54:N,59:k,60:M,61:O,62:D,70:S},{4:i,5:n,8:8,9:10,12:12,13:c,14:l,16:[1,133],17:15,18:d,21:h,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:f,39:E,41:w,43:I,44:L,46:P,50:_,52:v,53:A,54:N,59:k,60:M,61:O,62:D,70:S},{4:i,5:n,8:8,9:10,12:12,13:c,14:l,16:[1,134],17:15,18:d,21:h,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:f,39:E,41:w,43:I,44:L,46:P,50:_,52:v,53:A,54:N,59:k,60:M,61:O,62:D,70:S},{16:[1,135]},{4:i,5:n,8:8,9:10,12:12,13:c,14:l,16:[2,46],17:15,18:d,21:h,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:f,39:E,41:w,43:I,44:L,46:P,49:[1,136],50:_,52:v,53:A,54:N,59:k,60:M,61:O,62:D,70:S},{16:[1,137]},{4:i,5:n,8:8,9:10,12:12,13:c,14:l,16:[2,44],17:15,18:d,21:h,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:f,39:E,41:w,43:I,44:L,46:P,48:[1,138],50:_,52:v,53:A,54:N,59:k,60:M,61:O,62:D,70:S},{16:[1,139]},{16:[1,140]},{4:i,5:n,8:8,9:10,12:12,13:c,14:l,16:[2,42],17:15,18:d,21:h,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:f,39:E,41:w,43:I,44:L,46:P,47:[1,141],50:_,52:v,53:A,54:N,59:k,60:M,61:O,62:D,70:S},{4:i,5:n,8:8,9:10,12:12,13:c,14:l,16:[1,142],17:15,18:d,21:h,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:x,33:y,35:m,36:b,37:T,38:f,39:E,41:w,43:I,44:L,46:P,50:_,52:v,53:A,54:N,59:k,60:M,61:O,62:D,70:S},{15:[1,143]},t(R,[2,49]),{15:[1,144]},t(R,[2,51]),t(R,[2,52]),{22:145,70:S},{22:146,70:S},{56:147,81:W},{56:148,81:W},{56:149,81:W},{64:[1,150],81:[2,62]},{5:[2,55]},{5:[2,79]},{5:[2,56]},{5:[2,57]},{5:[2,58]},t(R,[2,16]),t(C,[2,10]),{12:151,50:_,52:v,53:A},t(C,[2,12]),t(C,[2,13]),t(R,[2,18]),t(R,[2,34]),t(R,[2,35]),t(R,[2,36]),t(R,[2,37]),{15:[1,152]},t(R,[2,38]),{15:[1,153]},t(R,[2,39]),t(R,[2,40]),{15:[1,154]},t(R,[2,41]),{5:[1,155]},{5:[1,156]},{56:157,81:W},{56:158,81:W},{5:[2,67]},{5:[2,53]},{5:[2,54]},{22:159,70:S},t(C,[2,11]),t($,s,{7:103,40:160}),t(Y,s,{7:105,42:161}),t(V,s,{7:108,45:162}),t(R,[2,48]),t(R,[2,50]),{5:[2,65]},{5:[2,66]},{81:[2,61]},{16:[2,47]},{16:[2,45]},{16:[2,43]}],defaultActions:{5:[2,1],6:[2,2],87:[2,63],88:[2,64],121:[2,55],122:[2,79],123:[2,56],124:[2,57],125:[2,58],147:[2,67],148:[2,53],149:[2,54],157:[2,65],158:[2,66],159:[2,61],160:[2,47],161:[2,45],162:[2,43]},parseError:o((function(t,e){if(!e.recoverable){var a=new Error(t);throw a.hash=e,a}this.trace(t)}),"parseError"),parse:o((function(t){var e=this,a=[0],r=[],s=[null],i=[],n=this.table,c="",l=0,d=0,h=i.slice.call(arguments,1),p=Object.create(this.lexer),g={yy:{}};for(var u in this.yy)Object.prototype.hasOwnProperty.call(this.yy,u)&&(g.yy[u]=this.yy[u]);p.setInput(t,g.yy),g.yy.lexer=p,g.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var x=p.yylloc;i.push(x);var y=p.options&&p.options.ranges;function m(){var t;return"number"!=typeof(t=r.pop()||p.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof g.yy.parseError?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o((function(t){a.length=a.length-2*t,s.length=s.length-t,i.length=i.length-t}),"popStack"),o(m,"lex");for(var b,T,f,E,w,I,L,P,_={};;){if(T=a[a.length-1],this.defaultActions[T]?f=this.defaultActions[T]:(null==b&&(b=m()),f=n[T]&&n[T][b]),void 0===f||!f.length||!f[0]){var v="";for(w in P=[],n[T])this.terminals_[w]&&w>2&&P.push("'"+this.terminals_[w]+"'");v=p.showPosition?"Parse error on line "+(l+1)+":\n"+p.showPosition()+"\nExpecting "+P.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==b?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(v,{text:p.match,token:this.terminals_[b]||b,line:p.yylineno,loc:x,expected:P})}if(f[0]instanceof Array&&f.length>1)throw new Error("Parse Error: multiple actions possible at state: "+T+", token: "+b);switch(f[0]){case 1:a.push(b),s.push(p.yytext),i.push(p.yylloc),a.push(f[1]),b=null,d=p.yyleng,c=p.yytext,l=p.yylineno,x=p.yylloc;break;case 2:if(I=this.productions_[f[1]][1],_.$=s[s.length-I],_._$={first_line:i[i.length-(I||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(I||1)].first_column,last_column:i[i.length-1].last_column},y&&(_._$.range=[i[i.length-(I||1)].range[0],i[i.length-1].range[1]]),void 0!==(E=this.performAction.apply(_,[c,d,l,g.yy,f[1],s,i].concat(h))))return E;I&&(a=a.slice(0,-1*I*2),s=s.slice(0,-1*I),i=i.slice(0,-1*I)),a.push(this.productions_[f[1]][0]),s.push(_.$),i.push(_._$),L=n[a[a.length-2]][a[a.length-1]],a.push(L);break;case 3:return!0}}return!0}),"parse")},z=function(){return{EOF:1,parseError:o((function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)}),"parseError"),setInput:o((function(t,e){return this.yy=e||this.yy||{},this._input=t,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:o((function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t}),"input"),unput:o((function(t){var e=t.length,a=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var s=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:a?(a.length===r.length?this.yylloc.first_column:0)+r[r.length-a.length].length-a[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this}),"unput"),more:o((function(){return this._more=!0,this}),"more"),reject:o((function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"reject"),less:o((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:o((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:o((function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:o((function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:o((function(t,e){var a,r,s;if(this.options.backtrack_lexer&&(s={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&&(s.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,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(t[0].length),this.matched+=t[0],a=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a)return a;if(this._backtrack){for(var i in s)this[i]=s[i];return!1}return!1}),"test_match"),next:o((function(){if(this.done)return this.EOF;var t,e,a,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),i=0;i<s.length;i++)if((a=this._input.match(this.rules[s[i]]))&&(!e||a[0].length>e[0].length)){if(e=a,r=i,this.options.backtrack_lexer){if(!1!==(t=this.test_match(a,s[i])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}),"next"),lex:o((function(){var t=this.next();return t||this.lex()}),"lex"),begin:o((function(t){this.conditionStack.push(t)}),"begin"),popState:o((function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]}),"popState"),_currentRules:o((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:o((function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"}),"topState"),pushState:o((function(t){this.begin(t)}),"pushState"),stateStackSize:o((function(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":!0},performAction:o((function(t,e,a,r){switch(a){case 0:case 51:case 66:return 5;case 1:case 2:case 3:case 4:case 5:break;case 6:return 19;case 7:return this.begin("LINE"),14;case 8:return this.begin("ID"),50;case 9:return this.begin("ID"),52;case 10:return 13;case 11:return this.begin("ID"),53;case 12:return e.yytext=e.yytext.trim(),this.begin("ALIAS"),70;case 13:return this.popState(),this.popState(),this.begin("LINE"),51;case 14:return this.popState(),this.popState(),5;case 15:return this.begin("LINE"),36;case 16:return this.begin("LINE"),37;case 17:return this.begin("LINE"),38;case 18:return this.begin("LINE"),39;case 19:return this.begin("LINE"),49;case 20:return this.begin("LINE"),41;case 21:return this.begin("LINE"),43;case 22:return this.begin("LINE"),48;case 23:return this.begin("LINE"),44;case 24:return this.begin("LINE"),47;case 25:return this.begin("LINE"),46;case 26:return this.popState(),15;case 27:return 16;case 28:return 65;case 29:return 66;case 30:return 59;case 31:return 60;case 32:return 61;case 33:return 62;case 34:return 57;case 35:return 54;case 36:return this.begin("ID"),21;case 37:return this.begin("ID"),23;case 38:return 29;case 39:return 30;case 40:return this.begin("acc_title"),31;case 41:return this.popState(),"acc_title_value";case 42:return this.begin("acc_descr"),33;case 43:return this.popState(),"acc_descr_value";case 44:this.begin("acc_descr_multiline");break;case 45:this.popState();break;case 46:return"acc_descr_multiline_value";case 47:return 6;case 48:return 18;case 49:return 20;case 50:return 64;case 52:return e.yytext=e.yytext.trim(),70;case 53:return 73;case 54:return 74;case 55:return 75;case 56:return 76;case 57:return 71;case 58:return 72;case 59:return 77;case 60:return 78;case 61:return 79;case 62:return 80;case 63:return 81;case 64:return 68;case 65:return 69;case 67:return"INVALID"}}),"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \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],conditions:{acc_descr_multiline:{rules:[45,46],inclusive:!1},acc_descr:{rules:[43],inclusive:!1},acc_title:{rules:[41],inclusive:!1},ID:{rules:[2,3,12],inclusive:!1},ALIAS:{rules:[2,3,13,14],inclusive:!1},LINE:{rules:[2,3,26],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,7,8,9,10,11,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30,31,32,33,34,35,36,37,38,39,40,42,44,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67],inclusive:!0}}}}();function H(){this.yy={}}return q.lexer=z,o(H,"Parser"),H.prototype=q,q.Parser=H,new H}();k.parser=k;var M=k,O=new n((()=>({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}))),D=o((function(t){O.records.boxes.push({name:t.text,wrap:t.wrap??Z(),fill:t.color,actorKeys:[]}),O.records.currentBox=O.records.boxes.slice(-1)[0]}),"addBox"),S=o((function(t,e,a,r){let s=O.records.currentBox;const i=O.records.actors.get(t);if(i){if(O.records.currentBox&&i.box&&O.records.currentBox!==i.box)throw new Error(`A same participant should only be defined in one Box: ${i.name} can't be in '${i.box.name}' and in '${O.records.currentBox.name}' at the same time.`);if(s=i.box?i.box:O.records.currentBox,i.box=s,i&&e===i.name&&null==a)return}if(null==(null==a?void 0:a.text)&&(a={text:e,type:r}),null!=r&&null!=a.text||(a={text:e,type:r}),O.records.actors.set(t,{box:s,name:e,description:a.text,wrap:a.wrap??Z(),prevActor:O.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:r??"participant"}),O.records.prevActor){const e=O.records.actors.get(O.records.prevActor);e&&(e.nextActor=t)}O.records.currentBox&&O.records.currentBox.actorKeys.push(t),O.records.prevActor=t}),"addActor"),R=o((t=>{let e,a=0;if(!t)return 0;for(e=0;e<O.records.messages.length;e++)O.records.messages[e].type===at.ACTIVE_START&&O.records.messages[e].from===t&&a++,O.records.messages[e].type===at.ACTIVE_END&&O.records.messages[e].from===t&&a--;return a}),"activationCount"),C=o((function(t,e,a,r){O.records.messages.push({from:t,to:e,message:a.text,wrap:a.wrap??Z(),answer:r})}),"addMessage"),B=o((function(t,e,a,r,s=!1){if(r===at.ACTIVE_END){if(R(t??"")<1){const e=new Error("Trying to inactivate an inactive participant ("+t+")");throw e.hash={text:"->>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},e}}return O.records.messages.push({from:t,to:e,message:(null==a?void 0:a.text)??"",wrap:(null==a?void 0:a.wrap)??Z(),type:r,activate:s}),!0}),"addSignal"),$=o((function(){return O.records.boxes.length>0}),"hasAtLeastOneBox"),Y=o((function(){return O.records.boxes.some((t=>t.name))}),"hasAtLeastOneBoxWithTitle"),V=o((function(){return O.records.messages}),"getMessages"),F=o((function(){return O.records.boxes}),"getBoxes"),W=o((function(){return O.records.actors}),"getActors"),q=o((function(){return O.records.createdActors}),"getCreatedActors"),z=o((function(){return O.records.destroyedActors}),"getDestroyedActors"),H=o((function(t){return O.records.actors.get(t)}),"getActor"),j=o((function(){return[...O.records.actors.keys()]}),"getActorKeys"),U=o((function(){O.records.sequenceNumbersEnabled=!0}),"enableSequenceNumbers"),K=o((function(){O.records.sequenceNumbersEnabled=!1}),"disableSequenceNumbers"),X=o((()=>O.records.sequenceNumbersEnabled),"showSequenceNumbers"),G=o((function(t){O.records.wrapEnabled=t}),"setWrap"),J=o((t=>{if(void 0===t)return{};t=t.trim();const e=null!==/^:?wrap:/.exec(t)||null===/^:?nowrap:/.exec(t)&&void 0;return{cleanedText:(void 0===e?t:t.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:e}}),"extractWrap"),Z=o((()=>{var t;return void 0!==O.records.wrapEnabled?O.records.wrapEnabled:(null==(t=u().sequence)?void 0:t.wrap)??!1}),"autoWrap"),Q=o((function(){O.reset(),E()}),"clear"),tt=o((function(t){const e=t.trim(),{wrap:a,cleanedText:r}=J(e),s={text:r,wrap:a};return x.debug(`parseMessage: ${JSON.stringify(s)}`),s}),"parseMessage"),et=o((function(t){const e=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t);let a=(null==e?void 0:e[1])?e[1].trim():"transparent",r=(null==e?void 0:e[2])?e[2].trim():void 0;if(null==window?void 0:window.CSS)window.CSS.supports("color",a)||(a="transparent",r=t.trim());else{const e=(new Option).style;e.color=a,e.color!==a&&(a="transparent",r=t.trim())}const{wrap:s,cleanedText:i}=J(r);return{text:i?f(i,u()):void 0,color:a,wrap:s}}),"parseBoxData"),at={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},rt=o((function(t,e,a){const r={actor:t,placement:e,message:a.text,wrap:a.wrap??Z()},s=[].concat(t,t);O.records.notes.push(r),O.records.messages.push({from:s[0],to:s[1],message:a.text,wrap:a.wrap??Z(),type:at.NOTE,placement:e})}),"addNote"),st=o((function(t,e){const a=H(t);try{let t=f(e.text,u());t=t.replace(/&amp;/g,"&"),t=t.replace(/&equals;/g,"=");nt(a,JSON.parse(t))}catch(r){x.error("error while parsing actor link text",r)}}),"addLinks"),it=o((function(t,e){const a=H(t);try{const t={};let r=f(e.text,u());const s=r.indexOf("@");r=r.replace(/&amp;/g,"&"),r=r.replace(/&equals;/g,"=");const i=r.slice(0,s-1).trim(),n=r.slice(s+1).trim();t[i]=n,nt(a,t)}catch(r){x.error("error while parsing actor link text",r)}}),"addALink");function nt(t,e){if(null==t.links)t.links=e;else for(const a in e)t.links[a]=e[a]}o(nt,"insertLinks");var ot=o((function(t,e){const a=H(t);try{const t=f(e.text,u());ct(a,JSON.parse(t))}catch(r){x.error("error while parsing actor properties text",r)}}),"addProperties");function ct(t,e){if(null==t.properties)t.properties=e;else for(const a in e)t.properties[a]=e[a]}function lt(){O.records.currentBox=void 0}o(ct,"insertProperties"),o(lt,"boxEnd");var dt=o((function(t,e){const a=H(t),r=document.getElementById(e.text);try{const t=r.innerHTML,e=JSON.parse(t);e.properties&&ct(a,e.properties),e.links&&nt(a,e.links)}catch(s){x.error("error while parsing actor details text",s)}}),"addDetails"),ht=o((function(t,e){if(void 0!==(null==t?void 0:t.properties))return t.properties[e]}),"getActorProperty"),pt=o((function(t){if(Array.isArray(t))t.forEach((function(t){pt(t)}));else switch(t.type){case"sequenceIndex":O.records.messages.push({from:void 0,to:void 0,message:{start:t.sequenceIndex,step:t.sequenceIndexStep,visible:t.sequenceVisible},wrap:!1,type:t.signalType});break;case"addParticipant":S(t.actor,t.actor,t.description,t.draw);break;case"createParticipant":if(O.records.actors.has(t.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");O.records.lastCreated=t.actor,S(t.actor,t.actor,t.description,t.draw),O.records.createdActors.set(t.actor,O.records.messages.length);break;case"destroyParticipant":O.records.lastDestroyed=t.actor,O.records.destroyedActors.set(t.actor,O.records.messages.length);break;case"activeStart":case"activeEnd":B(t.actor,void 0,void 0,t.signalType);break;case"addNote":rt(t.actor,t.placement,t.text);break;case"addLinks":st(t.actor,t.text);break;case"addALink":it(t.actor,t.text);break;case"addProperties":ot(t.actor,t.text);break;case"addDetails":dt(t.actor,t.text);break;case"addMessage":if(O.records.lastCreated){if(t.to!==O.records.lastCreated)throw new Error("The created participant "+O.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");O.records.lastCreated=void 0}else if(O.records.lastDestroyed){if(t.to!==O.records.lastDestroyed&&t.from!==O.records.lastDestroyed)throw new Error("The destroyed participant "+O.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");O.records.lastDestroyed=void 0}B(t.from,t.to,t.msg,t.signalType,t.activate);break;case"boxStart":D(t.boxData);break;case"boxEnd":lt();break;case"loopStart":B(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":case"rectEnd":case"optEnd":case"altEnd":case"parEnd":case"criticalEnd":case"breakEnd":B(void 0,void 0,void 0,t.signalType);break;case"rectStart":B(void 0,void 0,t.color,t.signalType);break;case"optStart":B(void 0,void 0,t.optText,t.signalType);break;case"altStart":case"else":B(void 0,void 0,t.altText,t.signalType);break;case"setAccTitle":d(t.text);break;case"parStart":case"and":B(void 0,void 0,t.parText,t.signalType);break;case"criticalStart":B(void 0,void 0,t.criticalText,t.signalType);break;case"option":B(void 0,void 0,t.optionText,t.signalType);break;case"breakStart":B(void 0,void 0,t.breakText,t.signalType)}}),"apply"),gt={addActor:S,addMessage:C,addSignal:B,addLinks:st,addDetails:dt,addProperties:ot,autoWrap:Z,setWrap:G,enableSequenceNumbers:U,disableSequenceNumbers:K,showSequenceNumbers:X,getMessages:V,getActors:W,getCreatedActors:q,getDestroyedActors:z,getActor:H,getActorKeys:j,getActorProperty:ht,getAccTitle:g,getBoxes:F,getDiagramTitle:p,setDiagramTitle:h,getConfig:o((()=>u().sequence),"getConfig"),clear:Q,parseMessage:tt,parseBoxData:et,LINETYPE:at,ARROWTYPE:{FILLED:0,OPEN:1},PLACEMENT:{LEFTOF:0,RIGHTOF:1,OVER:2},addNote:rt,setAccTitle:d,apply:pt,setAccDescription:l,getAccDescription:c,hasAtLeastOneBox:$,hasAtLeastOneBoxWithTitle:Y},ut=o((t=>`.actor {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n }\n\n text.actor > tspan {\n fill: ${t.actorTextColor};\n stroke: none;\n }\n\n .actor-line {\n stroke: ${t.actorLineColor};\n }\n\n .messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: none;\n stroke: ${t.signalColor};\n }\n\n .messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: 2, 2;\n stroke: ${t.signalColor};\n }\n\n #arrowhead path {\n fill: ${t.signalColor};\n stroke: ${t.signalColor};\n }\n\n .sequenceNumber {\n fill: ${t.sequenceNumberColor};\n }\n\n #sequencenumber {\n fill: ${t.signalColor};\n }\n\n #crosshead path {\n fill: ${t.signalColor};\n stroke: ${t.signalColor};\n }\n\n .messageText {\n fill: ${t.signalTextColor};\n stroke: none;\n }\n\n .labelBox {\n stroke: ${t.labelBoxBorderColor};\n fill: ${t.labelBoxBkgColor};\n }\n\n .labelText, .labelText > tspan {\n fill: ${t.labelTextColor};\n stroke: none;\n }\n\n .loopText, .loopText > tspan {\n fill: ${t.loopTextColor};\n stroke: none;\n }\n\n .loopLine {\n stroke-width: 2px;\n stroke-dasharray: 2, 2;\n stroke: ${t.labelBoxBorderColor};\n fill: ${t.labelBoxBorderColor};\n }\n\n .note {\n //stroke: #decc93;\n stroke: ${t.noteBorderColor};\n fill: ${t.noteBkgColor};\n }\n\n .noteText, .noteText > tspan {\n fill: ${t.noteTextColor};\n stroke: none;\n }\n\n .activation0 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .activation1 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .activation2 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .actorPopupMenu {\n position: absolute;\n }\n\n .actorPopupMenuPanel {\n position: absolute;\n fill: ${t.actorBkg};\n box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);\n filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));\n}\n .actor-man line {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n }\n .actor-man circle, line {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n stroke-width: 2px;\n }\n`),"getStyles"),xt="actor-top",yt="actor-bottom",mt="actor-man",bt=o((function(t,e){return r(t,e)}),"drawRect"),Tt=o((function(t,e,a,r,s){if(void 0===e.links||null===e.links||0===Object.keys(e.links).length)return{height:0,width:0};const i=e.links,n=e.actorCnt,o=e.rectData;var c="none";s&&(c="block !important");const l=t.append("g");l.attr("id","actor"+n+"_popup"),l.attr("class","actorPopupMenu"),l.attr("display",c);var d="";void 0!==o.class&&(d=" "+o.class);let h=o.width>a?o.width:a;const p=l.append("rect");if(p.attr("class","actorPopupMenuPanel"+d),p.attr("x",o.x),p.attr("y",o.height),p.attr("fill",o.fill),p.attr("stroke",o.stroke),p.attr("width",h),p.attr("height",o.height),p.attr("rx",o.rx),p.attr("ry",o.ry),null!=i){var g=20;for(let t in i){var u=l.append("a"),x=y.sanitizeUrl(i[t]);u.attr("xlink:href",x),u.attr("target","_blank"),zt(r)(t,u,o.x+10,o.height+g,h,20,{class:"actor"},r),g+=30}}return p.attr("height",g),{height:o.height+g,width:h}}),"drawPopup"),ft=o((function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"}),"popupMenuToggle"),Et=o((async function(t,e,a=null){let r=t.append("foreignObject");const s=await v(e.text,A()),i=r.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(s).node().getBoundingClientRect();if(r.attr("height",Math.round(i.height)).attr("width",Math.round(i.width)),"noteText"===e.class){const a=t.node().firstChild;a.setAttribute("height",i.height+2*e.textMargin);const s=a.getBBox();r.attr("x",Math.round(s.x+s.width/2-i.width/2)).attr("y",Math.round(s.y+s.height/2-i.height/2))}else if(a){let{startx:t,stopx:s,starty:n}=a;if(t>s){const e=t;t=s,s=e}r.attr("x",Math.round(t+Math.abs(t-s)/2-i.width/2)),"loopText"===e.class?r.attr("y",Math.round(n)):r.attr("y",Math.round(n-i.height))}return[r]}),"drawKatex"),wt=o((function(t,e){let a=0,r=0;const s=e.text.split(T.lineBreakRegex),[i,n]=P(e.fontSize);let c=[],l=0,d=o((()=>e.y),"yfunc");if(void 0!==e.valign&&void 0!==e.textMargin&&e.textMargin>0)switch(e.valign){case"top":case"start":d=o((()=>Math.round(e.y+e.textMargin)),"yfunc");break;case"middle":case"center":d=o((()=>Math.round(e.y+(a+r+e.textMargin)/2)),"yfunc");break;case"bottom":case"end":d=o((()=>Math.round(e.y+(a+r+2*e.textMargin)-e.textMargin)),"yfunc")}if(void 0!==e.anchor&&void 0!==e.textMargin&&void 0!==e.width)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="middle",e.alignmentBaseline="middle"}for(let[o,h]of s.entries()){void 0!==e.textMargin&&0===e.textMargin&&void 0!==i&&(l=o*i);const s=t.append("text");s.attr("x",e.x),s.attr("y",d()),void 0!==e.anchor&&s.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),void 0!==e.fontFamily&&s.style("font-family",e.fontFamily),void 0!==n&&s.style("font-size",n),void 0!==e.fontWeight&&s.style("font-weight",e.fontWeight),void 0!==e.fill&&s.attr("fill",e.fill),void 0!==e.class&&s.attr("class",e.class),void 0!==e.dy?s.attr("dy",e.dy):0!==l&&s.attr("dy",l);const p=h||_;if(e.tspan){const t=s.append("tspan");t.attr("x",e.x),void 0!==e.fill&&t.attr("fill",e.fill),t.text(p)}else s.text(p);void 0!==e.valign&&void 0!==e.textMargin&&e.textMargin>0&&(r+=(s._groups||s)[0][0].getBBox().height,a=r),c.push(s)}return c}),"drawText"),It=o((function(t,e){function a(t,e,a,r,s){return t+","+e+" "+(t+a)+","+e+" "+(t+a)+","+(e+r-s)+" "+(t+a-1.2*s)+","+(e+r)+" "+t+","+(e+r)}o(a,"genPoints");const r=t.append("polygon");return r.attr("points",a(e.x,e.y,e.width,e.height,7)),r.attr("class","labelBox"),e.y=e.y+e.height/2,wt(t,e),r}),"drawLabel"),Lt=-1,Pt=o(((t,e,a,r)=>{t.select&&a.forEach((a=>{const s=e.get(a),i=t.select("#actor"+s.actorCnt);!r.mirrorActors&&s.stopy?i.attr("y2",s.stopy+s.height/2):r.mirrorActors&&i.attr("y2",s.stopy)}))}),"fixLifeLineHeights"),_t=o((function(t,e,r,n){var o,c;const l=n?e.stopy:e.starty,d=e.x+e.width/2,h=l+e.height,p=t.append("g").lower();var g=p;n||(Lt++,Object.keys(e.links||{}).length&&!r.forceMenus&&g.attr("onclick",ft(`actor${Lt}_popup`)).attr("cursor","pointer"),g.append("line").attr("id","actor"+Lt).attr("x1",d).attr("y1",h).attr("x2",d).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),g=p.append("g"),e.actorCnt=Lt,null!=e.links&&g.attr("id","root-"+Lt));const u=a();var x="actor";(null==(o=e.properties)?void 0:o.class)?x=e.properties.class:u.fill="#eaeaea",x+=n?` ${yt}`:` ${xt}`,u.x=e.x,u.y=l,u.width=e.width,u.height=e.height,u.class=x,u.rx=3,u.ry=3,u.name=e.name;const y=bt(g,u);if(e.rectData=u,null==(c=e.properties)?void 0:c.icon){const t=e.properties.icon.trim();"@"===t.charAt(0)?s(g,u.x+u.width-20,u.y+10,t.substr(1)):i(g,u.x+u.width-20,u.y+10,t)}qt(r,I(e.description))(e.description,g,u.x,u.y,u.width,u.height,{class:"actor actor-box"},r);let m=e.height;if(y.node){const t=y.node().getBBox();e.height=t.height,m=t.height}return m}),"drawActorTypeParticipant"),vt=o((function(t,e,r,s){const i=s?e.stopy:e.starty,n=e.x+e.width/2,o=i+80,c=t.append("g").lower();s||(Lt++,c.append("line").attr("id","actor"+Lt).attr("x1",n).attr("y1",o).attr("x2",n).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),e.actorCnt=Lt);const l=t.append("g");let d=mt;d+=s?` ${yt}`:` ${xt}`,l.attr("class",d),l.attr("name",e.name);const h=a();h.x=e.x,h.y=i,h.fill="#eaeaea",h.width=e.width,h.height=e.height,h.class="actor",h.rx=3,h.ry=3,l.append("line").attr("id","actor-man-torso"+Lt).attr("x1",n).attr("y1",i+25).attr("x2",n).attr("y2",i+45),l.append("line").attr("id","actor-man-arms"+Lt).attr("x1",n-18).attr("y1",i+33).attr("x2",n+18).attr("y2",i+33),l.append("line").attr("x1",n-18).attr("y1",i+60).attr("x2",n).attr("y2",i+45),l.append("line").attr("x1",n).attr("y1",i+45).attr("x2",n+18-2).attr("y2",i+60);const p=l.append("circle");p.attr("cx",e.x+e.width/2),p.attr("cy",i+10),p.attr("r",15),p.attr("width",e.width),p.attr("height",e.height);const g=l.node().getBBox();return e.height=g.height,qt(r,I(e.description))(e.description,l,h.x,h.y+35,h.width,h.height,{class:`actor ${mt}`},r),e.height}),"drawActorTypeActor"),At=o((async function(t,e,a,r){switch(e.type){case"actor":return await vt(t,e,a,r);case"participant":return await _t(t,e,a,r)}}),"drawActor"),Nt=o((function(t,e,a){const r=t.append("g");Dt(r,e),e.name&&qt(a)(e.name,r,e.x,e.y+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},a),r.lower()}),"drawBox"),kt=o((function(t){return t.append("g")}),"anchorElement"),Mt=o((function(t,e,r,s,i){const n=a(),o=e.anchored;n.x=e.startx,n.y=e.starty,n.class="activation"+i%3,n.width=e.stopx-e.startx,n.height=r-e.starty,bt(o,n)}),"drawActivation"),Ot=o((async function(t,a,r,s){const{boxMargin:i,boxTextMargin:n,labelBoxHeight:c,labelBoxWidth:l,messageFontFamily:d,messageFontSize:h,messageFontWeight:p}=s,g=t.append("g"),u=o((function(t,e,a,r){return g.append("line").attr("x1",t).attr("y1",e).attr("x2",a).attr("y2",r).attr("class","loopLine")}),"drawLoopLine");u(a.startx,a.starty,a.stopx,a.starty),u(a.stopx,a.starty,a.stopx,a.stopy),u(a.startx,a.stopy,a.stopx,a.stopy),u(a.startx,a.starty,a.startx,a.stopy),void 0!==a.sections&&a.sections.forEach((function(t){u(a.startx,t.y,a.stopx,t.y).style("stroke-dasharray","3, 3")}));let x=e();x.text=r,x.x=a.startx,x.y=a.starty,x.fontFamily=d,x.fontSize=h,x.fontWeight=p,x.anchor="middle",x.valign="middle",x.tspan=!1,x.width=l||50,x.height=c||20,x.textMargin=n,x.class="labelText",It(g,x),x=Ft(),x.text=a.title,x.x=a.startx+l/2+(a.stopx-a.startx)/2,x.y=a.starty+i+n,x.anchor="middle",x.valign="middle",x.textMargin=n,x.class="loopText",x.fontFamily=d,x.fontSize=h,x.fontWeight=p,x.wrap=!0;let y=I(x.text)?await Et(g,x,a):wt(g,x);if(void 0!==a.sectionTitles)for(const[e,o]of Object.entries(a.sectionTitles))if(o.message){x.text=o.message,x.x=a.startx+(a.stopx-a.startx)/2,x.y=a.sections[e].y+i+n,x.class="loopText",x.anchor="middle",x.valign="middle",x.tspan=!1,x.fontFamily=d,x.fontSize=h,x.fontWeight=p,x.wrap=a.wrap,I(x.text)?(a.starty=a.sections[e].y,await Et(g,x,a)):wt(g,x);let t=Math.round(y.map((t=>(t._groups||t)[0][0].getBBox().height)).reduce(((t,e)=>t+e)));a.sections[e].height+=t-(i+n)}return a.height=Math.round(a.stopy-a.starty),g}),"drawLoop"),Dt=o((function(e,a){t(e,a)}),"drawBackgroundRect"),St=o((function(t){t.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"),Rt=o((function(t){t.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"),Ct=o((function(t){t.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"),Bt=o((function(t){t.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"),$t=o((function(t){t.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"),Yt=o((function(t){t.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"),Vt=o((function(t){t.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"),Ft=o((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"),Wt=o((function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}}),"getNoteRect"),qt=function(){function t(t,e,a,r,i,n,o){s(e.append("text").attr("x",a+i/2).attr("y",r+n/2+5).style("text-anchor","middle").text(t),o)}function e(t,e,a,r,i,n,o,c){const{actorFontSize:l,actorFontFamily:d,actorFontWeight:h}=c,[p,g]=P(l),u=t.split(T.lineBreakRegex);for(let x=0;x<u.length;x++){const t=x*p-p*(u.length-1)/2,c=e.append("text").attr("x",a+i/2).attr("y",r).style("text-anchor","middle").style("font-size",g).style("font-weight",h).style("font-family",d);c.append("tspan").attr("x",a+i/2).attr("dy",t).text(u[x]),c.attr("y",r+n/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),s(c,o)}}function a(t,a,r,i,n,o,c,l){const d=a.append("switch"),h=d.append("foreignObject").attr("x",r).attr("y",i).attr("width",n).attr("height",o).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");h.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,d,r,i,n,o,c,l),s(h,c)}async function r(t,a,r,i,n,o,c,l){const d=await L(t,A()),h=a.append("switch"),p=h.append("foreignObject").attr("x",r+n/2-d.width/2).attr("y",i+o/2-d.height/2).attr("width",d.width).attr("height",d.height).append("xhtml:div").style("height","100%").style("width","100%");p.append("div").style("text-align","center").style("vertical-align","middle").html(await v(t,A())),e(t,h,r,i,n,o,c,l),s(p,c)}function s(t,e){for(const a in e)e.hasOwnProperty(a)&&t.attr(a,e[a])}return o(t,"byText"),o(e,"byTspan"),o(a,"byFo"),o(r,"byKatex"),o(s,"_setTextAttrs"),function(s,i=!1){return i?r:"fo"===s.textPlacement?a:"old"===s.textPlacement?t:e}}(),zt=function(){function t(t,e,a,s,i,n,o){r(e.append("text").attr("x",a).attr("y",s).style("text-anchor","start").text(t),o)}function e(t,e,a,s,i,n,o,c){const{actorFontSize:l,actorFontFamily:d,actorFontWeight:h}=c,p=t.split(T.lineBreakRegex);for(let g=0;g<p.length;g++){const t=g*l-l*(p.length-1)/2,i=e.append("text").attr("x",a).attr("y",s).style("text-anchor","start").style("font-size",l).style("font-weight",h).style("font-family",d);i.append("tspan").attr("x",a).attr("dy",t).text(p[g]),i.attr("y",s+n/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),r(i,o)}}function a(t,a,s,i,n,o,c,l){const d=a.append("switch"),h=d.append("foreignObject").attr("x",s).attr("y",i).attr("width",n).attr("height",o).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");h.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,d,s,i,0,o,c,l),r(h,c)}function r(t,e){for(const a in e)e.hasOwnProperty(a)&&t.attr(a,e[a])}return o(t,"byText"),o(e,"byTspan"),o(a,"byFo"),o(r,"_setTextAttrs"),function(r){return"fo"===r.textPlacement?a:"old"===r.textPlacement?t:e}}(),Ht={drawRect:bt,drawText:wt,drawLabel:It,drawActor:At,drawBox:Nt,drawPopup:Tt,anchorElement:kt,drawActivation:Mt,drawLoop:Ot,drawBackgroundRect:Dt,insertArrowHead:Bt,insertArrowFilledHead:$t,insertSequenceNumber:Yt,insertArrowCrossHead:Vt,insertDatabaseIcon:St,insertComputerIcon:Rt,insertClockIcon:Ct,getTextObj:Ft,getNoteRect:Wt,fixLifeLineHeights:Pt,sanitizeUrl:y.sanitizeUrl},jt={},Ut={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:o((function(){return Math.max.apply(null,0===this.actors.length?[0]:this.actors.map((t=>t.height||0)))+(0===this.loops.length?0:this.loops.map((t=>t.height||0)).reduce(((t,e)=>t+e)))+(0===this.messages.length?0:this.messages.map((t=>t.height||0)).reduce(((t,e)=>t+e)))+(0===this.notes.length?0:this.notes.map((t=>t.height||0)).reduce(((t,e)=>t+e)))}),"getHeight"),clear:o((function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]}),"clear"),addBox:o((function(t){this.boxes.push(t)}),"addBox"),addActor:o((function(t){this.actors.push(t)}),"addActor"),addLoop:o((function(t){this.loops.push(t)}),"addLoop"),addMessage:o((function(t){this.messages.push(t)}),"addMessage"),addNote:o((function(t){this.notes.push(t)}),"addNote"),lastActor:o((function(){return this.actors[this.actors.length-1]}),"lastActor"),lastLoop:o((function(){return this.loops[this.loops.length-1]}),"lastLoop"),lastMessage:o((function(){return this.messages[this.messages.length-1]}),"lastMessage"),lastNote:o((function(){return this.notes[this.notes.length-1]}),"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:o((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,re(u())}),"init"),updateVal:o((function(t,e,a,r){void 0===t[e]?t[e]=a:t[e]=r(a,t[e])}),"updateVal"),updateBounds:o((function(t,e,a,r){const s=this;let i=0;function n(n){return o((function(o){i++;const c=s.sequenceItems.length-i+1;s.updateVal(o,"starty",e-c*jt.boxMargin,Math.min),s.updateVal(o,"stopy",r+c*jt.boxMargin,Math.max),s.updateVal(Ut.data,"startx",t-c*jt.boxMargin,Math.min),s.updateVal(Ut.data,"stopx",a+c*jt.boxMargin,Math.max),"activation"!==n&&(s.updateVal(o,"startx",t-c*jt.boxMargin,Math.min),s.updateVal(o,"stopx",a+c*jt.boxMargin,Math.max),s.updateVal(Ut.data,"starty",e-c*jt.boxMargin,Math.min),s.updateVal(Ut.data,"stopy",r+c*jt.boxMargin,Math.max))}),"updateItemBounds")}o(n,"updateFn"),this.sequenceItems.forEach(n()),this.activations.forEach(n("activation"))}),"updateBounds"),insert:o((function(t,e,a,r){const s=T.getMin(t,a),i=T.getMax(t,a),n=T.getMin(e,r),o=T.getMax(e,r);this.updateVal(Ut.data,"startx",s,Math.min),this.updateVal(Ut.data,"starty",n,Math.min),this.updateVal(Ut.data,"stopx",i,Math.max),this.updateVal(Ut.data,"stopy",o,Math.max),this.updateBounds(s,n,i,o)}),"insert"),newActivation:o((function(t,e,a){const r=a.get(t.from),s=se(t.from).length||0,i=r.x+r.width/2+(s-1)*jt.activationWidth/2;this.activations.push({startx:i,starty:this.verticalPos+2,stopx:i+jt.activationWidth,stopy:void 0,actor:t.from,anchored:Ht.anchorElement(e)})}),"newActivation"),endActivation:o((function(t){const e=this.activations.map((function(t){return t.actor})).lastIndexOf(t.from);return this.activations.splice(e,1)[0]}),"endActivation"),createLoop:o((function(t={message:void 0,wrap:!1,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}}),"createLoop"),newLoop:o((function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))}),"newLoop"),endLoop:o((function(){return this.sequenceItems.pop()}),"endLoop"),isLoopOverlap:o((function(){return!!this.sequenceItems.length&&this.sequenceItems[this.sequenceItems.length-1].overlap}),"isLoopOverlap"),addSectionToLoop:o((function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:Ut.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)}),"addSectionToLoop"),saveVerticalPos:o((function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)}),"saveVerticalPos"),resetVerticalPos:o((function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)}),"resetVerticalPos"),bumpVerticalPos:o((function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=T.getMax(this.data.stopy,this.verticalPos)}),"bumpVerticalPos"),getVerticalPos:o((function(){return this.verticalPos}),"getVerticalPos"),getBounds:o((function(){return{bounds:this.data,models:this.models}}),"getBounds")},Kt=o((async function(t,r){Ut.bumpVerticalPos(jt.boxMargin),r.height=jt.boxMargin,r.starty=Ut.getVerticalPos();const s=a();s.x=r.startx,s.y=r.starty,s.width=r.width||jt.width,s.class="note";const i=t.append("g"),n=Ht.drawRect(i,s),o=e();o.x=r.startx,o.y=r.starty,o.width=s.width,o.dy="1em",o.text=r.message,o.class="noteText",o.fontFamily=jt.noteFontFamily,o.fontSize=jt.noteFontSize,o.fontWeight=jt.noteFontWeight,o.anchor=jt.noteAlign,o.textMargin=jt.noteMargin,o.valign="center";const c=I(o.text)?await Et(i,o):wt(i,o),l=Math.round(c.map((t=>(t._groups||t)[0][0].getBBox().height)).reduce(((t,e)=>t+e)));n.attr("height",l+2*jt.noteMargin),r.height+=l+2*jt.noteMargin,Ut.bumpVerticalPos(l+2*jt.noteMargin),r.stopy=r.starty+l+2*jt.noteMargin,r.stopx=r.startx+s.width,Ut.insert(r.startx,r.starty,r.stopx,r.stopy),Ut.models.addNote(r)}),"drawNote"),Xt=o((t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight})),"messageFont"),Gt=o((t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight})),"noteFont"),Jt=o((t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight})),"actorFont");async function Zt(t,e){Ut.bumpVerticalPos(10);const{startx:a,stopx:r,message:s}=e,i=T.splitBreaks(s).length,n=I(s),o=n?await L(s,u()):w.calculateTextDimensions(s,Xt(jt));if(!n){const t=o.height/i;e.height+=t,Ut.bumpVerticalPos(t)}let c,l=o.height-10;const d=o.width;if(a===r){c=Ut.getVerticalPos()+l,jt.rightAngles||(l+=jt.boxMargin,c=Ut.getVerticalPos()+l),l+=30;const t=T.getMax(d/2,jt.width/2);Ut.insert(a-t,Ut.getVerticalPos()-10+l,r+t,Ut.getVerticalPos()+30+l)}else l+=jt.boxMargin,c=Ut.getVerticalPos()+l,Ut.insert(a,c-10,r,c);return Ut.bumpVerticalPos(l),e.height+=l,e.stopy=e.starty+e.height,Ut.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),c}o(Zt,"boundMessage");var Qt=o((async function(t,a,r,s){const{startx:i,stopx:n,starty:o,message:c,type:l,sequenceIndex:d,sequenceVisible:h}=a,p=w.calculateTextDimensions(c,Xt(jt)),g=e();g.x=i,g.y=o+10,g.width=n-i,g.class="messageText",g.dy="1em",g.text=c,g.fontFamily=jt.messageFontFamily,g.fontSize=jt.messageFontSize,g.fontWeight=jt.messageFontWeight,g.anchor=jt.messageAlign,g.valign="center",g.textMargin=jt.wrapPadding,g.tspan=!1,I(g.text)?await Et(t,g,{startx:i,stopx:n,starty:r}):wt(t,g);const u=p.width;let x;i===n?x=jt.rightAngles?t.append("path").attr("d",`M ${i},${r} H ${i+T.getMax(jt.width/2,u/2)} V ${r+25} H ${i}`):t.append("path").attr("d","M "+i+","+r+" C "+(i+60)+","+(r-10)+" "+(i+60)+","+(r+30)+" "+i+","+(r+20)):(x=t.append("line"),x.attr("x1",i),x.attr("y1",r),x.attr("x2",n),x.attr("y2",r)),l===s.db.LINETYPE.DOTTED||l===s.db.LINETYPE.DOTTED_CROSS||l===s.db.LINETYPE.DOTTED_POINT||l===s.db.LINETYPE.DOTTED_OPEN||l===s.db.LINETYPE.BIDIRECTIONAL_DOTTED?(x.style("stroke-dasharray","3, 3"),x.attr("class","messageLine1")):x.attr("class","messageLine0");let y="";jt.arrowMarkerAbsolute&&(y=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,y=y.replace(/\(/g,"\\("),y=y.replace(/\)/g,"\\)")),x.attr("stroke-width",2),x.attr("stroke","none"),x.style("fill","none"),l!==s.db.LINETYPE.SOLID&&l!==s.db.LINETYPE.DOTTED||x.attr("marker-end","url("+y+"#arrowhead)"),l!==s.db.LINETYPE.BIDIRECTIONAL_SOLID&&l!==s.db.LINETYPE.BIDIRECTIONAL_DOTTED||(x.attr("marker-start","url("+y+"#arrowhead)"),x.attr("marker-end","url("+y+"#arrowhead)")),l!==s.db.LINETYPE.SOLID_POINT&&l!==s.db.LINETYPE.DOTTED_POINT||x.attr("marker-end","url("+y+"#filled-head)"),l!==s.db.LINETYPE.SOLID_CROSS&&l!==s.db.LINETYPE.DOTTED_CROSS||x.attr("marker-end","url("+y+"#crosshead)"),(h||jt.showSequenceNumbers)&&(x.attr("marker-start","url("+y+"#sequencenumber)"),t.append("text").attr("x",i).attr("y",r+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(d))}),"drawMessage"),te=o((function(t,e,a,r,s,i,n){let o,c=0,l=0,d=0;for(const h of r){const t=e.get(h),r=t.box;o&&o!=r&&(n||Ut.models.addBox(o),l+=jt.boxMargin+o.margin),r&&r!=o&&(n||(r.x=c+l,r.y=s),l+=r.margin),t.width=t.width||jt.width,t.height=T.getMax(t.height||jt.height,jt.height),t.margin=t.margin||jt.actorMargin,d=T.getMax(d,t.height),a.get(t.name)&&(l+=t.width/2),t.x=c+l,t.starty=Ut.getVerticalPos(),Ut.insert(t.x,s,t.x+t.width,t.height),c+=t.width+l,t.box&&(t.box.width=c+r.margin-t.box.x),l=t.margin,o=t.box,Ut.models.addActor(t)}o&&!n&&Ut.models.addBox(o),Ut.bumpVerticalPos(d)}),"addActorRenderingData"),ee=o((async function(t,e,a,r){if(r){let r=0;Ut.bumpVerticalPos(2*jt.boxMargin);for(const s of a){const a=e.get(s);a.stopy||(a.stopy=Ut.getVerticalPos());const i=await Ht.drawActor(t,a,jt,!0);r=T.getMax(r,i)}Ut.bumpVerticalPos(r+jt.boxMargin)}else for(const s of a){const a=e.get(s);await Ht.drawActor(t,a,jt,!1)}}),"drawActors"),ae=o((function(t,e,a,r){let s=0,i=0;for(const n of a){const a=e.get(n),o=de(a),c=Ht.drawPopup(t,a,o,jt,jt.forceMenus,r);c.height>s&&(s=c.height),c.width+a.x>i&&(i=c.width+a.x)}return{maxHeight:s,maxWidth:i}}),"drawActorsPopup"),re=o((function(t){b(jt,t),t.fontFamily&&(jt.actorFontFamily=jt.noteFontFamily=jt.messageFontFamily=t.fontFamily),t.fontSize&&(jt.actorFontSize=jt.noteFontSize=jt.messageFontSize=t.fontSize),t.fontWeight&&(jt.actorFontWeight=jt.noteFontWeight=jt.messageFontWeight=t.fontWeight)}),"setConf"),se=o((function(t){return Ut.activations.filter((function(e){return e.actor===t}))}),"actorActivations"),ie=o((function(t,e){const a=e.get(t),r=se(t);return[r.reduce((function(t,e){return T.getMin(t,e.startx)}),a.x+a.width/2-1),r.reduce((function(t,e){return T.getMax(t,e.stopx)}),a.x+a.width/2+1)]}),"activationBounds");function ne(t,e,a,r,s){Ut.bumpVerticalPos(a);let i=r;if(e.id&&e.message&&t[e.id]){const a=t[e.id].width,s=Xt(jt);e.message=w.wrapLabel(`[${e.message}]`,a-2*jt.wrapPadding,s),e.width=a,e.wrap=!0;const n=w.calculateTextDimensions(e.message,s),o=T.getMax(n.height,jt.labelBoxHeight);i=r+o,x.debug(`${o} - ${e.message}`)}s(e),Ut.bumpVerticalPos(i)}function oe(t,e,a,r,s,i,n){function c(a,r){a.x<s.get(t.from).x?(Ut.insert(e.stopx-r,e.starty,e.startx,e.stopy+a.height/2+jt.noteMargin),e.stopx=e.stopx+r):(Ut.insert(e.startx,e.starty,e.stopx+r,e.stopy+a.height/2+jt.noteMargin),e.stopx=e.stopx-r)}function l(a,r){a.x<s.get(t.to).x?(Ut.insert(e.startx-r,e.starty,e.stopx,e.stopy+a.height/2+jt.noteMargin),e.startx=e.startx+r):(Ut.insert(e.stopx,e.starty,e.startx+r,e.stopy+a.height/2+jt.noteMargin),e.startx=e.startx-r)}if(o(c,"receiverAdjustment"),o(l,"senderAdjustment"),i.get(t.to)==r){const e=s.get(t.to);c(e,"actor"==e.type?21:e.width/2+3),e.starty=a-e.height/2,Ut.bumpVerticalPos(e.height/2)}else if(n.get(t.from)==r){const e=s.get(t.from);if(jt.mirrorActors){l(e,"actor"==e.type?18:e.width/2)}e.stopy=a-e.height/2,Ut.bumpVerticalPos(e.height/2)}else if(n.get(t.to)==r){const e=s.get(t.to);if(jt.mirrorActors){c(e,"actor"==e.type?21:e.width/2+3)}e.stopy=a-e.height/2,Ut.bumpVerticalPos(e.height/2)}}o(ne,"adjustLoopHeightForWrap"),o(oe,"adjustCreatedDestroyedData");var ce=o((async function(t,e,a,r){const{securityLevel:s,sequence:i}=u();let n;jt=i,"sandbox"===s&&(n=N("#i"+e));const c=N("sandbox"===s?n.nodes()[0].contentDocument.body:"body"),l="sandbox"===s?n.nodes()[0].contentDocument:document;Ut.init(),x.debug(r.db);const d="sandbox"===s?c.select(`[id="${e}"]`):N(`[id="${e}"]`),h=r.db.getActors(),p=r.db.getCreatedActors(),g=r.db.getDestroyedActors(),y=r.db.getBoxes();let b=r.db.getActorKeys();const T=r.db.getMessages(),f=r.db.getDiagramTitle(),E=r.db.hasAtLeastOneBox(),w=r.db.hasAtLeastOneBoxWithTitle(),I=await le(h,T,r);if(jt.height=await he(h,I,y),Ht.insertComputerIcon(d),Ht.insertDatabaseIcon(d),Ht.insertClockIcon(d),E&&(Ut.bumpVerticalPos(jt.boxMargin),w&&Ut.bumpVerticalPos(y[0].textMaxHeight)),!0===jt.hideUnusedParticipants){const t=new Set;T.forEach((e=>{t.add(e.from),t.add(e.to)})),b=b.filter((e=>t.has(e)))}te(d,h,p,b,0,T,!1);const L=await ue(T,h,I,r);function P(t,e){const a=Ut.endActivation(t);a.starty+18>e&&(a.starty=e-6,e+=12),Ht.drawActivation(d,a,e,jt,se(t.from).length),Ut.insert(a.startx,e-10,a.stopx,e)}Ht.insertArrowHead(d),Ht.insertArrowCrossHead(d),Ht.insertArrowFilledHead(d),Ht.insertSequenceNumber(d),o(P,"activeEnd");let _=1,v=1;const A=[],k=[];let M=0;for(const o of T){let t,e,a;switch(o.type){case r.db.LINETYPE.NOTE:Ut.resetVerticalPos(),e=o.noteModel,await Kt(d,e);break;case r.db.LINETYPE.ACTIVE_START:Ut.newActivation(o,d,h);break;case r.db.LINETYPE.ACTIVE_END:P(o,Ut.getVerticalPos());break;case r.db.LINETYPE.LOOP_START:ne(L,o,jt.boxMargin,jt.boxMargin+jt.boxTextMargin,(t=>Ut.newLoop(t)));break;case r.db.LINETYPE.LOOP_END:t=Ut.endLoop(),await Ht.drawLoop(d,t,"loop",jt),Ut.bumpVerticalPos(t.stopy-Ut.getVerticalPos()),Ut.models.addLoop(t);break;case r.db.LINETYPE.RECT_START:ne(L,o,jt.boxMargin,jt.boxMargin,(t=>Ut.newLoop(void 0,t.message)));break;case r.db.LINETYPE.RECT_END:t=Ut.endLoop(),k.push(t),Ut.models.addLoop(t),Ut.bumpVerticalPos(t.stopy-Ut.getVerticalPos());break;case r.db.LINETYPE.OPT_START:ne(L,o,jt.boxMargin,jt.boxMargin+jt.boxTextMargin,(t=>Ut.newLoop(t)));break;case r.db.LINETYPE.OPT_END:t=Ut.endLoop(),await Ht.drawLoop(d,t,"opt",jt),Ut.bumpVerticalPos(t.stopy-Ut.getVerticalPos()),Ut.models.addLoop(t);break;case r.db.LINETYPE.ALT_START:ne(L,o,jt.boxMargin,jt.boxMargin+jt.boxTextMargin,(t=>Ut.newLoop(t)));break;case r.db.LINETYPE.ALT_ELSE:ne(L,o,jt.boxMargin+jt.boxTextMargin,jt.boxMargin,(t=>Ut.addSectionToLoop(t)));break;case r.db.LINETYPE.ALT_END:t=Ut.endLoop(),await Ht.drawLoop(d,t,"alt",jt),Ut.bumpVerticalPos(t.stopy-Ut.getVerticalPos()),Ut.models.addLoop(t);break;case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:ne(L,o,jt.boxMargin,jt.boxMargin+jt.boxTextMargin,(t=>Ut.newLoop(t))),Ut.saveVerticalPos();break;case r.db.LINETYPE.PAR_AND:ne(L,o,jt.boxMargin+jt.boxTextMargin,jt.boxMargin,(t=>Ut.addSectionToLoop(t)));break;case r.db.LINETYPE.PAR_END:t=Ut.endLoop(),await Ht.drawLoop(d,t,"par",jt),Ut.bumpVerticalPos(t.stopy-Ut.getVerticalPos()),Ut.models.addLoop(t);break;case r.db.LINETYPE.AUTONUMBER:_=o.message.start||_,v=o.message.step||v,o.message.visible?r.db.enableSequenceNumbers():r.db.disableSequenceNumbers();break;case r.db.LINETYPE.CRITICAL_START:ne(L,o,jt.boxMargin,jt.boxMargin+jt.boxTextMargin,(t=>Ut.newLoop(t)));break;case r.db.LINETYPE.CRITICAL_OPTION:ne(L,o,jt.boxMargin+jt.boxTextMargin,jt.boxMargin,(t=>Ut.addSectionToLoop(t)));break;case r.db.LINETYPE.CRITICAL_END:t=Ut.endLoop(),await Ht.drawLoop(d,t,"critical",jt),Ut.bumpVerticalPos(t.stopy-Ut.getVerticalPos()),Ut.models.addLoop(t);break;case r.db.LINETYPE.BREAK_START:ne(L,o,jt.boxMargin,jt.boxMargin+jt.boxTextMargin,(t=>Ut.newLoop(t)));break;case r.db.LINETYPE.BREAK_END:t=Ut.endLoop(),await Ht.drawLoop(d,t,"break",jt),Ut.bumpVerticalPos(t.stopy-Ut.getVerticalPos()),Ut.models.addLoop(t);break;default:try{a=o.msgModel,a.starty=Ut.getVerticalPos(),a.sequenceIndex=_,a.sequenceVisible=r.db.showSequenceNumbers();const t=await Zt(0,a);oe(o,a,t,M,h,p,g),A.push({messageModel:a,lineStartY:t}),Ut.models.addMessage(a)}catch(Y){x.error("error while drawing message",Y)}}[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.SOLID,r.db.LINETYPE.DOTTED,r.db.LINETYPE.SOLID_CROSS,r.db.LINETYPE.DOTTED_CROSS,r.db.LINETYPE.SOLID_POINT,r.db.LINETYPE.DOTTED_POINT,r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(o.type)&&(_+=v),M++}x.debug("createdActors",p),x.debug("destroyedActors",g),await ee(d,h,b,!1);for(const o of A)await Qt(d,o.messageModel,o.lineStartY,r);jt.mirrorActors&&await ee(d,h,b,!0),k.forEach((t=>Ht.drawBackgroundRect(d,t))),Pt(d,h,b,jt);for(const o of Ut.models.boxes)o.height=Ut.getVerticalPos()-o.y,Ut.insert(o.x,o.y,o.x+o.width,o.height),o.startx=o.x,o.starty=o.y,o.stopx=o.startx+o.width,o.stopy=o.starty+o.height,o.stroke="rgb(0,0,0, 0.5)",Ht.drawBox(d,o,jt);E&&Ut.bumpVerticalPos(jt.boxMargin);const O=ae(d,h,b,l),{bounds:D}=Ut.getBounds();void 0===D.startx&&(D.startx=0),void 0===D.starty&&(D.starty=0),void 0===D.stopx&&(D.stopx=0),void 0===D.stopy&&(D.stopy=0);let S=D.stopy-D.starty;S<O.maxHeight&&(S=O.maxHeight);let R=S+2*jt.diagramMarginY;jt.mirrorActors&&(R=R-jt.boxMargin+jt.bottomMarginAdj);let C=D.stopx-D.startx;C<O.maxWidth&&(C=O.maxWidth);const B=C+2*jt.diagramMarginX;f&&d.append("text").text(f).attr("x",(D.stopx-D.startx)/2-2*jt.diagramMarginX).attr("y",-25),m(d,R,B,jt.useMaxWidth);const $=f?40:0;d.attr("viewBox",D.startx-jt.diagramMarginX+" -"+(jt.diagramMarginY+$)+" "+B+" "+(R+$)),x.debug("models:",Ut.models)}),"draw");async function le(t,e,a){const r={};for(const s of e)if(t.get(s.to)&&t.get(s.from)){const e=t.get(s.to);if(s.placement===a.db.PLACEMENT.LEFTOF&&!e.prevActor)continue;if(s.placement===a.db.PLACEMENT.RIGHTOF&&!e.nextActor)continue;const i=void 0!==s.placement,n=!i,o=i?Gt(jt):Xt(jt),c=s.wrap?w.wrapLabel(s.message,jt.width-2*jt.wrapPadding,o):s.message,l=(I(c)?await L(s.message,u()):w.calculateTextDimensions(c,o)).width+2*jt.wrapPadding;n&&s.from===e.nextActor?r[s.to]=T.getMax(r[s.to]||0,l):n&&s.from===e.prevActor?r[s.from]=T.getMax(r[s.from]||0,l):n&&s.from===s.to?(r[s.from]=T.getMax(r[s.from]||0,l/2),r[s.to]=T.getMax(r[s.to]||0,l/2)):s.placement===a.db.PLACEMENT.RIGHTOF?r[s.from]=T.getMax(r[s.from]||0,l):s.placement===a.db.PLACEMENT.LEFTOF?r[e.prevActor]=T.getMax(r[e.prevActor]||0,l):s.placement===a.db.PLACEMENT.OVER&&(e.prevActor&&(r[e.prevActor]=T.getMax(r[e.prevActor]||0,l/2)),e.nextActor&&(r[s.from]=T.getMax(r[s.from]||0,l/2)))}return x.debug("maxMessageWidthPerActor:",r),r}o(le,"getMaxMessageWidthPerActor");var de=o((function(t){let e=0;const a=Jt(jt);for(const r in t.links){const t=w.calculateTextDimensions(r,a).width+2*jt.wrapPadding+2*jt.boxMargin;e<t&&(e=t)}return e}),"getRequiredPopupWidth");async function he(t,e,a){let r=0;for(const i of t.keys()){const e=t.get(i);e.wrap&&(e.description=w.wrapLabel(e.description,jt.width-2*jt.wrapPadding,Jt(jt)));const a=I(e.description)?await L(e.description,u()):w.calculateTextDimensions(e.description,Jt(jt));e.width=e.wrap?jt.width:T.getMax(jt.width,a.width+2*jt.wrapPadding),e.height=e.wrap?T.getMax(a.height,jt.height):jt.height,r=T.getMax(r,e.height)}for(const i in e){const a=t.get(i);if(!a)continue;const r=t.get(a.nextActor);if(!r){const t=e[i]+jt.actorMargin-a.width/2;a.margin=T.getMax(t,jt.actorMargin);continue}const s=e[i]+jt.actorMargin-a.width/2-r.width/2;a.margin=T.getMax(s,jt.actorMargin)}let s=0;return a.forEach((e=>{const a=Xt(jt);let r=e.actorKeys.reduce(((e,a)=>e+(t.get(a).width+(t.get(a).margin||0))),0);r-=2*jt.boxTextMargin,e.wrap&&(e.name=w.wrapLabel(e.name,r-2*jt.wrapPadding,a));const i=w.calculateTextDimensions(e.name,a);s=T.getMax(i.height,s);const n=T.getMax(r,i.width+2*jt.wrapPadding);if(e.margin=jt.boxTextMargin,r<n){const t=(n-r)/2;e.margin+=t}})),a.forEach((t=>t.textMaxHeight=s)),T.getMax(r,jt.height)}o(he,"calculateActorMargins");var pe=o((async function(t,e,a){const r=e.get(t.from),s=e.get(t.to),i=r.x,n=s.x,o=t.wrap&&t.message;let c=I(t.message)?await L(t.message,u()):w.calculateTextDimensions(o?w.wrapLabel(t.message,jt.width,Gt(jt)):t.message,Gt(jt));const l={width:o?jt.width:T.getMax(jt.width,c.width+2*jt.noteMargin),height:0,startx:r.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===a.db.PLACEMENT.RIGHTOF?(l.width=o?T.getMax(jt.width,c.width):T.getMax(r.width/2+s.width/2,c.width+2*jt.noteMargin),l.startx=i+(r.width+jt.actorMargin)/2):t.placement===a.db.PLACEMENT.LEFTOF?(l.width=o?T.getMax(jt.width,c.width+2*jt.noteMargin):T.getMax(r.width/2+s.width/2,c.width+2*jt.noteMargin),l.startx=i-l.width+(r.width-jt.actorMargin)/2):t.to===t.from?(c=w.calculateTextDimensions(o?w.wrapLabel(t.message,T.getMax(jt.width,r.width),Gt(jt)):t.message,Gt(jt)),l.width=o?T.getMax(jt.width,r.width):T.getMax(r.width,jt.width,c.width+2*jt.noteMargin),l.startx=i+(r.width-l.width)/2):(l.width=Math.abs(i+r.width/2-(n+s.width/2))+jt.actorMargin,l.startx=i<n?i+r.width/2-jt.actorMargin/2:n+s.width/2-jt.actorMargin/2),o&&(l.message=w.wrapLabel(t.message,l.width-2*jt.wrapPadding,Gt(jt))),x.debug(`NM:[${l.startx},${l.stopx},${l.starty},${l.stopy}:${l.width},${l.height}=${t.message}]`),l}),"buildNoteModel"),ge=o((function(t,e,a){if(![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(t.type))return{};const[r,s]=ie(t.from,e),[i,n]=ie(t.to,e),c=r<=i;let l=c?s:r,d=c?i:n;const h=Math.abs(i-n)>2,p=o((t=>c?-t:t),"adjustValue");t.from===t.to?d=l:(t.activate&&!h&&(d+=p(jt.activationWidth/2-1)),[a.db.LINETYPE.SOLID_OPEN,a.db.LINETYPE.DOTTED_OPEN].includes(t.type)||(d+=p(3)),[a.db.LINETYPE.BIDIRECTIONAL_SOLID,a.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type)&&(l-=p(3)));const g=[r,s,i,n],u=Math.abs(l-d);t.wrap&&t.message&&(t.message=w.wrapLabel(t.message,T.getMax(u+2*jt.wrapPadding,jt.width),Xt(jt)));const x=w.calculateTextDimensions(t.message,Xt(jt));return{width:T.getMax(t.wrap?0:x.width+2*jt.wrapPadding,u+2*jt.wrapPadding,jt.width),height:0,startx:l,stopx:d,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,g),toBounds:Math.max.apply(null,g)}}),"buildMessageModel"),ue=o((async function(t,e,a,r){const s={},i=[];let n,o,c;for(const l of t){switch(l.id=w.random({length:10}),l.type){case r.db.LINETYPE.LOOP_START:case r.db.LINETYPE.ALT_START:case r.db.LINETYPE.OPT_START:case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:case r.db.LINETYPE.CRITICAL_START:case r.db.LINETYPE.BREAK_START:i.push({id:l.id,msg:l.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case r.db.LINETYPE.ALT_ELSE:case r.db.LINETYPE.PAR_AND:case r.db.LINETYPE.CRITICAL_OPTION:l.message&&(n=i.pop(),s[n.id]=n,s[l.id]=n,i.push(n));break;case r.db.LINETYPE.LOOP_END:case r.db.LINETYPE.ALT_END:case r.db.LINETYPE.OPT_END:case r.db.LINETYPE.PAR_END:case r.db.LINETYPE.CRITICAL_END:case r.db.LINETYPE.BREAK_END:n=i.pop(),s[n.id]=n;break;case r.db.LINETYPE.ACTIVE_START:{const t=e.get(l.from?l.from:l.to.actor),a=se(l.from?l.from:l.to.actor).length,r=t.x+t.width/2+(a-1)*jt.activationWidth/2,s={startx:r,stopx:r+jt.activationWidth,actor:l.from,enabled:!0};Ut.activations.push(s)}break;case r.db.LINETYPE.ACTIVE_END:{const t=Ut.activations.map((t=>t.actor)).lastIndexOf(l.from);Ut.activations.splice(t,1).splice(0,1)}}void 0!==l.placement?(o=await pe(l,e,r),l.noteModel=o,i.forEach((t=>{n=t,n.from=T.getMin(n.from,o.startx),n.to=T.getMax(n.to,o.startx+o.width),n.width=T.getMax(n.width,Math.abs(n.from-n.to))-jt.labelBoxWidth}))):(c=ge(l,e,r),l.msgModel=c,c.startx&&c.stopx&&i.length>0&&i.forEach((t=>{if(n=t,c.startx===c.stopx){const t=e.get(l.from),a=e.get(l.to);n.from=T.getMin(t.x-c.width/2,t.x-t.width/2,n.from),n.to=T.getMax(a.x+c.width/2,a.x+t.width/2,n.to),n.width=T.getMax(n.width,Math.abs(n.to-n.from))-jt.labelBoxWidth}else n.from=T.getMin(c.startx,n.from),n.to=T.getMax(c.stopx,n.to),n.width=T.getMax(n.width,c.width)-jt.labelBoxWidth})))}return Ut.activations=[],x.debug("Loop type widths:",s),s}),"calculateLoopBounds"),xe={parser:M,db:gt,renderer:{bounds:Ut,drawActors:ee,drawActorsPopup:ae,setConf:re,draw:ce},styles:ut,init:o((({wrap:t})=>{gt.setWrap(t)}),"init")};export{xe as diagram};
@@ -1 +0,0 @@
1
- function t(t){n(t,"start");var i={},s=t.languageData||{},d=!1;for(var o in t)if(o!=s&&t.hasOwnProperty(o))for(var u=i[o]=[],p=t[o],l=0;l<p.length;l++){var g=p[l];u.push(new e(g,t)),(g.indent||g.dedent)&&(d=!0)}return{name:s.name,startState:function(){return{state:"start",pending:null,indent:d?[]:null}},copyState:function(t){var n={state:t.state,pending:t.pending,indent:t.indent&&t.indent.slice(0)};return t.stack&&(n.stack=t.stack.slice(0)),n},token:a(i),indent:r(i,s),languageData:s}}function n(t,n){if(!t.hasOwnProperty(n))throw new Error("Undefined state "+n+" in simple mode")}function e(t,e){(t.next||t.push)&&n(e,t.next||t.push),this.regex=function(t){if(!t)return/(?:)/;var n="";return t instanceof RegExp?(t.ignoreCase&&(n="i"),t=t.source):t=String(t),new RegExp("^(?:"+t+")",n)}(t.regex),this.token=function(t){if(!t)return null;if(t.apply)return t;if("string"==typeof t)return t.replace(/\./g," ");for(var n=[],e=0;e<t.length;e++)n.push(t[e]&&t[e].replace(/\./g," "));return n}(t.token),this.data=t}function a(t){return function(n,e){if(e.pending){var a=e.pending.shift();return 0==e.pending.length&&(e.pending=null),n.pos+=a.text.length,a.token}for(var r=t[e.state],i=0;i<r.length;i++){var s=r[i],d=(!s.data.sol||n.sol())&&n.match(s.regex);if(d){s.data.next?e.state=s.data.next:s.data.push?((e.stack||(e.stack=[])).push(e.state),e.state=s.data.push):s.data.pop&&e.stack&&e.stack.length&&(e.state=e.stack.pop()),s.data.indent&&e.indent.push(n.indentation()+n.indentUnit),s.data.dedent&&e.indent.pop();var o=s.token;if(o&&o.apply&&(o=o(d)),d.length>2&&s.token&&"string"!=typeof s.token){e.pending=[];for(var u=2;u<d.length;u++)d[u]&&e.pending.push({text:d[u],token:s.token[u-1]});return n.backUp(d[0].length-(d[1]?d[1].length:0)),o[0]}return o&&o.join?o[0]:o}}return n.next(),null}}function r(t,n){return function(e,a){if(null==e.indent||n.dontIndentStates&&n.doneIndentState.indexOf(e.state)>-1)return null;var r=e.indent.length-1,i=t[e.state];t:for(;;){for(var s=0;s<i.length;s++){var d=i[s];if(d.data.dedent&&!1!==d.data.dedentIfLineStart){var o=d.regex.exec(a);if(o&&o[0]){r--,(d.next||d.push)&&(i=t[d.next||d.push]),a=a.slice(o[0].length);continue t}}}break}return r<0?0:e.indent[r]}}export{t as s};