@agent-link/server 0.1.539 → 0.1.540
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.
- package/package.json +4 -3
- package/web/dist/assets/{abnfDiagram-VRR7QNED-CYWjSLFB.js → abnfDiagram-VRR7QNED-D1hyJ-hn.js} +1 -1
- package/web/dist/assets/{arc-C5QqMw0D.js → arc-BuJJgjYt.js} +1 -1
- package/web/dist/assets/{architectureDiagram-ZJ3FMSHR-CiJkLkRK.js → architectureDiagram-ZJ3FMSHR-A9THC2Cc.js} +1 -1
- package/web/dist/assets/{blockDiagram-677ZJIJ3--rNn03K2.js → blockDiagram-677ZJIJ3-De9_CtWv.js} +1 -1
- package/web/dist/assets/{c4Diagram-LMCZKHZV-DFv38F5W.js → c4Diagram-LMCZKHZV-DeZVA52a.js} +1 -1
- package/web/dist/assets/channel-D0HU8H5o.js +1 -0
- package/web/dist/assets/{chunk-2Q5K7J3B-LcxWxL9X.js → chunk-2Q5K7J3B-DlDecKcs.js} +1 -1
- package/web/dist/assets/{chunk-32BRIVSS-L5rSd5kx.js → chunk-32BRIVSS-BhpTBz4U.js} +1 -1
- package/web/dist/assets/{chunk-5VM5RSS4-CqNmatdI.js → chunk-5VM5RSS4-DE8R6mLs.js} +1 -1
- package/web/dist/assets/{chunk-EX3LRPZG-2Wshn2od.js → chunk-EX3LRPZG-t_9lUdF-.js} +1 -1
- package/web/dist/assets/{chunk-JWPE2WC7-OIu2tm43.js → chunk-JWPE2WC7-D8olqveE.js} +1 -1
- package/web/dist/assets/{chunk-MOJQB5TN-GF0HoMD5.js → chunk-MOJQB5TN-qQmIJLhN.js} +1 -1
- package/web/dist/assets/{chunk-RYQCIY6F-esL_U6-9.js → chunk-RYQCIY6F-o8VHYTB2.js} +1 -1
- package/web/dist/assets/{chunk-V7JOEXUC-WNOLiPpt.js → chunk-V7JOEXUC-DGpoi6XB.js} +1 -1
- package/web/dist/assets/{chunk-VR4S4FIN-B-fO7gd6.js → chunk-VR4S4FIN-BjtiAe03.js} +1 -1
- package/web/dist/assets/{chunk-XXDRQBXY-D6g9o0gx.js → chunk-XXDRQBXY-Bf9B2FsN.js} +1 -1
- package/web/dist/assets/classDiagram-OUVF2IWQ-DQaRrb-b.js +1 -0
- package/web/dist/assets/classDiagram-v2-EOCWNBFH-DQaRrb-b.js +1 -0
- package/web/dist/assets/{cose-bilkent-JH36ORCC-CiWR02dm.js → cose-bilkent-JH36ORCC-CUu8D0Zk.js} +1 -1
- package/web/dist/assets/{cssMode-CdZ6WkPb.js → cssMode-BBGTtP8x.js} +1 -1
- package/web/dist/assets/{cynefin-VYW2F7L2-Cm5C7NQw.js → cynefin-VYW2F7L2-DVyQShfu.js} +1 -1
- package/web/dist/assets/{cynefinDiagram-TSTJHNR4-D4HWvIqR.js → cynefinDiagram-TSTJHNR4-5-G2jXgr.js} +1 -1
- package/web/dist/assets/{dagre-VKFMJZFB-Dydcg1Dj.js → dagre-VKFMJZFB-BVIWNamr.js} +1 -1
- package/web/dist/assets/{diagram-FQU43EPY-T1Gos5W9.js → diagram-FQU43EPY-DB_8HU4p.js} +1 -1
- package/web/dist/assets/{diagram-G47NLZAW-BiERNHwh.js → diagram-G47NLZAW-BuC9KdPo.js} +1 -1
- package/web/dist/assets/{diagram-NH7WQ7WH-Bp4PAleB.js → diagram-NH7WQ7WH-DEjdAGik.js} +1 -1
- package/web/dist/assets/{diagram-OA4YK3LP-gaknvItq.js → diagram-OA4YK3LP-CpUMGDrP.js} +1 -1
- package/web/dist/assets/{diagram-WEI45ONY-DrPuSW85.js → diagram-WEI45ONY-CD-UVma6.js} +1 -1
- package/web/dist/assets/{ebnfDiagram-CCIWWBDH-CAcdMMe7.js → ebnfDiagram-CCIWWBDH-Crk2X-Xr.js} +1 -1
- package/web/dist/assets/{editor.main-DGCQQuiO.js → editor.main-DX1kz8I2.js} +3 -3
- package/web/dist/assets/{erDiagram-Q63AITRT-DzyOSwU9.js → erDiagram-Q63AITRT-POwYozga.js} +1 -1
- package/web/dist/assets/{flowDiagram-23GEKE2U-DOe-9kuu.js → flowDiagram-23GEKE2U-5jmZ5k5e.js} +1 -1
- package/web/dist/assets/{freemarker2-1qw2nqEO.js → freemarker2-mDrCFxI5.js} +1 -1
- package/web/dist/assets/{ganttDiagram-NO4QXBWP-B2rh6MaY.js → ganttDiagram-NO4QXBWP-B9Mdj-u5.js} +1 -1
- package/web/dist/assets/{gitGraphDiagram-IHSO6WYX-DvnGb_NE.js → gitGraphDiagram-IHSO6WYX-CNPSE7ls.js} +1 -1
- package/web/dist/assets/{handlebars-BtUv9TxE.js → handlebars--G4a_6Oo.js} +1 -1
- package/web/dist/assets/{html-wKYvqrG5.js → html-tA32frga.js} +1 -1
- package/web/dist/assets/{htmlMode-BSafVEUS.js → htmlMode-CggNnIWF.js} +1 -1
- package/web/dist/assets/{index-DknoSkal.js → index-AdB8XHXv.js} +6 -6
- package/web/dist/assets/index-D5K63qug.css +32 -0
- package/web/dist/assets/{infoDiagram-FWYZ7A6U-DZimoK7P.js → infoDiagram-FWYZ7A6U-CyB7Vvcb.js} +1 -1
- package/web/dist/assets/{ishikawaDiagram-FXEZZL3T-DsvDmKxP.js → ishikawaDiagram-FXEZZL3T-DLMZ7H1X.js} +1 -1
- package/web/dist/assets/{javascript-h1g-Ucy8.js → javascript-DMkX6-SC.js} +1 -1
- package/web/dist/assets/{journeyDiagram-5HDEW3XC-CY8i7id_.js → journeyDiagram-5HDEW3XC-_nk1wTqH.js} +1 -1
- package/web/dist/assets/{jsonMode-DiNVkY3E.js → jsonMode-BatVhCGs.js} +1 -1
- package/web/dist/assets/{kanban-definition-HUTT4EX6-qsS7eTpB.js → kanban-definition-HUTT4EX6-Cz1JY0qx.js} +1 -1
- package/web/dist/assets/{linear-pxgzmzBW.js → linear-DkQS0EVl.js} +1 -1
- package/web/dist/assets/{liquid-BScuE6Li.js → liquid-JdcJe3Mn.js} +1 -1
- package/web/dist/assets/{lspLanguageFeatures-Bvg2J_jV.js → lspLanguageFeatures-BDC0ynk1.js} +1 -1
- package/web/dist/assets/{mdx-DEgin56d.js → mdx-C0s6E9Ya.js} +1 -1
- package/web/dist/assets/{mermaid.core-DkcKZax1.js → mermaid.core-DQSlETG7.js} +2 -2
- package/web/dist/assets/{mindmap-definition-LN4V7U3C-CdSHmqbA.js → mindmap-definition-LN4V7U3C-oNTOwQOU.js} +1 -1
- package/web/dist/assets/{pegDiagram-2B236MQR-B5lYNF_c.js → pegDiagram-2B236MQR-8BmSEVOy.js} +1 -1
- package/web/dist/assets/{pieDiagram-ENE6RG2P-C5XC449d.js → pieDiagram-ENE6RG2P-DRIltoVc.js} +1 -1
- package/web/dist/assets/{python-LiSQlk9W.js → python-DQKjtSgN.js} +1 -1
- package/web/dist/assets/{quadrantDiagram-ABIIQ3AL-B_lVz6fv.js → quadrantDiagram-ABIIQ3AL-BJfMAp1Q.js} +1 -1
- package/web/dist/assets/{railroadDiagram-RFXS5EU6-Cqyazggh.js → railroadDiagram-RFXS5EU6-Dj9-wyZY.js} +1 -1
- package/web/dist/assets/{razor-C-OT9rh_.js → razor-CL-fmDzS.js} +1 -1
- package/web/dist/assets/{requirementDiagram-TGXJPOKE-D1fFw8Za.js → requirementDiagram-TGXJPOKE-fPYOczdV.js} +1 -1
- package/web/dist/assets/{sankeyDiagram-HTMAVEWB-BmEnh6Zy.js → sankeyDiagram-HTMAVEWB-DyjpctG7.js} +1 -1
- package/web/dist/assets/{sequenceDiagram-DBY2YBRQ-D6IE-IG5.js → sequenceDiagram-DBY2YBRQ-RaZs5E3b.js} +1 -1
- package/web/dist/assets/{sizeCapture-X5ZJPWSS-BYkPr4jo.js → sizeCapture-X5ZJPWSS-BfOA5cbO.js} +1 -1
- package/web/dist/assets/{stateDiagram-2N3HPSRC-BUCTdtKV.js → stateDiagram-2N3HPSRC-CdxgHSfH.js} +1 -1
- package/web/dist/assets/stateDiagram-v2-6OUMAXLB-vTVKrqt9.js +1 -0
- package/web/dist/assets/{swimlanes-5IMT3BWC-DcMZ-6_P.js → swimlanes-5IMT3BWC-B19jLFc4.js} +2 -2
- package/web/dist/assets/swimlanesDiagram-G3AALYLV-CbIyNKp1.js +1 -0
- package/web/dist/assets/{timeline-definition-FHXFAJF6-CevcptDf.js → timeline-definition-FHXFAJF6-CYSSTJjP.js} +1 -1
- package/web/dist/assets/{tsMode-CQ3194z3.js → tsMode-I7W52vRp.js} +1 -1
- package/web/dist/assets/{typescript-D0PYBX18.js → typescript-BkUlxSfm.js} +1 -1
- package/web/dist/assets/{vennDiagram-L72KCM5P-C4E35ru2.js → vennDiagram-L72KCM5P-CJ5m4qeA.js} +1 -1
- package/web/dist/assets/{wardleyDiagram-EHGQE667-jZDfwkzC.js → wardleyDiagram-EHGQE667-CpaSYOZD.js} +1 -1
- package/web/dist/assets/{xml-BbyTLoF3.js → xml-B6uP1aJC.js} +1 -1
- package/web/dist/assets/{xychartDiagram-FW5EYKEG-CLEMD07_.js → xychartDiagram-FW5EYKEG-EqZ9r0f-.js} +1 -1
- package/web/dist/assets/{yaml-BQcG0ScU.js → yaml-BzfObSCH.js} +1 -1
- package/web/dist/index.html +2 -2
- package/web/dist/assets/channel-BUPHzg7D.js +0 -1
- package/web/dist/assets/classDiagram-OUVF2IWQ-CEHpjaOw.js +0 -1
- package/web/dist/assets/classDiagram-v2-EOCWNBFH-CEHpjaOw.js +0 -1
- package/web/dist/assets/index-DXanOGbR.css +0 -32
- package/web/dist/assets/stateDiagram-v2-6OUMAXLB-DvxjB9W-.js +0 -1
- package/web/dist/assets/swimlanesDiagram-G3AALYLV-u9Y7eEve.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var t;import{I as e}from"./chunk-2Q5K7J3B-LcxWxL9X.js";import{_ as a,X as r,c as s,d as i,l as n,j as o,e as c,f as d,k as l,b as h,s as p,o as T,a as E,g,p as u,Y as O,Z as _,q as y,i as x,y as b,$ as m,a0 as I,a1 as f,a2 as R,z as L,a3 as N,a4 as w}from"./mermaid.core-DkcKZax1.js";import{a as S,b as P,g as D,d as A,c as k,e as M}from"./chunk-32BRIVSS-L5rSd5kx.js";import"./index-DknoSkal.js";var C=function(){var t=a(function(t,e,a,r){for(a=a||{},r=t.length;r--;a[t[r]]=e);return a},"o"),e=[1,2],r=[1,3],s=[1,4],i=[2,4],n=[1,9],o=[1,11],c=[1,12],d=[1,14],l=[1,15],h=[1,17],p=[1,18],T=[1,19],E=[1,25],g=[1,26],u=[1,27],O=[1,28],_=[1,29],y=[1,30],x=[1,31],b=[1,32],m=[1,33],I=[1,34],f=[1,35],R=[1,36],L=[1,37],N=[1,38],w=[1,39],S=[1,40],P=[1,42],D=[1,43],A=[1,44],k=[1,45],M=[1,46],C=[1,47],v=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],B=[1,74],Y=[1,80],$=[1,81],V=[1,82],W=[1,83],F=[1,84],K=[1,85],q=[1,86],H=[1,87],z=[1,88],U=[1,89],j=[1,90],G=[1,91],X=[1,92],J=[1,93],Z=[1,94],Q=[1,95],tt=[1,96],et=[1,97],at=[1,98],rt=[1,99],st=[1,100],it=[1,101],nt=[1,102],ot=[1,103],ct=[1,104],dt=[1,105],lt=[2,78],ht=[4,5,17,51,53,54],pt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],Tt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],Et=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],gt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],ut=[5,52],Ot=[70,71,72,73],_t=[1,151],yt={trace:a(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:a(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 10:case 8:case 9:case 14:this.$=[];break;case 5:case 11:i[o-1].push(i[o]),this.$=i[o-1];break;case 6:case 7:case 12:case 13:case 67:this.$=i[o];break;case 16:i[o].type="createParticipant",this.$=i[o];break;case 17: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 19:this.$={type:"sequenceIndex",sequenceIndex:Number(i[o-2]),sequenceIndexStep:Number(i[o-1]),sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(i[o-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:r.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:r.LINETYPE.ACTIVE_START,actor:i[o-1].actor};break;case 24:this.$={type:"activeEnd",signalType:r.LINETYPE.ACTIVE_END,actor:i[o-1].actor};break;case 30:r.setDiagramTitle(i[o].substring(6)),this.$=i[o].substring(6);break;case 31:r.setDiagramTitle(i[o].substring(7)),this.$=i[o].substring(7);break;case 32:this.$=i[o].trim(),r.setAccTitle(this.$);break;case 33:case 34:this.$=i[o].trim(),r.setAccDescription(this.$);break;case 35: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 36: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 37: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 38: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 39: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 40: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 41: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 42: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 44:this.$=i[o-3].concat([{type:"option",optionText:r.parseMessage(i[o-1]),signalType:r.LINETYPE.CRITICAL_OPTION},i[o]]);break;case 46:this.$=i[o-3].concat([{type:"and",parText:r.parseMessage(i[o-1]),signalType:r.LINETYPE.PAR_AND},i[o]]);break;case 48:this.$=i[o-3].concat([{type:"else",altText:r.parseMessage(i[o-1]),signalType:r.LINETYPE.ALT_ELSE},i[o]]);break;case 49:case 54: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 50:case 55:i[o-1].draw="participant",i[o-1].type="addParticipant",this.$=i[o-1];break;case 51:case 56: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 52:case 57:i[o-1].draw="actor",i[o-1].type="addParticipant",this.$=i[o-1];break;case 53:i[o-1].type="destroyParticipant",this.$=i[o-1];break;case 58:this.$=[i[o-1],{type:"addNote",placement:i[o-2],actor:i[o-1].actor,text:i[o]}];break;case 59: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 60:this.$=[i[o-1],{type:"addLinks",actor:i[o-1].actor,text:i[o]}];break;case 61:this.$=[i[o-1],{type:"addALink",actor:i[o-1].actor,text:i[o]}];break;case 62:this.$=[i[o-1],{type:"addProperties",actor:i[o-1].actor,text:i[o]}];break;case 63:this.$=[i[o-1],{type:"addDetails",actor:i[o-1].actor,text:i[o]}];break;case 66:this.$=[i[o-2],i[o]];break;case 68:this.$=r.PLACEMENT.LEFTOF;break;case 69:this.$=r.PLACEMENT.RIGHTOF;break;case 70: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 71: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 72: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,centralConnection:r.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:i[o-1].actor}];break;case 73:this.$=[i[o-4],i[o-1],{type:"addMessage",from:i[o-4].actor,to:i[o-1].actor,signalType:i[o-2],msg:i[o],activate:!1,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:i[o-4].actor}];break;case 74:this.$=[i[o-5],i[o-1],{type:"addMessage",from:i[o-5].actor,to:i[o-1].actor,signalType:i[o-3],msg:i[o],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:i[o-1].actor},{type:"centralConnectionReverse",signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:i[o-5].actor}];break;case 75: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 76:this.$={type:"addParticipant",actor:i[o-1],config:i[o]};break;case 77:this.$=i[o-1].trim();break;case 78:this.$={type:"addParticipant",actor:i[o]};break;case 79:this.$=r.LINETYPE.SOLID_OPEN;break;case 80:this.$=r.LINETYPE.DOTTED_OPEN;break;case 81:this.$=r.LINETYPE.SOLID;break;case 82:this.$=r.LINETYPE.SOLID_TOP;break;case 83:this.$=r.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=r.LINETYPE.STICK_TOP;break;case 85:this.$=r.LINETYPE.STICK_BOTTOM;break;case 86:this.$=r.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=r.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=r.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=r.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=r.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=r.LINETYPE.DOTTED;break;case 100:this.$=r.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=r.LINETYPE.SOLID_CROSS;break;case 102:this.$=r.LINETYPE.DOTTED_CROSS;break;case 103:this.$=r.LINETYPE.SOLID_POINT;break;case 104:this.$=r.LINETYPE.DOTTED_POINT;break;case 105:this.$=r.parseMessage(i[o].trim().substring(1))}},"anonymous"),table:[{3:1,4:e,5:r,6:s},{1:[3]},{3:5,4:e,5:r,6:s},{3:6,4:e,5:r,6:s},t([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:n,5:o,8:8,9:10,10:c,13:13,14:d,15:l,18:16,19:h,22:p,23:41,24:T,25:20,26:21,27:22,28:23,29:24,30:E,31:g,32:u,34:O,36:_,37:y,38:x,39:b,40:m,42:I,44:f,45:R,47:L,51:N,53:w,54:S,56:P,61:D,62:A,63:k,64:M,73:C},t(v,[2,5]),{9:48,13:13,14:d,15:l,18:16,19:h,22:p,23:41,24:T,25:20,26:21,27:22,28:23,29:24,30:E,31:g,32:u,34:O,36:_,37:y,38:x,39:b,40:m,42:I,44:f,45:R,47:L,51:N,53:w,54:S,56:P,61:D,62:A,63:k,64:M,73:C},t(v,[2,7]),t(v,[2,8]),t(v,[2,9]),t(v,[2,15]),{13:49,51:N,53:w,54:S},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:C},{23:56,73:C},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},t(v,[2,30]),t(v,[2,31]),{33:[1,62]},{35:[1,63]},t(v,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:B},{23:75,55:76,73:B},{23:77,73:C},{69:78,72:[1,79],78:Y,79:$,80:V,81:W,82:F,83:K,84:q,85:H,86:z,87:U,88:j,89:G,90:X,91:J,92:Z,93:Q,94:tt,95:et,96:at,97:rt,98:st,99:it,100:nt,101:ot,102:ct,103:dt},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:C},{23:111,73:C},{23:112,73:C},{23:113,73:C},t([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],lt),t(v,[2,6]),t(v,[2,16]),t(ht,[2,10],{11:114}),t(v,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},t(v,[2,22]),{5:[1,118]},{5:[1,119]},t(v,[2,25]),t(v,[2,26]),t(v,[2,27]),t(v,[2,28]),t(v,[2,29]),t(v,[2,32]),t(v,[2,33]),t(pt,i,{7:120}),t(pt,i,{7:121}),t(pt,i,{7:122}),t(Tt,i,{41:123,7:124}),t(Et,i,{43:125,7:126}),t(Et,i,{7:126,43:127}),t(gt,i,{46:128,7:129}),t(pt,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},t(ut,lt,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:C},{69:146,78:Y,79:$,80:V,81:W,82:F,83:K,84:q,85:H,86:z,87:U,88:j,89:G,90:X,91:J,92:Z,93:Q,94:tt,95:et,96:at,97:rt,98:st,99:it,100:nt,101:ot,102:ct,103:dt},t(Ot,[2,79]),t(Ot,[2,80]),t(Ot,[2,81]),t(Ot,[2,82]),t(Ot,[2,83]),t(Ot,[2,84]),t(Ot,[2,85]),t(Ot,[2,86]),t(Ot,[2,87]),t(Ot,[2,88]),t(Ot,[2,89]),t(Ot,[2,90]),t(Ot,[2,91]),t(Ot,[2,92]),t(Ot,[2,93]),t(Ot,[2,94]),t(Ot,[2,95]),t(Ot,[2,96]),t(Ot,[2,97]),t(Ot,[2,98]),t(Ot,[2,99]),t(Ot,[2,100]),t(Ot,[2,101]),t(Ot,[2,102]),t(Ot,[2,103]),t(Ot,[2,104]),{23:147,73:C},{23:149,60:148,73:C},{73:[2,68]},{73:[2,69]},{58:150,104:_t},{58:152,104:_t},{58:153,104:_t},{58:154,104:_t},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:N,53:w,54:S},{5:[1,160]},t(v,[2,20]),t(v,[2,21]),t(v,[2,23]),t(v,[2,24]),{4:n,5:o,8:8,9:10,10:c,13:13,14:d,15:l,17:[1,161],18:16,19:h,22:p,23:41,24:T,25:20,26:21,27:22,28:23,29:24,30:E,31:g,32:u,34:O,36:_,37:y,38:x,39:b,40:m,42:I,44:f,45:R,47:L,51:N,53:w,54:S,56:P,61:D,62:A,63:k,64:M,73:C},{4:n,5:o,8:8,9:10,10:c,13:13,14:d,15:l,17:[1,162],18:16,19:h,22:p,23:41,24:T,25:20,26:21,27:22,28:23,29:24,30:E,31:g,32:u,34:O,36:_,37:y,38:x,39:b,40:m,42:I,44:f,45:R,47:L,51:N,53:w,54:S,56:P,61:D,62:A,63:k,64:M,73:C},{4:n,5:o,8:8,9:10,10:c,13:13,14:d,15:l,17:[1,163],18:16,19:h,22:p,23:41,24:T,25:20,26:21,27:22,28:23,29:24,30:E,31:g,32:u,34:O,36:_,37:y,38:x,39:b,40:m,42:I,44:f,45:R,47:L,51:N,53:w,54:S,56:P,61:D,62:A,63:k,64:M,73:C},{17:[1,164]},{4:n,5:o,8:8,9:10,10:c,13:13,14:d,15:l,17:[2,47],18:16,19:h,22:p,23:41,24:T,25:20,26:21,27:22,28:23,29:24,30:E,31:g,32:u,34:O,36:_,37:y,38:x,39:b,40:m,42:I,44:f,45:R,47:L,50:[1,165],51:N,53:w,54:S,56:P,61:D,62:A,63:k,64:M,73:C},{17:[1,166]},{4:n,5:o,8:8,9:10,10:c,13:13,14:d,15:l,17:[2,45],18:16,19:h,22:p,23:41,24:T,25:20,26:21,27:22,28:23,29:24,30:E,31:g,32:u,34:O,36:_,37:y,38:x,39:b,40:m,42:I,44:f,45:R,47:L,49:[1,167],51:N,53:w,54:S,56:P,61:D,62:A,63:k,64:M,73:C},{17:[1,168]},{17:[1,169]},{4:n,5:o,8:8,9:10,10:c,13:13,14:d,15:l,17:[2,43],18:16,19:h,22:p,23:41,24:T,25:20,26:21,27:22,28:23,29:24,30:E,31:g,32:u,34:O,36:_,37:y,38:x,39:b,40:m,42:I,44:f,45:R,47:L,48:[1,170],51:N,53:w,54:S,56:P,61:D,62:A,63:k,64:M,73:C},{4:n,5:o,8:8,9:10,10:c,13:13,14:d,15:l,17:[1,171],18:16,19:h,22:p,23:41,24:T,25:20,26:21,27:22,28:23,29:24,30:E,31:g,32:u,34:O,36:_,37:y,38:x,39:b,40:m,42:I,44:f,45:R,47:L,51:N,53:w,54:S,56:P,61:D,62:A,63:k,64:M,73:C},{16:[1,172]},t(v,[2,50]),{16:[1,173]},t(v,[2,55]),t(ut,[2,76]),{76:[1,174]},{16:[1,175]},t(v,[2,52]),{16:[1,176]},t(v,[2,57]),t(v,[2,53]),{23:177,73:C},{23:178,73:C},{23:179,73:C},{58:180,104:_t},{23:181,72:[1,182],73:C},{58:183,104:_t},{58:184,104:_t},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},t(v,[2,17]),t(ht,[2,11]),{13:186,51:N,53:w,54:S},t(ht,[2,13]),t(ht,[2,14]),t(v,[2,19]),t(v,[2,35]),t(v,[2,36]),t(v,[2,37]),t(v,[2,38]),{16:[1,187]},t(v,[2,39]),{16:[1,188]},t(v,[2,40]),t(v,[2,41]),{16:[1,189]},t(v,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:_t},{58:196,104:_t},{58:197,104:_t},{5:[2,75]},{58:198,104:_t},{23:199,73:C},{5:[2,58]},{5:[2,59]},{23:200,73:C},t(ht,[2,12]),t(Tt,i,{7:124,41:201}),t(Et,i,{7:126,43:202}),t(gt,i,{7:129,46:203}),t(v,[2,49]),t(v,[2,54]),t(ut,[2,77]),t(v,[2,51]),t(v,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:_t},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:a(function(t,e){if(!e.recoverable){var a=new Error(t);throw a.hash=e,a}this.trace(t)},"parseError"),parse:a(function(t){var e=this,r=[0],s=[],i=[null],n=[],o=this.table,c="",d=0,l=0,h=n.slice.call(arguments,1),p=Object.create(this.lexer),T={yy:{}};for(var E in this.yy)Object.prototype.hasOwnProperty.call(this.yy,E)&&(T.yy[E]=this.yy[E]);p.setInput(t,T.yy),T.yy.lexer=p,T.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var g=p.yylloc;n.push(g);var u=p.options&&p.options.ranges;function O(){var t;return"number"!=typeof(t=s.pop()||p.lex()||1)&&(t instanceof Array&&(t=(s=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof T.yy.parseError?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,a(function(t){r.length=r.length-2*t,i.length=i.length-t,n.length=n.length-t},"popStack"),a(O,"lex");for(var _,y,x,b,m,I,f,R,L={};;){if(y=r[r.length-1],this.defaultActions[y]?x=this.defaultActions[y]:(null==_&&(_=O()),x=o[y]&&o[y][_]),void 0===x||!x.length||!x[0]){var N="";for(m in R=[],o[y])this.terminals_[m]&&m>2&&R.push("'"+this.terminals_[m]+"'");N=p.showPosition?"Parse error on line "+(d+1)+":\n"+p.showPosition()+"\nExpecting "+R.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(d+1)+": Unexpected "+(1==_?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(N,{text:p.match,token:this.terminals_[_]||_,line:p.yylineno,loc:g,expected:R})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+y+", token: "+_);switch(x[0]){case 1:r.push(_),i.push(p.yytext),n.push(p.yylloc),r.push(x[1]),_=null,l=p.yyleng,c=p.yytext,d=p.yylineno,g=p.yylloc;break;case 2:if(I=this.productions_[x[1]][1],L.$=i[i.length-I],L._$={first_line:n[n.length-(I||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(I||1)].first_column,last_column:n[n.length-1].last_column},u&&(L._$.range=[n[n.length-(I||1)].range[0],n[n.length-1].range[1]]),void 0!==(b=this.performAction.apply(L,[c,l,d,T.yy,x[1],i,n].concat(h))))return b;I&&(r=r.slice(0,-1*I*2),i=i.slice(0,-1*I),n=n.slice(0,-1*I)),r.push(this.productions_[x[1]][0]),i.push(L.$),n.push(L._$),f=o[r[r.length-2]][r[r.length-1]],r.push(f);break;case 3:return!0}}return!0},"parse")},xt=function(){return{EOF:1,parseError:a(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:a(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:a(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:a(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:a(function(){return this._more=!0,this},"more"),reject:a(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:a(function(t){this.unput(this.match.slice(t))},"less"),pastInput:a(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:a(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:a(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:a(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:a(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:a(function(){var t=this.next();return t||this.lex()},"lex"),begin:a(function(t){this.conditionStack.push(t)},"begin"),popState:a(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:a(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:a(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:a(function(t){this.begin(t)},"pushState"),stateStackSize:a(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:a(function(t,e,a,r){switch(a){case 0:case 59:case 92:return 5;case 1:case 2:case 3:case 4:case 5:break;case 6:return 20;case 7:return this.begin("CONFIG"),75;case 8:return 76;case 9:return this.popState(),this.begin("ALIAS"),77;case 10:return this.popState(),this.popState(),77;case 11:case 60:return e.yytext=e.yytext.trim(),73;case 12:return e.yytext=e.yytext.trim(),this.begin("ALIAS"),73;case 13:return e.yytext=e.yytext.trim(),this.popState(),73;case 14:return this.popState(),10;case 15:return e.yytext=e.yytext.trim(),this.popState(),10;case 16:return this.begin("LINE"),15;case 17:return this.begin("ID"),51;case 18:return this.begin("ID"),53;case 19:return 14;case 20:return this.begin("ID"),54;case 21:return this.popState(),this.popState(),this.begin("LINE"),52;case 22:return this.popState(),this.popState(),5;case 23:return this.begin("LINE"),37;case 24:return this.begin("LINE"),38;case 25:return this.begin("LINE"),39;case 26:return this.begin("LINE"),40;case 27:return this.begin("LINE"),50;case 28:return this.begin("LINE"),42;case 29:return this.begin("LINE"),44;case 30:return this.begin("LINE"),49;case 31:return this.begin("LINE"),45;case 32:return this.begin("LINE"),48;case 33:return this.begin("LINE"),47;case 34:return this.popState(),16;case 35:return 17;case 36:return 67;case 37:return 68;case 38:return 61;case 39:return 62;case 40:return 63;case 41:return 64;case 42:return 59;case 43:return 56;case 44:return this.begin("ID"),22;case 45:return this.begin("ID"),24;case 46:return 30;case 47:return 31;case 48:return this.begin("acc_title"),32;case 49:return this.popState(),"acc_title_value";case 50:return this.begin("acc_descr"),34;case 51:return this.popState(),"acc_descr_value";case 52:this.begin("acc_descr_multiline");break;case 53:this.popState();break;case 54:return"acc_descr_multiline_value";case 55:return 6;case 56:return 19;case 57:return 21;case 58:return 66;case 61:return 80;case 62:return 97;case 63:return 98;case 64:return 99;case 65:return 78;case 66:return 79;case 67:return 100;case 68:return 101;case 69:return 102;case 70:return 103;case 71:return 85;case 72:return 86;case 73:return 87;case 74:return 88;case 75:return 93;case 76:return 94;case 77:return 95;case 78:return 96;case 79:return 81;case 80:return 82;case 81:return 83;case 82:return 84;case 83:return 89;case 84:return 90;case 85:return 91;case 86:return 92;case 87:case 88:return 104;case 89:return 70;case 90:return 71;case 91:return 72;case 93:return 10}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:([0-9]+(\.[0-9]{1,2})?|\.[0-9]{1,2})(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\}(?=\s+as\s))/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i,/^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i,/^(?:[^<>:\n,;@]*<[^\n]*)/i,/^(?:[^\n]+)/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\/\\\+\()\+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)|-\|\\|-\\|-\/|-\/\/|-\|\/|\/\|-|\\\|-|\/\/-|\\\\-|\/\|-|--\|\\|--|\(\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?:--\|\\)/i,/^(?:--\|\/)/i,/^(?:--\\\\)/i,/^(?:--\/\/)/i,/^(?:\/\|--)/i,/^(?:\\\|--)/i,/^(?:\/\/--)/i,/^(?:\\\\--)/i,/^(?:-\|\\)/i,/^(?:-\|\/)/i,/^(?:-\\\\)/i,/^(?:-\/\/)/i,/^(?:\/\|-)/i,/^(?:\\\|-)/i,/^(?:\/\/-)/i,/^(?:\\\\-)/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:\(\))/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[53,54],inclusive:!1},acc_descr:{rules:[51],inclusive:!1},acc_title:{rules:[49],inclusive:!1},ID:{rules:[2,3,7,11,12,13,14,15],inclusive:!1},ALIAS:{rules:[2,3,21,22],inclusive:!1},LINE:{rules:[2,3,34],inclusive:!1},CONFIG:{rules:[8,9,10],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,16,17,18,19,20,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,50,52,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93],inclusive:!0}}}}();function bt(){this.yy={}}return yt.lexer=xt,a(bt,"Parser"),bt.prototype=yt,yt.Parser=bt,new bt}();C.parser=C;var v=C,B={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34,SOLID_TOP:41,SOLID_BOTTOM:42,STICK_TOP:43,STICK_BOTTOM:44,SOLID_ARROW_TOP_REVERSE:45,SOLID_ARROW_BOTTOM_REVERSE:46,STICK_ARROW_TOP_REVERSE:47,STICK_ARROW_BOTTOM_REVERSE:48,SOLID_TOP_DOTTED:51,SOLID_BOTTOM_DOTTED:52,STICK_TOP_DOTTED:53,STICK_BOTTOM_DOTTED:54,SOLID_ARROW_TOP_REVERSE_DOTTED:55,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:56,STICK_ARROW_TOP_REVERSE_DOTTED:57,STICK_ARROW_BOTTOM_REVERSE_DOTTED:58,CENTRAL_CONNECTION:59,CENTRAL_CONNECTION_REVERSE:60,CENTRAL_CONNECTION_DUAL:61},Y={FILLED:0,OPEN:1},$={LEFTOF:0,RIGHTOF:1,OVER:2},V="actor",W="control",F="database",K="entity",q=(a(t=class{constructor(){this.state=new e(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=h,this.setAccDescription=p,this.setDiagramTitle=T,this.getAccTitle=E,this.getAccDescription=g,this.getDiagramTitle=u,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(s().wrap),this.LINETYPE=B,this.ARROWTYPE=Y,this.PLACEMENT=$}addBox(t){this.state.records.boxes.push({name:t.text,wrap:t.wrap??this.autoWrap(),fill:t.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(t,e,a,r,s){let i,n=this.state.records.currentBox;if(void 0!==s){let t;t=s.includes("\n")?s+"\n":"{\n"+s+"\n}",i=O(t,{schema:_})}r=(null==i?void 0:i.type)??r,!(null==i?void 0:i.alias)||a&&a.text!==e||(a={text:i.alias,wrap:null==a?void 0:a.wrap,type:r});const o=this.state.records.actors.get(t);if(o){if(this.state.records.currentBox&&o.box&&this.state.records.currentBox!==o.box)throw new Error(`A same participant should only be defined in one Box: ${o.name} can't be in '${o.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(n=o.box?o.box:this.state.records.currentBox,o.box=n,o&&e===o.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}),this.state.records.actors.set(t,{box:n,name:e,description:a.text,wrap:a.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:r??"participant"}),this.state.records.prevActor){const e=this.state.records.actors.get(this.state.records.prevActor);e&&(e.nextActor=t)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(t),this.state.records.prevActor=t}activationCount(t){let e,a=0;if(!t)return 0;for(e=0;e<this.state.records.messages.length;e++)this.state.records.messages[e].type===this.LINETYPE.ACTIVE_START&&this.state.records.messages[e].from===t&&a++,this.state.records.messages[e].type===this.LINETYPE.ACTIVE_END&&this.state.records.messages[e].from===t&&a--;return a}addMessage(t,e,a,r){this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:e,message:a.text,wrap:a.wrap??this.autoWrap(),answer:r})}addSignal(t,e,a,r,s=!1,i){if(r===this.LINETYPE.ACTIVE_END){if(this.activationCount(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 this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:e,message:(null==a?void 0:a.text)??"",wrap:(null==a?void 0:a.wrap)??this.autoWrap(),type:r,activate:s,centralConnection:i??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(t=>t.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(t){return this.state.records.actors.get(t)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(t){this.state.records.wrapEnabled=t}extractWrap(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}}autoWrap(){var t;return void 0!==this.state.records.wrapEnabled?this.state.records.wrapEnabled:(null==(t=s().sequence)?void 0:t.wrap)??!1}clear(){this.state.reset(),y()}parseMessage(t){const e=t.trim(),{wrap:a,cleanedText:r}=this.extractWrap(e),s={text:r,wrap:a};return n.debug(`parseMessage: ${JSON.stringify(s)}`),s}parseBoxData(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:i,cleanedText:n}=this.extractWrap(r);return{text:n?x(n,s()):void 0,color:a,wrap:i}}addNote(t,e,a){const r={actor:t,placement:e,message:a.text,wrap:a.wrap??this.autoWrap()},s=[].concat(t,t);this.state.records.notes.push(r),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:s[0],to:s[1],message:a.text,wrap:a.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:e})}addLinks(t,e){const a=this.getActor(t);try{let t=x(e.text,s());t=t.replace(/=/g,"="),t=t.replace(/&/g,"&");const r=JSON.parse(t);this.insertLinks(a,r)}catch(r){n.error("error while parsing actor link text",r)}}addALink(t,e){const a=this.getActor(t);try{const t={};let r=x(e.text,s());const i=r.indexOf("@");r=r.replace(/=/g,"="),r=r.replace(/&/g,"&");const n=r.slice(0,i-1).trim(),o=r.slice(i+1).trim();t[n]=o,this.insertLinks(a,t)}catch(r){n.error("error while parsing actor link text",r)}}insertLinks(t,e){if(null==t.links)t.links=e;else for(const a in e)t.links[a]=e[a]}addProperties(t,e){const a=this.getActor(t);try{const t=x(e.text,s()),r=JSON.parse(t);this.insertProperties(a,r)}catch(r){n.error("error while parsing actor properties text",r)}}insertProperties(t,e){if(null==t.properties)t.properties=e;else for(const a in e)t.properties[a]=e[a]}boxEnd(){this.state.records.currentBox=void 0}addDetails(t,e){const a=this.getActor(t),r=document.getElementById(e.text);try{const t=r.innerHTML,e=JSON.parse(t);e.properties&&this.insertProperties(a,e.properties),e.links&&this.insertLinks(a,e.links)}catch(s){n.error("error while parsing actor details text",s)}}getActorProperty(t,e){if(void 0!==(null==t?void 0:t.properties))return t.properties[e]}apply(t){if(Array.isArray(t))t.forEach(t=>{this.apply(t)});else switch(t.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:t.sequenceIndex,step:t.sequenceIndexStep,visible:t.sequenceVisible},wrap:!1,type:t.signalType});break;case"addParticipant":this.addActor(t.actor,t.actor,t.description,t.draw,t.config);break;case"createParticipant":if(this.state.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");this.state.records.lastCreated=t.actor,this.addActor(t.actor,t.actor,t.description,t.draw,t.config),this.state.records.createdActors.set(t.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=t.actor,this.state.records.destroyedActors.set(t.actor,this.state.records.messages.length);break;case"activeStart":case"centralConnection":case"centralConnectionReverse":case"activeEnd":this.addSignal(t.actor,void 0,void 0,t.signalType);break;case"addNote":this.addNote(t.actor,t.placement,t.text);break;case"addLinks":this.addLinks(t.actor,t.text);break;case"addALink":this.addALink(t.actor,t.text);break;case"addProperties":this.addProperties(t.actor,t.text);break;case"addDetails":this.addDetails(t.actor,t.text);break;case"addMessage":if(this.state.records.lastCreated){if(t.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(t.to!==this.state.records.lastDestroyed&&t.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(t.from,t.to,t.msg,t.signalType,t.activate,t.centralConnection);break;case"boxStart":this.addBox(t.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":case"rectEnd":case"optEnd":case"altEnd":case"parEnd":case"criticalEnd":case"breakEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"rectStart":this.addSignal(void 0,void 0,t.color,t.signalType);break;case"optStart":this.addSignal(void 0,void 0,t.optText,t.signalType);break;case"altStart":case"else":this.addSignal(void 0,void 0,t.altText,t.signalType);break;case"setAccTitle":h(t.text);break;case"parStart":case"and":this.addSignal(void 0,void 0,t.parText,t.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,t.criticalText,t.signalType);break;case"option":this.addSignal(void 0,void 0,t.optionText,t.signalType);break;case"breakStart":this.addSignal(void 0,void 0,t.breakText,t.signalType)}}getConfig(){return s().sequence}},"SequenceDB"),t),H=a(t=>{const e=t.dropShadow??"none",{look:a}=s();return`.actor {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n stroke-width: ${t.strokeWidth??1};\n }\n\n rect.actor.outer-path[data-look="neo"] {\n filter: ${e};\n }\n\n rect.note[data-look="neo"] {\n stroke:${t.noteBorderColor};\n fill:${t.noteBkgColor};\n filter: ${e};\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 .innerArc {\n stroke-width: 1.5;\n stroke-dasharray: none;\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 [id$="-arrowhead"] path {\n fill: ${t.signalColor};\n stroke: ${t.signalColor};\n }\n\n .sequenceNumber {\n fill: ${t.sequenceNumberColor};\n }\n\n [id$="-sequencenumber"] {\n fill: ${t.signalColor};\n }\n\n [id$="-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 filter: ${"neo"===a?e:"none"};\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 .sectionTitle, .sectionTitle > 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 ${t.noteFontWeight?`font-weight: ${t.noteFontWeight};`:""}\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 circle, line {\n fill: ${t.actorBkg};\n stroke-width: 2px;\n }\n\n g rect.rect {\n filter: ${e};\n stroke: ${t.nodeBorder};\n }\n`},"getStyles"),z="actor-top",U="actor-bottom",j="actor-box",G="actor-man",X=new Set(["redux-color","redux-dark-color"]),J=a(function(t,e){const a=A(t,e);return"neo"===L().look&&a.attr("data-look","neo"),a},"drawRect"),Z=a(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,c=e.rectData;var d="none";s&&(d="block !important");const l=t.append("g");l.attr("id","actor"+n+"_popup"),l.attr("class","actorPopupMenu"),l.attr("display",d);var h="";void 0!==c.class&&(h=" "+c.class);let p=c.width>a?c.width:a;const T=l.append("rect");if(T.attr("class","actorPopupMenuPanel"+h),T.attr("x",c.x),T.attr("y",c.height),T.attr("fill",c.fill),T.attr("stroke",c.stroke),T.attr("width",p),T.attr("height",c.height),T.attr("rx",c.rx),T.attr("ry",c.ry),null!=i){var E=20;for(let t in i){var g=l.append("a"),u=o.sanitizeUrl(i[t]);g.attr("xlink:href",u),g.attr("target","_blank"),Pt(r)(t,g,c.x+10,c.height+E,p,20,{class:"actor"},r),E+=30}}return T.attr("height",E),{height:c.height+E,width:p}},"drawPopup"),Q=a(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),tt=a(async function(t,e,a=null){let r=t.append("foreignObject");const s=await w(e.text,L()),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"),et=a(function(t,e){let r=0,s=0;const i=e.text.split(l.lineBreakRegex),[n,o]=f(e.fontSize);let c=[],d=0,h=a(()=>e.y,"yfunc");if(void 0!==e.valign&&void 0!==e.textMargin&&e.textMargin>0)switch(e.valign){case"top":case"start":h=a(()=>Math.round(e.y+e.textMargin),"yfunc");break;case"middle":case"center":h=a(()=>Math.round(e.y+(r+s+e.textMargin)/2),"yfunc");break;case"bottom":case"end":h=a(()=>Math.round(e.y+(r+s+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[a,l]of i.entries()){void 0!==e.textMargin&&0===e.textMargin&&void 0!==n&&(d=a*n);const i=t.append("text");i.attr("x",e.x),i.attr("y",h()),void 0!==e.anchor&&i.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),void 0!==e.fontFamily&&i.style("font-family",e.fontFamily),void 0!==o&&i.style("font-size",o),void 0!==e.fontWeight&&i.style("font-weight",e.fontWeight),void 0!==e.fill&&i.attr("fill",e.fill),void 0!==e.class&&i.attr("class",e.class),void 0!==e.dy?i.attr("dy",e.dy):0!==d&&i.attr("dy",d);const p=l||R;if(e.tspan){const t=i.append("tspan");t.attr("x",e.x),void 0!==e.fill&&t.attr("fill",e.fill),t.text(p)}else i.text(p);void 0!==e.valign&&void 0!==e.textMargin&&e.textMargin>0&&(s+=(i._groups||i)[0][0].getBBox().height,r=s),c.push(i)}return c},"drawText"),at=a(function(t,e){function r(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)}a(r,"genPoints");const s=t.append("polygon");return s.attr("points",r(e.x,e.y,e.width,e.height,7)),s.attr("class","labelBox"),e.y=e.y+e.height/2,et(t,e),s},"drawLabel"),rt=-1,st=a((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"),it=a(function(t,e,a,r,s){var i,n;const o=r?e.stopy:e.starty,c=e.x+e.width/2,d=o+e.height,{look:l,theme:h,themeVariables:p}=a,{bkgColorArray:T,borderColorArray:E}=p,g=t.append("g").lower();var u=g;r||(rt++,Object.keys(e.links||{}).length&&!a.forceMenus&&u.attr("onclick",Q(`actor${rt}_popup`)).attr("cursor","pointer"),u.append("line").attr("id","actor"+rt).attr("x1",c).attr("y1",d).attr("x2",c).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),u=g.append("g"),e.actorCnt=rt,null!=e.links&&u.attr("id","root-"+rt),"neo"===l&&u.attr("data-look","neo"));const O=D();var _="actor";(null==(i=e.properties)?void 0:i.class)?_=e.properties.class:O.fill="#eaeaea",_+=r?` ${U}`:` ${z}`,O.x=e.x,O.y=o,O.width=e.width,O.height=e.height,O.class=_,O.rx=3,O.ry=3,O.name=e.name,"neo"===l&&(O.rx=6,O.ry=6);const y=J(u,O),x=s.get(e.name)??0;if(X.has(h)&&(y.style("stroke",E[x%E.length]),y.style("fill",T[x%E.length])),"neo"===l&&y.attr("filter","url(#drop-shadow)"),e.rectData=O,null==(n=e.properties)?void 0:n.icon){const t=e.properties.icon.trim();"@"===t.charAt(0)?k(u,O.x+O.width-20,O.y+10,t.substr(1)):M(u,O.x+O.width-20,O.y+10,t)}r||(u.attr("data-et","participant"),u.attr("data-type","participant"),u.attr("data-id",e.name)),St(a,m(e.description))(e.description,u,O.x,O.y,O.width,O.height,{class:`actor ${j}`},a);let b=e.height;if(y.node){const t=y.node().getBBox();e.height=t.height,b=t.height}return b},"drawActorTypeParticipant"),nt=a(function(t,e,a,r,s){var i,n;const o=r?e.stopy:e.starty,c=e.x+e.width/2,d=o+e.height,{look:l,theme:h,themeVariables:p}=a,{bkgColorArray:T,borderColorArray:E}=p,g=t.append("g").lower();var u=g;r||(rt++,Object.keys(e.links||{}).length&&!a.forceMenus&&u.attr("onclick",Q(`actor${rt}_popup`)).attr("cursor","pointer"),u.append("line").attr("id","actor"+rt).attr("x1",c).attr("y1",d).attr("x2",c).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),u=g.append("g"),e.actorCnt=rt,null!=e.links&&u.attr("id","root-"+rt),"neo"===l&&u.attr("data-look","neo"));const O=D();var _="actor";(null==(i=e.properties)?void 0:i.class)?_=e.properties.class:O.fill="#eaeaea",_+=r?` ${U}`:` ${z}`,O.x=e.x,O.y=o,O.width=e.width,O.height=e.height,O.class=_,O.name=e.name;const y={...O,x:O.x+-6,y:O.y+6,class:"actor"},x=J(u,O),b=J(u,y);e.rectData=O,"neo"===l&&u.attr("filter","url(#drop-shadow)");const I=s.get(e.name)??0;if(X.has(h)&&(x.style("stroke",E[I%E.length]),x.style("fill",T[I%E.length]),b.style("stroke",E[I%E.length]),b.style("fill",T[I%E.length])),null==(n=e.properties)?void 0:n.icon){const t=e.properties.icon.trim();"@"===t.charAt(0)?k(u,O.x+O.width-20,O.y+10,t.substr(1)):M(u,O.x+O.width-20,O.y+10,t)}St(a,m(e.description))(e.description,u,O.x-6,O.y+6,O.width,O.height,{class:`actor ${j}`},a);let f=e.height;if(x.node){const t=x.node().getBBox();e.height=t.height,f=t.height}return r||(u.attr("data-et","participant"),u.attr("data-type","collections"),u.attr("data-id",e.name)),f},"drawActorTypeCollections"),ot=a(function(t,e,a,r,s){var i,n;const o=r?e.stopy:e.starty,c=e.x+e.width/2,d=o+e.height,{look:l,theme:h,themeVariables:p}=a,{bkgColorArray:T,borderColorArray:E}=p,g=t.append("g").lower();let u=g;r||(rt++,Object.keys(e.links||{}).length&&!a.forceMenus&&u.attr("onclick",Q(`actor${rt}_popup`)).attr("cursor","pointer"),u.append("line").attr("id","actor"+rt).attr("x1",c).attr("y1",d).attr("x2",c).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),u=g.append("g"),e.actorCnt=rt,null!=e.links&&u.attr("id","root-"+rt),"neo"===l&&u.attr("data-look","neo"));const O=D();let _="actor";(null==(i=e.properties)?void 0:i.class)?_=e.properties.class:O.fill="#eaeaea",_+=r?` ${U}`:` ${z}`,u.attr("class",_),O.x=e.x,O.y=o,O.width=e.width,O.height=e.height,O.name=e.name;const y=O.height/2,x=y/(2.5+O.height/50),b=u.append("g"),I=u.append("g"),f=`M ${O.x},${O.y+y}\n a ${x},${y} 0 0 0 0,${O.height}\n h ${O.width-2*x}\n a ${x},${y} 0 0 0 0,-${O.height}\n Z\n `;b.append("path").attr("d",f),I.append("path").attr("d",`M ${O.x},${O.y+y}\n a ${x},${y} 0 0 0 0,${O.height}`),b.attr("transform",`translate(${x}, ${-O.height/2})`),I.attr("transform",`translate(${O.width-x}, ${-O.height/2})`),e.rectData=O,"neo"===l&&b.attr("filter","url(#drop-shadow)");const R=s.get(e.name)??0;if(X.has(h)&&(b.style("stroke",E[R%E.length]),b.style("fill",T[R%E.length]),I.style("stroke",E[R%E.length]),I.style("fill",T[R%E.length])),null==(n=e.properties)?void 0:n.icon){const t=e.properties.icon.trim(),a=O.x+O.width-20,r=O.y+10;"@"===t.charAt(0)?k(u,a,r,t.substr(1)):M(u,a,r,t)}St(a,m(e.description))(e.description,u,O.x,O.y,O.width,O.height,{class:`actor ${j}`},a);let L=e.height;const N=b.select("path:last-child");if(N.node()){const t=N.node().getBBox();e.height=t.height,L=t.height}return r||(u.attr("data-et","participant"),u.attr("data-type","queue"),u.attr("data-id",e.name)),L},"drawActorTypeQueue"),ct=a(function(t,e,a,r,s,i){var n;const o=r?e.stopy:e.starty,c=e.x+e.width/2,d=o+75,{look:l,theme:h,themeVariables:p}=a,{bkgColorArray:T,borderColorArray:E,actorBorder:g,actorBkg:u}=p,O=t.append("g").lower();r||(rt++,O.append("line").attr("id","actor"+rt).attr("x1",c).attr("y1",d).attr("x2",c).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=rt);const _=t.append("g");let y=G;y+=r?` ${U}`:` ${z}`,_.attr("class",y),_.attr("name",e.name);const x=D();x.x=e.x,x.y=o,x.fill="#eaeaea",x.width=e.width,x.height=e.height,x.class="actor";const b=e.x+e.width/2,I=o+32;_.append("defs").append("marker").attr("id",s+"-filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").attr("stroke-width",1.2).append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),_.append("circle").attr("cx",b).attr("cy",I).attr("r",22).attr("filter",""+("neo"===l?"url(#drop-shadow)":"")),_.append("line").attr("marker-end","url(#"+s+"-filled-head-control)").attr("transform",`translate(${b}, ${I-22})`);const f=i.get(e.name)??0;X.has(h)?(_.style("stroke",E[f%E.length]),_.style("fill",T[f%E.length])):(_.style("stroke",g),_.style("fill",u));const R=_.node().getBBox();return e.height=R.height+2*((null==(n=null==a?void 0:a.sequence)?void 0:n.labelBoxHeight)??0),St(a,m(e.description))(e.description,_,x.x,x.y+22+(r?5:12),x.width,x.height,{class:`actor ${G}`},a),r||(_.attr("data-et","participant"),_.attr("data-type","control"),_.attr("data-id",e.name)),e.height},"drawActorTypeControl"),dt=a(function(t,e,a,r,s){var i;const n=r?e.stopy:e.starty,o=e.x+e.width/2,c=n+75,{look:d,theme:l,themeVariables:h}=a,{bkgColorArray:p,borderColorArray:T}=h,E=t.append("g").lower(),g=t.append("g");let u="actor";u+=r?` ${U}`:` ${z}`,g.attr("class",u),g.attr("name",e.name);const O=D();O.x=e.x,O.y=n,O.fill="#eaeaea",O.width=e.width,O.height=e.height,O.class="actor";const _=e.x+e.width/2,y=n+(r?10:25),x=22;g.append("circle").attr("cx",_).attr("cy",y).attr("r",x).attr("width",e.width).attr("height",e.height),g.append("line").attr("x1",_-x).attr("x2",_+x).attr("y1",y+x).attr("y2",y+x).attr("stroke-width",2),"neo"===d&&g.attr("filter","url(#drop-shadow)");const b=s.get(e.name)??0;X.has(l)&&(g.style("stroke",T[b%T.length]),g.style("fill",p[b%T.length]));const I=g.node().getBBox();return e.height=I.height+((null==(i=null==a?void 0:a.sequence)?void 0:i.labelBoxHeight)??0),r||(rt++,E.append("line").attr("id","actor"+rt).attr("x1",o).attr("y1",c).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=rt),St(a,m(e.description))(e.description,g,O.x,O.y+(r?15:30),O.width,O.height,{class:`actor ${G}`},a),r?g.attr("transform","translate(0, 22)"):(g.attr("transform","translate(0, 6)"),g.attr("data-et","participant"),g.attr("data-type","entity"),g.attr("data-id",e.name)),e.height},"drawActorTypeEntity"),lt=a(function(t,e,a,r,s){var i;const n=r?e.stopy:e.starty,o=e.x+e.width/2,c=n+e.height+2*a.boxTextMargin,{theme:d,themeVariables:l,look:h}=a,{bkgColorArray:p,borderColorArray:T,actorBorder:E}=l,g=t.append("g").lower();let u=g;r||(rt++,Object.keys(e.links||{}).length&&!a.forceMenus&&u.attr("onclick",Q(`actor${rt}_popup`)).attr("cursor","pointer"),u.append("line").attr("id","actor"+rt).attr("x1",o).attr("y1",c).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),u=g.append("g"),e.actorCnt=rt,null!=e.links&&u.attr("id","root-"+rt),"neo"===h&&u.attr("data-look","neo"));const O=D();let _="actor";(null==(i=e.properties)?void 0:i.class)?_=e.properties.class:O.fill="#eaeaea",_+=r?` ${U}`:` ${z}`,O.x=e.x,O.y=n,O.width=e.width,O.height=e.height,O.class=_,O.name=e.name,O.x=e.x,O.y=n;const y=O.width/3,x=O.width/3,b=y/2,I=b/(2.5+y/50),f=u.append("g");f.attr("class",_);const R=`\n M ${O.x},${O.y+I}\n a ${b},${I} 0 0 0 ${y},0\n a ${b},${I} 0 0 0 -${y},0\n l 0,${x-2*I}\n a ${b},${I} 0 0 0 ${y},0\n l 0,-${x-2*I}\n`;f.append("path").attr("d",R),"neo"===h&&f.attr("filter","url(#drop-shadow)");const L=s.get(e.name)??0;X.has(d)?(f.style("stroke",T[L%T.length]),f.style("fill",p[L%T.length])):f.style("stroke",E),f.attr("transform",`translate(${y}, ${I})`),e.rectData=O,St(a,m(e.description))(e.description,u,O.x,O.y+35,O.width,O.height,{class:`actor ${j}`},a);const N=f.select("path:last-child");if(N.node()){const t=N.node().getBBox();e.height=t.height+(a.sequence.labelBoxHeight??0)}return r||(u.attr("data-et","participant"),u.attr("data-type","database"),u.attr("data-id",e.name)),e.height},"drawActorTypeDatabase"),ht=a(function(t,e,a,r,s){const i=r?e.stopy:e.starty,n=e.x+e.width/2,o=i+80,c=t.append("g").lower(),{look:d,theme:l,themeVariables:h}=a,{bkgColorArray:p,borderColorArray:T,actorBorder:E}=h;r||(rt++,c.append("line").attr("id","actor"+rt).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).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=rt);const g=t.append("g");let u=G;u+=r?` ${U}`:` ${z}`,g.attr("class",u),g.attr("name",e.name);const O=D();O.x=e.x,O.y=i,O.fill="#eaeaea",O.width=e.width,O.height=e.height,O.class="actor",g.append("line").attr("id","actor-man-torso"+rt).attr("x1",e.x+e.width/2-55).attr("y1",i+12).attr("x2",e.x+e.width/2-15).attr("y2",i+12),g.append("line").attr("id","actor-man-arms"+rt).attr("x1",e.x+e.width/2-55).attr("y1",i+2).attr("x2",e.x+e.width/2-55).attr("y2",i+22),g.append("circle").attr("cx",e.x+e.width/2).attr("cy",i+12).attr("r",22),"neo"===d&&g.attr("filter","url(#drop-shadow)");const _=s.get(e.name)??0;X.has(l)?(g.style("stroke",T[_%T.length]),g.style("fill",p[_%T.length])):g.style("stroke",E);const y=g.node().getBBox();return e.height=y.height+(a.sequence.labelBoxHeight??0),St(a,m(e.description))(e.description,g,O.x,O.y+15,O.width,O.height,{class:`actor ${G}`},a),g.attr("transform","translate(0,21)"),r||(g.attr("data-et","participant"),g.attr("data-type","boundary"),g.attr("data-id",e.name)),e.height},"drawActorTypeBoundary"),pt=a(function(t,e,a,r,s){const i=r?e.stopy:e.starty,n=e.x+e.width/2,o=i+80,{look:c,theme:d,themeVariables:l}=a,{bkgColorArray:h,borderColorArray:p,actorBorder:T}=l,E=t.append("g").lower();r||(rt++,E.append("line").attr("id","actor"+rt).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).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=rt);const g=t.append("g");let u=G;u+=r?` ${U}`:` ${z}`,g.attr("class",u),g.attr("name",e.name),r||g.attr("data-et","participant").attr("data-type","actor").attr("data-id",e.name);const O="neo"===c?.5:1,_="neo"===c?i+30*(1-O):i;g.append("line").attr("id","actor-man-torso"+rt).attr("x1",n).attr("y1",_+25*O).attr("x2",n).attr("y2",_+45*O),g.append("line").attr("id","actor-man-arms"+rt).attr("x1",n-18*O).attr("y1",_+33*O).attr("x2",n+18*O).attr("y2",_+33*O),g.append("line").attr("x1",n-18*O).attr("y1",_+60*O).attr("x2",n).attr("y2",_+45*O),g.append("line").attr("x1",n).attr("y1",_+45*O).attr("x2",n+16*O).attr("y2",_+60*O);const y=g.append("circle");y.attr("cx",e.x+e.width/2),y.attr("cy",_+10*O),y.attr("r",15*O),y.attr("width",e.width*O),y.attr("height",e.height*O);const x=g.node().getBBox();e.height=x.height;const b=D();b.x=e.x,b.y=_,b.fill="#eaeaea",b.width=e.width,b.height=e.height/O,b.class="actor",b.rx=3,b.ry=3;const I=s.get(e.name)??0;return X.has(d)?(g.style("stroke",p[I%p.length]),g.style("fill",h[I%p.length])):g.style("stroke",T),St(a,m(e.description))(e.description,g,b.x,_+35*O-("neo"===c?10:0),b.width,b.height,{class:`actor ${G}`},a),e.height},"drawActorTypeActor"),Tt=a(async function(t,e,a,r,s,i,n){const o=n??new Map([...i.db.getActors().values()].map((t,e)=>[t.name,e]));switch(e.type){case"actor":return await pt(t,e,a,r,o);case"participant":return await it(t,e,a,r,o);case"boundary":return await ht(t,e,a,r,o);case"control":return await ct(t,e,a,r,s,o);case"entity":return await dt(t,e,a,r,o);case"database":return await lt(t,e,a,r,o);case"collections":return await nt(t,e,a,r,o);case"queue":return await ot(t,e,a,r,o)}},"drawActor"),Et=a(function(t,e,a){const r=t.append("g");_t(r,e),e.name&&St(a)(e.name,r,e.x,e.y+a.boxTextMargin+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},a),r.lower()},"drawBox"),gt=a(function(t){return t.append("g")},"anchorElement"),ut=a(function(t,e,a,r,s,i,n){const{theme:o,themeVariables:c}=r,{bkgColorArray:d,borderColorArray:l,mainBkg:h}=c,p=D(),T=e.anchored,E=e.actor;p.x=e.startx,p.y=e.starty,p.class="activation"+s%3,p.width=e.stopx-e.startx,p.height=a-e.starty;const g=J(T,p),u=(n??new Map([...i.db.getActors().values()].map((t,e)=>[t.name,e]))).get(E)??0;X.has(o)&&(g.style("stroke",l[u%l.length]),g.style("fill",d[u%l.length]??h))},"drawActivation"),Ot=a(async function(t,e,r,s,i){const{boxMargin:n,boxTextMargin:o,labelBoxHeight:c,labelBoxWidth:d,messageFontFamily:l,messageFontSize:h,messageFontWeight:p}=s,T=t.append("g").attr("data-et","control-structure").attr("data-id","i"+i.id),E=a(function(t,e,a,r){return T.append("line").attr("x1",t).attr("y1",e).attr("x2",a).attr("y2",r).attr("class","loopLine")},"drawLoopLine");E(e.startx,e.starty,e.stopx,e.starty),E(e.stopx,e.starty,e.stopx,e.stopy),E(e.startx,e.stopy,e.stopx,e.stopy),E(e.startx,e.starty,e.startx,e.stopy),void 0!==e.sections&&e.sections.forEach(function(t){E(e.startx,t.y,e.stopx,t.y).style("stroke-dasharray","3, 3")});let g=P();g.text=r,g.x=e.startx,g.y=e.starty,g.fontFamily=l,g.fontSize=h,g.fontWeight=p,g.anchor="middle",g.valign="middle",g.tspan=!1,g.width=Math.max(d??0,50),g.height=c+("neo"===s.look?15:0)||20,g.textMargin=o,g.class="labelText",at(T,g),g=Nt(),g.text=e.title,g.x=e.startx+d/2+(e.stopx-e.startx)/2,g.y=e.starty+n+o,g.anchor="middle",g.valign="middle",g.textMargin=o,g.class="loopText",g.fontFamily=l,g.fontSize=h,g.fontWeight=p,g.wrap=!0;let u=m(g.text)?await tt(T,g,e):et(T,g);if(void 0!==e.sectionTitles)for(const[a,O]of Object.entries(e.sectionTitles))if(O.message){g.text=O.message,g.x=e.startx+(e.stopx-e.startx)/2,g.y=e.sections[a].y+n+o,g.class="sectionTitle",g.anchor="middle",g.valign="middle",g.tspan=!1,g.fontFamily=l,g.fontSize=h,g.fontWeight=p,g.wrap=e.wrap,m(g.text)?(e.starty=e.sections[a].y,await tt(T,g,e)):et(T,g);let t=Math.round(u.map(t=>(t._groups||t)[0][0].getBBox().height).reduce((t,e)=>t+e));e.sections[a].height+=t-(n+o)}return e.height=Math.round(e.stopy-e.starty),T},"drawLoop"),_t=a(function(t,e){S(t,e)},"drawBackgroundRect"),yt=a(function(t,e){t.append("defs").append("symbol").attr("id",e+"-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"),xt=a(function(t,e){t.append("defs").append("symbol").attr("id",e+"-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"),bt=a(function(t,e){t.append("defs").append("symbol").attr("id",e+"-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"),mt=a(function(t,e){t.append("defs").append("marker").attr("id",e+"-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"),It=a(function(t,e){t.append("defs").append("marker").attr("id",e+"-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"),ft=a(function(t,e){t.append("defs").append("marker").attr("id",e+"-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"),Rt=a(function(t,e){t.append("defs").append("marker").attr("id",e+"-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"),Lt=a(function(t,e){const{theme:a}=e;t.append("defs").append("filter").attr("id","drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",""+("redux"===a||"redux-color"===a?"#000000":"#FFFFFF"))},"insertDropShadow"),Nt=a(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=a(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),St=function(){function t(t,e,a,r,s,n,o){i(e.append("text").attr("x",a+s/2).attr("y",r+n/2+5).style("text-anchor","middle").text(t),o)}function e(t,e,a,r,s,n,o,c){const{actorFontSize:d,actorFontFamily:h,actorFontWeight:p}=c,[T,E]=f(d),g=t.split(l.lineBreakRegex);for(let l=0;l<g.length;l++){const t=l*T-T*(g.length-1)/2,c=e.append("text").attr("x",a+s/2).attr("y",r).style("text-anchor","middle").style("font-size",E).style("font-weight",p).style("font-family",h);c.append("tspan").attr("x",a+s/2).attr("dy",t).text(g[l]),c.attr("y",r+n/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(c,o)}}function r(t,a,r,s,n,o,c,d){const l=a.append("switch"),h=l.append("foreignObject").attr("x",r).attr("y",s).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,l,r,s,n,o,c,d),i(h,c)}async function s(t,a,r,s,n,o,c,d){const l=await I(t,L()),h=a.append("switch"),p=h.append("foreignObject").attr("x",r+n/2-l.width/2).attr("y",s+o/2-l.height/2).attr("width",l.width).attr("height",l.height).append("xhtml:div").style("height","100%").style("width","100%");p.append("div").style("text-align","center").style("vertical-align","middle").html(await w(t,L())),e(t,h,r,s,n,o,c,d),i(p,c)}function i(t,e){for(const a in e)e.hasOwnProperty(a)&&t.attr(a,e[a])}return a(t,"byText"),a(e,"byTspan"),a(r,"byFo"),a(s,"byKatex"),a(i,"_setTextAttrs"),function(a,i=!1){return i?s:"fo"===a.textPlacement?r:"old"===a.textPlacement?t:e}}(),Pt=function(){function t(t,e,a,r,i,n,o){s(e.append("text").attr("x",a).attr("y",r).style("text-anchor","start").text(t),o)}function e(t,e,a,r,i,n,o,c){const{actorFontSize:d,actorFontFamily:h,actorFontWeight:p}=c,T=t.split(l.lineBreakRegex);for(let l=0;l<T.length;l++){const t=l*d-d*(T.length-1)/2,i=e.append("text").attr("x",a).attr("y",r).style("text-anchor","start").style("font-size",d).style("font-weight",p).style("font-family",h);i.append("tspan").attr("x",a).attr("dy",t).text(T[l]),i.attr("y",r+n/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),s(i,o)}}function r(t,a,r,i,n,o,c,d){const l=a.append("switch"),h=l.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,l,r,i,0,o,c,d),s(h,c)}function s(t,e){for(const a in e)e.hasOwnProperty(a)&&t.attr(a,e[a])}return a(t,"byText"),a(e,"byTspan"),a(r,"byFo"),a(s,"_setTextAttrs"),function(a){return"fo"===a.textPlacement?r:"old"===a.textPlacement?t:e}}(),Dt=a(function(t,e){t.append("defs").append("marker").attr("id",e+"-solidTopArrowHead").attr("refX",7.9).attr("refY",7.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 8 L 0 8 z")},"insertSolidTopArrowHead"),At=a(function(t,e){t.append("defs").append("marker").attr("id",e+"-solidBottomArrowHead").attr("refX",7.9).attr("refY",.75).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 0 L 0 8 z")},"insertSolidBottomArrowHead"),kt=a(function(t,e){t.append("defs").append("marker").attr("id",e+"-stickTopArrowHead").attr("refX",7.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 7 7").attr("stroke","black").attr("stroke-width",1.5).attr("fill","none")},"insertStickTopArrowHead"),Mt=a(function(t,e){t.append("defs").append("marker").attr("id",e+"-stickBottomArrowHead").attr("refX",7.5).attr("refY",0).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 7 L 7 0").attr("stroke","black").attr("stroke-width",1.5).attr("fill","none")},"insertStickBottomArrowHead"),Ct={drawRect:J,drawText:et,drawLabel:at,drawActor:Tt,drawBox:Et,drawPopup:Z,anchorElement:gt,drawActivation:ut,drawLoop:Ot,drawBackgroundRect:_t,insertArrowHead:mt,insertArrowFilledHead:It,insertSequenceNumber:ft,insertArrowCrossHead:Rt,insertDatabaseIcon:yt,insertComputerIcon:xt,insertClockIcon:bt,getTextObj:Nt,getNoteRect:wt,fixLifeLineHeights:st,sanitizeUrl:o.sanitizeUrl,insertDropShadow:Lt,insertSolidTopArrowHead:Dt,insertSolidBottomArrowHead:At,insertStickTopArrowHead:kt,insertStickBottomArrowHead:Mt},vt={},Bt={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:a(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:a(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:a(function(t){this.boxes.push(t)},"addBox"),addActor:a(function(t){this.actors.push(t)},"addActor"),addLoop:a(function(t){this.loops.push(t)},"addLoop"),addMessage:a(function(t){this.messages.push(t)},"addMessage"),addNote:a(function(t){this.notes.push(t)},"addNote"),lastActor:a(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:a(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:a(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:a(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:a(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,jt(s())},"init"),updateVal:a(function(t,e,a,r){void 0===t[e]?t[e]=a:t[e]=r(a,t[e])},"updateVal"),updateBounds:a(function(t,e,r,s){const i=this;let n=0;function o(o){return a(function(a){n++;const c=i.sequenceItems.length-n+1;i.updateVal(a,"starty",e-c*vt.boxMargin,Math.min),i.updateVal(a,"stopy",s+c*vt.boxMargin,Math.max),i.updateVal(Bt.data,"startx",t-c*vt.boxMargin,Math.min),i.updateVal(Bt.data,"stopx",r+c*vt.boxMargin,Math.max),"activation"!==o&&(i.updateVal(a,"startx",t-c*vt.boxMargin,Math.min),i.updateVal(a,"stopx",r+c*vt.boxMargin,Math.max),i.updateVal(Bt.data,"starty",e-c*vt.boxMargin,Math.min),i.updateVal(Bt.data,"stopy",s+c*vt.boxMargin,Math.max))},"updateItemBounds")}a(o,"updateFn"),this.sequenceItems.forEach(o()),this.activations.forEach(o("activation"))},"updateBounds"),insert:a(function(t,e,a,r){const s=l.getMin(t,a),i=l.getMax(t,a),n=l.getMin(e,r),o=l.getMax(e,r);this.updateVal(Bt.data,"startx",s,Math.min),this.updateVal(Bt.data,"starty",n,Math.min),this.updateVal(Bt.data,"stopx",i,Math.max),this.updateVal(Bt.data,"stopy",o,Math.max),this.updateBounds(s,n,i,o)},"insert"),newActivation:a(function(t,e,a){const r=a.get(t.from),s=Gt(t.from).length||0,i=r.x+r.width/2+(s-1)*vt.activationWidth/2;this.activations.push({startx:i,starty:this.verticalPos+2,stopx:i+vt.activationWidth,stopy:void 0,actor:t.from,anchored:Ct.anchorElement(e)})},"newActivation"),endActivation:a(function(t){const e=this.activations.map(function(t){return t.actor}).lastIndexOf(t.from);return this.activations.splice(e,1)[0]},"endActivation"),createLoop:a(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:a(function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},"newLoop"),endLoop:a(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:a(function(){return!!this.sequenceItems.length&&this.sequenceItems[this.sequenceItems.length-1].overlap},"isLoopOverlap"),addSectionToLoop:a(function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:Bt.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},"addSectionToLoop"),saveVerticalPos:a(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:a(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:a(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=l.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:a(function(){return this.verticalPos},"getVerticalPos"),getBounds:a(function(){return{bounds:this.data,models:this.models}},"getBounds")},Yt=a(async function(t,e,a){Bt.bumpVerticalPos(vt.boxMargin),e.height=vt.boxMargin,e.starty=Bt.getVerticalPos();const r=D();r.x=e.startx,r.y=e.starty,r.width=e.width||vt.width,r.class="note";const s=t.append("g");s.attr("data-et","note"),s.attr("data-id","i"+a);const i=Ct.drawRect(s,r),n=P();n.x=e.startx,n.y=e.starty,n.width=r.width,n.dy="1em",n.text=e.message,n.class="noteText",n.fontFamily=vt.noteFontFamily,n.fontSize=vt.noteFontSize,n.fontWeight=vt.noteFontWeight,n.anchor=vt.noteAlign,n.textMargin=vt.noteMargin,n.valign="center";const o=m(n.text)?await tt(s,n):et(s,n),c=Math.round(o.map(t=>(t._groups||t)[0][0].getBBox().height).reduce((t,e)=>t+e));i.attr("height",c+2*vt.noteMargin),e.height+=c+2*vt.noteMargin,Bt.bumpVerticalPos(c+2*vt.noteMargin),e.stopy=e.starty+c+2*vt.noteMargin,e.stopx=e.startx+r.width,Bt.insert(e.startx,e.starty,e.stopx,e.stopy),Bt.models.addNote(e)},"drawNote"),$t=a(function(t,e,r,s,i,n,o){const c=s.db.getActors(),d=c.get(e.from),l=c.get(e.to),h=r.sequenceVisible;let p=d.x+d.width/2,T=l.x+l.width/2;const E=p<=T,g=ne(e,s),u=t.append("g"),O=a((t,e)=>{const a=t?16.5:-16.5;return e?-a:a},"getCircleOffset"),_=a(t=>{u.append("circle").attr("cx",t).attr("cy",o).attr("r",5).attr("width",10).attr("height",10)},"drawCircle"),{CENTRAL_CONNECTION:y,CENTRAL_CONNECTION_REVERSE:x,CENTRAL_CONNECTION_DUAL:b}=s.db.LINETYPE;if(h)switch(e.centralConnection){case y:g&&(T+=O(E,!0));break;case x:g||(p+=O(E,!1));break;case b:g?T+=O(E,!0):p+=O(E,!1)}switch(e.centralConnection){case y:_(T);break;case x:_(p);break;case b:_(p),_(T)}},"drawCentralConnection"),Vt=a(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),Wt=a(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),Ft=a(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont");async function Kt(t,e){Bt.bumpVerticalPos(10);const{startx:a,stopx:r,message:i}=e,n=l.splitBreaks(i).length,o=m(i),c=o?await I(i,s()):b.calculateTextDimensions(i,Vt(vt));if(!o){const t=c.height/n;e.height+=t,Bt.bumpVerticalPos(t)}let d,h=c.height-10;const p=c.width;if(a===r){d=Bt.getVerticalPos()+h,vt.rightAngles||(h+=vt.boxMargin,d=Bt.getVerticalPos()+h),h+=30;const t=l.getMax(p/2,vt.width/2);Bt.insert(a-t,Bt.getVerticalPos()-10+h,r+t,Bt.getVerticalPos()+30+h)}else h+=vt.boxMargin,d=Bt.getVerticalPos()+h,Bt.insert(a,d-10,r,d);return Bt.bumpVerticalPos(h),e.height+=h,e.stopy=e.starty+e.height,Bt.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),d}a(Kt,"boundMessage");var qt=a(async function(t,e,a,r,s,i){const{startx:n,stopx:o,starty:c,message:d,type:h,sequenceIndex:p,sequenceVisible:T}=e,E=b.calculateTextDimensions(d,Vt(vt)),g=P();g.x=Math.min(n,o),g.y=c+10,g.width=Math.abs(o-n),g.class="messageText",g.dy="1em",g.text=d,g.fontFamily=vt.messageFontFamily,g.fontSize=vt.messageFontSize,g.fontWeight=vt.messageFontWeight,g.anchor=vt.messageAlign,g.valign="center",g.textMargin=vt.wrapPadding,g.tspan=!1,m(g.text)?await tt(t,g,{startx:n,stopx:o,starty:a}):et(t,g);const u=E.width;let O;if(n===o){const i=T||vt.showSequenceNumbers,c=ne(s,r),d=oe(s,r),h=n+(i&&(c||d)?10:0);O=vt.rightAngles?t.append("path").attr("d",`M ${h},${a} H ${n+l.getMax(vt.width/2,u/2)} V ${a+25} H ${n}`):t.append("path").attr("d","M "+h+","+a+" C "+(h+60)+","+(a-10)+" "+(n+60)+","+(a+30)+" "+n+","+(a+20)),se(s,r)&&$t(t,s,e,r,n,o,a)}else O=t.append("line"),O.attr("x1",n),O.attr("y1",a),O.attr("x2",o),O.attr("y2",a),se(s,r)&&$t(t,s,e,r,n,o,a);h===r.db.LINETYPE.DOTTED||h===r.db.LINETYPE.DOTTED_CROSS||h===r.db.LINETYPE.DOTTED_POINT||h===r.db.LINETYPE.DOTTED_OPEN||h===r.db.LINETYPE.BIDIRECTIONAL_DOTTED||h===r.db.LINETYPE.SOLID_TOP_DOTTED||h===r.db.LINETYPE.SOLID_BOTTOM_DOTTED||h===r.db.LINETYPE.STICK_TOP_DOTTED||h===r.db.LINETYPE.STICK_BOTTOM_DOTTED||h===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(O.style("stroke-dasharray","3, 3"),O.attr("class","messageLine1")):O.attr("class","messageLine0"),O.attr("data-et","message"),O.attr("data-id","i"+e.id),O.attr("data-from",e.from),O.attr("data-to",e.to);let _="";if(vt.arrowMarkerAbsolute&&(_=N(!0)),O.attr("stroke-width",2),O.attr("stroke","none"),O.style("fill","none"),h!==r.db.LINETYPE.SOLID_TOP&&h!==r.db.LINETYPE.SOLID_TOP_DOTTED||O.attr("marker-end","url("+_+"#"+i+"-solidTopArrowHead)"),h!==r.db.LINETYPE.SOLID_BOTTOM&&h!==r.db.LINETYPE.SOLID_BOTTOM_DOTTED||O.attr("marker-end","url("+_+"#"+i+"-solidBottomArrowHead)"),h!==r.db.LINETYPE.STICK_TOP&&h!==r.db.LINETYPE.STICK_TOP_DOTTED||O.attr("marker-end","url("+_+"#"+i+"-stickTopArrowHead)"),h!==r.db.LINETYPE.STICK_BOTTOM&&h!==r.db.LINETYPE.STICK_BOTTOM_DOTTED||O.attr("marker-end","url("+_+"#"+i+"-stickBottomArrowHead)"),h!==r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE&&h!==r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||O.attr("marker-start","url("+_+"#"+i+"-solidBottomArrowHead)"),h!==r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE&&h!==r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||O.attr("marker-start","url("+_+"#"+i+"-solidTopArrowHead)"),h!==r.db.LINETYPE.STICK_ARROW_TOP_REVERSE&&h!==r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||O.attr("marker-start","url("+_+"#"+i+"-stickBottomArrowHead)"),h!==r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE&&h!==r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED||O.attr("marker-start","url("+_+"#"+i+"-stickTopArrowHead)"),h!==r.db.LINETYPE.SOLID&&h!==r.db.LINETYPE.DOTTED||O.attr("marker-end","url("+_+"#"+i+"-arrowhead)"),h!==r.db.LINETYPE.BIDIRECTIONAL_SOLID&&h!==r.db.LINETYPE.BIDIRECTIONAL_DOTTED||(O.attr("marker-start","url("+_+"#"+i+"-arrowhead)"),O.attr("marker-end","url("+_+"#"+i+"-arrowhead)")),h!==r.db.LINETYPE.SOLID_POINT&&h!==r.db.LINETYPE.DOTTED_POINT||O.attr("marker-end","url("+_+"#"+i+"-filled-head)"),h!==r.db.LINETYPE.SOLID_CROSS&&h!==r.db.LINETYPE.DOTTED_CROSS||O.attr("marker-end","url("+_+"#"+i+"-crosshead)"),T||vt.showSequenceNumbers){const c=h===r.db.LINETYPE.BIDIRECTIONAL_SOLID||h===r.db.LINETYPE.BIDIRECTIONAL_DOTTED,d=h===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||h===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||h===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE||h===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||h===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,l=6,T=se(s,r);let E=n,g=o;c?(n<o?E=n+2*l:(E=n-l+(T?-5:0),E+=(null==s?void 0:s.centralConnection)===r.db.LINETYPE.CENTRAL_CONNECTION_DUAL||(null==s?void 0:s.centralConnection)===r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),O.attr("x1",E)):d?(o>n?g=o-2*l:(g=o-l,E+=(null==s?void 0:s.centralConnection)===r.db.LINETYPE.CENTRAL_CONNECTION_DUAL||(null==s?void 0:s.centralConnection)===r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),g+=T?15:0,O.attr("x2",g),O.attr("x1",E)):O.attr("x1",n+l);let u=0;const y=n<=o;u=n===o?e.fromBounds+1:d?y?e.toBounds-1:e.fromBounds+1:y?e.fromBounds+1:e.toBounds-1;let x="12px";const b=p.toString().length;b>5?x="7px":b>3&&(x="9px"),t.append("line").attr("x1",u).attr("y1",a).attr("x2",u).attr("y2",a).attr("stroke-width",0).attr("marker-start","url("+_+"#"+i+"-sequencenumber)"),t.append("text").attr("x",u).attr("y",a+4).attr("font-family","sans-serif").attr("font-size",x).attr("text-anchor","middle").attr("class","sequenceNumber").text(p)}},"drawMessage"),Ht=a(function(t,e,a,r,s,i,n){let o,c=0,d=0,h=0;for(const p of r){const t=e.get(p),r=t.box;o&&o!=r&&(n||Bt.models.addBox(o),d+=vt.boxMargin+o.margin),r&&r!=o&&(n||(r.x=c+d,r.y=s),d+=r.margin),t.width=l.getMax(t.width||vt.width,vt.width),t.height=l.getMax(t.height||vt.height,vt.height),t.margin=t.margin||vt.actorMargin,h=l.getMax(h,t.height),a.get(t.name)&&(d+=t.width/2),t.x=c+d,t.starty=Bt.getVerticalPos(),Bt.insert(t.x,s,t.x+t.width,t.height),c+=t.width+d,t.box&&(t.box.width=c+r.margin-t.box.x),d=t.margin,o=t.box,Bt.models.addActor(t)}o&&!n&&Bt.models.addBox(o),Bt.bumpVerticalPos(h)},"addActorRenderingData"),zt=a(async function(t,e,a,r,s,i,n){if(r){let r=0;Bt.bumpVerticalPos(2*vt.boxMargin);for(const o of a){const a=e.get(o);a.stopy||(a.stopy=Bt.getVerticalPos());const c=await Ct.drawActor(t,a,vt,!0,s,i,n);r=l.getMax(r,c)}Bt.bumpVerticalPos(r+vt.boxMargin)}else for(const o of a){const a=e.get(o);await Ct.drawActor(t,a,vt,!1,s,i,n)}},"drawActors"),Ut=a(function(t,e,a,r){let s=0,i=0;for(const n of a){const a=e.get(n),o=ee(a),c=Ct.drawPopup(t,a,o,vt,vt.forceMenus,r);c.height>s&&(s=c.height),c.width+a.x>i&&(i=c.width+a.x)}return{maxHeight:s,maxWidth:i}},"drawActorsPopup"),jt=a(function(t){d(vt,t),t.fontFamily&&(vt.actorFontFamily=vt.noteFontFamily=vt.messageFontFamily=t.fontFamily),t.fontSize&&(vt.actorFontSize=vt.noteFontSize=vt.messageFontSize=t.fontSize),t.fontWeight&&(vt.actorFontWeight=vt.noteFontWeight=vt.messageFontWeight=t.fontWeight)},"setConf"),Gt=a(function(t){return Bt.activations.filter(function(e){return e.actor===t})},"actorActivations"),Xt=a(function(t,e){const a=e.get(t),r=Gt(t);return[r.reduce(function(t,e){return l.getMin(t,e.startx)},a.x+a.width/2-1),r.reduce(function(t,e){return l.getMax(t,e.stopx)},a.x+a.width/2+1)]},"activationBounds");function Jt(t,e,a,r,s){Bt.bumpVerticalPos(a);let i=r;if(e.id&&e.message&&t[e.id]){const a=t[e.id].width,s=Vt(vt);e.message=b.wrapLabel(`[${e.message}]`,a-2*vt.wrapPadding,s),e.width=a,e.wrap=!0;const o=b.calculateTextDimensions(e.message,s),c=l.getMax(o.height,vt.labelBoxHeight);i=r+c,n.debug(`${c} - ${e.message}`)}s(e),Bt.bumpVerticalPos(i)}function Zt(t,e,r,s,i,n,o){function c(a,r){a.x<i.get(t.from).x?(Bt.insert(e.stopx-r,e.starty,e.startx,e.stopy+a.height/2+vt.noteMargin),e.stopx=e.stopx+r):(Bt.insert(e.startx,e.starty,e.stopx+r,e.stopy+a.height/2+vt.noteMargin),e.stopx=e.stopx-r)}function d(a,r){a.x<i.get(t.to).x?(Bt.insert(e.startx-r,e.starty,e.stopx,e.stopy+a.height/2+vt.noteMargin),e.startx=e.startx+r):(Bt.insert(e.stopx,e.starty,e.startx+r,e.stopy+a.height/2+vt.noteMargin),e.startx=e.startx-r)}a(c,"receiverAdjustment"),a(d,"senderAdjustment");const l=[V,W,K,F];if(n.get(t.to)==s){const e=i.get(t.to);c(e,l.includes(e.type)?21:e.width/2+3),e.starty=r-e.height/2,Bt.bumpVerticalPos(e.height/2)}else if(o.get(t.from)==s){const e=i.get(t.from);if(vt.mirrorActors){d(e,l.includes(e.type)?18:e.width/2)}e.stopy=r-e.height/2,Bt.bumpVerticalPos(e.height/2)}else if(o.get(t.to)==s){const e=i.get(t.to);if(vt.mirrorActors){c(e,l.includes(e.type)?21:e.width/2+3)}e.stopy=r-e.height/2,Bt.bumpVerticalPos(e.height/2)}}a(Jt,"adjustLoopHeightForWrap"),a(Zt,"adjustCreatedDestroyedData");var Qt=a(async function(t,e,r,o){const{securityLevel:d,sequence:l,look:h,themeVariables:p}=s();let T;vt=l,"sandbox"===d&&(T=i("#i"+e));const E=i("sandbox"===d?T.nodes()[0].contentDocument.body:"body"),g="sandbox"===d?T.nodes()[0].contentDocument:document;Bt.init(),n.debug(o.db);const u="sandbox"===d?E.select(`[id="${e}"]`):i(`[id="${e}"]`),O=o.db.getActors(),_=o.db.getCreatedActors(),y=o.db.getDestroyedActors(),x=o.db.getBoxes();let b=o.db.getActorKeys();const m=o.db.getMessages(),I=o.db.getDiagramTitle(),f=o.db.hasAtLeastOneBox(),R=o.db.hasAtLeastOneBoxWithTitle(),L=await te(O,m,o);if(vt.height=await ae(O,L,x),Ct.insertComputerIcon(u,e),Ct.insertDatabaseIcon(u,e),Ct.insertClockIcon(u,e),f&&(Bt.bumpVerticalPos(vt.boxMargin),R&&Bt.bumpVerticalPos(x[0].textMaxHeight)),!0===vt.hideUnusedParticipants){const t=new Set;m.forEach(e=>{t.add(e.from),t.add(e.to)}),b=b.filter(e=>t.has(e))}const N=new Map(b.map((t,e)=>{var a;return[(null==(a=O.get(t))?void 0:a.name)??t,e]}));Ht(u,O,_,b,0,m,!1);const w=await de(m,O,L,o);function S(t,e){const a=Bt.endActivation(t);a.starty+18>e&&(a.starty=e-6,e+=12),Ct.drawActivation(u,a,e,vt,Gt(t.from).length,o,N),Bt.insert(a.startx,e-10,a.stopx,e)}Ct.insertArrowHead(u,e),Ct.insertArrowCrossHead(u,e),Ct.insertArrowFilledHead(u,e),Ct.insertSequenceNumber(u,e),Ct.insertSolidTopArrowHead(u,e),Ct.insertSolidBottomArrowHead(u,e),Ct.insertStickTopArrowHead(u,e),Ct.insertStickBottomArrowHead(u,e),"neo"===h&&Ct.insertDropShadow(u,vt),a(S,"activeEnd");let P=1,D=1;const A=[],k=[];let M=0;for(const a of m){let t,e,r;switch(a.type){case o.db.LINETYPE.NOTE:Bt.resetVerticalPos(),e=a.noteModel,await Yt(u,e,a.id);break;case o.db.LINETYPE.ACTIVE_START:case o.db.LINETYPE.CENTRAL_CONNECTION:case o.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:Bt.newActivation(a,u,O);break;case o.db.LINETYPE.ACTIVE_END:S(a,Bt.getVerticalPos());break;case o.db.LINETYPE.LOOP_START:Jt(w,a,vt.boxMargin,vt.boxMargin+vt.boxTextMargin,t=>Bt.newLoop(t));break;case o.db.LINETYPE.LOOP_END:t=Bt.endLoop(),await Ct.drawLoop(u,t,"loop",vt,a),Bt.bumpVerticalPos(t.stopy-Bt.getVerticalPos()),Bt.models.addLoop(t);break;case o.db.LINETYPE.RECT_START:Jt(w,a,vt.boxMargin,vt.boxMargin,t=>{let e=t.message;e||(e=(null==p?void 0:p.rectBkgColor)||(null==p?void 0:p.actorBkg)||"rgba(128, 128, 128, 0.5)"),Bt.newLoop(void 0,e)});break;case o.db.LINETYPE.RECT_END:t=Bt.endLoop(),k.push(t),Bt.models.addLoop(t),Bt.bumpVerticalPos(t.stopy-Bt.getVerticalPos());break;case o.db.LINETYPE.OPT_START:Jt(w,a,vt.boxMargin,vt.boxMargin+vt.boxTextMargin,t=>Bt.newLoop(t));break;case o.db.LINETYPE.OPT_END:t=Bt.endLoop(),await Ct.drawLoop(u,t,"opt",vt,a),Bt.bumpVerticalPos(t.stopy-Bt.getVerticalPos()),Bt.models.addLoop(t);break;case o.db.LINETYPE.ALT_START:Jt(w,a,vt.boxMargin,vt.boxMargin+vt.boxTextMargin,t=>Bt.newLoop(t));break;case o.db.LINETYPE.ALT_ELSE:Jt(w,a,vt.boxMargin+vt.boxTextMargin,vt.boxMargin,t=>Bt.addSectionToLoop(t));break;case o.db.LINETYPE.ALT_END:t=Bt.endLoop(),await Ct.drawLoop(u,t,"alt",vt,a),Bt.bumpVerticalPos(t.stopy-Bt.getVerticalPos()),Bt.models.addLoop(t);break;case o.db.LINETYPE.PAR_START:case o.db.LINETYPE.PAR_OVER_START:Jt(w,a,vt.boxMargin,vt.boxMargin+vt.boxTextMargin,t=>Bt.newLoop(t)),Bt.saveVerticalPos();break;case o.db.LINETYPE.PAR_AND:Jt(w,a,vt.boxMargin+vt.boxTextMargin,vt.boxMargin,t=>Bt.addSectionToLoop(t));break;case o.db.LINETYPE.PAR_END:t=Bt.endLoop(),await Ct.drawLoop(u,t,"par",vt,a),Bt.bumpVerticalPos(t.stopy-Bt.getVerticalPos()),Bt.models.addLoop(t);break;case o.db.LINETYPE.AUTONUMBER:P=a.message.start||P,D=a.message.step||D,a.message.visible?o.db.enableSequenceNumbers():o.db.disableSequenceNumbers();break;case o.db.LINETYPE.CRITICAL_START:Jt(w,a,vt.boxMargin,vt.boxMargin+vt.boxTextMargin,t=>Bt.newLoop(t));break;case o.db.LINETYPE.CRITICAL_OPTION:Jt(w,a,vt.boxMargin+vt.boxTextMargin,vt.boxMargin,t=>Bt.addSectionToLoop(t));break;case o.db.LINETYPE.CRITICAL_END:t=Bt.endLoop(),await Ct.drawLoop(u,t,"critical",vt,a),Bt.bumpVerticalPos(t.stopy-Bt.getVerticalPos()),Bt.models.addLoop(t);break;case o.db.LINETYPE.BREAK_START:Jt(w,a,vt.boxMargin,vt.boxMargin+vt.boxTextMargin,t=>Bt.newLoop(t));break;case o.db.LINETYPE.BREAK_END:t=Bt.endLoop(),await Ct.drawLoop(u,t,"break",vt,a),Bt.bumpVerticalPos(t.stopy-Bt.getVerticalPos()),Bt.models.addLoop(t);break;default:try{r=a.msgModel,r.starty=Bt.getVerticalPos(),r.sequenceIndex=P,r.sequenceVisible=o.db.showSequenceNumbers(),r.id=a.id,r.from=a.from,r.to=a.to;const t=await Kt(0,r);Zt(a,r,t,M,O,_,y),A.push({messageModel:r,lineStartY:t,msg:a}),Bt.models.addMessage(r)}catch(K){n.error("error while drawing message",K)}}[o.db.LINETYPE.SOLID_OPEN,o.db.LINETYPE.DOTTED_OPEN,o.db.LINETYPE.SOLID,o.db.LINETYPE.SOLID_TOP,o.db.LINETYPE.SOLID_BOTTOM,o.db.LINETYPE.STICK_TOP,o.db.LINETYPE.STICK_BOTTOM,o.db.LINETYPE.SOLID_TOP_DOTTED,o.db.LINETYPE.SOLID_BOTTOM_DOTTED,o.db.LINETYPE.STICK_TOP_DOTTED,o.db.LINETYPE.STICK_BOTTOM_DOTTED,o.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,o.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,o.db.LINETYPE.STICK_ARROW_TOP_REVERSE,o.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,o.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,o.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,o.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,o.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,o.db.LINETYPE.DOTTED,o.db.LINETYPE.SOLID_CROSS,o.db.LINETYPE.DOTTED_CROSS,o.db.LINETYPE.SOLID_POINT,o.db.LINETYPE.DOTTED_POINT,o.db.LINETYPE.BIDIRECTIONAL_SOLID,o.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(a.type)&&(P=Math.round(100*(P+D))/100),M++}n.debug("createdActors",_),n.debug("destroyedActors",y),await zt(u,O,b,!1,e,o,N);for(const a of A)await qt(u,a.messageModel,a.lineStartY,o,a.msg,e);vt.mirrorActors&&await zt(u,O,b,!0,e,o,N),k.forEach(t=>Ct.drawBackgroundRect(u,t)),st(u,O,b,vt);for(const a of Bt.models.boxes){a.height=Bt.getVerticalPos()-a.y,Bt.insert(a.x,a.y,a.x+a.width,a.height);const t=2*vt.boxMargin;a.startx=a.x-t,a.starty=a.y-.25*t,a.stopx=a.startx+a.width+2*t,a.stopy=a.starty+a.height+.75*t,a.stroke="rgb(0,0,0, 0.5)",Ct.drawBox(u,a,vt)}f&&Bt.bumpVerticalPos(vt.boxMargin);const C=Ut(u,O,b,g),{bounds:v}=Bt.getBounds();void 0===v.startx&&(v.startx=0),void 0===v.starty&&(v.starty=0),void 0===v.stopx&&(v.stopx=0),void 0===v.stopy&&(v.stopy=0);let B=v.stopy-v.starty;B<C.maxHeight&&(B=C.maxHeight);let Y=B+2*vt.diagramMarginY;vt.mirrorActors&&(Y=Y-vt.boxMargin+vt.bottomMarginAdj);let $=v.stopx-v.startx;$<C.maxWidth&&($=C.maxWidth);const V=$+2*vt.diagramMarginX;I&&u.append("text").text(I).attr("x",(v.stopx-v.startx)/2-2*vt.diagramMarginX).attr("y",-25),c(u,Y,V,vt.useMaxWidth);const W=I?40:0,F=O.size&&"neo"===h?30:0;u.attr("viewBox",v.startx-vt.diagramMarginX+" -"+(vt.diagramMarginY+W)+" "+V+" "+(Y+W+F)),n.debug("models:",Bt.models)},"draw");async function te(t,e,a){const r={};for(const i of e)if(t.get(i.to)&&t.get(i.from)){const e=t.get(i.to);if(i.placement===a.db.PLACEMENT.LEFTOF&&!e.prevActor)continue;if(i.placement===a.db.PLACEMENT.RIGHTOF&&!e.nextActor)continue;const n=void 0!==i.placement,o=!n,c=n?Wt(vt):Vt(vt),d=i.wrap?b.wrapLabel(i.message,vt.width-2*vt.wrapPadding,c):i.message,h=(m(d)?await I(i.message,s()):b.calculateTextDimensions(d,c)).width+2*vt.wrapPadding;o&&i.from===e.nextActor?r[i.to]=l.getMax(r[i.to]||0,h):o&&i.from===e.prevActor?r[i.from]=l.getMax(r[i.from]||0,h):o&&i.from===i.to?(r[i.from]=l.getMax(r[i.from]||0,h/2),r[i.to]=l.getMax(r[i.to]||0,h/2)):i.placement===a.db.PLACEMENT.RIGHTOF?r[i.from]=l.getMax(r[i.from]||0,h):i.placement===a.db.PLACEMENT.LEFTOF?r[e.prevActor]=l.getMax(r[e.prevActor]||0,h):i.placement===a.db.PLACEMENT.OVER&&(e.prevActor&&(r[e.prevActor]=l.getMax(r[e.prevActor]||0,h/2)),e.nextActor&&(r[i.from]=l.getMax(r[i.from]||0,h/2)))}return n.debug("maxMessageWidthPerActor:",r),r}a(te,"getMaxMessageWidthPerActor");var ee=a(function(t){let e=0;const a=Ft(vt);for(const r in t.links){const t=b.calculateTextDimensions(r,a).width+2*vt.wrapPadding+2*vt.boxMargin;e<t&&(e=t)}return e},"getRequiredPopupWidth");async function ae(t,e,a){let r=0;for(const n of t.keys()){const e=t.get(n);e.wrap&&(e.description=b.wrapLabel(e.description,vt.width-2*vt.wrapPadding,Ft(vt)));const a=m(e.description)?await I(e.description,s()):b.calculateTextDimensions(e.description,Ft(vt));e.width=e.wrap?vt.width:l.getMax(vt.width,a.width+2*vt.wrapPadding),e.height=e.wrap?l.getMax(a.height,vt.height):vt.height,r=l.getMax(r,e.height)}for(const s in e){const a=t.get(s);if(!a)continue;const r=t.get(a.nextActor);if(!r){const t=e[s]+vt.actorMargin-a.width/2;a.margin=l.getMax(t,vt.actorMargin);continue}const i=e[s]+vt.actorMargin-a.width/2-r.width/2;a.margin=l.getMax(i,vt.actorMargin)}let i=0;return a.forEach(e=>{const a=Vt(vt);let r=e.actorKeys.reduce((e,a)=>e+(t.get(a).width+(t.get(a).margin||0)),0);r+=8*vt.boxMargin,r-=2*vt.boxTextMargin,e.wrap&&(e.name=b.wrapLabel(e.name,r-2*vt.wrapPadding,a));const s=b.calculateTextDimensions(e.name,a);i=l.getMax(s.height,i);const n=l.getMax(r,s.width+2*vt.wrapPadding);if(e.margin=vt.boxTextMargin,r<n){const t=(n-r)/2;e.margin+=t}}),a.forEach(t=>t.textMaxHeight=i),l.getMax(r,vt.height)}a(ae,"calculateActorMargins");var re=a(async function(t,e,a){const r=e.get(t.from),i=e.get(t.to),o=r.x,c=i.x,d=t.wrap&&t.message;let h=m(t.message)?await I(t.message,s()):b.calculateTextDimensions(d?b.wrapLabel(t.message,vt.width,Wt(vt)):t.message,Wt(vt));const p={width:d?vt.width:l.getMax(vt.width,h.width+2*vt.noteMargin),height:0,startx:r.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===a.db.PLACEMENT.RIGHTOF?(p.width=d?l.getMax(vt.width,h.width):l.getMax(r.width/2+i.width/2,h.width+2*vt.noteMargin),p.startx=o+(r.width+vt.actorMargin)/2):t.placement===a.db.PLACEMENT.LEFTOF?(p.width=d?l.getMax(vt.width,h.width+2*vt.noteMargin):l.getMax(r.width/2+i.width/2,h.width+2*vt.noteMargin),p.startx=o-p.width+(r.width-vt.actorMargin)/2):t.to===t.from?(h=b.calculateTextDimensions(d?b.wrapLabel(t.message,l.getMax(vt.width,r.width),Wt(vt)):t.message,Wt(vt)),p.width=d?l.getMax(vt.width,r.width):l.getMax(r.width,vt.width,h.width+2*vt.noteMargin),p.startx=o+(r.width-p.width)/2):(p.width=Math.abs(o+r.width/2-(c+i.width/2))+vt.actorMargin,p.startx=o<c?o+r.width/2-vt.actorMargin/2:c+i.width/2-vt.actorMargin/2),d&&(p.message=b.wrapLabel(t.message,p.width-2*vt.wrapPadding,Wt(vt))),n.debug(`NM:[${p.startx},${p.stopx},${p.starty},${p.stopy}:${p.width},${p.height}=${t.message}]`),p},"buildNoteModel"),se=a(function(t,e){const{CENTRAL_CONNECTION:a,CENTRAL_CONNECTION_REVERSE:r,CENTRAL_CONNECTION_DUAL:s}=e.db.LINETYPE;return[a,r,s].includes(t.centralConnection)},"hasCentralConnection"),ie=a(function(t,e,a){const{CENTRAL_CONNECTION_REVERSE:r,CENTRAL_CONNECTION_DUAL:s,BIDIRECTIONAL_SOLID:i,BIDIRECTIONAL_DOTTED:n}=e.db.LINETYPE;let o=0;return t.centralConnection!==r&&t.centralConnection!==s||(o+=4),t.centralConnection!==r&&t.centralConnection!==s||t.type!==i&&t.type!==n||(o+=a?0:-6),o},"calculateCentralConnectionOffset"),ne=a(function(t,e){const{SOLID_ARROW_TOP_REVERSE:a,SOLID_ARROW_TOP_REVERSE_DOTTED:r,SOLID_ARROW_BOTTOM_REVERSE:s,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:i,STICK_ARROW_TOP_REVERSE:n,STICK_ARROW_TOP_REVERSE_DOTTED:o,STICK_ARROW_BOTTOM_REVERSE:c,STICK_ARROW_BOTTOM_REVERSE_DOTTED:d}=e.db.LINETYPE;return[a,r,s,i,n,o,c,d].includes(t.type)},"isReverseArrowType"),oe=a(function(t,e){const{BIDIRECTIONAL_SOLID:a,BIDIRECTIONAL_DOTTED:r}=e.db.LINETYPE;return[a,r].includes(t.type)},"isBidirectionalArrowType"),ce=a(function(t,e,r){const{look:i}=s();if(![r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.SOLID,r.db.LINETYPE.SOLID_TOP,r.db.LINETYPE.SOLID_BOTTOM,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.SOLID_TOP_DOTTED,r.db.LINETYPE.SOLID_BOTTOM_DOTTED,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,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(t.type))return{};const[n,o]=Xt(t.from,e),[c,d]=Xt(t.to,e),h=n<=c;let p=h?o:n,T=h?c:d;if("neo"===i){const e=3;t.type!==r.db.LINETYPE.SOLID_OPEN&&(T+=h?-e:e),t.type!==r.db.LINETYPE.BIDIRECTIONAL_SOLID&&t.type!==r.db.LINETYPE.BIDIRECTIONAL_DOTTED||(p+=h?e:-e)}p+=ie(t,r,h);const E=Math.abs(c-d)>2,g=a(t=>h?-t:t,"adjustValue");t.from===t.to?T=p:(t.activate&&!E&&(T+=g(vt.activationWidth/2-1)),[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)||(T+=g(3)),[r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)&&(p-=g(3)));const u=[n,o,c,d],O=Math.abs(p-T);t.wrap&&t.message&&(t.message=b.wrapLabel(t.message,l.getMax(O+2*vt.wrapPadding,vt.width),Vt(vt)));const _=b.calculateTextDimensions(t.message,Vt(vt));return{width:l.getMax(t.wrap?0:_.width+2*vt.wrapPadding,O+2*vt.wrapPadding,vt.width),height:0,startx:p,stopx:T,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,u),toBounds:Math.max.apply(null,u)}},"buildMessageModel"),de=a(async function(t,e,a,r){const s={},i=[];let o,c,d;for(const n of t){switch(n.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:n.id,msg:n.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:n.message&&(o=i.pop(),s[o.id]=o,s[n.id]=o,i.push(o));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:o=i.pop(),s[o.id]=o;break;case r.db.LINETYPE.ACTIVE_START:{const t=e.get(n.from?n.from:n.to.actor),a=Gt(n.from?n.from:n.to.actor).length,r=t.x+t.width/2+(a-1)*vt.activationWidth/2,s={startx:r,stopx:r+vt.activationWidth,actor:n.from,enabled:!0};Bt.activations.push(s)}break;case r.db.LINETYPE.ACTIVE_END:{const t=Bt.activations.map(t=>t.actor).lastIndexOf(n.from);Bt.activations.splice(t,1).splice(0,1)}}void 0!==n.placement?(c=await re(n,e,r),n.noteModel=c,i.forEach(t=>{o=t,o.from=l.getMin(o.from,c.startx),o.to=l.getMax(o.to,c.startx+c.width),o.width=l.getMax(o.width,Math.abs(o.from-o.to))-vt.labelBoxWidth})):(d=ce(n,e,r),n.msgModel=d,d.startx&&d.stopx&&i.length>0&&i.forEach(t=>{if(o=t,d.startx===d.stopx){const t=e.get(n.from),a=e.get(n.to);o.from=l.getMin(t.x-d.width/2,t.x-t.width/2,o.from),o.to=l.getMax(a.x+d.width/2,a.x+t.width/2,o.to),o.width=l.getMax(o.width,Math.abs(o.to-o.from))-vt.labelBoxWidth}else o.from=l.getMin(d.startx,o.from),o.to=l.getMax(d.stopx,o.to),o.width=l.getMax(o.width,d.width)-vt.labelBoxWidth}))}return Bt.activations=[],n.debug("Loop type widths:",s),s},"calculateLoopBounds"),le={bounds:Bt,drawActors:zt,drawActorsPopup:Ut,setConf:jt,draw:Qt},he={parser:v,get db(){return new q},renderer:le,styles:H,init:a(t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,r({sequence:{wrap:t.wrap}}))},"init")};export{he as diagram};
|
|
1
|
+
var t;import{I as e}from"./chunk-2Q5K7J3B-DlDecKcs.js";import{_ as a,X as r,c as s,d as i,l as n,j as o,e as c,f as d,k as l,b as h,s as p,o as T,a as E,g,p as u,Y as O,Z as _,q as y,i as x,y as b,$ as m,a0 as I,a1 as f,a2 as R,z as L,a3 as N,a4 as w}from"./mermaid.core-DQSlETG7.js";import{a as S,b as P,g as D,d as A,c as k,e as M}from"./chunk-32BRIVSS-BhpTBz4U.js";import"./index-AdB8XHXv.js";var C=function(){var t=a(function(t,e,a,r){for(a=a||{},r=t.length;r--;a[t[r]]=e);return a},"o"),e=[1,2],r=[1,3],s=[1,4],i=[2,4],n=[1,9],o=[1,11],c=[1,12],d=[1,14],l=[1,15],h=[1,17],p=[1,18],T=[1,19],E=[1,25],g=[1,26],u=[1,27],O=[1,28],_=[1,29],y=[1,30],x=[1,31],b=[1,32],m=[1,33],I=[1,34],f=[1,35],R=[1,36],L=[1,37],N=[1,38],w=[1,39],S=[1,40],P=[1,42],D=[1,43],A=[1,44],k=[1,45],M=[1,46],C=[1,47],v=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],B=[1,74],Y=[1,80],$=[1,81],V=[1,82],W=[1,83],F=[1,84],K=[1,85],q=[1,86],H=[1,87],z=[1,88],U=[1,89],j=[1,90],G=[1,91],X=[1,92],J=[1,93],Z=[1,94],Q=[1,95],tt=[1,96],et=[1,97],at=[1,98],rt=[1,99],st=[1,100],it=[1,101],nt=[1,102],ot=[1,103],ct=[1,104],dt=[1,105],lt=[2,78],ht=[4,5,17,51,53,54],pt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],Tt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],Et=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],gt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],ut=[5,52],Ot=[70,71,72,73],_t=[1,151],yt={trace:a(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:a(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 10:case 8:case 9:case 14:this.$=[];break;case 5:case 11:i[o-1].push(i[o]),this.$=i[o-1];break;case 6:case 7:case 12:case 13:case 67:this.$=i[o];break;case 16:i[o].type="createParticipant",this.$=i[o];break;case 17: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 19:this.$={type:"sequenceIndex",sequenceIndex:Number(i[o-2]),sequenceIndexStep:Number(i[o-1]),sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(i[o-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:r.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:r.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:r.LINETYPE.ACTIVE_START,actor:i[o-1].actor};break;case 24:this.$={type:"activeEnd",signalType:r.LINETYPE.ACTIVE_END,actor:i[o-1].actor};break;case 30:r.setDiagramTitle(i[o].substring(6)),this.$=i[o].substring(6);break;case 31:r.setDiagramTitle(i[o].substring(7)),this.$=i[o].substring(7);break;case 32:this.$=i[o].trim(),r.setAccTitle(this.$);break;case 33:case 34:this.$=i[o].trim(),r.setAccDescription(this.$);break;case 35: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 36: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 37: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 38: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 39: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 40: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 41: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 42: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 44:this.$=i[o-3].concat([{type:"option",optionText:r.parseMessage(i[o-1]),signalType:r.LINETYPE.CRITICAL_OPTION},i[o]]);break;case 46:this.$=i[o-3].concat([{type:"and",parText:r.parseMessage(i[o-1]),signalType:r.LINETYPE.PAR_AND},i[o]]);break;case 48:this.$=i[o-3].concat([{type:"else",altText:r.parseMessage(i[o-1]),signalType:r.LINETYPE.ALT_ELSE},i[o]]);break;case 49:case 54: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 50:case 55:i[o-1].draw="participant",i[o-1].type="addParticipant",this.$=i[o-1];break;case 51:case 56: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 52:case 57:i[o-1].draw="actor",i[o-1].type="addParticipant",this.$=i[o-1];break;case 53:i[o-1].type="destroyParticipant",this.$=i[o-1];break;case 58:this.$=[i[o-1],{type:"addNote",placement:i[o-2],actor:i[o-1].actor,text:i[o]}];break;case 59: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 60:this.$=[i[o-1],{type:"addLinks",actor:i[o-1].actor,text:i[o]}];break;case 61:this.$=[i[o-1],{type:"addALink",actor:i[o-1].actor,text:i[o]}];break;case 62:this.$=[i[o-1],{type:"addProperties",actor:i[o-1].actor,text:i[o]}];break;case 63:this.$=[i[o-1],{type:"addDetails",actor:i[o-1].actor,text:i[o]}];break;case 66:this.$=[i[o-2],i[o]];break;case 68:this.$=r.PLACEMENT.LEFTOF;break;case 69:this.$=r.PLACEMENT.RIGHTOF;break;case 70: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 71: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 72: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,centralConnection:r.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:i[o-1].actor}];break;case 73:this.$=[i[o-4],i[o-1],{type:"addMessage",from:i[o-4].actor,to:i[o-1].actor,signalType:i[o-2],msg:i[o],activate:!1,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:i[o-4].actor}];break;case 74:this.$=[i[o-5],i[o-1],{type:"addMessage",from:i[o-5].actor,to:i[o-1].actor,signalType:i[o-3],msg:i[o],activate:!0,centralConnection:r.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:r.LINETYPE.CENTRAL_CONNECTION,actor:i[o-1].actor},{type:"centralConnectionReverse",signalType:r.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:i[o-5].actor}];break;case 75: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 76:this.$={type:"addParticipant",actor:i[o-1],config:i[o]};break;case 77:this.$=i[o-1].trim();break;case 78:this.$={type:"addParticipant",actor:i[o]};break;case 79:this.$=r.LINETYPE.SOLID_OPEN;break;case 80:this.$=r.LINETYPE.DOTTED_OPEN;break;case 81:this.$=r.LINETYPE.SOLID;break;case 82:this.$=r.LINETYPE.SOLID_TOP;break;case 83:this.$=r.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=r.LINETYPE.STICK_TOP;break;case 85:this.$=r.LINETYPE.STICK_BOTTOM;break;case 86:this.$=r.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=r.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=r.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=r.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=r.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=r.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=r.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=r.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=r.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=r.LINETYPE.DOTTED;break;case 100:this.$=r.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=r.LINETYPE.SOLID_CROSS;break;case 102:this.$=r.LINETYPE.DOTTED_CROSS;break;case 103:this.$=r.LINETYPE.SOLID_POINT;break;case 104:this.$=r.LINETYPE.DOTTED_POINT;break;case 105:this.$=r.parseMessage(i[o].trim().substring(1))}},"anonymous"),table:[{3:1,4:e,5:r,6:s},{1:[3]},{3:5,4:e,5:r,6:s},{3:6,4:e,5:r,6:s},t([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:n,5:o,8:8,9:10,10:c,13:13,14:d,15:l,18:16,19:h,22:p,23:41,24:T,25:20,26:21,27:22,28:23,29:24,30:E,31:g,32:u,34:O,36:_,37:y,38:x,39:b,40:m,42:I,44:f,45:R,47:L,51:N,53:w,54:S,56:P,61:D,62:A,63:k,64:M,73:C},t(v,[2,5]),{9:48,13:13,14:d,15:l,18:16,19:h,22:p,23:41,24:T,25:20,26:21,27:22,28:23,29:24,30:E,31:g,32:u,34:O,36:_,37:y,38:x,39:b,40:m,42:I,44:f,45:R,47:L,51:N,53:w,54:S,56:P,61:D,62:A,63:k,64:M,73:C},t(v,[2,7]),t(v,[2,8]),t(v,[2,9]),t(v,[2,15]),{13:49,51:N,53:w,54:S},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:C},{23:56,73:C},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},t(v,[2,30]),t(v,[2,31]),{33:[1,62]},{35:[1,63]},t(v,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:B},{23:75,55:76,73:B},{23:77,73:C},{69:78,72:[1,79],78:Y,79:$,80:V,81:W,82:F,83:K,84:q,85:H,86:z,87:U,88:j,89:G,90:X,91:J,92:Z,93:Q,94:tt,95:et,96:at,97:rt,98:st,99:it,100:nt,101:ot,102:ct,103:dt},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:C},{23:111,73:C},{23:112,73:C},{23:113,73:C},t([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],lt),t(v,[2,6]),t(v,[2,16]),t(ht,[2,10],{11:114}),t(v,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},t(v,[2,22]),{5:[1,118]},{5:[1,119]},t(v,[2,25]),t(v,[2,26]),t(v,[2,27]),t(v,[2,28]),t(v,[2,29]),t(v,[2,32]),t(v,[2,33]),t(pt,i,{7:120}),t(pt,i,{7:121}),t(pt,i,{7:122}),t(Tt,i,{41:123,7:124}),t(Et,i,{43:125,7:126}),t(Et,i,{7:126,43:127}),t(gt,i,{46:128,7:129}),t(pt,i,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},t(ut,lt,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:C},{69:146,78:Y,79:$,80:V,81:W,82:F,83:K,84:q,85:H,86:z,87:U,88:j,89:G,90:X,91:J,92:Z,93:Q,94:tt,95:et,96:at,97:rt,98:st,99:it,100:nt,101:ot,102:ct,103:dt},t(Ot,[2,79]),t(Ot,[2,80]),t(Ot,[2,81]),t(Ot,[2,82]),t(Ot,[2,83]),t(Ot,[2,84]),t(Ot,[2,85]),t(Ot,[2,86]),t(Ot,[2,87]),t(Ot,[2,88]),t(Ot,[2,89]),t(Ot,[2,90]),t(Ot,[2,91]),t(Ot,[2,92]),t(Ot,[2,93]),t(Ot,[2,94]),t(Ot,[2,95]),t(Ot,[2,96]),t(Ot,[2,97]),t(Ot,[2,98]),t(Ot,[2,99]),t(Ot,[2,100]),t(Ot,[2,101]),t(Ot,[2,102]),t(Ot,[2,103]),t(Ot,[2,104]),{23:147,73:C},{23:149,60:148,73:C},{73:[2,68]},{73:[2,69]},{58:150,104:_t},{58:152,104:_t},{58:153,104:_t},{58:154,104:_t},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:N,53:w,54:S},{5:[1,160]},t(v,[2,20]),t(v,[2,21]),t(v,[2,23]),t(v,[2,24]),{4:n,5:o,8:8,9:10,10:c,13:13,14:d,15:l,17:[1,161],18:16,19:h,22:p,23:41,24:T,25:20,26:21,27:22,28:23,29:24,30:E,31:g,32:u,34:O,36:_,37:y,38:x,39:b,40:m,42:I,44:f,45:R,47:L,51:N,53:w,54:S,56:P,61:D,62:A,63:k,64:M,73:C},{4:n,5:o,8:8,9:10,10:c,13:13,14:d,15:l,17:[1,162],18:16,19:h,22:p,23:41,24:T,25:20,26:21,27:22,28:23,29:24,30:E,31:g,32:u,34:O,36:_,37:y,38:x,39:b,40:m,42:I,44:f,45:R,47:L,51:N,53:w,54:S,56:P,61:D,62:A,63:k,64:M,73:C},{4:n,5:o,8:8,9:10,10:c,13:13,14:d,15:l,17:[1,163],18:16,19:h,22:p,23:41,24:T,25:20,26:21,27:22,28:23,29:24,30:E,31:g,32:u,34:O,36:_,37:y,38:x,39:b,40:m,42:I,44:f,45:R,47:L,51:N,53:w,54:S,56:P,61:D,62:A,63:k,64:M,73:C},{17:[1,164]},{4:n,5:o,8:8,9:10,10:c,13:13,14:d,15:l,17:[2,47],18:16,19:h,22:p,23:41,24:T,25:20,26:21,27:22,28:23,29:24,30:E,31:g,32:u,34:O,36:_,37:y,38:x,39:b,40:m,42:I,44:f,45:R,47:L,50:[1,165],51:N,53:w,54:S,56:P,61:D,62:A,63:k,64:M,73:C},{17:[1,166]},{4:n,5:o,8:8,9:10,10:c,13:13,14:d,15:l,17:[2,45],18:16,19:h,22:p,23:41,24:T,25:20,26:21,27:22,28:23,29:24,30:E,31:g,32:u,34:O,36:_,37:y,38:x,39:b,40:m,42:I,44:f,45:R,47:L,49:[1,167],51:N,53:w,54:S,56:P,61:D,62:A,63:k,64:M,73:C},{17:[1,168]},{17:[1,169]},{4:n,5:o,8:8,9:10,10:c,13:13,14:d,15:l,17:[2,43],18:16,19:h,22:p,23:41,24:T,25:20,26:21,27:22,28:23,29:24,30:E,31:g,32:u,34:O,36:_,37:y,38:x,39:b,40:m,42:I,44:f,45:R,47:L,48:[1,170],51:N,53:w,54:S,56:P,61:D,62:A,63:k,64:M,73:C},{4:n,5:o,8:8,9:10,10:c,13:13,14:d,15:l,17:[1,171],18:16,19:h,22:p,23:41,24:T,25:20,26:21,27:22,28:23,29:24,30:E,31:g,32:u,34:O,36:_,37:y,38:x,39:b,40:m,42:I,44:f,45:R,47:L,51:N,53:w,54:S,56:P,61:D,62:A,63:k,64:M,73:C},{16:[1,172]},t(v,[2,50]),{16:[1,173]},t(v,[2,55]),t(ut,[2,76]),{76:[1,174]},{16:[1,175]},t(v,[2,52]),{16:[1,176]},t(v,[2,57]),t(v,[2,53]),{23:177,73:C},{23:178,73:C},{23:179,73:C},{58:180,104:_t},{23:181,72:[1,182],73:C},{58:183,104:_t},{58:184,104:_t},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},t(v,[2,17]),t(ht,[2,11]),{13:186,51:N,53:w,54:S},t(ht,[2,13]),t(ht,[2,14]),t(v,[2,19]),t(v,[2,35]),t(v,[2,36]),t(v,[2,37]),t(v,[2,38]),{16:[1,187]},t(v,[2,39]),{16:[1,188]},t(v,[2,40]),t(v,[2,41]),{16:[1,189]},t(v,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:_t},{58:196,104:_t},{58:197,104:_t},{5:[2,75]},{58:198,104:_t},{23:199,73:C},{5:[2,58]},{5:[2,59]},{23:200,73:C},t(ht,[2,12]),t(Tt,i,{7:124,41:201}),t(Et,i,{7:126,43:202}),t(gt,i,{7:129,46:203}),t(v,[2,49]),t(v,[2,54]),t(ut,[2,77]),t(v,[2,51]),t(v,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:_t},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:a(function(t,e){if(!e.recoverable){var a=new Error(t);throw a.hash=e,a}this.trace(t)},"parseError"),parse:a(function(t){var e=this,r=[0],s=[],i=[null],n=[],o=this.table,c="",d=0,l=0,h=n.slice.call(arguments,1),p=Object.create(this.lexer),T={yy:{}};for(var E in this.yy)Object.prototype.hasOwnProperty.call(this.yy,E)&&(T.yy[E]=this.yy[E]);p.setInput(t,T.yy),T.yy.lexer=p,T.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var g=p.yylloc;n.push(g);var u=p.options&&p.options.ranges;function O(){var t;return"number"!=typeof(t=s.pop()||p.lex()||1)&&(t instanceof Array&&(t=(s=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof T.yy.parseError?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,a(function(t){r.length=r.length-2*t,i.length=i.length-t,n.length=n.length-t},"popStack"),a(O,"lex");for(var _,y,x,b,m,I,f,R,L={};;){if(y=r[r.length-1],this.defaultActions[y]?x=this.defaultActions[y]:(null==_&&(_=O()),x=o[y]&&o[y][_]),void 0===x||!x.length||!x[0]){var N="";for(m in R=[],o[y])this.terminals_[m]&&m>2&&R.push("'"+this.terminals_[m]+"'");N=p.showPosition?"Parse error on line "+(d+1)+":\n"+p.showPosition()+"\nExpecting "+R.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(d+1)+": Unexpected "+(1==_?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(N,{text:p.match,token:this.terminals_[_]||_,line:p.yylineno,loc:g,expected:R})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+y+", token: "+_);switch(x[0]){case 1:r.push(_),i.push(p.yytext),n.push(p.yylloc),r.push(x[1]),_=null,l=p.yyleng,c=p.yytext,d=p.yylineno,g=p.yylloc;break;case 2:if(I=this.productions_[x[1]][1],L.$=i[i.length-I],L._$={first_line:n[n.length-(I||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(I||1)].first_column,last_column:n[n.length-1].last_column},u&&(L._$.range=[n[n.length-(I||1)].range[0],n[n.length-1].range[1]]),void 0!==(b=this.performAction.apply(L,[c,l,d,T.yy,x[1],i,n].concat(h))))return b;I&&(r=r.slice(0,-1*I*2),i=i.slice(0,-1*I),n=n.slice(0,-1*I)),r.push(this.productions_[x[1]][0]),i.push(L.$),n.push(L._$),f=o[r[r.length-2]][r[r.length-1]],r.push(f);break;case 3:return!0}}return!0},"parse")},xt=function(){return{EOF:1,parseError:a(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:a(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:a(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:a(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:a(function(){return this._more=!0,this},"more"),reject:a(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:a(function(t){this.unput(this.match.slice(t))},"less"),pastInput:a(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:a(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:a(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:a(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:a(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:a(function(){var t=this.next();return t||this.lex()},"lex"),begin:a(function(t){this.conditionStack.push(t)},"begin"),popState:a(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:a(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:a(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:a(function(t){this.begin(t)},"pushState"),stateStackSize:a(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:a(function(t,e,a,r){switch(a){case 0:case 59:case 92:return 5;case 1:case 2:case 3:case 4:case 5:break;case 6:return 20;case 7:return this.begin("CONFIG"),75;case 8:return 76;case 9:return this.popState(),this.begin("ALIAS"),77;case 10:return this.popState(),this.popState(),77;case 11:case 60:return e.yytext=e.yytext.trim(),73;case 12:return e.yytext=e.yytext.trim(),this.begin("ALIAS"),73;case 13:return e.yytext=e.yytext.trim(),this.popState(),73;case 14:return this.popState(),10;case 15:return e.yytext=e.yytext.trim(),this.popState(),10;case 16:return this.begin("LINE"),15;case 17:return this.begin("ID"),51;case 18:return this.begin("ID"),53;case 19:return 14;case 20:return this.begin("ID"),54;case 21:return this.popState(),this.popState(),this.begin("LINE"),52;case 22:return this.popState(),this.popState(),5;case 23:return this.begin("LINE"),37;case 24:return this.begin("LINE"),38;case 25:return this.begin("LINE"),39;case 26:return this.begin("LINE"),40;case 27:return this.begin("LINE"),50;case 28:return this.begin("LINE"),42;case 29:return this.begin("LINE"),44;case 30:return this.begin("LINE"),49;case 31:return this.begin("LINE"),45;case 32:return this.begin("LINE"),48;case 33:return this.begin("LINE"),47;case 34:return this.popState(),16;case 35:return 17;case 36:return 67;case 37:return 68;case 38:return 61;case 39:return 62;case 40:return 63;case 41:return 64;case 42:return 59;case 43:return 56;case 44:return this.begin("ID"),22;case 45:return this.begin("ID"),24;case 46:return 30;case 47:return 31;case 48:return this.begin("acc_title"),32;case 49:return this.popState(),"acc_title_value";case 50:return this.begin("acc_descr"),34;case 51:return this.popState(),"acc_descr_value";case 52:this.begin("acc_descr_multiline");break;case 53:this.popState();break;case 54:return"acc_descr_multiline_value";case 55:return 6;case 56:return 19;case 57:return 21;case 58:return 66;case 61:return 80;case 62:return 97;case 63:return 98;case 64:return 99;case 65:return 78;case 66:return 79;case 67:return 100;case 68:return 101;case 69:return 102;case 70:return 103;case 71:return 85;case 72:return 86;case 73:return 87;case 74:return 88;case 75:return 93;case 76:return 94;case 77:return 95;case 78:return 96;case 79:return 81;case 80:return 82;case 81:return 83;case 82:return 84;case 83:return 89;case 84:return 90;case 85:return 91;case 86:return 92;case 87:case 88:return 104;case 89:return 70;case 90:return 71;case 91:return 72;case 93:return 10}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:([0-9]+(\.[0-9]{1,2})?|\.[0-9]{1,2})(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\}(?=\s+as\s))/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i,/^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i,/^(?:[^<>:\n,;@]*<[^\n]*)/i,/^(?:[^\n]+)/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\/\\\+\()\+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)|-\|\\|-\\|-\/|-\/\/|-\|\/|\/\|-|\\\|-|\/\/-|\\\\-|\/\|-|--\|\\|--|\(\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?:--\|\\)/i,/^(?:--\|\/)/i,/^(?:--\\\\)/i,/^(?:--\/\/)/i,/^(?:\/\|--)/i,/^(?:\\\|--)/i,/^(?:\/\/--)/i,/^(?:\\\\--)/i,/^(?:-\|\\)/i,/^(?:-\|\/)/i,/^(?:-\\\\)/i,/^(?:-\/\/)/i,/^(?:\/\|-)/i,/^(?:\\\|-)/i,/^(?:\/\/-)/i,/^(?:\\\\-)/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:\(\))/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[53,54],inclusive:!1},acc_descr:{rules:[51],inclusive:!1},acc_title:{rules:[49],inclusive:!1},ID:{rules:[2,3,7,11,12,13,14,15],inclusive:!1},ALIAS:{rules:[2,3,21,22],inclusive:!1},LINE:{rules:[2,3,34],inclusive:!1},CONFIG:{rules:[8,9,10],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,16,17,18,19,20,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,50,52,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93],inclusive:!0}}}}();function bt(){this.yy={}}return yt.lexer=xt,a(bt,"Parser"),bt.prototype=yt,yt.Parser=bt,new bt}();C.parser=C;var v=C,B={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34,SOLID_TOP:41,SOLID_BOTTOM:42,STICK_TOP:43,STICK_BOTTOM:44,SOLID_ARROW_TOP_REVERSE:45,SOLID_ARROW_BOTTOM_REVERSE:46,STICK_ARROW_TOP_REVERSE:47,STICK_ARROW_BOTTOM_REVERSE:48,SOLID_TOP_DOTTED:51,SOLID_BOTTOM_DOTTED:52,STICK_TOP_DOTTED:53,STICK_BOTTOM_DOTTED:54,SOLID_ARROW_TOP_REVERSE_DOTTED:55,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:56,STICK_ARROW_TOP_REVERSE_DOTTED:57,STICK_ARROW_BOTTOM_REVERSE_DOTTED:58,CENTRAL_CONNECTION:59,CENTRAL_CONNECTION_REVERSE:60,CENTRAL_CONNECTION_DUAL:61},Y={FILLED:0,OPEN:1},$={LEFTOF:0,RIGHTOF:1,OVER:2},V="actor",W="control",F="database",K="entity",q=(a(t=class{constructor(){this.state=new e(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=h,this.setAccDescription=p,this.setDiagramTitle=T,this.getAccTitle=E,this.getAccDescription=g,this.getDiagramTitle=u,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(s().wrap),this.LINETYPE=B,this.ARROWTYPE=Y,this.PLACEMENT=$}addBox(t){this.state.records.boxes.push({name:t.text,wrap:t.wrap??this.autoWrap(),fill:t.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(t,e,a,r,s){let i,n=this.state.records.currentBox;if(void 0!==s){let t;t=s.includes("\n")?s+"\n":"{\n"+s+"\n}",i=O(t,{schema:_})}r=(null==i?void 0:i.type)??r,!(null==i?void 0:i.alias)||a&&a.text!==e||(a={text:i.alias,wrap:null==a?void 0:a.wrap,type:r});const o=this.state.records.actors.get(t);if(o){if(this.state.records.currentBox&&o.box&&this.state.records.currentBox!==o.box)throw new Error(`A same participant should only be defined in one Box: ${o.name} can't be in '${o.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(n=o.box?o.box:this.state.records.currentBox,o.box=n,o&&e===o.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}),this.state.records.actors.set(t,{box:n,name:e,description:a.text,wrap:a.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:r??"participant"}),this.state.records.prevActor){const e=this.state.records.actors.get(this.state.records.prevActor);e&&(e.nextActor=t)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(t),this.state.records.prevActor=t}activationCount(t){let e,a=0;if(!t)return 0;for(e=0;e<this.state.records.messages.length;e++)this.state.records.messages[e].type===this.LINETYPE.ACTIVE_START&&this.state.records.messages[e].from===t&&a++,this.state.records.messages[e].type===this.LINETYPE.ACTIVE_END&&this.state.records.messages[e].from===t&&a--;return a}addMessage(t,e,a,r){this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:e,message:a.text,wrap:a.wrap??this.autoWrap(),answer:r})}addSignal(t,e,a,r,s=!1,i){if(r===this.LINETYPE.ACTIVE_END){if(this.activationCount(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 this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:e,message:(null==a?void 0:a.text)??"",wrap:(null==a?void 0:a.wrap)??this.autoWrap(),type:r,activate:s,centralConnection:i??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(t=>t.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(t){return this.state.records.actors.get(t)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(t){this.state.records.wrapEnabled=t}extractWrap(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}}autoWrap(){var t;return void 0!==this.state.records.wrapEnabled?this.state.records.wrapEnabled:(null==(t=s().sequence)?void 0:t.wrap)??!1}clear(){this.state.reset(),y()}parseMessage(t){const e=t.trim(),{wrap:a,cleanedText:r}=this.extractWrap(e),s={text:r,wrap:a};return n.debug(`parseMessage: ${JSON.stringify(s)}`),s}parseBoxData(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:i,cleanedText:n}=this.extractWrap(r);return{text:n?x(n,s()):void 0,color:a,wrap:i}}addNote(t,e,a){const r={actor:t,placement:e,message:a.text,wrap:a.wrap??this.autoWrap()},s=[].concat(t,t);this.state.records.notes.push(r),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:s[0],to:s[1],message:a.text,wrap:a.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:e})}addLinks(t,e){const a=this.getActor(t);try{let t=x(e.text,s());t=t.replace(/=/g,"="),t=t.replace(/&/g,"&");const r=JSON.parse(t);this.insertLinks(a,r)}catch(r){n.error("error while parsing actor link text",r)}}addALink(t,e){const a=this.getActor(t);try{const t={};let r=x(e.text,s());const i=r.indexOf("@");r=r.replace(/=/g,"="),r=r.replace(/&/g,"&");const n=r.slice(0,i-1).trim(),o=r.slice(i+1).trim();t[n]=o,this.insertLinks(a,t)}catch(r){n.error("error while parsing actor link text",r)}}insertLinks(t,e){if(null==t.links)t.links=e;else for(const a in e)t.links[a]=e[a]}addProperties(t,e){const a=this.getActor(t);try{const t=x(e.text,s()),r=JSON.parse(t);this.insertProperties(a,r)}catch(r){n.error("error while parsing actor properties text",r)}}insertProperties(t,e){if(null==t.properties)t.properties=e;else for(const a in e)t.properties[a]=e[a]}boxEnd(){this.state.records.currentBox=void 0}addDetails(t,e){const a=this.getActor(t),r=document.getElementById(e.text);try{const t=r.innerHTML,e=JSON.parse(t);e.properties&&this.insertProperties(a,e.properties),e.links&&this.insertLinks(a,e.links)}catch(s){n.error("error while parsing actor details text",s)}}getActorProperty(t,e){if(void 0!==(null==t?void 0:t.properties))return t.properties[e]}apply(t){if(Array.isArray(t))t.forEach(t=>{this.apply(t)});else switch(t.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:t.sequenceIndex,step:t.sequenceIndexStep,visible:t.sequenceVisible},wrap:!1,type:t.signalType});break;case"addParticipant":this.addActor(t.actor,t.actor,t.description,t.draw,t.config);break;case"createParticipant":if(this.state.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");this.state.records.lastCreated=t.actor,this.addActor(t.actor,t.actor,t.description,t.draw,t.config),this.state.records.createdActors.set(t.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=t.actor,this.state.records.destroyedActors.set(t.actor,this.state.records.messages.length);break;case"activeStart":case"centralConnection":case"centralConnectionReverse":case"activeEnd":this.addSignal(t.actor,void 0,void 0,t.signalType);break;case"addNote":this.addNote(t.actor,t.placement,t.text);break;case"addLinks":this.addLinks(t.actor,t.text);break;case"addALink":this.addALink(t.actor,t.text);break;case"addProperties":this.addProperties(t.actor,t.text);break;case"addDetails":this.addDetails(t.actor,t.text);break;case"addMessage":if(this.state.records.lastCreated){if(t.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(t.to!==this.state.records.lastDestroyed&&t.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(t.from,t.to,t.msg,t.signalType,t.activate,t.centralConnection);break;case"boxStart":this.addBox(t.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":case"rectEnd":case"optEnd":case"altEnd":case"parEnd":case"criticalEnd":case"breakEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"rectStart":this.addSignal(void 0,void 0,t.color,t.signalType);break;case"optStart":this.addSignal(void 0,void 0,t.optText,t.signalType);break;case"altStart":case"else":this.addSignal(void 0,void 0,t.altText,t.signalType);break;case"setAccTitle":h(t.text);break;case"parStart":case"and":this.addSignal(void 0,void 0,t.parText,t.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,t.criticalText,t.signalType);break;case"option":this.addSignal(void 0,void 0,t.optionText,t.signalType);break;case"breakStart":this.addSignal(void 0,void 0,t.breakText,t.signalType)}}getConfig(){return s().sequence}},"SequenceDB"),t),H=a(t=>{const e=t.dropShadow??"none",{look:a}=s();return`.actor {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n stroke-width: ${t.strokeWidth??1};\n }\n\n rect.actor.outer-path[data-look="neo"] {\n filter: ${e};\n }\n\n rect.note[data-look="neo"] {\n stroke:${t.noteBorderColor};\n fill:${t.noteBkgColor};\n filter: ${e};\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 .innerArc {\n stroke-width: 1.5;\n stroke-dasharray: none;\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 [id$="-arrowhead"] path {\n fill: ${t.signalColor};\n stroke: ${t.signalColor};\n }\n\n .sequenceNumber {\n fill: ${t.sequenceNumberColor};\n }\n\n [id$="-sequencenumber"] {\n fill: ${t.signalColor};\n }\n\n [id$="-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 filter: ${"neo"===a?e:"none"};\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 .sectionTitle, .sectionTitle > 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 ${t.noteFontWeight?`font-weight: ${t.noteFontWeight};`:""}\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 circle, line {\n fill: ${t.actorBkg};\n stroke-width: 2px;\n }\n\n g rect.rect {\n filter: ${e};\n stroke: ${t.nodeBorder};\n }\n`},"getStyles"),z="actor-top",U="actor-bottom",j="actor-box",G="actor-man",X=new Set(["redux-color","redux-dark-color"]),J=a(function(t,e){const a=A(t,e);return"neo"===L().look&&a.attr("data-look","neo"),a},"drawRect"),Z=a(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,c=e.rectData;var d="none";s&&(d="block !important");const l=t.append("g");l.attr("id","actor"+n+"_popup"),l.attr("class","actorPopupMenu"),l.attr("display",d);var h="";void 0!==c.class&&(h=" "+c.class);let p=c.width>a?c.width:a;const T=l.append("rect");if(T.attr("class","actorPopupMenuPanel"+h),T.attr("x",c.x),T.attr("y",c.height),T.attr("fill",c.fill),T.attr("stroke",c.stroke),T.attr("width",p),T.attr("height",c.height),T.attr("rx",c.rx),T.attr("ry",c.ry),null!=i){var E=20;for(let t in i){var g=l.append("a"),u=o.sanitizeUrl(i[t]);g.attr("xlink:href",u),g.attr("target","_blank"),Pt(r)(t,g,c.x+10,c.height+E,p,20,{class:"actor"},r),E+=30}}return T.attr("height",E),{height:c.height+E,width:p}},"drawPopup"),Q=a(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),tt=a(async function(t,e,a=null){let r=t.append("foreignObject");const s=await w(e.text,L()),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"),et=a(function(t,e){let r=0,s=0;const i=e.text.split(l.lineBreakRegex),[n,o]=f(e.fontSize);let c=[],d=0,h=a(()=>e.y,"yfunc");if(void 0!==e.valign&&void 0!==e.textMargin&&e.textMargin>0)switch(e.valign){case"top":case"start":h=a(()=>Math.round(e.y+e.textMargin),"yfunc");break;case"middle":case"center":h=a(()=>Math.round(e.y+(r+s+e.textMargin)/2),"yfunc");break;case"bottom":case"end":h=a(()=>Math.round(e.y+(r+s+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[a,l]of i.entries()){void 0!==e.textMargin&&0===e.textMargin&&void 0!==n&&(d=a*n);const i=t.append("text");i.attr("x",e.x),i.attr("y",h()),void 0!==e.anchor&&i.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),void 0!==e.fontFamily&&i.style("font-family",e.fontFamily),void 0!==o&&i.style("font-size",o),void 0!==e.fontWeight&&i.style("font-weight",e.fontWeight),void 0!==e.fill&&i.attr("fill",e.fill),void 0!==e.class&&i.attr("class",e.class),void 0!==e.dy?i.attr("dy",e.dy):0!==d&&i.attr("dy",d);const p=l||R;if(e.tspan){const t=i.append("tspan");t.attr("x",e.x),void 0!==e.fill&&t.attr("fill",e.fill),t.text(p)}else i.text(p);void 0!==e.valign&&void 0!==e.textMargin&&e.textMargin>0&&(s+=(i._groups||i)[0][0].getBBox().height,r=s),c.push(i)}return c},"drawText"),at=a(function(t,e){function r(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)}a(r,"genPoints");const s=t.append("polygon");return s.attr("points",r(e.x,e.y,e.width,e.height,7)),s.attr("class","labelBox"),e.y=e.y+e.height/2,et(t,e),s},"drawLabel"),rt=-1,st=a((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"),it=a(function(t,e,a,r,s){var i,n;const o=r?e.stopy:e.starty,c=e.x+e.width/2,d=o+e.height,{look:l,theme:h,themeVariables:p}=a,{bkgColorArray:T,borderColorArray:E}=p,g=t.append("g").lower();var u=g;r||(rt++,Object.keys(e.links||{}).length&&!a.forceMenus&&u.attr("onclick",Q(`actor${rt}_popup`)).attr("cursor","pointer"),u.append("line").attr("id","actor"+rt).attr("x1",c).attr("y1",d).attr("x2",c).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),u=g.append("g"),e.actorCnt=rt,null!=e.links&&u.attr("id","root-"+rt),"neo"===l&&u.attr("data-look","neo"));const O=D();var _="actor";(null==(i=e.properties)?void 0:i.class)?_=e.properties.class:O.fill="#eaeaea",_+=r?` ${U}`:` ${z}`,O.x=e.x,O.y=o,O.width=e.width,O.height=e.height,O.class=_,O.rx=3,O.ry=3,O.name=e.name,"neo"===l&&(O.rx=6,O.ry=6);const y=J(u,O),x=s.get(e.name)??0;if(X.has(h)&&(y.style("stroke",E[x%E.length]),y.style("fill",T[x%E.length])),"neo"===l&&y.attr("filter","url(#drop-shadow)"),e.rectData=O,null==(n=e.properties)?void 0:n.icon){const t=e.properties.icon.trim();"@"===t.charAt(0)?k(u,O.x+O.width-20,O.y+10,t.substr(1)):M(u,O.x+O.width-20,O.y+10,t)}r||(u.attr("data-et","participant"),u.attr("data-type","participant"),u.attr("data-id",e.name)),St(a,m(e.description))(e.description,u,O.x,O.y,O.width,O.height,{class:`actor ${j}`},a);let b=e.height;if(y.node){const t=y.node().getBBox();e.height=t.height,b=t.height}return b},"drawActorTypeParticipant"),nt=a(function(t,e,a,r,s){var i,n;const o=r?e.stopy:e.starty,c=e.x+e.width/2,d=o+e.height,{look:l,theme:h,themeVariables:p}=a,{bkgColorArray:T,borderColorArray:E}=p,g=t.append("g").lower();var u=g;r||(rt++,Object.keys(e.links||{}).length&&!a.forceMenus&&u.attr("onclick",Q(`actor${rt}_popup`)).attr("cursor","pointer"),u.append("line").attr("id","actor"+rt).attr("x1",c).attr("y1",d).attr("x2",c).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),u=g.append("g"),e.actorCnt=rt,null!=e.links&&u.attr("id","root-"+rt),"neo"===l&&u.attr("data-look","neo"));const O=D();var _="actor";(null==(i=e.properties)?void 0:i.class)?_=e.properties.class:O.fill="#eaeaea",_+=r?` ${U}`:` ${z}`,O.x=e.x,O.y=o,O.width=e.width,O.height=e.height,O.class=_,O.name=e.name;const y={...O,x:O.x+-6,y:O.y+6,class:"actor"},x=J(u,O),b=J(u,y);e.rectData=O,"neo"===l&&u.attr("filter","url(#drop-shadow)");const I=s.get(e.name)??0;if(X.has(h)&&(x.style("stroke",E[I%E.length]),x.style("fill",T[I%E.length]),b.style("stroke",E[I%E.length]),b.style("fill",T[I%E.length])),null==(n=e.properties)?void 0:n.icon){const t=e.properties.icon.trim();"@"===t.charAt(0)?k(u,O.x+O.width-20,O.y+10,t.substr(1)):M(u,O.x+O.width-20,O.y+10,t)}St(a,m(e.description))(e.description,u,O.x-6,O.y+6,O.width,O.height,{class:`actor ${j}`},a);let f=e.height;if(x.node){const t=x.node().getBBox();e.height=t.height,f=t.height}return r||(u.attr("data-et","participant"),u.attr("data-type","collections"),u.attr("data-id",e.name)),f},"drawActorTypeCollections"),ot=a(function(t,e,a,r,s){var i,n;const o=r?e.stopy:e.starty,c=e.x+e.width/2,d=o+e.height,{look:l,theme:h,themeVariables:p}=a,{bkgColorArray:T,borderColorArray:E}=p,g=t.append("g").lower();let u=g;r||(rt++,Object.keys(e.links||{}).length&&!a.forceMenus&&u.attr("onclick",Q(`actor${rt}_popup`)).attr("cursor","pointer"),u.append("line").attr("id","actor"+rt).attr("x1",c).attr("y1",d).attr("x2",c).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),u=g.append("g"),e.actorCnt=rt,null!=e.links&&u.attr("id","root-"+rt),"neo"===l&&u.attr("data-look","neo"));const O=D();let _="actor";(null==(i=e.properties)?void 0:i.class)?_=e.properties.class:O.fill="#eaeaea",_+=r?` ${U}`:` ${z}`,u.attr("class",_),O.x=e.x,O.y=o,O.width=e.width,O.height=e.height,O.name=e.name;const y=O.height/2,x=y/(2.5+O.height/50),b=u.append("g"),I=u.append("g"),f=`M ${O.x},${O.y+y}\n a ${x},${y} 0 0 0 0,${O.height}\n h ${O.width-2*x}\n a ${x},${y} 0 0 0 0,-${O.height}\n Z\n `;b.append("path").attr("d",f),I.append("path").attr("d",`M ${O.x},${O.y+y}\n a ${x},${y} 0 0 0 0,${O.height}`),b.attr("transform",`translate(${x}, ${-O.height/2})`),I.attr("transform",`translate(${O.width-x}, ${-O.height/2})`),e.rectData=O,"neo"===l&&b.attr("filter","url(#drop-shadow)");const R=s.get(e.name)??0;if(X.has(h)&&(b.style("stroke",E[R%E.length]),b.style("fill",T[R%E.length]),I.style("stroke",E[R%E.length]),I.style("fill",T[R%E.length])),null==(n=e.properties)?void 0:n.icon){const t=e.properties.icon.trim(),a=O.x+O.width-20,r=O.y+10;"@"===t.charAt(0)?k(u,a,r,t.substr(1)):M(u,a,r,t)}St(a,m(e.description))(e.description,u,O.x,O.y,O.width,O.height,{class:`actor ${j}`},a);let L=e.height;const N=b.select("path:last-child");if(N.node()){const t=N.node().getBBox();e.height=t.height,L=t.height}return r||(u.attr("data-et","participant"),u.attr("data-type","queue"),u.attr("data-id",e.name)),L},"drawActorTypeQueue"),ct=a(function(t,e,a,r,s,i){var n;const o=r?e.stopy:e.starty,c=e.x+e.width/2,d=o+75,{look:l,theme:h,themeVariables:p}=a,{bkgColorArray:T,borderColorArray:E,actorBorder:g,actorBkg:u}=p,O=t.append("g").lower();r||(rt++,O.append("line").attr("id","actor"+rt).attr("x1",c).attr("y1",d).attr("x2",c).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=rt);const _=t.append("g");let y=G;y+=r?` ${U}`:` ${z}`,_.attr("class",y),_.attr("name",e.name);const x=D();x.x=e.x,x.y=o,x.fill="#eaeaea",x.width=e.width,x.height=e.height,x.class="actor";const b=e.x+e.width/2,I=o+32;_.append("defs").append("marker").attr("id",s+"-filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").attr("stroke-width",1.2).append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),_.append("circle").attr("cx",b).attr("cy",I).attr("r",22).attr("filter",""+("neo"===l?"url(#drop-shadow)":"")),_.append("line").attr("marker-end","url(#"+s+"-filled-head-control)").attr("transform",`translate(${b}, ${I-22})`);const f=i.get(e.name)??0;X.has(h)?(_.style("stroke",E[f%E.length]),_.style("fill",T[f%E.length])):(_.style("stroke",g),_.style("fill",u));const R=_.node().getBBox();return e.height=R.height+2*((null==(n=null==a?void 0:a.sequence)?void 0:n.labelBoxHeight)??0),St(a,m(e.description))(e.description,_,x.x,x.y+22+(r?5:12),x.width,x.height,{class:`actor ${G}`},a),r||(_.attr("data-et","participant"),_.attr("data-type","control"),_.attr("data-id",e.name)),e.height},"drawActorTypeControl"),dt=a(function(t,e,a,r,s){var i;const n=r?e.stopy:e.starty,o=e.x+e.width/2,c=n+75,{look:d,theme:l,themeVariables:h}=a,{bkgColorArray:p,borderColorArray:T}=h,E=t.append("g").lower(),g=t.append("g");let u="actor";u+=r?` ${U}`:` ${z}`,g.attr("class",u),g.attr("name",e.name);const O=D();O.x=e.x,O.y=n,O.fill="#eaeaea",O.width=e.width,O.height=e.height,O.class="actor";const _=e.x+e.width/2,y=n+(r?10:25),x=22;g.append("circle").attr("cx",_).attr("cy",y).attr("r",x).attr("width",e.width).attr("height",e.height),g.append("line").attr("x1",_-x).attr("x2",_+x).attr("y1",y+x).attr("y2",y+x).attr("stroke-width",2),"neo"===d&&g.attr("filter","url(#drop-shadow)");const b=s.get(e.name)??0;X.has(l)&&(g.style("stroke",T[b%T.length]),g.style("fill",p[b%T.length]));const I=g.node().getBBox();return e.height=I.height+((null==(i=null==a?void 0:a.sequence)?void 0:i.labelBoxHeight)??0),r||(rt++,E.append("line").attr("id","actor"+rt).attr("x1",o).attr("y1",c).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=rt),St(a,m(e.description))(e.description,g,O.x,O.y+(r?15:30),O.width,O.height,{class:`actor ${G}`},a),r?g.attr("transform","translate(0, 22)"):(g.attr("transform","translate(0, 6)"),g.attr("data-et","participant"),g.attr("data-type","entity"),g.attr("data-id",e.name)),e.height},"drawActorTypeEntity"),lt=a(function(t,e,a,r,s){var i;const n=r?e.stopy:e.starty,o=e.x+e.width/2,c=n+e.height+2*a.boxTextMargin,{theme:d,themeVariables:l,look:h}=a,{bkgColorArray:p,borderColorArray:T,actorBorder:E}=l,g=t.append("g").lower();let u=g;r||(rt++,Object.keys(e.links||{}).length&&!a.forceMenus&&u.attr("onclick",Q(`actor${rt}_popup`)).attr("cursor","pointer"),u.append("line").attr("id","actor"+rt).attr("x1",o).attr("y1",c).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name).attr("data-et","life-line").attr("data-id",e.name),u=g.append("g"),e.actorCnt=rt,null!=e.links&&u.attr("id","root-"+rt),"neo"===h&&u.attr("data-look","neo"));const O=D();let _="actor";(null==(i=e.properties)?void 0:i.class)?_=e.properties.class:O.fill="#eaeaea",_+=r?` ${U}`:` ${z}`,O.x=e.x,O.y=n,O.width=e.width,O.height=e.height,O.class=_,O.name=e.name,O.x=e.x,O.y=n;const y=O.width/3,x=O.width/3,b=y/2,I=b/(2.5+y/50),f=u.append("g");f.attr("class",_);const R=`\n M ${O.x},${O.y+I}\n a ${b},${I} 0 0 0 ${y},0\n a ${b},${I} 0 0 0 -${y},0\n l 0,${x-2*I}\n a ${b},${I} 0 0 0 ${y},0\n l 0,-${x-2*I}\n`;f.append("path").attr("d",R),"neo"===h&&f.attr("filter","url(#drop-shadow)");const L=s.get(e.name)??0;X.has(d)?(f.style("stroke",T[L%T.length]),f.style("fill",p[L%T.length])):f.style("stroke",E),f.attr("transform",`translate(${y}, ${I})`),e.rectData=O,St(a,m(e.description))(e.description,u,O.x,O.y+35,O.width,O.height,{class:`actor ${j}`},a);const N=f.select("path:last-child");if(N.node()){const t=N.node().getBBox();e.height=t.height+(a.sequence.labelBoxHeight??0)}return r||(u.attr("data-et","participant"),u.attr("data-type","database"),u.attr("data-id",e.name)),e.height},"drawActorTypeDatabase"),ht=a(function(t,e,a,r,s){const i=r?e.stopy:e.starty,n=e.x+e.width/2,o=i+80,c=t.append("g").lower(),{look:d,theme:l,themeVariables:h}=a,{bkgColorArray:p,borderColorArray:T,actorBorder:E}=h;r||(rt++,c.append("line").attr("id","actor"+rt).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).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=rt);const g=t.append("g");let u=G;u+=r?` ${U}`:` ${z}`,g.attr("class",u),g.attr("name",e.name);const O=D();O.x=e.x,O.y=i,O.fill="#eaeaea",O.width=e.width,O.height=e.height,O.class="actor",g.append("line").attr("id","actor-man-torso"+rt).attr("x1",e.x+e.width/2-55).attr("y1",i+12).attr("x2",e.x+e.width/2-15).attr("y2",i+12),g.append("line").attr("id","actor-man-arms"+rt).attr("x1",e.x+e.width/2-55).attr("y1",i+2).attr("x2",e.x+e.width/2-55).attr("y2",i+22),g.append("circle").attr("cx",e.x+e.width/2).attr("cy",i+12).attr("r",22),"neo"===d&&g.attr("filter","url(#drop-shadow)");const _=s.get(e.name)??0;X.has(l)?(g.style("stroke",T[_%T.length]),g.style("fill",p[_%T.length])):g.style("stroke",E);const y=g.node().getBBox();return e.height=y.height+(a.sequence.labelBoxHeight??0),St(a,m(e.description))(e.description,g,O.x,O.y+15,O.width,O.height,{class:`actor ${G}`},a),g.attr("transform","translate(0,21)"),r||(g.attr("data-et","participant"),g.attr("data-type","boundary"),g.attr("data-id",e.name)),e.height},"drawActorTypeBoundary"),pt=a(function(t,e,a,r,s){const i=r?e.stopy:e.starty,n=e.x+e.width/2,o=i+80,{look:c,theme:d,themeVariables:l}=a,{bkgColorArray:h,borderColorArray:p,actorBorder:T}=l,E=t.append("g").lower();r||(rt++,E.append("line").attr("id","actor"+rt).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).attr("data-et","life-line").attr("data-id",e.name),e.actorCnt=rt);const g=t.append("g");let u=G;u+=r?` ${U}`:` ${z}`,g.attr("class",u),g.attr("name",e.name),r||g.attr("data-et","participant").attr("data-type","actor").attr("data-id",e.name);const O="neo"===c?.5:1,_="neo"===c?i+30*(1-O):i;g.append("line").attr("id","actor-man-torso"+rt).attr("x1",n).attr("y1",_+25*O).attr("x2",n).attr("y2",_+45*O),g.append("line").attr("id","actor-man-arms"+rt).attr("x1",n-18*O).attr("y1",_+33*O).attr("x2",n+18*O).attr("y2",_+33*O),g.append("line").attr("x1",n-18*O).attr("y1",_+60*O).attr("x2",n).attr("y2",_+45*O),g.append("line").attr("x1",n).attr("y1",_+45*O).attr("x2",n+16*O).attr("y2",_+60*O);const y=g.append("circle");y.attr("cx",e.x+e.width/2),y.attr("cy",_+10*O),y.attr("r",15*O),y.attr("width",e.width*O),y.attr("height",e.height*O);const x=g.node().getBBox();e.height=x.height;const b=D();b.x=e.x,b.y=_,b.fill="#eaeaea",b.width=e.width,b.height=e.height/O,b.class="actor",b.rx=3,b.ry=3;const I=s.get(e.name)??0;return X.has(d)?(g.style("stroke",p[I%p.length]),g.style("fill",h[I%p.length])):g.style("stroke",T),St(a,m(e.description))(e.description,g,b.x,_+35*O-("neo"===c?10:0),b.width,b.height,{class:`actor ${G}`},a),e.height},"drawActorTypeActor"),Tt=a(async function(t,e,a,r,s,i,n){const o=n??new Map([...i.db.getActors().values()].map((t,e)=>[t.name,e]));switch(e.type){case"actor":return await pt(t,e,a,r,o);case"participant":return await it(t,e,a,r,o);case"boundary":return await ht(t,e,a,r,o);case"control":return await ct(t,e,a,r,s,o);case"entity":return await dt(t,e,a,r,o);case"database":return await lt(t,e,a,r,o);case"collections":return await nt(t,e,a,r,o);case"queue":return await ot(t,e,a,r,o)}},"drawActor"),Et=a(function(t,e,a){const r=t.append("g");_t(r,e),e.name&&St(a)(e.name,r,e.x,e.y+a.boxTextMargin+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},a),r.lower()},"drawBox"),gt=a(function(t){return t.append("g")},"anchorElement"),ut=a(function(t,e,a,r,s,i,n){const{theme:o,themeVariables:c}=r,{bkgColorArray:d,borderColorArray:l,mainBkg:h}=c,p=D(),T=e.anchored,E=e.actor;p.x=e.startx,p.y=e.starty,p.class="activation"+s%3,p.width=e.stopx-e.startx,p.height=a-e.starty;const g=J(T,p),u=(n??new Map([...i.db.getActors().values()].map((t,e)=>[t.name,e]))).get(E)??0;X.has(o)&&(g.style("stroke",l[u%l.length]),g.style("fill",d[u%l.length]??h))},"drawActivation"),Ot=a(async function(t,e,r,s,i){const{boxMargin:n,boxTextMargin:o,labelBoxHeight:c,labelBoxWidth:d,messageFontFamily:l,messageFontSize:h,messageFontWeight:p}=s,T=t.append("g").attr("data-et","control-structure").attr("data-id","i"+i.id),E=a(function(t,e,a,r){return T.append("line").attr("x1",t).attr("y1",e).attr("x2",a).attr("y2",r).attr("class","loopLine")},"drawLoopLine");E(e.startx,e.starty,e.stopx,e.starty),E(e.stopx,e.starty,e.stopx,e.stopy),E(e.startx,e.stopy,e.stopx,e.stopy),E(e.startx,e.starty,e.startx,e.stopy),void 0!==e.sections&&e.sections.forEach(function(t){E(e.startx,t.y,e.stopx,t.y).style("stroke-dasharray","3, 3")});let g=P();g.text=r,g.x=e.startx,g.y=e.starty,g.fontFamily=l,g.fontSize=h,g.fontWeight=p,g.anchor="middle",g.valign="middle",g.tspan=!1,g.width=Math.max(d??0,50),g.height=c+("neo"===s.look?15:0)||20,g.textMargin=o,g.class="labelText",at(T,g),g=Nt(),g.text=e.title,g.x=e.startx+d/2+(e.stopx-e.startx)/2,g.y=e.starty+n+o,g.anchor="middle",g.valign="middle",g.textMargin=o,g.class="loopText",g.fontFamily=l,g.fontSize=h,g.fontWeight=p,g.wrap=!0;let u=m(g.text)?await tt(T,g,e):et(T,g);if(void 0!==e.sectionTitles)for(const[a,O]of Object.entries(e.sectionTitles))if(O.message){g.text=O.message,g.x=e.startx+(e.stopx-e.startx)/2,g.y=e.sections[a].y+n+o,g.class="sectionTitle",g.anchor="middle",g.valign="middle",g.tspan=!1,g.fontFamily=l,g.fontSize=h,g.fontWeight=p,g.wrap=e.wrap,m(g.text)?(e.starty=e.sections[a].y,await tt(T,g,e)):et(T,g);let t=Math.round(u.map(t=>(t._groups||t)[0][0].getBBox().height).reduce((t,e)=>t+e));e.sections[a].height+=t-(n+o)}return e.height=Math.round(e.stopy-e.starty),T},"drawLoop"),_t=a(function(t,e){S(t,e)},"drawBackgroundRect"),yt=a(function(t,e){t.append("defs").append("symbol").attr("id",e+"-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"),xt=a(function(t,e){t.append("defs").append("symbol").attr("id",e+"-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"),bt=a(function(t,e){t.append("defs").append("symbol").attr("id",e+"-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"),mt=a(function(t,e){t.append("defs").append("marker").attr("id",e+"-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"),It=a(function(t,e){t.append("defs").append("marker").attr("id",e+"-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"),ft=a(function(t,e){t.append("defs").append("marker").attr("id",e+"-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"),Rt=a(function(t,e){t.append("defs").append("marker").attr("id",e+"-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"),Lt=a(function(t,e){const{theme:a}=e;t.append("defs").append("filter").attr("id","drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",""+("redux"===a||"redux-color"===a?"#000000":"#FFFFFF"))},"insertDropShadow"),Nt=a(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=a(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),St=function(){function t(t,e,a,r,s,n,o){i(e.append("text").attr("x",a+s/2).attr("y",r+n/2+5).style("text-anchor","middle").text(t),o)}function e(t,e,a,r,s,n,o,c){const{actorFontSize:d,actorFontFamily:h,actorFontWeight:p}=c,[T,E]=f(d),g=t.split(l.lineBreakRegex);for(let l=0;l<g.length;l++){const t=l*T-T*(g.length-1)/2,c=e.append("text").attr("x",a+s/2).attr("y",r).style("text-anchor","middle").style("font-size",E).style("font-weight",p).style("font-family",h);c.append("tspan").attr("x",a+s/2).attr("dy",t).text(g[l]),c.attr("y",r+n/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(c,o)}}function r(t,a,r,s,n,o,c,d){const l=a.append("switch"),h=l.append("foreignObject").attr("x",r).attr("y",s).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,l,r,s,n,o,c,d),i(h,c)}async function s(t,a,r,s,n,o,c,d){const l=await I(t,L()),h=a.append("switch"),p=h.append("foreignObject").attr("x",r+n/2-l.width/2).attr("y",s+o/2-l.height/2).attr("width",l.width).attr("height",l.height).append("xhtml:div").style("height","100%").style("width","100%");p.append("div").style("text-align","center").style("vertical-align","middle").html(await w(t,L())),e(t,h,r,s,n,o,c,d),i(p,c)}function i(t,e){for(const a in e)e.hasOwnProperty(a)&&t.attr(a,e[a])}return a(t,"byText"),a(e,"byTspan"),a(r,"byFo"),a(s,"byKatex"),a(i,"_setTextAttrs"),function(a,i=!1){return i?s:"fo"===a.textPlacement?r:"old"===a.textPlacement?t:e}}(),Pt=function(){function t(t,e,a,r,i,n,o){s(e.append("text").attr("x",a).attr("y",r).style("text-anchor","start").text(t),o)}function e(t,e,a,r,i,n,o,c){const{actorFontSize:d,actorFontFamily:h,actorFontWeight:p}=c,T=t.split(l.lineBreakRegex);for(let l=0;l<T.length;l++){const t=l*d-d*(T.length-1)/2,i=e.append("text").attr("x",a).attr("y",r).style("text-anchor","start").style("font-size",d).style("font-weight",p).style("font-family",h);i.append("tspan").attr("x",a).attr("dy",t).text(T[l]),i.attr("y",r+n/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),s(i,o)}}function r(t,a,r,i,n,o,c,d){const l=a.append("switch"),h=l.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,l,r,i,0,o,c,d),s(h,c)}function s(t,e){for(const a in e)e.hasOwnProperty(a)&&t.attr(a,e[a])}return a(t,"byText"),a(e,"byTspan"),a(r,"byFo"),a(s,"_setTextAttrs"),function(a){return"fo"===a.textPlacement?r:"old"===a.textPlacement?t:e}}(),Dt=a(function(t,e){t.append("defs").append("marker").attr("id",e+"-solidTopArrowHead").attr("refX",7.9).attr("refY",7.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 8 L 0 8 z")},"insertSolidTopArrowHead"),At=a(function(t,e){t.append("defs").append("marker").attr("id",e+"-solidBottomArrowHead").attr("refX",7.9).attr("refY",.75).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 0 L 0 8 z")},"insertSolidBottomArrowHead"),kt=a(function(t,e){t.append("defs").append("marker").attr("id",e+"-stickTopArrowHead").attr("refX",7.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 7 7").attr("stroke","black").attr("stroke-width",1.5).attr("fill","none")},"insertStickTopArrowHead"),Mt=a(function(t,e){t.append("defs").append("marker").attr("id",e+"-stickBottomArrowHead").attr("refX",7.5).attr("refY",0).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 7 L 7 0").attr("stroke","black").attr("stroke-width",1.5).attr("fill","none")},"insertStickBottomArrowHead"),Ct={drawRect:J,drawText:et,drawLabel:at,drawActor:Tt,drawBox:Et,drawPopup:Z,anchorElement:gt,drawActivation:ut,drawLoop:Ot,drawBackgroundRect:_t,insertArrowHead:mt,insertArrowFilledHead:It,insertSequenceNumber:ft,insertArrowCrossHead:Rt,insertDatabaseIcon:yt,insertComputerIcon:xt,insertClockIcon:bt,getTextObj:Nt,getNoteRect:wt,fixLifeLineHeights:st,sanitizeUrl:o.sanitizeUrl,insertDropShadow:Lt,insertSolidTopArrowHead:Dt,insertSolidBottomArrowHead:At,insertStickTopArrowHead:kt,insertStickBottomArrowHead:Mt},vt={},Bt={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:a(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:a(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:a(function(t){this.boxes.push(t)},"addBox"),addActor:a(function(t){this.actors.push(t)},"addActor"),addLoop:a(function(t){this.loops.push(t)},"addLoop"),addMessage:a(function(t){this.messages.push(t)},"addMessage"),addNote:a(function(t){this.notes.push(t)},"addNote"),lastActor:a(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:a(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:a(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:a(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:a(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,jt(s())},"init"),updateVal:a(function(t,e,a,r){void 0===t[e]?t[e]=a:t[e]=r(a,t[e])},"updateVal"),updateBounds:a(function(t,e,r,s){const i=this;let n=0;function o(o){return a(function(a){n++;const c=i.sequenceItems.length-n+1;i.updateVal(a,"starty",e-c*vt.boxMargin,Math.min),i.updateVal(a,"stopy",s+c*vt.boxMargin,Math.max),i.updateVal(Bt.data,"startx",t-c*vt.boxMargin,Math.min),i.updateVal(Bt.data,"stopx",r+c*vt.boxMargin,Math.max),"activation"!==o&&(i.updateVal(a,"startx",t-c*vt.boxMargin,Math.min),i.updateVal(a,"stopx",r+c*vt.boxMargin,Math.max),i.updateVal(Bt.data,"starty",e-c*vt.boxMargin,Math.min),i.updateVal(Bt.data,"stopy",s+c*vt.boxMargin,Math.max))},"updateItemBounds")}a(o,"updateFn"),this.sequenceItems.forEach(o()),this.activations.forEach(o("activation"))},"updateBounds"),insert:a(function(t,e,a,r){const s=l.getMin(t,a),i=l.getMax(t,a),n=l.getMin(e,r),o=l.getMax(e,r);this.updateVal(Bt.data,"startx",s,Math.min),this.updateVal(Bt.data,"starty",n,Math.min),this.updateVal(Bt.data,"stopx",i,Math.max),this.updateVal(Bt.data,"stopy",o,Math.max),this.updateBounds(s,n,i,o)},"insert"),newActivation:a(function(t,e,a){const r=a.get(t.from),s=Gt(t.from).length||0,i=r.x+r.width/2+(s-1)*vt.activationWidth/2;this.activations.push({startx:i,starty:this.verticalPos+2,stopx:i+vt.activationWidth,stopy:void 0,actor:t.from,anchored:Ct.anchorElement(e)})},"newActivation"),endActivation:a(function(t){const e=this.activations.map(function(t){return t.actor}).lastIndexOf(t.from);return this.activations.splice(e,1)[0]},"endActivation"),createLoop:a(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:a(function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},"newLoop"),endLoop:a(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:a(function(){return!!this.sequenceItems.length&&this.sequenceItems[this.sequenceItems.length-1].overlap},"isLoopOverlap"),addSectionToLoop:a(function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:Bt.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},"addSectionToLoop"),saveVerticalPos:a(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:a(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:a(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=l.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:a(function(){return this.verticalPos},"getVerticalPos"),getBounds:a(function(){return{bounds:this.data,models:this.models}},"getBounds")},Yt=a(async function(t,e,a){Bt.bumpVerticalPos(vt.boxMargin),e.height=vt.boxMargin,e.starty=Bt.getVerticalPos();const r=D();r.x=e.startx,r.y=e.starty,r.width=e.width||vt.width,r.class="note";const s=t.append("g");s.attr("data-et","note"),s.attr("data-id","i"+a);const i=Ct.drawRect(s,r),n=P();n.x=e.startx,n.y=e.starty,n.width=r.width,n.dy="1em",n.text=e.message,n.class="noteText",n.fontFamily=vt.noteFontFamily,n.fontSize=vt.noteFontSize,n.fontWeight=vt.noteFontWeight,n.anchor=vt.noteAlign,n.textMargin=vt.noteMargin,n.valign="center";const o=m(n.text)?await tt(s,n):et(s,n),c=Math.round(o.map(t=>(t._groups||t)[0][0].getBBox().height).reduce((t,e)=>t+e));i.attr("height",c+2*vt.noteMargin),e.height+=c+2*vt.noteMargin,Bt.bumpVerticalPos(c+2*vt.noteMargin),e.stopy=e.starty+c+2*vt.noteMargin,e.stopx=e.startx+r.width,Bt.insert(e.startx,e.starty,e.stopx,e.stopy),Bt.models.addNote(e)},"drawNote"),$t=a(function(t,e,r,s,i,n,o){const c=s.db.getActors(),d=c.get(e.from),l=c.get(e.to),h=r.sequenceVisible;let p=d.x+d.width/2,T=l.x+l.width/2;const E=p<=T,g=ne(e,s),u=t.append("g"),O=a((t,e)=>{const a=t?16.5:-16.5;return e?-a:a},"getCircleOffset"),_=a(t=>{u.append("circle").attr("cx",t).attr("cy",o).attr("r",5).attr("width",10).attr("height",10)},"drawCircle"),{CENTRAL_CONNECTION:y,CENTRAL_CONNECTION_REVERSE:x,CENTRAL_CONNECTION_DUAL:b}=s.db.LINETYPE;if(h)switch(e.centralConnection){case y:g&&(T+=O(E,!0));break;case x:g||(p+=O(E,!1));break;case b:g?T+=O(E,!0):p+=O(E,!1)}switch(e.centralConnection){case y:_(T);break;case x:_(p);break;case b:_(p),_(T)}},"drawCentralConnection"),Vt=a(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),Wt=a(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),Ft=a(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont");async function Kt(t,e){Bt.bumpVerticalPos(10);const{startx:a,stopx:r,message:i}=e,n=l.splitBreaks(i).length,o=m(i),c=o?await I(i,s()):b.calculateTextDimensions(i,Vt(vt));if(!o){const t=c.height/n;e.height+=t,Bt.bumpVerticalPos(t)}let d,h=c.height-10;const p=c.width;if(a===r){d=Bt.getVerticalPos()+h,vt.rightAngles||(h+=vt.boxMargin,d=Bt.getVerticalPos()+h),h+=30;const t=l.getMax(p/2,vt.width/2);Bt.insert(a-t,Bt.getVerticalPos()-10+h,r+t,Bt.getVerticalPos()+30+h)}else h+=vt.boxMargin,d=Bt.getVerticalPos()+h,Bt.insert(a,d-10,r,d);return Bt.bumpVerticalPos(h),e.height+=h,e.stopy=e.starty+e.height,Bt.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),d}a(Kt,"boundMessage");var qt=a(async function(t,e,a,r,s,i){const{startx:n,stopx:o,starty:c,message:d,type:h,sequenceIndex:p,sequenceVisible:T}=e,E=b.calculateTextDimensions(d,Vt(vt)),g=P();g.x=Math.min(n,o),g.y=c+10,g.width=Math.abs(o-n),g.class="messageText",g.dy="1em",g.text=d,g.fontFamily=vt.messageFontFamily,g.fontSize=vt.messageFontSize,g.fontWeight=vt.messageFontWeight,g.anchor=vt.messageAlign,g.valign="center",g.textMargin=vt.wrapPadding,g.tspan=!1,m(g.text)?await tt(t,g,{startx:n,stopx:o,starty:a}):et(t,g);const u=E.width;let O;if(n===o){const i=T||vt.showSequenceNumbers,c=ne(s,r),d=oe(s,r),h=n+(i&&(c||d)?10:0);O=vt.rightAngles?t.append("path").attr("d",`M ${h},${a} H ${n+l.getMax(vt.width/2,u/2)} V ${a+25} H ${n}`):t.append("path").attr("d","M "+h+","+a+" C "+(h+60)+","+(a-10)+" "+(n+60)+","+(a+30)+" "+n+","+(a+20)),se(s,r)&&$t(t,s,e,r,n,o,a)}else O=t.append("line"),O.attr("x1",n),O.attr("y1",a),O.attr("x2",o),O.attr("y2",a),se(s,r)&&$t(t,s,e,r,n,o,a);h===r.db.LINETYPE.DOTTED||h===r.db.LINETYPE.DOTTED_CROSS||h===r.db.LINETYPE.DOTTED_POINT||h===r.db.LINETYPE.DOTTED_OPEN||h===r.db.LINETYPE.BIDIRECTIONAL_DOTTED||h===r.db.LINETYPE.SOLID_TOP_DOTTED||h===r.db.LINETYPE.SOLID_BOTTOM_DOTTED||h===r.db.LINETYPE.STICK_TOP_DOTTED||h===r.db.LINETYPE.STICK_BOTTOM_DOTTED||h===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(O.style("stroke-dasharray","3, 3"),O.attr("class","messageLine1")):O.attr("class","messageLine0"),O.attr("data-et","message"),O.attr("data-id","i"+e.id),O.attr("data-from",e.from),O.attr("data-to",e.to);let _="";if(vt.arrowMarkerAbsolute&&(_=N(!0)),O.attr("stroke-width",2),O.attr("stroke","none"),O.style("fill","none"),h!==r.db.LINETYPE.SOLID_TOP&&h!==r.db.LINETYPE.SOLID_TOP_DOTTED||O.attr("marker-end","url("+_+"#"+i+"-solidTopArrowHead)"),h!==r.db.LINETYPE.SOLID_BOTTOM&&h!==r.db.LINETYPE.SOLID_BOTTOM_DOTTED||O.attr("marker-end","url("+_+"#"+i+"-solidBottomArrowHead)"),h!==r.db.LINETYPE.STICK_TOP&&h!==r.db.LINETYPE.STICK_TOP_DOTTED||O.attr("marker-end","url("+_+"#"+i+"-stickTopArrowHead)"),h!==r.db.LINETYPE.STICK_BOTTOM&&h!==r.db.LINETYPE.STICK_BOTTOM_DOTTED||O.attr("marker-end","url("+_+"#"+i+"-stickBottomArrowHead)"),h!==r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE&&h!==r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||O.attr("marker-start","url("+_+"#"+i+"-solidBottomArrowHead)"),h!==r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE&&h!==r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||O.attr("marker-start","url("+_+"#"+i+"-solidTopArrowHead)"),h!==r.db.LINETYPE.STICK_ARROW_TOP_REVERSE&&h!==r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||O.attr("marker-start","url("+_+"#"+i+"-stickBottomArrowHead)"),h!==r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE&&h!==r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED||O.attr("marker-start","url("+_+"#"+i+"-stickTopArrowHead)"),h!==r.db.LINETYPE.SOLID&&h!==r.db.LINETYPE.DOTTED||O.attr("marker-end","url("+_+"#"+i+"-arrowhead)"),h!==r.db.LINETYPE.BIDIRECTIONAL_SOLID&&h!==r.db.LINETYPE.BIDIRECTIONAL_DOTTED||(O.attr("marker-start","url("+_+"#"+i+"-arrowhead)"),O.attr("marker-end","url("+_+"#"+i+"-arrowhead)")),h!==r.db.LINETYPE.SOLID_POINT&&h!==r.db.LINETYPE.DOTTED_POINT||O.attr("marker-end","url("+_+"#"+i+"-filled-head)"),h!==r.db.LINETYPE.SOLID_CROSS&&h!==r.db.LINETYPE.DOTTED_CROSS||O.attr("marker-end","url("+_+"#"+i+"-crosshead)"),T||vt.showSequenceNumbers){const c=h===r.db.LINETYPE.BIDIRECTIONAL_SOLID||h===r.db.LINETYPE.BIDIRECTIONAL_DOTTED,d=h===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||h===r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||h===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||h===r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||h===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE||h===r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||h===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||h===r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,l=6,T=se(s,r);let E=n,g=o;c?(n<o?E=n+2*l:(E=n-l+(T?-5:0),E+=(null==s?void 0:s.centralConnection)===r.db.LINETYPE.CENTRAL_CONNECTION_DUAL||(null==s?void 0:s.centralConnection)===r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),O.attr("x1",E)):d?(o>n?g=o-2*l:(g=o-l,E+=(null==s?void 0:s.centralConnection)===r.db.LINETYPE.CENTRAL_CONNECTION_DUAL||(null==s?void 0:s.centralConnection)===r.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),g+=T?15:0,O.attr("x2",g),O.attr("x1",E)):O.attr("x1",n+l);let u=0;const y=n<=o;u=n===o?e.fromBounds+1:d?y?e.toBounds-1:e.fromBounds+1:y?e.fromBounds+1:e.toBounds-1;let x="12px";const b=p.toString().length;b>5?x="7px":b>3&&(x="9px"),t.append("line").attr("x1",u).attr("y1",a).attr("x2",u).attr("y2",a).attr("stroke-width",0).attr("marker-start","url("+_+"#"+i+"-sequencenumber)"),t.append("text").attr("x",u).attr("y",a+4).attr("font-family","sans-serif").attr("font-size",x).attr("text-anchor","middle").attr("class","sequenceNumber").text(p)}},"drawMessage"),Ht=a(function(t,e,a,r,s,i,n){let o,c=0,d=0,h=0;for(const p of r){const t=e.get(p),r=t.box;o&&o!=r&&(n||Bt.models.addBox(o),d+=vt.boxMargin+o.margin),r&&r!=o&&(n||(r.x=c+d,r.y=s),d+=r.margin),t.width=l.getMax(t.width||vt.width,vt.width),t.height=l.getMax(t.height||vt.height,vt.height),t.margin=t.margin||vt.actorMargin,h=l.getMax(h,t.height),a.get(t.name)&&(d+=t.width/2),t.x=c+d,t.starty=Bt.getVerticalPos(),Bt.insert(t.x,s,t.x+t.width,t.height),c+=t.width+d,t.box&&(t.box.width=c+r.margin-t.box.x),d=t.margin,o=t.box,Bt.models.addActor(t)}o&&!n&&Bt.models.addBox(o),Bt.bumpVerticalPos(h)},"addActorRenderingData"),zt=a(async function(t,e,a,r,s,i,n){if(r){let r=0;Bt.bumpVerticalPos(2*vt.boxMargin);for(const o of a){const a=e.get(o);a.stopy||(a.stopy=Bt.getVerticalPos());const c=await Ct.drawActor(t,a,vt,!0,s,i,n);r=l.getMax(r,c)}Bt.bumpVerticalPos(r+vt.boxMargin)}else for(const o of a){const a=e.get(o);await Ct.drawActor(t,a,vt,!1,s,i,n)}},"drawActors"),Ut=a(function(t,e,a,r){let s=0,i=0;for(const n of a){const a=e.get(n),o=ee(a),c=Ct.drawPopup(t,a,o,vt,vt.forceMenus,r);c.height>s&&(s=c.height),c.width+a.x>i&&(i=c.width+a.x)}return{maxHeight:s,maxWidth:i}},"drawActorsPopup"),jt=a(function(t){d(vt,t),t.fontFamily&&(vt.actorFontFamily=vt.noteFontFamily=vt.messageFontFamily=t.fontFamily),t.fontSize&&(vt.actorFontSize=vt.noteFontSize=vt.messageFontSize=t.fontSize),t.fontWeight&&(vt.actorFontWeight=vt.noteFontWeight=vt.messageFontWeight=t.fontWeight)},"setConf"),Gt=a(function(t){return Bt.activations.filter(function(e){return e.actor===t})},"actorActivations"),Xt=a(function(t,e){const a=e.get(t),r=Gt(t);return[r.reduce(function(t,e){return l.getMin(t,e.startx)},a.x+a.width/2-1),r.reduce(function(t,e){return l.getMax(t,e.stopx)},a.x+a.width/2+1)]},"activationBounds");function Jt(t,e,a,r,s){Bt.bumpVerticalPos(a);let i=r;if(e.id&&e.message&&t[e.id]){const a=t[e.id].width,s=Vt(vt);e.message=b.wrapLabel(`[${e.message}]`,a-2*vt.wrapPadding,s),e.width=a,e.wrap=!0;const o=b.calculateTextDimensions(e.message,s),c=l.getMax(o.height,vt.labelBoxHeight);i=r+c,n.debug(`${c} - ${e.message}`)}s(e),Bt.bumpVerticalPos(i)}function Zt(t,e,r,s,i,n,o){function c(a,r){a.x<i.get(t.from).x?(Bt.insert(e.stopx-r,e.starty,e.startx,e.stopy+a.height/2+vt.noteMargin),e.stopx=e.stopx+r):(Bt.insert(e.startx,e.starty,e.stopx+r,e.stopy+a.height/2+vt.noteMargin),e.stopx=e.stopx-r)}function d(a,r){a.x<i.get(t.to).x?(Bt.insert(e.startx-r,e.starty,e.stopx,e.stopy+a.height/2+vt.noteMargin),e.startx=e.startx+r):(Bt.insert(e.stopx,e.starty,e.startx+r,e.stopy+a.height/2+vt.noteMargin),e.startx=e.startx-r)}a(c,"receiverAdjustment"),a(d,"senderAdjustment");const l=[V,W,K,F];if(n.get(t.to)==s){const e=i.get(t.to);c(e,l.includes(e.type)?21:e.width/2+3),e.starty=r-e.height/2,Bt.bumpVerticalPos(e.height/2)}else if(o.get(t.from)==s){const e=i.get(t.from);if(vt.mirrorActors){d(e,l.includes(e.type)?18:e.width/2)}e.stopy=r-e.height/2,Bt.bumpVerticalPos(e.height/2)}else if(o.get(t.to)==s){const e=i.get(t.to);if(vt.mirrorActors){c(e,l.includes(e.type)?21:e.width/2+3)}e.stopy=r-e.height/2,Bt.bumpVerticalPos(e.height/2)}}a(Jt,"adjustLoopHeightForWrap"),a(Zt,"adjustCreatedDestroyedData");var Qt=a(async function(t,e,r,o){const{securityLevel:d,sequence:l,look:h,themeVariables:p}=s();let T;vt=l,"sandbox"===d&&(T=i("#i"+e));const E=i("sandbox"===d?T.nodes()[0].contentDocument.body:"body"),g="sandbox"===d?T.nodes()[0].contentDocument:document;Bt.init(),n.debug(o.db);const u="sandbox"===d?E.select(`[id="${e}"]`):i(`[id="${e}"]`),O=o.db.getActors(),_=o.db.getCreatedActors(),y=o.db.getDestroyedActors(),x=o.db.getBoxes();let b=o.db.getActorKeys();const m=o.db.getMessages(),I=o.db.getDiagramTitle(),f=o.db.hasAtLeastOneBox(),R=o.db.hasAtLeastOneBoxWithTitle(),L=await te(O,m,o);if(vt.height=await ae(O,L,x),Ct.insertComputerIcon(u,e),Ct.insertDatabaseIcon(u,e),Ct.insertClockIcon(u,e),f&&(Bt.bumpVerticalPos(vt.boxMargin),R&&Bt.bumpVerticalPos(x[0].textMaxHeight)),!0===vt.hideUnusedParticipants){const t=new Set;m.forEach(e=>{t.add(e.from),t.add(e.to)}),b=b.filter(e=>t.has(e))}const N=new Map(b.map((t,e)=>{var a;return[(null==(a=O.get(t))?void 0:a.name)??t,e]}));Ht(u,O,_,b,0,m,!1);const w=await de(m,O,L,o);function S(t,e){const a=Bt.endActivation(t);a.starty+18>e&&(a.starty=e-6,e+=12),Ct.drawActivation(u,a,e,vt,Gt(t.from).length,o,N),Bt.insert(a.startx,e-10,a.stopx,e)}Ct.insertArrowHead(u,e),Ct.insertArrowCrossHead(u,e),Ct.insertArrowFilledHead(u,e),Ct.insertSequenceNumber(u,e),Ct.insertSolidTopArrowHead(u,e),Ct.insertSolidBottomArrowHead(u,e),Ct.insertStickTopArrowHead(u,e),Ct.insertStickBottomArrowHead(u,e),"neo"===h&&Ct.insertDropShadow(u,vt),a(S,"activeEnd");let P=1,D=1;const A=[],k=[];let M=0;for(const a of m){let t,e,r;switch(a.type){case o.db.LINETYPE.NOTE:Bt.resetVerticalPos(),e=a.noteModel,await Yt(u,e,a.id);break;case o.db.LINETYPE.ACTIVE_START:case o.db.LINETYPE.CENTRAL_CONNECTION:case o.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:Bt.newActivation(a,u,O);break;case o.db.LINETYPE.ACTIVE_END:S(a,Bt.getVerticalPos());break;case o.db.LINETYPE.LOOP_START:Jt(w,a,vt.boxMargin,vt.boxMargin+vt.boxTextMargin,t=>Bt.newLoop(t));break;case o.db.LINETYPE.LOOP_END:t=Bt.endLoop(),await Ct.drawLoop(u,t,"loop",vt,a),Bt.bumpVerticalPos(t.stopy-Bt.getVerticalPos()),Bt.models.addLoop(t);break;case o.db.LINETYPE.RECT_START:Jt(w,a,vt.boxMargin,vt.boxMargin,t=>{let e=t.message;e||(e=(null==p?void 0:p.rectBkgColor)||(null==p?void 0:p.actorBkg)||"rgba(128, 128, 128, 0.5)"),Bt.newLoop(void 0,e)});break;case o.db.LINETYPE.RECT_END:t=Bt.endLoop(),k.push(t),Bt.models.addLoop(t),Bt.bumpVerticalPos(t.stopy-Bt.getVerticalPos());break;case o.db.LINETYPE.OPT_START:Jt(w,a,vt.boxMargin,vt.boxMargin+vt.boxTextMargin,t=>Bt.newLoop(t));break;case o.db.LINETYPE.OPT_END:t=Bt.endLoop(),await Ct.drawLoop(u,t,"opt",vt,a),Bt.bumpVerticalPos(t.stopy-Bt.getVerticalPos()),Bt.models.addLoop(t);break;case o.db.LINETYPE.ALT_START:Jt(w,a,vt.boxMargin,vt.boxMargin+vt.boxTextMargin,t=>Bt.newLoop(t));break;case o.db.LINETYPE.ALT_ELSE:Jt(w,a,vt.boxMargin+vt.boxTextMargin,vt.boxMargin,t=>Bt.addSectionToLoop(t));break;case o.db.LINETYPE.ALT_END:t=Bt.endLoop(),await Ct.drawLoop(u,t,"alt",vt,a),Bt.bumpVerticalPos(t.stopy-Bt.getVerticalPos()),Bt.models.addLoop(t);break;case o.db.LINETYPE.PAR_START:case o.db.LINETYPE.PAR_OVER_START:Jt(w,a,vt.boxMargin,vt.boxMargin+vt.boxTextMargin,t=>Bt.newLoop(t)),Bt.saveVerticalPos();break;case o.db.LINETYPE.PAR_AND:Jt(w,a,vt.boxMargin+vt.boxTextMargin,vt.boxMargin,t=>Bt.addSectionToLoop(t));break;case o.db.LINETYPE.PAR_END:t=Bt.endLoop(),await Ct.drawLoop(u,t,"par",vt,a),Bt.bumpVerticalPos(t.stopy-Bt.getVerticalPos()),Bt.models.addLoop(t);break;case o.db.LINETYPE.AUTONUMBER:P=a.message.start||P,D=a.message.step||D,a.message.visible?o.db.enableSequenceNumbers():o.db.disableSequenceNumbers();break;case o.db.LINETYPE.CRITICAL_START:Jt(w,a,vt.boxMargin,vt.boxMargin+vt.boxTextMargin,t=>Bt.newLoop(t));break;case o.db.LINETYPE.CRITICAL_OPTION:Jt(w,a,vt.boxMargin+vt.boxTextMargin,vt.boxMargin,t=>Bt.addSectionToLoop(t));break;case o.db.LINETYPE.CRITICAL_END:t=Bt.endLoop(),await Ct.drawLoop(u,t,"critical",vt,a),Bt.bumpVerticalPos(t.stopy-Bt.getVerticalPos()),Bt.models.addLoop(t);break;case o.db.LINETYPE.BREAK_START:Jt(w,a,vt.boxMargin,vt.boxMargin+vt.boxTextMargin,t=>Bt.newLoop(t));break;case o.db.LINETYPE.BREAK_END:t=Bt.endLoop(),await Ct.drawLoop(u,t,"break",vt,a),Bt.bumpVerticalPos(t.stopy-Bt.getVerticalPos()),Bt.models.addLoop(t);break;default:try{r=a.msgModel,r.starty=Bt.getVerticalPos(),r.sequenceIndex=P,r.sequenceVisible=o.db.showSequenceNumbers(),r.id=a.id,r.from=a.from,r.to=a.to;const t=await Kt(0,r);Zt(a,r,t,M,O,_,y),A.push({messageModel:r,lineStartY:t,msg:a}),Bt.models.addMessage(r)}catch(K){n.error("error while drawing message",K)}}[o.db.LINETYPE.SOLID_OPEN,o.db.LINETYPE.DOTTED_OPEN,o.db.LINETYPE.SOLID,o.db.LINETYPE.SOLID_TOP,o.db.LINETYPE.SOLID_BOTTOM,o.db.LINETYPE.STICK_TOP,o.db.LINETYPE.STICK_BOTTOM,o.db.LINETYPE.SOLID_TOP_DOTTED,o.db.LINETYPE.SOLID_BOTTOM_DOTTED,o.db.LINETYPE.STICK_TOP_DOTTED,o.db.LINETYPE.STICK_BOTTOM_DOTTED,o.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,o.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,o.db.LINETYPE.STICK_ARROW_TOP_REVERSE,o.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,o.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,o.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,o.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,o.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,o.db.LINETYPE.DOTTED,o.db.LINETYPE.SOLID_CROSS,o.db.LINETYPE.DOTTED_CROSS,o.db.LINETYPE.SOLID_POINT,o.db.LINETYPE.DOTTED_POINT,o.db.LINETYPE.BIDIRECTIONAL_SOLID,o.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(a.type)&&(P=Math.round(100*(P+D))/100),M++}n.debug("createdActors",_),n.debug("destroyedActors",y),await zt(u,O,b,!1,e,o,N);for(const a of A)await qt(u,a.messageModel,a.lineStartY,o,a.msg,e);vt.mirrorActors&&await zt(u,O,b,!0,e,o,N),k.forEach(t=>Ct.drawBackgroundRect(u,t)),st(u,O,b,vt);for(const a of Bt.models.boxes){a.height=Bt.getVerticalPos()-a.y,Bt.insert(a.x,a.y,a.x+a.width,a.height);const t=2*vt.boxMargin;a.startx=a.x-t,a.starty=a.y-.25*t,a.stopx=a.startx+a.width+2*t,a.stopy=a.starty+a.height+.75*t,a.stroke="rgb(0,0,0, 0.5)",Ct.drawBox(u,a,vt)}f&&Bt.bumpVerticalPos(vt.boxMargin);const C=Ut(u,O,b,g),{bounds:v}=Bt.getBounds();void 0===v.startx&&(v.startx=0),void 0===v.starty&&(v.starty=0),void 0===v.stopx&&(v.stopx=0),void 0===v.stopy&&(v.stopy=0);let B=v.stopy-v.starty;B<C.maxHeight&&(B=C.maxHeight);let Y=B+2*vt.diagramMarginY;vt.mirrorActors&&(Y=Y-vt.boxMargin+vt.bottomMarginAdj);let $=v.stopx-v.startx;$<C.maxWidth&&($=C.maxWidth);const V=$+2*vt.diagramMarginX;I&&u.append("text").text(I).attr("x",(v.stopx-v.startx)/2-2*vt.diagramMarginX).attr("y",-25),c(u,Y,V,vt.useMaxWidth);const W=I?40:0,F=O.size&&"neo"===h?30:0;u.attr("viewBox",v.startx-vt.diagramMarginX+" -"+(vt.diagramMarginY+W)+" "+V+" "+(Y+W+F)),n.debug("models:",Bt.models)},"draw");async function te(t,e,a){const r={};for(const i of e)if(t.get(i.to)&&t.get(i.from)){const e=t.get(i.to);if(i.placement===a.db.PLACEMENT.LEFTOF&&!e.prevActor)continue;if(i.placement===a.db.PLACEMENT.RIGHTOF&&!e.nextActor)continue;const n=void 0!==i.placement,o=!n,c=n?Wt(vt):Vt(vt),d=i.wrap?b.wrapLabel(i.message,vt.width-2*vt.wrapPadding,c):i.message,h=(m(d)?await I(i.message,s()):b.calculateTextDimensions(d,c)).width+2*vt.wrapPadding;o&&i.from===e.nextActor?r[i.to]=l.getMax(r[i.to]||0,h):o&&i.from===e.prevActor?r[i.from]=l.getMax(r[i.from]||0,h):o&&i.from===i.to?(r[i.from]=l.getMax(r[i.from]||0,h/2),r[i.to]=l.getMax(r[i.to]||0,h/2)):i.placement===a.db.PLACEMENT.RIGHTOF?r[i.from]=l.getMax(r[i.from]||0,h):i.placement===a.db.PLACEMENT.LEFTOF?r[e.prevActor]=l.getMax(r[e.prevActor]||0,h):i.placement===a.db.PLACEMENT.OVER&&(e.prevActor&&(r[e.prevActor]=l.getMax(r[e.prevActor]||0,h/2)),e.nextActor&&(r[i.from]=l.getMax(r[i.from]||0,h/2)))}return n.debug("maxMessageWidthPerActor:",r),r}a(te,"getMaxMessageWidthPerActor");var ee=a(function(t){let e=0;const a=Ft(vt);for(const r in t.links){const t=b.calculateTextDimensions(r,a).width+2*vt.wrapPadding+2*vt.boxMargin;e<t&&(e=t)}return e},"getRequiredPopupWidth");async function ae(t,e,a){let r=0;for(const n of t.keys()){const e=t.get(n);e.wrap&&(e.description=b.wrapLabel(e.description,vt.width-2*vt.wrapPadding,Ft(vt)));const a=m(e.description)?await I(e.description,s()):b.calculateTextDimensions(e.description,Ft(vt));e.width=e.wrap?vt.width:l.getMax(vt.width,a.width+2*vt.wrapPadding),e.height=e.wrap?l.getMax(a.height,vt.height):vt.height,r=l.getMax(r,e.height)}for(const s in e){const a=t.get(s);if(!a)continue;const r=t.get(a.nextActor);if(!r){const t=e[s]+vt.actorMargin-a.width/2;a.margin=l.getMax(t,vt.actorMargin);continue}const i=e[s]+vt.actorMargin-a.width/2-r.width/2;a.margin=l.getMax(i,vt.actorMargin)}let i=0;return a.forEach(e=>{const a=Vt(vt);let r=e.actorKeys.reduce((e,a)=>e+(t.get(a).width+(t.get(a).margin||0)),0);r+=8*vt.boxMargin,r-=2*vt.boxTextMargin,e.wrap&&(e.name=b.wrapLabel(e.name,r-2*vt.wrapPadding,a));const s=b.calculateTextDimensions(e.name,a);i=l.getMax(s.height,i);const n=l.getMax(r,s.width+2*vt.wrapPadding);if(e.margin=vt.boxTextMargin,r<n){const t=(n-r)/2;e.margin+=t}}),a.forEach(t=>t.textMaxHeight=i),l.getMax(r,vt.height)}a(ae,"calculateActorMargins");var re=a(async function(t,e,a){const r=e.get(t.from),i=e.get(t.to),o=r.x,c=i.x,d=t.wrap&&t.message;let h=m(t.message)?await I(t.message,s()):b.calculateTextDimensions(d?b.wrapLabel(t.message,vt.width,Wt(vt)):t.message,Wt(vt));const p={width:d?vt.width:l.getMax(vt.width,h.width+2*vt.noteMargin),height:0,startx:r.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===a.db.PLACEMENT.RIGHTOF?(p.width=d?l.getMax(vt.width,h.width):l.getMax(r.width/2+i.width/2,h.width+2*vt.noteMargin),p.startx=o+(r.width+vt.actorMargin)/2):t.placement===a.db.PLACEMENT.LEFTOF?(p.width=d?l.getMax(vt.width,h.width+2*vt.noteMargin):l.getMax(r.width/2+i.width/2,h.width+2*vt.noteMargin),p.startx=o-p.width+(r.width-vt.actorMargin)/2):t.to===t.from?(h=b.calculateTextDimensions(d?b.wrapLabel(t.message,l.getMax(vt.width,r.width),Wt(vt)):t.message,Wt(vt)),p.width=d?l.getMax(vt.width,r.width):l.getMax(r.width,vt.width,h.width+2*vt.noteMargin),p.startx=o+(r.width-p.width)/2):(p.width=Math.abs(o+r.width/2-(c+i.width/2))+vt.actorMargin,p.startx=o<c?o+r.width/2-vt.actorMargin/2:c+i.width/2-vt.actorMargin/2),d&&(p.message=b.wrapLabel(t.message,p.width-2*vt.wrapPadding,Wt(vt))),n.debug(`NM:[${p.startx},${p.stopx},${p.starty},${p.stopy}:${p.width},${p.height}=${t.message}]`),p},"buildNoteModel"),se=a(function(t,e){const{CENTRAL_CONNECTION:a,CENTRAL_CONNECTION_REVERSE:r,CENTRAL_CONNECTION_DUAL:s}=e.db.LINETYPE;return[a,r,s].includes(t.centralConnection)},"hasCentralConnection"),ie=a(function(t,e,a){const{CENTRAL_CONNECTION_REVERSE:r,CENTRAL_CONNECTION_DUAL:s,BIDIRECTIONAL_SOLID:i,BIDIRECTIONAL_DOTTED:n}=e.db.LINETYPE;let o=0;return t.centralConnection!==r&&t.centralConnection!==s||(o+=4),t.centralConnection!==r&&t.centralConnection!==s||t.type!==i&&t.type!==n||(o+=a?0:-6),o},"calculateCentralConnectionOffset"),ne=a(function(t,e){const{SOLID_ARROW_TOP_REVERSE:a,SOLID_ARROW_TOP_REVERSE_DOTTED:r,SOLID_ARROW_BOTTOM_REVERSE:s,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:i,STICK_ARROW_TOP_REVERSE:n,STICK_ARROW_TOP_REVERSE_DOTTED:o,STICK_ARROW_BOTTOM_REVERSE:c,STICK_ARROW_BOTTOM_REVERSE_DOTTED:d}=e.db.LINETYPE;return[a,r,s,i,n,o,c,d].includes(t.type)},"isReverseArrowType"),oe=a(function(t,e){const{BIDIRECTIONAL_SOLID:a,BIDIRECTIONAL_DOTTED:r}=e.db.LINETYPE;return[a,r].includes(t.type)},"isBidirectionalArrowType"),ce=a(function(t,e,r){const{look:i}=s();if(![r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.SOLID,r.db.LINETYPE.SOLID_TOP,r.db.LINETYPE.SOLID_BOTTOM,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.SOLID_TOP_DOTTED,r.db.LINETYPE.SOLID_BOTTOM_DOTTED,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,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(t.type))return{};const[n,o]=Xt(t.from,e),[c,d]=Xt(t.to,e),h=n<=c;let p=h?o:n,T=h?c:d;if("neo"===i){const e=3;t.type!==r.db.LINETYPE.SOLID_OPEN&&(T+=h?-e:e),t.type!==r.db.LINETYPE.BIDIRECTIONAL_SOLID&&t.type!==r.db.LINETYPE.BIDIRECTIONAL_DOTTED||(p+=h?e:-e)}p+=ie(t,r,h);const E=Math.abs(c-d)>2,g=a(t=>h?-t:t,"adjustValue");t.from===t.to?T=p:(t.activate&&!E&&(T+=g(vt.activationWidth/2-1)),[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)||(T+=g(3)),[r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(t.type)&&(p-=g(3)));const u=[n,o,c,d],O=Math.abs(p-T);t.wrap&&t.message&&(t.message=b.wrapLabel(t.message,l.getMax(O+2*vt.wrapPadding,vt.width),Vt(vt)));const _=b.calculateTextDimensions(t.message,Vt(vt));return{width:l.getMax(t.wrap?0:_.width+2*vt.wrapPadding,O+2*vt.wrapPadding,vt.width),height:0,startx:p,stopx:T,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,u),toBounds:Math.max.apply(null,u)}},"buildMessageModel"),de=a(async function(t,e,a,r){const s={},i=[];let o,c,d;for(const n of t){switch(n.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:n.id,msg:n.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:n.message&&(o=i.pop(),s[o.id]=o,s[n.id]=o,i.push(o));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:o=i.pop(),s[o.id]=o;break;case r.db.LINETYPE.ACTIVE_START:{const t=e.get(n.from?n.from:n.to.actor),a=Gt(n.from?n.from:n.to.actor).length,r=t.x+t.width/2+(a-1)*vt.activationWidth/2,s={startx:r,stopx:r+vt.activationWidth,actor:n.from,enabled:!0};Bt.activations.push(s)}break;case r.db.LINETYPE.ACTIVE_END:{const t=Bt.activations.map(t=>t.actor).lastIndexOf(n.from);Bt.activations.splice(t,1).splice(0,1)}}void 0!==n.placement?(c=await re(n,e,r),n.noteModel=c,i.forEach(t=>{o=t,o.from=l.getMin(o.from,c.startx),o.to=l.getMax(o.to,c.startx+c.width),o.width=l.getMax(o.width,Math.abs(o.from-o.to))-vt.labelBoxWidth})):(d=ce(n,e,r),n.msgModel=d,d.startx&&d.stopx&&i.length>0&&i.forEach(t=>{if(o=t,d.startx===d.stopx){const t=e.get(n.from),a=e.get(n.to);o.from=l.getMin(t.x-d.width/2,t.x-t.width/2,o.from),o.to=l.getMax(a.x+d.width/2,a.x+t.width/2,o.to),o.width=l.getMax(o.width,Math.abs(o.to-o.from))-vt.labelBoxWidth}else o.from=l.getMin(d.startx,o.from),o.to=l.getMax(d.stopx,o.to),o.width=l.getMax(o.width,d.width)-vt.labelBoxWidth}))}return Bt.activations=[],n.debug("Loop type widths:",s),s},"calculateLoopBounds"),le={bounds:Bt,drawActors:zt,drawActorsPopup:Ut,setConf:jt,draw:Qt},he={parser:v,get db(){return new q},renderer:le,styles:H,init:a(t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,r({sequence:{wrap:t.wrap}}))},"init")};export{he as diagram};
|