163 lines
114 KiB
JavaScript
163 lines
114 KiB
JavaScript
|
|
import{a as tr}from"./chunk-T5OCTHI4.mjs";import{a as $e,b as je}from"./chunk-7FYTHRHK.mjs";import{a as Je,b as Ze,d as Kt,e as Ft,f as lt,g as Pt}from"./chunk-LII3EMHJ.mjs";import{c as Qe,n as ae,p as X}from"./chunk-QA3QBVWF.mjs";import{a as xr}from"./chunk-KNLZD3CH.mjs";import{$ as Xe,A as St,B as We,D as Q,E as mt,F as re,G as k,O as Ke,S as Fe,T as se,U as qe,V as He,W as ze,X as Ue,Y as Ge,_ as $,a as Ye,t as wt}from"./chunk-67TQ5CYL.mjs";import{b as j,h as kt}from"./chunk-7W6UQGC5.mjs";import{a as x,d as gr}from"./chunk-AQ6EADP3.mjs";var ne=(function(){var e=x(function(ut,w,C,P){for(C=C||{},P=ut.length;P--;C[ut[P]]=w);return C},"o"),t=[1,2],s=[1,3],r=[1,4],n=[2,4],i=[1,9],a=[1,11],l=[1,12],E=[1,14],h=[1,15],c=[1,17],_=[1,18],u=[1,19],y=[1,25],T=[1,26],f=[1,27],g=[1,28],b=[1,29],R=[1,30],O=[1,31],A=[1,32],N=[1,33],S=[1,34],V=[1,35],v=[1,36],H=[1,37],U=[1,38],G=[1,39],J=[1,40],et=[1,42],z=[1,43],at=[1,44],rt=[1,45],nt=[1,46],Y=[1,47],M=[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],Bt=[1,74],L=[1,80],D=[1,81],dt=[1,82],st=[1,83],W=[1,84],he=[1,85],pe=[1,86],Te=[1,87],Ee=[1,88],ue=[1,89],fe=[1,90],ge=[1,91],xe=[1,92],_e=[1,93],be=[1,94],me=[1,95],Ie=[1,96],ye=[1,97],Re=[1,98],Oe=[1,99],Le=[1,100],Ne=[1,101],Ae=[1,102],we=[1,103],Se=[1,104],ke=[1,105],Pe=[2,78],Nt=[4,5,17,51,53,54],Vt=[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],De=[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],Gt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],Ce=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],Xt=[5,52],F=[70,71,72,73],ot=[1,151],Jt={trace:x(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_CON
|
||
|
|
`+Z.showPosition()+`
|
||
|
|
Expecting `+Wt.join(", ")+", got '"+(this.terminals_[tt]||tt)+"'":ee="Parse error on line "+(vt+1)+": Unexpected "+(tt==Ve?"end of input":"'"+(this.terminals_[tt]||tt)+"'"),this.parseError(ee,{text:Z.match,token:this.terminals_[tt]||tt,line:Z.yylineno,loc:$t,expected:Wt})}if(ct[0]instanceof Array&&ct.length>1)throw new Error("Parse Error: multiple actions possible at state: "+bt+", token: "+tt);switch(ct[0]){case 1:P.push(tt),q.push(Z.yytext),o.push(Z.yylloc),P.push(ct[1]),tt=null,jt?(tt=jt,jt=null):(Me=Z.yyleng,p=Z.yytext,vt=Z.yylineno,$t=Z.yylloc,Be>0&&Be--);break;case 2:if(pt=this.productions_[ct[1]][1],Ot.$=q[q.length-pt],Ot._$={first_line:o[o.length-(pt||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(pt||1)].first_column,last_column:o[o.length-1].last_column},ur&&(Ot._$.range=[o[o.length-(pt||1)].range[0],o[o.length-1].range[1]]),te=this.performAction.apply(Ot,[p,Me,vt,_t.yy,ct[1],q,o].concat(Er)),typeof te<"u")return te;pt&&(P=P.slice(0,-1*pt*2),q=q.slice(0,-1*pt),o=o.slice(0,-1*pt)),P.push(this.productions_[ct[1]][0]),q.push(Ot.$),o.push(Ot._$),ve=At[P[P.length-2]][P[P.length-1]],P.push(ve);break;case 3:return!0}}return!0},"parse")},pr=(function(){var ut={EOF:1,parseError:x(function(C,P){if(this.yy.parser)this.yy.parser.parseError(C,P);else throw new Error(C)},"parseError"),setInput:x(function(w,C){return this.yy=C||this.yy||{},this._input=w,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:x(function(){var w=this._input[0];this.yytext+=w,this.yyleng++,this.offset++,this.match+=w,this.matched+=w;var C=w.match(/(?:\r\n?|\n).*/g);return C?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),w},"input"),unput:x(function(w){var C=w.length,P=w.split(/(?:\r\n?|\n)/g);this._input=w+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-C),this.offset-=C;var m=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),P.length-1&&(this.yylineno-=P.length-1);var q=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:P?(P.length===m.length?this.yylloc.first_column:0)+m[m.length-P.length].length-P[0].length:this.yylloc.first_column-C},this.options.ranges&&(this.yylloc.range=[q[0],q[0]+this.yyleng-C]),this.yyleng=this.yytext.length,this},"unput"),more:x(function(){return this._more=!0,this},"more"),reject:x(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:x(function(w){this.unput(this.match.slice(w))},"less"),pastInput:x(function(){var w=this.matched.substr(0,this.matched.length-this.match.length);return(w.length>20?"...":"")+w.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:x(function(){var w=this.match;return w.length<20&&(w+=this._input.substr(0,20-w.length)),(w.substr(0,20)+(w.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:x(function(){var w=this.pastInput(),C=new Array(w.length+1).join("-");return w+this.upcomingInput()+`
|
||
|
|
`+C+"^"},"showPosition"),test_match:x(function(w,C){var P,m,q;if(this.options.backtrack_lexer&&(q={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&&(q.yylloc.range=this.yylloc.range.slice(0))),m=w[0].match(/(?:\r\n?|\n).*/g),m&&(this.yylineno+=m.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:m?m[m.length-1].length-m[m.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+w[0].length},this.yytext+=w[0],this.match+=w[0],this.matches=w,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(w[0].length),this.matched+=w[0],P=this.performAction.call(this,this.yy,this,C,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),P)return P;if(this._backtrack){for(var o in q)this[o]=q[o];return!1}return!1},"test_match"),next:x(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var w,C,P,m;this._more||(this.yytext="",this.match="");for(var q=this._currentRules(),o=0;o<q.length;o++)if(P=this._input.match(this.rules[q[o]]),P&&(!C||P[0].length>C[0].length)){if(C=P,m=o,this.options.backtrack_lexer){if(w=this.test_match(P,q[o]),w!==!1)return w;if(this._backtrack){C=!1;continue}else return!1}else if(!this.options.flex)break}return C?(w=this.test_match(C,q[m]),w!==!1?w:!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:x(function(){var C=this.next();return C||this.lex()},"lex"),begin:x(function(C){this.conditionStack.push(C)},"begin"),popState:x(function(){var C=this.conditionStack.length-1;return C>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:x(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:x(function(C){return C=this.conditionStack.length-1-Math.abs(C||0),C>=0?this.conditionStack[C]:"INITIAL"},"topState"),pushState:x(function(C){this.begin(C)},"pushState"),stateStackSize:x(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:x(function(C,P,m,q){var o=q;switch(m){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 20;case 7:return this.begin("CONFIG"),75;break;case 8:return 76;case 9:return this.popState(),this.begin("ALIAS"),77;break;case 10:return this.popState(),this.popState(),77;break;case 11:return P.yytext=P.yytext.trim(),73;break;case 12:return P.yytext=P.yytext.trim(),this.begin("ALIAS"),73;break;case 13:return P.yytext=P.yytext.trim(),this.popState(),73;break;case 14:return this.popState(),10;break;case 15:return P.yytext=P.yytext.trim(),this.popState(),10;break;case 16:return this.begin("LINE"),15;break;case 17:return this.begin("ID"),51;break;case 18:return this.begin("ID"),53;break;case 19:return 14;case 20:return this.begin("ID"),54;break;case 21:return this.popState(),this.popState(),this.begin("LINE"),52;break;case 22:return this.popState(),this.popState(),5;break;case 23:return this.begin("LINE"),37;break;case 24:return this.begin("LINE"),38;break;case 25:return this.begin("LINE"),39;break;case 26:return this.begin("LINE"),40;break;case 27:return this.begin("LINE"),50;break;case 28:return this.begin("LINE"),42;break;case 29:return this.begin("LINE"),44;break;case 30:return this.begin("LINE"),49;break;case 31:return this.begin("LINE"),45;break;case 32:return this.begin("LINE"),48;break;case 33:return this.begin("LINE"),47;break;case 34:return this.popState(),16;break;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;break;case 45:return this.begin("ID"),24;break;case 46:return 30;case 47:return 31;case 48:return this.begin("acc_title"),32;break;case 49:return this.popState(),"acc_title_value";break;case 50:return this.begin("acc_descr"),34;break;case 51:return this.popState(),"acc_descr_value";break;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 59:return 5;case 60:return P.yytext=P.yytext.trim(),73;break;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:return 104;case 88:return 104;case 89:return 70;case 90:return 71;case 91:return 72;case 92:return 5;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,/^(
|
||
|
|
`)?h=i+`
|
||
|
|
`:h=`{
|
||
|
|
`+i+`
|
||
|
|
}`,l=je(h,{schema:$e})}n=l?.type??n,l?.alias&&(!r||r.text===s)&&(r={text:l.alias,wrap:r?.wrap,type:n});let E=this.state.records.actors.get(t);if(E){if(this.state.records.currentBox&&E.box&&this.state.records.currentBox!==E.box)throw new Error(`A same participant should only be defined in one Box: ${E.name} can't be in '${E.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(a=E.box?E.box:this.state.records.currentBox,E.box=a,E&&s===E.name&&r==null)return}if(r?.text==null&&(r={text:s,type:n}),(n==null||r.text==null)&&(r={text:s,type:n}),this.state.records.actors.set(t,{box:a,name:s,description:r.text,wrap:r.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:n??"participant"}),this.state.records.prevActor){let h=this.state.records.actors.get(this.state.records.prevActor);h&&(h.nextActor=t)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(t),this.state.records.prevActor=t}activationCount(t){let s,r=0;if(!t)return 0;for(s=0;s<this.state.records.messages.length;s++)this.state.records.messages[s].type===this.LINETYPE.ACTIVE_START&&this.state.records.messages[s].from===t&&r++,this.state.records.messages[s].type===this.LINETYPE.ACTIVE_END&&this.state.records.messages[s].from===t&&r--;return r}addMessage(t,s,r,n){this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:s,message:r.text,wrap:r.wrap??this.autoWrap(),answer:n})}addSignal(t,s,r,n,i=!1,a){if(n===this.LINETYPE.ACTIVE_END&&this.activationCount(t??"")<1){let 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:s,message:r?.text??"",wrap:r?.wrap??this.autoWrap(),type:n,activate:i,centralConnection:a??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(t===void 0)return{};t=t.trim();let s=/^:?wrap:/.exec(t)!==null?!0:/^:?nowrap:/.exec(t)!==null?!1:void 0;return{cleanedText:(s===void 0?t:t.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:s}}autoWrap(){return this.state.records.wrapEnabled!==void 0?this.state.records.wrapEnabled:$().sequence?.wrap??!1}clear(){this.state.reset(),Fe()}parseMessage(t){let s=t.trim(),{wrap:r,cleanedText:n}=this.extractWrap(s),i={text:n,wrap:r};return j.debug(`parseMessage: ${JSON.stringify(i)}`),i}parseBoxData(t){let s=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t),r=s?.[1]?s[1].trim():"transparent",n=s?.[2]?s[2].trim():void 0;if(window?.CSS)window.CSS.supports("color",r)||(r="transparent",n=t.trim());else{let l=new Option().style;l.color=r,l.color!==r&&(r="transparent",n=t.trim())}let{wrap:i,cleanedText:a}=this.extractWrap(n);return{text:a?St(a,$()):void 0,color:r,wrap:i}}addNote(t,s,r){let n={actor:t,placement:s,message:r.text,wrap:r.wrap??this.autoWrap()},i=[].concat(t,t);this.state.records.notes.push(n),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:i[0],to:i[1],message:r.text,wrap:r.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:s})}addLinks(t,s){let r=this.getActor(t);try{let n=St(s.text,$());n=n.replace(/=/g,"="),n=n.replace(/&/g,"&");let i=JSON.parse(n);
|
||
|
|
stroke: ${e.actorBorder};
|
||
|
|
fill: ${e.actorBkg};
|
||
|
|
stroke-width: ${e.strokeWidth??1};
|
||
|
|
}
|
||
|
|
|
||
|
|
rect.actor.outer-path[data-look="neo"] {
|
||
|
|
filter: ${t};
|
||
|
|
}
|
||
|
|
|
||
|
|
rect.note[data-look="neo"] {
|
||
|
|
stroke:${e.noteBorderColor};
|
||
|
|
fill:${e.noteBkgColor};
|
||
|
|
filter: ${t};
|
||
|
|
}
|
||
|
|
|
||
|
|
text.actor > tspan {
|
||
|
|
fill: ${e.actorTextColor};
|
||
|
|
stroke: none;
|
||
|
|
}
|
||
|
|
|
||
|
|
.actor-line {
|
||
|
|
stroke: ${e.actorLineColor};
|
||
|
|
}
|
||
|
|
|
||
|
|
.innerArc {
|
||
|
|
stroke-width: 1.5;
|
||
|
|
stroke-dasharray: none;
|
||
|
|
}
|
||
|
|
|
||
|
|
.messageLine0 {
|
||
|
|
stroke-width: 1.5;
|
||
|
|
stroke-dasharray: none;
|
||
|
|
stroke: ${e.signalColor};
|
||
|
|
}
|
||
|
|
|
||
|
|
.messageLine1 {
|
||
|
|
stroke-width: 1.5;
|
||
|
|
stroke-dasharray: 2, 2;
|
||
|
|
stroke: ${e.signalColor};
|
||
|
|
}
|
||
|
|
|
||
|
|
[id$="-arrowhead"] path {
|
||
|
|
fill: ${e.signalColor};
|
||
|
|
stroke: ${e.signalColor};
|
||
|
|
}
|
||
|
|
|
||
|
|
.sequenceNumber {
|
||
|
|
fill: ${e.sequenceNumberColor};
|
||
|
|
}
|
||
|
|
|
||
|
|
[id$="-sequencenumber"] {
|
||
|
|
fill: ${e.signalColor};
|
||
|
|
}
|
||
|
|
|
||
|
|
[id$="-crosshead"] path {
|
||
|
|
fill: ${e.signalColor};
|
||
|
|
stroke: ${e.signalColor};
|
||
|
|
}
|
||
|
|
|
||
|
|
.messageText {
|
||
|
|
fill: ${e.signalTextColor};
|
||
|
|
stroke: none;
|
||
|
|
}
|
||
|
|
|
||
|
|
.labelBox {
|
||
|
|
stroke: ${e.labelBoxBorderColor};
|
||
|
|
fill: ${e.labelBoxBkgColor};
|
||
|
|
filter: ${s==="neo"?t:"none"};
|
||
|
|
}
|
||
|
|
|
||
|
|
.labelText, .labelText > tspan {
|
||
|
|
fill: ${e.labelTextColor};
|
||
|
|
stroke: none;
|
||
|
|
}
|
||
|
|
|
||
|
|
.loopText, .loopText > tspan {
|
||
|
|
fill: ${e.loopTextColor};
|
||
|
|
stroke: none;
|
||
|
|
}
|
||
|
|
|
||
|
|
.sectionTitle, .sectionTitle > tspan {
|
||
|
|
fill: ${e.loopTextColor};
|
||
|
|
stroke: none;
|
||
|
|
}
|
||
|
|
|
||
|
|
.loopLine {
|
||
|
|
stroke-width: 2px;
|
||
|
|
stroke-dasharray: 2, 2;
|
||
|
|
stroke: ${e.labelBoxBorderColor};
|
||
|
|
fill: ${e.labelBoxBorderColor};
|
||
|
|
}
|
||
|
|
|
||
|
|
.note {
|
||
|
|
//stroke: #decc93;
|
||
|
|
stroke: ${e.noteBorderColor};
|
||
|
|
fill: ${e.noteBkgColor};
|
||
|
|
}
|
||
|
|
|
||
|
|
.noteText, .noteText > tspan {
|
||
|
|
fill: ${e.noteTextColor};
|
||
|
|
stroke: none;
|
||
|
|
${e.noteFontWeight?`font-weight: ${e.noteFontWeight};`:""}
|
||
|
|
}
|
||
|
|
|
||
|
|
.activation0 {
|
||
|
|
fill: ${e.activationBkgColor};
|
||
|
|
stroke: ${e.activationBorderColor};
|
||
|
|
}
|
||
|
|
|
||
|
|
.activation1 {
|
||
|
|
fill: ${e.activationBkgColor};
|
||
|
|
stroke: ${e.activationBorderColor};
|
||
|
|
}
|
||
|
|
|
||
|
|
.activation2 {
|
||
|
|
fill: ${e.activationBkgColor};
|
||
|
|
stroke: ${e.activationBorderColor};
|
||
|
|
}
|
||
|
|
|
||
|
|
.actorPopupMenu {
|
||
|
|
position: absolute;
|
||
|
|
}
|
||
|
|
|
||
|
|
.actorPopupMenuPanel {
|
||
|
|
position: absolute;
|
||
|
|
fill: ${e.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 circle, line {
|
||
|
|
fill: ${e.actorBkg};
|
||
|
|
stroke-width: 2px;
|
||
|
|
}
|
||
|
|
|
||
|
|
g rect.rect {
|
||
|
|
filter: ${t};
|
||
|
|
stroke: ${e.nodeBorder};
|
||
|
|
}
|
||
|
|
`},"getStyles"),rr=Ir;var ie=gr(xr(),1);var ft=36,gt="actor-top",xt="actor-bottom",Ht="actor-box",It="actor-man",Tt=new Set(["redux-color","redux-dark-color"]),Ct=x(function(e,t){let s=Je(e,t);return wt().look==="neo"&&s.attr("data-look","neo"),s},"drawRect"),Rr=x(function(e,t,s,r,n){if(t.links===void 0||t.links===null||Object.keys(t.links).length===0)return{height:0,width:0};let i=t.links,a=t.actorCnt,l=t.rectData;var E="none";n&&(E="block !important");let h=e.append("g");h.attr("id","actor"+a+"_popup"),h.attr("class","actorPopupMenu"),h.attr("display",E);var c="";l.class!==void 0&&(c=" "+l.class);let _=l.width>s?l.width:s,u=h.append("rect");if(u.attr("class","actorPopupMenuPanel"+c),u.attr("x",l.x),u.attr("y",l.height),u.attr("fill",l.fill),u.attr("stroke",l.stroke),u.attr("width",_),u.attr("height",l.height),u.attr("rx",l.rx),u.attr("ry",l.ry),i!=null){var y=20;for(let g in i){var T=h.append("a"),f=(0,ie.sanitizeUrl)(i[g]);T.attr("xlink:href",f),T.attr("target","_blank"),Gr(r)(g,T,l.x+10,l.height+y,_,20,{class:"actor"},r),y+=30}}return u.attr("height",y),{height:l.height+y,width:_}},"drawPopup"),zt=x(function(e){return"var pu = document.getElementById('"+e+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),Mt=x(async function(e,t,s=null){let r=e.append("foreignObject"),n=await re(t.text,wt()),a=r.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(n).node().getBoundingClientRect();if(r.attr("height",Math.round(a.height)).attr("width",Math.round(a.width)),t.class==="noteText"){let l=e.node().firstChild;l.setAttribute("height",a.height+2*t.textMargin);let E=l.getBBox();r.attr("x",Math.round(E.x+E.width/2-a.width/2)).attr("y",Math.round(E.y+E.height/2-a.height/2))}else if(s){let{startx:l,stopx:E,starty:h}=s;if(l>E){let c=l;l=E,E=c}r.attr("x",Math.round(l+Math.abs(l-E)/2-a.width/2)),t.class==="loopText"?r.attr("y",Math.round(h)):r.attr("y",Math.round(h-a.height))}return[r]},"drawKatex"),yt=x(function(e,t){let s=0,r=0,n=t.text.split(k.lineBreakRegex),[i,a]=ae(t.fontSize),l=[],E=0,h=x(()=>t.y,"yfunc");if(t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0)switch(t.valign){case"top":case"start":h=x(()=>Math.round(t.y+t.textMargin),"yfunc");break;case"middle":case"center":h=x(()=>Math.round(t.y+(s+r+t.textMargin)/2),"yfunc");break;case"bottom":case"end":h=x(()=>Math.round(t.y+(s+r+2*t.textMargin)-t.textMargin),"yfunc");break}if(t.anchor!==void 0&&t.textMargin!==void 0&&t.width!==void 0)switch(t.anchor){case"left":case"start":t.x=Math.round(t.x+t.textMargin),t.anchor="start",t.dominantBaseline="middle",t.alignmentBaseline="middle";break;case"middle":case"center":t.x=Math.round(t.x+t.width/2),t.anchor="middle",t.dominantBaseline="middle",t.alignmentBaseline="middle";break;case"right":case"end":t.x=Math.round(t.x+t.width-t.textMargin),t.anchor="end",t.dominantBaseline="middle",t.alignmentBaseline="middle";break}for(let[c,_]of n.entries()){t.textMargin!==void 0&&t.textMargin===0&&i!==void 0&&(E=c*i);let u=e.append("text");u.attr("x",t.x),u.attr("y",h()),t.anchor!==void 0&&u.attr("text-anchor",t.anchor).attr("dominant-baseline",t.dominantBaseline).attr("alignment-baseline",t.alignmentBaseline),t.fontFamily!==void 0&&u.style("font-family",t.fontFamily),a!==void 0&&u.style("font-size",a),t.fontWeight!==void 0&&u.style("font-weight",t.fontWeight),t.fill!==void 0&&u.attr("fill",t.fill),t.class!==void 0&&u.attr("class",t.class),t.dy!==void 0?u.attr("dy",t.dy):E!==0&&u.attr("dy",E);let y=_||Qe;if(t.tspan){let T=u.append("tspan");T.attr("x",t.x),t.fill!==void 0&&T.attr("fill",t.fill),T.text(y)}else u.text(y);t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0&&(r+=(u._groups||u)[0][0].getBBox().height,s=r),l.push(u)}return l},"drawText"),sr=x(function(e,t){function s(n,i,a,l,E){return n+","+i+" "+(n+a)+","+i+" "+(n+a)+","+(i+l-E)+" "+(n+a-E*1.2)+","+(i+l)+" "+n+","+(i+l)}x(s,"genPoints");let r=e.append("polygon");return r.attr("points",s(t.x,t.y,t.width,t.height,7)),r.attr("class","labelBox"),t.y=t.y+t.height/2,y
|
||
|
|
a ${R},${b} 0 0 0 0,${f.height}
|
||
|
|
h ${f.width-2*R}
|
||
|
|
a ${R},${b} 0 0 0 0,-${f.height}
|
||
|
|
Z
|
||
|
|
`;O.append("path").attr("d",N),A.append("path").attr("d",`M ${f.x},${f.y+b}
|
||
|
|
a ${R},${b} 0 0 0 0,${f.height}`),O.attr("transform",`translate(${R}, ${-(f.height/2)})`),A.attr("transform",`translate(${f.width-R}, ${-f.height/2})`),t.rectData=f,E==="neo"&&O.attr("filter","url(#drop-shadow)");let S=n.get(t.name)??0;if(Tt.has(h)&&(O.style("stroke",u[S%u.length]),O.style("fill",_[S%u.length]),A.style("stroke",u[S%u.length]),A.style("fill",_[S%u.length])),t.properties?.icon){let H=t.properties.icon.trim(),U=f.x+f.width-20,G=f.y+10;H.charAt(0)==="@"?Ft(T,U,G,H.substr(1)):Kt(T,U,G,H)}Et(s,Q(t.description))(t.description,T,f.x,f.y,f.width,f.height,{class:`actor ${Ht}`},s);let V=t.height,v=O.select("path:last-child");if(v.node()){let H=v.node().getBBox();t.height=H.height,V=H.height}return r||(T.attr("data-et","participant"),T.attr("data-type","queue"),T.attr("data-id",t.name)),V},"drawActorTypeQueue"),Ar=x(function(e,t,s,r,n,i){let a=r?t.stopy:t.starty,l=t.x+t.width/2,E=a+75,{look:h,theme:c,themeVariables:_}=s,{bkgColorArray:u,borderColorArray:y,actorBorder:T,actorBkg:f}=_,g=e.append("g").lower();r||(B++,g.append("line").attr("id","actor"+B).attr("x1",l).attr("y1",E).attr("x2",l).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=B);let b=e.append("g"),R=It;r?R+=` ${xt}`:R+=` ${gt}`,b.attr("class",R),b.attr("name",t.name);let O=lt();O.x=t.x,O.y=a,O.fill="#eaeaea",O.width=t.width,O.height=t.height,O.class="actor";let A=t.x+t.width/2,N=a+32,S=22;b.append("defs").append("marker").attr("id",n+"-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"),b.append("circle").attr("cx",A).attr("cy",N).attr("r",S).attr("filter",`${h==="neo"?"url(#drop-shadow)":""}`),b.append("line").attr("marker-end","url(#"+n+"-filled-head-control)").attr("transform",`translate(${A}, ${N-S})`);let V=i.get(t.name)??0;Tt.has(c)?(b.style("stroke",y[V%y.length]),b.style("fill",u[V%y.length])):(b.style("stroke",T),b.style("fill",f));let v=b.node().getBBox();return t.height=v.height+2*(s?.sequence?.labelBoxHeight??0),Et(s,Q(t.description))(t.description,b,O.x,O.y+S+(r?5:12),O.width,O.height,{class:`actor ${It}`},s),r||(b.attr("data-et","participant"),b.attr("data-type","control"),b.attr("data-id",t.name)),t.height},"drawActorTypeControl"),wr=x(function(e,t,s,r,n){let i=r?t.stopy:t.starty,a=t.x+t.width/2,l=i+75,{look:E,theme:h,themeVariables:c}=s,{bkgColorArray:_,borderColorArray:u}=c,y=e.append("g").lower(),T=e.append("g"),f="actor";r?f+=` ${xt}`:f+=` ${gt}`,T.attr("class",f),T.attr("name",t.name);let g=lt();g.x=t.x,g.y=i,g.fill="#eaeaea",g.width=t.width,g.height=t.height,g.class="actor";let b=t.x+t.width/2,R=i+(r?10:25),O=22;T.append("circle").attr("cx",b).attr("cy",R).attr("r",O).attr("width",t.width).attr("height",t.height),T.append("line").attr("x1",b-O).attr("x2",b+O).attr("y1",R+O).attr("y2",R+O).attr("stroke-width",2),E==="neo"&&T.attr("filter","url(#drop-shadow)");let A=n.get(t.name)??0;Tt.has(h)&&(T.style("stroke",u[A%u.length]),T.style("fill",_[A%u.length]));let N=T.node().getBBox();return t.height=N.height+(s?.sequence?.labelBoxHeight??0),r||(B++,y.append("line").attr("id","actor"+B).attr("x1",a).attr("y1",l).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=B),Et(s,Q(t.description))(t.description,T,g.x,g.y+(r?15:30),g.width,g.height,{class:`actor ${It}`},s),r?T.attr("transform",`translate(0, ${O})`):(T.attr("transform",`translate(0, ${O/2-5})`),T.attr("data-et","participant"),T.attr("data-type","entity"),T.attr("data-id",t.name)),t.height},"drawActorTypeEntity"),Sr=x(function(e,t,s,r,n){let i=r?t.stopy:t.starty,a=t.x+t.width/2,l=i+t.height+2*s.boxTextMargin,{theme:E,themeVariables:h,look:c}=s,{bkgColorArray:_,borderColorArray:u,actorBorder:y}=h,T=e.append("g").lower(),f=T;r||(B++,Object.keys(t.l
|
||
|
|
M ${g.x},${g.y+N}
|
||
|
|
a ${A},${N} 0 0 0 ${R},0
|
||
|
|
a ${A},${N} 0 0 0 -${R},0
|
||
|
|
l 0,${O-2*N}
|
||
|
|
a ${A},${N} 0 0 0 ${R},0
|
||
|
|
l 0,-${O-2*N}
|
||
|
|
`;S.append("path").attr("d",V),c==="neo"&&S.attr("filter","url(#drop-shadow)");let v=n.get(t.name)??0;Tt.has(E)?(S.style("stroke",u[v%u.length]),S.style("fill",_[v%u.length])):S.style("stroke",y),S.attr("transform",`translate(${R}, ${N})`),t.rectData=g,Et(s,Q(t.description))(t.description,f,g.x,g.y+35,g.width,g.height,{class:`actor ${Ht}`},s);let H=S.select("path:last-child");if(H.node()){let U=H.node().getBBox();t.height=U.height+(s.sequence.labelBoxHeight??0)}return r||(f.attr("data-et","participant"),f.attr("data-type","database"),f.attr("data-id",t.name)),t.height},"drawActorTypeDatabase"),kr=x(function(e,t,s,r,n){let i=r?t.stopy:t.starty,a=t.x+t.width/2,l=i+80,E=22,h=e.append("g").lower(),{look:c,theme:_,themeVariables:u}=s,{bkgColorArray:y,borderColorArray:T,actorBorder:f}=u;r||(B++,h.append("line").attr("id","actor"+B).attr("x1",a).attr("y1",l).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=B);let g=e.append("g"),b=It;r?b+=` ${xt}`:b+=` ${gt}`,g.attr("class",b),g.attr("name",t.name);let R=lt();R.x=t.x,R.y=i,R.fill="#eaeaea",R.width=t.width,R.height=t.height,R.class="actor",g.append("line").attr("id","actor-man-torso"+B).attr("x1",t.x+t.width/2-E*2.5).attr("y1",i+12).attr("x2",t.x+t.width/2-15).attr("y2",i+12),g.append("line").attr("id","actor-man-arms"+B).attr("x1",t.x+t.width/2-E*2.5).attr("y1",i+2).attr("x2",t.x+t.width/2-E*2.5).attr("y2",i+22),g.append("circle").attr("cx",t.x+t.width/2).attr("cy",i+12).attr("r",E),c==="neo"&&g.attr("filter","url(#drop-shadow)");let O=n.get(t.name)??0;Tt.has(_)?(g.style("stroke",T[O%T.length]),g.style("fill",y[O%T.length])):g.style("stroke",f);let A=g.node().getBBox();return t.height=A.height+(s.sequence.labelBoxHeight??0),Et(s,Q(t.description))(t.description,g,R.x,R.y+15,R.width,R.height,{class:`actor ${It}`},s),g.attr("transform",`translate(0,${E/2+10})`),r||(g.attr("data-et","participant"),g.attr("data-type","boundary"),g.attr("data-id",t.name)),t.height},"drawActorTypeBoundary"),Pr=x(function(e,t,s,r,n){let i=r?t.stopy:t.starty,a=t.x+t.width/2,l=i+80,{look:E,theme:h,themeVariables:c}=s,{bkgColorArray:_,borderColorArray:u,actorBorder:y}=c,T=e.append("g").lower();r||(B++,T.append("line").attr("id","actor"+B).attr("x1",a).attr("y1",l).attr("x2",a).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=B);let f=e.append("g"),g=It;r?g+=` ${xt}`:g+=` ${gt}`,f.attr("class",g),f.attr("name",t.name),r||f.attr("data-et","participant").attr("data-type","actor").attr("data-id",t.name);let b=E==="neo"?.5:1,R=E==="neo"?i+(1-b)*30:i;f.append("line").attr("id","actor-man-torso"+B).attr("x1",a).attr("y1",R+25*b).attr("x2",a).attr("y2",R+45*b),f.append("line").attr("id","actor-man-arms"+B).attr("x1",a-ft/2*b).attr("y1",R+33*b).attr("x2",a+ft/2*b).attr("y2",R+33*b),f.append("line").attr("x1",a-ft/2*b).attr("y1",R+60*b).attr("x2",a).attr("y2",R+45*b),f.append("line").attr("x1",a).attr("y1",R+45*b).attr("x2",a+(ft/2-2)*b).attr("y2",R+60*b);let O=f.append("circle");O.attr("cx",t.x+t.width/2),O.attr("cy",R+10*b),O.attr("r",15*b),O.attr("width",t.width*b),O.attr("height",t.height*b);let A=f.node().getBBox();t.height=A.height;let N=lt();N.x=t.x,N.y=R,N.fill="#eaeaea",N.width=t.width,N.height=t.height/b,N.class="actor",N.rx=3,N.ry=3;let S=n.get(t.name)??0;return Tt.has(h)?(f.style("stroke",u[S%u.length]),f.style("fill",_[S%u.length])):f.style("stroke",y),Et(s,Q(t.description))(t.description,f,N.x,R+35*b-(E==="neo"?10:0),N.width,N.height,{class:`actor ${It}`},s),t.height},"drawActorTypeActor"),Dr=x(async function(e,t,s,r,n,i,a){let l=a??new Map([...i.db.getActors().values()].map((E,h)=>[E.name,h]));switch(t.type){case"actor":return await Pr(e,t,s,r,l);case"participant":return await Or(e,t,s,r,l);case"boundary":return await kr(e,t,s,r,l);case"control":return await Ar(e,t,s,r,n,l);case"entity":return await wr(e,t,s,r,l);case"database":ret
|