import{g as St,a as Kt,d as Se,b as Me,c as Re,e as De}from"./chunk-XVOYOM2C-Dt7ZJZwW.js";import{I as Ce}from"./chunk-2RYQ3QTB-Bq6pkclg.js";import{_ as d,g as Oe,q as Be,p as Ve,d as at,s as se,c as Ye,b as Fe,e as _,I as lt,J as wt,u as F,l as J,r as We,i as Mt,a as qe,j as kt,k as ze,m as ae,K as ie,B as Ft,L as ne,Z as He}from"./index-CNUZxHYN.js";var Wt=function(){var t=d(function(pt,I,L,A){for(L=L||{},A=pt.length;A--;L[pt[A]]=I);return L},"o"),e=[1,2],o=[1,3],r=[1,4],a=[2,4],i=[1,9],c=[1,11],h=[1,13],p=[1,14],s=[1,16],f=[1,17],E=[1,18],g=[1,24],T=[1,25],m=[1,26],w=[1,27],k=[1,28],V=[1,29],M=[1,30],Y=[1,31],C=[1,32],z=[1,33],H=[1,34],Z=[1,35],et=[1,36],K=[1,37],U=[1,38],q=[1,39],R=[1,41],Q=[1,42],G=[1,43],j=[1,44],rt=[1,45],S=[1,46],y=[1,4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,48,49,50,52,53,54,59,60,61,62,70],P=[4,5,16,50,52,53],$=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],it=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,49,50,52,53,54,59,60,61,62,70],N=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,48,50,52,53,54,59,60,61,62,70],Jt=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,50,52,53,54,59,60,61,62,70],ot=[68,69,70],dt=[1,122],Ct={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,box_section:10,box_line:11,participant_statement:12,create:13,box:14,restOfLine:15,end:16,signal:17,autonumber:18,NUM:19,off:20,activate:21,actor:22,deactivate:23,note_statement:24,links_statement:25,link_statement:26,properties_statement:27,details_statement:28,title:29,legacy_title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,loop:36,rect:37,opt:38,alt:39,else_sections:40,par:41,par_sections:42,par_over:43,critical:44,option_sections:45,break:46,option:47,and:48,else:49,participant:50,AS:51,participant_actor:52,destroy:53,note:54,placement:55,text2:56,over:57,actor_pair:58,links:59,link:60,properties:61,details:62,spaceList:63,",":64,left_of:65,right_of:66,signaltype:67,"+":68,"-":69,ACTOR:70,SOLID_OPEN_ARROW:71,DOTTED_OPEN_ARROW:72,SOLID_ARROW:73,BIDIRECTIONAL_SOLID_ARROW:74,DOTTED_ARROW:75,BIDIRECTIONAL_DOTTED_ARROW:76,SOLID_CROSS:77,DOTTED_CROSS:78,SOLID_POINT:79,DOTTED_POINT:80,TXT:81,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",13:"create",14:"box",15:"restOfLine",16:"end",18:"autonumber",19:"NUM",20:"off",21:"activate",23:"deactivate",29:"title",30:"legacy_title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"loop",37:"rect",38:"opt",39:"alt",41:"par",43:"par_over",44:"critical",46:"break",47:"option",48:"and",49:"else",50:"participant",51:"AS",52:"participant_actor",53:"destroy",54:"note",57:"over",59:"links",60:"link",61:"properties",62:"details",64:",",65:"left_of",66:"right_of",68:"+",69:"-",70:"ACTOR",71:"SOLID_OPEN_ARROW",72:"DOTTED_OPEN_ARROW",73:"SOLID_ARROW",74:"BIDIRECTIONAL_SOLID_ARROW",75:"DOTTED_ARROW",76:"BIDIRECTIONAL_DOTTED_ARROW",77:"SOLID_CROSS",78:"DOTTED_CROSS",79:"SOLID_POINT",80:"DOTTED_POINT",81:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[10,0],[10,2],[11,2],[11,1],[11,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[45,1],[45,4],[42,1],[42,4],[40,1],[40,4],[12,5],[12,3],[12,5],[12,3],[12,3],[24,4],[24,4],[25,3],[26,3],[27,3],[28,3],[63,2],[63,1],[58,3],[58,1],[55,1],[55,1],[17,5],[17,5],[17,4],[22,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[56,1]],performAction:d(function(I,L,A,b,D,l,mt){var u=l.length-1;switch(D){case 3:return b.apply(l[u]),l[u];case 4:case 9:this.$=[];break;case 5:case 10:l[u-1].push(l[u]),this.$=l[u-1];break;case 6:case 7:case 11:case 12:this.$=l[u];break;case 8:case 13:this.$=[];break;case 15:l[u].type="createParticipant",this.$=l[u];break;case 16:l[u-1].unshift({type:"boxStart",boxData:b.parseBoxData(l[u-2])}),l[u-1].push({type:"boxEnd",boxText:l[u-2]}),this.$=l[u-1];break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(l[u-2]),sequenceIndexStep:Number(l[u-1]),sequenceVisible:!0,signalType:b.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(l[u-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:b.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:b.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:b.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"activeStart",signalType:b.LINETYPE.ACTIVE_START,actor:l[u-1].actor};break;case 23:this.$={type:"activeEnd",signalType:b.LINETYPE.ACTIVE_END,actor:l[u-1].actor};break;case 29:b.setDiagramTitle(l[u].substring(6)),this.$=l[u].substring(6);break;case 30:b.setDiagramTitle(l[u].substring(7)),this.$=l[u].substring(7);break;case 31:this.$=l[u].trim(),b.setAccTitle(this.$);break;case 32:case 33:this.$=l[u].trim(),b.setAccDescription(this.$);break;case 34:l[u-1].unshift({type:"loopStart",loopText:b.parseMessage(l[u-2]),signalType:b.LINETYPE.LOOP_START}),l[u-1].push({type:"loopEnd",loopText:l[u-2],signalType:b.LINETYPE.LOOP_END}),this.$=l[u-1];break;case 35:l[u-1].unshift({type:"rectStart",color:b.parseMessage(l[u-2]),signalType:b.LINETYPE.RECT_START}),l[u-1].push({type:"rectEnd",color:b.parseMessage(l[u-2]),signalType:b.LINETYPE.RECT_END}),this.$=l[u-1];break;case 36:l[u-1].unshift({type:"optStart",optText:b.parseMessage(l[u-2]),signalType:b.LINETYPE.OPT_START}),l[u-1].push({type:"optEnd",optText:b.parseMessage(l[u-2]),signalType:b.LINETYPE.OPT_END}),this.$=l[u-1];break;case 37:l[u-1].unshift({type:"altStart",altText:b.parseMessage(l[u-2]),signalType:b.LINETYPE.ALT_START}),l[u-1].push({type:"altEnd",signalType:b.LINETYPE.ALT_END}),this.$=l[u-1];break;case 38:l[u-1].unshift({type:"parStart",parText:b.parseMessage(l[u-2]),signalType:b.LINETYPE.PAR_START}),l[u-1].push({type:"parEnd",signalType:b.LINETYPE.PAR_END}),this.$=l[u-1];break;case 39:l[u-1].unshift({type:"parStart",parText:b.parseMessage(l[u-2]),signalType:b.LINETYPE.PAR_OVER_START}),l[u-1].push({type:"parEnd",signalType:b.LINETYPE.PAR_END}),this.$=l[u-1];break;case 40:l[u-1].unshift({type:"criticalStart",criticalText:b.parseMessage(l[u-2]),signalType:b.LINETYPE.CRITICAL_START}),l[u-1].push({type:"criticalEnd",signalType:b.LINETYPE.CRITICAL_END}),this.$=l[u-1];break;case 41:l[u-1].unshift({type:"breakStart",breakText:b.parseMessage(l[u-2]),signalType:b.LINETYPE.BREAK_START}),l[u-1].push({type:"breakEnd",optText:b.parseMessage(l[u-2]),signalType:b.LINETYPE.BREAK_END}),this.$=l[u-1];break;case 43:this.$=l[u-3].concat([{type:"option",optionText:b.parseMessage(l[u-1]),signalType:b.LINETYPE.CRITICAL_OPTION},l[u]]);break;case 45:this.$=l[u-3].concat([{type:"and",parText:b.parseMessage(l[u-1]),signalType:b.LINETYPE.PAR_AND},l[u]]);break;case 47:this.$=l[u-3].concat([{type:"else",altText:b.parseMessage(l[u-1]),signalType:b.LINETYPE.ALT_ELSE},l[u]]);break;case 48:l[u-3].draw="participant",l[u-3].type="addParticipant",l[u-3].description=b.parseMessage(l[u-1]),this.$=l[u-3];break;case 49:l[u-1].draw="participant",l[u-1].type="addParticipant",this.$=l[u-1];break;case 50:l[u-3].draw="actor",l[u-3].type="addParticipant",l[u-3].description=b.parseMessage(l[u-1]),this.$=l[u-3];break;case 51:l[u-1].draw="actor",l[u-1].type="addParticipant",this.$=l[u-1];break;case 52:l[u-1].type="destroyParticipant",this.$=l[u-1];break;case 53:this.$=[l[u-1],{type:"addNote",placement:l[u-2],actor:l[u-1].actor,text:l[u]}];break;case 54:l[u-2]=[].concat(l[u-1],l[u-1]).slice(0,2),l[u-2][0]=l[u-2][0].actor,l[u-2][1]=l[u-2][1].actor,this.$=[l[u-1],{type:"addNote",placement:b.PLACEMENT.OVER,actor:l[u-2].slice(0,2),text:l[u]}];break;case 55:this.$=[l[u-1],{type:"addLinks",actor:l[u-1].actor,text:l[u]}];break;case 56:this.$=[l[u-1],{type:"addALink",actor:l[u-1].actor,text:l[u]}];break;case 57:this.$=[l[u-1],{type:"addProperties",actor:l[u-1].actor,text:l[u]}];break;case 58:this.$=[l[u-1],{type:"addDetails",actor:l[u-1].actor,text:l[u]}];break;case 61:this.$=[l[u-2],l[u]];break;case 62:this.$=l[u];break;case 63:this.$=b.PLACEMENT.LEFTOF;break;case 64:this.$=b.PLACEMENT.RIGHTOF;break;case 65:this.$=[l[u-4],l[u-1],{type:"addMessage",from:l[u-4].actor,to:l[u-1].actor,signalType:l[u-3],msg:l[u],activate:!0},{type:"activeStart",signalType:b.LINETYPE.ACTIVE_START,actor:l[u-1].actor}];break;case 66:this.$=[l[u-4],l[u-1],{type:"addMessage",from:l[u-4].actor,to:l[u-1].actor,signalType:l[u-3],msg:l[u]},{type:"activeEnd",signalType:b.LINETYPE.ACTIVE_END,actor:l[u-4].actor}];break;case 67:this.$=[l[u-3],l[u-1],{type:"addMessage",from:l[u-3].actor,to:l[u-1].actor,signalType:l[u-2],msg:l[u]}];break;case 68:this.$={type:"addParticipant",actor:l[u]};break;case 69:this.$=b.LINETYPE.SOLID_OPEN;break;case 70:this.$=b.LINETYPE.DOTTED_OPEN;break;case 71:this.$=b.LINETYPE.SOLID;break;case 72:this.$=b.LINETYPE.BIDIRECTIONAL_SOLID;break;case 73:this.$=b.LINETYPE.DOTTED;break;case 74:this.$=b.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 75:this.$=b.LINETYPE.SOLID_CROSS;break;case 76:this.$=b.LINETYPE.DOTTED_CROSS;break;case 77:this.$=b.LINETYPE.SOLID_POINT;break;case 78:this.$=b.LINETYPE.DOTTED_POINT;break;case 79:this.$=b.parseMessage(l[u].trim().substring(1));break}},"anonymous"),table:[{3:1,4:e,5:o,6:r},{1:[3]},{3:5,4:e,5:o,6:r},{3:6,4:e,5:o,6:r},t([1,4,5,13,14,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:i,5:c,8:8,9:10,12:12,13:h,14:p,17:15,18:s,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:w,35:k,36:V,37:M,38:Y,39:C,41:z,43:H,44:Z,46:et,50:K,52:U,53:q,54:R,59:Q,60:G,61:j,62:rt,70:S},t(y,[2,5]),{9:47,12:12,13:h,14:p,17:15,18:s,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:w,35:k,36:V,37:M,38:Y,39:C,41:z,43:H,44:Z,46:et,50:K,52:U,53:q,54:R,59:Q,60:G,61:j,62:rt,70:S},t(y,[2,7]),t(y,[2,8]),t(y,[2,14]),{12:48,50:K,52:U,53:q},{15:[1,49]},{5:[1,50]},{5:[1,53],19:[1,51],20:[1,52]},{22:54,70:S},{22:55,70:S},{5:[1,56]},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},t(y,[2,29]),t(y,[2,30]),{32:[1,61]},{34:[1,62]},t(y,[2,33]),{15:[1,63]},{15:[1,64]},{15:[1,65]},{15:[1,66]},{15:[1,67]},{15:[1,68]},{15:[1,69]},{15:[1,70]},{22:71,70:S},{22:72,70:S},{22:73,70:S},{67:74,71:[1,75],72:[1,76],73:[1,77],74:[1,78],75:[1,79],76:[1,80],77:[1,81],78:[1,82],79:[1,83],80:[1,84]},{55:85,57:[1,86],65:[1,87],66:[1,88]},{22:89,70:S},{22:90,70:S},{22:91,70:S},{22:92,70:S},t([5,51,64,71,72,73,74,75,76,77,78,79,80,81],[2,68]),t(y,[2,6]),t(y,[2,15]),t(P,[2,9],{10:93}),t(y,[2,17]),{5:[1,95],19:[1,94]},{5:[1,96]},t(y,[2,21]),{5:[1,97]},{5:[1,98]},t(y,[2,24]),t(y,[2,25]),t(y,[2,26]),t(y,[2,27]),t(y,[2,28]),t(y,[2,31]),t(y,[2,32]),t($,a,{7:99}),t($,a,{7:100}),t($,a,{7:101}),t(it,a,{40:102,7:103}),t(N,a,{42:104,7:105}),t(N,a,{7:105,42:106}),t(Jt,a,{45:107,7:108}),t($,a,{7:109}),{5:[1,111],51:[1,110]},{5:[1,113],51:[1,112]},{5:[1,114]},{22:117,68:[1,115],69:[1,116],70:S},t(ot,[2,69]),t(ot,[2,70]),t(ot,[2,71]),t(ot,[2,72]),t(ot,[2,73]),t(ot,[2,74]),t(ot,[2,75]),t(ot,[2,76]),t(ot,[2,77]),t(ot,[2,78]),{22:118,70:S},{22:120,58:119,70:S},{70:[2,63]},{70:[2,64]},{56:121,81:dt},{56:123,81:dt},{56:124,81:dt},{56:125,81:dt},{4:[1,128],5:[1,130],11:127,12:129,16:[1,126],50:K,52:U,53:q},{5:[1,131]},t(y,[2,19]),t(y,[2,20]),t(y,[2,22]),t(y,[2,23]),{4:i,5:c,8:8,9:10,12:12,13:h,14:p,16:[1,132],17:15,18:s,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:w,35:k,36:V,37:M,38:Y,39:C,41:z,43:H,44:Z,46:et,50:K,52:U,53:q,54:R,59:Q,60:G,61:j,62:rt,70:S},{4:i,5:c,8:8,9:10,12:12,13:h,14:p,16:[1,133],17:15,18:s,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:w,35:k,36:V,37:M,38:Y,39:C,41:z,43:H,44:Z,46:et,50:K,52:U,53:q,54:R,59:Q,60:G,61:j,62:rt,70:S},{4:i,5:c,8:8,9:10,12:12,13:h,14:p,16:[1,134],17:15,18:s,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:w,35:k,36:V,37:M,38:Y,39:C,41:z,43:H,44:Z,46:et,50:K,52:U,53:q,54:R,59:Q,60:G,61:j,62:rt,70:S},{16:[1,135]},{4:i,5:c,8:8,9:10,12:12,13:h,14:p,16:[2,46],17:15,18:s,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:w,35:k,36:V,37:M,38:Y,39:C,41:z,43:H,44:Z,46:et,49:[1,136],50:K,52:U,53:q,54:R,59:Q,60:G,61:j,62:rt,70:S},{16:[1,137]},{4:i,5:c,8:8,9:10,12:12,13:h,14:p,16:[2,44],17:15,18:s,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:w,35:k,36:V,37:M,38:Y,39:C,41:z,43:H,44:Z,46:et,48:[1,138],50:K,52:U,53:q,54:R,59:Q,60:G,61:j,62:rt,70:S},{16:[1,139]},{16:[1,140]},{4:i,5:c,8:8,9:10,12:12,13:h,14:p,16:[2,42],17:15,18:s,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:w,35:k,36:V,37:M,38:Y,39:C,41:z,43:H,44:Z,46:et,47:[1,141],50:K,52:U,53:q,54:R,59:Q,60:G,61:j,62:rt,70:S},{4:i,5:c,8:8,9:10,12:12,13:h,14:p,16:[1,142],17:15,18:s,21:f,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:g,30:T,31:m,33:w,35:k,36:V,37:M,38:Y,39:C,41:z,43:H,44:Z,46:et,50:K,52:U,53:q,54:R,59:Q,60:G,61:j,62:rt,70:S},{15:[1,143]},t(y,[2,49]),{15:[1,144]},t(y,[2,51]),t(y,[2,52]),{22:145,70:S},{22:146,70:S},{56:147,81:dt},{56:148,81:dt},{56:149,81:dt},{64:[1,150],81:[2,62]},{5:[2,55]},{5:[2,79]},{5:[2,56]},{5:[2,57]},{5:[2,58]},t(y,[2,16]),t(P,[2,10]),{12:151,50:K,52:U,53:q},t(P,[2,12]),t(P,[2,13]),t(y,[2,18]),t(y,[2,34]),t(y,[2,35]),t(y,[2,36]),t(y,[2,37]),{15:[1,152]},t(y,[2,38]),{15:[1,153]},t(y,[2,39]),t(y,[2,40]),{15:[1,154]},t(y,[2,41]),{5:[1,155]},{5:[1,156]},{56:157,81:dt},{56:158,81:dt},{5:[2,67]},{5:[2,53]},{5:[2,54]},{22:159,70:S},t(P,[2,11]),t(it,a,{7:103,40:160}),t(N,a,{7:105,42:161}),t(Jt,a,{7:108,45:162}),t(y,[2,48]),t(y,[2,50]),{5:[2,65]},{5:[2,66]},{81:[2,61]},{16:[2,47]},{16:[2,45]},{16:[2,43]}],defaultActions:{5:[2,1],6:[2,2],87:[2,63],88:[2,64],121:[2,55],122:[2,79],123:[2,56],124:[2,57],125:[2,58],147:[2,67],148:[2,53],149:[2,54],157:[2,65],158:[2,66],159:[2,61],160:[2,47],161:[2,45],162:[2,43]},parseError:d(function(I,L){if(L.recoverable)this.trace(I);else{var A=new Error(I);throw A.hash=L,A}},"parseError"),parse:d(function(I){var L=this,A=[0],b=[],D=[null],l=[],mt=this.table,u="",Lt=0,Zt=0,Pe=2,Qt=1,Ae=l.slice.call(arguments,1),W=Object.create(this.lexer),ut={yy:{}};for(var Ot in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ot)&&(ut.yy[Ot]=this.yy[Ot]);W.setInput(I,ut.yy),ut.yy.lexer=W,ut.yy.parser=this,typeof W.yylloc>"u"&&(W.yylloc={});var Bt=W.yylloc;l.push(Bt);var ke=W.options&&W.options.ranges;typeof ut.yy.parseError=="function"?this.parseError=ut.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ne(tt){A.length=A.length-2*tt,D.length=D.length-tt,l.length=l.length-tt}d(Ne,"popStack");function jt(){var tt;return tt=b.pop()||W.lex()||Qt,typeof tt!="number"&&(tt instanceof Array&&(b=tt,tt=b.pop()),tt=L.symbols_[tt]||tt),tt}d(jt,"lex");for(var X,gt,st,Vt,yt={},Pt,ht,$t,At;;){if(gt=A[A.length-1],this.defaultActions[gt]?st=this.defaultActions[gt]:((X===null||typeof X>"u")&&(X=jt()),st=mt[gt]&&mt[gt][X]),typeof st>"u"||!st.length||!st[0]){var Yt="";At=[];for(Pt in mt[gt])this.terminals_[Pt]&&Pt>Pe&&At.push("'"+this.terminals_[Pt]+"'");W.showPosition?Yt="Parse error on line "+(Lt+1)+`: `+W.showPosition()+` Expecting `+At.join(", ")+", got '"+(this.terminals_[X]||X)+"'":Yt="Parse error on line "+(Lt+1)+": Unexpected "+(X==Qt?"end of input":"'"+(this.terminals_[X]||X)+"'"),this.parseError(Yt,{text:W.match,token:this.terminals_[X]||X,line:W.yylineno,loc:Bt,expected:At})}if(st[0]instanceof Array&&st.length>1)throw new Error("Parse Error: multiple actions possible at state: "+gt+", token: "+X);switch(st[0]){case 1:A.push(X),D.push(W.yytext),l.push(W.yylloc),A.push(st[1]),X=null,Zt=W.yyleng,u=W.yytext,Lt=W.yylineno,Bt=W.yylloc;break;case 2:if(ht=this.productions_[st[1]][1],yt.$=D[D.length-ht],yt._$={first_line:l[l.length-(ht||1)].first_line,last_line:l[l.length-1].last_line,first_column:l[l.length-(ht||1)].first_column,last_column:l[l.length-1].last_column},ke&&(yt._$.range=[l[l.length-(ht||1)].range[0],l[l.length-1].range[1]]),Vt=this.performAction.apply(yt,[u,Zt,Lt,ut.yy,st[1],D,l].concat(Ae)),typeof Vt<"u")return Vt;ht&&(A=A.slice(0,-1*ht*2),D=D.slice(0,-1*ht),l=l.slice(0,-1*ht)),A.push(this.productions_[st[1]][0]),D.push(yt.$),l.push(yt._$),$t=mt[A[A.length-2]][A[A.length-1]],A.push($t);break;case 3:return!0}}return!0},"parse")},Le=function(){var pt={EOF:1,parseError:d(function(L,A){if(this.yy.parser)this.yy.parser.parseError(L,A);else throw new Error(L)},"parseError"),setInput:d(function(I,L){return this.yy=L||this.yy||{},this._input=I,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var I=this._input[0];this.yytext+=I,this.yyleng++,this.offset++,this.match+=I,this.matched+=I;var L=I.match(/(?:\r\n?|\n).*/g);return L?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),I},"input"),unput:d(function(I){var L=I.length,A=I.split(/(?:\r\n?|\n)/g);this._input=I+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-L),this.offset-=L;var b=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 D=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:A?(A.length===b.length?this.yylloc.first_column:0)+b[b.length-A.length].length-A[0].length:this.yylloc.first_column-L},this.options.ranges&&(this.yylloc.range=[D[0],D[0]+this.yyleng-L]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(I){this.unput(this.match.slice(I))},"less"),pastInput:d(function(){var I=this.matched.substr(0,this.matched.length-this.match.length);return(I.length>20?"...":"")+I.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var I=this.match;return I.length<20&&(I+=this._input.substr(0,20-I.length)),(I.substr(0,20)+(I.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var I=this.pastInput(),L=new Array(I.length+1).join("-");return I+this.upcomingInput()+` `+L+"^"},"showPosition"),test_match:d(function(I,L){var A,b,D;if(this.options.backtrack_lexer&&(D={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(D.yylloc.range=this.yylloc.range.slice(0))),b=I[0].match(/(?:\r\n?|\n).*/g),b&&(this.yylineno+=b.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:b?b[b.length-1].length-b[b.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+I[0].length},this.yytext+=I[0],this.match+=I[0],this.matches=I,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(I[0].length),this.matched+=I[0],A=this.performAction.call(this,this.yy,this,L,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),A)return A;if(this._backtrack){for(var l in D)this[l]=D[l];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var I,L,A,b;this._more||(this.yytext="",this.match="");for(var D=this._currentRules(),l=0;lL[0].length)){if(L=A,b=l,this.options.backtrack_lexer){if(I=this.test_match(A,D[l]),I!==!1)return I;if(this._backtrack){L=!1;continue}else return!1}else if(!this.options.flex)break}return L?(I=this.test_match(L,D[b]),I!==!1?I:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:d(function(){var L=this.next();return L||this.lex()},"lex"),begin:d(function(L){this.conditionStack.push(L)},"begin"),popState:d(function(){var L=this.conditionStack.length-1;return L>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:d(function(L){return L=this.conditionStack.length-1-Math.abs(L||0),L>=0?this.conditionStack[L]:"INITIAL"},"topState"),pushState:d(function(L){this.begin(L)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:d(function(L,A,b,D){switch(b){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 19;case 7:return this.begin("LINE"),14;case 8:return this.begin("ID"),50;case 9:return this.begin("ID"),52;case 10:return 13;case 11:return this.begin("ID"),53;case 12:return A.yytext=A.yytext.trim(),this.begin("ALIAS"),70;case 13:return this.popState(),this.popState(),this.begin("LINE"),51;case 14:return this.popState(),this.popState(),5;case 15:return this.begin("LINE"),36;case 16:return this.begin("LINE"),37;case 17:return this.begin("LINE"),38;case 18:return this.begin("LINE"),39;case 19:return this.begin("LINE"),49;case 20:return this.begin("LINE"),41;case 21:return this.begin("LINE"),43;case 22:return this.begin("LINE"),48;case 23:return this.begin("LINE"),44;case 24:return this.begin("LINE"),47;case 25:return this.begin("LINE"),46;case 26:return this.popState(),15;case 27:return 16;case 28:return 65;case 29:return 66;case 30:return 59;case 31:return 60;case 32:return 61;case 33:return 62;case 34:return 57;case 35:return 54;case 36:return this.begin("ID"),21;case 37:return this.begin("ID"),23;case 38:return 29;case 39:return 30;case 40:return this.begin("acc_title"),31;case 41:return this.popState(),"acc_title_value";case 42:return this.begin("acc_descr"),33;case 43:return this.popState(),"acc_descr_value";case 44:this.begin("acc_descr_multiline");break;case 45:this.popState();break;case 46:return"acc_descr_multiline_value";case 47:return 6;case 48:return 18;case 49:return 20;case 50:return 64;case 51:return 5;case 52:return A.yytext=A.yytext.trim(),70;case 53:return 73;case 54:return 74;case 55:return 75;case 56:return 76;case 57:return 71;case 58:return 72;case 59:return 77;case 60:return 78;case 61:return 79;case 62:return 80;case 63:return 81;case 64:return 68;case 65:return 69;case 66:return 5;case 67:return"INVALID"}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:[^\<->\->:\n,;]+?([\-]*[^\<->\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\+\<->\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+\<->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?::(?:(?:no)?wrap)?[^#\n;]+)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[45,46],inclusive:!1},acc_descr:{rules:[43],inclusive:!1},acc_title:{rules:[41],inclusive:!1},ID:{rules:[2,3,12],inclusive:!1},ALIAS:{rules:[2,3,13,14],inclusive:!1},LINE:{rules:[2,3,26],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,7,8,9,10,11,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30,31,32,33,34,35,36,37,38,39,40,42,44,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67],inclusive:!0}}};return pt}();Ct.lexer=Le;function _t(){this.yy={}}return d(_t,"Parser"),_t.prototype=Ct,Ct.Parser=_t,new _t}();Wt.parser=Wt;var Ke=Wt,v=new Ce(()=>({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})),Ue=d(function(t){v.records.boxes.push({name:t.text,wrap:t.wrap??xt(),fill:t.color,actorKeys:[]}),v.records.currentBox=v.records.boxes.slice(-1)[0]},"addBox"),qt=d(function(t,e,o,r){let a=v.records.currentBox;const i=v.records.actors.get(t);if(i){if(v.records.currentBox&&i.box&&v.records.currentBox!==i.box)throw new Error(`A same participant should only be defined in one Box: ${i.name} can't be in '${i.box.name}' and in '${v.records.currentBox.name}' at the same time.`);if(a=i.box?i.box:v.records.currentBox,i.box=a,i&&e===i.name&&o==null)return}if((o==null?void 0:o.text)==null&&(o={text:e,type:r}),(r==null||o.text==null)&&(o={text:e,type:r}),v.records.actors.set(t,{box:a,name:e,description:o.text,wrap:o.wrap??xt(),prevActor:v.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:r??"participant"}),v.records.prevActor){const c=v.records.actors.get(v.records.prevActor);c&&(c.nextActor=t)}v.records.currentBox&&v.records.currentBox.actorKeys.push(t),v.records.prevActor=t},"addActor"),Ge=d(t=>{let e,o=0;if(!t)return 0;for(e=0;e>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},c}return v.records.messages.push({from:t,to:e,message:(o==null?void 0:o.text)??"",wrap:(o==null?void 0:o.wrap)??xt(),type:r,activate:a}),!0},"addSignal"),Je=d(function(){return v.records.boxes.length>0},"hasAtLeastOneBox"),Ze=d(function(){return v.records.boxes.some(t=>t.name)},"hasAtLeastOneBoxWithTitle"),Qe=d(function(){return v.records.messages},"getMessages"),je=d(function(){return v.records.boxes},"getBoxes"),$e=d(function(){return v.records.actors},"getActors"),t0=d(function(){return v.records.createdActors},"getCreatedActors"),e0=d(function(){return v.records.destroyedActors},"getDestroyedActors"),It=d(function(t){return v.records.actors.get(t)},"getActor"),r0=d(function(){return[...v.records.actors.keys()]},"getActorKeys"),s0=d(function(){v.records.sequenceNumbersEnabled=!0},"enableSequenceNumbers"),a0=d(function(){v.records.sequenceNumbersEnabled=!1},"disableSequenceNumbers"),i0=d(()=>v.records.sequenceNumbersEnabled,"showSequenceNumbers"),n0=d(function(t){v.records.wrapEnabled=t},"setWrap"),oe=d(t=>{if(t===void 0)return{};t=t.trim();const e=/^:?wrap:/.exec(t)!==null?!0:/^:?nowrap:/.exec(t)!==null?!1:void 0;return{cleanedText:(e===void 0?t:t.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:e}},"extractWrap"),xt=d(()=>{var t;return v.records.wrapEnabled!==void 0?v.records.wrapEnabled:((t=at().sequence)==null?void 0:t.wrap)??!1},"autoWrap"),o0=d(function(){v.reset(),We()},"clear"),c0=d(function(t){const e=t.trim(),{wrap:o,cleanedText:r}=oe(e),a={text:r,wrap:o};return J.debug(`parseMessage: ${JSON.stringify(a)}`),a},"parseMessage"),l0=d(function(t){const e=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t);let o=e!=null&&e[1]?e[1].trim():"transparent",r=e!=null&&e[2]?e[2].trim():void 0;if(window!=null&&window.CSS)window.CSS.supports("color",o)||(o="transparent",r=t.trim());else{const c=new Option().style;c.color=o,c.color!==o&&(o="transparent",r=t.trim())}const{wrap:a,cleanedText:i}=oe(r);return{text:i?Mt(i,at()):void 0,color:o,wrap:a}},"parseBoxData"),vt={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},d0={FILLED:0,OPEN:1},h0={LEFTOF:0,RIGHTOF:1,OVER:2},ce=d(function(t,e,o){const r={actor:t,placement:e,message:o.text,wrap:o.wrap??xt()},a=[].concat(t,t);v.records.notes.push(r),v.records.messages.push({from:a[0],to:a[1],message:o.text,wrap:o.wrap??xt(),type:vt.NOTE,placement:e})},"addNote"),le=d(function(t,e){const o=It(t);try{let r=Mt(e.text,at());r=r.replace(/&/g,"&"),r=r.replace(/=/g,"=");const a=JSON.parse(r);Rt(o,a)}catch(r){J.error("error while parsing actor link text",r)}},"addLinks"),p0=d(function(t,e){const o=It(t);try{const r={};let a=Mt(e.text,at());const i=a.indexOf("@");a=a.replace(/&/g,"&"),a=a.replace(/=/g,"=");const c=a.slice(0,i-1).trim(),h=a.slice(i+1).trim();r[c]=h,Rt(o,r)}catch(r){J.error("error while parsing actor link text",r)}},"addALink");function Rt(t,e){if(t.links==null)t.links=e;else for(const o in e)t.links[o]=e[o]}d(Rt,"insertLinks");var de=d(function(t,e){const o=It(t);try{const r=Mt(e.text,at()),a=JSON.parse(r);Ut(o,a)}catch(r){J.error("error while parsing actor properties text",r)}},"addProperties");function Ut(t,e){if(t.properties==null)t.properties=e;else for(const o in e)t.properties[o]=e[o]}d(Ut,"insertProperties");function he(){v.records.currentBox=void 0}d(he,"boxEnd");var pe=d(function(t,e){const o=It(t),r=document.getElementById(e.text);try{const a=r.innerHTML,i=JSON.parse(a);i.properties&&Ut(o,i.properties),i.links&&Rt(o,i.links)}catch(a){J.error("error while parsing actor details text",a)}},"addDetails"),u0=d(function(t,e){if((t==null?void 0:t.properties)!==void 0)return t.properties[e]},"getActorProperty"),ue=d(function(t){if(Array.isArray(t))t.forEach(function(e){ue(e)});else switch(t.type){case"sequenceIndex":v.records.messages.push({from:void 0,to:void 0,message:{start:t.sequenceIndex,step:t.sequenceIndexStep,visible:t.sequenceVisible},wrap:!1,type:t.signalType});break;case"addParticipant":qt(t.actor,t.actor,t.description,t.draw);break;case"createParticipant":if(v.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");v.records.lastCreated=t.actor,qt(t.actor,t.actor,t.description,t.draw),v.records.createdActors.set(t.actor,v.records.messages.length);break;case"destroyParticipant":v.records.lastDestroyed=t.actor,v.records.destroyedActors.set(t.actor,v.records.messages.length);break;case"activeStart":O(t.actor,void 0,void 0,t.signalType);break;case"activeEnd":O(t.actor,void 0,void 0,t.signalType);break;case"addNote":ce(t.actor,t.placement,t.text);break;case"addLinks":le(t.actor,t.text);break;case"addALink":p0(t.actor,t.text);break;case"addProperties":de(t.actor,t.text);break;case"addDetails":pe(t.actor,t.text);break;case"addMessage":if(v.records.lastCreated){if(t.to!==v.records.lastCreated)throw new Error("The created participant "+v.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");v.records.lastCreated=void 0}else if(v.records.lastDestroyed){if(t.to!==v.records.lastDestroyed&&t.from!==v.records.lastDestroyed)throw new Error("The destroyed participant "+v.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");v.records.lastDestroyed=void 0}O(t.from,t.to,t.msg,t.signalType,t.activate);break;case"boxStart":Ue(t.boxData);break;case"boxEnd":he();break;case"loopStart":O(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":O(void 0,void 0,void 0,t.signalType);break;case"rectStart":O(void 0,void 0,t.color,t.signalType);break;case"rectEnd":O(void 0,void 0,void 0,t.signalType);break;case"optStart":O(void 0,void 0,t.optText,t.signalType);break;case"optEnd":O(void 0,void 0,void 0,t.signalType);break;case"altStart":O(void 0,void 0,t.altText,t.signalType);break;case"else":O(void 0,void 0,t.altText,t.signalType);break;case"altEnd":O(void 0,void 0,void 0,t.signalType);break;case"setAccTitle":se(t.text);break;case"parStart":O(void 0,void 0,t.parText,t.signalType);break;case"and":O(void 0,void 0,t.parText,t.signalType);break;case"parEnd":O(void 0,void 0,void 0,t.signalType);break;case"criticalStart":O(void 0,void 0,t.criticalText,t.signalType);break;case"option":O(void 0,void 0,t.optionText,t.signalType);break;case"criticalEnd":O(void 0,void 0,void 0,t.signalType);break;case"breakStart":O(void 0,void 0,t.breakText,t.signalType);break;case"breakEnd":O(void 0,void 0,void 0,t.signalType);break}},"apply"),te={addActor:qt,addMessage:Xe,addSignal:O,addLinks:le,addDetails:pe,addProperties:de,autoWrap:xt,setWrap:n0,enableSequenceNumbers:s0,disableSequenceNumbers:a0,showSequenceNumbers:i0,getMessages:Qe,getActors:$e,getCreatedActors:t0,getDestroyedActors:e0,getActor:It,getActorKeys:r0,getActorProperty:u0,getAccTitle:Oe,getBoxes:je,getDiagramTitle:Be,setDiagramTitle:Ve,getConfig:d(()=>at().sequence,"getConfig"),clear:o0,parseMessage:c0,parseBoxData:l0,LINETYPE:vt,ARROWTYPE:d0,PLACEMENT:h0,addNote:ce,setAccTitle:se,apply:ue,setAccDescription:Ye,getAccDescription:Fe,hasAtLeastOneBox:Je,hasAtLeastOneBoxWithTitle:Ze},g0=d(t=>`.actor { stroke: ${t.actorBorder}; fill: ${t.actorBkg}; } text.actor > tspan { fill: ${t.actorTextColor}; stroke: none; } .actor-line { stroke: ${t.actorLineColor}; } .messageLine0 { stroke-width: 1.5; stroke-dasharray: none; stroke: ${t.signalColor}; } .messageLine1 { stroke-width: 1.5; stroke-dasharray: 2, 2; stroke: ${t.signalColor}; } #arrowhead path { fill: ${t.signalColor}; stroke: ${t.signalColor}; } .sequenceNumber { fill: ${t.sequenceNumberColor}; } #sequencenumber { fill: ${t.signalColor}; } #crosshead path { fill: ${t.signalColor}; stroke: ${t.signalColor}; } .messageText { fill: ${t.signalTextColor}; stroke: none; } .labelBox { stroke: ${t.labelBoxBorderColor}; fill: ${t.labelBoxBkgColor}; } .labelText, .labelText > tspan { fill: ${t.labelTextColor}; stroke: none; } .loopText, .loopText > tspan { fill: ${t.loopTextColor}; stroke: none; } .loopLine { stroke-width: 2px; stroke-dasharray: 2, 2; stroke: ${t.labelBoxBorderColor}; fill: ${t.labelBoxBorderColor}; } .note { //stroke: #decc93; stroke: ${t.noteBorderColor}; fill: ${t.noteBkgColor}; } .noteText, .noteText > tspan { fill: ${t.noteTextColor}; stroke: none; } .activation0 { fill: ${t.activationBkgColor}; stroke: ${t.activationBorderColor}; } .activation1 { fill: ${t.activationBkgColor}; stroke: ${t.activationBorderColor}; } .activation2 { fill: ${t.activationBkgColor}; stroke: ${t.activationBorderColor}; } .actorPopupMenu { position: absolute; } .actorPopupMenuPanel { position: absolute; fill: ${t.actorBkg}; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4)); } .actor-man line { stroke: ${t.actorBorder}; fill: ${t.actorBkg}; } .actor-man circle, line { stroke: ${t.actorBorder}; fill: ${t.actorBkg}; stroke-width: 2px; } `,"getStyles"),f0=g0,ft=18*2,ge="actor-top",fe="actor-bottom",x0="actor-box",ee="actor-man",Gt=d(function(t,e){return Se(t,e)},"drawRect"),T0=d(function(t,e,o,r,a){if(e.links===void 0||e.links===null||Object.keys(e.links).length===0)return{height:0,width:0};const i=e.links,c=e.actorCnt,h=e.rectData;var p="none";a&&(p="block !important");const s=t.append("g");s.attr("id","actor"+c+"_popup"),s.attr("class","actorPopupMenu"),s.attr("display",p);var f="";h.class!==void 0&&(f=" "+h.class);let E=h.width>o?h.width:o;const g=s.append("rect");if(g.attr("class","actorPopupMenuPanel"+f),g.attr("x",h.x),g.attr("y",h.height),g.attr("fill",h.fill),g.attr("stroke",h.stroke),g.attr("width",E),g.attr("height",h.height),g.attr("rx",h.rx),g.attr("ry",h.ry),i!=null){var T=20;for(let k in i){var m=s.append("a"),w=ae(i[k]);m.attr("xlink:href",w),m.attr("target","_blank"),D0(r)(k,m,h.x+10,h.height+T,E,20,{class:"actor"},r),T+=30}}return g.attr("height",T),{height:h.height+T,width:E}},"drawPopup"),y0=d(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),Nt=d(async function(t,e,o=null){let r=t.append("foreignObject");const a=await ie(e.text,Ft()),c=r.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(a).node().getBoundingClientRect();if(r.attr("height",Math.round(c.height)).attr("width",Math.round(c.width)),e.class==="noteText"){const h=t.node().firstChild;h.setAttribute("height",c.height+2*e.textMargin);const p=h.getBBox();r.attr("x",Math.round(p.x+p.width/2-c.width/2)).attr("y",Math.round(p.y+p.height/2-c.height/2))}else if(o){let{startx:h,stopx:p,starty:s}=o;if(h>p){const f=h;h=p,p=f}r.attr("x",Math.round(h+Math.abs(h-p)/2-c.width/2)),e.class==="loopText"?r.attr("y",Math.round(s)):r.attr("y",Math.round(s-c.height))}return[r]},"drawKatex"),bt=d(function(t,e){let o=0,r=0;const a=e.text.split(_.lineBreakRegex),[i,c]=ne(e.fontSize);let h=[],p=0,s=d(()=>e.y,"yfunc");if(e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0)switch(e.valign){case"top":case"start":s=d(()=>Math.round(e.y+e.textMargin),"yfunc");break;case"middle":case"center":s=d(()=>Math.round(e.y+(o+r+e.textMargin)/2),"yfunc");break;case"bottom":case"end":s=d(()=>Math.round(e.y+(o+r+2*e.textMargin)-e.textMargin),"yfunc");break}if(e.anchor!==void 0&&e.textMargin!==void 0&&e.width!==void 0)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";break}for(let[f,E]of a.entries()){e.textMargin!==void 0&&e.textMargin===0&&i!==void 0&&(p=f*i);const g=t.append("text");g.attr("x",e.x),g.attr("y",s()),e.anchor!==void 0&&g.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),e.fontFamily!==void 0&&g.style("font-family",e.fontFamily),c!==void 0&&g.style("font-size",c),e.fontWeight!==void 0&&g.style("font-weight",e.fontWeight),e.fill!==void 0&&g.attr("fill",e.fill),e.class!==void 0&&g.attr("class",e.class),e.dy!==void 0?g.attr("dy",e.dy):p!==0&&g.attr("dy",p);const T=E||He;if(e.tspan){const m=g.append("tspan");m.attr("x",e.x),e.fill!==void 0&&m.attr("fill",e.fill),m.text(T)}else g.text(T);e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0&&(r+=(g._groups||g)[0][0].getBBox().height,o=r),h.push(g)}return h},"drawText"),xe=d(function(t,e){function o(a,i,c,h,p){return a+","+i+" "+(a+c)+","+i+" "+(a+c)+","+(i+h-p)+" "+(a+c-p*1.2)+","+(i+h)+" "+a+","+(i+h)}d(o,"genPoints");const r=t.append("polygon");return r.attr("points",o(e.x,e.y,e.width,e.height,7)),r.attr("class","labelBox"),e.y=e.y+e.height/2,bt(t,e),r},"drawLabel"),ct=-1,Te=d((t,e,o,r)=>{t.select&&o.forEach(a=>{const i=e.get(a),c=t.select("#actor"+i.actorCnt);!r.mirrorActors&&i.stopy?c.attr("y2",i.stopy+i.height/2):r.mirrorActors&&c.attr("y2",i.stopy)})},"fixLifeLineHeights"),E0=d(function(t,e,o,r){var T,m;const a=r?e.stopy:e.starty,i=e.x+e.width/2,c=a+5,h=t.append("g").lower();var p=h;r||(ct++,Object.keys(e.links||{}).length&&!o.forceMenus&&p.attr("onclick",y0(`actor${ct}_popup`)).attr("cursor","pointer"),p.append("line").attr("id","actor"+ct).attr("x1",i).attr("y1",c).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),p=h.append("g"),e.actorCnt=ct,e.links!=null&&p.attr("id","root-"+ct));const s=St();var f="actor";(T=e.properties)!=null&&T.class?f=e.properties.class:s.fill="#eaeaea",r?f+=` ${fe}`:f+=` ${ge}`,s.x=e.x,s.y=a,s.width=e.width,s.height=e.height,s.class=f,s.rx=3,s.ry=3,s.name=e.name;const E=Gt(p,s);if(e.rectData=s,(m=e.properties)!=null&&m.icon){const w=e.properties.icon.trim();w.charAt(0)==="@"?Re(p,s.x+s.width-20,s.y+10,w.substr(1)):De(p,s.x+s.width-20,s.y+10,w)}Xt(o,lt(e.description))(e.description,p,s.x,s.y,s.width,s.height,{class:`actor ${x0}`},o);let g=e.height;if(E.node){const w=E.node().getBBox();e.height=w.height,g=w.height}return g},"drawActorTypeParticipant"),b0=d(function(t,e,o,r){const a=r?e.stopy:e.starty,i=e.x+e.width/2,c=a+80,h=t.append("g").lower();r||(ct++,h.append("line").attr("id","actor"+ct).attr("x1",i).attr("y1",c).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),e.actorCnt=ct);const p=t.append("g");let s=ee;r?s+=` ${fe}`:s+=` ${ge}`,p.attr("class",s),p.attr("name",e.name);const f=St();f.x=e.x,f.y=a,f.fill="#eaeaea",f.width=e.width,f.height=e.height,f.class="actor",f.rx=3,f.ry=3,p.append("line").attr("id","actor-man-torso"+ct).attr("x1",i).attr("y1",a+25).attr("x2",i).attr("y2",a+45),p.append("line").attr("id","actor-man-arms"+ct).attr("x1",i-ft/2).attr("y1",a+33).attr("x2",i+ft/2).attr("y2",a+33),p.append("line").attr("x1",i-ft/2).attr("y1",a+60).attr("x2",i).attr("y2",a+45),p.append("line").attr("x1",i).attr("y1",a+45).attr("x2",i+ft/2-2).attr("y2",a+60);const E=p.append("circle");E.attr("cx",e.x+e.width/2),E.attr("cy",a+10),E.attr("r",15),E.attr("width",e.width),E.attr("height",e.height);const g=p.node().getBBox();return e.height=g.height,Xt(o,lt(e.description))(e.description,p,f.x,f.y+35,f.width,f.height,{class:`actor ${ee}`},o),e.height},"drawActorTypeActor"),m0=d(async function(t,e,o,r){switch(e.type){case"actor":return await b0(t,e,o,r);case"participant":return await E0(t,e,o,r)}},"drawActor"),v0=d(function(t,e,o){const a=t.append("g");ye(a,e),e.name&&Xt(o)(e.name,a,e.x,e.y+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},o),a.lower()},"drawBox"),w0=d(function(t){return t.append("g")},"anchorElement"),I0=d(function(t,e,o,r,a){const i=St(),c=e.anchored;i.x=e.startx,i.y=e.starty,i.class="activation"+a%3,i.width=e.stopx-e.startx,i.height=o-e.starty,Gt(c,i)},"drawActivation"),_0=d(async function(t,e,o,r){const{boxMargin:a,boxTextMargin:i,labelBoxHeight:c,labelBoxWidth:h,messageFontFamily:p,messageFontSize:s,messageFontWeight:f}=r,E=t.append("g"),g=d(function(w,k,V,M){return E.append("line").attr("x1",w).attr("y1",k).attr("x2",V).attr("y2",M).attr("class","loopLine")},"drawLoopLine");g(e.startx,e.starty,e.stopx,e.starty),g(e.stopx,e.starty,e.stopx,e.stopy),g(e.startx,e.stopy,e.stopx,e.stopy),g(e.startx,e.starty,e.startx,e.stopy),e.sections!==void 0&&e.sections.forEach(function(w){g(e.startx,w.y,e.stopx,w.y).style("stroke-dasharray","3, 3")});let T=Kt();T.text=o,T.x=e.startx,T.y=e.starty,T.fontFamily=p,T.fontSize=s,T.fontWeight=f,T.anchor="middle",T.valign="middle",T.tspan=!1,T.width=h||50,T.height=c||20,T.textMargin=i,T.class="labelText",xe(E,T),T=Ee(),T.text=e.title,T.x=e.startx+h/2+(e.stopx-e.startx)/2,T.y=e.starty+a+i,T.anchor="middle",T.valign="middle",T.textMargin=i,T.class="loopText",T.fontFamily=p,T.fontSize=s,T.fontWeight=f,T.wrap=!0;let m=lt(T.text)?await Nt(E,T,e):bt(E,T);if(e.sectionTitles!==void 0){for(const[w,k]of Object.entries(e.sectionTitles))if(k.message){T.text=k.message,T.x=e.startx+(e.stopx-e.startx)/2,T.y=e.sections[w].y+a+i,T.class="loopText",T.anchor="middle",T.valign="middle",T.tspan=!1,T.fontFamily=p,T.fontSize=s,T.fontWeight=f,T.wrap=e.wrap,lt(T.text)?(e.starty=e.sections[w].y,await Nt(E,T,e)):bt(E,T);let V=Math.round(m.map(M=>(M._groups||M)[0][0].getBBox().height).reduce((M,Y)=>M+Y));e.sections[w].height+=V-(a+i)}}return e.height=Math.round(e.stopy-e.starty),E},"drawLoop"),ye=d(function(t,e){Me(t,e)},"drawBackgroundRect"),L0=d(function(t){t.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),P0=d(function(t){t.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),A0=d(function(t){t.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),k0=d(function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),N0=d(function(t){t.append("defs").append("marker").attr("id","filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),S0=d(function(t){t.append("defs").append("marker").attr("id","sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber"),M0=d(function(t){t.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),Ee=d(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"),R0=d(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),Xt=function(){function t(i,c,h,p,s,f,E){const g=c.append("text").attr("x",h+s/2).attr("y",p+f/2+5).style("text-anchor","middle").text(i);a(g,E)}d(t,"byText");function e(i,c,h,p,s,f,E,g){const{actorFontSize:T,actorFontFamily:m,actorFontWeight:w}=g,[k,V]=ne(T),M=i.split(_.lineBreakRegex);for(let Y=0;Yt.height||0))+(this.loops.length===0?0:this.loops.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.messages.length===0?0:this.messages.map(t=>t.height||0).reduce((t,e)=>t+e))+(this.notes.length===0?0:this.notes.map(t=>t.height||0).reduce((t,e)=>t+e))},"getHeight"),clear:d(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:d(function(t){this.boxes.push(t)},"addBox"),addActor:d(function(t){this.actors.push(t)},"addActor"),addLoop:d(function(t){this.loops.push(t)},"addLoop"),addMessage:d(function(t){this.messages.push(t)},"addMessage"),addNote:d(function(t){this.notes.push(t)},"addNote"),lastActor:d(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:d(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:d(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:d(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:d(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,ve(at())},"init"),updateVal:d(function(t,e,o,r){t[e]===void 0?t[e]=o:t[e]=r(o,t[e])},"updateVal"),updateBounds:d(function(t,e,o,r){const a=this;let i=0;function c(h){return d(function(s){i++;const f=a.sequenceItems.length-i+1;a.updateVal(s,"starty",e-f*n.boxMargin,Math.min),a.updateVal(s,"stopy",r+f*n.boxMargin,Math.max),a.updateVal(x.data,"startx",t-f*n.boxMargin,Math.min),a.updateVal(x.data,"stopx",o+f*n.boxMargin,Math.max),h!=="activation"&&(a.updateVal(s,"startx",t-f*n.boxMargin,Math.min),a.updateVal(s,"stopx",o+f*n.boxMargin,Math.max),a.updateVal(x.data,"starty",e-f*n.boxMargin,Math.min),a.updateVal(x.data,"stopy",r+f*n.boxMargin,Math.max))},"updateItemBounds")}d(c,"updateFn"),this.sequenceItems.forEach(c()),this.activations.forEach(c("activation"))},"updateBounds"),insert:d(function(t,e,o,r){const a=_.getMin(t,o),i=_.getMax(t,o),c=_.getMin(e,r),h=_.getMax(e,r);this.updateVal(x.data,"startx",a,Math.min),this.updateVal(x.data,"starty",c,Math.min),this.updateVal(x.data,"stopx",i,Math.max),this.updateVal(x.data,"stopy",h,Math.max),this.updateBounds(a,c,i,h)},"insert"),newActivation:d(function(t,e,o){const r=o.get(t.from),a=Dt(t.from).length||0,i=r.x+r.width/2+(a-1)*n.activationWidth/2;this.activations.push({startx:i,starty:this.verticalPos+2,stopx:i+n.activationWidth,stopy:void 0,actor:t.from,anchored:B.anchorElement(e)})},"newActivation"),endActivation:d(function(t){const e=this.activations.map(function(o){return o.actor}).lastIndexOf(t.from);return this.activations.splice(e,1)[0]},"endActivation"),createLoop:d(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:d(function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},"newLoop"),endLoop:d(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:d(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:d(function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:x.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},"addSectionToLoop"),saveVerticalPos:d(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:d(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:d(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=_.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:d(function(){return this.verticalPos},"getVerticalPos"),getBounds:d(function(){return{bounds:this.data,models:this.models}},"getBounds")},C0=d(async function(t,e){x.bumpVerticalPos(n.boxMargin),e.height=n.boxMargin,e.starty=x.getVerticalPos();const o=St();o.x=e.startx,o.y=e.starty,o.width=e.width||n.width,o.class="note";const r=t.append("g"),a=B.drawRect(r,o),i=Kt();i.x=e.startx,i.y=e.starty,i.width=o.width,i.dy="1em",i.text=e.message,i.class="noteText",i.fontFamily=n.noteFontFamily,i.fontSize=n.noteFontSize,i.fontWeight=n.noteFontWeight,i.anchor=n.noteAlign,i.textMargin=n.noteMargin,i.valign="center";const c=lt(i.text)?await Nt(r,i):bt(r,i),h=Math.round(c.map(p=>(p._groups||p)[0][0].getBBox().height).reduce((p,s)=>p+s));a.attr("height",h+2*n.noteMargin),e.height+=h+2*n.noteMargin,x.bumpVerticalPos(h+2*n.noteMargin),e.stopy=e.starty+h+2*n.noteMargin,e.stopx=e.startx+o.width,x.insert(e.startx,e.starty,e.stopx,e.stopy),x.models.addNote(e)},"drawNote"),Tt=d(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),Et=d(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),zt=d(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont");async function be(t,e){x.bumpVerticalPos(10);const{startx:o,stopx:r,message:a}=e,i=_.splitBreaks(a).length,c=lt(a),h=c?await wt(a,at()):F.calculateTextDimensions(a,Tt(n));if(!c){const E=h.height/i;e.height+=E,x.bumpVerticalPos(E)}let p,s=h.height-10;const f=h.width;if(o===r){p=x.getVerticalPos()+s,n.rightAngles||(s+=n.boxMargin,p=x.getVerticalPos()+s),s+=30;const E=_.getMax(f/2,n.width/2);x.insert(o-E,x.getVerticalPos()-10+s,r+E,x.getVerticalPos()+30+s)}else s+=n.boxMargin,p=x.getVerticalPos()+s,x.insert(o,p-10,r,p);return x.bumpVerticalPos(s),e.height+=s,e.stopy=e.starty+e.height,x.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),p}d(be,"boundMessage");var O0=d(async function(t,e,o,r){const{startx:a,stopx:i,starty:c,message:h,type:p,sequenceIndex:s,sequenceVisible:f}=e,E=F.calculateTextDimensions(h,Tt(n)),g=Kt();g.x=a,g.y=c+10,g.width=i-a,g.class="messageText",g.dy="1em",g.text=h,g.fontFamily=n.messageFontFamily,g.fontSize=n.messageFontSize,g.fontWeight=n.messageFontWeight,g.anchor=n.messageAlign,g.valign="center",g.textMargin=n.wrapPadding,g.tspan=!1,lt(g.text)?await Nt(t,g,{startx:a,stopx:i,starty:o}):bt(t,g);const T=E.width;let m;a===i?n.rightAngles?m=t.append("path").attr("d",`M ${a},${o} H ${a+_.getMax(n.width/2,T/2)} V ${o+25} H ${a}`):m=t.append("path").attr("d","M "+a+","+o+" C "+(a+60)+","+(o-10)+" "+(a+60)+","+(o+30)+" "+a+","+(o+20)):(m=t.append("line"),m.attr("x1",a),m.attr("y1",o),m.attr("x2",i),m.attr("y2",o)),p===r.db.LINETYPE.DOTTED||p===r.db.LINETYPE.DOTTED_CROSS||p===r.db.LINETYPE.DOTTED_POINT||p===r.db.LINETYPE.DOTTED_OPEN||p===r.db.LINETYPE.BIDIRECTIONAL_DOTTED?(m.style("stroke-dasharray","3, 3"),m.attr("class","messageLine1")):m.attr("class","messageLine0");let w="";n.arrowMarkerAbsolute&&(w=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,w=w.replace(/\(/g,"\\("),w=w.replace(/\)/g,"\\)")),m.attr("stroke-width",2),m.attr("stroke","none"),m.style("fill","none"),(p===r.db.LINETYPE.SOLID||p===r.db.LINETYPE.DOTTED)&&m.attr("marker-end","url("+w+"#arrowhead)"),(p===r.db.LINETYPE.BIDIRECTIONAL_SOLID||p===r.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(m.attr("marker-start","url("+w+"#arrowhead)"),m.attr("marker-end","url("+w+"#arrowhead)")),(p===r.db.LINETYPE.SOLID_POINT||p===r.db.LINETYPE.DOTTED_POINT)&&m.attr("marker-end","url("+w+"#filled-head)"),(p===r.db.LINETYPE.SOLID_CROSS||p===r.db.LINETYPE.DOTTED_CROSS)&&m.attr("marker-end","url("+w+"#crosshead)"),(f||n.showSequenceNumbers)&&(m.attr("marker-start","url("+w+"#sequencenumber)"),t.append("text").attr("x",a).attr("y",o+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(s))},"drawMessage"),B0=d(function(t,e,o,r,a,i,c){let h=0,p=0,s,f=0;for(const E of r){const g=e.get(E),T=g.box;s&&s!=T&&(c||x.models.addBox(s),p+=n.boxMargin+s.margin),T&&T!=s&&(c||(T.x=h+p,T.y=a),p+=T.margin),g.width=g.width||n.width,g.height=_.getMax(g.height||n.height,n.height),g.margin=g.margin||n.actorMargin,f=_.getMax(f,g.height),o.get(g.name)&&(p+=g.width/2),g.x=h+p,g.starty=x.getVerticalPos(),x.insert(g.x,a,g.x+g.width,g.height),h+=g.width+p,g.box&&(g.box.width=h+T.margin-g.box.x),p=g.margin,s=g.box,x.models.addActor(g)}s&&!c&&x.models.addBox(s),x.bumpVerticalPos(f)},"addActorRenderingData"),Ht=d(async function(t,e,o,r){if(r){let a=0;x.bumpVerticalPos(n.boxMargin*2);for(const i of o){const c=e.get(i);c.stopy||(c.stopy=x.getVerticalPos());const h=await B.drawActor(t,c,n,!0);a=_.getMax(a,h)}x.bumpVerticalPos(a+n.boxMargin)}else for(const a of o){const i=e.get(a);await B.drawActor(t,i,n,!1)}},"drawActors"),me=d(function(t,e,o,r){let a=0,i=0;for(const c of o){const h=e.get(c),p=Y0(h),s=B.drawPopup(t,h,p,n,n.forceMenus,r);s.height>a&&(a=s.height),s.width+h.x>i&&(i=s.width+h.x)}return{maxHeight:a,maxWidth:i}},"drawActorsPopup"),ve=d(function(t){qe(n,t),t.fontFamily&&(n.actorFontFamily=n.noteFontFamily=n.messageFontFamily=t.fontFamily),t.fontSize&&(n.actorFontSize=n.noteFontSize=n.messageFontSize=t.fontSize),t.fontWeight&&(n.actorFontWeight=n.noteFontWeight=n.messageFontWeight=t.fontWeight)},"setConf"),Dt=d(function(t){return x.activations.filter(function(e){return e.actor===t})},"actorActivations"),re=d(function(t,e){const o=e.get(t),r=Dt(t),a=r.reduce(function(c,h){return _.getMin(c,h.startx)},o.x+o.width/2-1),i=r.reduce(function(c,h){return _.getMax(c,h.stopx)},o.x+o.width/2+1);return[a,i]},"activationBounds");function nt(t,e,o,r,a){x.bumpVerticalPos(o);let i=r;if(e.id&&e.message&&t[e.id]){const c=t[e.id].width,h=Tt(n);e.message=F.wrapLabel(`[${e.message}]`,c-2*n.wrapPadding,h),e.width=c,e.wrap=!0;const p=F.calculateTextDimensions(e.message,h),s=_.getMax(p.height,n.labelBoxHeight);i=r+s,J.debug(`${s} - ${e.message}`)}a(e),x.bumpVerticalPos(i)}d(nt,"adjustLoopHeightForWrap");function we(t,e,o,r,a,i,c){function h(s,f){s.x{y.add(P.from),y.add(P.to)}),m=m.filter(P=>y.has(P))}B0(s,f,E,m,0,w,!1);const C=await q0(w,f,Y,r);B.insertArrowHead(s),B.insertArrowCrossHead(s),B.insertArrowFilledHead(s),B.insertSequenceNumber(s);function z(y,P){const $=x.endActivation(y);$.starty+18>P&&($.starty=P-6,P+=12),B.drawActivation(s,$,P,n,Dt(y.from).length),x.insert($.startx,P-10,$.stopx,P)}d(z,"activeEnd");let H=1,Z=1;const et=[],K=[];let U=0;for(const y of w){let P,$,it;switch(y.type){case r.db.LINETYPE.NOTE:x.resetVerticalPos(),$=y.noteModel,await C0(s,$);break;case r.db.LINETYPE.ACTIVE_START:x.newActivation(y,s,f);break;case r.db.LINETYPE.ACTIVE_END:z(y,x.getVerticalPos());break;case r.db.LINETYPE.LOOP_START:nt(C,y,n.boxMargin,n.boxMargin+n.boxTextMargin,N=>x.newLoop(N));break;case r.db.LINETYPE.LOOP_END:P=x.endLoop(),await B.drawLoop(s,P,"loop",n),x.bumpVerticalPos(P.stopy-x.getVerticalPos()),x.models.addLoop(P);break;case r.db.LINETYPE.RECT_START:nt(C,y,n.boxMargin,n.boxMargin,N=>x.newLoop(void 0,N.message));break;case r.db.LINETYPE.RECT_END:P=x.endLoop(),K.push(P),x.models.addLoop(P),x.bumpVerticalPos(P.stopy-x.getVerticalPos());break;case r.db.LINETYPE.OPT_START:nt(C,y,n.boxMargin,n.boxMargin+n.boxTextMargin,N=>x.newLoop(N));break;case r.db.LINETYPE.OPT_END:P=x.endLoop(),await B.drawLoop(s,P,"opt",n),x.bumpVerticalPos(P.stopy-x.getVerticalPos()),x.models.addLoop(P);break;case r.db.LINETYPE.ALT_START:nt(C,y,n.boxMargin,n.boxMargin+n.boxTextMargin,N=>x.newLoop(N));break;case r.db.LINETYPE.ALT_ELSE:nt(C,y,n.boxMargin+n.boxTextMargin,n.boxMargin,N=>x.addSectionToLoop(N));break;case r.db.LINETYPE.ALT_END:P=x.endLoop(),await B.drawLoop(s,P,"alt",n),x.bumpVerticalPos(P.stopy-x.getVerticalPos()),x.models.addLoop(P);break;case r.db.LINETYPE.PAR_START:case r.db.LINETYPE.PAR_OVER_START:nt(C,y,n.boxMargin,n.boxMargin+n.boxTextMargin,N=>x.newLoop(N)),x.saveVerticalPos();break;case r.db.LINETYPE.PAR_AND:nt(C,y,n.boxMargin+n.boxTextMargin,n.boxMargin,N=>x.addSectionToLoop(N));break;case r.db.LINETYPE.PAR_END:P=x.endLoop(),await B.drawLoop(s,P,"par",n),x.bumpVerticalPos(P.stopy-x.getVerticalPos()),x.models.addLoop(P);break;case r.db.LINETYPE.AUTONUMBER:H=y.message.start||H,Z=y.message.step||Z,y.message.visible?r.db.enableSequenceNumbers():r.db.disableSequenceNumbers();break;case r.db.LINETYPE.CRITICAL_START:nt(C,y,n.boxMargin,n.boxMargin+n.boxTextMargin,N=>x.newLoop(N));break;case r.db.LINETYPE.CRITICAL_OPTION:nt(C,y,n.boxMargin+n.boxTextMargin,n.boxMargin,N=>x.addSectionToLoop(N));break;case r.db.LINETYPE.CRITICAL_END:P=x.endLoop(),await B.drawLoop(s,P,"critical",n),x.bumpVerticalPos(P.stopy-x.getVerticalPos()),x.models.addLoop(P);break;case r.db.LINETYPE.BREAK_START:nt(C,y,n.boxMargin,n.boxMargin+n.boxTextMargin,N=>x.newLoop(N));break;case r.db.LINETYPE.BREAK_END:P=x.endLoop(),await B.drawLoop(s,P,"break",n),x.bumpVerticalPos(P.stopy-x.getVerticalPos()),x.models.addLoop(P);break;default:try{it=y.msgModel,it.starty=x.getVerticalPos(),it.sequenceIndex=H,it.sequenceVisible=r.db.showSequenceNumbers();const N=await be(s,it);we(y,it,N,U,f,E,g),et.push({messageModel:it,lineStartY:N}),x.models.addMessage(it)}catch(N){J.error("error while drawing message",N)}}[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.SOLID,r.db.LINETYPE.DOTTED,r.db.LINETYPE.SOLID_CROSS,r.db.LINETYPE.DOTTED_CROSS,r.db.LINETYPE.SOLID_POINT,r.db.LINETYPE.DOTTED_POINT,r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(y.type)&&(H=H+Z),U++}J.debug("createdActors",E),J.debug("destroyedActors",g),await Ht(s,f,m,!1);for(const y of et)await O0(s,y.messageModel,y.lineStartY,r);n.mirrorActors&&await Ht(s,f,m,!0),K.forEach(y=>B.drawBackgroundRect(s,y)),Te(s,f,m,n);for(const y of x.models.boxes)y.height=x.getVerticalPos()-y.y,x.insert(y.x,y.y,y.x+y.width,y.height),y.startx=y.x,y.starty=y.y,y.stopx=y.startx+y.width,y.stopy=y.starty+y.height,y.stroke="rgb(0,0,0, 0.5)",B.drawBox(s,y,n);V&&x.bumpVerticalPos(n.boxMargin);const q=me(s,f,m,p),{bounds:R}=x.getBounds();R.startx===void 0&&(R.startx=0),R.starty===void 0&&(R.starty=0),R.stopx===void 0&&(R.stopx=0),R.stopy===void 0&&(R.stopy=0);let Q=R.stopy-R.starty;Q{const c=Tt(n);let h=i.actorKeys.reduce((f,E)=>f+=t.get(E).width+(t.get(E).margin||0),0);h-=2*n.boxTextMargin,i.wrap&&(i.name=F.wrapLabel(i.name,h-2*n.wrapPadding,c));const p=F.calculateTextDimensions(i.name,c);a=_.getMax(p.height,a);const s=_.getMax(h,p.width+2*n.wrapPadding);if(i.margin=n.boxTextMargin,hi.textMaxHeight=a),_.getMax(r,n.height)}d(_e,"calculateActorMargins");var F0=d(async function(t,e,o){const r=e.get(t.from),a=e.get(t.to),i=r.x,c=a.x,h=t.wrap&&t.message;let p=lt(t.message)?await wt(t.message,at()):F.calculateTextDimensions(h?F.wrapLabel(t.message,n.width,Et(n)):t.message,Et(n));const s={width:h?n.width:_.getMax(n.width,p.width+2*n.noteMargin),height:0,startx:r.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===o.db.PLACEMENT.RIGHTOF?(s.width=h?_.getMax(n.width,p.width):_.getMax(r.width/2+a.width/2,p.width+2*n.noteMargin),s.startx=i+(r.width+n.actorMargin)/2):t.placement===o.db.PLACEMENT.LEFTOF?(s.width=h?_.getMax(n.width,p.width+2*n.noteMargin):_.getMax(r.width/2+a.width/2,p.width+2*n.noteMargin),s.startx=i-s.width+(r.width-n.actorMargin)/2):t.to===t.from?(p=F.calculateTextDimensions(h?F.wrapLabel(t.message,_.getMax(n.width,r.width),Et(n)):t.message,Et(n)),s.width=h?_.getMax(n.width,r.width):_.getMax(r.width,n.width,p.width+2*n.noteMargin),s.startx=i+(r.width-s.width)/2):(s.width=Math.abs(i+r.width/2-(c+a.width/2))+n.actorMargin,s.startx=i2,E=d(w=>h?-w:w,"adjustValue");t.from===t.to?s=p:(t.activate&&!f&&(s+=E(n.activationWidth/2-1)),[o.db.LINETYPE.SOLID_OPEN,o.db.LINETYPE.DOTTED_OPEN].includes(t.type)||(s+=E(3)),[o.db.LINETYPE.BIDIRECTIONAL_SOLID,o.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type)&&(p-=E(3)));const g=[r,a,i,c],T=Math.abs(p-s);t.wrap&&t.message&&(t.message=F.wrapLabel(t.message,_.getMax(T+2*n.wrapPadding,n.width),Tt(n)));const m=F.calculateTextDimensions(t.message,Tt(n));return{width:_.getMax(t.wrap?0:m.width+2*n.wrapPadding,T+2*n.wrapPadding,n.width),height:0,startx:p,stopx:s,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,g),toBounds:Math.max.apply(null,g)}},"buildMessageModel"),q0=d(async function(t,e,o,r){const a={},i=[];let c,h,p;for(const s of t){switch(s.id=F.random({length:10}),s.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:s.id,msg:s.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:s.message&&(c=i.pop(),a[c.id]=c,a[s.id]=c,i.push(c));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:c=i.pop(),a[c.id]=c;break;case r.db.LINETYPE.ACTIVE_START:{const E=e.get(s.from?s.from:s.to.actor),g=Dt(s.from?s.from:s.to.actor).length,T=E.x+E.width/2+(g-1)*n.activationWidth/2,m={startx:T,stopx:T+n.activationWidth,actor:s.from,enabled:!0};x.activations.push(m)}break;case r.db.LINETYPE.ACTIVE_END:{const E=x.activations.map(g=>g.actor).lastIndexOf(s.from);x.activations.splice(E,1).splice(0,1)}break}s.placement!==void 0?(h=await F0(s,e,r),s.noteModel=h,i.forEach(E=>{c=E,c.from=_.getMin(c.from,h.startx),c.to=_.getMax(c.to,h.startx+h.width),c.width=_.getMax(c.width,Math.abs(c.from-c.to))-n.labelBoxWidth})):(p=W0(s,e,r),s.msgModel=p,p.startx&&p.stopx&&i.length>0&&i.forEach(E=>{if(c=E,p.startx===p.stopx){const g=e.get(s.from),T=e.get(s.to);c.from=_.getMin(g.x-p.width/2,g.x-g.width/2,c.from),c.to=_.getMax(T.x+p.width/2,T.x+g.width/2,c.to),c.width=_.getMax(c.width,Math.abs(c.to-c.from))-n.labelBoxWidth}else c.from=_.getMin(p.startx,c.from),c.to=_.getMax(p.stopx,c.to),c.width=_.getMax(c.width,p.width)-n.labelBoxWidth}))}return x.activations=[],J.debug("Loop type widths:",a),a},"calculateLoopBounds"),z0={bounds:x,drawActors:Ht,drawActorsPopup:me,setConf:ve,draw:V0},G0={parser:Ke,db:te,renderer:z0,styles:f0,init:d(({wrap:t})=>{te.setWrap(t)},"init")};export{G0 as diagram};