@codragraph/cli 2.1.0 → 2.1.4
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/README.md +62 -21
- package/dist/_shared/cgdb/schema-constants.d.ts +2 -2
- package/dist/_shared/cgdb/schema-constants.d.ts.map +1 -1
- package/dist/_shared/cgdb/schema-constants.js +3 -0
- package/dist/_shared/cgdb/schema-constants.js.map +1 -1
- package/dist/_shared/feature-clusters.d.ts +99 -0
- package/dist/_shared/feature-clusters.d.ts.map +1 -0
- package/dist/_shared/feature-clusters.js +2 -0
- package/dist/_shared/feature-clusters.js.map +1 -0
- package/dist/_shared/graph/types.d.ts +16 -2
- package/dist/_shared/graph/types.d.ts.map +1 -1
- package/dist/_shared/index.d.ts +1 -0
- package/dist/_shared/index.d.ts.map +1 -1
- package/dist/_shared/index.js.map +1 -1
- package/dist/_shared/pipeline.d.ts +1 -1
- package/dist/_shared/pipeline.d.ts.map +1 -1
- package/dist/cli/ai-context.js +4 -0
- package/dist/cli/analyze.js +46 -26
- package/dist/cli/index.js +39 -1
- package/dist/cli/serve.d.ts +1 -0
- package/dist/cli/serve.js +3 -1
- package/dist/cli/setup.js +42 -21
- package/dist/cli/status.d.ts +13 -0
- package/dist/cli/status.js +99 -0
- package/dist/cli/tool.d.ts +25 -0
- package/dist/cli/tool.js +74 -0
- package/dist/config/ignore-service.js +2 -0
- package/dist/config/supported-languages.d.ts +3 -3
- package/dist/config/supported-languages.js +3 -3
- package/dist/core/cgdb/cgdb-adapter.js +19 -3
- package/dist/core/cgdb/csv-generator.js +33 -2
- package/dist/core/cgdb/schema.d.ts +2 -1
- package/dist/core/cgdb/schema.js +55 -0
- package/dist/core/embeddings/embedder.js +4 -2
- package/dist/core/graphstore/cgdb-row-source.js +3 -2
- package/dist/core/graphstore/index.d.ts +1 -1
- package/dist/core/graphstore/index.js +1 -1
- package/dist/core/group/bridge-db.js +42 -10
- package/dist/core/group/service.d.ts +16 -0
- package/dist/core/group/service.js +360 -0
- package/dist/core/ingestion/emit-references.d.ts +1 -1
- package/dist/core/ingestion/emit-references.js +1 -1
- package/dist/core/ingestion/feature-cluster-processor.d.ts +62 -0
- package/dist/core/ingestion/feature-cluster-processor.js +626 -0
- package/dist/core/ingestion/finalize-orchestrator.js +1 -1
- package/dist/core/ingestion/model/registration-table.js +1 -0
- package/dist/core/ingestion/model/resolve.d.ts +2 -2
- package/dist/core/ingestion/model/resolve.js +3 -3
- package/dist/core/ingestion/model/semantic-model.d.ts +1 -1
- package/dist/core/ingestion/model/semantic-model.js +1 -1
- package/dist/core/ingestion/model/symbol-table.d.ts +1 -1
- package/dist/core/ingestion/model/symbol-table.js +1 -1
- package/dist/core/ingestion/pipeline-phases/feature-clusters.d.ts +17 -0
- package/dist/core/ingestion/pipeline-phases/feature-clusters.js +88 -0
- package/dist/core/ingestion/pipeline-phases/index.d.ts +1 -0
- package/dist/core/ingestion/pipeline-phases/index.js +1 -0
- package/dist/core/ingestion/pipeline.d.ts +4 -0
- package/dist/core/ingestion/pipeline.js +9 -5
- package/dist/core/run-analyze.d.ts +21 -0
- package/dist/core/run-analyze.js +213 -6
- package/dist/core/search/hybrid-search.js +11 -3
- package/dist/mcp/core/embedder.js +5 -2
- package/dist/mcp/local/local-backend.d.ts +12 -0
- package/dist/mcp/local/local-backend.js +381 -3
- package/dist/mcp/resources.js +139 -0
- package/dist/mcp/tools.js +174 -2
- package/dist/server/api.d.ts +14 -2
- package/dist/server/api.js +206 -7
- package/dist/server/mcp-http.d.ts +22 -0
- package/dist/server/mcp-http.js +21 -2
- package/dist/server/web-dashboard.d.ts +28 -0
- package/dist/server/web-dashboard.js +61 -0
- package/dist/storage/repo-manager.d.ts +6 -1
- package/dist/storage/repo-manager.js +5 -1
- package/dist/types/pipeline.d.ts +2 -0
- package/dist/web/assets/agent-D5lb0zXz.js +1089 -0
- package/dist/web/assets/architectureDiagram-EMZXCZ2Q-CZtc99v_.js +36 -0
- package/dist/web/assets/blockDiagram-IGV67L2C-BtoUp-6Y.js +132 -0
- package/dist/web/assets/c4Diagram-DFAF54RM-C4Hl3J2U.js +10 -0
- package/dist/web/assets/chunk-3GS5O3IE-DkUjU0WD.js +231 -0
- package/dist/web/assets/chunk-3YCYZ6SJ-CQkVgT_z.js +1 -0
- package/dist/web/assets/chunk-7RZVMHOQ-BitYcNVR.js +338 -0
- package/dist/web/assets/chunk-AEOMTBSW-BgTIXPsY.js +1 -0
- package/dist/web/assets/chunk-H3VCZNTA-Cx5XV_aC.js +13 -0
- package/dist/web/assets/chunk-HN6EAY2L-BBnyTNdB.js +1 -0
- package/dist/web/assets/chunk-KSICW3F5-BYzvDLNI.js +15 -0
- package/dist/web/assets/chunk-O5ABG6QK-dHwHzA6n.js +1 -0
- package/dist/web/assets/chunk-PK6DOVAG-CvsEnugt.js +206 -0
- package/dist/web/assets/chunk-RWUO3TPN-BgRTY0_k.js +1 -0
- package/dist/web/assets/chunk-TBF5ZNIQ-DL5stGM1.js +1 -0
- package/dist/web/assets/chunk-TU3PZOEN-RLyvLcv-.js +1 -0
- package/dist/web/assets/classDiagram-PPOCWD7C-DTr8QIOf.js +1 -0
- package/dist/web/assets/classDiagram-v2-23LJLIIU-DTr8QIOf.js +1 -0
- package/dist/web/assets/context-builder-22jU3V56.js +16 -0
- package/dist/web/assets/cose-bilkent-PNC4W37J-DVhePRYg.js +1 -0
- package/dist/web/assets/dagre-E77IOHMT-Dzx0A6ZU.js +4 -0
- package/dist/web/assets/diagram-H7BISOXX-CC9pRew1.js +43 -0
- package/dist/web/assets/diagram-JC5VWROH-Bau_i9tf.js +24 -0
- package/dist/web/assets/diagram-LXUTUG65-D9_FM2Gt.js +10 -0
- package/dist/web/assets/diagram-WEHSV5V5-BMlayouL.js +24 -0
- package/dist/web/assets/erDiagram-GCSMX5X6-C3dhDFA8.js +85 -0
- package/dist/web/assets/flowDiagram-OTCZ4VVT-CWSFWmhr.js +162 -0
- package/dist/web/assets/ganttDiagram-MUNLMDZQ-D3a67Yol.js +292 -0
- package/dist/web/assets/gitGraphDiagram-3HKGZ4G3-7jmry-vM.js +106 -0
- package/dist/web/assets/index-BgeqpYgd.js +1415 -0
- package/dist/web/assets/index-CT0GtFLZ.css +1 -0
- package/dist/web/assets/infoDiagram-MN7RKWGX-G7lhP0Ib.js +2 -0
- package/dist/web/assets/ishikawaDiagram-YMYX4NHK-DUoJvNP2.js +70 -0
- package/dist/web/assets/journeyDiagram-SO5T7YLQ-RMFPNNqz.js +139 -0
- package/dist/web/assets/kanban-definition-LJHFXRCJ-BzpDs1K9.js +89 -0
- package/dist/web/assets/katex-GD7MH7QM-DBQvrix-.js +261 -0
- package/dist/web/assets/mindmap-definition-2EUWGEK5-Bk0O4roa.js +96 -0
- package/dist/web/assets/pieDiagram-3IATQBI2-DKU7kpgS.js +30 -0
- package/dist/web/assets/quadrantDiagram-E256RVCF-BY0TGWCS.js +7 -0
- package/dist/web/assets/requirementDiagram-M5DCFWZL-DLHOVTSv.js +84 -0
- package/dist/web/assets/sankeyDiagram-L3NBLAOT-DVMj5rX2.js +10 -0
- package/dist/web/assets/sequenceDiagram-ZOUHS735-CJC73bV-.js +157 -0
- package/dist/web/assets/stateDiagram-MLPALWAM-BCFyESls.js +1 -0
- package/dist/web/assets/stateDiagram-v2-B5LQ5ZB2-DahzzIca.js +1 -0
- package/dist/web/assets/timeline-definition-5SPVSISX-TRSDRgPw.js +120 -0
- package/dist/web/assets/vennDiagram-IE5QUKF5-DNy7HRBM.js +34 -0
- package/dist/web/assets/wardley-RL74JXVD-BCRCBASE-B-eZEzf9.js +161 -0
- package/dist/web/assets/wardleyDiagram-XU3VSMPF-BP-r1xzR.js +20 -0
- package/dist/web/assets/xychartDiagram-ZHJ5623Y-Dr9r7a35.js +7 -0
- package/dist/web/codragraph-logo-512.png +0 -0
- package/dist/web/codragraph-logo.png +0 -0
- package/dist/web/favicon.png +0 -0
- package/dist/web/index.html +36 -0
- package/hooks/claude/codragraph-hook.cjs +24 -9
- package/hooks/claude/pre-tool-use.sh +6 -1
- package/package.json +15 -4
- package/scripts/build.js +75 -16
- package/scripts/patch-tree-sitter-swift.cjs +0 -1
- package/skills/codragraph-cli.md +17 -1
- package/skills/codragraph-guide.md +6 -2
- package/skills/codragraph-onboarding.md +2 -2
- package/vendor/leiden/index.cjs +272 -285
- package/vendor/leiden/utils.cjs +264 -274
- package/dist/_shared/lbug/schema-constants.d.ts +0 -16
- package/dist/_shared/lbug/schema-constants.d.ts.map +0 -1
- package/dist/_shared/lbug/schema-constants.js +0 -67
- package/dist/_shared/lbug/schema-constants.js.map +0 -1
- package/dist/core/graphstore/lbug-row-source.d.ts +0 -19
- package/dist/core/graphstore/lbug-row-source.js +0 -141
- package/dist/core/lbug/content-read.d.ts +0 -46
- package/dist/core/lbug/content-read.js +0 -64
- package/dist/core/lbug/csv-generator.d.ts +0 -29
- package/dist/core/lbug/csv-generator.js +0 -492
- package/dist/core/lbug/lbug-adapter.d.ts +0 -176
- package/dist/core/lbug/lbug-adapter.js +0 -1320
- package/dist/core/lbug/pool-adapter.d.ts +0 -93
- package/dist/core/lbug/pool-adapter.js +0 -550
- package/dist/core/lbug/schema.d.ts +0 -62
- package/dist/core/lbug/schema.js +0 -502
- package/dist/mcp/core/lbug-adapter.d.ts +0 -5
- package/dist/mcp/core/lbug-adapter.js +0 -5
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import{s as aa}from"./chunk-TU3PZOEN-RLyvLcv-.js";import{m as O,d as ra,q as Q,i as vt,p as it,b as ia,w as sa,C as D,e as ke,a as na,h as oa,s as la,l as ca,n as da,A as ha,j as pa,o as Ta,c as Bt,U as X,ag as J,ah as wt,r as Ea,f as ga,a8 as ve,ai as ua,O as $t,aj as ya,ak as Be}from"./index-BgeqpYgd.js";import{g as Oa,G as ae,u as pt,x as xa,h as re,E as ie}from"./chunk-O5ABG6QK-dHwHzA6n.js";var Qt=function(){var e=O(function(ht,S,A,_){for(A=A||{},_=ht.length;_--;A[ht[_]]=S);return A},"o"),t=[1,2],r=[1,3],a=[1,4],s=[2,4],n=[1,9],i=[1,11],l=[1,12],E=[1,14],h=[1,15],c=[1,17],x=[1,18],g=[1,19],m=[1,25],T=[1,26],u=[1,27],y=[1,28],b=[1,29],f=[1,30],R=[1,31],P=[1,32],w=[1,33],N=[1,34],Y=[1,35],C=[1,36],B=[1,37],H=[1,38],z=[1,39],U=[1,40],G=[1,42],q=[1,43],st=[1,44],tt=[1,45],nt=[1,46],$=[1,47],M=[1,4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,49,50,51,53,54,56,61,62,63,64,73],At=[1,74],L=[1,80],k=[1,81],et=[1,82],at=[1,83],W=[1,84],se=[1,85],ne=[1,86],oe=[1,87],le=[1,88],ce=[1,89],de=[1,90],he=[1,91],pe=[1,92],Te=[1,93],Ee=[1,94],ge=[1,95],ue=[1,96],ye=[1,97],Oe=[1,98],xe=[1,99],_e=[1,100],be=[1,101],Ie=[1,102],fe=[1,103],me=[1,104],Re=[1,105],Le=[2,78],Nt=[4,5,17,51,53,54],Pt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],Ne=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,50,51,53,54,56,61,62,63,64,73],qt=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,49,51,53,54,56,61,62,63,64,73],Se=[4,5,10,14,15,17,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,48,51,53,54,56,61,62,63,64,73],Ht=[5,52],F=[70,71,72,73],lt=[1,151],zt={trace:O(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,INVALID:10,box_section:11,box_line:12,participant_statement:13,create:14,box:15,restOfLine:16,end:17,signal:18,autonumber:19,NUM:20,off:21,activate:22,actor:23,deactivate:24,note_statement:25,links_statement:26,link_statement:27,properties_statement:28,details_statement:29,title:30,legacy_title:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,loop:37,rect:38,opt:39,alt:40,else_sections:41,par:42,par_sections:43,par_over:44,critical:45,option_sections:46,break:47,option:48,and:49,else:50,participant:51,AS:52,participant_actor:53,destroy:54,actor_with_config:55,note:56,placement:57,text2:58,over:59,actor_pair:60,links:61,link:62,properties:63,details:64,spaceList:65,",":66,left_of:67,right_of:68,signaltype:69,"+":70,"-":71,"()":72,ACTOR:73,config_object:74,CONFIG_START:75,CONFIG_CONTENT:76,CONFIG_END:77,SOLID_OPEN_ARROW:78,DOTTED_OPEN_ARROW:79,SOLID_ARROW:80,SOLID_ARROW_TOP:81,SOLID_ARROW_BOTTOM:82,STICK_ARROW_TOP:83,STICK_ARROW_BOTTOM:84,SOLID_ARROW_TOP_DOTTED:85,SOLID_ARROW_BOTTOM_DOTTED:86,STICK_ARROW_TOP_DOTTED:87,STICK_ARROW_BOTTOM_DOTTED:88,SOLID_ARROW_TOP_REVERSE:89,SOLID_ARROW_BOTTOM_REVERSE:90,STICK_ARROW_TOP_REVERSE:91,STICK_ARROW_BOTTOM_REVERSE:92,SOLID_ARROW_TOP_REVERSE_DOTTED:93,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:94,STICK_ARROW_TOP_REVERSE_DOTTED:95,STICK_ARROW_BOTTOM_REVERSE_DOTTED:96,BIDIRECTIONAL_SOLID_ARROW:97,DOTTED_ARROW:98,BIDIRECTIONAL_DOTTED_ARROW:99,SOLID_CROSS:100,DOTTED_CROSS:101,SOLID_POINT:102,DOTTED_POINT:103,TXT:104,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",10:"INVALID",14:"create",15:"box",16:"restOfLine",17:"end",19:"autonumber",20:"NUM",21:"off",22:"activate",24:"deactivate",30:"title",31:"legacy_title",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"loop",38:"rect",39:"opt",40:"alt",42:"par",44:"par_over",45:"critical",47:"break",48:"option",49:"and",50:"else",51:"participant",52:"AS",53:"participant_actor",54:"destroy",56:"note",59:"over",61:"links",62:"link",63:"properties",64:"details",66:",",67:"left_of",68:"right_of",70:"+",71:"-",72:"()",73:"ACTOR",75:"CONFIG_START",76:"CONFIG_CONTENT",77:"CONFIG_END",78:"SOLID_OPEN_ARROW",79:"DOTTED_OPEN_ARROW",80:"SOLID_ARROW",81:"SOLID_ARROW_TOP",82:"SOLID_ARROW_BOTTOM",83:"STICK_ARROW_TOP",84:"STICK_ARROW_BOTTOM",85:"SOLID_ARROW_TOP_DOTTED",86:"SOLID_ARROW_BOTTOM_DOTTED",87:"STICK_ARROW_TOP_DOTTED",88:"STICK_ARROW_BOTTOM_DOTTED",89:"SOLID_ARROW_TOP_REVERSE",90:"SOLID_ARROW_BOTTOM_REVERSE",91:"STICK_ARROW_TOP_REVERSE",92:"STICK_ARROW_BOTTOM_REVERSE",93:"SOLID_ARROW_TOP_REVERSE_DOTTED",94:"SOLID_ARROW_BOTTOM_REVERSE_DOTTED",95:"STICK_ARROW_TOP_REVERSE_DOTTED",96:"STICK_ARROW_BOTTOM_REVERSE_DOTTED",97:"BIDIRECTIONAL_SOLID_ARROW",98:"DOTTED_ARROW",99:"BIDIRECTIONAL_DOTTED_ARROW",100:"SOLID_CROSS",101:"DOTTED_CROSS",102:"SOLID_POINT",103:"DOTTED_POINT",104:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[8,1],[11,0],[11,2],[12,2],[12,1],[12,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[46,1],[46,4],[43,1],[43,4],[41,1],[41,4],[13,5],[13,3],[13,5],[13,3],[13,3],[13,5],[13,3],[13,5],[13,3],[25,4],[25,4],[26,3],[27,3],[28,3],[29,3],[65,2],[65,1],[60,3],[60,1],[57,1],[57,1],[18,5],[18,5],[18,5],[18,5],[18,6],[18,4],[55,2],[74,3],[23,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[69,1],[58,1]],performAction:O(function(ht,S,A,_,V,o,rt){var p=o.length-1;switch(V){case 3:return _.apply(o[p]),o[p];case 4:case 10:this.$=[];break;case 5:case 11:o[p-1].push(o[p]),this.$=o[p-1];break;case 6:case 7:case 12:case 13:this.$=o[p];break;case 8:case 9:case 14:this.$=[];break;case 16:o[p].type="createParticipant",this.$=o[p];break;case 17:o[p-1].unshift({type:"boxStart",boxData:_.parseBoxData(o[p-2])}),o[p-1].push({type:"boxEnd",boxText:o[p-2]}),this.$=o[p-1];break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(o[p-2]),sequenceIndexStep:Number(o[p-1]),sequenceVisible:!0,signalType:_.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceIndex:Number(o[p-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:_.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:_.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:_.LINETYPE.AUTONUMBER};break;case 23:this.$={type:"activeStart",signalType:_.LINETYPE.ACTIVE_START,actor:o[p-1].actor};break;case 24:this.$={type:"activeEnd",signalType:_.LINETYPE.ACTIVE_END,actor:o[p-1].actor};break;case 30:_.setDiagramTitle(o[p].substring(6)),this.$=o[p].substring(6);break;case 31:_.setDiagramTitle(o[p].substring(7)),this.$=o[p].substring(7);break;case 32:this.$=o[p].trim(),_.setAccTitle(this.$);break;case 33:case 34:this.$=o[p].trim(),_.setAccDescription(this.$);break;case 35:o[p-1].unshift({type:"loopStart",loopText:_.parseMessage(o[p-2]),signalType:_.LINETYPE.LOOP_START}),o[p-1].push({type:"loopEnd",loopText:o[p-2],signalType:_.LINETYPE.LOOP_END}),this.$=o[p-1];break;case 36:o[p-1].unshift({type:"rectStart",color:_.parseMessage(o[p-2]),signalType:_.LINETYPE.RECT_START}),o[p-1].push({type:"rectEnd",color:_.parseMessage(o[p-2]),signalType:_.LINETYPE.RECT_END}),this.$=o[p-1];break;case 37:o[p-1].unshift({type:"optStart",optText:_.parseMessage(o[p-2]),signalType:_.LINETYPE.OPT_START}),o[p-1].push({type:"optEnd",optText:_.parseMessage(o[p-2]),signalType:_.LINETYPE.OPT_END}),this.$=o[p-1];break;case 38:o[p-1].unshift({type:"altStart",altText:_.parseMessage(o[p-2]),signalType:_.LINETYPE.ALT_START}),o[p-1].push({type:"altEnd",signalType:_.LINETYPE.ALT_END}),this.$=o[p-1];break;case 39:o[p-1].unshift({type:"parStart",parText:_.parseMessage(o[p-2]),signalType:_.LINETYPE.PAR_START}),o[p-1].push({type:"parEnd",signalType:_.LINETYPE.PAR_END}),this.$=o[p-1];break;case 40:o[p-1].unshift({type:"parStart",parText:_.parseMessage(o[p-2]),signalType:_.LINETYPE.PAR_OVER_START}),o[p-1].push({type:"parEnd",signalType:_.LINETYPE.PAR_END}),this.$=o[p-1];break;case 41:o[p-1].unshift({type:"criticalStart",criticalText:_.parseMessage(o[p-2]),signalType:_.LINETYPE.CRITICAL_START}),o[p-1].push({type:"criticalEnd",signalType:_.LINETYPE.CRITICAL_END}),this.$=o[p-1];break;case 42:o[p-1].unshift({type:"breakStart",breakText:_.parseMessage(o[p-2]),signalType:_.LINETYPE.BREAK_START}),o[p-1].push({type:"breakEnd",optText:_.parseMessage(o[p-2]),signalType:_.LINETYPE.BREAK_END}),this.$=o[p-1];break;case 44:this.$=o[p-3].concat([{type:"option",optionText:_.parseMessage(o[p-1]),signalType:_.LINETYPE.CRITICAL_OPTION},o[p]]);break;case 46:this.$=o[p-3].concat([{type:"and",parText:_.parseMessage(o[p-1]),signalType:_.LINETYPE.PAR_AND},o[p]]);break;case 48:this.$=o[p-3].concat([{type:"else",altText:_.parseMessage(o[p-1]),signalType:_.LINETYPE.ALT_ELSE},o[p]]);break;case 49:o[p-3].draw="participant",o[p-3].type="addParticipant",o[p-3].description=_.parseMessage(o[p-1]),this.$=o[p-3];break;case 50:o[p-1].draw="participant",o[p-1].type="addParticipant",this.$=o[p-1];break;case 51:o[p-3].draw="actor",o[p-3].type="addParticipant",o[p-3].description=_.parseMessage(o[p-1]),this.$=o[p-3];break;case 52:case 57:o[p-1].draw="actor",o[p-1].type="addParticipant",this.$=o[p-1];break;case 53:o[p-1].type="destroyParticipant",this.$=o[p-1];break;case 54:o[p-3].draw="participant",o[p-3].type="addParticipant",o[p-3].description=_.parseMessage(o[p-1]),this.$=o[p-3];break;case 55:o[p-1].draw="participant",o[p-1].type="addParticipant",this.$=o[p-1];break;case 56:o[p-3].draw="actor",o[p-3].type="addParticipant",o[p-3].description=_.parseMessage(o[p-1]),this.$=o[p-3];break;case 58:this.$=[o[p-1],{type:"addNote",placement:o[p-2],actor:o[p-1].actor,text:o[p]}];break;case 59:o[p-2]=[].concat(o[p-1],o[p-1]).slice(0,2),o[p-2][0]=o[p-2][0].actor,o[p-2][1]=o[p-2][1].actor,this.$=[o[p-1],{type:"addNote",placement:_.PLACEMENT.OVER,actor:o[p-2].slice(0,2),text:o[p]}];break;case 60:this.$=[o[p-1],{type:"addLinks",actor:o[p-1].actor,text:o[p]}];break;case 61:this.$=[o[p-1],{type:"addALink",actor:o[p-1].actor,text:o[p]}];break;case 62:this.$=[o[p-1],{type:"addProperties",actor:o[p-1].actor,text:o[p]}];break;case 63:this.$=[o[p-1],{type:"addDetails",actor:o[p-1].actor,text:o[p]}];break;case 66:this.$=[o[p-2],o[p]];break;case 67:this.$=o[p];break;case 68:this.$=_.PLACEMENT.LEFTOF;break;case 69:this.$=_.PLACEMENT.RIGHTOF;break;case 70:this.$=[o[p-4],o[p-1],{type:"addMessage",from:o[p-4].actor,to:o[p-1].actor,signalType:o[p-3],msg:o[p],activate:!0},{type:"activeStart",signalType:_.LINETYPE.ACTIVE_START,actor:o[p-1].actor}];break;case 71:this.$=[o[p-4],o[p-1],{type:"addMessage",from:o[p-4].actor,to:o[p-1].actor,signalType:o[p-3],msg:o[p]},{type:"activeEnd",signalType:_.LINETYPE.ACTIVE_END,actor:o[p-4].actor}];break;case 72:this.$=[o[p-4],o[p-1],{type:"addMessage",from:o[p-4].actor,to:o[p-1].actor,signalType:o[p-3],msg:o[p],activate:!0,centralConnection:_.LINETYPE.CENTRAL_CONNECTION},{type:"centralConnection",signalType:_.LINETYPE.CENTRAL_CONNECTION,actor:o[p-1].actor}];break;case 73:this.$=[o[p-4],o[p-1],{type:"addMessage",from:o[p-4].actor,to:o[p-1].actor,signalType:o[p-2],msg:o[p],activate:!1,centralConnection:_.LINETYPE.CENTRAL_CONNECTION_REVERSE},{type:"centralConnectionReverse",signalType:_.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:o[p-4].actor}];break;case 74:this.$=[o[p-5],o[p-1],{type:"addMessage",from:o[p-5].actor,to:o[p-1].actor,signalType:o[p-3],msg:o[p],activate:!0,centralConnection:_.LINETYPE.CENTRAL_CONNECTION_DUAL},{type:"centralConnection",signalType:_.LINETYPE.CENTRAL_CONNECTION,actor:o[p-1].actor},{type:"centralConnectionReverse",signalType:_.LINETYPE.CENTRAL_CONNECTION_REVERSE,actor:o[p-5].actor}];break;case 75:this.$=[o[p-3],o[p-1],{type:"addMessage",from:o[p-3].actor,to:o[p-1].actor,signalType:o[p-2],msg:o[p]}];break;case 76:this.$={type:"addParticipant",actor:o[p-1],config:o[p]};break;case 77:this.$=o[p-1].trim();break;case 78:this.$={type:"addParticipant",actor:o[p]};break;case 79:this.$=_.LINETYPE.SOLID_OPEN;break;case 80:this.$=_.LINETYPE.DOTTED_OPEN;break;case 81:this.$=_.LINETYPE.SOLID;break;case 82:this.$=_.LINETYPE.SOLID_TOP;break;case 83:this.$=_.LINETYPE.SOLID_BOTTOM;break;case 84:this.$=_.LINETYPE.STICK_TOP;break;case 85:this.$=_.LINETYPE.STICK_BOTTOM;break;case 86:this.$=_.LINETYPE.SOLID_TOP_DOTTED;break;case 87:this.$=_.LINETYPE.SOLID_BOTTOM_DOTTED;break;case 88:this.$=_.LINETYPE.STICK_TOP_DOTTED;break;case 89:this.$=_.LINETYPE.STICK_BOTTOM_DOTTED;break;case 90:this.$=_.LINETYPE.SOLID_ARROW_TOP_REVERSE;break;case 91:this.$=_.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE;break;case 92:this.$=_.LINETYPE.STICK_ARROW_TOP_REVERSE;break;case 93:this.$=_.LINETYPE.STICK_ARROW_BOTTOM_REVERSE;break;case 94:this.$=_.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED;break;case 95:this.$=_.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED;break;case 96:this.$=_.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED;break;case 97:this.$=_.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED;break;case 98:this.$=_.LINETYPE.BIDIRECTIONAL_SOLID;break;case 99:this.$=_.LINETYPE.DOTTED;break;case 100:this.$=_.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 101:this.$=_.LINETYPE.SOLID_CROSS;break;case 102:this.$=_.LINETYPE.DOTTED_CROSS;break;case 103:this.$=_.LINETYPE.SOLID_POINT;break;case 104:this.$=_.LINETYPE.DOTTED_POINT;break;case 105:this.$=_.parseMessage(o[p].trim().substring(1));break}},"anonymous"),table:[{3:1,4:t,5:r,6:a},{1:[3]},{3:5,4:t,5:r,6:a},{3:6,4:t,5:r,6:a},e([1,4,5,10,14,15,19,22,24,30,31,32,34,36,37,38,39,40,42,44,45,47,51,53,54,56,61,62,63,64,73],s,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:n,5:i,8:8,9:10,10:l,13:13,14:E,15:h,18:16,19:c,22:x,23:41,24:g,25:20,26:21,27:22,28:23,29:24,30:m,31:T,32:u,34:y,36:b,37:f,38:R,39:P,40:w,42:N,44:Y,45:C,47:B,51:H,53:z,54:U,56:G,61:q,62:st,63:tt,64:nt,73:$},e(M,[2,5]),{9:48,13:13,14:E,15:h,18:16,19:c,22:x,23:41,24:g,25:20,26:21,27:22,28:23,29:24,30:m,31:T,32:u,34:y,36:b,37:f,38:R,39:P,40:w,42:N,44:Y,45:C,47:B,51:H,53:z,54:U,56:G,61:q,62:st,63:tt,64:nt,73:$},e(M,[2,7]),e(M,[2,8]),e(M,[2,9]),e(M,[2,15]),{13:49,51:H,53:z,54:U},{16:[1,50]},{5:[1,51]},{5:[1,54],20:[1,52],21:[1,53]},{23:55,73:$},{23:56,73:$},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},{5:[1,61]},e(M,[2,30]),e(M,[2,31]),{33:[1,62]},{35:[1,63]},e(M,[2,34]),{16:[1,64]},{16:[1,65]},{16:[1,66]},{16:[1,67]},{16:[1,68]},{16:[1,69]},{16:[1,70]},{16:[1,71]},{23:72,55:73,73:At},{23:75,55:76,73:At},{23:77,73:$},{69:78,72:[1,79],78:L,79:k,80:et,81:at,82:W,83:se,84:ne,85:oe,86:le,87:ce,88:de,89:he,90:pe,91:Te,92:Ee,93:ge,94:ue,95:ye,96:Oe,97:xe,98:_e,99:be,100:Ie,101:fe,102:me,103:Re},{57:106,59:[1,107],67:[1,108],68:[1,109]},{23:110,73:$},{23:111,73:$},{23:112,73:$},{23:113,73:$},e([5,66,72,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104],Le),e(M,[2,6]),e(M,[2,16]),e(Nt,[2,10],{11:114}),e(M,[2,18]),{5:[1,116],20:[1,115]},{5:[1,117]},e(M,[2,22]),{5:[1,118]},{5:[1,119]},e(M,[2,25]),e(M,[2,26]),e(M,[2,27]),e(M,[2,28]),e(M,[2,29]),e(M,[2,32]),e(M,[2,33]),e(Pt,s,{7:120}),e(Pt,s,{7:121}),e(Pt,s,{7:122}),e(Ne,s,{41:123,7:124}),e(qt,s,{43:125,7:126}),e(qt,s,{7:126,43:127}),e(Se,s,{46:128,7:129}),e(Pt,s,{7:130}),{5:[1,132],52:[1,131]},{5:[1,134],52:[1,133]},e(Ht,Le,{74:135,75:[1,136]}),{5:[1,138],52:[1,137]},{5:[1,140],52:[1,139]},{5:[1,141]},{23:145,70:[1,142],71:[1,143],72:[1,144],73:$},{69:146,78:L,79:k,80:et,81:at,82:W,83:se,84:ne,85:oe,86:le,87:ce,88:de,89:he,90:pe,91:Te,92:Ee,93:ge,94:ue,95:ye,96:Oe,97:xe,98:_e,99:be,100:Ie,101:fe,102:me,103:Re},e(F,[2,79]),e(F,[2,80]),e(F,[2,81]),e(F,[2,82]),e(F,[2,83]),e(F,[2,84]),e(F,[2,85]),e(F,[2,86]),e(F,[2,87]),e(F,[2,88]),e(F,[2,89]),e(F,[2,90]),e(F,[2,91]),e(F,[2,92]),e(F,[2,93]),e(F,[2,94]),e(F,[2,95]),e(F,[2,96]),e(F,[2,97]),e(F,[2,98]),e(F,[2,99]),e(F,[2,100]),e(F,[2,101]),e(F,[2,102]),e(F,[2,103]),e(F,[2,104]),{23:147,73:$},{23:149,60:148,73:$},{73:[2,68]},{73:[2,69]},{58:150,104:lt},{58:152,104:lt},{58:153,104:lt},{58:154,104:lt},{4:[1,157],5:[1,159],12:156,13:158,17:[1,155],51:H,53:z,54:U},{5:[1,160]},e(M,[2,20]),e(M,[2,21]),e(M,[2,23]),e(M,[2,24]),{4:n,5:i,8:8,9:10,10:l,13:13,14:E,15:h,17:[1,161],18:16,19:c,22:x,23:41,24:g,25:20,26:21,27:22,28:23,29:24,30:m,31:T,32:u,34:y,36:b,37:f,38:R,39:P,40:w,42:N,44:Y,45:C,47:B,51:H,53:z,54:U,56:G,61:q,62:st,63:tt,64:nt,73:$},{4:n,5:i,8:8,9:10,10:l,13:13,14:E,15:h,17:[1,162],18:16,19:c,22:x,23:41,24:g,25:20,26:21,27:22,28:23,29:24,30:m,31:T,32:u,34:y,36:b,37:f,38:R,39:P,40:w,42:N,44:Y,45:C,47:B,51:H,53:z,54:U,56:G,61:q,62:st,63:tt,64:nt,73:$},{4:n,5:i,8:8,9:10,10:l,13:13,14:E,15:h,17:[1,163],18:16,19:c,22:x,23:41,24:g,25:20,26:21,27:22,28:23,29:24,30:m,31:T,32:u,34:y,36:b,37:f,38:R,39:P,40:w,42:N,44:Y,45:C,47:B,51:H,53:z,54:U,56:G,61:q,62:st,63:tt,64:nt,73:$},{17:[1,164]},{4:n,5:i,8:8,9:10,10:l,13:13,14:E,15:h,17:[2,47],18:16,19:c,22:x,23:41,24:g,25:20,26:21,27:22,28:23,29:24,30:m,31:T,32:u,34:y,36:b,37:f,38:R,39:P,40:w,42:N,44:Y,45:C,47:B,50:[1,165],51:H,53:z,54:U,56:G,61:q,62:st,63:tt,64:nt,73:$},{17:[1,166]},{4:n,5:i,8:8,9:10,10:l,13:13,14:E,15:h,17:[2,45],18:16,19:c,22:x,23:41,24:g,25:20,26:21,27:22,28:23,29:24,30:m,31:T,32:u,34:y,36:b,37:f,38:R,39:P,40:w,42:N,44:Y,45:C,47:B,49:[1,167],51:H,53:z,54:U,56:G,61:q,62:st,63:tt,64:nt,73:$},{17:[1,168]},{17:[1,169]},{4:n,5:i,8:8,9:10,10:l,13:13,14:E,15:h,17:[2,43],18:16,19:c,22:x,23:41,24:g,25:20,26:21,27:22,28:23,29:24,30:m,31:T,32:u,34:y,36:b,37:f,38:R,39:P,40:w,42:N,44:Y,45:C,47:B,48:[1,170],51:H,53:z,54:U,56:G,61:q,62:st,63:tt,64:nt,73:$},{4:n,5:i,8:8,9:10,10:l,13:13,14:E,15:h,17:[1,171],18:16,19:c,22:x,23:41,24:g,25:20,26:21,27:22,28:23,29:24,30:m,31:T,32:u,34:y,36:b,37:f,38:R,39:P,40:w,42:N,44:Y,45:C,47:B,51:H,53:z,54:U,56:G,61:q,62:st,63:tt,64:nt,73:$},{16:[1,172]},e(M,[2,50]),{16:[1,173]},e(M,[2,55]),e(Ht,[2,76]),{76:[1,174]},{16:[1,175]},e(M,[2,52]),{16:[1,176]},e(M,[2,57]),e(M,[2,53]),{23:177,73:$},{23:178,73:$},{23:179,73:$},{58:180,104:lt},{23:181,72:[1,182],73:$},{58:183,104:lt},{58:184,104:lt},{66:[1,185],104:[2,67]},{5:[2,60]},{5:[2,105]},{5:[2,61]},{5:[2,62]},{5:[2,63]},e(M,[2,17]),e(Nt,[2,11]),{13:186,51:H,53:z,54:U},e(Nt,[2,13]),e(Nt,[2,14]),e(M,[2,19]),e(M,[2,35]),e(M,[2,36]),e(M,[2,37]),e(M,[2,38]),{16:[1,187]},e(M,[2,39]),{16:[1,188]},e(M,[2,40]),e(M,[2,41]),{16:[1,189]},e(M,[2,42]),{5:[1,190]},{5:[1,191]},{77:[1,192]},{5:[1,193]},{5:[1,194]},{58:195,104:lt},{58:196,104:lt},{58:197,104:lt},{5:[2,75]},{58:198,104:lt},{23:199,73:$},{5:[2,58]},{5:[2,59]},{23:200,73:$},e(Nt,[2,12]),e(Ne,s,{7:124,41:201}),e(qt,s,{7:126,43:202}),e(Se,s,{7:129,46:203}),e(M,[2,49]),e(M,[2,54]),e(Ht,[2,77]),e(M,[2,51]),e(M,[2,56]),{5:[2,70]},{5:[2,71]},{5:[2,72]},{5:[2,73]},{58:204,104:lt},{104:[2,66]},{17:[2,48]},{17:[2,46]},{17:[2,44]},{5:[2,74]}],defaultActions:{5:[2,1],6:[2,2],108:[2,68],109:[2,69],150:[2,60],151:[2,105],152:[2,61],153:[2,62],154:[2,63],180:[2,75],183:[2,58],184:[2,59],195:[2,70],196:[2,71],197:[2,72],198:[2,73],200:[2,66],201:[2,48],202:[2,46],203:[2,44],204:[2,74]},parseError:O(function(ht,S){if(S.recoverable)this.trace(ht);else{var A=new Error(ht);throw A.hash=S,A}},"parseError"),parse:O(function(ht){var S=this,A=[0],_=[],V=[null],o=[],rt=this.table,p="",kt=0,we=0,Je=0,Ze=2,Ae=1,Qe=o.slice.call(arguments,1),j=Object.create(this.lexer),Ot={yy:{}};for(var Ut in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ut)&&(Ot.yy[Ut]=this.yy[Ut]);j.setInput(ht,Ot.yy),Ot.yy.lexer=j,Ot.yy.parser=this,typeof j.yylloc>"u"&&(j.yylloc={});var jt=j.yylloc;o.push(jt);var ta=j.options&&j.options.ranges;typeof Ot.yy.parseError=="function"?this.parseError=Ot.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ea(ot){A.length=A.length-2*ot,V.length=V.length-ot,o.length=o.length-ot}O(ea,"popStack");function Pe(){var ot;return ot=_.pop()||j.lex()||Ae,typeof ot!="number"&&(ot instanceof Array&&(_=ot,ot=_.pop()),ot=S.symbols_[ot]||ot),ot}O(Pe,"lex");for(var Z,Xt,xt,ct,Tr,Gt,ft={},Mt,Tt,De,Ct;;){if(xt=A[A.length-1],this.defaultActions[xt]?ct=this.defaultActions[xt]:((Z===null||typeof Z>"u")&&(Z=Pe()),ct=rt[xt]&&rt[xt][Z]),typeof ct>"u"||!ct.length||!ct[0]){var Jt="";Ct=[];for(Mt in rt[xt])this.terminals_[Mt]&&Mt>Ze&&Ct.push("'"+this.terminals_[Mt]+"'");j.showPosition?Jt="Parse error on line "+(kt+1)+`:
|
|
2
|
+
`+j.showPosition()+`
|
|
3
|
+
Expecting `+Ct.join(", ")+", got '"+(this.terminals_[Z]||Z)+"'":Jt="Parse error on line "+(kt+1)+": Unexpected "+(Z==Ae?"end of input":"'"+(this.terminals_[Z]||Z)+"'"),this.parseError(Jt,{text:j.match,token:this.terminals_[Z]||Z,line:j.yylineno,loc:jt,expected:Ct})}if(ct[0]instanceof Array&&ct.length>1)throw new Error("Parse Error: multiple actions possible at state: "+xt+", token: "+Z);switch(ct[0]){case 1:A.push(Z),V.push(j.yytext),o.push(j.yylloc),A.push(ct[1]),Z=null,Xt?(Z=Xt,Xt=null):(we=j.yyleng,p=j.yytext,kt=j.yylineno,jt=j.yylloc,Je>0);break;case 2:if(Tt=this.productions_[ct[1]][1],ft.$=V[V.length-Tt],ft._$={first_line:o[o.length-(Tt||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(Tt||1)].first_column,last_column:o[o.length-1].last_column},ta&&(ft._$.range=[o[o.length-(Tt||1)].range[0],o[o.length-1].range[1]]),Gt=this.performAction.apply(ft,[p,we,kt,Ot.yy,ct[1],V,o].concat(Qe)),typeof Gt<"u")return Gt;Tt&&(A=A.slice(0,-1*Tt*2),V=V.slice(0,-1*Tt),o=o.slice(0,-1*Tt)),A.push(this.productions_[ct[1]][0]),V.push(ft.$),o.push(ft._$),De=rt[A[A.length-2]][A[A.length-1]],A.push(De);break;case 3:return!0}}return!0},"parse")},Ge=function(){var ht={EOF:1,parseError:O(function(S,A){if(this.yy.parser)this.yy.parser.parseError(S,A);else throw new Error(S)},"parseError"),setInput:O(function(S,A){return this.yy=A||this.yy||{},this._input=S,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 S=this._input[0];this.yytext+=S,this.yyleng++,this.offset++,this.match+=S,this.matched+=S;var A=S.match(/(?:\r\n?|\n).*/g);return A?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),S},"input"),unput:O(function(S){var A=S.length,_=S.split(/(?:\r\n?|\n)/g);this._input=S+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-A),this.offset-=A;var V=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),_.length-1&&(this.yylineno-=_.length-1);var o=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:_?(_.length===V.length?this.yylloc.first_column:0)+V[V.length-_.length].length-_[0].length:this.yylloc.first_column-A},this.options.ranges&&(this.yylloc.range=[o[0],o[0]+this.yyleng-A]),this.yyleng=this.yytext.length,this},"unput"),more:O(function(){return this._more=!0,this},"more"),reject:O(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:O(function(S){this.unput(this.match.slice(S))},"less"),pastInput:O(function(){var S=this.matched.substr(0,this.matched.length-this.match.length);return(S.length>20?"...":"")+S.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:O(function(){var S=this.match;return S.length<20&&(S+=this._input.substr(0,20-S.length)),(S.substr(0,20)+(S.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:O(function(){var S=this.pastInput(),A=new Array(S.length+1).join("-");return S+this.upcomingInput()+`
|
|
5
|
+
`+A+"^"},"showPosition"),test_match:O(function(S,A){var _,V,o;if(this.options.backtrack_lexer&&(o={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&&(o.yylloc.range=this.yylloc.range.slice(0))),V=S[0].match(/(?:\r\n?|\n).*/g),V&&(this.yylineno+=V.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:V?V[V.length-1].length-V[V.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+S[0].length},this.yytext+=S[0],this.match+=S[0],this.matches=S,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(S[0].length),this.matched+=S[0],_=this.performAction.call(this,this.yy,this,A,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),_)return _;if(this._backtrack){for(var rt in o)this[rt]=o[rt];return!1}return!1},"test_match"),next:O(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var S,A,_,V;this._more||(this.yytext="",this.match="");for(var o=this._currentRules(),rt=0;rt<o.length;rt++)if(_=this._input.match(this.rules[o[rt]]),_&&(!A||_[0].length>A[0].length)){if(A=_,V=rt,this.options.backtrack_lexer){if(S=this.test_match(_,o[rt]),S!==!1)return S;if(this._backtrack){A=!1;continue}else return!1}else if(!this.options.flex)break}return A?(S=this.test_match(A,o[V]),S!==!1?S:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:O(function(){var S=this.next();return S||this.lex()},"lex"),begin:O(function(S){this.conditionStack.push(S)},"begin"),popState:O(function(){var S=this.conditionStack.length-1;return S>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(S){return S=this.conditionStack.length-1-Math.abs(S||0),S>=0?this.conditionStack[S]:"INITIAL"},"topState"),pushState:O(function(S){this.begin(S)},"pushState"),stateStackSize:O(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:O(function(S,A,_,V){switch(_){case 0:return 5;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 20;case 7:return this.begin("CONFIG"),75;case 8:return 76;case 9:return this.popState(),this.begin("ALIAS"),77;case 10:return this.popState(),this.popState(),77;case 11:return A.yytext=A.yytext.trim(),73;case 12:return A.yytext=A.yytext.trim(),this.begin("ALIAS"),73;case 13:return A.yytext=A.yytext.trim(),this.popState(),73;case 14:return this.popState(),10;case 15:return A.yytext=A.yytext.trim(),this.popState(),10;case 16:return this.begin("LINE"),15;case 17:return this.begin("ID"),51;case 18:return this.begin("ID"),53;case 19:return 14;case 20:return this.begin("ID"),54;case 21:return this.popState(),this.popState(),this.begin("LINE"),52;case 22:return this.popState(),this.popState(),5;case 23:return this.begin("LINE"),37;case 24:return this.begin("LINE"),38;case 25:return this.begin("LINE"),39;case 26:return this.begin("LINE"),40;case 27:return this.begin("LINE"),50;case 28:return this.begin("LINE"),42;case 29:return this.begin("LINE"),44;case 30:return this.begin("LINE"),49;case 31:return this.begin("LINE"),45;case 32:return this.begin("LINE"),48;case 33:return this.begin("LINE"),47;case 34:return this.popState(),16;case 35:return 17;case 36:return 67;case 37:return 68;case 38:return 61;case 39:return 62;case 40:return 63;case 41:return 64;case 42:return 59;case 43:return 56;case 44:return this.begin("ID"),22;case 45:return this.begin("ID"),24;case 46:return 30;case 47:return 31;case 48:return this.begin("acc_title"),32;case 49:return this.popState(),"acc_title_value";case 50:return this.begin("acc_descr"),34;case 51:return this.popState(),"acc_descr_value";case 52:this.begin("acc_descr_multiline");break;case 53:this.popState();break;case 54:return"acc_descr_multiline_value";case 55:return 6;case 56:return 19;case 57:return 21;case 58:return 66;case 59:return 5;case 60:return A.yytext=A.yytext.trim(),73;case 61:return 80;case 62:return 97;case 63:return 98;case 64:return 99;case 65:return 78;case 66:return 79;case 67:return 100;case 68:return 101;case 69:return 102;case 70:return 103;case 71:return 85;case 72:return 86;case 73:return 87;case 74:return 88;case 75:return 93;case 76:return 94;case 77:return 95;case 78:return 96;case 79:return 81;case 80:return 82;case 81:return 83;case 82:return 84;case 83:return 89;case 84:return 90;case 85:return 91;case 86:return 92;case 87:return 104;case 88:return 104;case 89:return 70;case 90:return 71;case 91:return 72;case 92:return 5;case 93:return 10}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\}(?=\s+as\s))/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^<>:\n,;@\s]+(?=\s+as\s))/i,/^(?:[^<>:\n,;@]+(?=\s*[\n;#]|$))/i,/^(?:[^<>:\n,;@]*<[^\n]*)/i,/^(?:[^\n]+)/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\/\\\+\()\+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)|-\|\\|-\\|-\/|-\/\/|-\|\/|\/\|-|\\\|-|\/\/-|\\\\-|\/\|-|--\|\\|--|\(\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?:--\|\\)/i,/^(?:--\|\/)/i,/^(?:--\\\\)/i,/^(?:--\/\/)/i,/^(?:\/\|--)/i,/^(?:\\\|--)/i,/^(?:\/\/--)/i,/^(?:\\\\--)/i,/^(?:-\|\\)/i,/^(?:-\|\/)/i,/^(?:-\\\\)/i,/^(?:-\/\/)/i,/^(?:\/\|-)/i,/^(?:\\\|-)/i,/^(?:\/\/-)/i,/^(?:\\\\-)/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:\(\))/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[53,54],inclusive:!1},acc_descr:{rules:[51],inclusive:!1},acc_title:{rules:[49],inclusive:!1},ID:{rules:[2,3,7,11,12,13,14,15],inclusive:!1},ALIAS:{rules:[2,3,21,22],inclusive:!1},LINE:{rules:[2,3,34],inclusive:!1},CONFIG:{rules:[8,9,10],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,16,17,18,19,20,23,24,25,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,47,48,50,52,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93],inclusive:!0}}};return ht}();zt.lexer=Ge;function Dt(){this.yy={}}return O(Dt,"Parser"),Dt.prototype=zt,zt.Parser=Dt,new Dt}();Qt.parser=Qt;var _a=Qt,ba={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34,SOLID_TOP:41,SOLID_BOTTOM:42,STICK_TOP:43,STICK_BOTTOM:44,SOLID_ARROW_TOP_REVERSE:45,SOLID_ARROW_BOTTOM_REVERSE:46,STICK_ARROW_TOP_REVERSE:47,STICK_ARROW_BOTTOM_REVERSE:48,SOLID_TOP_DOTTED:51,SOLID_BOTTOM_DOTTED:52,STICK_TOP_DOTTED:53,STICK_BOTTOM_DOTTED:54,SOLID_ARROW_TOP_REVERSE_DOTTED:55,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:56,STICK_ARROW_TOP_REVERSE_DOTTED:57,STICK_ARROW_BOTTOM_REVERSE_DOTTED:58,CENTRAL_CONNECTION:59,CENTRAL_CONNECTION_REVERSE:60,CENTRAL_CONNECTION_DUAL:61},Ia={FILLED:0,OPEN:1},fa={LEFTOF:0,RIGHTOF:1,OVER:2},Yt={ACTOR:"actor",CONTROL:"control",DATABASE:"database",ENTITY:"entity"},Rt,ma=(Rt=class{constructor(){this.state=new aa(()=>({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=ke,this.setAccDescription=na,this.setDiagramTitle=oa,this.getAccTitle=la,this.getAccDescription=ca,this.getDiagramTitle=da,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(Q().wrap),this.LINETYPE=ba,this.ARROWTYPE=Ia,this.PLACEMENT=fa}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,r,a,s,n){let i=this.state.records.currentBox,l;if(n!==void 0){let h;n.includes(`
|
|
7
|
+
`)?h=n+`
|
|
8
|
+
`:h=`{
|
|
9
|
+
`+n+`
|
|
10
|
+
}`,l=ha(h,{schema:pa})}s=(l==null?void 0:l.type)??s,l!=null&&l.alias&&(!a||a.text===r)&&(a={text:l.alias,wrap:a==null?void 0:a.wrap,type:s});let E=this.state.records.actors.get(t);if(E){if(this.state.records.currentBox&&E.box&&this.state.records.currentBox!==E.box)throw new Error(`A same participant should only be defined in one Box: ${E.name} can't be in '${E.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(i=E.box?E.box:this.state.records.currentBox,E.box=i,E&&r===E.name&&a==null)return}if((a==null?void 0:a.text)==null&&(a={text:r,type:s}),(s==null||a.text==null)&&(a={text:r,type:s}),this.state.records.actors.set(t,{box:i,name:r,description:a.text,wrap:a.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:s??"participant"}),this.state.records.prevActor){let h=this.state.records.actors.get(this.state.records.prevActor);h&&(h.nextActor=t)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(t),this.state.records.prevActor=t}activationCount(t){let r,a=0;if(!t)return 0;for(r=0;r<this.state.records.messages.length;r++)this.state.records.messages[r].type===this.LINETYPE.ACTIVE_START&&this.state.records.messages[r].from===t&&a++,this.state.records.messages[r].type===this.LINETYPE.ACTIVE_END&&this.state.records.messages[r].from===t&&a--;return a}addMessage(t,r,a,s){this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:r,message:a.text,wrap:a.wrap??this.autoWrap(),answer:s})}addSignal(t,r,a,s,n=!1,i){if(s===this.LINETYPE.ACTIVE_END&&this.activationCount(t??"")<1){let l=new Error("Trying to inactivate an inactive participant ("+t+")");throw l.hash={text:"->>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},l}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:r,message:(a==null?void 0:a.text)??"",wrap:(a==null?void 0:a.wrap)??this.autoWrap(),type:s,activate:n,centralConnection:i??0}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(t=>t.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(t){return this.state.records.actors.get(t)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(t){this.state.records.wrapEnabled=t}extractWrap(t){if(t===void 0)return{};t=t.trim();let r=/^:?wrap:/.exec(t)!==null?!0:/^:?nowrap:/.exec(t)!==null?!1:void 0;return{cleanedText:(r===void 0?t:t.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:r}}autoWrap(){var t;return this.state.records.wrapEnabled!==void 0?this.state.records.wrapEnabled:((t=Q().sequence)==null?void 0:t.wrap)??!1}clear(){this.state.reset(),Ta()}parseMessage(t){let r=t.trim(),{wrap:a,cleanedText:s}=this.extractWrap(r),n={text:s,wrap:a};return it.debug(`parseMessage: ${JSON.stringify(n)}`),n}parseBoxData(t){let r=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t),a=r!=null&&r[1]?r[1].trim():"transparent",s=r!=null&&r[2]?r[2].trim():void 0;if(window!=null&&window.CSS)window.CSS.supports("color",a)||(a="transparent",s=t.trim());else{let l=new Option().style;l.color=a,l.color!==a&&(a="transparent",s=t.trim())}let{wrap:n,cleanedText:i}=this.extractWrap(s);return{text:i?Bt(i,Q()):void 0,color:a,wrap:n}}addNote(t,r,a){let s={actor:t,placement:r,message:a.text,wrap:a.wrap??this.autoWrap()},n=[].concat(t,t);this.state.records.notes.push(s),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:n[0],to:n[1],message:a.text,wrap:a.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:r})}addLinks(t,r){let a=this.getActor(t);try{let s=Bt(r.text,Q());s=s.replace(/=/g,"="),s=s.replace(/&/g,"&");let n=JSON.parse(s);this.insertLinks(a,n)}catch(s){it.error("error while parsing actor link text",s)}}addALink(t,r){let a=this.getActor(t);try{let s={},n=Bt(r.text,Q()),i=n.indexOf("@");n=n.replace(/=/g,"="),n=n.replace(/&/g,"&");let l=n.slice(0,i-1).trim(),E=n.slice(i+1).trim();s[l]=E,this.insertLinks(a,s)}catch(s){it.error("error while parsing actor link text",s)}}insertLinks(t,r){if(t.links==null)t.links=r;else for(let a in r)t.links[a]=r[a]}addProperties(t,r){let a=this.getActor(t);try{let s=Bt(r.text,Q()),n=JSON.parse(s);this.insertProperties(a,n)}catch(s){it.error("error while parsing actor properties text",s)}}insertProperties(t,r){if(t.properties==null)t.properties=r;else for(let a in r)t.properties[a]=r[a]}boxEnd(){this.state.records.currentBox=void 0}addDetails(t,r){let a=this.getActor(t),s=document.getElementById(r.text);try{let n=s.innerHTML,i=JSON.parse(n);i.properties&&this.insertProperties(a,i.properties),i.links&&this.insertLinks(a,i.links)}catch(n){it.error("error while parsing actor details text",n)}}getActorProperty(t,r){if((t==null?void 0:t.properties)!==void 0)return t.properties[r]}apply(t){if(Array.isArray(t))t.forEach(r=>{this.apply(r)});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":this.addSignal(t.actor,void 0,void 0,t.signalType);break;case"centralConnection":this.addSignal(t.actor,void 0,void 0,t.signalType);break;case"centralConnectionReverse":this.addSignal(t.actor,void 0,void 0,t.signalType);break;case"activeEnd":this.addSignal(t.actor,void 0,void 0,t.signalType);break;case"addNote":this.addNote(t.actor,t.placement,t.text);break;case"addLinks":this.addLinks(t.actor,t.text);break;case"addALink":this.addALink(t.actor,t.text);break;case"addProperties":this.addProperties(t.actor,t.text);break;case"addDetails":this.addDetails(t.actor,t.text);break;case"addMessage":if(this.state.records.lastCreated){if(t.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(t.to!==this.state.records.lastDestroyed&&t.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(t.from,t.to,t.msg,t.signalType,t.activate,t.centralConnection);break;case"boxStart":this.addBox(t.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":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"rectEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"optStart":this.addSignal(void 0,void 0,t.optText,t.signalType);break;case"optEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"altStart":this.addSignal(void 0,void 0,t.altText,t.signalType);break;case"else":this.addSignal(void 0,void 0,t.altText,t.signalType);break;case"altEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"setAccTitle":ke(t.text);break;case"parStart":this.addSignal(void 0,void 0,t.parText,t.signalType);break;case"and":this.addSignal(void 0,void 0,t.parText,t.signalType);break;case"parEnd":this.addSignal(void 0,void 0,void 0,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"criticalEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"breakStart":this.addSignal(void 0,void 0,t.breakText,t.signalType);break;case"breakEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break}}getConfig(){return Q().sequence}},O(Rt,"SequenceDB"),Rt),Ra=O(e=>{let t=e.dropShadow??"none",{look:r}=Q();return`.actor {
|
|
11
|
+
stroke: ${e.actorBorder};
|
|
12
|
+
fill: ${e.actorBkg};
|
|
13
|
+
stroke-width: ${e.strokeWidth??1};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
rect.actor.outer-path[data-look="neo"] {
|
|
17
|
+
filter: ${t};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
rect.note[data-look="neo"] {
|
|
21
|
+
stroke:${e.noteBorderColor};
|
|
22
|
+
fill:${e.noteBkgColor};
|
|
23
|
+
filter: ${t};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
text.actor > tspan {
|
|
27
|
+
fill: ${e.actorTextColor};
|
|
28
|
+
stroke: none;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.actor-line {
|
|
32
|
+
stroke: ${e.actorLineColor};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.innerArc {
|
|
36
|
+
stroke-width: 1.5;
|
|
37
|
+
stroke-dasharray: none;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.messageLine0 {
|
|
41
|
+
stroke-width: 1.5;
|
|
42
|
+
stroke-dasharray: none;
|
|
43
|
+
stroke: ${e.signalColor};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.messageLine1 {
|
|
47
|
+
stroke-width: 1.5;
|
|
48
|
+
stroke-dasharray: 2, 2;
|
|
49
|
+
stroke: ${e.signalColor};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
[id$="-arrowhead"] path {
|
|
53
|
+
fill: ${e.signalColor};
|
|
54
|
+
stroke: ${e.signalColor};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.sequenceNumber {
|
|
58
|
+
fill: ${e.sequenceNumberColor};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
[id$="-sequencenumber"] {
|
|
62
|
+
fill: ${e.signalColor};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
[id$="-crosshead"] path {
|
|
66
|
+
fill: ${e.signalColor};
|
|
67
|
+
stroke: ${e.signalColor};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.messageText {
|
|
71
|
+
fill: ${e.signalTextColor};
|
|
72
|
+
stroke: none;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.labelBox {
|
|
76
|
+
stroke: ${e.labelBoxBorderColor};
|
|
77
|
+
fill: ${e.labelBoxBkgColor};
|
|
78
|
+
filter: ${r==="neo"?t:"none"};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.labelText, .labelText > tspan {
|
|
82
|
+
fill: ${e.labelTextColor};
|
|
83
|
+
stroke: none;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.loopText, .loopText > tspan {
|
|
87
|
+
fill: ${e.loopTextColor};
|
|
88
|
+
stroke: none;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.loopLine {
|
|
92
|
+
stroke-width: 2px;
|
|
93
|
+
stroke-dasharray: 2, 2;
|
|
94
|
+
stroke: ${e.labelBoxBorderColor};
|
|
95
|
+
fill: ${e.labelBoxBorderColor};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.note {
|
|
99
|
+
//stroke: #decc93;
|
|
100
|
+
stroke: ${e.noteBorderColor};
|
|
101
|
+
fill: ${e.noteBkgColor};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.noteText, .noteText > tspan {
|
|
105
|
+
fill: ${e.noteTextColor};
|
|
106
|
+
stroke: none;
|
|
107
|
+
${e.noteFontWeight?`font-weight: ${e.noteFontWeight};`:""}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.activation0 {
|
|
111
|
+
fill: ${e.activationBkgColor};
|
|
112
|
+
stroke: ${e.activationBorderColor};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.activation1 {
|
|
116
|
+
fill: ${e.activationBkgColor};
|
|
117
|
+
stroke: ${e.activationBorderColor};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.activation2 {
|
|
121
|
+
fill: ${e.activationBkgColor};
|
|
122
|
+
stroke: ${e.activationBorderColor};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.actorPopupMenu {
|
|
126
|
+
position: absolute;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.actorPopupMenuPanel {
|
|
130
|
+
position: absolute;
|
|
131
|
+
fill: ${e.actorBkg};
|
|
132
|
+
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
|
|
133
|
+
filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));
|
|
134
|
+
}
|
|
135
|
+
.actor-man circle, line {
|
|
136
|
+
fill: ${e.actorBkg};
|
|
137
|
+
stroke-width: 2px;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
g rect.rect {
|
|
141
|
+
filter: ${t};
|
|
142
|
+
stroke: ${e.nodeBorder};
|
|
143
|
+
}
|
|
144
|
+
`},"getStyles"),La=Ra,Ye=Ea(ga()),_t=36,ut="actor-top",yt="actor-bottom",Wt="actor-box",bt="actor-man",Et=new Set(["redux-color","redux-dark-color"]),St=O(function(e,t){let r=xa(e,t);return $t().look==="neo"&&r.attr("data-look","neo"),r},"drawRect"),Na=O(function(e,t,r,a,s){if(t.links===void 0||t.links===null||Object.keys(t.links).length===0)return{height:0,width:0};let n=t.links,i=t.actorCnt,l=t.rectData;var E="none";s&&(E="block !important");let h=e.append("g");h.attr("id","actor"+i+"_popup"),h.attr("class","actorPopupMenu"),h.attr("display",E);var c="";l.class!==void 0&&(c=" "+l.class);let x=l.width>r?l.width:r,g=h.append("rect");if(g.attr("class","actorPopupMenuPanel"+c),g.attr("x",l.x),g.attr("y",l.height),g.attr("fill",l.fill),g.attr("stroke",l.stroke),g.attr("width",x),g.attr("height",l.height),g.attr("rx",l.rx),g.attr("ry",l.ry),n!=null){var m=20;for(let y in n){var T=h.append("a"),u=(0,Ye.sanitizeUrl)(n[y]);T.attr("xlink:href",u),T.attr("target","_blank"),Ga(a)(y,T,l.x+10,l.height+m,x,20,{class:"actor"},a),m+=30}}return g.attr("height",m),{height:l.height+m,width:x}},"drawPopup"),Ft=O(function(e){return"var pu = document.getElementById('"+e+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),Vt=O(async function(e,t,r=null){let a=e.append("foreignObject"),s=await Be(t.text,$t()),n=a.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(s).node().getBoundingClientRect();if(a.attr("height",Math.round(n.height)).attr("width",Math.round(n.width)),t.class==="noteText"){let i=e.node().firstChild;i.setAttribute("height",n.height+2*t.textMargin);let l=i.getBBox();a.attr("x",Math.round(l.x+l.width/2-n.width/2)).attr("y",Math.round(l.y+l.height/2-n.height/2))}else if(r){let{startx:i,stopx:l,starty:E}=r;if(i>l){let h=i;i=l,l=h}a.attr("x",Math.round(i+Math.abs(i-l)/2-n.width/2)),t.class==="loopText"?a.attr("y",Math.round(E)):a.attr("y",Math.round(E-n.height))}return[a]},"drawKatex"),Lt=O(function(e,t){let r=0,a=0,s=t.text.split(D.lineBreakRegex),[n,i]=ve(t.fontSize),l=[],E=0,h=O(()=>t.y,"yfunc");if(t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0)switch(t.valign){case"top":case"start":h=O(()=>Math.round(t.y+t.textMargin),"yfunc");break;case"middle":case"center":h=O(()=>Math.round(t.y+(r+a+t.textMargin)/2),"yfunc");break;case"bottom":case"end":h=O(()=>Math.round(t.y+(r+a+2*t.textMargin)-t.textMargin),"yfunc");break}if(t.anchor!==void 0&&t.textMargin!==void 0&&t.width!==void 0)switch(t.anchor){case"left":case"start":t.x=Math.round(t.x+t.textMargin),t.anchor="start",t.dominantBaseline="middle",t.alignmentBaseline="middle";break;case"middle":case"center":t.x=Math.round(t.x+t.width/2),t.anchor="middle",t.dominantBaseline="middle",t.alignmentBaseline="middle";break;case"right":case"end":t.x=Math.round(t.x+t.width-t.textMargin),t.anchor="end",t.dominantBaseline="middle",t.alignmentBaseline="middle";break}for(let[c,x]of s.entries()){t.textMargin!==void 0&&t.textMargin===0&&n!==void 0&&(E=c*n);let g=e.append("text");g.attr("x",t.x),g.attr("y",h()),t.anchor!==void 0&&g.attr("text-anchor",t.anchor).attr("dominant-baseline",t.dominantBaseline).attr("alignment-baseline",t.alignmentBaseline),t.fontFamily!==void 0&&g.style("font-family",t.fontFamily),i!==void 0&&g.style("font-size",i),t.fontWeight!==void 0&&g.style("font-weight",t.fontWeight),t.fill!==void 0&&g.attr("fill",t.fill),t.class!==void 0&&g.attr("class",t.class),t.dy!==void 0?g.attr("dy",t.dy):E!==0&&g.attr("dy",E);let m=x||ua;if(t.tspan){let T=g.append("tspan");T.attr("x",t.x),t.fill!==void 0&&T.attr("fill",t.fill),T.text(m)}else g.text(m);t.valign!==void 0&&t.textMargin!==void 0&&t.textMargin>0&&(a+=(g._groups||g)[0][0].getBBox().height,r=a),l.push(g)}return l},"drawText"),$e=O(function(e,t){function r(s,n,i,l,E){return s+","+n+" "+(s+i)+","+n+" "+(s+i)+","+(n+l-E)+" "+(s+i-E*1.2)+","+(n+l)+" "+s+","+(n+l)}O(r,"genPoints");let a=e.append("polygon");return a.attr("points",r(t.x,t.y,t.width,t.height,7)),a.attr("class","labelBox"),t.y=t.y+t.height/2,Lt(e,t),a},"drawLabel"),v=-1,Ve=O((e,t,r,a)=>{e.select&&r.forEach(s=>{let n=t.get(s),i=e.select("#actor"+n.actorCnt);!a.mirrorActors&&n.stopy?i.attr("y2",n.stopy+n.height/2):a.mirrorActors&&i.attr("y2",n.stopy)})},"fixLifeLineHeights"),Sa=O(function(e,t,r,a,s){var P,w;let n=a?t.stopy:t.starty,i=t.x+t.width/2,l=n+t.height,{look:E,theme:h,themeVariables:c}=r,{bkgColorArray:x,borderColorArray:g}=c,m=e.append("g").lower();var T=m;a||(v++,Object.keys(t.links||{}).length&&!r.forceMenus&&T.attr("onclick",Ft(`actor${v}_popup`)).attr("cursor","pointer"),T.append("line").attr("id","actor"+v).attr("x1",i).attr("y1",l).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),T=m.append("g"),t.actorCnt=v,t.links!=null&&T.attr("id","root-"+v),E==="neo"&&T.attr("data-look","neo"));let u=pt();var y="actor";(P=t.properties)!=null&&P.class?y=t.properties.class:u.fill="#eaeaea",a?y+=` ${yt}`:y+=` ${ut}`,u.x=t.x,u.y=n,u.width=t.width,u.height=t.height,u.class=y,u.rx=3,u.ry=3,u.name=t.name,E==="neo"&&(u.rx=6,u.ry=6);let b=St(T,u),f=s.get(t.name)??0;if(Et.has(h)&&(b.style("stroke",g[f%g.length]),b.style("fill",x[f%g.length])),E==="neo"&&b.attr("filter","url(#drop-shadow)"),t.rectData=u,(w=t.properties)==null?void 0:w.icon){let N=t.properties.icon.trim();N.charAt(0)==="@"?re(T,u.x+u.width-20,u.y+10,N.substr(1)):ie(T,u.x+u.width-20,u.y+10,N)}a||(T.attr("data-et","participant"),T.attr("data-type","participant"),T.attr("data-id",t.name)),gt(r,J(t.description))(t.description,T,u.x,u.y,u.width,u.height,{class:`actor ${Wt}`},r);let R=t.height;if(b.node){let N=b.node().getBBox();t.height=N.height,R=N.height}return R},"drawActorTypeParticipant"),wa=O(function(e,t,r,a,s){var Y,C;let n=a?t.stopy:t.starty,i=t.x+t.width/2,l=n+t.height,{look:E,theme:h,themeVariables:c}=r,{bkgColorArray:x,borderColorArray:g}=c,m=e.append("g").lower();var T=m;a||(v++,Object.keys(t.links||{}).length&&!r.forceMenus&&T.attr("onclick",Ft(`actor${v}_popup`)).attr("cursor","pointer"),T.append("line").attr("id","actor"+v).attr("x1",i).attr("y1",l).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),T=m.append("g"),t.actorCnt=v,t.links!=null&&T.attr("id","root-"+v),E==="neo"&&T.attr("data-look","neo"));let u=pt();var y="actor";(Y=t.properties)!=null&&Y.class?y=t.properties.class:u.fill="#eaeaea",a?y+=` ${yt}`:y+=` ${ut}`,u.x=t.x,u.y=n,u.width=t.width,u.height=t.height,u.class=y,u.name=t.name;let b=6,f={...u,x:u.x+-b,y:u.y+ +b,class:"actor"},R=St(T,u),P=St(T,f);t.rectData=u,E==="neo"&&T.attr("filter","url(#drop-shadow)");let w=s.get(t.name)??0;if(Et.has(h)&&(R.style("stroke",g[w%g.length]),R.style("fill",x[w%g.length]),P.style("stroke",g[w%g.length]),P.style("fill",x[w%g.length])),(C=t.properties)==null?void 0:C.icon){let B=t.properties.icon.trim();B.charAt(0)==="@"?re(T,u.x+u.width-20,u.y+10,B.substr(1)):ie(T,u.x+u.width-20,u.y+10,B)}gt(r,J(t.description))(t.description,T,u.x-b,u.y+b,u.width,u.height,{class:`actor ${Wt}`},r);let N=t.height;if(R.node){let B=R.node().getBBox();t.height=B.height,N=B.height}return a||(T.attr("data-et","participant"),T.attr("data-type","collections"),T.attr("data-id",t.name)),N},"drawActorTypeCollections"),Aa=O(function(e,t,r,a,s){var B,H;let n=a?t.stopy:t.starty,i=t.x+t.width/2,l=n+t.height,{look:E,theme:h,themeVariables:c}=r,{bkgColorArray:x,borderColorArray:g}=c,m=e.append("g").lower(),T=m;a||(v++,Object.keys(t.links||{}).length&&!r.forceMenus&&T.attr("onclick",Ft(`actor${v}_popup`)).attr("cursor","pointer"),T.append("line").attr("id","actor"+v).attr("x1",i).attr("y1",l).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),T=m.append("g"),t.actorCnt=v,t.links!=null&&T.attr("id","root-"+v),E==="neo"&&T.attr("data-look","neo"));let u=pt(),y="actor";(B=t.properties)!=null&&B.class?y=t.properties.class:u.fill="#eaeaea",a?y+=` ${yt}`:y+=` ${ut}`,T.attr("class",y),u.x=t.x,u.y=n,u.width=t.width,u.height=t.height,u.name=t.name;let b=u.height/2,f=b/(2.5+u.height/50),R=T.append("g"),P=T.append("g"),w=`M ${u.x},${u.y+b}
|
|
145
|
+
a ${f},${b} 0 0 0 0,${u.height}
|
|
146
|
+
h ${u.width-2*f}
|
|
147
|
+
a ${f},${b} 0 0 0 0,-${u.height}
|
|
148
|
+
Z
|
|
149
|
+
`;R.append("path").attr("d",w),P.append("path").attr("d",`M ${u.x},${u.y+b}
|
|
150
|
+
a ${f},${b} 0 0 0 0,${u.height}`),R.attr("transform",`translate(${f}, ${-(u.height/2)})`),P.attr("transform",`translate(${u.width-f}, ${-u.height/2})`),t.rectData=u,E==="neo"&&R.attr("filter","url(#drop-shadow)");let N=s.get(t.name)??0;if(Et.has(h)&&(R.style("stroke",g[N%g.length]),R.style("fill",x[N%g.length]),P.style("stroke",g[N%g.length]),P.style("fill",x[N%g.length])),(H=t.properties)==null?void 0:H.icon){let z=t.properties.icon.trim(),U=u.x+u.width-20,G=u.y+10;z.charAt(0)==="@"?re(T,U,G,z.substr(1)):ie(T,U,G,z)}gt(r,J(t.description))(t.description,T,u.x,u.y,u.width,u.height,{class:`actor ${Wt}`},r);let Y=t.height,C=R.select("path:last-child");if(C.node()){let z=C.node().getBBox();t.height=z.height,Y=z.height}return a||(T.attr("data-et","participant"),T.attr("data-type","queue"),T.attr("data-id",t.name)),Y},"drawActorTypeQueue"),Pa=O(function(e,t,r,a,s,n){var B;let i=a?t.stopy:t.starty,l=t.x+t.width/2,E=i+75,{look:h,theme:c,themeVariables:x}=r,{bkgColorArray:g,borderColorArray:m,actorBorder:T,actorBkg:u}=x,y=e.append("g").lower();a||(v++,y.append("line").attr("id","actor"+v).attr("x1",l).attr("y1",E).attr("x2",l).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=v);let b=e.append("g"),f=bt;a?f+=` ${yt}`:f+=` ${ut}`,b.attr("class",f),b.attr("name",t.name);let R=pt();R.x=t.x,R.y=i,R.fill="#eaeaea",R.width=t.width,R.height=t.height,R.class="actor";let P=t.x+t.width/2,w=i+32,N=22;b.append("defs").append("marker").attr("id",s+"-filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").attr("stroke-width",1.2).append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),b.append("circle").attr("cx",P).attr("cy",w).attr("r",N).attr("filter",`${h==="neo"?"url(#drop-shadow)":""}`),b.append("line").attr("marker-end","url(#"+s+"-filled-head-control)").attr("transform",`translate(${P}, ${w-N})`);let Y=n.get(t.name)??0;Et.has(c)?(b.style("stroke",m[Y%m.length]),b.style("fill",g[Y%m.length])):(b.style("stroke",T),b.style("fill",u));let C=b.node().getBBox();return t.height=C.height+2*(((B=r==null?void 0:r.sequence)==null?void 0:B.labelBoxHeight)??0),gt(r,J(t.description))(t.description,b,R.x,R.y+N+(a?5:12),R.width,R.height,{class:`actor ${bt}`},r),a||(b.attr("data-et","participant"),b.attr("data-type","control"),b.attr("data-id",t.name)),t.height},"drawActorTypeControl"),Da=O(function(e,t,r,a,s){var N;let n=a?t.stopy:t.starty,i=t.x+t.width/2,l=n+75,{look:E,theme:h,themeVariables:c}=r,{bkgColorArray:x,borderColorArray:g}=c,m=e.append("g").lower(),T=e.append("g"),u="actor";a?u+=` ${yt}`:u+=` ${ut}`,T.attr("class",u),T.attr("name",t.name);let y=pt();y.x=t.x,y.y=n,y.fill="#eaeaea",y.width=t.width,y.height=t.height,y.class="actor";let b=t.x+t.width/2,f=n+(a?10:25),R=22;T.append("circle").attr("cx",b).attr("cy",f).attr("r",R).attr("width",t.width).attr("height",t.height),T.append("line").attr("x1",b-R).attr("x2",b+R).attr("y1",f+R).attr("y2",f+R).attr("stroke-width",2),E==="neo"&&T.attr("filter","url(#drop-shadow)");let P=s.get(t.name)??0;Et.has(h)&&(T.style("stroke",g[P%g.length]),T.style("fill",x[P%g.length]));let w=T.node().getBBox();return t.height=w.height+(((N=r==null?void 0:r.sequence)==null?void 0:N.labelBoxHeight)??0),a||(v++,m.append("line").attr("id","actor"+v).attr("x1",i).attr("y1",l).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=v),gt(r,J(t.description))(t.description,T,y.x,y.y+(a?15:30),y.width,y.height,{class:`actor ${bt}`},r),a?T.attr("transform",`translate(0, ${R})`):(T.attr("transform",`translate(0, ${R/2-5})`),T.attr("data-et","participant"),T.attr("data-type","entity"),T.attr("data-id",t.name)),t.height},"drawActorTypeEntity"),ka=O(function(e,t,r,a,s){var H;let n=a?t.stopy:t.starty,i=t.x+t.width/2,l=n+t.height+2*r.boxTextMargin,{theme:E,themeVariables:h,look:c}=r,{bkgColorArray:x,borderColorArray:g,actorBorder:m}=h,T=e.append("g").lower(),u=T;a||(v++,Object.keys(t.links||{}).length&&!r.forceMenus&&u.attr("onclick",Ft(`actor${v}_popup`)).attr("cursor","pointer"),u.append("line").attr("id","actor"+v).attr("x1",i).attr("y1",l).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),u=T.append("g"),t.actorCnt=v,t.links!=null&&u.attr("id","root-"+v),c==="neo"&&u.attr("data-look","neo"));let y=pt(),b="actor";(H=t.properties)!=null&&H.class?b=t.properties.class:y.fill="#eaeaea",a?b+=` ${yt}`:b+=` ${ut}`,y.x=t.x,y.y=n,y.width=t.width,y.height=t.height,y.class=b,y.name=t.name,y.x=t.x,y.y=n;let f=y.width/3,R=y.width/3,P=f/2,w=P/(2.5+f/50),N=u.append("g");N.attr("class",b);let Y=`
|
|
151
|
+
M ${y.x},${y.y+w}
|
|
152
|
+
a ${P},${w} 0 0 0 ${f},0
|
|
153
|
+
a ${P},${w} 0 0 0 -${f},0
|
|
154
|
+
l 0,${R-2*w}
|
|
155
|
+
a ${P},${w} 0 0 0 ${f},0
|
|
156
|
+
l 0,-${R-2*w}
|
|
157
|
+
`;N.append("path").attr("d",Y),c==="neo"&&N.attr("filter","url(#drop-shadow)");let C=s.get(t.name)??0;Et.has(E)?(N.style("stroke",g[C%g.length]),N.style("fill",x[C%g.length])):N.style("stroke",m),N.attr("transform",`translate(${f}, ${w})`),t.rectData=y,gt(r,J(t.description))(t.description,u,y.x,y.y+35,y.width,y.height,{class:`actor ${Wt}`},r);let B=N.select("path:last-child");if(B.node()){let z=B.node().getBBox();t.height=z.height+(r.sequence.labelBoxHeight??0)}return a||(u.attr("data-et","participant"),u.attr("data-type","database"),u.attr("data-id",t.name)),t.height},"drawActorTypeDatabase"),Ma=O(function(e,t,r,a,s){let n=a?t.stopy:t.starty,i=t.x+t.width/2,l=n+80,E=22,h=e.append("g").lower(),{look:c,theme:x,themeVariables:g}=r,{bkgColorArray:m,borderColorArray:T,actorBorder:u}=g;a||(v++,h.append("line").attr("id","actor"+v).attr("x1",i).attr("y1",l).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=v);let y=e.append("g"),b=bt;a?b+=` ${yt}`:b+=` ${ut}`,y.attr("class",b),y.attr("name",t.name);let f=pt();f.x=t.x,f.y=n,f.fill="#eaeaea",f.width=t.width,f.height=t.height,f.class="actor",y.append("line").attr("id","actor-man-torso"+v).attr("x1",t.x+t.width/2-E*2.5).attr("y1",n+12).attr("x2",t.x+t.width/2-15).attr("y2",n+12),y.append("line").attr("id","actor-man-arms"+v).attr("x1",t.x+t.width/2-E*2.5).attr("y1",n+2).attr("x2",t.x+t.width/2-E*2.5).attr("y2",n+22),y.append("circle").attr("cx",t.x+t.width/2).attr("cy",n+12).attr("r",E),c==="neo"&&y.attr("filter","url(#drop-shadow)");let R=s.get(t.name)??0;Et.has(x)?(y.style("stroke",T[R%T.length]),y.style("fill",m[R%T.length])):y.style("stroke",u);let P=y.node().getBBox();return t.height=P.height+(r.sequence.labelBoxHeight??0),gt(r,J(t.description))(t.description,y,f.x,f.y+15,f.width,f.height,{class:`actor ${bt}`},r),y.attr("transform",`translate(0,${E/2+10})`),a||(y.attr("data-et","participant"),y.attr("data-type","boundary"),y.attr("data-id",t.name)),t.height},"drawActorTypeBoundary"),Ca=O(function(e,t,r,a,s){let n=a?t.stopy:t.starty,i=t.x+t.width/2,l=n+80,{look:E,theme:h,themeVariables:c}=r,{bkgColorArray:x,borderColorArray:g,actorBorder:m}=c,T=e.append("g").lower();a||(v++,T.append("line").attr("id","actor"+v).attr("x1",i).attr("y1",l).attr("x2",i).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",t.name).attr("data-et","life-line").attr("data-id",t.name),t.actorCnt=v);let u=e.append("g"),y=bt;a?y+=` ${yt}`:y+=` ${ut}`,u.attr("class",y),u.attr("name",t.name),a||u.attr("data-et","participant").attr("data-type","actor").attr("data-id",t.name);let b=E==="neo"?.5:1,f=E==="neo"?n+(1-b)*30:n;u.append("line").attr("id","actor-man-torso"+v).attr("x1",i).attr("y1",f+25*b).attr("x2",i).attr("y2",f+45*b),u.append("line").attr("id","actor-man-arms"+v).attr("x1",i-_t/2*b).attr("y1",f+33*b).attr("x2",i+_t/2*b).attr("y2",f+33*b),u.append("line").attr("x1",i-_t/2*b).attr("y1",f+60*b).attr("x2",i).attr("y2",f+45*b),u.append("line").attr("x1",i).attr("y1",f+45*b).attr("x2",i+(_t/2-2)*b).attr("y2",f+60*b);let R=u.append("circle");R.attr("cx",t.x+t.width/2),R.attr("cy",f+10*b),R.attr("r",15*b),R.attr("width",t.width*b),R.attr("height",t.height*b);let P=u.node().getBBox();t.height=P.height;let w=pt();w.x=t.x,w.y=f,w.fill="#eaeaea",w.width=t.width,w.height=t.height/b,w.class="actor",w.rx=3,w.ry=3;let N=s.get(t.name)??0;return Et.has(h)?(u.style("stroke",g[N%g.length]),u.style("fill",x[N%g.length])):u.style("stroke",m),gt(r,J(t.description))(t.description,u,w.x,f+35*b-(E==="neo"?10:0),w.width,w.height,{class:`actor ${bt}`},r),t.height},"drawActorTypeActor"),va=O(async function(e,t,r,a,s,n,i){let l=i??new Map([...n.db.getActors().values()].map((E,h)=>[E.name,h]));switch(t.type){case"actor":return await Ca(e,t,r,a,l);case"participant":return await Sa(e,t,r,a,l);case"boundary":return await Ma(e,t,r,a,l);case"control":return await Pa(e,t,r,a,s,l);case"entity":return await Da(e,t,r,a,l);case"database":return await ka(e,t,r,a,l);case"collections":return await wa(e,t,r,a,l);case"queue":return await Aa(e,t,r,a,l)}},"drawActor"),Ba=O(function(e,t,r){let a=e.append("g");We(a,t),t.name&>(r)(t.name,a,t.x,t.y+r.boxTextMargin+(t.textMaxHeight||0)/2,t.width,0,{class:"text"},r),a.lower()},"drawBox"),Ya=O(function(e){return e.append("g")},"anchorElement"),$a=O(function(e,t,r,a,s,n,i){let{theme:l,themeVariables:E}=a,{bkgColorArray:h,borderColorArray:c,mainBkg:x}=E,g=pt(),m=t.anchored,T=t.actor;g.x=t.startx,g.y=t.starty,g.class="activation"+s%3,g.width=t.stopx-t.startx,g.height=r-t.starty;let u=St(m,g),y=(i??new Map([...n.db.getActors().values()].map((b,f)=>[b.name,f]))).get(T)??0;Et.has(l)&&(u.style("stroke",c[y%c.length]),u.style("fill",h[y%c.length]??x))},"drawActivation"),Va=O(async function(e,t,r,a,s){let{boxMargin:n,boxTextMargin:i,labelBoxHeight:l,labelBoxWidth:E,messageFontFamily:h,messageFontSize:c,messageFontWeight:x}=a,g=e.append("g").attr("data-et","control-structure").attr("data-id","i"+s.id),m=O(function(y,b,f,R){return g.append("line").attr("x1",y).attr("y1",b).attr("x2",f).attr("y2",R).attr("class","loopLine")},"drawLoopLine");m(t.startx,t.starty,t.stopx,t.starty),m(t.stopx,t.starty,t.stopx,t.stopy),m(t.startx,t.stopy,t.stopx,t.stopy),m(t.startx,t.starty,t.startx,t.stopy),t.sections!==void 0&&t.sections.forEach(function(y){m(t.startx,y.y,t.stopx,y.y).style("stroke-dasharray","3, 3")});let T=ae();T.text=r,T.x=t.startx,T.y=t.starty,T.fontFamily=h,T.fontSize=c,T.fontWeight=x,T.anchor="middle",T.valign="middle",T.tspan=!1,T.width=Math.max(E??0,50),T.height=l+(a.look==="neo"?15:0)||20,T.textMargin=i,T.class="labelText",$e(g,T),T=Fe(),T.text=t.title,T.x=t.startx+E/2+(t.stopx-t.startx)/2,T.y=t.starty+n+i,T.anchor="middle",T.valign="middle",T.textMargin=i,T.class="loopText",T.fontFamily=h,T.fontSize=c,T.fontWeight=x,T.wrap=!0;let u=J(T.text)?await Vt(g,T,t):Lt(g,T);if(t.sectionTitles!==void 0){for(let[y,b]of Object.entries(t.sectionTitles))if(b.message){T.text=b.message,T.x=t.startx+(t.stopx-t.startx)/2,T.y=t.sections[y].y+n+i,T.class="loopText",T.anchor="middle",T.valign="middle",T.tspan=!1,T.fontFamily=h,T.fontSize=c,T.fontWeight=x,T.wrap=t.wrap,J(T.text)?(t.starty=t.sections[y].y,await Vt(g,T,t)):Lt(g,T);let f=Math.round(u.map(R=>(R._groups||R)[0][0].getBBox().height).reduce((R,P)=>R+P));t.sections[y].height+=f-(n+i)}}return t.height=Math.round(t.stopy-t.starty),g},"drawLoop"),We=O(function(e,t){Oa(e,t)},"drawBackgroundRect"),Wa=O(function(e,t){e.append("defs").append("symbol").attr("id",t+"-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"),Fa=O(function(e,t){e.append("defs").append("symbol").attr("id",t+"-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"),Ka=O(function(e,t){e.append("defs").append("symbol").attr("id",t+"-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"),qa=O(function(e,t){e.append("defs").append("marker").attr("id",t+"-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"),Ha=O(function(e,t){e.append("defs").append("marker").attr("id",t+"-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"),za=O(function(e,t){e.append("defs").append("marker").attr("id",t+"-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"),Ua=O(function(e,t){e.append("defs").append("marker").attr("id",t+"-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"),ja=O(function(e,t){let{theme:r}=t;e.append("defs").append("filter").attr("id","drop-shadow").attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${r==="redux"||r==="redux-color"?"#000000":"#FFFFFF"}`)},"insertDropShadow"),Fe=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"),Xa=O(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),gt=function(){function e(n,i,l,E,h,c,x){let g=i.append("text").attr("x",l+h/2).attr("y",E+c/2+5).style("text-anchor","middle").text(n);s(g,x)}O(e,"byText");function t(n,i,l,E,h,c,x,g){let{actorFontSize:m,actorFontFamily:T,actorFontWeight:u}=g,[y,b]=ve(m),f=n.split(D.lineBreakRegex);for(let R=0;R<f.length;R++){let P=R*y-y*(f.length-1)/2,w=i.append("text").attr("x",l+h/2).attr("y",E).style("text-anchor","middle").style("font-size",b).style("font-weight",u).style("font-family",T);w.append("tspan").attr("x",l+h/2).attr("dy",P).text(f[R]),w.attr("y",E+c/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),s(w,x)}}O(t,"byTspan");function r(n,i,l,E,h,c,x,g){let m=i.append("switch"),T=m.append("foreignObject").attr("x",l).attr("y",E).attr("width",h).attr("height",c).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");T.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(n),t(n,m,l,E,h,c,x,g),s(T,x)}O(r,"byFo");async function a(n,i,l,E,h,c,x,g){let m=await wt(n,$t()),T=i.append("switch"),u=T.append("foreignObject").attr("x",l+h/2-m.width/2).attr("y",E+c/2-m.height/2).attr("width",m.width).attr("height",m.height).append("xhtml:div").style("height","100%").style("width","100%");u.append("div").style("text-align","center").style("vertical-align","middle").html(await Be(n,$t())),t(n,T,l,E,h,c,x,g),s(u,x)}O(a,"byKatex");function s(n,i){for(let l in i)i.hasOwnProperty(l)&&n.attr(l,i[l])}return O(s,"_setTextAttrs"),function(n,i=!1){return i?a:n.textPlacement==="fo"?r:n.textPlacement==="old"?e:t}}(),Ga=function(){function e(s,n,i,l,E,h,c){let x=n.append("text").attr("x",i).attr("y",l).style("text-anchor","start").text(s);a(x,c)}O(e,"byText");function t(s,n,i,l,E,h,c,x){let{actorFontSize:g,actorFontFamily:m,actorFontWeight:T}=x,u=s.split(D.lineBreakRegex);for(let y=0;y<u.length;y++){let b=y*g-g*(u.length-1)/2,f=n.append("text").attr("x",i).attr("y",l).style("text-anchor","start").style("font-size",g).style("font-weight",T).style("font-family",m);f.append("tspan").attr("x",i).attr("dy",b).text(u[y]),f.attr("y",l+h/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),a(f,c)}}O(t,"byTspan");function r(s,n,i,l,E,h,c,x){let g=n.append("switch"),m=g.append("foreignObject").attr("x",i).attr("y",l).attr("width",E).attr("height",h).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");m.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(s),t(s,g,i,l,E,h,c,x),a(m,c)}O(r,"byFo");function a(s,n){for(let i in n)n.hasOwnProperty(i)&&s.attr(i,n[i])}return O(a,"_setTextAttrs"),function(s){return s.textPlacement==="fo"?r:s.textPlacement==="old"?e:t}}(),Ja=O(function(e,t){e.append("defs").append("marker").attr("id",t+"-solidTopArrowHead").attr("refX",7.9).attr("refY",7.25).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 8 L 0 8 z")},"insertSolidTopArrowHead"),Za=O(function(e,t){e.append("defs").append("marker").attr("id",t+"-solidBottomArrowHead").attr("refX",7.9).attr("refY",.75).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 0 L 0 8 z")},"insertSolidBottomArrowHead"),Qa=O(function(e,t){e.append("defs").append("marker").attr("id",t+"-stickTopArrowHead").attr("refX",7.5).attr("refY",7).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 7 7").attr("stroke","black").attr("stroke-width",1.5).attr("fill","none")},"insertStickTopArrowHead"),tr=O(function(e,t){e.append("defs").append("marker").attr("id",t+"-stickBottomArrowHead").attr("refX",7.5).attr("refY",0).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M 0 7 L 7 0").attr("stroke","black").attr("stroke-width",1.5).attr("fill","none")},"insertStickBottomArrowHead"),K={drawRect:St,drawText:Lt,drawLabel:$e,drawActor:va,drawBox:Ba,drawPopup:Na,anchorElement:Ya,drawActivation:$a,drawLoop:Va,drawBackgroundRect:We,insertArrowHead:qa,insertArrowFilledHead:Ha,insertSequenceNumber:za,insertArrowCrossHead:Ua,insertDatabaseIcon:Wa,insertComputerIcon:Fa,insertClockIcon:Ka,getTextObj:Fe,getNoteRect:Xa,fixLifeLineHeights:Ve,sanitizeUrl:Ye.sanitizeUrl,insertDropShadow:ja,insertSolidTopArrowHead:Ja,insertSolidBottomArrowHead:Za,insertStickTopArrowHead:Qa,insertStickBottomArrowHead:tr},d={},I={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,this.actors.length===0?[0]:this.actors.map(e=>e.height||0))+(this.loops.length===0?0:this.loops.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.messages.length===0?0:this.messages.map(e=>e.height||0).reduce((e,t)=>e+t))+(this.notes.length===0?0:this.notes.map(e=>e.height||0).reduce((e,t)=>e+t))},"getHeight"),clear:O(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:O(function(e){this.boxes.push(e)},"addBox"),addActor:O(function(e){this.actors.push(e)},"addActor"),addLoop:O(function(e){this.loops.push(e)},"addLoop"),addMessage:O(function(e){this.messages.push(e)},"addMessage"),addNote:O(function(e){this.notes.push(e)},"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,He(Q())},"init"),updateVal:O(function(e,t,r,a){e[t]===void 0?e[t]=r:e[t]=a(r,e[t])},"updateVal"),updateBounds:O(function(e,t,r,a){let s=this,n=0;function i(l){return O(function(E){n++;let h=s.sequenceItems.length-n+1;s.updateVal(E,"starty",t-h*d.boxMargin,Math.min),s.updateVal(E,"stopy",a+h*d.boxMargin,Math.max),s.updateVal(I.data,"startx",e-h*d.boxMargin,Math.min),s.updateVal(I.data,"stopx",r+h*d.boxMargin,Math.max),l!=="activation"&&(s.updateVal(E,"startx",e-h*d.boxMargin,Math.min),s.updateVal(E,"stopx",r+h*d.boxMargin,Math.max),s.updateVal(I.data,"starty",t-h*d.boxMargin,Math.min),s.updateVal(I.data,"stopy",a+h*d.boxMargin,Math.max))},"updateItemBounds")}O(i,"updateFn"),this.sequenceItems.forEach(i()),this.activations.forEach(i("activation"))},"updateBounds"),insert:O(function(e,t,r,a){let s=D.getMin(e,r),n=D.getMax(e,r),i=D.getMin(t,a),l=D.getMax(t,a);this.updateVal(I.data,"startx",s,Math.min),this.updateVal(I.data,"starty",i,Math.min),this.updateVal(I.data,"stopx",n,Math.max),this.updateVal(I.data,"stopy",l,Math.max),this.updateBounds(s,i,n,l)},"insert"),newActivation:O(function(e,t,r){let a=r.get(e.from),s=Kt(e.from).length||0,n=a.x+a.width/2+(s-1)*d.activationWidth/2;this.activations.push({startx:n,starty:this.verticalPos+2,stopx:n+d.activationWidth,stopy:void 0,actor:e.from,anchored:K.anchorElement(t)})},"newActivation"),endActivation:O(function(e){let t=this.activations.map(function(r){return r.actor}).lastIndexOf(e.from);return this.activations.splice(t,1)[0]},"endActivation"),createLoop:O(function(e={message:void 0,wrap:!1,width:void 0},t){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:e.message,wrap:e.wrap,width:e.width,height:0,fill:t}},"createLoop"),newLoop:O(function(e={message:void 0,wrap:!1,width:void 0},t){this.sequenceItems.push(this.createLoop(e,t))},"newLoop"),endLoop:O(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:O(function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:!1},"isLoopOverlap"),addSectionToLoop:O(function(e){let t=this.sequenceItems.pop();t.sections=t.sections||[],t.sectionTitles=t.sectionTitles||[],t.sections.push({y:I.getVerticalPos(),height:0}),t.sectionTitles.push(e),this.sequenceItems.push(t)},"addSectionToLoop"),saveVerticalPos:O(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:O(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:O(function(e){this.verticalPos=this.verticalPos+e,this.data.stopy=D.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")},er=O(async function(e,t,r){I.bumpVerticalPos(d.boxMargin),t.height=d.boxMargin,t.starty=I.getVerticalPos();let a=pt();a.x=t.startx,a.y=t.starty,a.width=t.width||d.width,a.class="note";let s=e.append("g");s.attr("data-et","note"),s.attr("data-id","i"+r);let n=K.drawRect(s,a),i=ae();i.x=t.startx,i.y=t.starty,i.width=a.width,i.dy="1em",i.text=t.message,i.class="noteText",i.fontFamily=d.noteFontFamily,i.fontSize=d.noteFontSize,i.fontWeight=d.noteFontWeight,i.anchor=d.noteAlign,i.textMargin=d.noteMargin,i.valign="center";let l=J(i.text)?await Vt(s,i):Lt(s,i),E=Math.round(l.map(h=>(h._groups||h)[0][0].getBBox().height).reduce((h,c)=>h+c));n.attr("height",E+2*d.noteMargin),t.height+=E+2*d.noteMargin,I.bumpVerticalPos(E+2*d.noteMargin),t.stopy=t.starty+E+2*d.noteMargin,t.stopx=t.startx+a.width,I.insert(t.startx,t.starty,t.stopx,t.stopy),I.models.addNote(t)},"drawNote"),Me=O(function(e,t,r,a,s,n,i){let l=a.db.getActors(),E=l.get(t.from),h=l.get(t.to),c=r.sequenceVisible,x=E.x+E.width/2,g=h.x+h.width/2,m=x<=g,T=Xe(t,a),u=e.append("g"),y=16.5,b=O((N,Y)=>{let C=N?y:-y;return Y?-C:C},"getCircleOffset"),f=O(N=>{u.append("circle").attr("cx",N).attr("cy",i).attr("r",5).attr("width",10).attr("height",10)},"drawCircle"),{CENTRAL_CONNECTION:R,CENTRAL_CONNECTION_REVERSE:P,CENTRAL_CONNECTION_DUAL:w}=a.db.LINETYPE;if(c)switch(t.centralConnection){case R:T&&(g+=b(m,!0));break;case P:T||(x+=b(m,!1));break;case w:T?g+=b(m,!0):x+=b(m,!1);break}switch(t.centralConnection){case R:f(g);break;case P:f(x);break;case w:f(x),f(g);break}},"drawCentralConnection"),It=O(e=>({fontFamily:e.messageFontFamily,fontSize:e.messageFontSize,fontWeight:e.messageFontWeight}),"messageFont"),mt=O(e=>({fontFamily:e.noteFontFamily,fontSize:e.noteFontSize,fontWeight:e.noteFontWeight}),"noteFont"),te=O(e=>({fontFamily:e.actorFontFamily,fontSize:e.actorFontSize,fontWeight:e.actorFontWeight}),"actorFont");async function Ke(e,t){I.bumpVerticalPos(10);let{startx:r,stopx:a,message:s}=t,n=D.splitBreaks(s).length,i=J(s),l=i?await wt(s,Q()):X.calculateTextDimensions(s,It(d));if(!i){let x=l.height/n;t.height+=x,I.bumpVerticalPos(x)}let E,h=l.height-10,c=l.width;if(r===a){E=I.getVerticalPos()+h,d.rightAngles||(h+=d.boxMargin,E=I.getVerticalPos()+h),h+=30;let x=D.getMax(c/2,d.width/2);I.insert(r-x,I.getVerticalPos()-10+h,a+x,I.getVerticalPos()+30+h)}else h+=d.boxMargin,E=I.getVerticalPos()+h,I.insert(r,E-10,a,E);return I.bumpVerticalPos(h),t.height+=h,t.stopy=t.starty+t.height,I.insert(t.fromBounds,t.starty,t.toBounds,t.stopy),E}O(Ke,"boundMessage");var ar=O(async function(e,t,r,a,s,n){let{startx:i,stopx:l,starty:E,message:h,type:c,sequenceIndex:x,sequenceVisible:g}=t,m=X.calculateTextDimensions(h,It(d)),T=ae();T.x=i,T.y=E+10,T.width=l-i,T.class="messageText",T.dy="1em",T.text=h,T.fontFamily=d.messageFontFamily,T.fontSize=d.messageFontSize,T.fontWeight=d.messageFontWeight,T.anchor=d.messageAlign,T.valign="center",T.textMargin=d.wrapPadding,T.tspan=!1,J(T.text)?await Vt(e,T,{startx:i,stopx:l,starty:r}):Lt(e,T);let u=m.width,y;if(i===l){let f=g||d.showSequenceNumbers,R=Xe(s,a),P=cr(s,a),w=i+(f&&(R||P)?10:0);d.rightAngles?y=e.append("path").attr("d",`M ${w},${r} H ${i+D.getMax(d.width/2,u/2)} V ${r+25} H ${i}`):y=e.append("path").attr("d","M "+w+","+r+" C "+(w+60)+","+(r-10)+" "+(i+60)+","+(r+30)+" "+i+","+(r+20)),Zt(s,a)&&Me(e,s,t,a,i,l,r)}else y=e.append("line"),y.attr("x1",i),y.attr("y1",r),y.attr("x2",l),y.attr("y2",r),Zt(s,a)&&Me(e,s,t,a,i,l,r);c===a.db.LINETYPE.DOTTED||c===a.db.LINETYPE.DOTTED_CROSS||c===a.db.LINETYPE.DOTTED_POINT||c===a.db.LINETYPE.DOTTED_OPEN||c===a.db.LINETYPE.BIDIRECTIONAL_DOTTED||c===a.db.LINETYPE.SOLID_TOP_DOTTED||c===a.db.LINETYPE.SOLID_BOTTOM_DOTTED||c===a.db.LINETYPE.STICK_TOP_DOTTED||c===a.db.LINETYPE.STICK_BOTTOM_DOTTED||c===a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||c===a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||c===a.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||c===a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED?(y.style("stroke-dasharray","3, 3"),y.attr("class","messageLine1")):y.attr("class","messageLine0"),y.attr("data-et","message"),y.attr("data-id","i"+t.id),y.attr("data-from",t.from),y.attr("data-to",t.to);let b="";if(d.arrowMarkerAbsolute&&(b=ya(!0)),y.attr("stroke-width",2),y.attr("stroke","none"),y.style("fill","none"),(c===a.db.LINETYPE.SOLID_TOP||c===a.db.LINETYPE.SOLID_TOP_DOTTED)&&y.attr("marker-end","url("+b+"#"+n+"-solidTopArrowHead)"),(c===a.db.LINETYPE.SOLID_BOTTOM||c===a.db.LINETYPE.SOLID_BOTTOM_DOTTED)&&y.attr("marker-end","url("+b+"#"+n+"-solidBottomArrowHead)"),(c===a.db.LINETYPE.STICK_TOP||c===a.db.LINETYPE.STICK_TOP_DOTTED)&&y.attr("marker-end","url("+b+"#"+n+"-stickTopArrowHead)"),(c===a.db.LINETYPE.STICK_BOTTOM||c===a.db.LINETYPE.STICK_BOTTOM_DOTTED)&&y.attr("marker-end","url("+b+"#"+n+"-stickBottomArrowHead)"),(c===a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||c===a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED)&&y.attr("marker-start","url("+b+"#"+n+"-solidBottomArrowHead)"),(c===a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||c===a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr("marker-start","url("+b+"#"+n+"-solidTopArrowHead)"),(c===a.db.LINETYPE.STICK_ARROW_TOP_REVERSE||c===a.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED)&&y.attr("marker-start","url("+b+"#"+n+"-stickBottomArrowHead)"),(c===a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||c===a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED)&&y.attr("marker-start","url("+b+"#"+n+"-stickTopArrowHead)"),(c===a.db.LINETYPE.SOLID||c===a.db.LINETYPE.DOTTED)&&y.attr("marker-end","url("+b+"#"+n+"-arrowhead)"),(c===a.db.LINETYPE.BIDIRECTIONAL_SOLID||c===a.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(y.attr("marker-start","url("+b+"#"+n+"-arrowhead)"),y.attr("marker-end","url("+b+"#"+n+"-arrowhead)")),(c===a.db.LINETYPE.SOLID_POINT||c===a.db.LINETYPE.DOTTED_POINT)&&y.attr("marker-end","url("+b+"#"+n+"-filled-head)"),(c===a.db.LINETYPE.SOLID_CROSS||c===a.db.LINETYPE.DOTTED_CROSS)&&y.attr("marker-end","url("+b+"#"+n+"-crosshead)"),g||d.showSequenceNumbers){let f=c===a.db.LINETYPE.BIDIRECTIONAL_SOLID||c===a.db.LINETYPE.BIDIRECTIONAL_DOTTED,R=c===a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE||c===a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED||c===a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE||c===a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED||c===a.db.LINETYPE.STICK_ARROW_TOP_REVERSE||c===a.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED||c===a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE||c===a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,P=6,w=Zt(s,a),N=i,Y=l;f?(i<l?N=i+P*2:(N=i-P+(w?-5:0),N+=(s==null?void 0:s.centralConnection)===a.db.LINETYPE.CENTRAL_CONNECTION_DUAL||(s==null?void 0:s.centralConnection)===a.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),y.attr("x1",N)):R?(l>i?Y=l-2*P:(Y=l-P,N+=(s==null?void 0:s.centralConnection)===a.db.LINETYPE.CENTRAL_CONNECTION_DUAL||(s==null?void 0:s.centralConnection)===a.db.LINETYPE.CENTRAL_CONNECTION_REVERSE?-7.5:0),Y+=w?15:0,y.attr("x2",Y),y.attr("x1",N)):y.attr("x1",i+P);let C=0,B=i===l,H=i<=l;B?C=t.fromBounds+1:R?C=H?t.toBounds-1:t.fromBounds+1:C=H?t.fromBounds+1:t.toBounds-1,e.append("line").attr("x1",C).attr("y1",r).attr("x2",C).attr("y2",r).attr("stroke-width",0).attr("marker-start","url("+b+"#"+n+"-sequencenumber)"),e.append("text").attr("x",C).attr("y",r+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(x)}},"drawMessage"),rr=O(function(e,t,r,a,s,n,i){let l=0,E=0,h,c=0;for(let x of a){let g=t.get(x),m=g.box;h&&h!=m&&(i||I.models.addBox(h),E+=d.boxMargin+h.margin),m&&m!=h&&(i||(m.x=l+E,m.y=s),E+=m.margin),g.width=D.getMax(g.width||d.width,d.width),g.height=D.getMax(g.height||d.height,d.height),g.margin=g.margin||d.actorMargin,c=D.getMax(c,g.height),r.get(g.name)&&(E+=g.width/2),g.x=l+E,g.starty=I.getVerticalPos(),I.insert(g.x,s,g.x+g.width,g.height),l+=g.width+E,g.box&&(g.box.width=l+m.margin-g.box.x),E=g.margin,h=g.box,I.models.addActor(g)}h&&!i&&I.models.addBox(h),I.bumpVerticalPos(c)},"addActorRenderingData"),ee=O(async function(e,t,r,a,s,n,i){if(a){let l=0;I.bumpVerticalPos(d.boxMargin*2);for(let E of r){let h=t.get(E);h.stopy||(h.stopy=I.getVerticalPos());let c=await K.drawActor(e,h,d,!0,s,n,i);l=D.getMax(l,c)}I.bumpVerticalPos(l+d.boxMargin)}else for(let l of r){let E=t.get(l);await K.drawActor(e,E,d,!1,s,n,i)}},"drawActors"),qe=O(function(e,t,r,a){let s=0,n=0;for(let i of r){let l=t.get(i),E=sr(l),h=K.drawPopup(e,l,E,d,d.forceMenus,a);h.height>s&&(s=h.height),h.width+l.x>n&&(n=h.width+l.x)}return{maxHeight:s,maxWidth:n}},"drawActorsPopup"),He=O(function(e){sa(d,e),e.fontFamily&&(d.actorFontFamily=d.noteFontFamily=d.messageFontFamily=e.fontFamily),e.fontSize&&(d.actorFontSize=d.noteFontSize=d.messageFontSize=e.fontSize),e.fontWeight&&(d.actorFontWeight=d.noteFontWeight=d.messageFontWeight=e.fontWeight)},"setConf"),Kt=O(function(e){return I.activations.filter(function(t){return t.actor===e})},"actorActivations"),Ce=O(function(e,t){let r=t.get(e),a=Kt(e),s=a.reduce(function(i,l){return D.getMin(i,l.startx)},r.x+r.width/2-1),n=a.reduce(function(i,l){return D.getMax(i,l.stopx)},r.x+r.width/2+1);return[s,n]},"activationBounds");function dt(e,t,r,a,s){I.bumpVerticalPos(r);let n=a;if(t.id&&t.message&&e[t.id]){let i=e[t.id].width,l=It(d);t.message=X.wrapLabel(`[${t.message}]`,i-2*d.wrapPadding,l),t.width=i,t.wrap=!0;let E=X.calculateTextDimensions(t.message,l),h=D.getMax(E.height,d.labelBoxHeight);n=a+h,it.debug(`${h} - ${t.message}`)}s(t),I.bumpVerticalPos(n)}O(dt,"adjustLoopHeightForWrap");function ze(e,t,r,a,s,n,i){function l(c,x){c.x<s.get(e.from).x?(I.insert(t.stopx-x,t.starty,t.startx,t.stopy+c.height/2+d.noteMargin),t.stopx=t.stopx+x):(I.insert(t.startx,t.starty,t.stopx+x,t.stopy+c.height/2+d.noteMargin),t.stopx=t.stopx-x)}O(l,"receiverAdjustment");function E(c,x){c.x<s.get(e.to).x?(I.insert(t.startx-x,t.starty,t.stopx,t.stopy+c.height/2+d.noteMargin),t.startx=t.startx+x):(I.insert(t.stopx,t.starty,t.startx+x,t.stopy+c.height/2+d.noteMargin),t.startx=t.startx-x)}O(E,"senderAdjustment");let h=[Yt.ACTOR,Yt.CONTROL,Yt.ENTITY,Yt.DATABASE];if(n.get(e.to)==a){let c=s.get(e.to),x=h.includes(c.type)?_t/2+3:c.width/2+3;l(c,x),c.starty=r-c.height/2,I.bumpVerticalPos(c.height/2)}else if(i.get(e.from)==a){let c=s.get(e.from);if(d.mirrorActors){let x=h.includes(c.type)?_t/2:c.width/2;E(c,x)}c.stopy=r-c.height/2,I.bumpVerticalPos(c.height/2)}else if(i.get(e.to)==a){let c=s.get(e.to);if(d.mirrorActors){let x=h.includes(c.type)?_t/2+3:c.width/2+3;l(c,x)}c.stopy=r-c.height/2,I.bumpVerticalPos(c.height/2)}}O(ze,"adjustCreatedDestroyedData");var ir=O(async function(e,t,r,a){let{securityLevel:s,sequence:n,look:i}=Q();d=n;let l;s==="sandbox"&&(l=vt("#i"+t));let E=s==="sandbox"?vt(l.nodes()[0].contentDocument.body):vt("body"),h=s==="sandbox"?l.nodes()[0].contentDocument:document;I.init(),it.debug(a.db);let c=s==="sandbox"?E.select(`[id="${t}"]`):vt(`[id="${t}"]`),x=a.db.getActors(),g=a.db.getCreatedActors(),m=a.db.getDestroyedActors(),T=a.db.getBoxes(),u=a.db.getActorKeys(),y=a.db.getMessages(),b=a.db.getDiagramTitle(),f=a.db.hasAtLeastOneBox(),R=a.db.hasAtLeastOneBoxWithTitle(),P=await Ue(x,y,a);if(d.height=await je(x,P,T),K.insertComputerIcon(c,t),K.insertDatabaseIcon(c,t),K.insertClockIcon(c,t),f&&(I.bumpVerticalPos(d.boxMargin),R&&I.bumpVerticalPos(T[0].textMaxHeight)),d.hideUnusedParticipants===!0){let L=new Set;y.forEach(k=>{L.add(k.from),L.add(k.to)}),u=u.filter(k=>L.has(k))}let w=new Map(u.map((L,k)=>{var et;return[((et=x.get(L))==null?void 0:et.name)??L,k]}));rr(c,x,g,u,0,y,!1);let N=await hr(y,x,P,a);K.insertArrowHead(c,t),K.insertArrowCrossHead(c,t),K.insertArrowFilledHead(c,t),K.insertSequenceNumber(c,t),K.insertSolidTopArrowHead(c,t),K.insertSolidBottomArrowHead(c,t),K.insertStickTopArrowHead(c,t),K.insertStickBottomArrowHead(c,t),i==="neo"&&K.insertDropShadow(c,d);function Y(L,k){let et=I.endActivation(L);et.starty+18>k&&(et.starty=k-6,k+=12),K.drawActivation(c,et,k,d,Kt(L.from).length,a,w),I.insert(et.startx,k-10,et.stopx,k)}O(Y,"activeEnd");let C=1,B=1,H=[],z=[],U=0;for(let L of y){let k,et,at;switch(L.type){case a.db.LINETYPE.NOTE:I.resetVerticalPos(),et=L.noteModel,await er(c,et,L.id);break;case a.db.LINETYPE.ACTIVE_START:I.newActivation(L,c,x);break;case a.db.LINETYPE.CENTRAL_CONNECTION:I.newActivation(L,c,x);break;case a.db.LINETYPE.CENTRAL_CONNECTION_REVERSE:I.newActivation(L,c,x);break;case a.db.LINETYPE.ACTIVE_END:Y(L,I.getVerticalPos());break;case a.db.LINETYPE.LOOP_START:dt(N,L,d.boxMargin,d.boxMargin+d.boxTextMargin,W=>I.newLoop(W));break;case a.db.LINETYPE.LOOP_END:k=I.endLoop(),await K.drawLoop(c,k,"loop",d,L),I.bumpVerticalPos(k.stopy-I.getVerticalPos()),I.models.addLoop(k);break;case a.db.LINETYPE.RECT_START:dt(N,L,d.boxMargin,d.boxMargin,W=>I.newLoop(void 0,W.message));break;case a.db.LINETYPE.RECT_END:k=I.endLoop(),z.push(k),I.models.addLoop(k),I.bumpVerticalPos(k.stopy-I.getVerticalPos());break;case a.db.LINETYPE.OPT_START:dt(N,L,d.boxMargin,d.boxMargin+d.boxTextMargin,W=>I.newLoop(W));break;case a.db.LINETYPE.OPT_END:k=I.endLoop(),await K.drawLoop(c,k,"opt",d,L),I.bumpVerticalPos(k.stopy-I.getVerticalPos()),I.models.addLoop(k);break;case a.db.LINETYPE.ALT_START:dt(N,L,d.boxMargin,d.boxMargin+d.boxTextMargin,W=>I.newLoop(W));break;case a.db.LINETYPE.ALT_ELSE:dt(N,L,d.boxMargin+d.boxTextMargin,d.boxMargin,W=>I.addSectionToLoop(W));break;case a.db.LINETYPE.ALT_END:k=I.endLoop(),await K.drawLoop(c,k,"alt",d,L),I.bumpVerticalPos(k.stopy-I.getVerticalPos()),I.models.addLoop(k);break;case a.db.LINETYPE.PAR_START:case a.db.LINETYPE.PAR_OVER_START:dt(N,L,d.boxMargin,d.boxMargin+d.boxTextMargin,W=>I.newLoop(W)),I.saveVerticalPos();break;case a.db.LINETYPE.PAR_AND:dt(N,L,d.boxMargin+d.boxTextMargin,d.boxMargin,W=>I.addSectionToLoop(W));break;case a.db.LINETYPE.PAR_END:k=I.endLoop(),await K.drawLoop(c,k,"par",d,L),I.bumpVerticalPos(k.stopy-I.getVerticalPos()),I.models.addLoop(k);break;case a.db.LINETYPE.AUTONUMBER:C=L.message.start||C,B=L.message.step||B,L.message.visible?a.db.enableSequenceNumbers():a.db.disableSequenceNumbers();break;case a.db.LINETYPE.CRITICAL_START:dt(N,L,d.boxMargin,d.boxMargin+d.boxTextMargin,W=>I.newLoop(W));break;case a.db.LINETYPE.CRITICAL_OPTION:dt(N,L,d.boxMargin+d.boxTextMargin,d.boxMargin,W=>I.addSectionToLoop(W));break;case a.db.LINETYPE.CRITICAL_END:k=I.endLoop(),await K.drawLoop(c,k,"critical",d,L),I.bumpVerticalPos(k.stopy-I.getVerticalPos()),I.models.addLoop(k);break;case a.db.LINETYPE.BREAK_START:dt(N,L,d.boxMargin,d.boxMargin+d.boxTextMargin,W=>I.newLoop(W));break;case a.db.LINETYPE.BREAK_END:k=I.endLoop(),await K.drawLoop(c,k,"break",d,L),I.bumpVerticalPos(k.stopy-I.getVerticalPos()),I.models.addLoop(k);break;default:try{at=L.msgModel,at.starty=I.getVerticalPos(),at.sequenceIndex=C,at.sequenceVisible=a.db.showSequenceNumbers(),at.id=L.id,at.from=L.from,at.to=L.to;let W=await Ke(c,at);ze(L,at,W,U,x,g,m),H.push({messageModel:at,lineStartY:W,msg:L}),I.models.addMessage(at)}catch(W){it.error("error while drawing message",W)}}[a.db.LINETYPE.SOLID_OPEN,a.db.LINETYPE.DOTTED_OPEN,a.db.LINETYPE.SOLID,a.db.LINETYPE.SOLID_TOP,a.db.LINETYPE.SOLID_BOTTOM,a.db.LINETYPE.STICK_TOP,a.db.LINETYPE.STICK_BOTTOM,a.db.LINETYPE.SOLID_TOP_DOTTED,a.db.LINETYPE.SOLID_BOTTOM_DOTTED,a.db.LINETYPE.STICK_TOP_DOTTED,a.db.LINETYPE.STICK_BOTTOM_DOTTED,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,a.db.LINETYPE.STICK_ARROW_TOP_REVERSE,a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,a.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,a.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,a.db.LINETYPE.DOTTED,a.db.LINETYPE.SOLID_CROSS,a.db.LINETYPE.DOTTED_CROSS,a.db.LINETYPE.SOLID_POINT,a.db.LINETYPE.DOTTED_POINT,a.db.LINETYPE.BIDIRECTIONAL_SOLID,a.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(L.type)&&(C=C+B),U++}it.debug("createdActors",g),it.debug("destroyedActors",m),await ee(c,x,u,!1,t,a,w);for(let L of H)await ar(c,L.messageModel,L.lineStartY,a,L.msg,t);d.mirrorActors&&await ee(c,x,u,!0,t,a,w),z.forEach(L=>K.drawBackgroundRect(c,L)),Ve(c,x,u,d);for(let L of I.models.boxes){L.height=I.getVerticalPos()-L.y,I.insert(L.x,L.y,L.x+L.width,L.height);let k=d.boxMargin*2;L.startx=L.x-k,L.starty=L.y-k*.25,L.stopx=L.startx+L.width+2*k,L.stopy=L.starty+L.height+k*.75,L.stroke="rgb(0,0,0, 0.5)",K.drawBox(c,L,d)}f&&I.bumpVerticalPos(d.boxMargin);let G=qe(c,x,u,h),{bounds:q}=I.getBounds();q.startx===void 0&&(q.startx=0),q.starty===void 0&&(q.starty=0),q.stopx===void 0&&(q.stopx=0),q.stopy===void 0&&(q.stopy=0);let st=q.stopy-q.starty;st<G.maxHeight&&(st=G.maxHeight);let tt=st+2*d.diagramMarginY;d.mirrorActors&&(tt=tt-d.boxMargin+d.bottomMarginAdj);let nt=q.stopx-q.startx;nt<G.maxWidth&&(nt=G.maxWidth);let $=nt+2*d.diagramMarginX;b&&c.append("text").text(b).attr("x",(q.stopx-q.startx)/2-2*d.diagramMarginX).attr("y",-25),ia(c,tt,$,d.useMaxWidth);let M=b?40:0,At=x.size&&i==="neo"?30:0;c.attr("viewBox",q.startx-d.diagramMarginX+" -"+(d.diagramMarginY+M)+" "+$+" "+(tt+M+At)),it.debug("models:",I.models)},"draw");async function Ue(e,t,r){let a={};for(let s of t)if(e.get(s.to)&&e.get(s.from)){let n=e.get(s.to);if(s.placement===r.db.PLACEMENT.LEFTOF&&!n.prevActor||s.placement===r.db.PLACEMENT.RIGHTOF&&!n.nextActor)continue;let i=s.placement!==void 0,l=!i,E=i?mt(d):It(d),h=s.wrap?X.wrapLabel(s.message,d.width-2*d.wrapPadding,E):s.message,c=(J(h)?await wt(s.message,Q()):X.calculateTextDimensions(h,E)).width+2*d.wrapPadding;l&&s.from===n.nextActor?a[s.to]=D.getMax(a[s.to]||0,c):l&&s.from===n.prevActor?a[s.from]=D.getMax(a[s.from]||0,c):l&&s.from===s.to?(a[s.from]=D.getMax(a[s.from]||0,c/2),a[s.to]=D.getMax(a[s.to]||0,c/2)):s.placement===r.db.PLACEMENT.RIGHTOF?a[s.from]=D.getMax(a[s.from]||0,c):s.placement===r.db.PLACEMENT.LEFTOF?a[n.prevActor]=D.getMax(a[n.prevActor]||0,c):s.placement===r.db.PLACEMENT.OVER&&(n.prevActor&&(a[n.prevActor]=D.getMax(a[n.prevActor]||0,c/2)),n.nextActor&&(a[s.from]=D.getMax(a[s.from]||0,c/2)))}return it.debug("maxMessageWidthPerActor:",a),a}O(Ue,"getMaxMessageWidthPerActor");var sr=O(function(e){let t=0,r=te(d);for(let a in e.links){let s=X.calculateTextDimensions(a,r).width+2*d.wrapPadding+2*d.boxMargin;t<s&&(t=s)}return t},"getRequiredPopupWidth");async function je(e,t,r){let a=0;for(let n of e.keys()){let i=e.get(n);i.wrap&&(i.description=X.wrapLabel(i.description,d.width-2*d.wrapPadding,te(d)));let l=J(i.description)?await wt(i.description,Q()):X.calculateTextDimensions(i.description,te(d));i.width=i.wrap?d.width:D.getMax(d.width,l.width+2*d.wrapPadding),i.height=i.wrap?D.getMax(l.height,d.height):d.height,a=D.getMax(a,i.height)}for(let n in t){let i=e.get(n);if(!i)continue;let l=e.get(i.nextActor);if(!l){let h=t[n]+d.actorMargin-i.width/2;i.margin=D.getMax(h,d.actorMargin);continue}let E=t[n]+d.actorMargin-i.width/2-l.width/2;i.margin=D.getMax(E,d.actorMargin)}let s=0;return r.forEach(n=>{let i=It(d),l=n.actorKeys.reduce((x,g)=>x+=e.get(g).width+(e.get(g).margin||0),0),E=d.boxMargin*8;l+=E,l-=2*d.boxTextMargin,n.wrap&&(n.name=X.wrapLabel(n.name,l-2*d.wrapPadding,i));let h=X.calculateTextDimensions(n.name,i);s=D.getMax(h.height,s);let c=D.getMax(l,h.width+2*d.wrapPadding);if(n.margin=d.boxTextMargin,l<c){let x=(c-l)/2;n.margin+=x}}),r.forEach(n=>n.textMaxHeight=s),D.getMax(a,d.height)}O(je,"calculateActorMargins");var nr=O(async function(e,t,r){let a=t.get(e.from),s=t.get(e.to),n=a.x,i=s.x,l=e.wrap&&e.message,E=J(e.message)?await wt(e.message,Q()):X.calculateTextDimensions(l?X.wrapLabel(e.message,d.width,mt(d)):e.message,mt(d)),h={width:l?d.width:D.getMax(d.width,E.width+2*d.noteMargin),height:0,startx:a.x,stopx:0,starty:0,stopy:0,message:e.message};return e.placement===r.db.PLACEMENT.RIGHTOF?(h.width=l?D.getMax(d.width,E.width):D.getMax(a.width/2+s.width/2,E.width+2*d.noteMargin),h.startx=n+(a.width+d.actorMargin)/2):e.placement===r.db.PLACEMENT.LEFTOF?(h.width=l?D.getMax(d.width,E.width+2*d.noteMargin):D.getMax(a.width/2+s.width/2,E.width+2*d.noteMargin),h.startx=n-h.width+(a.width-d.actorMargin)/2):e.to===e.from?(E=X.calculateTextDimensions(l?X.wrapLabel(e.message,D.getMax(d.width,a.width),mt(d)):e.message,mt(d)),h.width=l?D.getMax(d.width,a.width):D.getMax(a.width,d.width,E.width+2*d.noteMargin),h.startx=n+(a.width-h.width)/2):(h.width=Math.abs(n+a.width/2-(i+s.width/2))+d.actorMargin,h.startx=n<i?n+a.width/2-d.actorMargin/2:i+s.width/2-d.actorMargin/2),l&&(h.message=X.wrapLabel(e.message,h.width-2*d.wrapPadding,mt(d))),it.debug(`NM:[${h.startx},${h.stopx},${h.starty},${h.stopy}:${h.width},${h.height}=${e.message}]`),h},"buildNoteModel"),or=4,Zt=O(function(e,t){let{CENTRAL_CONNECTION:r,CENTRAL_CONNECTION_REVERSE:a,CENTRAL_CONNECTION_DUAL:s}=t.db.LINETYPE;return[r,a,s].includes(e.centralConnection)},"hasCentralConnection"),lr=O(function(e,t,r){let{CENTRAL_CONNECTION_REVERSE:a,CENTRAL_CONNECTION_DUAL:s,BIDIRECTIONAL_SOLID:n,BIDIRECTIONAL_DOTTED:i}=t.db.LINETYPE,l=0;return(e.centralConnection===a||e.centralConnection===s)&&(l+=or),(e.centralConnection===a||e.centralConnection===s)&&(e.type===n||e.type===i)&&(l+=r?0:-6),l},"calculateCentralConnectionOffset"),Xe=O(function(e,t){let{SOLID_ARROW_TOP_REVERSE:r,SOLID_ARROW_TOP_REVERSE_DOTTED:a,SOLID_ARROW_BOTTOM_REVERSE:s,SOLID_ARROW_BOTTOM_REVERSE_DOTTED:n,STICK_ARROW_TOP_REVERSE:i,STICK_ARROW_TOP_REVERSE_DOTTED:l,STICK_ARROW_BOTTOM_REVERSE:E,STICK_ARROW_BOTTOM_REVERSE_DOTTED:h}=t.db.LINETYPE;return[r,a,s,n,i,l,E,h].includes(e.type)},"isReverseArrowType"),cr=O(function(e,t){let{BIDIRECTIONAL_SOLID:r,BIDIRECTIONAL_DOTTED:a}=t.db.LINETYPE;return[r,a].includes(e.type)},"isBidirectionalArrowType"),dr=O(function(e,t,r){let{look:a}=Q();if(![r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.SOLID,r.db.LINETYPE.SOLID_TOP,r.db.LINETYPE.SOLID_BOTTOM,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.SOLID_TOP_DOTTED,r.db.LINETYPE.SOLID_BOTTOM_DOTTED,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.DOTTED,r.db.LINETYPE.SOLID_CROSS,r.db.LINETYPE.DOTTED_CROSS,r.db.LINETYPE.SOLID_POINT,r.db.LINETYPE.DOTTED_POINT,r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(e.type))return{};let[s,n]=Ce(e.from,t),[i,l]=Ce(e.to,t),E=s<=i,h=E?n:s,c=E?i:l;a==="neo"&&(e.type!==r.db.LINETYPE.SOLID_OPEN&&(c+=E?-3:3),(e.type===r.db.LINETYPE.BIDIRECTIONAL_SOLID||e.type===r.db.LINETYPE.BIDIRECTIONAL_DOTTED)&&(h+=E?3:-3)),h+=lr(e,r,E);let x=Math.abs(i-l)>2,g=O(y=>E?-y:y,"adjustValue");e.from===e.to?c=h:(e.activate&&!x&&(c+=g(d.activationWidth/2-1)),[r.db.LINETYPE.SOLID_OPEN,r.db.LINETYPE.DOTTED_OPEN,r.db.LINETYPE.STICK_TOP,r.db.LINETYPE.STICK_BOTTOM,r.db.LINETYPE.STICK_TOP_DOTTED,r.db.LINETYPE.STICK_BOTTOM_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE,r.db.LINETYPE.STICK_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.STICK_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(e.type)||(c+=g(3)),[r.db.LINETYPE.BIDIRECTIONAL_SOLID,r.db.LINETYPE.BIDIRECTIONAL_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE_DOTTED,r.db.LINETYPE.SOLID_ARROW_TOP_REVERSE,r.db.LINETYPE.SOLID_ARROW_BOTTOM_REVERSE].includes(e.type)&&(h-=g(3)));let m=[s,n,i,l],T=Math.abs(h-c);e.wrap&&e.message&&(e.message=X.wrapLabel(e.message,D.getMax(T+2*d.wrapPadding,d.width),It(d)));let u=X.calculateTextDimensions(e.message,It(d));return{width:D.getMax(e.wrap?0:u.width+2*d.wrapPadding,T+2*d.wrapPadding,d.width),height:0,startx:h,stopx:c,starty:0,stopy:0,message:e.message,type:e.type,wrap:e.wrap,fromBounds:Math.min.apply(null,m),toBounds:Math.max.apply(null,m)}},"buildMessageModel"),hr=O(async function(e,t,r,a){let s={},n=[],i,l,E;for(let h of e){switch(h.type){case a.db.LINETYPE.LOOP_START:case a.db.LINETYPE.ALT_START:case a.db.LINETYPE.OPT_START:case a.db.LINETYPE.PAR_START:case a.db.LINETYPE.PAR_OVER_START:case a.db.LINETYPE.CRITICAL_START:case a.db.LINETYPE.BREAK_START:n.push({id:h.id,msg:h.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case a.db.LINETYPE.ALT_ELSE:case a.db.LINETYPE.PAR_AND:case a.db.LINETYPE.CRITICAL_OPTION:h.message&&(i=n.pop(),s[i.id]=i,s[h.id]=i,n.push(i));break;case a.db.LINETYPE.LOOP_END:case a.db.LINETYPE.ALT_END:case a.db.LINETYPE.OPT_END:case a.db.LINETYPE.PAR_END:case a.db.LINETYPE.CRITICAL_END:case a.db.LINETYPE.BREAK_END:i=n.pop(),s[i.id]=i;break;case a.db.LINETYPE.ACTIVE_START:{let c=t.get(h.from?h.from:h.to.actor),x=Kt(h.from?h.from:h.to.actor).length,g=c.x+c.width/2+(x-1)*d.activationWidth/2,m={startx:g,stopx:g+d.activationWidth,actor:h.from,enabled:!0};I.activations.push(m)}break;case a.db.LINETYPE.ACTIVE_END:{let c=I.activations.map(x=>x.actor).lastIndexOf(h.from);I.activations.splice(c,1).splice(0,1)}break}h.placement!==void 0?(l=await nr(h,t,a),h.noteModel=l,n.forEach(c=>{i=c,i.from=D.getMin(i.from,l.startx),i.to=D.getMax(i.to,l.startx+l.width),i.width=D.getMax(i.width,Math.abs(i.from-i.to))-d.labelBoxWidth})):(E=dr(h,t,a),h.msgModel=E,E.startx&&E.stopx&&n.length>0&&n.forEach(c=>{if(i=c,E.startx===E.stopx){let x=t.get(h.from),g=t.get(h.to);i.from=D.getMin(x.x-E.width/2,x.x-x.width/2,i.from),i.to=D.getMax(g.x+E.width/2,g.x+x.width/2,i.to),i.width=D.getMax(i.width,Math.abs(i.to-i.from))-d.labelBoxWidth}else i.from=D.getMin(E.startx,i.from),i.to=D.getMax(E.stopx,i.to),i.width=D.getMax(i.width,E.width)-d.labelBoxWidth}))}return I.activations=[],it.debug("Loop type widths:",s),s},"calculateLoopBounds"),pr={bounds:I,drawActors:ee,drawActorsPopup:qe,setConf:He,draw:ir},yr={parser:_a,get db(){return new ma},renderer:pr,styles:La,init:O(e=>{e.sequence||(e.sequence={}),e.wrap&&(e.sequence.wrap=e.wrap,ra({sequence:{wrap:e.wrap}}))},"init")};export{yr as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as G,Y as U,_ as v}from"./chunk-3GS5O3IE-DkUjU0WD.js";import{f as C}from"./chunk-3YCYZ6SJ-CQkVgT_z.js";import{m as O}from"./chunk-HN6EAY2L-BBnyTNdB.js";import"./chunk-TBF5ZNIQ-DL5stGM1.js";import"./chunk-RWUO3TPN-BgRTY0_k.js";import{m as y,q as t,i as H,p as k,b as P,C as T,af as R,am as I,aj as $,U as W}from"./index-BgeqpYgd.js";import"./chunk-H3VCZNTA-Cx5XV_aC.js";var Y=y(e=>e.append("circle").attr("class","start-state").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit).attr("cy",t().state.padding+t().state.sizeUnit),"drawStartState"),j=y(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t().state.textHeight).attr("class","divider").attr("x2",t().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),q=y((e,i)=>{let o=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+2*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),s=o.node().getBBox();return e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",s.width+2*t().state.padding).attr("height",s.height+2*t().state.padding).attr("rx",t().state.radius),o},"drawSimpleState"),F=y((e,i)=>{let o=y(function(g,c,b){let w=g.append("tspan").attr("x",2*t().state.padding).text(c);b||w.attr("dy",t().state.textHeight)},"addTspan"),s=e.append("text").attr("x",2*t().state.padding).attr("y",t().state.textHeight+1.3*t().state.padding).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.descriptions[0]).node().getBBox(),d=s.height,h=e.append("text").attr("x",t().state.padding).attr("y",d+t().state.padding*.4+t().state.dividerMargin+t().state.textHeight).attr("class","state-description"),x=!0,a=!0;i.descriptions.forEach(function(g){x||(o(h,g,a),a=!1),x=!1});let n=e.append("line").attr("x1",t().state.padding).attr("y1",t().state.padding+d+t().state.dividerMargin/2).attr("y2",t().state.padding+d+t().state.dividerMargin/2).attr("class","descr-divider"),u=h.node().getBBox(),l=Math.max(u.width,s.width);return n.attr("x2",l+3*t().state.padding),e.insert("rect",":first-child").attr("x",t().state.padding).attr("y",t().state.padding).attr("width",l+2*t().state.padding).attr("height",u.height+d+2*t().state.padding).attr("rx",t().state.radius),e},"drawDescrState"),J=y((e,i,o)=>{let s=t().state.padding,d=2*t().state.padding,h=e.node().getBBox(),x=h.width,a=h.x,n=e.append("text").attr("x",0).attr("y",t().state.titleShift).attr("font-size",t().state.fontSize).attr("class","state-title").text(i.id),u=n.node().getBBox().width+d,l=Math.max(u,x);l===x&&(l=l+d);let g,c=e.node().getBBox();i.doc,g=a-s,u>x&&(g=(x-l)/2+s),Math.abs(a-c.x)<s&&u>x&&(g=a-(u-x)/2);let b=1-t().state.textHeight;return e.insert("rect",":first-child").attr("x",g).attr("y",b).attr("class",o?"alt-composit":"composit").attr("width",l).attr("height",c.height+t().state.textHeight+t().state.titleShift+1).attr("rx","0"),n.attr("x",g+s),u<=x&&n.attr("x",a+(l-d)/2-u/2+s),e.insert("rect",":first-child").attr("x",g).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",l).attr("height",t().state.textHeight*3).attr("rx",t().state.radius),e.insert("rect",":first-child").attr("x",g).attr("y",t().state.titleShift-t().state.textHeight-t().state.padding).attr("width",l).attr("height",c.height+3+2*t().state.textHeight).attr("rx",t().state.radius),e},"addTitleAndBox"),_=y(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t().state.sizeUnit+t().state.miniPadding).attr("cx",t().state.padding+t().state.sizeUnit+t().state.miniPadding).attr("cy",t().state.padding+t().state.sizeUnit+t().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t().state.sizeUnit).attr("cx",t().state.padding+t().state.sizeUnit+2).attr("cy",t().state.padding+t().state.sizeUnit+2)),"drawEndState"),X=y((e,i)=>{let o=t().state.forkWidth,s=t().state.forkHeight;if(i.parentId){let d=o;o=s,s=d}return e.append("rect").style("stroke","black").style("fill","black").attr("width",o).attr("height",s).attr("x",t().state.padding).attr("y",t().state.padding)},"drawForkJoinState"),Z=y((e,i,o,s)=>{let d=0,h=s.append("text");h.style("text-anchor","start"),h.attr("class","noteText");let x=e.replace(/\r\n/g,"<br/>");x=x.replace(/\n/g,"<br/>");let a=x.split(T.lineBreakRegex),n=1.25*t().state.noteMargin;for(let u of a){let l=u.trim();if(l.length>0){let g=h.append("tspan");if(g.text(l),n===0){let c=g.node().getBBox();n+=c.height}d+=n,g.attr("x",i+t().state.noteMargin),g.attr("y",o+d+1.25*t().state.noteMargin)}}return{textWidth:h.node().getBBox().width,textHeight:d}},"_drawLongText"),K=y((e,i)=>{i.attr("class","state-note");let o=i.append("rect").attr("x",0).attr("y",t().state.padding),s=i.append("g"),{textWidth:d,textHeight:h}=Z(e,0,0,s);return o.attr("height",h+2*t().state.noteMargin),o.attr("width",d+t().state.noteMargin*2),o},"drawNote"),D=y(function(e,i){let o=i.id,s={id:o,label:i.id,width:0,height:0},d=e.append("g").attr("id",o).attr("class","stateGroup");i.type==="start"&&Y(d),i.type==="end"&&_(d),(i.type==="fork"||i.type==="join")&&X(d,i),i.type==="note"&&K(i.note.text,d),i.type==="divider"&&j(d),i.type==="default"&&i.descriptions.length===0&&q(d,i),i.type==="default"&&i.descriptions.length>0&&F(d,i);let h=d.node().getBBox();return s.width=h.width+2*t().state.padding,s.height=h.height+2*t().state.padding,s},"drawState"),A=0,Q=y(function(e,i,o){let s=y(function(n){switch(n){case v.relationType.AGGREGATION:return"aggregation";case v.relationType.EXTENSION:return"extension";case v.relationType.COMPOSITION:return"composition";case v.relationType.DEPENDENCY:return"dependency"}},"getRelationType");i.points=i.points.filter(n=>!Number.isNaN(n.y));let d=i.points,h=R().x(function(n){return n.x}).y(function(n){return n.y}).curve(I),x=e.append("path").attr("d",h(d)).attr("id","edge"+A).attr("class","transition"),a="";if(t().state.arrowMarkerAbsolute&&(a=$(!0)),x.attr("marker-end","url("+a+"#"+s(v.relationType.DEPENDENCY)+"End)"),o.title!==void 0){let n=e.append("g").attr("class","stateLabel"),{x:u,y:l}=W.calcLabelPosition(i.points),g=T.getRows(o.title),c=0,b=[],w=0,E=0;for(let r=0;r<=g.length;r++){let f=n.append("text").attr("text-anchor","middle").text(g[r]).attr("x",u).attr("y",l+c),p=f.node().getBBox();w=Math.max(w,p.width),E=Math.min(E,p.x),k.info(p.x,u,l+c),c===0&&(c=f.node().getBBox().height,k.info("Title height",c,l)),b.push(f)}let N=c*g.length;if(g.length>1){let r=(g.length-1)*c*.5;b.forEach((f,p)=>f.attr("y",l+p*c-r)),N=c*g.length}let M=n.node().getBBox();n.insert("rect",":first-child").attr("class","box").attr("x",u-w/2-t().state.padding/2).attr("y",l-N/2-t().state.padding/2-3.5).attr("width",w+t().state.padding).attr("height",N+t().state.padding),k.info(M)}A++},"drawEdge"),m,z={},V=y(function(){},"setConf"),tt=y(function(e){e.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"),et=y(function(e,i,o,s){m=t().state;let d=t().securityLevel,h;d==="sandbox"&&(h=H("#i"+i));let x=d==="sandbox"?H(h.nodes()[0].contentDocument.body):H("body"),a=d==="sandbox"?h.nodes()[0].contentDocument:document;k.debug("Rendering diagram "+e);let n=x.select(`[id='${i}']`);tt(n);let u=s.db.getRootDoc(),l=n.append("g").attr("id",i+"-root");L(u,l,void 0,!1,x,a,s);let g=m.padding,c=n.node().getBBox(),b=c.width+g*2,w=c.height+g*2,E=b*1.75;P(n,w,E,m.useMaxWidth),n.attr("viewBox",`${c.x-m.padding} ${c.y-m.padding} `+b+" "+w)},"draw"),at=y(e=>e?e.length*m.fontSizeFactor:1,"getLabelWidth"),L=y((e,i,o,s,d,h,x)=>{let a=new O({compound:!0,multigraph:!0}),n,u=!0;for(n=0;n<e.length;n++)if(e[n].stmt==="relation"){u=!1;break}o?a.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:u?1:m.edgeLengthFactor,nodeSep:u?1:50,isMultiGraph:!0}):a.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:u?1:m.edgeLengthFactor,nodeSep:u?1:50,ranker:"tight-tree",isMultiGraph:!0}),a.setDefaultEdgeLabel(function(){return{}});let l=x.db.getStates(),g=x.db.getRelations(),c=Object.keys(l),b=!0;for(let r of c){let f=l[r];o&&(f.parentId=o);let p;if(f.doc){let S=i.append("g").attr("id",f.id).attr("class","stateGroup");if(p=L(f.doc,S,f.id,!s,d,h,x),b){S=J(S,f,s);let B=S.node().getBBox();p.width=B.width,p.height=B.height+m.padding/2,z[f.id]={y:m.compositTitleSize}}}else p=D(i,f,a);if(f.note){let S={descriptions:[],id:f.id+"-note",note:f.note,type:"note"},B=D(i,S,a);f.note.position==="left of"?(a.setNode(p.id+"-note",B),a.setNode(p.id,p)):(a.setNode(p.id,p),a.setNode(p.id+"-note",B)),a.setParent(p.id,p.id+"-group"),a.setParent(p.id+"-note",p.id+"-group")}else a.setNode(p.id,p)}k.debug("Count=",a.nodeCount(),a);let w=0;g.forEach(function(r){w++,k.debug("Setting edge",r),a.setEdge(r.id1,r.id2,{relation:r,width:at(r.title),height:m.labelHeight*T.getRows(r.title).length,labelpos:"c"},"id"+w)}),C(a),k.debug("Graph after layout",a.nodes());let E=i.node();a.nodes().forEach(function(r){r!==void 0&&a.node(r)!==void 0?(k.warn("Node "+r+": "+JSON.stringify(a.node(r))),d.select("#"+E.id+" #"+r).attr("transform","translate("+(a.node(r).x-a.node(r).width/2)+","+(a.node(r).y+(z[r]?z[r].y:0)-a.node(r).height/2)+" )"),d.select("#"+E.id+" #"+r).attr("data-x-shift",a.node(r).x-a.node(r).width/2),h.querySelectorAll("#"+E.id+" #"+r+" .divider").forEach(f=>{let p=f.parentElement,S=0,B=0;p&&(p.parentElement&&(S=p.parentElement.getBBox().width),B=parseInt(p.getAttribute("data-x-shift"),10),Number.isNaN(B)&&(B=0)),f.setAttribute("x1",0-B+8),f.setAttribute("x2",S-B-8)})):k.debug("No Node "+r+": "+JSON.stringify(a.node(r)))});let N=E.getBBox();a.edges().forEach(function(r){r!==void 0&&a.edge(r)!==void 0&&(k.debug("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(a.edge(r))),Q(i,a.edge(r),a.edge(r).relation))}),N=E.getBBox();let M={id:o||"root",label:o||"root",width:0,height:0};return M.width=N.width+2*m.padding,M.height=N.height+2*m.padding,k.debug("Doc rendered",M,a),M},"renderDoc"),it={setConf:V,draw:et},lt={parser:U,get db(){return new v(1)},renderer:it,styles:G,init:y(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};export{lt as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as e,q as t,Y as a,_ as s}from"./chunk-3GS5O3IE-DkUjU0WD.js";import"./chunk-TBF5ZNIQ-DL5stGM1.js";import"./chunk-RWUO3TPN-BgRTY0_k.js";import{m as o}from"./index-BgeqpYgd.js";var g={parser:a,get db(){return new s(2)},renderer:t,styles:e,init:o(r=>{r.state||(r.state={}),r.state.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{g as diagram};
|