omni-context-cli 0.0.47 → 0.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +7 -7
- package/dist/clients/extension.vsix +0 -0
- package/dist/clients/web/assets/{_baseUniq-CX8zlFs7.js → _baseUniq-O6Fk0Wzr.js} +1 -1
- package/dist/clients/web/assets/{arc-CEtF1EGj.js → arc-n0x23Ctx.js} +1 -1
- package/dist/clients/web/assets/{architectureDiagram-VXUJARFQ-Bx7GTL6B.js → architectureDiagram-VXUJARFQ-siUxtu84.js} +1 -1
- package/dist/clients/web/assets/{blockDiagram-VD42YOAC-BjtcSSV-.js → blockDiagram-VD42YOAC-DSqh9eGY.js} +1 -1
- package/dist/clients/web/assets/{c4Diagram-YG6GDRKO-BAvYJX3s.js → c4Diagram-YG6GDRKO-wYR7H7xi.js} +1 -1
- package/dist/clients/web/assets/channel-NwuYDCTJ.js +1 -0
- package/dist/clients/web/assets/{chunk-4BX2VUAB-VDvSCKz9.js → chunk-4BX2VUAB-Cay_iY5D.js} +1 -1
- package/dist/clients/web/assets/{chunk-55IACEB6-BBVxwshD.js → chunk-55IACEB6-BeMIObm3.js} +1 -1
- package/dist/clients/web/assets/{chunk-B4BG7PRW-ZHWNFyzz.js → chunk-B4BG7PRW-B6cIgi7d.js} +1 -1
- package/dist/clients/web/assets/{chunk-DI55MBZ5-BSKWux3O.js → chunk-DI55MBZ5-BXrfKlO3.js} +1 -1
- package/dist/clients/web/assets/{chunk-FMBD7UC4-AuNRiNqR.js → chunk-FMBD7UC4-67W1cNu_.js} +1 -1
- package/dist/clients/web/assets/{chunk-QN33PNHL-08F21gyd.js → chunk-QN33PNHL-DuPwsSus.js} +1 -1
- package/dist/clients/web/assets/{chunk-QZHKN3VN-CofegEKu.js → chunk-QZHKN3VN-DWUuzBl_.js} +1 -1
- package/dist/clients/web/assets/{chunk-TZMSLE5B-BvK53YZ4.js → chunk-TZMSLE5B-D3SRAd4i.js} +1 -1
- package/dist/clients/web/assets/classDiagram-2ON5EDUG-CA17y53i.js +1 -0
- package/dist/clients/web/assets/classDiagram-v2-WZHVMYZB-CA17y53i.js +1 -0
- package/dist/clients/web/assets/clone-Ccjp7w8U.js +1 -0
- package/dist/clients/web/assets/{cose-bilkent-S5V4N54A-DB1D1TCj.js → cose-bilkent-S5V4N54A-2yiAjDsY.js} +1 -1
- package/dist/clients/web/assets/{dagre-6UL2VRFP-B1HQaAFZ.js → dagre-6UL2VRFP-DWtKyQlZ.js} +1 -1
- package/dist/clients/web/assets/{diagram-PSM6KHXK-DoaRQlVL.js → diagram-PSM6KHXK-BsH8ucOy.js} +1 -1
- package/dist/clients/web/assets/{diagram-QEK2KX5R-BLNm2-9U.js → diagram-QEK2KX5R-CgAM_caT.js} +1 -1
- package/dist/clients/web/assets/{diagram-S2PKOQOG-D_HqKRem.js → diagram-S2PKOQOG-5sXZE5fB.js} +1 -1
- package/dist/clients/web/assets/{erDiagram-Q2GNP2WA-3_FAiuzS.js → erDiagram-Q2GNP2WA-SZjIGLfC.js} +1 -1
- package/dist/clients/web/assets/{flowDiagram-NV44I4VS-DF5j5IcG.js → flowDiagram-NV44I4VS-B13r1-Qr.js} +1 -1
- package/dist/clients/web/assets/{ganttDiagram-JELNMOA3-CnaU1KSb.js → ganttDiagram-JELNMOA3-tnNnlmJ_.js} +1 -1
- package/dist/clients/web/assets/{gitGraphDiagram-NY62KEGX-BSXDh8sZ.js → gitGraphDiagram-NY62KEGX-D3vXxiLR.js} +1 -1
- package/dist/clients/web/assets/{graph-CIxq09py.js → graph-yEZO5As9.js} +1 -1
- package/dist/clients/web/assets/index-BvMYTiOr.js +27 -0
- package/dist/clients/web/assets/{index-BPEUmvhI.css → index-bgcKJQwq.css} +1 -1
- package/dist/clients/web/assets/{infoDiagram-WHAUD3N6-gI-yNEYD.js → infoDiagram-WHAUD3N6-Diqs41Bs.js} +1 -1
- package/dist/clients/web/assets/{journeyDiagram-XKPGCS4Q-DoW4VOKO.js → journeyDiagram-XKPGCS4Q-CsFCBnpU.js} +1 -1
- package/dist/clients/web/assets/{kanban-definition-3W4ZIXB7-Bg8UfgUx.js → kanban-definition-3W4ZIXB7-ToLQEJ6t.js} +1 -1
- package/dist/clients/web/assets/{layout--4uVmx-N.js → layout-DAYHKwLI.js} +1 -1
- package/dist/clients/web/assets/{linear-DpKhln-O.js → linear-C6-59Tkb.js} +1 -1
- package/dist/clients/web/assets/{min-Bbgp4eqd.js → min-CcGwUInn.js} +1 -1
- package/dist/clients/web/assets/{mindmap-definition-VGOIOE7T-Skdk9vHD.js → mindmap-definition-VGOIOE7T-DUxl95g0.js} +1 -1
- package/dist/clients/web/assets/{pieDiagram-ADFJNKIX-C8gHhlA5.js → pieDiagram-ADFJNKIX-B01HV9sF.js} +1 -1
- package/dist/clients/web/assets/{quadrantDiagram-AYHSOK5B-CvVDIbhx.js → quadrantDiagram-AYHSOK5B-CeqFw4rm.js} +1 -1
- package/dist/clients/web/assets/{requirementDiagram-UZGBJVZJ-B7FfYgDE.js → requirementDiagram-UZGBJVZJ-CFCoQIAQ.js} +1 -1
- package/dist/clients/web/assets/{sankeyDiagram-TZEHDZUN-RBHSZdpT.js → sankeyDiagram-TZEHDZUN-C4bOlCv6.js} +1 -1
- package/dist/clients/web/assets/{sequenceDiagram-WL72ISMW-GYnvN6gJ.js → sequenceDiagram-WL72ISMW-CmcZq0aE.js} +1 -1
- package/dist/clients/web/assets/{stateDiagram-FKZM4ZOC-C-2OA1RE.js → stateDiagram-FKZM4ZOC-BrC_Infp.js} +1 -1
- package/dist/clients/web/assets/stateDiagram-v2-4FDKWEC3-Bi_Pj5vD.js +1 -0
- package/dist/clients/web/assets/{timeline-definition-IT6M3QCI-DVtVZUgn.js → timeline-definition-IT6M3QCI-C25RxMkJ.js} +1 -1
- package/dist/clients/web/assets/{treemap-KMMF4GRG-B8bK_hZH.js → treemap-KMMF4GRG-CYbXQA3w.js} +1 -1
- package/dist/clients/web/assets/{xychartDiagram-PRI3JC2R-B9ykwY9D.js → xychartDiagram-PRI3JC2R-DxEjdm1o.js} +1 -1
- package/dist/clients/web/index.html +6 -3
- package/package.json +1 -1
- package/dist/clients/web/assets/channel-Cx3BbvCA.js +0 -1
- package/dist/clients/web/assets/classDiagram-2ON5EDUG-DaIzUzAc.js +0 -1
- package/dist/clients/web/assets/classDiagram-v2-WZHVMYZB-DaIzUzAc.js +0 -1
- package/dist/clients/web/assets/clone-qk7TfhGG.js +0 -1
- package/dist/clients/web/assets/index-BjhzeLhE.js +0 -27
- package/dist/clients/web/assets/stateDiagram-v2-4FDKWEC3-DswVao59.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var t;import{a as e,b as s,g as i,d as a,c as n,e as r}from"./chunk-TZMSLE5B-BvK53YZ4.js";import{_ as o,n as c,c as l,d as h,l as d,j as u,e as p,f,k as y,b,s as x,p as v,a as m,g as k,q as g,t as w,J as T,y as _,i as A,u as $,L as I,M as O,N as E,Z as L,O as S,P as N,F as D}from"./index-BjhzeLhE.js";import{I as M}from"./chunk-QZHKN3VN-CofegEKu.js";var P=function(){var t=o(function(t,e,s,i){for(s=s||{},i=t.length;i--;s[t[i]]=e);return s},"o"),e=[1,2],s=[1,3],i=[1,4],a=[2,4],n=[1,9],r=[1,11],c=[1,13],l=[1,14],h=[1,16],d=[1,17],u=[1,18],p=[1,24],f=[1,25],y=[1,26],b=[1,27],x=[1,28],v=[1,29],m=[1,30],k=[1,31],g=[1,32],w=[1,33],T=[1,34],_=[1,35],A=[1,36],$=[1,37],I=[1,38],O=[1,39],E=[1,41],L=[1,42],S=[1,43],N=[1,44],D=[1,45],M=[1,46],P=[1,4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,48,49,50,52,53,55,60,61,62,63,71],R=[2,71],C=[4,5,16,50,52,53],B=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,55,60,61,62,63,71],F=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,49,50,52,53,55,60,61,62,63,71],q=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,48,50,52,53,55,60,61,62,63,71],W=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,50,52,53,55,60,61,62,63,71],j=[69,70,71],z=[1,127],V={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,box_section:10,box_line:11,participant_statement:12,create:13,box:14,restOfLine:15,end:16,signal:17,autonumber:18,NUM:19,off:20,activate:21,actor:22,deactivate:23,note_statement:24,links_statement:25,link_statement:26,properties_statement:27,details_statement:28,title:29,legacy_title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,loop:36,rect:37,opt:38,alt:39,else_sections:40,par:41,par_sections:42,par_over:43,critical:44,option_sections:45,break:46,option:47,and:48,else:49,participant:50,AS:51,participant_actor:52,destroy:53,actor_with_config:54,note:55,placement:56,text2:57,over:58,actor_pair:59,links:60,link:61,properties:62,details:63,spaceList:64,",":65,left_of:66,right_of:67,signaltype:68,"+":69,"-":70,ACTOR:71,config_object:72,CONFIG_START:73,CONFIG_CONTENT:74,CONFIG_END:75,SOLID_OPEN_ARROW:76,DOTTED_OPEN_ARROW:77,SOLID_ARROW:78,BIDIRECTIONAL_SOLID_ARROW:79,DOTTED_ARROW:80,BIDIRECTIONAL_DOTTED_ARROW:81,SOLID_CROSS:82,DOTTED_CROSS:83,SOLID_POINT:84,DOTTED_POINT:85,TXT:86,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",13:"create",14:"box",15:"restOfLine",16:"end",18:"autonumber",19:"NUM",20:"off",21:"activate",23:"deactivate",29:"title",30:"legacy_title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"loop",37:"rect",38:"opt",39:"alt",41:"par",43:"par_over",44:"critical",46:"break",47:"option",48:"and",49:"else",50:"participant",51:"AS",52:"participant_actor",53:"destroy",55:"note",58:"over",60:"links",61:"link",62:"properties",63:"details",65:",",66:"left_of",67:"right_of",69:"+",70:"-",71:"ACTOR",73:"CONFIG_START",74:"CONFIG_CONTENT",75:"CONFIG_END",76:"SOLID_OPEN_ARROW",77:"DOTTED_OPEN_ARROW",78:"SOLID_ARROW",79:"BIDIRECTIONAL_SOLID_ARROW",80:"DOTTED_ARROW",81:"BIDIRECTIONAL_DOTTED_ARROW",82:"SOLID_CROSS",83:"DOTTED_CROSS",84:"SOLID_POINT",85:"DOTTED_POINT",86:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[10,0],[10,2],[11,2],[11,1],[11,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[45,1],[45,4],[42,1],[42,4],[40,1],[40,4],[12,5],[12,3],[12,5],[12,3],[12,3],[12,3],[24,4],[24,4],[25,3],[26,3],[27,3],[28,3],[64,2],[64,1],[59,3],[59,1],[56,1],[56,1],[17,5],[17,5],[17,4],[54,2],[72,3],[22,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[57,1]],performAction:o(function(t,e,s,i,a,n,r){var o=n.length-1;switch(a){case 3:return i.apply(n[o]),n[o];case 4:case 9:case 8:case 13:this.$=[];break;case 5:case 10:n[o-1].push(n[o]),this.$=n[o-1];break;case 6:case 7:case 11:case 12:case 63:this.$=n[o];break;case 15:n[o].type="createParticipant",this.$=n[o];break;case 16:n[o-1].unshift({type:"boxStart",boxData:i.parseBoxData(n[o-2])}),n[o-1].push({type:"boxEnd",boxText:n[o-2]}),this.$=n[o-1];break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(n[o-2]),sequenceIndexStep:Number(n[o-1]),sequenceVisible:!0,signalType:i.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(n[o-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:i.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:i.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:i.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"activeStart",signalType:i.LINETYPE.ACTIVE_START,actor:n[o-1].actor};break;case 23:this.$={type:"activeEnd",signalType:i.LINETYPE.ACTIVE_END,actor:n[o-1].actor};break;case 29:i.setDiagramTitle(n[o].substring(6)),this.$=n[o].substring(6);break;case 30:i.setDiagramTitle(n[o].substring(7)),this.$=n[o].substring(7);break;case 31:this.$=n[o].trim(),i.setAccTitle(this.$);break;case 32:case 33:this.$=n[o].trim(),i.setAccDescription(this.$);break;case 34:n[o-1].unshift({type:"loopStart",loopText:i.parseMessage(n[o-2]),signalType:i.LINETYPE.LOOP_START}),n[o-1].push({type:"loopEnd",loopText:n[o-2],signalType:i.LINETYPE.LOOP_END}),this.$=n[o-1];break;case 35:n[o-1].unshift({type:"rectStart",color:i.parseMessage(n[o-2]),signalType:i.LINETYPE.RECT_START}),n[o-1].push({type:"rectEnd",color:i.parseMessage(n[o-2]),signalType:i.LINETYPE.RECT_END}),this.$=n[o-1];break;case 36:n[o-1].unshift({type:"optStart",optText:i.parseMessage(n[o-2]),signalType:i.LINETYPE.OPT_START}),n[o-1].push({type:"optEnd",optText:i.parseMessage(n[o-2]),signalType:i.LINETYPE.OPT_END}),this.$=n[o-1];break;case 37:n[o-1].unshift({type:"altStart",altText:i.parseMessage(n[o-2]),signalType:i.LINETYPE.ALT_START}),n[o-1].push({type:"altEnd",signalType:i.LINETYPE.ALT_END}),this.$=n[o-1];break;case 38:n[o-1].unshift({type:"parStart",parText:i.parseMessage(n[o-2]),signalType:i.LINETYPE.PAR_START}),n[o-1].push({type:"parEnd",signalType:i.LINETYPE.PAR_END}),this.$=n[o-1];break;case 39:n[o-1].unshift({type:"parStart",parText:i.parseMessage(n[o-2]),signalType:i.LINETYPE.PAR_OVER_START}),n[o-1].push({type:"parEnd",signalType:i.LINETYPE.PAR_END}),this.$=n[o-1];break;case 40:n[o-1].unshift({type:"criticalStart",criticalText:i.parseMessage(n[o-2]),signalType:i.LINETYPE.CRITICAL_START}),n[o-1].push({type:"criticalEnd",signalType:i.LINETYPE.CRITICAL_END}),this.$=n[o-1];break;case 41:n[o-1].unshift({type:"breakStart",breakText:i.parseMessage(n[o-2]),signalType:i.LINETYPE.BREAK_START}),n[o-1].push({type:"breakEnd",optText:i.parseMessage(n[o-2]),signalType:i.LINETYPE.BREAK_END}),this.$=n[o-1];break;case 43:this.$=n[o-3].concat([{type:"option",optionText:i.parseMessage(n[o-1]),signalType:i.LINETYPE.CRITICAL_OPTION},n[o]]);break;case 45:this.$=n[o-3].concat([{type:"and",parText:i.parseMessage(n[o-1]),signalType:i.LINETYPE.PAR_AND},n[o]]);break;case 47:this.$=n[o-3].concat([{type:"else",altText:i.parseMessage(n[o-1]),signalType:i.LINETYPE.ALT_ELSE},n[o]]);break;case 48:n[o-3].draw="participant",n[o-3].type="addParticipant",n[o-3].description=i.parseMessage(n[o-1]),this.$=n[o-3];break;case 49:case 53:n[o-1].draw="participant",n[o-1].type="addParticipant",this.$=n[o-1];break;case 50:n[o-3].draw="actor",n[o-3].type="addParticipant",n[o-3].description=i.parseMessage(n[o-1]),this.$=n[o-3];break;case 51:n[o-1].draw="actor",n[o-1].type="addParticipant",this.$=n[o-1];break;case 52:n[o-1].type="destroyParticipant",this.$=n[o-1];break;case 54:this.$=[n[o-1],{type:"addNote",placement:n[o-2],actor:n[o-1].actor,text:n[o]}];break;case 55:n[o-2]=[].concat(n[o-1],n[o-1]).slice(0,2),n[o-2][0]=n[o-2][0].actor,n[o-2][1]=n[o-2][1].actor,this.$=[n[o-1],{type:"addNote",placement:i.PLACEMENT.OVER,actor:n[o-2].slice(0,2),text:n[o]}];break;case 56:this.$=[n[o-1],{type:"addLinks",actor:n[o-1].actor,text:n[o]}];break;case 57:this.$=[n[o-1],{type:"addALink",actor:n[o-1].actor,text:n[o]}];break;case 58:this.$=[n[o-1],{type:"addProperties",actor:n[o-1].actor,text:n[o]}];break;case 59:this.$=[n[o-1],{type:"addDetails",actor:n[o-1].actor,text:n[o]}];break;case 62:this.$=[n[o-2],n[o]];break;case 64:this.$=i.PLACEMENT.LEFTOF;break;case 65:this.$=i.PLACEMENT.RIGHTOF;break;case 66:this.$=[n[o-4],n[o-1],{type:"addMessage",from:n[o-4].actor,to:n[o-1].actor,signalType:n[o-3],msg:n[o],activate:!0},{type:"activeStart",signalType:i.LINETYPE.ACTIVE_START,actor:n[o-1].actor}];break;case 67:this.$=[n[o-4],n[o-1],{type:"addMessage",from:n[o-4].actor,to:n[o-1].actor,signalType:n[o-3],msg:n[o]},{type:"activeEnd",signalType:i.LINETYPE.ACTIVE_END,actor:n[o-4].actor}];break;case 68:this.$=[n[o-3],n[o-1],{type:"addMessage",from:n[o-3].actor,to:n[o-1].actor,signalType:n[o-2],msg:n[o]}];break;case 69:this.$={type:"addParticipant",actor:n[o-1],config:n[o]};break;case 70:this.$=n[o-1].trim();break;case 71:this.$={type:"addParticipant",actor:n[o]};break;case 72:this.$=i.LINETYPE.SOLID_OPEN;break;case 73:this.$=i.LINETYPE.DOTTED_OPEN;break;case 74:this.$=i.LINETYPE.SOLID;break;case 75:this.$=i.LINETYPE.BIDIRECTIONAL_SOLID;break;case 76:this.$=i.LINETYPE.DOTTED;break;case 77:this.$=i.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 78:this.$=i.LINETYPE.SOLID_CROSS;break;case 79:this.$=i.LINETYPE.DOTTED_CROSS;break;case 80:this.$=i.LINETYPE.SOLID_POINT;break;case 81:this.$=i.LINETYPE.DOTTED_POINT;break;case 82:this.$=i.parseMessage(n[o].trim().substring(1))}},"anonymous"),table:[{3:1,4:e,5:s,6:i},{1:[3]},{3:5,4:e,5:s,6:i},{3:6,4:e,5:s,6:i},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,55,60,61,62,63,71],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:n,5:r,8:8,9:10,12:12,13:c,14:l,17:15,18:h,21:d,22:40,23:u,24:19,25:20,26:21,27:22,28:23,29:p,30:f,31:y,33:b,35:x,36:v,37:m,38:k,39:g,41:w,43:T,44:_,46:A,50:$,52:I,53:O,55:E,60:L,61:S,62:N,63:D,71:M},t(P,[2,5]),{9:47,12:12,13:c,14:l,17:15,18:h,21:d,22:40,23:u,24:19,25:20,26:21,27:22,28:23,29:p,30:f,31:y,33:b,35:x,36:v,37:m,38:k,39:g,41:w,43:T,44:_,46:A,50:$,52:I,53:O,55:E,60:L,61:S,62:N,63:D,71:M},t(P,[2,7]),t(P,[2,8]),t(P,[2,14]),{12:48,50:$,52:I,53:O},{15:[1,49]},{5:[1,50]},{5:[1,53],19:[1,51],20:[1,52]},{22:54,71:M},{22:55,71:M},{5:[1,56]},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},t(P,[2,29]),t(P,[2,30]),{32:[1,61]},{34:[1,62]},t(P,[2,33]),{15:[1,63]},{15:[1,64]},{15:[1,65]},{15:[1,66]},{15:[1,67]},{15:[1,68]},{15:[1,69]},{15:[1,70]},{22:71,54:72,71:[1,73]},{22:74,71:M},{22:75,71:M},{68:76,76:[1,77],77:[1,78],78:[1,79],79:[1,80],80:[1,81],81:[1,82],82:[1,83],83:[1,84],84:[1,85],85:[1,86]},{56:87,58:[1,88],66:[1,89],67:[1,90]},{22:91,71:M},{22:92,71:M},{22:93,71:M},{22:94,71:M},t([5,51,65,76,77,78,79,80,81,82,83,84,85,86],R),t(P,[2,6]),t(P,[2,15]),t(C,[2,9],{10:95}),t(P,[2,17]),{5:[1,97],19:[1,96]},{5:[1,98]},t(P,[2,21]),{5:[1,99]},{5:[1,100]},t(P,[2,24]),t(P,[2,25]),t(P,[2,26]),t(P,[2,27]),t(P,[2,28]),t(P,[2,31]),t(P,[2,32]),t(B,a,{7:101}),t(B,a,{7:102}),t(B,a,{7:103}),t(F,a,{40:104,7:105}),t(q,a,{42:106,7:107}),t(q,a,{7:107,42:108}),t(W,a,{45:109,7:110}),t(B,a,{7:111}),{5:[1,113],51:[1,112]},{5:[1,114]},t([5,51],R,{72:115,73:[1,116]}),{5:[1,118],51:[1,117]},{5:[1,119]},{22:122,69:[1,120],70:[1,121],71:M},t(j,[2,72]),t(j,[2,73]),t(j,[2,74]),t(j,[2,75]),t(j,[2,76]),t(j,[2,77]),t(j,[2,78]),t(j,[2,79]),t(j,[2,80]),t(j,[2,81]),{22:123,71:M},{22:125,59:124,71:M},{71:[2,64]},{71:[2,65]},{57:126,86:z},{57:128,86:z},{57:129,86:z},{57:130,86:z},{4:[1,133],5:[1,135],11:132,12:134,16:[1,131],50:$,52:I,53:O},{5:[1,136]},t(P,[2,19]),t(P,[2,20]),t(P,[2,22]),t(P,[2,23]),{4:n,5:r,8:8,9:10,12:12,13:c,14:l,16:[1,137],17:15,18:h,21:d,22:40,23:u,24:19,25:20,26:21,27:22,28:23,29:p,30:f,31:y,33:b,35:x,36:v,37:m,38:k,39:g,41:w,43:T,44:_,46:A,50:$,52:I,53:O,55:E,60:L,61:S,62:N,63:D,71:M},{4:n,5:r,8:8,9:10,12:12,13:c,14:l,16:[1,138],17:15,18:h,21:d,22:40,23:u,24:19,25:20,26:21,27:22,28:23,29:p,30:f,31:y,33:b,35:x,36:v,37:m,38:k,39:g,41:w,43:T,44:_,46:A,50:$,52:I,53:O,55:E,60:L,61:S,62:N,63:D,71:M},{4:n,5:r,8:8,9:10,12:12,13:c,14:l,16:[1,139],17:15,18:h,21:d,22:40,23:u,24:19,25:20,26:21,27:22,28:23,29:p,30:f,31:y,33:b,35:x,36:v,37:m,38:k,39:g,41:w,43:T,44:_,46:A,50:$,52:I,53:O,55:E,60:L,61:S,62:N,63:D,71:M},{16:[1,140]},{4:n,5:r,8:8,9:10,12:12,13:c,14:l,16:[2,46],17:15,18:h,21:d,22:40,23:u,24:19,25:20,26:21,27:22,28:23,29:p,30:f,31:y,33:b,35:x,36:v,37:m,38:k,39:g,41:w,43:T,44:_,46:A,49:[1,141],50:$,52:I,53:O,55:E,60:L,61:S,62:N,63:D,71:M},{16:[1,142]},{4:n,5:r,8:8,9:10,12:12,13:c,14:l,16:[2,44],17:15,18:h,21:d,22:40,23:u,24:19,25:20,26:21,27:22,28:23,29:p,30:f,31:y,33:b,35:x,36:v,37:m,38:k,39:g,41:w,43:T,44:_,46:A,48:[1,143],50:$,52:I,53:O,55:E,60:L,61:S,62:N,63:D,71:M},{16:[1,144]},{16:[1,145]},{4:n,5:r,8:8,9:10,12:12,13:c,14:l,16:[2,42],17:15,18:h,21:d,22:40,23:u,24:19,25:20,26:21,27:22,28:23,29:p,30:f,31:y,33:b,35:x,36:v,37:m,38:k,39:g,41:w,43:T,44:_,46:A,47:[1,146],50:$,52:I,53:O,55:E,60:L,61:S,62:N,63:D,71:M},{4:n,5:r,8:8,9:10,12:12,13:c,14:l,16:[1,147],17:15,18:h,21:d,22:40,23:u,24:19,25:20,26:21,27:22,28:23,29:p,30:f,31:y,33:b,35:x,36:v,37:m,38:k,39:g,41:w,43:T,44:_,46:A,50:$,52:I,53:O,55:E,60:L,61:S,62:N,63:D,71:M},{15:[1,148]},t(P,[2,49]),t(P,[2,53]),{5:[2,69]},{74:[1,149]},{15:[1,150]},t(P,[2,51]),t(P,[2,52]),{22:151,71:M},{22:152,71:M},{57:153,86:z},{57:154,86:z},{57:155,86:z},{65:[1,156],86:[2,63]},{5:[2,56]},{5:[2,82]},{5:[2,57]},{5:[2,58]},{5:[2,59]},t(P,[2,16]),t(C,[2,10]),{12:157,50:$,52:I,53:O},t(C,[2,12]),t(C,[2,13]),t(P,[2,18]),t(P,[2,34]),t(P,[2,35]),t(P,[2,36]),t(P,[2,37]),{15:[1,158]},t(P,[2,38]),{15:[1,159]},t(P,[2,39]),t(P,[2,40]),{15:[1,160]},t(P,[2,41]),{5:[1,161]},{75:[1,162]},{5:[1,163]},{57:164,86:z},{57:165,86:z},{5:[2,68]},{5:[2,54]},{5:[2,55]},{22:166,71:M},t(C,[2,11]),t(F,a,{7:105,40:167}),t(q,a,{7:107,42:168}),t(W,a,{7:110,45:169}),t(P,[2,48]),{5:[2,70]},t(P,[2,50]),{5:[2,66]},{5:[2,67]},{86:[2,62]},{16:[2,47]},{16:[2,45]},{16:[2,43]}],defaultActions:{5:[2,1],6:[2,2],89:[2,64],90:[2,65],115:[2,69],126:[2,56],127:[2,82],128:[2,57],129:[2,58],130:[2,59],153:[2,68],154:[2,54],155:[2,55],162:[2,70],164:[2,66],165:[2,67],166:[2,62],167:[2,47],168:[2,45],169:[2,43]},parseError:o(function(t,e){if(!e.recoverable){var s=new Error(t);throw s.hash=e,s}this.trace(t)},"parseError"),parse:o(function(t){var e=this,s=[0],i=[],a=[null],n=[],r=this.table,c="",l=0,h=0,d=n.slice.call(arguments,1),u=Object.create(this.lexer),p={yy:{}};for(var f in this.yy)Object.prototype.hasOwnProperty.call(this.yy,f)&&(p.yy[f]=this.yy[f]);u.setInput(t,p.yy),p.yy.lexer=u,p.yy.parser=this,void 0===u.yylloc&&(u.yylloc={});var y=u.yylloc;n.push(y);var b=u.options&&u.options.ranges;function x(){var t;return"number"!=typeof(t=i.pop()||u.lex()||1)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(function(t){s.length=s.length-2*t,a.length=a.length-t,n.length=n.length-t},"popStack"),o(x,"lex");for(var v,m,k,g,w,T,_,A,$={};;){if(m=s[s.length-1],this.defaultActions[m]?k=this.defaultActions[m]:(null==v&&(v=x()),k=r[m]&&r[m][v]),void 0===k||!k.length||!k[0]){var I="";for(w in A=[],r[m])this.terminals_[w]&&w>2&&A.push("'"+this.terminals_[w]+"'");I=u.showPosition?"Parse error on line "+(l+1)+":\n"+u.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==v?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(I,{text:u.match,token:this.terminals_[v]||v,line:u.yylineno,loc:y,expected:A})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+m+", token: "+v);switch(k[0]){case 1:s.push(v),a.push(u.yytext),n.push(u.yylloc),s.push(k[1]),v=null,h=u.yyleng,c=u.yytext,l=u.yylineno,y=u.yylloc;break;case 2:if(T=this.productions_[k[1]][1],$.$=a[a.length-T],$._$={first_line:n[n.length-(T||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(T||1)].first_column,last_column:n[n.length-1].last_column},b&&($._$.range=[n[n.length-(T||1)].range[0],n[n.length-1].range[1]]),void 0!==(g=this.performAction.apply($,[c,h,l,p.yy,k[1],a,n].concat(d))))return g;T&&(s=s.slice(0,-1*T*2),a=a.slice(0,-1*T),n=n.slice(0,-1*T)),s.push(this.productions_[k[1]][0]),a.push($.$),n.push($._$),_=r[s[s.length-2]][s[s.length-1]],s.push(_);break;case 3:return!0}}return!0},"parse")},H=function(){return{EOF:1,parseError:o(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:o(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:o(function(t){var e=t.length,s=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),s.length-1&&(this.yylineno-=s.length-1);var a=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:s?(s.length===i.length?this.yylloc.first_column:0)+i[i.length-s.length].length-s[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[a[0],a[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:o(function(t){this.unput(this.match.slice(t))},"less"),pastInput:o(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:o(function(t,e){var s,i,a;if(this.options.backtrack_lexer&&(a={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&&(a.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],s=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack){for(var n in a)this[n]=a[n];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;var t,e,s,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var a=this._currentRules(),n=0;n<a.length;n++)if((s=this._input.match(this.rules[a[n]]))&&(!e||s[0].length>e[0].length)){if(e=s,i=n,this.options.backtrack_lexer){if(!1!==(t=this.test_match(s,a[n])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,a[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var t=this.next();return t||this.lex()},"lex"),begin:o(function(t){this.conditionStack.push(t)},"begin"),popState:o(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:o(function(t){this.begin(t)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(t,e,s,i){switch(s){case 0:case 56:case 72:return 5;case 1:case 2:case 3:case 4:case 5:break;case 6:return 19;case 7:return this.begin("CONFIG"),73;case 8:return 74;case 9:return this.popState(),this.popState(),75;case 10:case 57:return e.yytext=e.yytext.trim(),71;case 11:case 17:return e.yytext=e.yytext.trim(),this.begin("ALIAS"),71;case 12:return this.begin("LINE"),14;case 13:return this.begin("ID"),50;case 14:return this.begin("ID"),52;case 15:return 13;case 16:return this.begin("ID"),53;case 18:return this.popState(),this.popState(),this.begin("LINE"),51;case 19:return this.popState(),this.popState(),5;case 20:return this.begin("LINE"),36;case 21:return this.begin("LINE"),37;case 22:return this.begin("LINE"),38;case 23:return this.begin("LINE"),39;case 24:return this.begin("LINE"),49;case 25:return this.begin("LINE"),41;case 26:return this.begin("LINE"),43;case 27:return this.begin("LINE"),48;case 28:return this.begin("LINE"),44;case 29:return this.begin("LINE"),47;case 30:return this.begin("LINE"),46;case 31:return this.popState(),15;case 32:return 16;case 33:return 66;case 34:return 67;case 35:return 60;case 36:return 61;case 37:return 62;case 38:return 63;case 39:return 58;case 40:return 55;case 41:return this.begin("ID"),21;case 42:return this.begin("ID"),23;case 43:return 29;case 44:return 30;case 45:return this.begin("acc_title"),31;case 46:return this.popState(),"acc_title_value";case 47:return this.begin("acc_descr"),33;case 48:return this.popState(),"acc_descr_value";case 49:this.begin("acc_descr_multiline");break;case 50:this.popState();break;case 51:return"acc_descr_multiline_value";case 52:return 6;case 53:return 18;case 54:return 20;case 55:return 65;case 58:return 78;case 59:return 79;case 60:return 80;case 61:return 81;case 62:return 76;case 63:return 77;case 64:return 82;case 65:return 83;case 66:return 84;case 67:return 85;case 68:case 69:return 86;case 70:return 69;case 71:return 70;case 73:return"INVALID"}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^\<->\->:\n,;@]+?([\-]*[^\<->\->:\n,;@]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:[^<\->\->:\n,;]+?([\-]*[^<\->\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[50,51],inclusive:!1},acc_descr:{rules:[48],inclusive:!1},acc_title:{rules:[46],inclusive:!1},ID:{rules:[2,3,7,10,11,17],inclusive:!1},ALIAS:{rules:[2,3,18,19],inclusive:!1},LINE:{rules:[2,3,31],inclusive:!1},CONFIG:{rules:[8,9],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,12,13,14,15,16,20,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,47,49,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73],inclusive:!0}}}}();function G(){this.yy={}}return V.lexer=H,o(G,"Parser"),G.prototype=V,V.Parser=G,new G}();P.parser=P;var R=P,C={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},B={FILLED:0,OPEN:1},F={LEFTOF:0,RIGHTOF:1,OVER:2},q="actor",W="control",j="database",z="entity",V=(o(t=class{constructor(){this.state=new M(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=b,this.setAccDescription=x,this.setDiagramTitle=v,this.getAccTitle=m,this.getAccDescription=k,this.getDiagramTitle=g,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(l().wrap),this.LINETYPE=C,this.ARROWTYPE=B,this.PLACEMENT=F}addBox(t){this.state.records.boxes.push({name:t.text,wrap:t.wrap??this.autoWrap(),fill:t.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(t,e,s,i,a){let n,r=this.state.records.currentBox;if(void 0!==a){let t;t=a.includes("\n")?a+"\n":"{\n"+a+"\n}",n=w(t,{schema:T})}i=(null==n?void 0:n.type)??i;const o=this.state.records.actors.get(t);if(o){if(this.state.records.currentBox&&o.box&&this.state.records.currentBox!==o.box)throw new Error(`A same participant should only be defined in one Box: ${o.name} can't be in '${o.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(r=o.box?o.box:this.state.records.currentBox,o.box=r,o&&e===o.name&&null==s)return}if(null==(null==s?void 0:s.text)&&(s={text:e,type:i}),null!=i&&null!=s.text||(s={text:e,type:i}),this.state.records.actors.set(t,{box:r,name:e,description:s.text,wrap:s.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:i??"participant"}),this.state.records.prevActor){const e=this.state.records.actors.get(this.state.records.prevActor);e&&(e.nextActor=t)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(t),this.state.records.prevActor=t}activationCount(t){let e,s=0;if(!t)return 0;for(e=0;e<this.state.records.messages.length;e++)this.state.records.messages[e].type===this.LINETYPE.ACTIVE_START&&this.state.records.messages[e].from===t&&s++,this.state.records.messages[e].type===this.LINETYPE.ACTIVE_END&&this.state.records.messages[e].from===t&&s--;return s}addMessage(t,e,s,i){this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:e,message:s.text,wrap:s.wrap??this.autoWrap(),answer:i})}addSignal(t,e,s,i,a=!1){if(i===this.LINETYPE.ACTIVE_END){if(this.activationCount(t??"")<1){const e=new Error("Trying to inactivate an inactive participant ("+t+")");throw e.hash={text:"->>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},e}}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:e,message:(null==s?void 0:s.text)??"",wrap:(null==s?void 0:s.wrap)??this.autoWrap(),type:i,activate:a}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(t=>t.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(t){return this.state.records.actors.get(t)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(t){this.state.records.wrapEnabled=t}extractWrap(t){if(void 0===t)return{};t=t.trim();const e=null!==/^:?wrap:/.exec(t)||null===/^:?nowrap:/.exec(t)&&void 0;return{cleanedText:(void 0===e?t:t.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:e}}autoWrap(){var t;return void 0!==this.state.records.wrapEnabled?this.state.records.wrapEnabled:(null==(t=l().sequence)?void 0:t.wrap)??!1}clear(){this.state.reset(),_()}parseMessage(t){const e=t.trim(),{wrap:s,cleanedText:i}=this.extractWrap(e),a={text:i,wrap:s};return d.debug(`parseMessage: ${JSON.stringify(a)}`),a}parseBoxData(t){const e=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t);let s=(null==e?void 0:e[1])?e[1].trim():"transparent",i=(null==e?void 0:e[2])?e[2].trim():void 0;if(null==window?void 0:window.CSS)window.CSS.supports("color",s)||(s="transparent",i=t.trim());else{const e=(new Option).style;e.color=s,e.color!==s&&(s="transparent",i=t.trim())}const{wrap:a,cleanedText:n}=this.extractWrap(i);return{text:n?A(n,l()):void 0,color:s,wrap:a}}addNote(t,e,s){const i={actor:t,placement:e,message:s.text,wrap:s.wrap??this.autoWrap()},a=[].concat(t,t);this.state.records.notes.push(i),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:a[0],to:a[1],message:s.text,wrap:s.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:e})}addLinks(t,e){const s=this.getActor(t);try{let t=A(e.text,l());t=t.replace(/=/g,"="),t=t.replace(/&/g,"&");const i=JSON.parse(t);this.insertLinks(s,i)}catch(i){d.error("error while parsing actor link text",i)}}addALink(t,e){const s=this.getActor(t);try{const t={};let i=A(e.text,l());const a=i.indexOf("@");i=i.replace(/=/g,"="),i=i.replace(/&/g,"&");const n=i.slice(0,a-1).trim(),r=i.slice(a+1).trim();t[n]=r,this.insertLinks(s,t)}catch(i){d.error("error while parsing actor link text",i)}}insertLinks(t,e){if(null==t.links)t.links=e;else for(const s in e)t.links[s]=e[s]}addProperties(t,e){const s=this.getActor(t);try{const t=A(e.text,l()),i=JSON.parse(t);this.insertProperties(s,i)}catch(i){d.error("error while parsing actor properties text",i)}}insertProperties(t,e){if(null==t.properties)t.properties=e;else for(const s in e)t.properties[s]=e[s]}boxEnd(){this.state.records.currentBox=void 0}addDetails(t,e){const s=this.getActor(t),i=document.getElementById(e.text);try{const t=i.innerHTML,e=JSON.parse(t);e.properties&&this.insertProperties(s,e.properties),e.links&&this.insertLinks(s,e.links)}catch(a){d.error("error while parsing actor details text",a)}}getActorProperty(t,e){if(void 0!==(null==t?void 0:t.properties))return t.properties[e]}apply(t){if(Array.isArray(t))t.forEach(t=>{this.apply(t)});else switch(t.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:t.sequenceIndex,step:t.sequenceIndexStep,visible:t.sequenceVisible},wrap:!1,type:t.signalType});break;case"addParticipant":this.addActor(t.actor,t.actor,t.description,t.draw,t.config);break;case"createParticipant":if(this.state.records.actors.has(t.actor))throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");this.state.records.lastCreated=t.actor,this.addActor(t.actor,t.actor,t.description,t.draw,t.config),this.state.records.createdActors.set(t.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=t.actor,this.state.records.destroyedActors.set(t.actor,this.state.records.messages.length);break;case"activeStart":case"activeEnd":this.addSignal(t.actor,void 0,void 0,t.signalType);break;case"addNote":this.addNote(t.actor,t.placement,t.text);break;case"addLinks":this.addLinks(t.actor,t.text);break;case"addALink":this.addALink(t.actor,t.text);break;case"addProperties":this.addProperties(t.actor,t.text);break;case"addDetails":this.addDetails(t.actor,t.text);break;case"addMessage":if(this.state.records.lastCreated){if(t.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(t.to!==this.state.records.lastDestroyed&&t.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(t.from,t.to,t.msg,t.signalType,t.activate);break;case"boxStart":this.addBox(t.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":case"rectEnd":case"optEnd":case"altEnd":case"parEnd":case"criticalEnd":case"breakEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"rectStart":this.addSignal(void 0,void 0,t.color,t.signalType);break;case"optStart":this.addSignal(void 0,void 0,t.optText,t.signalType);break;case"altStart":case"else":this.addSignal(void 0,void 0,t.altText,t.signalType);break;case"setAccTitle":b(t.text);break;case"parStart":case"and":this.addSignal(void 0,void 0,t.parText,t.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,t.criticalText,t.signalType);break;case"option":this.addSignal(void 0,void 0,t.optionText,t.signalType);break;case"breakStart":this.addSignal(void 0,void 0,t.breakText,t.signalType)}}getConfig(){return l().sequence}},"SequenceDB"),t),H=o(t=>`.actor {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n }\n\n text.actor > tspan {\n fill: ${t.actorTextColor};\n stroke: none;\n }\n\n .actor-line {\n stroke: ${t.actorLineColor};\n }\n \n .innerArc {\n stroke-width: 1.5;\n stroke-dasharray: none;\n }\n\n .messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: none;\n stroke: ${t.signalColor};\n }\n\n .messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: 2, 2;\n stroke: ${t.signalColor};\n }\n\n #arrowhead path {\n fill: ${t.signalColor};\n stroke: ${t.signalColor};\n }\n\n .sequenceNumber {\n fill: ${t.sequenceNumberColor};\n }\n\n #sequencenumber {\n fill: ${t.signalColor};\n }\n\n #crosshead path {\n fill: ${t.signalColor};\n stroke: ${t.signalColor};\n }\n\n .messageText {\n fill: ${t.signalTextColor};\n stroke: none;\n }\n\n .labelBox {\n stroke: ${t.labelBoxBorderColor};\n fill: ${t.labelBoxBkgColor};\n }\n\n .labelText, .labelText > tspan {\n fill: ${t.labelTextColor};\n stroke: none;\n }\n\n .loopText, .loopText > tspan {\n fill: ${t.loopTextColor};\n stroke: none;\n }\n\n .loopLine {\n stroke-width: 2px;\n stroke-dasharray: 2, 2;\n stroke: ${t.labelBoxBorderColor};\n fill: ${t.labelBoxBorderColor};\n }\n\n .note {\n //stroke: #decc93;\n stroke: ${t.noteBorderColor};\n fill: ${t.noteBkgColor};\n }\n\n .noteText, .noteText > tspan {\n fill: ${t.noteTextColor};\n stroke: none;\n }\n\n .activation0 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .activation1 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .activation2 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .actorPopupMenu {\n position: absolute;\n }\n\n .actorPopupMenuPanel {\n position: absolute;\n fill: ${t.actorBkg};\n box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);\n filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));\n}\n .actor-man line {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n }\n .actor-man circle, line {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n stroke-width: 2px;\n }\n\n`,"getStyles"),G="actor-top",U="actor-bottom",K="actor-box",X="actor-man",Y=o(function(t,e){return a(t,e)},"drawRect"),Z=o(function(t,e,s,i,a){if(void 0===e.links||null===e.links||0===Object.keys(e.links).length)return{height:0,width:0};const n=e.links,r=e.actorCnt,o=e.rectData;var c="none";a&&(c="block !important");const l=t.append("g");l.attr("id","actor"+r+"_popup"),l.attr("class","actorPopupMenu"),l.attr("display",c);var h="";void 0!==o.class&&(h=" "+o.class);let d=o.width>s?o.width:s;const p=l.append("rect");if(p.attr("class","actorPopupMenuPanel"+h),p.attr("x",o.x),p.attr("y",o.height),p.attr("fill",o.fill),p.attr("stroke",o.stroke),p.attr("width",d),p.attr("height",o.height),p.attr("rx",o.rx),p.attr("ry",o.ry),null!=n){var f=20;for(let t in n){var y=l.append("a"),b=u.sanitizeUrl(n[t]);y.attr("xlink:href",b),y.attr("target","_blank"),Ot(i)(t,y,o.x+10,o.height+f,d,20,{class:"actor"},i),f+=30}}return p.attr("height",f),{height:o.height+f,width:d}},"drawPopup"),J=o(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),Q=o(async function(t,e,s=null){let i=t.append("foreignObject");const a=await N(e.text,D()),n=i.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(a).node().getBoundingClientRect();if(i.attr("height",Math.round(n.height)).attr("width",Math.round(n.width)),"noteText"===e.class){const s=t.node().firstChild;s.setAttribute("height",n.height+2*e.textMargin);const a=s.getBBox();i.attr("x",Math.round(a.x+a.width/2-n.width/2)).attr("y",Math.round(a.y+a.height/2-n.height/2))}else if(s){let{startx:t,stopx:a,starty:r}=s;if(t>a){const e=t;t=a,a=e}i.attr("x",Math.round(t+Math.abs(t-a)/2-n.width/2)),"loopText"===e.class?i.attr("y",Math.round(r)):i.attr("y",Math.round(r-n.height))}return[i]},"drawKatex"),tt=o(function(t,e){let s=0,i=0;const a=e.text.split(y.lineBreakRegex),[n,r]=E(e.fontSize);let c=[],l=0,h=o(()=>e.y,"yfunc");if(void 0!==e.valign&&void 0!==e.textMargin&&e.textMargin>0)switch(e.valign){case"top":case"start":h=o(()=>Math.round(e.y+e.textMargin),"yfunc");break;case"middle":case"center":h=o(()=>Math.round(e.y+(s+i+e.textMargin)/2),"yfunc");break;case"bottom":case"end":h=o(()=>Math.round(e.y+(s+i+2*e.textMargin)-e.textMargin),"yfunc")}if(void 0!==e.anchor&&void 0!==e.textMargin&&void 0!==e.width)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="middle",e.alignmentBaseline="middle"}for(let[o,d]of a.entries()){void 0!==e.textMargin&&0===e.textMargin&&void 0!==n&&(l=o*n);const a=t.append("text");a.attr("x",e.x),a.attr("y",h()),void 0!==e.anchor&&a.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),void 0!==e.fontFamily&&a.style("font-family",e.fontFamily),void 0!==r&&a.style("font-size",r),void 0!==e.fontWeight&&a.style("font-weight",e.fontWeight),void 0!==e.fill&&a.attr("fill",e.fill),void 0!==e.class&&a.attr("class",e.class),void 0!==e.dy?a.attr("dy",e.dy):0!==l&&a.attr("dy",l);const u=d||L;if(e.tspan){const t=a.append("tspan");t.attr("x",e.x),void 0!==e.fill&&t.attr("fill",e.fill),t.text(u)}else a.text(u);void 0!==e.valign&&void 0!==e.textMargin&&e.textMargin>0&&(i+=(a._groups||a)[0][0].getBBox().height,s=i),c.push(a)}return c},"drawText"),et=o(function(t,e){function s(t,e,s,i,a){return t+","+e+" "+(t+s)+","+e+" "+(t+s)+","+(e+i-a)+" "+(t+s-1.2*a)+","+(e+i)+" "+t+","+(e+i)}o(s,"genPoints");const i=t.append("polygon");return i.attr("points",s(e.x,e.y,e.width,e.height,7)),i.attr("class","labelBox"),e.y=e.y+e.height/2,tt(t,e),i},"drawLabel"),st=-1,it=o((t,e,s,i)=>{t.select&&s.forEach(s=>{const a=e.get(s),n=t.select("#actor"+a.actorCnt);!i.mirrorActors&&a.stopy?n.attr("y2",a.stopy+a.height/2):i.mirrorActors&&n.attr("y2",a.stopy)})},"fixLifeLineHeights"),at=o(function(t,e,s,a){var o,c;const l=a?e.stopy:e.starty,h=e.x+e.width/2,d=l+e.height,u=t.append("g").lower();var p=u;a||(st++,Object.keys(e.links||{}).length&&!s.forceMenus&&p.attr("onclick",J(`actor${st}_popup`)).attr("cursor","pointer"),p.append("line").attr("id","actor"+st).attr("x1",h).attr("y1",d).attr("x2",h).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),p=u.append("g"),e.actorCnt=st,null!=e.links&&p.attr("id","root-"+st));const f=i();var y="actor";(null==(o=e.properties)?void 0:o.class)?y=e.properties.class:f.fill="#eaeaea",y+=a?` ${U}`:` ${G}`,f.x=e.x,f.y=l,f.width=e.width,f.height=e.height,f.class=y,f.rx=3,f.ry=3,f.name=e.name;const b=Y(p,f);if(e.rectData=f,null==(c=e.properties)?void 0:c.icon){const t=e.properties.icon.trim();"@"===t.charAt(0)?n(p,f.x+f.width-20,f.y+10,t.substr(1)):r(p,f.x+f.width-20,f.y+10,t)}It(s,I(e.description))(e.description,p,f.x,f.y,f.width,f.height,{class:`actor ${K}`},s);let x=e.height;if(b.node){const t=b.node().getBBox();e.height=t.height,x=t.height}return x},"drawActorTypeParticipant"),nt=o(function(t,e,s,a){var o,c;const l=a?e.stopy:e.starty,h=e.x+e.width/2,d=l+e.height,u=t.append("g").lower();var p=u;a||(st++,Object.keys(e.links||{}).length&&!s.forceMenus&&p.attr("onclick",J(`actor${st}_popup`)).attr("cursor","pointer"),p.append("line").attr("id","actor"+st).attr("x1",h).attr("y1",d).attr("x2",h).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),p=u.append("g"),e.actorCnt=st,null!=e.links&&p.attr("id","root-"+st));const f=i();var y="actor";(null==(o=e.properties)?void 0:o.class)?y=e.properties.class:f.fill="#eaeaea",y+=a?` ${U}`:` ${G}`,f.x=e.x,f.y=l,f.width=e.width,f.height=e.height,f.class=y,f.name=e.name;const b={...f,x:f.x+-6,y:f.y+6,class:"actor"},x=Y(p,f);if(Y(p,b),e.rectData=f,null==(c=e.properties)?void 0:c.icon){const t=e.properties.icon.trim();"@"===t.charAt(0)?n(p,f.x+f.width-20,f.y+10,t.substr(1)):r(p,f.x+f.width-20,f.y+10,t)}It(s,I(e.description))(e.description,p,f.x-6,f.y+6,f.width,f.height,{class:`actor ${K}`},s);let v=e.height;if(x.node){const t=x.node().getBBox();e.height=t.height,v=t.height}return v},"drawActorTypeCollections"),rt=o(function(t,e,s,a){var o,c;const l=a?e.stopy:e.starty,h=e.x+e.width/2,d=l+e.height,u=t.append("g").lower();let p=u;a||(st++,Object.keys(e.links||{}).length&&!s.forceMenus&&p.attr("onclick",J(`actor${st}_popup`)).attr("cursor","pointer"),p.append("line").attr("id","actor"+st).attr("x1",h).attr("y1",d).attr("x2",h).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),p=u.append("g"),e.actorCnt=st,null!=e.links&&p.attr("id","root-"+st));const f=i();let y="actor";(null==(o=e.properties)?void 0:o.class)?y=e.properties.class:f.fill="#eaeaea",y+=a?` ${U}`:` ${G}`,f.x=e.x,f.y=l,f.width=e.width,f.height=e.height,f.class=y,f.name=e.name;const b=f.height/2,x=b/(2.5+f.height/50),v=p.append("g"),m=p.append("g");if(v.append("path").attr("d",`M ${f.x},${f.y+b}\n a ${x},${b} 0 0 0 0,${f.height}\n h ${f.width-2*x}\n a ${x},${b} 0 0 0 0,-${f.height}\n Z\n `).attr("class",y),m.append("path").attr("d",`M ${f.x},${f.y+b}\n a ${x},${b} 0 0 0 0,${f.height}`).attr("stroke","#666").attr("stroke-width","1px").attr("class",y),v.attr("transform",`translate(${x}, ${-f.height/2})`),m.attr("transform",`translate(${f.width-x}, ${-f.height/2})`),e.rectData=f,null==(c=e.properties)?void 0:c.icon){const t=e.properties.icon.trim(),s=f.x+f.width-20,i=f.y+10;"@"===t.charAt(0)?n(p,s,i,t.substr(1)):r(p,s,i,t)}It(s,I(e.description))(e.description,p,f.x,f.y,f.width,f.height,{class:`actor ${K}`},s);let k=e.height;const g=v.select("path:last-child");if(g.node()){const t=g.node().getBBox();e.height=t.height,k=t.height}return k},"drawActorTypeQueue"),ot=o(function(t,e,s,a){var n;const r=a?e.stopy:e.starty,o=e.x+e.width/2,c=r+75,l=t.append("g").lower();a||(st++,l.append("line").attr("id","actor"+st).attr("x1",o).attr("y1",c).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),e.actorCnt=st);const h=t.append("g");let d=X;d+=a?` ${U}`:` ${G}`,h.attr("class",d),h.attr("name",e.name);const u=i();u.x=e.x,u.y=r,u.fill="#eaeaea",u.width=e.width,u.height=e.height,u.class="actor";const p=e.x+e.width/2,f=r+30;h.append("defs").append("marker").attr("id","filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),h.append("circle").attr("cx",p).attr("cy",f).attr("r",18).attr("fill","#eaeaf7").attr("stroke","#666").attr("stroke-width",1.2),h.append("line").attr("marker-end","url(#filled-head-control)").attr("transform",`translate(${p}, ${f-18})`);const y=h.node().getBBox();return e.height=y.height+2*((null==(n=null==s?void 0:s.sequence)?void 0:n.labelBoxHeight)??0),It(s,I(e.description))(e.description,h,u.x,u.y+18+(a?5:10),u.width,u.height,{class:`actor ${X}`},s),e.height},"drawActorTypeControl"),ct=o(function(t,e,s,a){var n;const r=a?e.stopy:e.starty,o=e.x+e.width/2,c=r+75,l=t.append("g").lower(),h=t.append("g");let d=X;d+=a?` ${U}`:` ${G}`,h.attr("class",d),h.attr("name",e.name);const u=i();u.x=e.x,u.y=r,u.fill="#eaeaea",u.width=e.width,u.height=e.height,u.class="actor";const p=e.x+e.width/2,f=r+(a?10:25),y=18;h.append("circle").attr("cx",p).attr("cy",f).attr("r",y).attr("width",e.width).attr("height",e.height),h.append("line").attr("x1",p-y).attr("x2",p+y).attr("y1",f+y).attr("y2",f+y).attr("stroke","#333").attr("stroke-width",2);const b=h.node().getBBox();return e.height=b.height+((null==(n=null==s?void 0:s.sequence)?void 0:n.labelBoxHeight)??0),a||(st++,l.append("line").attr("id","actor"+st).attr("x1",o).attr("y1",c).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),e.actorCnt=st),It(s,I(e.description))(e.description,h,u.x,u.y+(a?(f-r+y-5)/2:(f+y-r)/2),u.width,u.height,{class:`actor ${X}`},s),h.attr("transform","translate(0, 9)"),e.height},"drawActorTypeEntity"),lt=o(function(t,e,s,a){var n;const r=a?e.stopy:e.starty,o=e.x+e.width/2,c=r+e.height+2*s.boxTextMargin,l=t.append("g").lower();let h=l;a||(st++,Object.keys(e.links||{}).length&&!s.forceMenus&&h.attr("onclick",J(`actor${st}_popup`)).attr("cursor","pointer"),h.append("line").attr("id","actor"+st).attr("x1",o).attr("y1",c).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),h=l.append("g"),e.actorCnt=st,null!=e.links&&h.attr("id","root-"+st));const d=i();let u="actor";(null==(n=e.properties)?void 0:n.class)?u=e.properties.class:d.fill="#eaeaea",u+=a?` ${U}`:` ${G}`,d.x=e.x,d.y=r,d.width=e.width,d.height=e.height,d.class=u,d.name=e.name,d.x=e.x,d.y=r;const p=d.width/4,f=d.width/4,y=p/2,b=y/(2.5+p/50),x=h.append("g"),v=`\n M ${d.x},${d.y+b}\n a ${y},${b} 0 0 0 ${p},0\n a ${y},${b} 0 0 0 -${p},0\n l 0,${f-2*b}\n a ${y},${b} 0 0 0 ${p},0\n l 0,-${f-2*b}\n`;x.append("path").attr("d",v).attr("fill","#eaeaea").attr("stroke","#000").attr("stroke-width",1).attr("class",u),a?x.attr("transform",`translate(${1.5*p}, ${d.height/4-2*b})`):x.attr("transform",`translate(${1.5*p}, ${(d.height+b)/4})`),e.rectData=d,It(s,I(e.description))(e.description,h,d.x,d.y+(a?(d.height+f)/4:(d.height+b)/2),d.width,d.height,{class:`actor ${K}`},s);const m=x.select("path:last-child");if(m.node()){const t=m.node().getBBox();e.height=t.height+(s.sequence.labelBoxHeight??0)}return e.height},"drawActorTypeDatabase"),ht=o(function(t,e,s,a){const n=a?e.stopy:e.starty,r=e.x+e.width/2,o=n+80,c=30,l=t.append("g").lower();a||(st++,l.append("line").attr("id","actor"+st).attr("x1",r).attr("y1",o).attr("x2",r).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),e.actorCnt=st);const h=t.append("g");let d=X;d+=a?` ${U}`:` ${G}`,h.attr("class",d),h.attr("name",e.name);const u=i();u.x=e.x,u.y=n,u.fill="#eaeaea",u.width=e.width,u.height=e.height,u.class="actor",h.append("line").attr("id","actor-man-torso"+st).attr("x1",e.x+e.width/2-75).attr("y1",n+10).attr("x2",e.x+e.width/2-15).attr("y2",n+10),h.append("line").attr("id","actor-man-arms"+st).attr("x1",e.x+e.width/2-75).attr("y1",n+0).attr("x2",e.x+e.width/2-75).attr("y2",n+20),h.append("circle").attr("cx",e.x+e.width/2).attr("cy",n+10).attr("r",c);const p=h.node().getBBox();return e.height=p.height+(s.sequence.labelBoxHeight??0),It(s,I(e.description))(e.description,h,u.x,u.y+(a?11:18),u.width,u.height,{class:`actor ${X}`},s),h.attr("transform","translate(0,22)"),e.height},"drawActorTypeBoundary"),dt=o(function(t,e,s,a){const n=a?e.stopy:e.starty,r=e.x+e.width/2,o=n+80,c=t.append("g").lower();a||(st++,c.append("line").attr("id","actor"+st).attr("x1",r).attr("y1",o).attr("x2",r).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),e.actorCnt=st);const l=t.append("g");let h=X;h+=a?` ${U}`:` ${G}`,l.attr("class",h),l.attr("name",e.name);const d=i();d.x=e.x,d.y=n,d.fill="#eaeaea",d.width=e.width,d.height=e.height,d.class="actor",d.rx=3,d.ry=3,l.append("line").attr("id","actor-man-torso"+st).attr("x1",r).attr("y1",n+25).attr("x2",r).attr("y2",n+45),l.append("line").attr("id","actor-man-arms"+st).attr("x1",r-18).attr("y1",n+33).attr("x2",r+18).attr("y2",n+33),l.append("line").attr("x1",r-18).attr("y1",n+60).attr("x2",r).attr("y2",n+45),l.append("line").attr("x1",r).attr("y1",n+45).attr("x2",r+18-2).attr("y2",n+60);const u=l.append("circle");u.attr("cx",e.x+e.width/2),u.attr("cy",n+10),u.attr("r",15),u.attr("width",e.width),u.attr("height",e.height);const p=l.node().getBBox();return e.height=p.height,It(s,I(e.description))(e.description,l,d.x,d.y+35,d.width,d.height,{class:`actor ${X}`},s),e.height},"drawActorTypeActor"),ut=o(async function(t,e,s,i){switch(e.type){case"actor":return await dt(t,e,s,i);case"participant":return await at(t,e,s,i);case"boundary":return await ht(t,e,s,i);case"control":return await ot(t,e,s,i);case"entity":return await ct(t,e,s,i);case"database":return await lt(t,e,s,i);case"collections":return await nt(t,e,s,i);case"queue":return await rt(t,e,s,i)}},"drawActor"),pt=o(function(t,e,s){const i=t.append("g");xt(i,e),e.name&&It(s)(e.name,i,e.x,e.y+s.boxTextMargin+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},s),i.lower()},"drawBox"),ft=o(function(t){return t.append("g")},"anchorElement"),yt=o(function(t,e,s,a,n){const r=i(),o=e.anchored;r.x=e.startx,r.y=e.starty,r.class="activation"+n%3,r.width=e.stopx-e.startx,r.height=s-e.starty,Y(o,r)},"drawActivation"),bt=o(async function(t,e,i,a){const{boxMargin:n,boxTextMargin:r,labelBoxHeight:c,labelBoxWidth:l,messageFontFamily:h,messageFontSize:d,messageFontWeight:u}=a,p=t.append("g"),f=o(function(t,e,s,i){return p.append("line").attr("x1",t).attr("y1",e).attr("x2",s).attr("y2",i).attr("class","loopLine")},"drawLoopLine");f(e.startx,e.starty,e.stopx,e.starty),f(e.stopx,e.starty,e.stopx,e.stopy),f(e.startx,e.stopy,e.stopx,e.stopy),f(e.startx,e.starty,e.startx,e.stopy),void 0!==e.sections&&e.sections.forEach(function(t){f(e.startx,t.y,e.stopx,t.y).style("stroke-dasharray","3, 3")});let y=s();y.text=i,y.x=e.startx,y.y=e.starty,y.fontFamily=h,y.fontSize=d,y.fontWeight=u,y.anchor="middle",y.valign="middle",y.tspan=!1,y.width=l||50,y.height=c||20,y.textMargin=r,y.class="labelText",et(p,y),y=At(),y.text=e.title,y.x=e.startx+l/2+(e.stopx-e.startx)/2,y.y=e.starty+n+r,y.anchor="middle",y.valign="middle",y.textMargin=r,y.class="loopText",y.fontFamily=h,y.fontSize=d,y.fontWeight=u,y.wrap=!0;let b=I(y.text)?await Q(p,y,e):tt(p,y);if(void 0!==e.sectionTitles)for(const[s,o]of Object.entries(e.sectionTitles))if(o.message){y.text=o.message,y.x=e.startx+(e.stopx-e.startx)/2,y.y=e.sections[s].y+n+r,y.class="loopText",y.anchor="middle",y.valign="middle",y.tspan=!1,y.fontFamily=h,y.fontSize=d,y.fontWeight=u,y.wrap=e.wrap,I(y.text)?(e.starty=e.sections[s].y,await Q(p,y,e)):tt(p,y);let t=Math.round(b.map(t=>(t._groups||t)[0][0].getBBox().height).reduce((t,e)=>t+e));e.sections[s].height+=t-(n+r)}return e.height=Math.round(e.stopy-e.starty),p},"drawLoop"),xt=o(function(t,s){e(t,s)},"drawBackgroundRect"),vt=o(function(t){t.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),mt=o(function(t){t.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),kt=o(function(t){t.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),gt=o(function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),wt=o(function(t){t.append("defs").append("marker").attr("id","filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),Tt=o(function(t){t.append("defs").append("marker").attr("id","sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber"),_t=o(function(t){t.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),At=o(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},"getTextObj"),$t=o(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),It=function(){function t(t,e,s,i,n,r,o){a(e.append("text").attr("x",s+n/2).attr("y",i+r/2+5).style("text-anchor","middle").text(t),o)}function e(t,e,s,i,n,r,o,c){const{actorFontSize:l,actorFontFamily:h,actorFontWeight:d}=c,[u,p]=E(l),f=t.split(y.lineBreakRegex);for(let y=0;y<f.length;y++){const t=y*u-u*(f.length-1)/2,c=e.append("text").attr("x",s+n/2).attr("y",i).style("text-anchor","middle").style("font-size",p).style("font-weight",d).style("font-family",h);c.append("tspan").attr("x",s+n/2).attr("dy",t).text(f[y]),c.attr("y",i+r/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),a(c,o)}}function s(t,s,i,n,r,o,c,l){const h=s.append("switch"),d=h.append("foreignObject").attr("x",i).attr("y",n).attr("width",r).attr("height",o).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");d.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,h,i,n,r,o,c,l),a(d,c)}async function i(t,s,i,n,r,o,c,l){const h=await O(t,D()),d=s.append("switch"),u=d.append("foreignObject").attr("x",i+r/2-h.width/2).attr("y",n+o/2-h.height/2).attr("width",h.width).attr("height",h.height).append("xhtml:div").style("height","100%").style("width","100%");u.append("div").style("text-align","center").style("vertical-align","middle").html(await N(t,D())),e(t,d,i,n,r,o,c,l),a(u,c)}function a(t,e){for(const s in e)e.hasOwnProperty(s)&&t.attr(s,e[s])}return o(t,"byText"),o(e,"byTspan"),o(s,"byFo"),o(i,"byKatex"),o(a,"_setTextAttrs"),function(a,n=!1){return n?i:"fo"===a.textPlacement?s:"old"===a.textPlacement?t:e}}(),Ot=function(){function t(t,e,s,a,n,r,o){i(e.append("text").attr("x",s).attr("y",a).style("text-anchor","start").text(t),o)}function e(t,e,s,a,n,r,o,c){const{actorFontSize:l,actorFontFamily:h,actorFontWeight:d}=c,u=t.split(y.lineBreakRegex);for(let p=0;p<u.length;p++){const t=p*l-l*(u.length-1)/2,n=e.append("text").attr("x",s).attr("y",a).style("text-anchor","start").style("font-size",l).style("font-weight",d).style("font-family",h);n.append("tspan").attr("x",s).attr("dy",t).text(u[p]),n.attr("y",a+r/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(n,o)}}function s(t,s,a,n,r,o,c,l){const h=s.append("switch"),d=h.append("foreignObject").attr("x",a).attr("y",n).attr("width",r).attr("height",o).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");d.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,h,a,n,0,o,c,l),i(d,c)}function i(t,e){for(const s in e)e.hasOwnProperty(s)&&t.attr(s,e[s])}return o(t,"byText"),o(e,"byTspan"),o(s,"byFo"),o(i,"_setTextAttrs"),function(i){return"fo"===i.textPlacement?s:"old"===i.textPlacement?t:e}}(),Et={drawRect:Y,drawText:tt,drawLabel:et,drawActor:ut,drawBox:pt,drawPopup:Z,anchorElement:ft,drawActivation:yt,drawLoop:bt,drawBackgroundRect:xt,insertArrowHead:gt,insertArrowFilledHead:wt,insertSequenceNumber:Tt,insertArrowCrossHead:_t,insertDatabaseIcon:vt,insertComputerIcon:mt,insertClockIcon:kt,getTextObj:At,getNoteRect:$t,fixLifeLineHeights:it,sanitizeUrl:u.sanitizeUrl},Lt={},St={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:o(function(){return Math.max.apply(null,0===this.actors.length?[0]:this.actors.map(t=>t.height||0))+(0===this.loops.length?0:this.loops.map(t=>t.height||0).reduce((t,e)=>t+e))+(0===this.messages.length?0:this.messages.map(t=>t.height||0).reduce((t,e)=>t+e))+(0===this.notes.length?0:this.notes.map(t=>t.height||0).reduce((t,e)=>t+e))},"getHeight"),clear:o(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:o(function(t){this.boxes.push(t)},"addBox"),addActor:o(function(t){this.actors.push(t)},"addActor"),addLoop:o(function(t){this.loops.push(t)},"addLoop"),addMessage:o(function(t){this.messages.push(t)},"addMessage"),addNote:o(function(t){this.notes.push(t)},"addNote"),lastActor:o(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:o(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:o(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:o(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:o(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,Wt(l())},"init"),updateVal:o(function(t,e,s,i){void 0===t[e]?t[e]=s:t[e]=i(s,t[e])},"updateVal"),updateBounds:o(function(t,e,s,i){const a=this;let n=0;function r(r){return o(function(o){n++;const c=a.sequenceItems.length-n+1;a.updateVal(o,"starty",e-c*Lt.boxMargin,Math.min),a.updateVal(o,"stopy",i+c*Lt.boxMargin,Math.max),a.updateVal(St.data,"startx",t-c*Lt.boxMargin,Math.min),a.updateVal(St.data,"stopx",s+c*Lt.boxMargin,Math.max),"activation"!==r&&(a.updateVal(o,"startx",t-c*Lt.boxMargin,Math.min),a.updateVal(o,"stopx",s+c*Lt.boxMargin,Math.max),a.updateVal(St.data,"starty",e-c*Lt.boxMargin,Math.min),a.updateVal(St.data,"stopy",i+c*Lt.boxMargin,Math.max))},"updateItemBounds")}o(r,"updateFn"),this.sequenceItems.forEach(r()),this.activations.forEach(r("activation"))},"updateBounds"),insert:o(function(t,e,s,i){const a=y.getMin(t,s),n=y.getMax(t,s),r=y.getMin(e,i),o=y.getMax(e,i);this.updateVal(St.data,"startx",a,Math.min),this.updateVal(St.data,"starty",r,Math.min),this.updateVal(St.data,"stopx",n,Math.max),this.updateVal(St.data,"stopy",o,Math.max),this.updateBounds(a,r,n,o)},"insert"),newActivation:o(function(t,e,s){const i=s.get(t.from),a=jt(t.from).length||0,n=i.x+i.width/2+(a-1)*Lt.activationWidth/2;this.activations.push({startx:n,starty:this.verticalPos+2,stopx:n+Lt.activationWidth,stopy:void 0,actor:t.from,anchored:Et.anchorElement(e)})},"newActivation"),endActivation:o(function(t){const e=this.activations.map(function(t){return t.actor}).lastIndexOf(t.from);return this.activations.splice(e,1)[0]},"endActivation"),createLoop:o(function(t={message:void 0,wrap:!1,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}},"createLoop"),newLoop:o(function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},"newLoop"),endLoop:o(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:o(function(){return!!this.sequenceItems.length&&this.sequenceItems[this.sequenceItems.length-1].overlap},"isLoopOverlap"),addSectionToLoop:o(function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:St.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},"addSectionToLoop"),saveVerticalPos:o(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:o(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:o(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=y.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:o(function(){return this.verticalPos},"getVerticalPos"),getBounds:o(function(){return{bounds:this.data,models:this.models}},"getBounds")},Nt=o(async function(t,e){St.bumpVerticalPos(Lt.boxMargin),e.height=Lt.boxMargin,e.starty=St.getVerticalPos();const a=i();a.x=e.startx,a.y=e.starty,a.width=e.width||Lt.width,a.class="note";const n=t.append("g"),r=Et.drawRect(n,a),o=s();o.x=e.startx,o.y=e.starty,o.width=a.width,o.dy="1em",o.text=e.message,o.class="noteText",o.fontFamily=Lt.noteFontFamily,o.fontSize=Lt.noteFontSize,o.fontWeight=Lt.noteFontWeight,o.anchor=Lt.noteAlign,o.textMargin=Lt.noteMargin,o.valign="center";const c=I(o.text)?await Q(n,o):tt(n,o),l=Math.round(c.map(t=>(t._groups||t)[0][0].getBBox().height).reduce((t,e)=>t+e));r.attr("height",l+2*Lt.noteMargin),e.height+=l+2*Lt.noteMargin,St.bumpVerticalPos(l+2*Lt.noteMargin),e.stopy=e.starty+l+2*Lt.noteMargin,e.stopx=e.startx+a.width,St.insert(e.startx,e.starty,e.stopx,e.stopy),St.models.addNote(e)},"drawNote"),Dt=o(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),Mt=o(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),Pt=o(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont");async function Rt(t,e){St.bumpVerticalPos(10);const{startx:s,stopx:i,message:a}=e,n=y.splitBreaks(a).length,r=I(a),o=r?await O(a,l()):$.calculateTextDimensions(a,Dt(Lt));if(!r){const t=o.height/n;e.height+=t,St.bumpVerticalPos(t)}let c,h=o.height-10;const d=o.width;if(s===i){c=St.getVerticalPos()+h,Lt.rightAngles||(h+=Lt.boxMargin,c=St.getVerticalPos()+h),h+=30;const t=y.getMax(d/2,Lt.width/2);St.insert(s-t,St.getVerticalPos()-10+h,i+t,St.getVerticalPos()+30+h)}else h+=Lt.boxMargin,c=St.getVerticalPos()+h,St.insert(s,c-10,i,c);return St.bumpVerticalPos(h),e.height+=h,e.stopy=e.starty+e.height,St.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),c}o(Rt,"boundMessage");var Ct=o(async function(t,e,i,a){const{startx:n,stopx:r,starty:o,message:c,type:l,sequenceIndex:h,sequenceVisible:d}=e,u=$.calculateTextDimensions(c,Dt(Lt)),p=s();p.x=n,p.y=o+10,p.width=r-n,p.class="messageText",p.dy="1em",p.text=c,p.fontFamily=Lt.messageFontFamily,p.fontSize=Lt.messageFontSize,p.fontWeight=Lt.messageFontWeight,p.anchor=Lt.messageAlign,p.valign="center",p.textMargin=Lt.wrapPadding,p.tspan=!1,I(p.text)?await Q(t,p,{startx:n,stopx:r,starty:i}):tt(t,p);const f=u.width;let b;n===r?b=Lt.rightAngles?t.append("path").attr("d",`M ${n},${i} H ${n+y.getMax(Lt.width/2,f/2)} V ${i+25} H ${n}`):t.append("path").attr("d","M "+n+","+i+" C "+(n+60)+","+(i-10)+" "+(n+60)+","+(i+30)+" "+n+","+(i+20)):(b=t.append("line"),b.attr("x1",n),b.attr("y1",i),b.attr("x2",r),b.attr("y2",i)),l===a.db.LINETYPE.DOTTED||l===a.db.LINETYPE.DOTTED_CROSS||l===a.db.LINETYPE.DOTTED_POINT||l===a.db.LINETYPE.DOTTED_OPEN||l===a.db.LINETYPE.BIDIRECTIONAL_DOTTED?(b.style("stroke-dasharray","3, 3"),b.attr("class","messageLine1")):b.attr("class","messageLine0");let x="";if(Lt.arrowMarkerAbsolute&&(x=S(!0)),b.attr("stroke-width",2),b.attr("stroke","none"),b.style("fill","none"),l!==a.db.LINETYPE.SOLID&&l!==a.db.LINETYPE.DOTTED||b.attr("marker-end","url("+x+"#arrowhead)"),l!==a.db.LINETYPE.BIDIRECTIONAL_SOLID&&l!==a.db.LINETYPE.BIDIRECTIONAL_DOTTED||(b.attr("marker-start","url("+x+"#arrowhead)"),b.attr("marker-end","url("+x+"#arrowhead)")),l!==a.db.LINETYPE.SOLID_POINT&&l!==a.db.LINETYPE.DOTTED_POINT||b.attr("marker-end","url("+x+"#filled-head)"),l!==a.db.LINETYPE.SOLID_CROSS&&l!==a.db.LINETYPE.DOTTED_CROSS||b.attr("marker-end","url("+x+"#crosshead)"),d||Lt.showSequenceNumbers){if(l===a.db.LINETYPE.BIDIRECTIONAL_SOLID||l===a.db.LINETYPE.BIDIRECTIONAL_DOTTED){const t=6;n<r?b.attr("x1",n+2*t):b.attr("x1",n+t)}t.append("line").attr("x1",n).attr("y1",i).attr("x2",n).attr("y2",i).attr("stroke-width",0).attr("marker-start","url("+x+"#sequencenumber)"),t.append("text").attr("x",n).attr("y",i+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(h)}},"drawMessage"),Bt=o(function(t,e,s,i,a,n,r){let o,c=0,l=0,h=0;for(const d of i){const t=e.get(d),i=t.box;o&&o!=i&&(r||St.models.addBox(o),l+=Lt.boxMargin+o.margin),i&&i!=o&&(r||(i.x=c+l,i.y=a),l+=i.margin),t.width=t.width||Lt.width,t.height=y.getMax(t.height||Lt.height,Lt.height),t.margin=t.margin||Lt.actorMargin,h=y.getMax(h,t.height),s.get(t.name)&&(l+=t.width/2),t.x=c+l,t.starty=St.getVerticalPos(),St.insert(t.x,a,t.x+t.width,t.height),c+=t.width+l,t.box&&(t.box.width=c+i.margin-t.box.x),l=t.margin,o=t.box,St.models.addActor(t)}o&&!r&&St.models.addBox(o),St.bumpVerticalPos(h)},"addActorRenderingData"),Ft=o(async function(t,e,s,i){if(i){let i=0;St.bumpVerticalPos(2*Lt.boxMargin);for(const a of s){const s=e.get(a);s.stopy||(s.stopy=St.getVerticalPos());const n=await Et.drawActor(t,s,Lt,!0);i=y.getMax(i,n)}St.bumpVerticalPos(i+Lt.boxMargin)}else for(const a of s){const s=e.get(a);await Et.drawActor(t,s,Lt,!1)}},"drawActors"),qt=o(function(t,e,s,i){let a=0,n=0;for(const r of s){const s=e.get(r),o=Kt(s),c=Et.drawPopup(t,s,o,Lt,Lt.forceMenus,i);c.height>a&&(a=c.height),c.width+s.x>n&&(n=c.width+s.x)}return{maxHeight:a,maxWidth:n}},"drawActorsPopup"),Wt=o(function(t){f(Lt,t),t.fontFamily&&(Lt.actorFontFamily=Lt.noteFontFamily=Lt.messageFontFamily=t.fontFamily),t.fontSize&&(Lt.actorFontSize=Lt.noteFontSize=Lt.messageFontSize=t.fontSize),t.fontWeight&&(Lt.actorFontWeight=Lt.noteFontWeight=Lt.messageFontWeight=t.fontWeight)},"setConf"),jt=o(function(t){return St.activations.filter(function(e){return e.actor===t})},"actorActivations"),zt=o(function(t,e){const s=e.get(t),i=jt(t);return[i.reduce(function(t,e){return y.getMin(t,e.startx)},s.x+s.width/2-1),i.reduce(function(t,e){return y.getMax(t,e.stopx)},s.x+s.width/2+1)]},"activationBounds");function Vt(t,e,s,i,a){St.bumpVerticalPos(s);let n=i;if(e.id&&e.message&&t[e.id]){const s=t[e.id].width,a=Dt(Lt);e.message=$.wrapLabel(`[${e.message}]`,s-2*Lt.wrapPadding,a),e.width=s,e.wrap=!0;const r=$.calculateTextDimensions(e.message,a),o=y.getMax(r.height,Lt.labelBoxHeight);n=i+o,d.debug(`${o} - ${e.message}`)}a(e),St.bumpVerticalPos(n)}function Ht(t,e,s,i,a,n,r){function c(s,i){s.x<a.get(t.from).x?(St.insert(e.stopx-i,e.starty,e.startx,e.stopy+s.height/2+Lt.noteMargin),e.stopx=e.stopx+i):(St.insert(e.startx,e.starty,e.stopx+i,e.stopy+s.height/2+Lt.noteMargin),e.stopx=e.stopx-i)}function l(s,i){s.x<a.get(t.to).x?(St.insert(e.startx-i,e.starty,e.stopx,e.stopy+s.height/2+Lt.noteMargin),e.startx=e.startx+i):(St.insert(e.stopx,e.starty,e.startx+i,e.stopy+s.height/2+Lt.noteMargin),e.startx=e.startx-i)}o(c,"receiverAdjustment"),o(l,"senderAdjustment");const h=[q,W,z,j];if(n.get(t.to)==i){const e=a.get(t.to);c(e,h.includes(e.type)?21:e.width/2+3),e.starty=s-e.height/2,St.bumpVerticalPos(e.height/2)}else if(r.get(t.from)==i){const e=a.get(t.from);if(Lt.mirrorActors){l(e,h.includes(e.type)?18:e.width/2)}e.stopy=s-e.height/2,St.bumpVerticalPos(e.height/2)}else if(r.get(t.to)==i){const e=a.get(t.to);if(Lt.mirrorActors){c(e,h.includes(e.type)?21:e.width/2+3)}e.stopy=s-e.height/2,St.bumpVerticalPos(e.height/2)}}o(Vt,"adjustLoopHeightForWrap"),o(Ht,"adjustCreatedDestroyedData");var Gt=o(async function(t,e,s,i){const{securityLevel:a,sequence:n}=l();let r;Lt=n,"sandbox"===a&&(r=h("#i"+e));const c=h("sandbox"===a?r.nodes()[0].contentDocument.body:"body"),u="sandbox"===a?r.nodes()[0].contentDocument:document;St.init(),d.debug(i.db);const f="sandbox"===a?c.select(`[id="${e}"]`):h(`[id="${e}"]`),y=i.db.getActors(),b=i.db.getCreatedActors(),x=i.db.getDestroyedActors(),v=i.db.getBoxes();let m=i.db.getActorKeys();const k=i.db.getMessages(),g=i.db.getDiagramTitle(),w=i.db.hasAtLeastOneBox(),T=i.db.hasAtLeastOneBoxWithTitle(),_=await Ut(y,k,i);if(Lt.height=await Xt(y,_,v),Et.insertComputerIcon(f),Et.insertDatabaseIcon(f),Et.insertClockIcon(f),w&&(St.bumpVerticalPos(Lt.boxMargin),T&&St.bumpVerticalPos(v[0].textMaxHeight)),!0===Lt.hideUnusedParticipants){const t=new Set;k.forEach(e=>{t.add(e.from),t.add(e.to)}),m=m.filter(e=>t.has(e))}Bt(f,y,b,m,0,k,!1);const A=await Jt(k,y,_,i);function $(t,e){const s=St.endActivation(t);s.starty+18>e&&(s.starty=e-6,e+=12),Et.drawActivation(f,s,e,Lt,jt(t.from).length),St.insert(s.startx,e-10,s.stopx,e)}Et.insertArrowHead(f),Et.insertArrowCrossHead(f),Et.insertArrowFilledHead(f),Et.insertSequenceNumber(f),o($,"activeEnd");let I=1,O=1;const E=[],L=[];let S=0;for(const o of k){let t,e,s;switch(o.type){case i.db.LINETYPE.NOTE:St.resetVerticalPos(),e=o.noteModel,await Nt(f,e);break;case i.db.LINETYPE.ACTIVE_START:St.newActivation(o,f,y);break;case i.db.LINETYPE.ACTIVE_END:$(o,St.getVerticalPos());break;case i.db.LINETYPE.LOOP_START:Vt(A,o,Lt.boxMargin,Lt.boxMargin+Lt.boxTextMargin,t=>St.newLoop(t));break;case i.db.LINETYPE.LOOP_END:t=St.endLoop(),await Et.drawLoop(f,t,"loop",Lt),St.bumpVerticalPos(t.stopy-St.getVerticalPos()),St.models.addLoop(t);break;case i.db.LINETYPE.RECT_START:Vt(A,o,Lt.boxMargin,Lt.boxMargin,t=>St.newLoop(void 0,t.message));break;case i.db.LINETYPE.RECT_END:t=St.endLoop(),L.push(t),St.models.addLoop(t),St.bumpVerticalPos(t.stopy-St.getVerticalPos());break;case i.db.LINETYPE.OPT_START:Vt(A,o,Lt.boxMargin,Lt.boxMargin+Lt.boxTextMargin,t=>St.newLoop(t));break;case i.db.LINETYPE.OPT_END:t=St.endLoop(),await Et.drawLoop(f,t,"opt",Lt),St.bumpVerticalPos(t.stopy-St.getVerticalPos()),St.models.addLoop(t);break;case i.db.LINETYPE.ALT_START:Vt(A,o,Lt.boxMargin,Lt.boxMargin+Lt.boxTextMargin,t=>St.newLoop(t));break;case i.db.LINETYPE.ALT_ELSE:Vt(A,o,Lt.boxMargin+Lt.boxTextMargin,Lt.boxMargin,t=>St.addSectionToLoop(t));break;case i.db.LINETYPE.ALT_END:t=St.endLoop(),await Et.drawLoop(f,t,"alt",Lt),St.bumpVerticalPos(t.stopy-St.getVerticalPos()),St.models.addLoop(t);break;case i.db.LINETYPE.PAR_START:case i.db.LINETYPE.PAR_OVER_START:Vt(A,o,Lt.boxMargin,Lt.boxMargin+Lt.boxTextMargin,t=>St.newLoop(t)),St.saveVerticalPos();break;case i.db.LINETYPE.PAR_AND:Vt(A,o,Lt.boxMargin+Lt.boxTextMargin,Lt.boxMargin,t=>St.addSectionToLoop(t));break;case i.db.LINETYPE.PAR_END:t=St.endLoop(),await Et.drawLoop(f,t,"par",Lt),St.bumpVerticalPos(t.stopy-St.getVerticalPos()),St.models.addLoop(t);break;case i.db.LINETYPE.AUTONUMBER:I=o.message.start||I,O=o.message.step||O,o.message.visible?i.db.enableSequenceNumbers():i.db.disableSequenceNumbers();break;case i.db.LINETYPE.CRITICAL_START:Vt(A,o,Lt.boxMargin,Lt.boxMargin+Lt.boxTextMargin,t=>St.newLoop(t));break;case i.db.LINETYPE.CRITICAL_OPTION:Vt(A,o,Lt.boxMargin+Lt.boxTextMargin,Lt.boxMargin,t=>St.addSectionToLoop(t));break;case i.db.LINETYPE.CRITICAL_END:t=St.endLoop(),await Et.drawLoop(f,t,"critical",Lt),St.bumpVerticalPos(t.stopy-St.getVerticalPos()),St.models.addLoop(t);break;case i.db.LINETYPE.BREAK_START:Vt(A,o,Lt.boxMargin,Lt.boxMargin+Lt.boxTextMargin,t=>St.newLoop(t));break;case i.db.LINETYPE.BREAK_END:t=St.endLoop(),await Et.drawLoop(f,t,"break",Lt),St.bumpVerticalPos(t.stopy-St.getVerticalPos()),St.models.addLoop(t);break;default:try{s=o.msgModel,s.starty=St.getVerticalPos(),s.sequenceIndex=I,s.sequenceVisible=i.db.showSequenceNumbers();const t=await Rt(0,s);Ht(o,s,t,S,y,b,x),E.push({messageModel:s,lineStartY:t}),St.models.addMessage(s)}catch(F){d.error("error while drawing message",F)}}[i.db.LINETYPE.SOLID_OPEN,i.db.LINETYPE.DOTTED_OPEN,i.db.LINETYPE.SOLID,i.db.LINETYPE.DOTTED,i.db.LINETYPE.SOLID_CROSS,i.db.LINETYPE.DOTTED_CROSS,i.db.LINETYPE.SOLID_POINT,i.db.LINETYPE.DOTTED_POINT,i.db.LINETYPE.BIDIRECTIONAL_SOLID,i.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(o.type)&&(I+=O),S++}d.debug("createdActors",b),d.debug("destroyedActors",x),await Ft(f,y,m,!1);for(const o of E)await Ct(f,o.messageModel,o.lineStartY,i);Lt.mirrorActors&&await Ft(f,y,m,!0),L.forEach(t=>Et.drawBackgroundRect(f,t)),it(f,y,m,Lt);for(const o of St.models.boxes){o.height=St.getVerticalPos()-o.y,St.insert(o.x,o.y,o.x+o.width,o.height);const t=2*Lt.boxMargin;o.startx=o.x-t,o.starty=o.y-.25*t,o.stopx=o.startx+o.width+2*t,o.stopy=o.starty+o.height+.75*t,o.stroke="rgb(0,0,0, 0.5)",Et.drawBox(f,o,Lt)}w&&St.bumpVerticalPos(Lt.boxMargin);const N=qt(f,y,m,u),{bounds:D}=St.getBounds();void 0===D.startx&&(D.startx=0),void 0===D.starty&&(D.starty=0),void 0===D.stopx&&(D.stopx=0),void 0===D.stopy&&(D.stopy=0);let M=D.stopy-D.starty;M<N.maxHeight&&(M=N.maxHeight);let P=M+2*Lt.diagramMarginY;Lt.mirrorActors&&(P=P-Lt.boxMargin+Lt.bottomMarginAdj);let R=D.stopx-D.startx;R<N.maxWidth&&(R=N.maxWidth);const C=R+2*Lt.diagramMarginX;g&&f.append("text").text(g).attr("x",(D.stopx-D.startx)/2-2*Lt.diagramMarginX).attr("y",-25),p(f,P,C,Lt.useMaxWidth);const B=g?40:0;f.attr("viewBox",D.startx-Lt.diagramMarginX+" -"+(Lt.diagramMarginY+B)+" "+C+" "+(P+B)),d.debug("models:",St.models)},"draw");async function Ut(t,e,s){const i={};for(const a of e)if(t.get(a.to)&&t.get(a.from)){const e=t.get(a.to);if(a.placement===s.db.PLACEMENT.LEFTOF&&!e.prevActor)continue;if(a.placement===s.db.PLACEMENT.RIGHTOF&&!e.nextActor)continue;const n=void 0!==a.placement,r=!n,o=n?Mt(Lt):Dt(Lt),c=a.wrap?$.wrapLabel(a.message,Lt.width-2*Lt.wrapPadding,o):a.message,h=(I(c)?await O(a.message,l()):$.calculateTextDimensions(c,o)).width+2*Lt.wrapPadding;r&&a.from===e.nextActor?i[a.to]=y.getMax(i[a.to]||0,h):r&&a.from===e.prevActor?i[a.from]=y.getMax(i[a.from]||0,h):r&&a.from===a.to?(i[a.from]=y.getMax(i[a.from]||0,h/2),i[a.to]=y.getMax(i[a.to]||0,h/2)):a.placement===s.db.PLACEMENT.RIGHTOF?i[a.from]=y.getMax(i[a.from]||0,h):a.placement===s.db.PLACEMENT.LEFTOF?i[e.prevActor]=y.getMax(i[e.prevActor]||0,h):a.placement===s.db.PLACEMENT.OVER&&(e.prevActor&&(i[e.prevActor]=y.getMax(i[e.prevActor]||0,h/2)),e.nextActor&&(i[a.from]=y.getMax(i[a.from]||0,h/2)))}return d.debug("maxMessageWidthPerActor:",i),i}o(Ut,"getMaxMessageWidthPerActor");var Kt=o(function(t){let e=0;const s=Pt(Lt);for(const i in t.links){const t=$.calculateTextDimensions(i,s).width+2*Lt.wrapPadding+2*Lt.boxMargin;e<t&&(e=t)}return e},"getRequiredPopupWidth");async function Xt(t,e,s){let i=0;for(const n of t.keys()){const e=t.get(n);e.wrap&&(e.description=$.wrapLabel(e.description,Lt.width-2*Lt.wrapPadding,Pt(Lt)));const s=I(e.description)?await O(e.description,l()):$.calculateTextDimensions(e.description,Pt(Lt));e.width=e.wrap?Lt.width:y.getMax(Lt.width,s.width+2*Lt.wrapPadding),e.height=e.wrap?y.getMax(s.height,Lt.height):Lt.height,i=y.getMax(i,e.height)}for(const n in e){const s=t.get(n);if(!s)continue;const i=t.get(s.nextActor);if(!i){const t=e[n]+Lt.actorMargin-s.width/2;s.margin=y.getMax(t,Lt.actorMargin);continue}const a=e[n]+Lt.actorMargin-s.width/2-i.width/2;s.margin=y.getMax(a,Lt.actorMargin)}let a=0;return s.forEach(e=>{const s=Dt(Lt);let i=e.actorKeys.reduce((e,s)=>e+(t.get(s).width+(t.get(s).margin||0)),0);i+=8*Lt.boxMargin,i-=2*Lt.boxTextMargin,e.wrap&&(e.name=$.wrapLabel(e.name,i-2*Lt.wrapPadding,s));const n=$.calculateTextDimensions(e.name,s);a=y.getMax(n.height,a);const r=y.getMax(i,n.width+2*Lt.wrapPadding);if(e.margin=Lt.boxTextMargin,i<r){const t=(r-i)/2;e.margin+=t}}),s.forEach(t=>t.textMaxHeight=a),y.getMax(i,Lt.height)}o(Xt,"calculateActorMargins");var Yt=o(async function(t,e,s){const i=e.get(t.from),a=e.get(t.to),n=i.x,r=a.x,o=t.wrap&&t.message;let c=I(t.message)?await O(t.message,l()):$.calculateTextDimensions(o?$.wrapLabel(t.message,Lt.width,Mt(Lt)):t.message,Mt(Lt));const h={width:o?Lt.width:y.getMax(Lt.width,c.width+2*Lt.noteMargin),height:0,startx:i.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===s.db.PLACEMENT.RIGHTOF?(h.width=o?y.getMax(Lt.width,c.width):y.getMax(i.width/2+a.width/2,c.width+2*Lt.noteMargin),h.startx=n+(i.width+Lt.actorMargin)/2):t.placement===s.db.PLACEMENT.LEFTOF?(h.width=o?y.getMax(Lt.width,c.width+2*Lt.noteMargin):y.getMax(i.width/2+a.width/2,c.width+2*Lt.noteMargin),h.startx=n-h.width+(i.width-Lt.actorMargin)/2):t.to===t.from?(c=$.calculateTextDimensions(o?$.wrapLabel(t.message,y.getMax(Lt.width,i.width),Mt(Lt)):t.message,Mt(Lt)),h.width=o?y.getMax(Lt.width,i.width):y.getMax(i.width,Lt.width,c.width+2*Lt.noteMargin),h.startx=n+(i.width-h.width)/2):(h.width=Math.abs(n+i.width/2-(r+a.width/2))+Lt.actorMargin,h.startx=n<r?n+i.width/2-Lt.actorMargin/2:r+a.width/2-Lt.actorMargin/2),o&&(h.message=$.wrapLabel(t.message,h.width-2*Lt.wrapPadding,Mt(Lt))),d.debug(`NM:[${h.startx},${h.stopx},${h.starty},${h.stopy}:${h.width},${h.height}=${t.message}]`),h},"buildNoteModel"),Zt=o(function(t,e,s){if(![s.db.LINETYPE.SOLID_OPEN,s.db.LINETYPE.DOTTED_OPEN,s.db.LINETYPE.SOLID,s.db.LINETYPE.DOTTED,s.db.LINETYPE.SOLID_CROSS,s.db.LINETYPE.DOTTED_CROSS,s.db.LINETYPE.SOLID_POINT,s.db.LINETYPE.DOTTED_POINT,s.db.LINETYPE.BIDIRECTIONAL_SOLID,s.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type))return{};const[i,a]=zt(t.from,e),[n,r]=zt(t.to,e),c=i<=n;let l=c?a:i,h=c?n:r;const d=Math.abs(n-r)>2,u=o(t=>c?-t:t,"adjustValue");t.from===t.to?h=l:(t.activate&&!d&&(h+=u(Lt.activationWidth/2-1)),[s.db.LINETYPE.SOLID_OPEN,s.db.LINETYPE.DOTTED_OPEN].includes(t.type)||(h+=u(3)),[s.db.LINETYPE.BIDIRECTIONAL_SOLID,s.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type)&&(l-=u(3)));const p=[i,a,n,r],f=Math.abs(l-h);t.wrap&&t.message&&(t.message=$.wrapLabel(t.message,y.getMax(f+2*Lt.wrapPadding,Lt.width),Dt(Lt)));const b=$.calculateTextDimensions(t.message,Dt(Lt));return{width:y.getMax(t.wrap?0:b.width+2*Lt.wrapPadding,f+2*Lt.wrapPadding,Lt.width),height:0,startx:l,stopx:h,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,p),toBounds:Math.max.apply(null,p)}},"buildMessageModel"),Jt=o(async function(t,e,s,i){const a={},n=[];let r,o,c;for(const l of t){switch(l.type){case i.db.LINETYPE.LOOP_START:case i.db.LINETYPE.ALT_START:case i.db.LINETYPE.OPT_START:case i.db.LINETYPE.PAR_START:case i.db.LINETYPE.PAR_OVER_START:case i.db.LINETYPE.CRITICAL_START:case i.db.LINETYPE.BREAK_START:n.push({id:l.id,msg:l.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case i.db.LINETYPE.ALT_ELSE:case i.db.LINETYPE.PAR_AND:case i.db.LINETYPE.CRITICAL_OPTION:l.message&&(r=n.pop(),a[r.id]=r,a[l.id]=r,n.push(r));break;case i.db.LINETYPE.LOOP_END:case i.db.LINETYPE.ALT_END:case i.db.LINETYPE.OPT_END:case i.db.LINETYPE.PAR_END:case i.db.LINETYPE.CRITICAL_END:case i.db.LINETYPE.BREAK_END:r=n.pop(),a[r.id]=r;break;case i.db.LINETYPE.ACTIVE_START:{const t=e.get(l.from?l.from:l.to.actor),s=jt(l.from?l.from:l.to.actor).length,i=t.x+t.width/2+(s-1)*Lt.activationWidth/2,a={startx:i,stopx:i+Lt.activationWidth,actor:l.from,enabled:!0};St.activations.push(a)}break;case i.db.LINETYPE.ACTIVE_END:{const t=St.activations.map(t=>t.actor).lastIndexOf(l.from);St.activations.splice(t,1).splice(0,1)}}void 0!==l.placement?(o=await Yt(l,e,i),l.noteModel=o,n.forEach(t=>{r=t,r.from=y.getMin(r.from,o.startx),r.to=y.getMax(r.to,o.startx+o.width),r.width=y.getMax(r.width,Math.abs(r.from-r.to))-Lt.labelBoxWidth})):(c=Zt(l,e,i),l.msgModel=c,c.startx&&c.stopx&&n.length>0&&n.forEach(t=>{if(r=t,c.startx===c.stopx){const t=e.get(l.from),s=e.get(l.to);r.from=y.getMin(t.x-c.width/2,t.x-t.width/2,r.from),r.to=y.getMax(s.x+c.width/2,s.x+t.width/2,r.to),r.width=y.getMax(r.width,Math.abs(r.to-r.from))-Lt.labelBoxWidth}else r.from=y.getMin(c.startx,r.from),r.to=y.getMax(c.stopx,r.to),r.width=y.getMax(r.width,c.width)-Lt.labelBoxWidth}))}return St.activations=[],d.debug("Loop type widths:",a),a},"calculateLoopBounds"),Qt={bounds:St,drawActors:Ft,drawActorsPopup:qt,setConf:Wt,draw:Gt},te={parser:R,get db(){return new V},renderer:Qt,styles:H,init:o(t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,c({sequence:{wrap:t.wrap}}))},"init")};export{te as diagram};
|
|
1
|
+
var t;import{a as e,b as s,g as i,d as a,c as n,e as r}from"./chunk-TZMSLE5B-D3SRAd4i.js";import{_ as o,n as c,c as l,d as h,l as d,j as u,e as p,f,k as y,b,s as x,p as v,a as m,g as k,q as g,t as w,J as T,y as _,i as A,u as $,L as I,M as O,N as E,Z as L,O as S,P as N,F as D}from"./index-BvMYTiOr.js";import{I as M}from"./chunk-QZHKN3VN-DWUuzBl_.js";var P=function(){var t=o(function(t,e,s,i){for(s=s||{},i=t.length;i--;s[t[i]]=e);return s},"o"),e=[1,2],s=[1,3],i=[1,4],a=[2,4],n=[1,9],r=[1,11],c=[1,13],l=[1,14],h=[1,16],d=[1,17],u=[1,18],p=[1,24],f=[1,25],y=[1,26],b=[1,27],x=[1,28],v=[1,29],m=[1,30],k=[1,31],g=[1,32],w=[1,33],T=[1,34],_=[1,35],A=[1,36],$=[1,37],I=[1,38],O=[1,39],E=[1,41],L=[1,42],S=[1,43],N=[1,44],D=[1,45],M=[1,46],P=[1,4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,48,49,50,52,53,55,60,61,62,63,71],R=[2,71],C=[4,5,16,50,52,53],B=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,55,60,61,62,63,71],F=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,49,50,52,53,55,60,61,62,63,71],q=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,48,50,52,53,55,60,61,62,63,71],W=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,50,52,53,55,60,61,62,63,71],j=[69,70,71],z=[1,127],V={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,box_section:10,box_line:11,participant_statement:12,create:13,box:14,restOfLine:15,end:16,signal:17,autonumber:18,NUM:19,off:20,activate:21,actor:22,deactivate:23,note_statement:24,links_statement:25,link_statement:26,properties_statement:27,details_statement:28,title:29,legacy_title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,loop:36,rect:37,opt:38,alt:39,else_sections:40,par:41,par_sections:42,par_over:43,critical:44,option_sections:45,break:46,option:47,and:48,else:49,participant:50,AS:51,participant_actor:52,destroy:53,actor_with_config:54,note:55,placement:56,text2:57,over:58,actor_pair:59,links:60,link:61,properties:62,details:63,spaceList:64,",":65,left_of:66,right_of:67,signaltype:68,"+":69,"-":70,ACTOR:71,config_object:72,CONFIG_START:73,CONFIG_CONTENT:74,CONFIG_END:75,SOLID_OPEN_ARROW:76,DOTTED_OPEN_ARROW:77,SOLID_ARROW:78,BIDIRECTIONAL_SOLID_ARROW:79,DOTTED_ARROW:80,BIDIRECTIONAL_DOTTED_ARROW:81,SOLID_CROSS:82,DOTTED_CROSS:83,SOLID_POINT:84,DOTTED_POINT:85,TXT:86,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",13:"create",14:"box",15:"restOfLine",16:"end",18:"autonumber",19:"NUM",20:"off",21:"activate",23:"deactivate",29:"title",30:"legacy_title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"loop",37:"rect",38:"opt",39:"alt",41:"par",43:"par_over",44:"critical",46:"break",47:"option",48:"and",49:"else",50:"participant",51:"AS",52:"participant_actor",53:"destroy",55:"note",58:"over",60:"links",61:"link",62:"properties",63:"details",65:",",66:"left_of",67:"right_of",69:"+",70:"-",71:"ACTOR",73:"CONFIG_START",74:"CONFIG_CONTENT",75:"CONFIG_END",76:"SOLID_OPEN_ARROW",77:"DOTTED_OPEN_ARROW",78:"SOLID_ARROW",79:"BIDIRECTIONAL_SOLID_ARROW",80:"DOTTED_ARROW",81:"BIDIRECTIONAL_DOTTED_ARROW",82:"SOLID_CROSS",83:"DOTTED_CROSS",84:"SOLID_POINT",85:"DOTTED_POINT",86:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[10,0],[10,2],[11,2],[11,1],[11,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[45,1],[45,4],[42,1],[42,4],[40,1],[40,4],[12,5],[12,3],[12,5],[12,3],[12,3],[12,3],[24,4],[24,4],[25,3],[26,3],[27,3],[28,3],[64,2],[64,1],[59,3],[59,1],[56,1],[56,1],[17,5],[17,5],[17,4],[54,2],[72,3],[22,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[57,1]],performAction:o(function(t,e,s,i,a,n,r){var o=n.length-1;switch(a){case 3:return i.apply(n[o]),n[o];case 4:case 9:case 8:case 13:this.$=[];break;case 5:case 10:n[o-1].push(n[o]),this.$=n[o-1];break;case 6:case 7:case 11:case 12:case 63:this.$=n[o];break;case 15:n[o].type="createParticipant",this.$=n[o];break;case 16:n[o-1].unshift({type:"boxStart",boxData:i.parseBoxData(n[o-2])}),n[o-1].push({type:"boxEnd",boxText:n[o-2]}),this.$=n[o-1];break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(n[o-2]),sequenceIndexStep:Number(n[o-1]),sequenceVisible:!0,signalType:i.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(n[o-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:i.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:i.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:i.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"activeStart",signalType:i.LINETYPE.ACTIVE_START,actor:n[o-1].actor};break;case 23:this.$={type:"activeEnd",signalType:i.LINETYPE.ACTIVE_END,actor:n[o-1].actor};break;case 29:i.setDiagramTitle(n[o].substring(6)),this.$=n[o].substring(6);break;case 30:i.setDiagramTitle(n[o].substring(7)),this.$=n[o].substring(7);break;case 31:this.$=n[o].trim(),i.setAccTitle(this.$);break;case 32:case 33:this.$=n[o].trim(),i.setAccDescription(this.$);break;case 34:n[o-1].unshift({type:"loopStart",loopText:i.parseMessage(n[o-2]),signalType:i.LINETYPE.LOOP_START}),n[o-1].push({type:"loopEnd",loopText:n[o-2],signalType:i.LINETYPE.LOOP_END}),this.$=n[o-1];break;case 35:n[o-1].unshift({type:"rectStart",color:i.parseMessage(n[o-2]),signalType:i.LINETYPE.RECT_START}),n[o-1].push({type:"rectEnd",color:i.parseMessage(n[o-2]),signalType:i.LINETYPE.RECT_END}),this.$=n[o-1];break;case 36:n[o-1].unshift({type:"optStart",optText:i.parseMessage(n[o-2]),signalType:i.LINETYPE.OPT_START}),n[o-1].push({type:"optEnd",optText:i.parseMessage(n[o-2]),signalType:i.LINETYPE.OPT_END}),this.$=n[o-1];break;case 37:n[o-1].unshift({type:"altStart",altText:i.parseMessage(n[o-2]),signalType:i.LINETYPE.ALT_START}),n[o-1].push({type:"altEnd",signalType:i.LINETYPE.ALT_END}),this.$=n[o-1];break;case 38:n[o-1].unshift({type:"parStart",parText:i.parseMessage(n[o-2]),signalType:i.LINETYPE.PAR_START}),n[o-1].push({type:"parEnd",signalType:i.LINETYPE.PAR_END}),this.$=n[o-1];break;case 39:n[o-1].unshift({type:"parStart",parText:i.parseMessage(n[o-2]),signalType:i.LINETYPE.PAR_OVER_START}),n[o-1].push({type:"parEnd",signalType:i.LINETYPE.PAR_END}),this.$=n[o-1];break;case 40:n[o-1].unshift({type:"criticalStart",criticalText:i.parseMessage(n[o-2]),signalType:i.LINETYPE.CRITICAL_START}),n[o-1].push({type:"criticalEnd",signalType:i.LINETYPE.CRITICAL_END}),this.$=n[o-1];break;case 41:n[o-1].unshift({type:"breakStart",breakText:i.parseMessage(n[o-2]),signalType:i.LINETYPE.BREAK_START}),n[o-1].push({type:"breakEnd",optText:i.parseMessage(n[o-2]),signalType:i.LINETYPE.BREAK_END}),this.$=n[o-1];break;case 43:this.$=n[o-3].concat([{type:"option",optionText:i.parseMessage(n[o-1]),signalType:i.LINETYPE.CRITICAL_OPTION},n[o]]);break;case 45:this.$=n[o-3].concat([{type:"and",parText:i.parseMessage(n[o-1]),signalType:i.LINETYPE.PAR_AND},n[o]]);break;case 47:this.$=n[o-3].concat([{type:"else",altText:i.parseMessage(n[o-1]),signalType:i.LINETYPE.ALT_ELSE},n[o]]);break;case 48:n[o-3].draw="participant",n[o-3].type="addParticipant",n[o-3].description=i.parseMessage(n[o-1]),this.$=n[o-3];break;case 49:case 53:n[o-1].draw="participant",n[o-1].type="addParticipant",this.$=n[o-1];break;case 50:n[o-3].draw="actor",n[o-3].type="addParticipant",n[o-3].description=i.parseMessage(n[o-1]),this.$=n[o-3];break;case 51:n[o-1].draw="actor",n[o-1].type="addParticipant",this.$=n[o-1];break;case 52:n[o-1].type="destroyParticipant",this.$=n[o-1];break;case 54:this.$=[n[o-1],{type:"addNote",placement:n[o-2],actor:n[o-1].actor,text:n[o]}];break;case 55:n[o-2]=[].concat(n[o-1],n[o-1]).slice(0,2),n[o-2][0]=n[o-2][0].actor,n[o-2][1]=n[o-2][1].actor,this.$=[n[o-1],{type:"addNote",placement:i.PLACEMENT.OVER,actor:n[o-2].slice(0,2),text:n[o]}];break;case 56:this.$=[n[o-1],{type:"addLinks",actor:n[o-1].actor,text:n[o]}];break;case 57:this.$=[n[o-1],{type:"addALink",actor:n[o-1].actor,text:n[o]}];break;case 58:this.$=[n[o-1],{type:"addProperties",actor:n[o-1].actor,text:n[o]}];break;case 59:this.$=[n[o-1],{type:"addDetails",actor:n[o-1].actor,text:n[o]}];break;case 62:this.$=[n[o-2],n[o]];break;case 64:this.$=i.PLACEMENT.LEFTOF;break;case 65:this.$=i.PLACEMENT.RIGHTOF;break;case 66:this.$=[n[o-4],n[o-1],{type:"addMessage",from:n[o-4].actor,to:n[o-1].actor,signalType:n[o-3],msg:n[o],activate:!0},{type:"activeStart",signalType:i.LINETYPE.ACTIVE_START,actor:n[o-1].actor}];break;case 67:this.$=[n[o-4],n[o-1],{type:"addMessage",from:n[o-4].actor,to:n[o-1].actor,signalType:n[o-3],msg:n[o]},{type:"activeEnd",signalType:i.LINETYPE.ACTIVE_END,actor:n[o-4].actor}];break;case 68:this.$=[n[o-3],n[o-1],{type:"addMessage",from:n[o-3].actor,to:n[o-1].actor,signalType:n[o-2],msg:n[o]}];break;case 69:this.$={type:"addParticipant",actor:n[o-1],config:n[o]};break;case 70:this.$=n[o-1].trim();break;case 71:this.$={type:"addParticipant",actor:n[o]};break;case 72:this.$=i.LINETYPE.SOLID_OPEN;break;case 73:this.$=i.LINETYPE.DOTTED_OPEN;break;case 74:this.$=i.LINETYPE.SOLID;break;case 75:this.$=i.LINETYPE.BIDIRECTIONAL_SOLID;break;case 76:this.$=i.LINETYPE.DOTTED;break;case 77:this.$=i.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 78:this.$=i.LINETYPE.SOLID_CROSS;break;case 79:this.$=i.LINETYPE.DOTTED_CROSS;break;case 80:this.$=i.LINETYPE.SOLID_POINT;break;case 81:this.$=i.LINETYPE.DOTTED_POINT;break;case 82:this.$=i.parseMessage(n[o].trim().substring(1))}},"anonymous"),table:[{3:1,4:e,5:s,6:i},{1:[3]},{3:5,4:e,5:s,6:i},{3:6,4:e,5:s,6:i},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,55,60,61,62,63,71],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:n,5:r,8:8,9:10,12:12,13:c,14:l,17:15,18:h,21:d,22:40,23:u,24:19,25:20,26:21,27:22,28:23,29:p,30:f,31:y,33:b,35:x,36:v,37:m,38:k,39:g,41:w,43:T,44:_,46:A,50:$,52:I,53:O,55:E,60:L,61:S,62:N,63:D,71:M},t(P,[2,5]),{9:47,12:12,13:c,14:l,17:15,18:h,21:d,22:40,23:u,24:19,25:20,26:21,27:22,28:23,29:p,30:f,31:y,33:b,35:x,36:v,37:m,38:k,39:g,41:w,43:T,44:_,46:A,50:$,52:I,53:O,55:E,60:L,61:S,62:N,63:D,71:M},t(P,[2,7]),t(P,[2,8]),t(P,[2,14]),{12:48,50:$,52:I,53:O},{15:[1,49]},{5:[1,50]},{5:[1,53],19:[1,51],20:[1,52]},{22:54,71:M},{22:55,71:M},{5:[1,56]},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},t(P,[2,29]),t(P,[2,30]),{32:[1,61]},{34:[1,62]},t(P,[2,33]),{15:[1,63]},{15:[1,64]},{15:[1,65]},{15:[1,66]},{15:[1,67]},{15:[1,68]},{15:[1,69]},{15:[1,70]},{22:71,54:72,71:[1,73]},{22:74,71:M},{22:75,71:M},{68:76,76:[1,77],77:[1,78],78:[1,79],79:[1,80],80:[1,81],81:[1,82],82:[1,83],83:[1,84],84:[1,85],85:[1,86]},{56:87,58:[1,88],66:[1,89],67:[1,90]},{22:91,71:M},{22:92,71:M},{22:93,71:M},{22:94,71:M},t([5,51,65,76,77,78,79,80,81,82,83,84,85,86],R),t(P,[2,6]),t(P,[2,15]),t(C,[2,9],{10:95}),t(P,[2,17]),{5:[1,97],19:[1,96]},{5:[1,98]},t(P,[2,21]),{5:[1,99]},{5:[1,100]},t(P,[2,24]),t(P,[2,25]),t(P,[2,26]),t(P,[2,27]),t(P,[2,28]),t(P,[2,31]),t(P,[2,32]),t(B,a,{7:101}),t(B,a,{7:102}),t(B,a,{7:103}),t(F,a,{40:104,7:105}),t(q,a,{42:106,7:107}),t(q,a,{7:107,42:108}),t(W,a,{45:109,7:110}),t(B,a,{7:111}),{5:[1,113],51:[1,112]},{5:[1,114]},t([5,51],R,{72:115,73:[1,116]}),{5:[1,118],51:[1,117]},{5:[1,119]},{22:122,69:[1,120],70:[1,121],71:M},t(j,[2,72]),t(j,[2,73]),t(j,[2,74]),t(j,[2,75]),t(j,[2,76]),t(j,[2,77]),t(j,[2,78]),t(j,[2,79]),t(j,[2,80]),t(j,[2,81]),{22:123,71:M},{22:125,59:124,71:M},{71:[2,64]},{71:[2,65]},{57:126,86:z},{57:128,86:z},{57:129,86:z},{57:130,86:z},{4:[1,133],5:[1,135],11:132,12:134,16:[1,131],50:$,52:I,53:O},{5:[1,136]},t(P,[2,19]),t(P,[2,20]),t(P,[2,22]),t(P,[2,23]),{4:n,5:r,8:8,9:10,12:12,13:c,14:l,16:[1,137],17:15,18:h,21:d,22:40,23:u,24:19,25:20,26:21,27:22,28:23,29:p,30:f,31:y,33:b,35:x,36:v,37:m,38:k,39:g,41:w,43:T,44:_,46:A,50:$,52:I,53:O,55:E,60:L,61:S,62:N,63:D,71:M},{4:n,5:r,8:8,9:10,12:12,13:c,14:l,16:[1,138],17:15,18:h,21:d,22:40,23:u,24:19,25:20,26:21,27:22,28:23,29:p,30:f,31:y,33:b,35:x,36:v,37:m,38:k,39:g,41:w,43:T,44:_,46:A,50:$,52:I,53:O,55:E,60:L,61:S,62:N,63:D,71:M},{4:n,5:r,8:8,9:10,12:12,13:c,14:l,16:[1,139],17:15,18:h,21:d,22:40,23:u,24:19,25:20,26:21,27:22,28:23,29:p,30:f,31:y,33:b,35:x,36:v,37:m,38:k,39:g,41:w,43:T,44:_,46:A,50:$,52:I,53:O,55:E,60:L,61:S,62:N,63:D,71:M},{16:[1,140]},{4:n,5:r,8:8,9:10,12:12,13:c,14:l,16:[2,46],17:15,18:h,21:d,22:40,23:u,24:19,25:20,26:21,27:22,28:23,29:p,30:f,31:y,33:b,35:x,36:v,37:m,38:k,39:g,41:w,43:T,44:_,46:A,49:[1,141],50:$,52:I,53:O,55:E,60:L,61:S,62:N,63:D,71:M},{16:[1,142]},{4:n,5:r,8:8,9:10,12:12,13:c,14:l,16:[2,44],17:15,18:h,21:d,22:40,23:u,24:19,25:20,26:21,27:22,28:23,29:p,30:f,31:y,33:b,35:x,36:v,37:m,38:k,39:g,41:w,43:T,44:_,46:A,48:[1,143],50:$,52:I,53:O,55:E,60:L,61:S,62:N,63:D,71:M},{16:[1,144]},{16:[1,145]},{4:n,5:r,8:8,9:10,12:12,13:c,14:l,16:[2,42],17:15,18:h,21:d,22:40,23:u,24:19,25:20,26:21,27:22,28:23,29:p,30:f,31:y,33:b,35:x,36:v,37:m,38:k,39:g,41:w,43:T,44:_,46:A,47:[1,146],50:$,52:I,53:O,55:E,60:L,61:S,62:N,63:D,71:M},{4:n,5:r,8:8,9:10,12:12,13:c,14:l,16:[1,147],17:15,18:h,21:d,22:40,23:u,24:19,25:20,26:21,27:22,28:23,29:p,30:f,31:y,33:b,35:x,36:v,37:m,38:k,39:g,41:w,43:T,44:_,46:A,50:$,52:I,53:O,55:E,60:L,61:S,62:N,63:D,71:M},{15:[1,148]},t(P,[2,49]),t(P,[2,53]),{5:[2,69]},{74:[1,149]},{15:[1,150]},t(P,[2,51]),t(P,[2,52]),{22:151,71:M},{22:152,71:M},{57:153,86:z},{57:154,86:z},{57:155,86:z},{65:[1,156],86:[2,63]},{5:[2,56]},{5:[2,82]},{5:[2,57]},{5:[2,58]},{5:[2,59]},t(P,[2,16]),t(C,[2,10]),{12:157,50:$,52:I,53:O},t(C,[2,12]),t(C,[2,13]),t(P,[2,18]),t(P,[2,34]),t(P,[2,35]),t(P,[2,36]),t(P,[2,37]),{15:[1,158]},t(P,[2,38]),{15:[1,159]},t(P,[2,39]),t(P,[2,40]),{15:[1,160]},t(P,[2,41]),{5:[1,161]},{75:[1,162]},{5:[1,163]},{57:164,86:z},{57:165,86:z},{5:[2,68]},{5:[2,54]},{5:[2,55]},{22:166,71:M},t(C,[2,11]),t(F,a,{7:105,40:167}),t(q,a,{7:107,42:168}),t(W,a,{7:110,45:169}),t(P,[2,48]),{5:[2,70]},t(P,[2,50]),{5:[2,66]},{5:[2,67]},{86:[2,62]},{16:[2,47]},{16:[2,45]},{16:[2,43]}],defaultActions:{5:[2,1],6:[2,2],89:[2,64],90:[2,65],115:[2,69],126:[2,56],127:[2,82],128:[2,57],129:[2,58],130:[2,59],153:[2,68],154:[2,54],155:[2,55],162:[2,70],164:[2,66],165:[2,67],166:[2,62],167:[2,47],168:[2,45],169:[2,43]},parseError:o(function(t,e){if(!e.recoverable){var s=new Error(t);throw s.hash=e,s}this.trace(t)},"parseError"),parse:o(function(t){var e=this,s=[0],i=[],a=[null],n=[],r=this.table,c="",l=0,h=0,d=n.slice.call(arguments,1),u=Object.create(this.lexer),p={yy:{}};for(var f in this.yy)Object.prototype.hasOwnProperty.call(this.yy,f)&&(p.yy[f]=this.yy[f]);u.setInput(t,p.yy),p.yy.lexer=u,p.yy.parser=this,void 0===u.yylloc&&(u.yylloc={});var y=u.yylloc;n.push(y);var b=u.options&&u.options.ranges;function x(){var t;return"number"!=typeof(t=i.pop()||u.lex()||1)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(function(t){s.length=s.length-2*t,a.length=a.length-t,n.length=n.length-t},"popStack"),o(x,"lex");for(var v,m,k,g,w,T,_,A,$={};;){if(m=s[s.length-1],this.defaultActions[m]?k=this.defaultActions[m]:(null==v&&(v=x()),k=r[m]&&r[m][v]),void 0===k||!k.length||!k[0]){var I="";for(w in A=[],r[m])this.terminals_[w]&&w>2&&A.push("'"+this.terminals_[w]+"'");I=u.showPosition?"Parse error on line "+(l+1)+":\n"+u.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==v?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(I,{text:u.match,token:this.terminals_[v]||v,line:u.yylineno,loc:y,expected:A})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+m+", token: "+v);switch(k[0]){case 1:s.push(v),a.push(u.yytext),n.push(u.yylloc),s.push(k[1]),v=null,h=u.yyleng,c=u.yytext,l=u.yylineno,y=u.yylloc;break;case 2:if(T=this.productions_[k[1]][1],$.$=a[a.length-T],$._$={first_line:n[n.length-(T||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(T||1)].first_column,last_column:n[n.length-1].last_column},b&&($._$.range=[n[n.length-(T||1)].range[0],n[n.length-1].range[1]]),void 0!==(g=this.performAction.apply($,[c,h,l,p.yy,k[1],a,n].concat(d))))return g;T&&(s=s.slice(0,-1*T*2),a=a.slice(0,-1*T),n=n.slice(0,-1*T)),s.push(this.productions_[k[1]][0]),a.push($.$),n.push($._$),_=r[s[s.length-2]][s[s.length-1]],s.push(_);break;case 3:return!0}}return!0},"parse")},H=function(){return{EOF:1,parseError:o(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:o(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:o(function(t){var e=t.length,s=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),s.length-1&&(this.yylineno-=s.length-1);var a=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:s?(s.length===i.length?this.yylloc.first_column:0)+i[i.length-s.length].length-s[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[a[0],a[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:o(function(t){this.unput(this.match.slice(t))},"less"),pastInput:o(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:o(function(t,e){var s,i,a;if(this.options.backtrack_lexer&&(a={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&&(a.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],s=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack){for(var n in a)this[n]=a[n];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;var t,e,s,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var a=this._currentRules(),n=0;n<a.length;n++)if((s=this._input.match(this.rules[a[n]]))&&(!e||s[0].length>e[0].length)){if(e=s,i=n,this.options.backtrack_lexer){if(!1!==(t=this.test_match(s,a[n])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,a[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var t=this.next();return t||this.lex()},"lex"),begin:o(function(t){this.conditionStack.push(t)},"begin"),popState:o(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:o(function(t){this.begin(t)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(t,e,s,i){switch(s){case 0:case 56:case 72:return 5;case 1:case 2:case 3:case 4:case 5:break;case 6:return 19;case 7:return this.begin("CONFIG"),73;case 8:return 74;case 9:return this.popState(),this.popState(),75;case 10:case 57:return e.yytext=e.yytext.trim(),71;case 11:case 17:return e.yytext=e.yytext.trim(),this.begin("ALIAS"),71;case 12:return this.begin("LINE"),14;case 13:return this.begin("ID"),50;case 14:return this.begin("ID"),52;case 15:return 13;case 16:return this.begin("ID"),53;case 18:return this.popState(),this.popState(),this.begin("LINE"),51;case 19:return this.popState(),this.popState(),5;case 20:return this.begin("LINE"),36;case 21:return this.begin("LINE"),37;case 22:return this.begin("LINE"),38;case 23:return this.begin("LINE"),39;case 24:return this.begin("LINE"),49;case 25:return this.begin("LINE"),41;case 26:return this.begin("LINE"),43;case 27:return this.begin("LINE"),48;case 28:return this.begin("LINE"),44;case 29:return this.begin("LINE"),47;case 30:return this.begin("LINE"),46;case 31:return this.popState(),15;case 32:return 16;case 33:return 66;case 34:return 67;case 35:return 60;case 36:return 61;case 37:return 62;case 38:return 63;case 39:return 58;case 40:return 55;case 41:return this.begin("ID"),21;case 42:return this.begin("ID"),23;case 43:return 29;case 44:return 30;case 45:return this.begin("acc_title"),31;case 46:return this.popState(),"acc_title_value";case 47:return this.begin("acc_descr"),33;case 48:return this.popState(),"acc_descr_value";case 49:this.begin("acc_descr_multiline");break;case 50:this.popState();break;case 51:return"acc_descr_multiline_value";case 52:return 6;case 53:return 18;case 54:return 20;case 55:return 65;case 58:return 78;case 59:return 79;case 60:return 80;case 61:return 81;case 62:return 76;case 63:return 77;case 64:return 82;case 65:return 83;case 66:return 84;case 67:return 85;case 68:case 69:return 86;case 70:return 69;case 71:return 70;case 73:return"INVALID"}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^\<->\->:\n,;@]+?([\-]*[^\<->\->:\n,;@]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:[^<\->\->:\n,;]+?([\-]*[^<\->\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[50,51],inclusive:!1},acc_descr:{rules:[48],inclusive:!1},acc_title:{rules:[46],inclusive:!1},ID:{rules:[2,3,7,10,11,17],inclusive:!1},ALIAS:{rules:[2,3,18,19],inclusive:!1},LINE:{rules:[2,3,31],inclusive:!1},CONFIG:{rules:[8,9],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,12,13,14,15,16,20,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,47,49,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73],inclusive:!0}}}}();function G(){this.yy={}}return V.lexer=H,o(G,"Parser"),G.prototype=V,V.Parser=G,new G}();P.parser=P;var R=P,C={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},B={FILLED:0,OPEN:1},F={LEFTOF:0,RIGHTOF:1,OVER:2},q="actor",W="control",j="database",z="entity",V=(o(t=class{constructor(){this.state=new M(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=b,this.setAccDescription=x,this.setDiagramTitle=v,this.getAccTitle=m,this.getAccDescription=k,this.getDiagramTitle=g,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(l().wrap),this.LINETYPE=C,this.ARROWTYPE=B,this.PLACEMENT=F}addBox(t){this.state.records.boxes.push({name:t.text,wrap:t.wrap??this.autoWrap(),fill:t.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(t,e,s,i,a){let n,r=this.state.records.currentBox;if(void 0!==a){let t;t=a.includes("\n")?a+"\n":"{\n"+a+"\n}",n=w(t,{schema:T})}i=(null==n?void 0:n.type)??i;const o=this.state.records.actors.get(t);if(o){if(this.state.records.currentBox&&o.box&&this.state.records.currentBox!==o.box)throw new Error(`A same participant should only be defined in one Box: ${o.name} can't be in '${o.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(r=o.box?o.box:this.state.records.currentBox,o.box=r,o&&e===o.name&&null==s)return}if(null==(null==s?void 0:s.text)&&(s={text:e,type:i}),null!=i&&null!=s.text||(s={text:e,type:i}),this.state.records.actors.set(t,{box:r,name:e,description:s.text,wrap:s.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:i??"participant"}),this.state.records.prevActor){const e=this.state.records.actors.get(this.state.records.prevActor);e&&(e.nextActor=t)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(t),this.state.records.prevActor=t}activationCount(t){let e,s=0;if(!t)return 0;for(e=0;e<this.state.records.messages.length;e++)this.state.records.messages[e].type===this.LINETYPE.ACTIVE_START&&this.state.records.messages[e].from===t&&s++,this.state.records.messages[e].type===this.LINETYPE.ACTIVE_END&&this.state.records.messages[e].from===t&&s--;return s}addMessage(t,e,s,i){this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:e,message:s.text,wrap:s.wrap??this.autoWrap(),answer:i})}addSignal(t,e,s,i,a=!1){if(i===this.LINETYPE.ACTIVE_END){if(this.activationCount(t??"")<1){const e=new Error("Trying to inactivate an inactive participant ("+t+")");throw e.hash={text:"->>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},e}}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:e,message:(null==s?void 0:s.text)??"",wrap:(null==s?void 0:s.wrap)??this.autoWrap(),type:i,activate:a}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(t=>t.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(t){return this.state.records.actors.get(t)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(t){this.state.records.wrapEnabled=t}extractWrap(t){if(void 0===t)return{};t=t.trim();const e=null!==/^:?wrap:/.exec(t)||null===/^:?nowrap:/.exec(t)&&void 0;return{cleanedText:(void 0===e?t:t.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:e}}autoWrap(){var t;return void 0!==this.state.records.wrapEnabled?this.state.records.wrapEnabled:(null==(t=l().sequence)?void 0:t.wrap)??!1}clear(){this.state.reset(),_()}parseMessage(t){const e=t.trim(),{wrap:s,cleanedText:i}=this.extractWrap(e),a={text:i,wrap:s};return d.debug(`parseMessage: ${JSON.stringify(a)}`),a}parseBoxData(t){const e=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t);let s=(null==e?void 0:e[1])?e[1].trim():"transparent",i=(null==e?void 0:e[2])?e[2].trim():void 0;if(null==window?void 0:window.CSS)window.CSS.supports("color",s)||(s="transparent",i=t.trim());else{const e=(new Option).style;e.color=s,e.color!==s&&(s="transparent",i=t.trim())}const{wrap:a,cleanedText:n}=this.extractWrap(i);return{text:n?A(n,l()):void 0,color:s,wrap:a}}addNote(t,e,s){const i={actor:t,placement:e,message:s.text,wrap:s.wrap??this.autoWrap()},a=[].concat(t,t);this.state.records.notes.push(i),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:a[0],to:a[1],message:s.text,wrap:s.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:e})}addLinks(t,e){const s=this.getActor(t);try{let t=A(e.text,l());t=t.replace(/=/g,"="),t=t.replace(/&/g,"&");const i=JSON.parse(t);this.insertLinks(s,i)}catch(i){d.error("error while parsing actor link text",i)}}addALink(t,e){const s=this.getActor(t);try{const t={};let i=A(e.text,l());const a=i.indexOf("@");i=i.replace(/=/g,"="),i=i.replace(/&/g,"&");const n=i.slice(0,a-1).trim(),r=i.slice(a+1).trim();t[n]=r,this.insertLinks(s,t)}catch(i){d.error("error while parsing actor link text",i)}}insertLinks(t,e){if(null==t.links)t.links=e;else for(const s in e)t.links[s]=e[s]}addProperties(t,e){const s=this.getActor(t);try{const t=A(e.text,l()),i=JSON.parse(t);this.insertProperties(s,i)}catch(i){d.error("error while parsing actor properties text",i)}}insertProperties(t,e){if(null==t.properties)t.properties=e;else for(const s in e)t.properties[s]=e[s]}boxEnd(){this.state.records.currentBox=void 0}addDetails(t,e){const s=this.getActor(t),i=document.getElementById(e.text);try{const t=i.innerHTML,e=JSON.parse(t);e.properties&&this.insertProperties(s,e.properties),e.links&&this.insertLinks(s,e.links)}catch(a){d.error("error while parsing actor details text",a)}}getActorProperty(t,e){if(void 0!==(null==t?void 0:t.properties))return t.properties[e]}apply(t){if(Array.isArray(t))t.forEach(t=>{this.apply(t)});else switch(t.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:t.sequenceIndex,step:t.sequenceIndexStep,visible:t.sequenceVisible},wrap:!1,type:t.signalType});break;case"addParticipant":this.addActor(t.actor,t.actor,t.description,t.draw,t.config);break;case"createParticipant":if(this.state.records.actors.has(t.actor))throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");this.state.records.lastCreated=t.actor,this.addActor(t.actor,t.actor,t.description,t.draw,t.config),this.state.records.createdActors.set(t.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=t.actor,this.state.records.destroyedActors.set(t.actor,this.state.records.messages.length);break;case"activeStart":case"activeEnd":this.addSignal(t.actor,void 0,void 0,t.signalType);break;case"addNote":this.addNote(t.actor,t.placement,t.text);break;case"addLinks":this.addLinks(t.actor,t.text);break;case"addALink":this.addALink(t.actor,t.text);break;case"addProperties":this.addProperties(t.actor,t.text);break;case"addDetails":this.addDetails(t.actor,t.text);break;case"addMessage":if(this.state.records.lastCreated){if(t.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(t.to!==this.state.records.lastDestroyed&&t.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(t.from,t.to,t.msg,t.signalType,t.activate);break;case"boxStart":this.addBox(t.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":case"rectEnd":case"optEnd":case"altEnd":case"parEnd":case"criticalEnd":case"breakEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"rectStart":this.addSignal(void 0,void 0,t.color,t.signalType);break;case"optStart":this.addSignal(void 0,void 0,t.optText,t.signalType);break;case"altStart":case"else":this.addSignal(void 0,void 0,t.altText,t.signalType);break;case"setAccTitle":b(t.text);break;case"parStart":case"and":this.addSignal(void 0,void 0,t.parText,t.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,t.criticalText,t.signalType);break;case"option":this.addSignal(void 0,void 0,t.optionText,t.signalType);break;case"breakStart":this.addSignal(void 0,void 0,t.breakText,t.signalType)}}getConfig(){return l().sequence}},"SequenceDB"),t),H=o(t=>`.actor {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n }\n\n text.actor > tspan {\n fill: ${t.actorTextColor};\n stroke: none;\n }\n\n .actor-line {\n stroke: ${t.actorLineColor};\n }\n \n .innerArc {\n stroke-width: 1.5;\n stroke-dasharray: none;\n }\n\n .messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: none;\n stroke: ${t.signalColor};\n }\n\n .messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: 2, 2;\n stroke: ${t.signalColor};\n }\n\n #arrowhead path {\n fill: ${t.signalColor};\n stroke: ${t.signalColor};\n }\n\n .sequenceNumber {\n fill: ${t.sequenceNumberColor};\n }\n\n #sequencenumber {\n fill: ${t.signalColor};\n }\n\n #crosshead path {\n fill: ${t.signalColor};\n stroke: ${t.signalColor};\n }\n\n .messageText {\n fill: ${t.signalTextColor};\n stroke: none;\n }\n\n .labelBox {\n stroke: ${t.labelBoxBorderColor};\n fill: ${t.labelBoxBkgColor};\n }\n\n .labelText, .labelText > tspan {\n fill: ${t.labelTextColor};\n stroke: none;\n }\n\n .loopText, .loopText > tspan {\n fill: ${t.loopTextColor};\n stroke: none;\n }\n\n .loopLine {\n stroke-width: 2px;\n stroke-dasharray: 2, 2;\n stroke: ${t.labelBoxBorderColor};\n fill: ${t.labelBoxBorderColor};\n }\n\n .note {\n //stroke: #decc93;\n stroke: ${t.noteBorderColor};\n fill: ${t.noteBkgColor};\n }\n\n .noteText, .noteText > tspan {\n fill: ${t.noteTextColor};\n stroke: none;\n }\n\n .activation0 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .activation1 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .activation2 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .actorPopupMenu {\n position: absolute;\n }\n\n .actorPopupMenuPanel {\n position: absolute;\n fill: ${t.actorBkg};\n box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);\n filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));\n}\n .actor-man line {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n }\n .actor-man circle, line {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n stroke-width: 2px;\n }\n\n`,"getStyles"),G="actor-top",U="actor-bottom",K="actor-box",X="actor-man",Y=o(function(t,e){return a(t,e)},"drawRect"),Z=o(function(t,e,s,i,a){if(void 0===e.links||null===e.links||0===Object.keys(e.links).length)return{height:0,width:0};const n=e.links,r=e.actorCnt,o=e.rectData;var c="none";a&&(c="block !important");const l=t.append("g");l.attr("id","actor"+r+"_popup"),l.attr("class","actorPopupMenu"),l.attr("display",c);var h="";void 0!==o.class&&(h=" "+o.class);let d=o.width>s?o.width:s;const p=l.append("rect");if(p.attr("class","actorPopupMenuPanel"+h),p.attr("x",o.x),p.attr("y",o.height),p.attr("fill",o.fill),p.attr("stroke",o.stroke),p.attr("width",d),p.attr("height",o.height),p.attr("rx",o.rx),p.attr("ry",o.ry),null!=n){var f=20;for(let t in n){var y=l.append("a"),b=u.sanitizeUrl(n[t]);y.attr("xlink:href",b),y.attr("target","_blank"),Ot(i)(t,y,o.x+10,o.height+f,d,20,{class:"actor"},i),f+=30}}return p.attr("height",f),{height:o.height+f,width:d}},"drawPopup"),J=o(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),Q=o(async function(t,e,s=null){let i=t.append("foreignObject");const a=await N(e.text,D()),n=i.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(a).node().getBoundingClientRect();if(i.attr("height",Math.round(n.height)).attr("width",Math.round(n.width)),"noteText"===e.class){const s=t.node().firstChild;s.setAttribute("height",n.height+2*e.textMargin);const a=s.getBBox();i.attr("x",Math.round(a.x+a.width/2-n.width/2)).attr("y",Math.round(a.y+a.height/2-n.height/2))}else if(s){let{startx:t,stopx:a,starty:r}=s;if(t>a){const e=t;t=a,a=e}i.attr("x",Math.round(t+Math.abs(t-a)/2-n.width/2)),"loopText"===e.class?i.attr("y",Math.round(r)):i.attr("y",Math.round(r-n.height))}return[i]},"drawKatex"),tt=o(function(t,e){let s=0,i=0;const a=e.text.split(y.lineBreakRegex),[n,r]=E(e.fontSize);let c=[],l=0,h=o(()=>e.y,"yfunc");if(void 0!==e.valign&&void 0!==e.textMargin&&e.textMargin>0)switch(e.valign){case"top":case"start":h=o(()=>Math.round(e.y+e.textMargin),"yfunc");break;case"middle":case"center":h=o(()=>Math.round(e.y+(s+i+e.textMargin)/2),"yfunc");break;case"bottom":case"end":h=o(()=>Math.round(e.y+(s+i+2*e.textMargin)-e.textMargin),"yfunc")}if(void 0!==e.anchor&&void 0!==e.textMargin&&void 0!==e.width)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="middle",e.alignmentBaseline="middle"}for(let[o,d]of a.entries()){void 0!==e.textMargin&&0===e.textMargin&&void 0!==n&&(l=o*n);const a=t.append("text");a.attr("x",e.x),a.attr("y",h()),void 0!==e.anchor&&a.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),void 0!==e.fontFamily&&a.style("font-family",e.fontFamily),void 0!==r&&a.style("font-size",r),void 0!==e.fontWeight&&a.style("font-weight",e.fontWeight),void 0!==e.fill&&a.attr("fill",e.fill),void 0!==e.class&&a.attr("class",e.class),void 0!==e.dy?a.attr("dy",e.dy):0!==l&&a.attr("dy",l);const u=d||L;if(e.tspan){const t=a.append("tspan");t.attr("x",e.x),void 0!==e.fill&&t.attr("fill",e.fill),t.text(u)}else a.text(u);void 0!==e.valign&&void 0!==e.textMargin&&e.textMargin>0&&(i+=(a._groups||a)[0][0].getBBox().height,s=i),c.push(a)}return c},"drawText"),et=o(function(t,e){function s(t,e,s,i,a){return t+","+e+" "+(t+s)+","+e+" "+(t+s)+","+(e+i-a)+" "+(t+s-1.2*a)+","+(e+i)+" "+t+","+(e+i)}o(s,"genPoints");const i=t.append("polygon");return i.attr("points",s(e.x,e.y,e.width,e.height,7)),i.attr("class","labelBox"),e.y=e.y+e.height/2,tt(t,e),i},"drawLabel"),st=-1,it=o((t,e,s,i)=>{t.select&&s.forEach(s=>{const a=e.get(s),n=t.select("#actor"+a.actorCnt);!i.mirrorActors&&a.stopy?n.attr("y2",a.stopy+a.height/2):i.mirrorActors&&n.attr("y2",a.stopy)})},"fixLifeLineHeights"),at=o(function(t,e,s,a){var o,c;const l=a?e.stopy:e.starty,h=e.x+e.width/2,d=l+e.height,u=t.append("g").lower();var p=u;a||(st++,Object.keys(e.links||{}).length&&!s.forceMenus&&p.attr("onclick",J(`actor${st}_popup`)).attr("cursor","pointer"),p.append("line").attr("id","actor"+st).attr("x1",h).attr("y1",d).attr("x2",h).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),p=u.append("g"),e.actorCnt=st,null!=e.links&&p.attr("id","root-"+st));const f=i();var y="actor";(null==(o=e.properties)?void 0:o.class)?y=e.properties.class:f.fill="#eaeaea",y+=a?` ${U}`:` ${G}`,f.x=e.x,f.y=l,f.width=e.width,f.height=e.height,f.class=y,f.rx=3,f.ry=3,f.name=e.name;const b=Y(p,f);if(e.rectData=f,null==(c=e.properties)?void 0:c.icon){const t=e.properties.icon.trim();"@"===t.charAt(0)?n(p,f.x+f.width-20,f.y+10,t.substr(1)):r(p,f.x+f.width-20,f.y+10,t)}It(s,I(e.description))(e.description,p,f.x,f.y,f.width,f.height,{class:`actor ${K}`},s);let x=e.height;if(b.node){const t=b.node().getBBox();e.height=t.height,x=t.height}return x},"drawActorTypeParticipant"),nt=o(function(t,e,s,a){var o,c;const l=a?e.stopy:e.starty,h=e.x+e.width/2,d=l+e.height,u=t.append("g").lower();var p=u;a||(st++,Object.keys(e.links||{}).length&&!s.forceMenus&&p.attr("onclick",J(`actor${st}_popup`)).attr("cursor","pointer"),p.append("line").attr("id","actor"+st).attr("x1",h).attr("y1",d).attr("x2",h).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),p=u.append("g"),e.actorCnt=st,null!=e.links&&p.attr("id","root-"+st));const f=i();var y="actor";(null==(o=e.properties)?void 0:o.class)?y=e.properties.class:f.fill="#eaeaea",y+=a?` ${U}`:` ${G}`,f.x=e.x,f.y=l,f.width=e.width,f.height=e.height,f.class=y,f.name=e.name;const b={...f,x:f.x+-6,y:f.y+6,class:"actor"},x=Y(p,f);if(Y(p,b),e.rectData=f,null==(c=e.properties)?void 0:c.icon){const t=e.properties.icon.trim();"@"===t.charAt(0)?n(p,f.x+f.width-20,f.y+10,t.substr(1)):r(p,f.x+f.width-20,f.y+10,t)}It(s,I(e.description))(e.description,p,f.x-6,f.y+6,f.width,f.height,{class:`actor ${K}`},s);let v=e.height;if(x.node){const t=x.node().getBBox();e.height=t.height,v=t.height}return v},"drawActorTypeCollections"),rt=o(function(t,e,s,a){var o,c;const l=a?e.stopy:e.starty,h=e.x+e.width/2,d=l+e.height,u=t.append("g").lower();let p=u;a||(st++,Object.keys(e.links||{}).length&&!s.forceMenus&&p.attr("onclick",J(`actor${st}_popup`)).attr("cursor","pointer"),p.append("line").attr("id","actor"+st).attr("x1",h).attr("y1",d).attr("x2",h).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),p=u.append("g"),e.actorCnt=st,null!=e.links&&p.attr("id","root-"+st));const f=i();let y="actor";(null==(o=e.properties)?void 0:o.class)?y=e.properties.class:f.fill="#eaeaea",y+=a?` ${U}`:` ${G}`,f.x=e.x,f.y=l,f.width=e.width,f.height=e.height,f.class=y,f.name=e.name;const b=f.height/2,x=b/(2.5+f.height/50),v=p.append("g"),m=p.append("g");if(v.append("path").attr("d",`M ${f.x},${f.y+b}\n a ${x},${b} 0 0 0 0,${f.height}\n h ${f.width-2*x}\n a ${x},${b} 0 0 0 0,-${f.height}\n Z\n `).attr("class",y),m.append("path").attr("d",`M ${f.x},${f.y+b}\n a ${x},${b} 0 0 0 0,${f.height}`).attr("stroke","#666").attr("stroke-width","1px").attr("class",y),v.attr("transform",`translate(${x}, ${-f.height/2})`),m.attr("transform",`translate(${f.width-x}, ${-f.height/2})`),e.rectData=f,null==(c=e.properties)?void 0:c.icon){const t=e.properties.icon.trim(),s=f.x+f.width-20,i=f.y+10;"@"===t.charAt(0)?n(p,s,i,t.substr(1)):r(p,s,i,t)}It(s,I(e.description))(e.description,p,f.x,f.y,f.width,f.height,{class:`actor ${K}`},s);let k=e.height;const g=v.select("path:last-child");if(g.node()){const t=g.node().getBBox();e.height=t.height,k=t.height}return k},"drawActorTypeQueue"),ot=o(function(t,e,s,a){var n;const r=a?e.stopy:e.starty,o=e.x+e.width/2,c=r+75,l=t.append("g").lower();a||(st++,l.append("line").attr("id","actor"+st).attr("x1",o).attr("y1",c).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),e.actorCnt=st);const h=t.append("g");let d=X;d+=a?` ${U}`:` ${G}`,h.attr("class",d),h.attr("name",e.name);const u=i();u.x=e.x,u.y=r,u.fill="#eaeaea",u.width=e.width,u.height=e.height,u.class="actor";const p=e.x+e.width/2,f=r+30;h.append("defs").append("marker").attr("id","filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),h.append("circle").attr("cx",p).attr("cy",f).attr("r",18).attr("fill","#eaeaf7").attr("stroke","#666").attr("stroke-width",1.2),h.append("line").attr("marker-end","url(#filled-head-control)").attr("transform",`translate(${p}, ${f-18})`);const y=h.node().getBBox();return e.height=y.height+2*((null==(n=null==s?void 0:s.sequence)?void 0:n.labelBoxHeight)??0),It(s,I(e.description))(e.description,h,u.x,u.y+18+(a?5:10),u.width,u.height,{class:`actor ${X}`},s),e.height},"drawActorTypeControl"),ct=o(function(t,e,s,a){var n;const r=a?e.stopy:e.starty,o=e.x+e.width/2,c=r+75,l=t.append("g").lower(),h=t.append("g");let d=X;d+=a?` ${U}`:` ${G}`,h.attr("class",d),h.attr("name",e.name);const u=i();u.x=e.x,u.y=r,u.fill="#eaeaea",u.width=e.width,u.height=e.height,u.class="actor";const p=e.x+e.width/2,f=r+(a?10:25),y=18;h.append("circle").attr("cx",p).attr("cy",f).attr("r",y).attr("width",e.width).attr("height",e.height),h.append("line").attr("x1",p-y).attr("x2",p+y).attr("y1",f+y).attr("y2",f+y).attr("stroke","#333").attr("stroke-width",2);const b=h.node().getBBox();return e.height=b.height+((null==(n=null==s?void 0:s.sequence)?void 0:n.labelBoxHeight)??0),a||(st++,l.append("line").attr("id","actor"+st).attr("x1",o).attr("y1",c).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),e.actorCnt=st),It(s,I(e.description))(e.description,h,u.x,u.y+(a?(f-r+y-5)/2:(f+y-r)/2),u.width,u.height,{class:`actor ${X}`},s),h.attr("transform","translate(0, 9)"),e.height},"drawActorTypeEntity"),lt=o(function(t,e,s,a){var n;const r=a?e.stopy:e.starty,o=e.x+e.width/2,c=r+e.height+2*s.boxTextMargin,l=t.append("g").lower();let h=l;a||(st++,Object.keys(e.links||{}).length&&!s.forceMenus&&h.attr("onclick",J(`actor${st}_popup`)).attr("cursor","pointer"),h.append("line").attr("id","actor"+st).attr("x1",o).attr("y1",c).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),h=l.append("g"),e.actorCnt=st,null!=e.links&&h.attr("id","root-"+st));const d=i();let u="actor";(null==(n=e.properties)?void 0:n.class)?u=e.properties.class:d.fill="#eaeaea",u+=a?` ${U}`:` ${G}`,d.x=e.x,d.y=r,d.width=e.width,d.height=e.height,d.class=u,d.name=e.name,d.x=e.x,d.y=r;const p=d.width/4,f=d.width/4,y=p/2,b=y/(2.5+p/50),x=h.append("g"),v=`\n M ${d.x},${d.y+b}\n a ${y},${b} 0 0 0 ${p},0\n a ${y},${b} 0 0 0 -${p},0\n l 0,${f-2*b}\n a ${y},${b} 0 0 0 ${p},0\n l 0,-${f-2*b}\n`;x.append("path").attr("d",v).attr("fill","#eaeaea").attr("stroke","#000").attr("stroke-width",1).attr("class",u),a?x.attr("transform",`translate(${1.5*p}, ${d.height/4-2*b})`):x.attr("transform",`translate(${1.5*p}, ${(d.height+b)/4})`),e.rectData=d,It(s,I(e.description))(e.description,h,d.x,d.y+(a?(d.height+f)/4:(d.height+b)/2),d.width,d.height,{class:`actor ${K}`},s);const m=x.select("path:last-child");if(m.node()){const t=m.node().getBBox();e.height=t.height+(s.sequence.labelBoxHeight??0)}return e.height},"drawActorTypeDatabase"),ht=o(function(t,e,s,a){const n=a?e.stopy:e.starty,r=e.x+e.width/2,o=n+80,c=30,l=t.append("g").lower();a||(st++,l.append("line").attr("id","actor"+st).attr("x1",r).attr("y1",o).attr("x2",r).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),e.actorCnt=st);const h=t.append("g");let d=X;d+=a?` ${U}`:` ${G}`,h.attr("class",d),h.attr("name",e.name);const u=i();u.x=e.x,u.y=n,u.fill="#eaeaea",u.width=e.width,u.height=e.height,u.class="actor",h.append("line").attr("id","actor-man-torso"+st).attr("x1",e.x+e.width/2-75).attr("y1",n+10).attr("x2",e.x+e.width/2-15).attr("y2",n+10),h.append("line").attr("id","actor-man-arms"+st).attr("x1",e.x+e.width/2-75).attr("y1",n+0).attr("x2",e.x+e.width/2-75).attr("y2",n+20),h.append("circle").attr("cx",e.x+e.width/2).attr("cy",n+10).attr("r",c);const p=h.node().getBBox();return e.height=p.height+(s.sequence.labelBoxHeight??0),It(s,I(e.description))(e.description,h,u.x,u.y+(a?11:18),u.width,u.height,{class:`actor ${X}`},s),h.attr("transform","translate(0,22)"),e.height},"drawActorTypeBoundary"),dt=o(function(t,e,s,a){const n=a?e.stopy:e.starty,r=e.x+e.width/2,o=n+80,c=t.append("g").lower();a||(st++,c.append("line").attr("id","actor"+st).attr("x1",r).attr("y1",o).attr("x2",r).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),e.actorCnt=st);const l=t.append("g");let h=X;h+=a?` ${U}`:` ${G}`,l.attr("class",h),l.attr("name",e.name);const d=i();d.x=e.x,d.y=n,d.fill="#eaeaea",d.width=e.width,d.height=e.height,d.class="actor",d.rx=3,d.ry=3,l.append("line").attr("id","actor-man-torso"+st).attr("x1",r).attr("y1",n+25).attr("x2",r).attr("y2",n+45),l.append("line").attr("id","actor-man-arms"+st).attr("x1",r-18).attr("y1",n+33).attr("x2",r+18).attr("y2",n+33),l.append("line").attr("x1",r-18).attr("y1",n+60).attr("x2",r).attr("y2",n+45),l.append("line").attr("x1",r).attr("y1",n+45).attr("x2",r+18-2).attr("y2",n+60);const u=l.append("circle");u.attr("cx",e.x+e.width/2),u.attr("cy",n+10),u.attr("r",15),u.attr("width",e.width),u.attr("height",e.height);const p=l.node().getBBox();return e.height=p.height,It(s,I(e.description))(e.description,l,d.x,d.y+35,d.width,d.height,{class:`actor ${X}`},s),e.height},"drawActorTypeActor"),ut=o(async function(t,e,s,i){switch(e.type){case"actor":return await dt(t,e,s,i);case"participant":return await at(t,e,s,i);case"boundary":return await ht(t,e,s,i);case"control":return await ot(t,e,s,i);case"entity":return await ct(t,e,s,i);case"database":return await lt(t,e,s,i);case"collections":return await nt(t,e,s,i);case"queue":return await rt(t,e,s,i)}},"drawActor"),pt=o(function(t,e,s){const i=t.append("g");xt(i,e),e.name&&It(s)(e.name,i,e.x,e.y+s.boxTextMargin+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},s),i.lower()},"drawBox"),ft=o(function(t){return t.append("g")},"anchorElement"),yt=o(function(t,e,s,a,n){const r=i(),o=e.anchored;r.x=e.startx,r.y=e.starty,r.class="activation"+n%3,r.width=e.stopx-e.startx,r.height=s-e.starty,Y(o,r)},"drawActivation"),bt=o(async function(t,e,i,a){const{boxMargin:n,boxTextMargin:r,labelBoxHeight:c,labelBoxWidth:l,messageFontFamily:h,messageFontSize:d,messageFontWeight:u}=a,p=t.append("g"),f=o(function(t,e,s,i){return p.append("line").attr("x1",t).attr("y1",e).attr("x2",s).attr("y2",i).attr("class","loopLine")},"drawLoopLine");f(e.startx,e.starty,e.stopx,e.starty),f(e.stopx,e.starty,e.stopx,e.stopy),f(e.startx,e.stopy,e.stopx,e.stopy),f(e.startx,e.starty,e.startx,e.stopy),void 0!==e.sections&&e.sections.forEach(function(t){f(e.startx,t.y,e.stopx,t.y).style("stroke-dasharray","3, 3")});let y=s();y.text=i,y.x=e.startx,y.y=e.starty,y.fontFamily=h,y.fontSize=d,y.fontWeight=u,y.anchor="middle",y.valign="middle",y.tspan=!1,y.width=l||50,y.height=c||20,y.textMargin=r,y.class="labelText",et(p,y),y=At(),y.text=e.title,y.x=e.startx+l/2+(e.stopx-e.startx)/2,y.y=e.starty+n+r,y.anchor="middle",y.valign="middle",y.textMargin=r,y.class="loopText",y.fontFamily=h,y.fontSize=d,y.fontWeight=u,y.wrap=!0;let b=I(y.text)?await Q(p,y,e):tt(p,y);if(void 0!==e.sectionTitles)for(const[s,o]of Object.entries(e.sectionTitles))if(o.message){y.text=o.message,y.x=e.startx+(e.stopx-e.startx)/2,y.y=e.sections[s].y+n+r,y.class="loopText",y.anchor="middle",y.valign="middle",y.tspan=!1,y.fontFamily=h,y.fontSize=d,y.fontWeight=u,y.wrap=e.wrap,I(y.text)?(e.starty=e.sections[s].y,await Q(p,y,e)):tt(p,y);let t=Math.round(b.map(t=>(t._groups||t)[0][0].getBBox().height).reduce((t,e)=>t+e));e.sections[s].height+=t-(n+r)}return e.height=Math.round(e.stopy-e.starty),p},"drawLoop"),xt=o(function(t,s){e(t,s)},"drawBackgroundRect"),vt=o(function(t){t.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),mt=o(function(t){t.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),kt=o(function(t){t.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),gt=o(function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),wt=o(function(t){t.append("defs").append("marker").attr("id","filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),Tt=o(function(t){t.append("defs").append("marker").attr("id","sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber"),_t=o(function(t){t.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),At=o(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},"getTextObj"),$t=o(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),It=function(){function t(t,e,s,i,n,r,o){a(e.append("text").attr("x",s+n/2).attr("y",i+r/2+5).style("text-anchor","middle").text(t),o)}function e(t,e,s,i,n,r,o,c){const{actorFontSize:l,actorFontFamily:h,actorFontWeight:d}=c,[u,p]=E(l),f=t.split(y.lineBreakRegex);for(let y=0;y<f.length;y++){const t=y*u-u*(f.length-1)/2,c=e.append("text").attr("x",s+n/2).attr("y",i).style("text-anchor","middle").style("font-size",p).style("font-weight",d).style("font-family",h);c.append("tspan").attr("x",s+n/2).attr("dy",t).text(f[y]),c.attr("y",i+r/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),a(c,o)}}function s(t,s,i,n,r,o,c,l){const h=s.append("switch"),d=h.append("foreignObject").attr("x",i).attr("y",n).attr("width",r).attr("height",o).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");d.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,h,i,n,r,o,c,l),a(d,c)}async function i(t,s,i,n,r,o,c,l){const h=await O(t,D()),d=s.append("switch"),u=d.append("foreignObject").attr("x",i+r/2-h.width/2).attr("y",n+o/2-h.height/2).attr("width",h.width).attr("height",h.height).append("xhtml:div").style("height","100%").style("width","100%");u.append("div").style("text-align","center").style("vertical-align","middle").html(await N(t,D())),e(t,d,i,n,r,o,c,l),a(u,c)}function a(t,e){for(const s in e)e.hasOwnProperty(s)&&t.attr(s,e[s])}return o(t,"byText"),o(e,"byTspan"),o(s,"byFo"),o(i,"byKatex"),o(a,"_setTextAttrs"),function(a,n=!1){return n?i:"fo"===a.textPlacement?s:"old"===a.textPlacement?t:e}}(),Ot=function(){function t(t,e,s,a,n,r,o){i(e.append("text").attr("x",s).attr("y",a).style("text-anchor","start").text(t),o)}function e(t,e,s,a,n,r,o,c){const{actorFontSize:l,actorFontFamily:h,actorFontWeight:d}=c,u=t.split(y.lineBreakRegex);for(let p=0;p<u.length;p++){const t=p*l-l*(u.length-1)/2,n=e.append("text").attr("x",s).attr("y",a).style("text-anchor","start").style("font-size",l).style("font-weight",d).style("font-family",h);n.append("tspan").attr("x",s).attr("dy",t).text(u[p]),n.attr("y",a+r/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(n,o)}}function s(t,s,a,n,r,o,c,l){const h=s.append("switch"),d=h.append("foreignObject").attr("x",a).attr("y",n).attr("width",r).attr("height",o).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");d.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,h,a,n,0,o,c,l),i(d,c)}function i(t,e){for(const s in e)e.hasOwnProperty(s)&&t.attr(s,e[s])}return o(t,"byText"),o(e,"byTspan"),o(s,"byFo"),o(i,"_setTextAttrs"),function(i){return"fo"===i.textPlacement?s:"old"===i.textPlacement?t:e}}(),Et={drawRect:Y,drawText:tt,drawLabel:et,drawActor:ut,drawBox:pt,drawPopup:Z,anchorElement:ft,drawActivation:yt,drawLoop:bt,drawBackgroundRect:xt,insertArrowHead:gt,insertArrowFilledHead:wt,insertSequenceNumber:Tt,insertArrowCrossHead:_t,insertDatabaseIcon:vt,insertComputerIcon:mt,insertClockIcon:kt,getTextObj:At,getNoteRect:$t,fixLifeLineHeights:it,sanitizeUrl:u.sanitizeUrl},Lt={},St={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:o(function(){return Math.max.apply(null,0===this.actors.length?[0]:this.actors.map(t=>t.height||0))+(0===this.loops.length?0:this.loops.map(t=>t.height||0).reduce((t,e)=>t+e))+(0===this.messages.length?0:this.messages.map(t=>t.height||0).reduce((t,e)=>t+e))+(0===this.notes.length?0:this.notes.map(t=>t.height||0).reduce((t,e)=>t+e))},"getHeight"),clear:o(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:o(function(t){this.boxes.push(t)},"addBox"),addActor:o(function(t){this.actors.push(t)},"addActor"),addLoop:o(function(t){this.loops.push(t)},"addLoop"),addMessage:o(function(t){this.messages.push(t)},"addMessage"),addNote:o(function(t){this.notes.push(t)},"addNote"),lastActor:o(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:o(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:o(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:o(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:o(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,Wt(l())},"init"),updateVal:o(function(t,e,s,i){void 0===t[e]?t[e]=s:t[e]=i(s,t[e])},"updateVal"),updateBounds:o(function(t,e,s,i){const a=this;let n=0;function r(r){return o(function(o){n++;const c=a.sequenceItems.length-n+1;a.updateVal(o,"starty",e-c*Lt.boxMargin,Math.min),a.updateVal(o,"stopy",i+c*Lt.boxMargin,Math.max),a.updateVal(St.data,"startx",t-c*Lt.boxMargin,Math.min),a.updateVal(St.data,"stopx",s+c*Lt.boxMargin,Math.max),"activation"!==r&&(a.updateVal(o,"startx",t-c*Lt.boxMargin,Math.min),a.updateVal(o,"stopx",s+c*Lt.boxMargin,Math.max),a.updateVal(St.data,"starty",e-c*Lt.boxMargin,Math.min),a.updateVal(St.data,"stopy",i+c*Lt.boxMargin,Math.max))},"updateItemBounds")}o(r,"updateFn"),this.sequenceItems.forEach(r()),this.activations.forEach(r("activation"))},"updateBounds"),insert:o(function(t,e,s,i){const a=y.getMin(t,s),n=y.getMax(t,s),r=y.getMin(e,i),o=y.getMax(e,i);this.updateVal(St.data,"startx",a,Math.min),this.updateVal(St.data,"starty",r,Math.min),this.updateVal(St.data,"stopx",n,Math.max),this.updateVal(St.data,"stopy",o,Math.max),this.updateBounds(a,r,n,o)},"insert"),newActivation:o(function(t,e,s){const i=s.get(t.from),a=jt(t.from).length||0,n=i.x+i.width/2+(a-1)*Lt.activationWidth/2;this.activations.push({startx:n,starty:this.verticalPos+2,stopx:n+Lt.activationWidth,stopy:void 0,actor:t.from,anchored:Et.anchorElement(e)})},"newActivation"),endActivation:o(function(t){const e=this.activations.map(function(t){return t.actor}).lastIndexOf(t.from);return this.activations.splice(e,1)[0]},"endActivation"),createLoop:o(function(t={message:void 0,wrap:!1,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}},"createLoop"),newLoop:o(function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},"newLoop"),endLoop:o(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:o(function(){return!!this.sequenceItems.length&&this.sequenceItems[this.sequenceItems.length-1].overlap},"isLoopOverlap"),addSectionToLoop:o(function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:St.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},"addSectionToLoop"),saveVerticalPos:o(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:o(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:o(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=y.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:o(function(){return this.verticalPos},"getVerticalPos"),getBounds:o(function(){return{bounds:this.data,models:this.models}},"getBounds")},Nt=o(async function(t,e){St.bumpVerticalPos(Lt.boxMargin),e.height=Lt.boxMargin,e.starty=St.getVerticalPos();const a=i();a.x=e.startx,a.y=e.starty,a.width=e.width||Lt.width,a.class="note";const n=t.append("g"),r=Et.drawRect(n,a),o=s();o.x=e.startx,o.y=e.starty,o.width=a.width,o.dy="1em",o.text=e.message,o.class="noteText",o.fontFamily=Lt.noteFontFamily,o.fontSize=Lt.noteFontSize,o.fontWeight=Lt.noteFontWeight,o.anchor=Lt.noteAlign,o.textMargin=Lt.noteMargin,o.valign="center";const c=I(o.text)?await Q(n,o):tt(n,o),l=Math.round(c.map(t=>(t._groups||t)[0][0].getBBox().height).reduce((t,e)=>t+e));r.attr("height",l+2*Lt.noteMargin),e.height+=l+2*Lt.noteMargin,St.bumpVerticalPos(l+2*Lt.noteMargin),e.stopy=e.starty+l+2*Lt.noteMargin,e.stopx=e.startx+a.width,St.insert(e.startx,e.starty,e.stopx,e.stopy),St.models.addNote(e)},"drawNote"),Dt=o(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),Mt=o(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),Pt=o(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont");async function Rt(t,e){St.bumpVerticalPos(10);const{startx:s,stopx:i,message:a}=e,n=y.splitBreaks(a).length,r=I(a),o=r?await O(a,l()):$.calculateTextDimensions(a,Dt(Lt));if(!r){const t=o.height/n;e.height+=t,St.bumpVerticalPos(t)}let c,h=o.height-10;const d=o.width;if(s===i){c=St.getVerticalPos()+h,Lt.rightAngles||(h+=Lt.boxMargin,c=St.getVerticalPos()+h),h+=30;const t=y.getMax(d/2,Lt.width/2);St.insert(s-t,St.getVerticalPos()-10+h,i+t,St.getVerticalPos()+30+h)}else h+=Lt.boxMargin,c=St.getVerticalPos()+h,St.insert(s,c-10,i,c);return St.bumpVerticalPos(h),e.height+=h,e.stopy=e.starty+e.height,St.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),c}o(Rt,"boundMessage");var Ct=o(async function(t,e,i,a){const{startx:n,stopx:r,starty:o,message:c,type:l,sequenceIndex:h,sequenceVisible:d}=e,u=$.calculateTextDimensions(c,Dt(Lt)),p=s();p.x=n,p.y=o+10,p.width=r-n,p.class="messageText",p.dy="1em",p.text=c,p.fontFamily=Lt.messageFontFamily,p.fontSize=Lt.messageFontSize,p.fontWeight=Lt.messageFontWeight,p.anchor=Lt.messageAlign,p.valign="center",p.textMargin=Lt.wrapPadding,p.tspan=!1,I(p.text)?await Q(t,p,{startx:n,stopx:r,starty:i}):tt(t,p);const f=u.width;let b;n===r?b=Lt.rightAngles?t.append("path").attr("d",`M ${n},${i} H ${n+y.getMax(Lt.width/2,f/2)} V ${i+25} H ${n}`):t.append("path").attr("d","M "+n+","+i+" C "+(n+60)+","+(i-10)+" "+(n+60)+","+(i+30)+" "+n+","+(i+20)):(b=t.append("line"),b.attr("x1",n),b.attr("y1",i),b.attr("x2",r),b.attr("y2",i)),l===a.db.LINETYPE.DOTTED||l===a.db.LINETYPE.DOTTED_CROSS||l===a.db.LINETYPE.DOTTED_POINT||l===a.db.LINETYPE.DOTTED_OPEN||l===a.db.LINETYPE.BIDIRECTIONAL_DOTTED?(b.style("stroke-dasharray","3, 3"),b.attr("class","messageLine1")):b.attr("class","messageLine0");let x="";if(Lt.arrowMarkerAbsolute&&(x=S(!0)),b.attr("stroke-width",2),b.attr("stroke","none"),b.style("fill","none"),l!==a.db.LINETYPE.SOLID&&l!==a.db.LINETYPE.DOTTED||b.attr("marker-end","url("+x+"#arrowhead)"),l!==a.db.LINETYPE.BIDIRECTIONAL_SOLID&&l!==a.db.LINETYPE.BIDIRECTIONAL_DOTTED||(b.attr("marker-start","url("+x+"#arrowhead)"),b.attr("marker-end","url("+x+"#arrowhead)")),l!==a.db.LINETYPE.SOLID_POINT&&l!==a.db.LINETYPE.DOTTED_POINT||b.attr("marker-end","url("+x+"#filled-head)"),l!==a.db.LINETYPE.SOLID_CROSS&&l!==a.db.LINETYPE.DOTTED_CROSS||b.attr("marker-end","url("+x+"#crosshead)"),d||Lt.showSequenceNumbers){if(l===a.db.LINETYPE.BIDIRECTIONAL_SOLID||l===a.db.LINETYPE.BIDIRECTIONAL_DOTTED){const t=6;n<r?b.attr("x1",n+2*t):b.attr("x1",n+t)}t.append("line").attr("x1",n).attr("y1",i).attr("x2",n).attr("y2",i).attr("stroke-width",0).attr("marker-start","url("+x+"#sequencenumber)"),t.append("text").attr("x",n).attr("y",i+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(h)}},"drawMessage"),Bt=o(function(t,e,s,i,a,n,r){let o,c=0,l=0,h=0;for(const d of i){const t=e.get(d),i=t.box;o&&o!=i&&(r||St.models.addBox(o),l+=Lt.boxMargin+o.margin),i&&i!=o&&(r||(i.x=c+l,i.y=a),l+=i.margin),t.width=t.width||Lt.width,t.height=y.getMax(t.height||Lt.height,Lt.height),t.margin=t.margin||Lt.actorMargin,h=y.getMax(h,t.height),s.get(t.name)&&(l+=t.width/2),t.x=c+l,t.starty=St.getVerticalPos(),St.insert(t.x,a,t.x+t.width,t.height),c+=t.width+l,t.box&&(t.box.width=c+i.margin-t.box.x),l=t.margin,o=t.box,St.models.addActor(t)}o&&!r&&St.models.addBox(o),St.bumpVerticalPos(h)},"addActorRenderingData"),Ft=o(async function(t,e,s,i){if(i){let i=0;St.bumpVerticalPos(2*Lt.boxMargin);for(const a of s){const s=e.get(a);s.stopy||(s.stopy=St.getVerticalPos());const n=await Et.drawActor(t,s,Lt,!0);i=y.getMax(i,n)}St.bumpVerticalPos(i+Lt.boxMargin)}else for(const a of s){const s=e.get(a);await Et.drawActor(t,s,Lt,!1)}},"drawActors"),qt=o(function(t,e,s,i){let a=0,n=0;for(const r of s){const s=e.get(r),o=Kt(s),c=Et.drawPopup(t,s,o,Lt,Lt.forceMenus,i);c.height>a&&(a=c.height),c.width+s.x>n&&(n=c.width+s.x)}return{maxHeight:a,maxWidth:n}},"drawActorsPopup"),Wt=o(function(t){f(Lt,t),t.fontFamily&&(Lt.actorFontFamily=Lt.noteFontFamily=Lt.messageFontFamily=t.fontFamily),t.fontSize&&(Lt.actorFontSize=Lt.noteFontSize=Lt.messageFontSize=t.fontSize),t.fontWeight&&(Lt.actorFontWeight=Lt.noteFontWeight=Lt.messageFontWeight=t.fontWeight)},"setConf"),jt=o(function(t){return St.activations.filter(function(e){return e.actor===t})},"actorActivations"),zt=o(function(t,e){const s=e.get(t),i=jt(t);return[i.reduce(function(t,e){return y.getMin(t,e.startx)},s.x+s.width/2-1),i.reduce(function(t,e){return y.getMax(t,e.stopx)},s.x+s.width/2+1)]},"activationBounds");function Vt(t,e,s,i,a){St.bumpVerticalPos(s);let n=i;if(e.id&&e.message&&t[e.id]){const s=t[e.id].width,a=Dt(Lt);e.message=$.wrapLabel(`[${e.message}]`,s-2*Lt.wrapPadding,a),e.width=s,e.wrap=!0;const r=$.calculateTextDimensions(e.message,a),o=y.getMax(r.height,Lt.labelBoxHeight);n=i+o,d.debug(`${o} - ${e.message}`)}a(e),St.bumpVerticalPos(n)}function Ht(t,e,s,i,a,n,r){function c(s,i){s.x<a.get(t.from).x?(St.insert(e.stopx-i,e.starty,e.startx,e.stopy+s.height/2+Lt.noteMargin),e.stopx=e.stopx+i):(St.insert(e.startx,e.starty,e.stopx+i,e.stopy+s.height/2+Lt.noteMargin),e.stopx=e.stopx-i)}function l(s,i){s.x<a.get(t.to).x?(St.insert(e.startx-i,e.starty,e.stopx,e.stopy+s.height/2+Lt.noteMargin),e.startx=e.startx+i):(St.insert(e.stopx,e.starty,e.startx+i,e.stopy+s.height/2+Lt.noteMargin),e.startx=e.startx-i)}o(c,"receiverAdjustment"),o(l,"senderAdjustment");const h=[q,W,z,j];if(n.get(t.to)==i){const e=a.get(t.to);c(e,h.includes(e.type)?21:e.width/2+3),e.starty=s-e.height/2,St.bumpVerticalPos(e.height/2)}else if(r.get(t.from)==i){const e=a.get(t.from);if(Lt.mirrorActors){l(e,h.includes(e.type)?18:e.width/2)}e.stopy=s-e.height/2,St.bumpVerticalPos(e.height/2)}else if(r.get(t.to)==i){const e=a.get(t.to);if(Lt.mirrorActors){c(e,h.includes(e.type)?21:e.width/2+3)}e.stopy=s-e.height/2,St.bumpVerticalPos(e.height/2)}}o(Vt,"adjustLoopHeightForWrap"),o(Ht,"adjustCreatedDestroyedData");var Gt=o(async function(t,e,s,i){const{securityLevel:a,sequence:n}=l();let r;Lt=n,"sandbox"===a&&(r=h("#i"+e));const c=h("sandbox"===a?r.nodes()[0].contentDocument.body:"body"),u="sandbox"===a?r.nodes()[0].contentDocument:document;St.init(),d.debug(i.db);const f="sandbox"===a?c.select(`[id="${e}"]`):h(`[id="${e}"]`),y=i.db.getActors(),b=i.db.getCreatedActors(),x=i.db.getDestroyedActors(),v=i.db.getBoxes();let m=i.db.getActorKeys();const k=i.db.getMessages(),g=i.db.getDiagramTitle(),w=i.db.hasAtLeastOneBox(),T=i.db.hasAtLeastOneBoxWithTitle(),_=await Ut(y,k,i);if(Lt.height=await Xt(y,_,v),Et.insertComputerIcon(f),Et.insertDatabaseIcon(f),Et.insertClockIcon(f),w&&(St.bumpVerticalPos(Lt.boxMargin),T&&St.bumpVerticalPos(v[0].textMaxHeight)),!0===Lt.hideUnusedParticipants){const t=new Set;k.forEach(e=>{t.add(e.from),t.add(e.to)}),m=m.filter(e=>t.has(e))}Bt(f,y,b,m,0,k,!1);const A=await Jt(k,y,_,i);function $(t,e){const s=St.endActivation(t);s.starty+18>e&&(s.starty=e-6,e+=12),Et.drawActivation(f,s,e,Lt,jt(t.from).length),St.insert(s.startx,e-10,s.stopx,e)}Et.insertArrowHead(f),Et.insertArrowCrossHead(f),Et.insertArrowFilledHead(f),Et.insertSequenceNumber(f),o($,"activeEnd");let I=1,O=1;const E=[],L=[];let S=0;for(const o of k){let t,e,s;switch(o.type){case i.db.LINETYPE.NOTE:St.resetVerticalPos(),e=o.noteModel,await Nt(f,e);break;case i.db.LINETYPE.ACTIVE_START:St.newActivation(o,f,y);break;case i.db.LINETYPE.ACTIVE_END:$(o,St.getVerticalPos());break;case i.db.LINETYPE.LOOP_START:Vt(A,o,Lt.boxMargin,Lt.boxMargin+Lt.boxTextMargin,t=>St.newLoop(t));break;case i.db.LINETYPE.LOOP_END:t=St.endLoop(),await Et.drawLoop(f,t,"loop",Lt),St.bumpVerticalPos(t.stopy-St.getVerticalPos()),St.models.addLoop(t);break;case i.db.LINETYPE.RECT_START:Vt(A,o,Lt.boxMargin,Lt.boxMargin,t=>St.newLoop(void 0,t.message));break;case i.db.LINETYPE.RECT_END:t=St.endLoop(),L.push(t),St.models.addLoop(t),St.bumpVerticalPos(t.stopy-St.getVerticalPos());break;case i.db.LINETYPE.OPT_START:Vt(A,o,Lt.boxMargin,Lt.boxMargin+Lt.boxTextMargin,t=>St.newLoop(t));break;case i.db.LINETYPE.OPT_END:t=St.endLoop(),await Et.drawLoop(f,t,"opt",Lt),St.bumpVerticalPos(t.stopy-St.getVerticalPos()),St.models.addLoop(t);break;case i.db.LINETYPE.ALT_START:Vt(A,o,Lt.boxMargin,Lt.boxMargin+Lt.boxTextMargin,t=>St.newLoop(t));break;case i.db.LINETYPE.ALT_ELSE:Vt(A,o,Lt.boxMargin+Lt.boxTextMargin,Lt.boxMargin,t=>St.addSectionToLoop(t));break;case i.db.LINETYPE.ALT_END:t=St.endLoop(),await Et.drawLoop(f,t,"alt",Lt),St.bumpVerticalPos(t.stopy-St.getVerticalPos()),St.models.addLoop(t);break;case i.db.LINETYPE.PAR_START:case i.db.LINETYPE.PAR_OVER_START:Vt(A,o,Lt.boxMargin,Lt.boxMargin+Lt.boxTextMargin,t=>St.newLoop(t)),St.saveVerticalPos();break;case i.db.LINETYPE.PAR_AND:Vt(A,o,Lt.boxMargin+Lt.boxTextMargin,Lt.boxMargin,t=>St.addSectionToLoop(t));break;case i.db.LINETYPE.PAR_END:t=St.endLoop(),await Et.drawLoop(f,t,"par",Lt),St.bumpVerticalPos(t.stopy-St.getVerticalPos()),St.models.addLoop(t);break;case i.db.LINETYPE.AUTONUMBER:I=o.message.start||I,O=o.message.step||O,o.message.visible?i.db.enableSequenceNumbers():i.db.disableSequenceNumbers();break;case i.db.LINETYPE.CRITICAL_START:Vt(A,o,Lt.boxMargin,Lt.boxMargin+Lt.boxTextMargin,t=>St.newLoop(t));break;case i.db.LINETYPE.CRITICAL_OPTION:Vt(A,o,Lt.boxMargin+Lt.boxTextMargin,Lt.boxMargin,t=>St.addSectionToLoop(t));break;case i.db.LINETYPE.CRITICAL_END:t=St.endLoop(),await Et.drawLoop(f,t,"critical",Lt),St.bumpVerticalPos(t.stopy-St.getVerticalPos()),St.models.addLoop(t);break;case i.db.LINETYPE.BREAK_START:Vt(A,o,Lt.boxMargin,Lt.boxMargin+Lt.boxTextMargin,t=>St.newLoop(t));break;case i.db.LINETYPE.BREAK_END:t=St.endLoop(),await Et.drawLoop(f,t,"break",Lt),St.bumpVerticalPos(t.stopy-St.getVerticalPos()),St.models.addLoop(t);break;default:try{s=o.msgModel,s.starty=St.getVerticalPos(),s.sequenceIndex=I,s.sequenceVisible=i.db.showSequenceNumbers();const t=await Rt(0,s);Ht(o,s,t,S,y,b,x),E.push({messageModel:s,lineStartY:t}),St.models.addMessage(s)}catch(F){d.error("error while drawing message",F)}}[i.db.LINETYPE.SOLID_OPEN,i.db.LINETYPE.DOTTED_OPEN,i.db.LINETYPE.SOLID,i.db.LINETYPE.DOTTED,i.db.LINETYPE.SOLID_CROSS,i.db.LINETYPE.DOTTED_CROSS,i.db.LINETYPE.SOLID_POINT,i.db.LINETYPE.DOTTED_POINT,i.db.LINETYPE.BIDIRECTIONAL_SOLID,i.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(o.type)&&(I+=O),S++}d.debug("createdActors",b),d.debug("destroyedActors",x),await Ft(f,y,m,!1);for(const o of E)await Ct(f,o.messageModel,o.lineStartY,i);Lt.mirrorActors&&await Ft(f,y,m,!0),L.forEach(t=>Et.drawBackgroundRect(f,t)),it(f,y,m,Lt);for(const o of St.models.boxes){o.height=St.getVerticalPos()-o.y,St.insert(o.x,o.y,o.x+o.width,o.height);const t=2*Lt.boxMargin;o.startx=o.x-t,o.starty=o.y-.25*t,o.stopx=o.startx+o.width+2*t,o.stopy=o.starty+o.height+.75*t,o.stroke="rgb(0,0,0, 0.5)",Et.drawBox(f,o,Lt)}w&&St.bumpVerticalPos(Lt.boxMargin);const N=qt(f,y,m,u),{bounds:D}=St.getBounds();void 0===D.startx&&(D.startx=0),void 0===D.starty&&(D.starty=0),void 0===D.stopx&&(D.stopx=0),void 0===D.stopy&&(D.stopy=0);let M=D.stopy-D.starty;M<N.maxHeight&&(M=N.maxHeight);let P=M+2*Lt.diagramMarginY;Lt.mirrorActors&&(P=P-Lt.boxMargin+Lt.bottomMarginAdj);let R=D.stopx-D.startx;R<N.maxWidth&&(R=N.maxWidth);const C=R+2*Lt.diagramMarginX;g&&f.append("text").text(g).attr("x",(D.stopx-D.startx)/2-2*Lt.diagramMarginX).attr("y",-25),p(f,P,C,Lt.useMaxWidth);const B=g?40:0;f.attr("viewBox",D.startx-Lt.diagramMarginX+" -"+(Lt.diagramMarginY+B)+" "+C+" "+(P+B)),d.debug("models:",St.models)},"draw");async function Ut(t,e,s){const i={};for(const a of e)if(t.get(a.to)&&t.get(a.from)){const e=t.get(a.to);if(a.placement===s.db.PLACEMENT.LEFTOF&&!e.prevActor)continue;if(a.placement===s.db.PLACEMENT.RIGHTOF&&!e.nextActor)continue;const n=void 0!==a.placement,r=!n,o=n?Mt(Lt):Dt(Lt),c=a.wrap?$.wrapLabel(a.message,Lt.width-2*Lt.wrapPadding,o):a.message,h=(I(c)?await O(a.message,l()):$.calculateTextDimensions(c,o)).width+2*Lt.wrapPadding;r&&a.from===e.nextActor?i[a.to]=y.getMax(i[a.to]||0,h):r&&a.from===e.prevActor?i[a.from]=y.getMax(i[a.from]||0,h):r&&a.from===a.to?(i[a.from]=y.getMax(i[a.from]||0,h/2),i[a.to]=y.getMax(i[a.to]||0,h/2)):a.placement===s.db.PLACEMENT.RIGHTOF?i[a.from]=y.getMax(i[a.from]||0,h):a.placement===s.db.PLACEMENT.LEFTOF?i[e.prevActor]=y.getMax(i[e.prevActor]||0,h):a.placement===s.db.PLACEMENT.OVER&&(e.prevActor&&(i[e.prevActor]=y.getMax(i[e.prevActor]||0,h/2)),e.nextActor&&(i[a.from]=y.getMax(i[a.from]||0,h/2)))}return d.debug("maxMessageWidthPerActor:",i),i}o(Ut,"getMaxMessageWidthPerActor");var Kt=o(function(t){let e=0;const s=Pt(Lt);for(const i in t.links){const t=$.calculateTextDimensions(i,s).width+2*Lt.wrapPadding+2*Lt.boxMargin;e<t&&(e=t)}return e},"getRequiredPopupWidth");async function Xt(t,e,s){let i=0;for(const n of t.keys()){const e=t.get(n);e.wrap&&(e.description=$.wrapLabel(e.description,Lt.width-2*Lt.wrapPadding,Pt(Lt)));const s=I(e.description)?await O(e.description,l()):$.calculateTextDimensions(e.description,Pt(Lt));e.width=e.wrap?Lt.width:y.getMax(Lt.width,s.width+2*Lt.wrapPadding),e.height=e.wrap?y.getMax(s.height,Lt.height):Lt.height,i=y.getMax(i,e.height)}for(const n in e){const s=t.get(n);if(!s)continue;const i=t.get(s.nextActor);if(!i){const t=e[n]+Lt.actorMargin-s.width/2;s.margin=y.getMax(t,Lt.actorMargin);continue}const a=e[n]+Lt.actorMargin-s.width/2-i.width/2;s.margin=y.getMax(a,Lt.actorMargin)}let a=0;return s.forEach(e=>{const s=Dt(Lt);let i=e.actorKeys.reduce((e,s)=>e+(t.get(s).width+(t.get(s).margin||0)),0);i+=8*Lt.boxMargin,i-=2*Lt.boxTextMargin,e.wrap&&(e.name=$.wrapLabel(e.name,i-2*Lt.wrapPadding,s));const n=$.calculateTextDimensions(e.name,s);a=y.getMax(n.height,a);const r=y.getMax(i,n.width+2*Lt.wrapPadding);if(e.margin=Lt.boxTextMargin,i<r){const t=(r-i)/2;e.margin+=t}}),s.forEach(t=>t.textMaxHeight=a),y.getMax(i,Lt.height)}o(Xt,"calculateActorMargins");var Yt=o(async function(t,e,s){const i=e.get(t.from),a=e.get(t.to),n=i.x,r=a.x,o=t.wrap&&t.message;let c=I(t.message)?await O(t.message,l()):$.calculateTextDimensions(o?$.wrapLabel(t.message,Lt.width,Mt(Lt)):t.message,Mt(Lt));const h={width:o?Lt.width:y.getMax(Lt.width,c.width+2*Lt.noteMargin),height:0,startx:i.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===s.db.PLACEMENT.RIGHTOF?(h.width=o?y.getMax(Lt.width,c.width):y.getMax(i.width/2+a.width/2,c.width+2*Lt.noteMargin),h.startx=n+(i.width+Lt.actorMargin)/2):t.placement===s.db.PLACEMENT.LEFTOF?(h.width=o?y.getMax(Lt.width,c.width+2*Lt.noteMargin):y.getMax(i.width/2+a.width/2,c.width+2*Lt.noteMargin),h.startx=n-h.width+(i.width-Lt.actorMargin)/2):t.to===t.from?(c=$.calculateTextDimensions(o?$.wrapLabel(t.message,y.getMax(Lt.width,i.width),Mt(Lt)):t.message,Mt(Lt)),h.width=o?y.getMax(Lt.width,i.width):y.getMax(i.width,Lt.width,c.width+2*Lt.noteMargin),h.startx=n+(i.width-h.width)/2):(h.width=Math.abs(n+i.width/2-(r+a.width/2))+Lt.actorMargin,h.startx=n<r?n+i.width/2-Lt.actorMargin/2:r+a.width/2-Lt.actorMargin/2),o&&(h.message=$.wrapLabel(t.message,h.width-2*Lt.wrapPadding,Mt(Lt))),d.debug(`NM:[${h.startx},${h.stopx},${h.starty},${h.stopy}:${h.width},${h.height}=${t.message}]`),h},"buildNoteModel"),Zt=o(function(t,e,s){if(![s.db.LINETYPE.SOLID_OPEN,s.db.LINETYPE.DOTTED_OPEN,s.db.LINETYPE.SOLID,s.db.LINETYPE.DOTTED,s.db.LINETYPE.SOLID_CROSS,s.db.LINETYPE.DOTTED_CROSS,s.db.LINETYPE.SOLID_POINT,s.db.LINETYPE.DOTTED_POINT,s.db.LINETYPE.BIDIRECTIONAL_SOLID,s.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type))return{};const[i,a]=zt(t.from,e),[n,r]=zt(t.to,e),c=i<=n;let l=c?a:i,h=c?n:r;const d=Math.abs(n-r)>2,u=o(t=>c?-t:t,"adjustValue");t.from===t.to?h=l:(t.activate&&!d&&(h+=u(Lt.activationWidth/2-1)),[s.db.LINETYPE.SOLID_OPEN,s.db.LINETYPE.DOTTED_OPEN].includes(t.type)||(h+=u(3)),[s.db.LINETYPE.BIDIRECTIONAL_SOLID,s.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type)&&(l-=u(3)));const p=[i,a,n,r],f=Math.abs(l-h);t.wrap&&t.message&&(t.message=$.wrapLabel(t.message,y.getMax(f+2*Lt.wrapPadding,Lt.width),Dt(Lt)));const b=$.calculateTextDimensions(t.message,Dt(Lt));return{width:y.getMax(t.wrap?0:b.width+2*Lt.wrapPadding,f+2*Lt.wrapPadding,Lt.width),height:0,startx:l,stopx:h,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,p),toBounds:Math.max.apply(null,p)}},"buildMessageModel"),Jt=o(async function(t,e,s,i){const a={},n=[];let r,o,c;for(const l of t){switch(l.type){case i.db.LINETYPE.LOOP_START:case i.db.LINETYPE.ALT_START:case i.db.LINETYPE.OPT_START:case i.db.LINETYPE.PAR_START:case i.db.LINETYPE.PAR_OVER_START:case i.db.LINETYPE.CRITICAL_START:case i.db.LINETYPE.BREAK_START:n.push({id:l.id,msg:l.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case i.db.LINETYPE.ALT_ELSE:case i.db.LINETYPE.PAR_AND:case i.db.LINETYPE.CRITICAL_OPTION:l.message&&(r=n.pop(),a[r.id]=r,a[l.id]=r,n.push(r));break;case i.db.LINETYPE.LOOP_END:case i.db.LINETYPE.ALT_END:case i.db.LINETYPE.OPT_END:case i.db.LINETYPE.PAR_END:case i.db.LINETYPE.CRITICAL_END:case i.db.LINETYPE.BREAK_END:r=n.pop(),a[r.id]=r;break;case i.db.LINETYPE.ACTIVE_START:{const t=e.get(l.from?l.from:l.to.actor),s=jt(l.from?l.from:l.to.actor).length,i=t.x+t.width/2+(s-1)*Lt.activationWidth/2,a={startx:i,stopx:i+Lt.activationWidth,actor:l.from,enabled:!0};St.activations.push(a)}break;case i.db.LINETYPE.ACTIVE_END:{const t=St.activations.map(t=>t.actor).lastIndexOf(l.from);St.activations.splice(t,1).splice(0,1)}}void 0!==l.placement?(o=await Yt(l,e,i),l.noteModel=o,n.forEach(t=>{r=t,r.from=y.getMin(r.from,o.startx),r.to=y.getMax(r.to,o.startx+o.width),r.width=y.getMax(r.width,Math.abs(r.from-r.to))-Lt.labelBoxWidth})):(c=Zt(l,e,i),l.msgModel=c,c.startx&&c.stopx&&n.length>0&&n.forEach(t=>{if(r=t,c.startx===c.stopx){const t=e.get(l.from),s=e.get(l.to);r.from=y.getMin(t.x-c.width/2,t.x-t.width/2,r.from),r.to=y.getMax(s.x+c.width/2,s.x+t.width/2,r.to),r.width=y.getMax(r.width,Math.abs(r.to-r.from))-Lt.labelBoxWidth}else r.from=y.getMin(c.startx,r.from),r.to=y.getMax(c.stopx,r.to),r.width=y.getMax(r.width,c.width)-Lt.labelBoxWidth}))}return St.activations=[],d.debug("Loop type widths:",a),a},"calculateLoopBounds"),Qt={bounds:St,drawActors:Ft,drawActorsPopup:qt,setConf:Wt,draw:Gt},te={parser:R,get db(){return new V},renderer:Qt,styles:H,init:o(t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,c({sequence:{wrap:t.wrap}}))},"init")};export{te as diagram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as t,a as e,S as r}from"./chunk-DI55MBZ5-BSKWux3O.js";import{_ as n,c as s,d as i,l as o,e as a,k as c,R as d,S as l,O as h,u as f}from"./index-BjhzeLhE.js";import{G as u}from"./graph-CIxq09py.js";import{l as x}from"./layout--4uVmx-N.js";import"./chunk-55IACEB6-BBVxwshD.js";import"./chunk-QN33PNHL-08F21gyd.js";import"./_baseUniq-CX8zlFs7.js";import"./min-Bbgp4eqd.js";var p,g=n(t=>t.append("circle").attr("class","start-state").attr("r",s().state.sizeUnit).attr("cx",s().state.padding+s().state.sizeUnit).attr("cy",s().state.padding+s().state.sizeUnit),"drawStartState"),y=n(t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",s().state.textHeight).attr("class","divider").attr("x2",2*s().state.textHeight).attr("y1",0).attr("y2",0),"drawDivider"),m=n((t,e)=>{const r=t.append("text").attr("x",2*s().state.padding).attr("y",s().state.textHeight+2*s().state.padding).attr("font-size",s().state.fontSize).attr("class","state-title").text(e.id),n=r.node().getBBox();return t.insert("rect",":first-child").attr("x",s().state.padding).attr("y",s().state.padding).attr("width",n.width+2*s().state.padding).attr("height",n.height+2*s().state.padding).attr("rx",s().state.radius),r},"drawSimpleState"),w=n((t,e)=>{const r=n(function(t,e,r){const n=t.append("tspan").attr("x",2*s().state.padding).text(e);r||n.attr("dy",s().state.textHeight)},"addTspan"),i=t.append("text").attr("x",2*s().state.padding).attr("y",s().state.textHeight+1.3*s().state.padding).attr("font-size",s().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),o=i.height,a=t.append("text").attr("x",s().state.padding).attr("y",o+.4*s().state.padding+s().state.dividerMargin+s().state.textHeight).attr("class","state-description");let c=!0,d=!0;e.descriptions.forEach(function(t){c||(r(a,t,d),d=!1),c=!1});const l=t.append("line").attr("x1",s().state.padding).attr("y1",s().state.padding+o+s().state.dividerMargin/2).attr("y2",s().state.padding+o+s().state.dividerMargin/2).attr("class","descr-divider"),h=a.node().getBBox(),f=Math.max(h.width,i.width);return l.attr("x2",f+3*s().state.padding),t.insert("rect",":first-child").attr("x",s().state.padding).attr("y",s().state.padding).attr("width",f+2*s().state.padding).attr("height",h.height+o+2*s().state.padding).attr("rx",s().state.radius),t},"drawDescrState"),k=n((t,e,r)=>{const n=s().state.padding,i=2*s().state.padding,o=t.node().getBBox(),a=o.width,c=o.x,d=t.append("text").attr("x",0).attr("y",s().state.titleShift).attr("font-size",s().state.fontSize).attr("class","state-title").text(e.id),l=d.node().getBBox().width+i;let h,f=Math.max(l,a);f===a&&(f+=i);const u=t.node().getBBox();e.doc,h=c-n,l>a&&(h=(a-f)/2+n),Math.abs(c-u.x)<n&&l>a&&(h=c-(l-a)/2);const x=1-s().state.textHeight;return t.insert("rect",":first-child").attr("x",h).attr("y",x).attr("class",r?"alt-composit":"composit").attr("width",f).attr("height",u.height+s().state.textHeight+s().state.titleShift+1).attr("rx","0"),d.attr("x",h+n),l<=a&&d.attr("x",c+(f-i)/2-l/2+n),t.insert("rect",":first-child").attr("x",h).attr("y",s().state.titleShift-s().state.textHeight-s().state.padding).attr("width",f).attr("height",3*s().state.textHeight).attr("rx",s().state.radius),t.insert("rect",":first-child").attr("x",h).attr("y",s().state.titleShift-s().state.textHeight-s().state.padding).attr("width",f).attr("height",u.height+3+2*s().state.textHeight).attr("rx",s().state.radius),t},"addTitleAndBox"),b=n(t=>(t.append("circle").attr("class","end-state-outer").attr("r",s().state.sizeUnit+s().state.miniPadding).attr("cx",s().state.padding+s().state.sizeUnit+s().state.miniPadding).attr("cy",s().state.padding+s().state.sizeUnit+s().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",s().state.sizeUnit).attr("cx",s().state.padding+s().state.sizeUnit+2).attr("cy",s().state.padding+s().state.sizeUnit+2)),"drawEndState"),S=n((t,e)=>{let r=s().state.forkWidth,n=s().state.forkHeight;if(e.parentId){let t=r;r=n,n=t}return t.append("rect").style("stroke","black").style("fill","black").attr("width",r).attr("height",n).attr("x",s().state.padding).attr("y",s().state.padding)},"drawForkJoinState"),v=n((t,e,r,n)=>{let i=0;const o=n.append("text");o.style("text-anchor","start"),o.attr("class","noteText");let a=t.replace(/\r\n/g,"<br/>");a=a.replace(/\n/g,"<br/>");const d=a.split(c.lineBreakRegex);let l=1.25*s().state.noteMargin;for(const c of d){const t=c.trim();if(t.length>0){const n=o.append("tspan");if(n.text(t),0===l){l+=n.node().getBBox().height}i+=l,n.attr("x",e+s().state.noteMargin),n.attr("y",r+i+1.25*s().state.noteMargin)}}return{textWidth:o.node().getBBox().width,textHeight:i}},"_drawLongText"),N=n((t,e)=>{e.attr("class","state-note");const r=e.append("rect").attr("x",0).attr("y",s().state.padding),n=e.append("g"),{textWidth:i,textHeight:o}=v(t,0,0,n);return r.attr("height",o+2*s().state.noteMargin),r.attr("width",i+2*s().state.noteMargin),r},"drawNote"),j=n(function(t,e){const r=e.id,n={id:r,label:e.id,width:0,height:0},i=t.append("g").attr("id",r).attr("class","stateGroup");"start"===e.type&&g(i),"end"===e.type&&b(i),"fork"!==e.type&&"join"!==e.type||S(i,e),"note"===e.type&&N(e.note.text,i),"divider"===e.type&&y(i),"default"===e.type&&0===e.descriptions.length&&m(i,e),"default"===e.type&&e.descriptions.length>0&&w(i,e);const o=i.node().getBBox();return n.width=o.width+2*s().state.padding,n.height=o.height+2*s().state.padding,n},"drawState"),M=0,L=n(function(t,e,i){const a=n(function(t){switch(t){case r.relationType.AGGREGATION:return"aggregation";case r.relationType.EXTENSION:return"extension";case r.relationType.COMPOSITION:return"composition";case r.relationType.DEPENDENCY:return"dependency"}},"getRelationType");e.points=e.points.filter(t=>!Number.isNaN(t.y));const u=e.points,x=d().x(function(t){return t.x}).y(function(t){return t.y}).curve(l),p=t.append("path").attr("d",x(u)).attr("id","edge"+M).attr("class","transition");let g="";if(s().state.arrowMarkerAbsolute&&(g=h(!0)),p.attr("marker-end","url("+g+"#"+a(r.relationType.DEPENDENCY)+"End)"),void 0!==i.title){const r=t.append("g").attr("class","stateLabel"),{x:n,y:a}=f.calcLabelPosition(e.points),d=c.getRows(i.title);let l=0;const h=[];let u=0,x=0;for(let t=0;t<=d.length;t++){const e=r.append("text").attr("text-anchor","middle").text(d[t]).attr("x",n).attr("y",a+l),s=e.node().getBBox();if(u=Math.max(u,s.width),x=Math.min(x,s.x),o.info(s.x,n,a+l),0===l){const t=e.node().getBBox();l=t.height,o.info("Title height",l,a)}h.push(e)}let p=l*d.length;if(d.length>1){const t=(d.length-1)*l*.5;h.forEach((e,r)=>e.attr("y",a+r*l-t)),p=l*d.length}const g=r.node().getBBox();r.insert("rect",":first-child").attr("class","box").attr("x",n-u/2-s().state.padding/2).attr("y",a-p/2-s().state.padding/2-3.5).attr("width",u+s().state.padding).attr("height",p+s().state.padding),o.info(g)}M++},"drawEdge"),T={},E=n(function(){},"setConf"),G=n(function(t){t.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),B=n(function(t,e,r,n){p=s().state;const c=s().securityLevel;let d;"sandbox"===c&&(d=i("#i"+e));const l=i("sandbox"===c?d.nodes()[0].contentDocument.body:"body"),h="sandbox"===c?d.nodes()[0].contentDocument:document;o.debug("Rendering diagram "+t);const f=l.select(`[id='${e}']`);G(f);const u=n.db.getRootDoc();O(u,f,void 0,!1,l,h,n);const x=p.padding,g=f.node().getBBox(),y=g.width+2*x,m=g.height+2*x;a(f,m,1.75*y,p.useMaxWidth),f.attr("viewBox",`${g.x-p.padding} ${g.y-p.padding} `+y+" "+m)},"draw"),D=n(t=>t?t.length*p.fontSizeFactor:1,"getLabelWidth"),O=n((t,e,r,n,s,i,a)=>{const d=new u({compound:!0,multigraph:!0});let l,h=!0;for(l=0;l<t.length;l++)if("relation"===t[l].stmt){h=!1;break}r?d.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:h?1:p.edgeLengthFactor,nodeSep:h?1:50,isMultiGraph:!0}):d.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:h?1:p.edgeLengthFactor,nodeSep:h?1:50,ranker:"tight-tree",isMultiGraph:!0}),d.setDefaultEdgeLabel(function(){return{}});const f=a.db.getStates(),g=a.db.getRelations(),y=Object.keys(f);for(const o of y){const t=f[o];let c;if(r&&(t.parentId=r),t.doc){let r=e.append("g").attr("id",t.id).attr("class","stateGroup");c=O(t.doc,r,t.id,!n,s,i,a);{r=k(r,t,n);let e=r.node().getBBox();c.width=e.width,c.height=e.height+p.padding/2,T[t.id]={y:p.compositTitleSize}}}else c=j(e,t,d);if(t.note){const r={descriptions:[],id:t.id+"-note",note:t.note,type:"note"},n=j(e,r,d);"left of"===t.note.position?(d.setNode(c.id+"-note",n),d.setNode(c.id,c)):(d.setNode(c.id,c),d.setNode(c.id+"-note",n)),d.setParent(c.id,c.id+"-group"),d.setParent(c.id+"-note",c.id+"-group")}else d.setNode(c.id,c)}o.debug("Count=",d.nodeCount(),d);let m=0;g.forEach(function(t){m++,o.debug("Setting edge",t),d.setEdge(t.id1,t.id2,{relation:t,width:D(t.title),height:p.labelHeight*c.getRows(t.title).length,labelpos:"c"},"id"+m)}),x(d),o.debug("Graph after layout",d.nodes());const w=e.node();d.nodes().forEach(function(t){if(void 0!==t&&void 0!==d.node(t)){o.warn("Node "+t+": "+JSON.stringify(d.node(t))),s.select("#"+w.id+" #"+t).attr("transform","translate("+(d.node(t).x-d.node(t).width/2)+","+(d.node(t).y+(T[t]?T[t].y:0)-d.node(t).height/2)+" )"),s.select("#"+w.id+" #"+t).attr("data-x-shift",d.node(t).x-d.node(t).width/2);i.querySelectorAll("#"+w.id+" #"+t+" .divider").forEach(t=>{const e=t.parentElement;let r=0,n=0;e&&(e.parentElement&&(r=e.parentElement.getBBox().width),n=parseInt(e.getAttribute("data-x-shift"),10),Number.isNaN(n)&&(n=0)),t.setAttribute("x1",0-n+8),t.setAttribute("x2",r-n-8)})}else o.debug("No Node "+t+": "+JSON.stringify(d.node(t)))});let b=w.getBBox();d.edges().forEach(function(t){void 0!==t&&void 0!==d.edge(t)&&(o.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(d.edge(t))),L(e,d.edge(t),d.edge(t).relation))}),b=w.getBBox();const S={id:r||"root",label:r||"root",width:0,height:0};return S.width=b.width+2*p.padding,S.height=b.height+2*p.padding,o.debug("Doc rendered",S,d),S},"renderDoc"),C={setConf:E,draw:B},H={parser:e,get db(){return new r(1)},renderer:C,styles:t,init:n(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{H as diagram};
|
|
1
|
+
import{s as t,a as e,S as r}from"./chunk-DI55MBZ5-BXrfKlO3.js";import{_ as n,c as s,d as i,l as o,e as a,k as c,R as d,S as l,O as h,u as f}from"./index-BvMYTiOr.js";import{G as u}from"./graph-yEZO5As9.js";import{l as x}from"./layout-DAYHKwLI.js";import"./chunk-55IACEB6-BeMIObm3.js";import"./chunk-QN33PNHL-DuPwsSus.js";import"./_baseUniq-O6Fk0Wzr.js";import"./min-CcGwUInn.js";var p,g=n(t=>t.append("circle").attr("class","start-state").attr("r",s().state.sizeUnit).attr("cx",s().state.padding+s().state.sizeUnit).attr("cy",s().state.padding+s().state.sizeUnit),"drawStartState"),y=n(t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",s().state.textHeight).attr("class","divider").attr("x2",2*s().state.textHeight).attr("y1",0).attr("y2",0),"drawDivider"),m=n((t,e)=>{const r=t.append("text").attr("x",2*s().state.padding).attr("y",s().state.textHeight+2*s().state.padding).attr("font-size",s().state.fontSize).attr("class","state-title").text(e.id),n=r.node().getBBox();return t.insert("rect",":first-child").attr("x",s().state.padding).attr("y",s().state.padding).attr("width",n.width+2*s().state.padding).attr("height",n.height+2*s().state.padding).attr("rx",s().state.radius),r},"drawSimpleState"),w=n((t,e)=>{const r=n(function(t,e,r){const n=t.append("tspan").attr("x",2*s().state.padding).text(e);r||n.attr("dy",s().state.textHeight)},"addTspan"),i=t.append("text").attr("x",2*s().state.padding).attr("y",s().state.textHeight+1.3*s().state.padding).attr("font-size",s().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),o=i.height,a=t.append("text").attr("x",s().state.padding).attr("y",o+.4*s().state.padding+s().state.dividerMargin+s().state.textHeight).attr("class","state-description");let c=!0,d=!0;e.descriptions.forEach(function(t){c||(r(a,t,d),d=!1),c=!1});const l=t.append("line").attr("x1",s().state.padding).attr("y1",s().state.padding+o+s().state.dividerMargin/2).attr("y2",s().state.padding+o+s().state.dividerMargin/2).attr("class","descr-divider"),h=a.node().getBBox(),f=Math.max(h.width,i.width);return l.attr("x2",f+3*s().state.padding),t.insert("rect",":first-child").attr("x",s().state.padding).attr("y",s().state.padding).attr("width",f+2*s().state.padding).attr("height",h.height+o+2*s().state.padding).attr("rx",s().state.radius),t},"drawDescrState"),k=n((t,e,r)=>{const n=s().state.padding,i=2*s().state.padding,o=t.node().getBBox(),a=o.width,c=o.x,d=t.append("text").attr("x",0).attr("y",s().state.titleShift).attr("font-size",s().state.fontSize).attr("class","state-title").text(e.id),l=d.node().getBBox().width+i;let h,f=Math.max(l,a);f===a&&(f+=i);const u=t.node().getBBox();e.doc,h=c-n,l>a&&(h=(a-f)/2+n),Math.abs(c-u.x)<n&&l>a&&(h=c-(l-a)/2);const x=1-s().state.textHeight;return t.insert("rect",":first-child").attr("x",h).attr("y",x).attr("class",r?"alt-composit":"composit").attr("width",f).attr("height",u.height+s().state.textHeight+s().state.titleShift+1).attr("rx","0"),d.attr("x",h+n),l<=a&&d.attr("x",c+(f-i)/2-l/2+n),t.insert("rect",":first-child").attr("x",h).attr("y",s().state.titleShift-s().state.textHeight-s().state.padding).attr("width",f).attr("height",3*s().state.textHeight).attr("rx",s().state.radius),t.insert("rect",":first-child").attr("x",h).attr("y",s().state.titleShift-s().state.textHeight-s().state.padding).attr("width",f).attr("height",u.height+3+2*s().state.textHeight).attr("rx",s().state.radius),t},"addTitleAndBox"),b=n(t=>(t.append("circle").attr("class","end-state-outer").attr("r",s().state.sizeUnit+s().state.miniPadding).attr("cx",s().state.padding+s().state.sizeUnit+s().state.miniPadding).attr("cy",s().state.padding+s().state.sizeUnit+s().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",s().state.sizeUnit).attr("cx",s().state.padding+s().state.sizeUnit+2).attr("cy",s().state.padding+s().state.sizeUnit+2)),"drawEndState"),S=n((t,e)=>{let r=s().state.forkWidth,n=s().state.forkHeight;if(e.parentId){let t=r;r=n,n=t}return t.append("rect").style("stroke","black").style("fill","black").attr("width",r).attr("height",n).attr("x",s().state.padding).attr("y",s().state.padding)},"drawForkJoinState"),v=n((t,e,r,n)=>{let i=0;const o=n.append("text");o.style("text-anchor","start"),o.attr("class","noteText");let a=t.replace(/\r\n/g,"<br/>");a=a.replace(/\n/g,"<br/>");const d=a.split(c.lineBreakRegex);let l=1.25*s().state.noteMargin;for(const c of d){const t=c.trim();if(t.length>0){const n=o.append("tspan");if(n.text(t),0===l){l+=n.node().getBBox().height}i+=l,n.attr("x",e+s().state.noteMargin),n.attr("y",r+i+1.25*s().state.noteMargin)}}return{textWidth:o.node().getBBox().width,textHeight:i}},"_drawLongText"),N=n((t,e)=>{e.attr("class","state-note");const r=e.append("rect").attr("x",0).attr("y",s().state.padding),n=e.append("g"),{textWidth:i,textHeight:o}=v(t,0,0,n);return r.attr("height",o+2*s().state.noteMargin),r.attr("width",i+2*s().state.noteMargin),r},"drawNote"),j=n(function(t,e){const r=e.id,n={id:r,label:e.id,width:0,height:0},i=t.append("g").attr("id",r).attr("class","stateGroup");"start"===e.type&&g(i),"end"===e.type&&b(i),"fork"!==e.type&&"join"!==e.type||S(i,e),"note"===e.type&&N(e.note.text,i),"divider"===e.type&&y(i),"default"===e.type&&0===e.descriptions.length&&m(i,e),"default"===e.type&&e.descriptions.length>0&&w(i,e);const o=i.node().getBBox();return n.width=o.width+2*s().state.padding,n.height=o.height+2*s().state.padding,n},"drawState"),M=0,L=n(function(t,e,i){const a=n(function(t){switch(t){case r.relationType.AGGREGATION:return"aggregation";case r.relationType.EXTENSION:return"extension";case r.relationType.COMPOSITION:return"composition";case r.relationType.DEPENDENCY:return"dependency"}},"getRelationType");e.points=e.points.filter(t=>!Number.isNaN(t.y));const u=e.points,x=d().x(function(t){return t.x}).y(function(t){return t.y}).curve(l),p=t.append("path").attr("d",x(u)).attr("id","edge"+M).attr("class","transition");let g="";if(s().state.arrowMarkerAbsolute&&(g=h(!0)),p.attr("marker-end","url("+g+"#"+a(r.relationType.DEPENDENCY)+"End)"),void 0!==i.title){const r=t.append("g").attr("class","stateLabel"),{x:n,y:a}=f.calcLabelPosition(e.points),d=c.getRows(i.title);let l=0;const h=[];let u=0,x=0;for(let t=0;t<=d.length;t++){const e=r.append("text").attr("text-anchor","middle").text(d[t]).attr("x",n).attr("y",a+l),s=e.node().getBBox();if(u=Math.max(u,s.width),x=Math.min(x,s.x),o.info(s.x,n,a+l),0===l){const t=e.node().getBBox();l=t.height,o.info("Title height",l,a)}h.push(e)}let p=l*d.length;if(d.length>1){const t=(d.length-1)*l*.5;h.forEach((e,r)=>e.attr("y",a+r*l-t)),p=l*d.length}const g=r.node().getBBox();r.insert("rect",":first-child").attr("class","box").attr("x",n-u/2-s().state.padding/2).attr("y",a-p/2-s().state.padding/2-3.5).attr("width",u+s().state.padding).attr("height",p+s().state.padding),o.info(g)}M++},"drawEdge"),T={},E=n(function(){},"setConf"),G=n(function(t){t.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),B=n(function(t,e,r,n){p=s().state;const c=s().securityLevel;let d;"sandbox"===c&&(d=i("#i"+e));const l=i("sandbox"===c?d.nodes()[0].contentDocument.body:"body"),h="sandbox"===c?d.nodes()[0].contentDocument:document;o.debug("Rendering diagram "+t);const f=l.select(`[id='${e}']`);G(f);const u=n.db.getRootDoc();O(u,f,void 0,!1,l,h,n);const x=p.padding,g=f.node().getBBox(),y=g.width+2*x,m=g.height+2*x;a(f,m,1.75*y,p.useMaxWidth),f.attr("viewBox",`${g.x-p.padding} ${g.y-p.padding} `+y+" "+m)},"draw"),D=n(t=>t?t.length*p.fontSizeFactor:1,"getLabelWidth"),O=n((t,e,r,n,s,i,a)=>{const d=new u({compound:!0,multigraph:!0});let l,h=!0;for(l=0;l<t.length;l++)if("relation"===t[l].stmt){h=!1;break}r?d.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:h?1:p.edgeLengthFactor,nodeSep:h?1:50,isMultiGraph:!0}):d.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:h?1:p.edgeLengthFactor,nodeSep:h?1:50,ranker:"tight-tree",isMultiGraph:!0}),d.setDefaultEdgeLabel(function(){return{}});const f=a.db.getStates(),g=a.db.getRelations(),y=Object.keys(f);for(const o of y){const t=f[o];let c;if(r&&(t.parentId=r),t.doc){let r=e.append("g").attr("id",t.id).attr("class","stateGroup");c=O(t.doc,r,t.id,!n,s,i,a);{r=k(r,t,n);let e=r.node().getBBox();c.width=e.width,c.height=e.height+p.padding/2,T[t.id]={y:p.compositTitleSize}}}else c=j(e,t,d);if(t.note){const r={descriptions:[],id:t.id+"-note",note:t.note,type:"note"},n=j(e,r,d);"left of"===t.note.position?(d.setNode(c.id+"-note",n),d.setNode(c.id,c)):(d.setNode(c.id,c),d.setNode(c.id+"-note",n)),d.setParent(c.id,c.id+"-group"),d.setParent(c.id+"-note",c.id+"-group")}else d.setNode(c.id,c)}o.debug("Count=",d.nodeCount(),d);let m=0;g.forEach(function(t){m++,o.debug("Setting edge",t),d.setEdge(t.id1,t.id2,{relation:t,width:D(t.title),height:p.labelHeight*c.getRows(t.title).length,labelpos:"c"},"id"+m)}),x(d),o.debug("Graph after layout",d.nodes());const w=e.node();d.nodes().forEach(function(t){if(void 0!==t&&void 0!==d.node(t)){o.warn("Node "+t+": "+JSON.stringify(d.node(t))),s.select("#"+w.id+" #"+t).attr("transform","translate("+(d.node(t).x-d.node(t).width/2)+","+(d.node(t).y+(T[t]?T[t].y:0)-d.node(t).height/2)+" )"),s.select("#"+w.id+" #"+t).attr("data-x-shift",d.node(t).x-d.node(t).width/2);i.querySelectorAll("#"+w.id+" #"+t+" .divider").forEach(t=>{const e=t.parentElement;let r=0,n=0;e&&(e.parentElement&&(r=e.parentElement.getBBox().width),n=parseInt(e.getAttribute("data-x-shift"),10),Number.isNaN(n)&&(n=0)),t.setAttribute("x1",0-n+8),t.setAttribute("x2",r-n-8)})}else o.debug("No Node "+t+": "+JSON.stringify(d.node(t)))});let b=w.getBBox();d.edges().forEach(function(t){void 0!==t&&void 0!==d.edge(t)&&(o.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(d.edge(t))),L(e,d.edge(t),d.edge(t).relation))}),b=w.getBBox();const S={id:r||"root",label:r||"root",width:0,height:0};return S.width=b.width+2*p.padding,S.height=b.height+2*p.padding,o.debug("Doc rendered",S,d),S},"renderDoc"),C={setConf:E,draw:B},H={parser:e,get db(){return new r(1)},renderer:C,styles:t,init:n(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{H as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as r,b as s,a as e,S as t}from"./chunk-DI55MBZ5-BXrfKlO3.js";import{_ as i}from"./index-BvMYTiOr.js";import"./chunk-55IACEB6-BeMIObm3.js";import"./chunk-QN33PNHL-DuPwsSus.js";var n={parser:e,get db(){return new t(2)},renderer:s,styles:r,init:i(r=>{r.state||(r.state={}),r.state.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
|