omni-context-cli 0.0.38 → 0.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +7 -7
- package/dist/clients/extension.vsix +0 -0
- package/dist/clients/web/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/dist/clients/web/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/dist/clients/web/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/dist/clients/web/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/dist/clients/web/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/dist/clients/web/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/dist/clients/web/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/dist/clients/web/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/dist/clients/web/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/dist/clients/web/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/dist/clients/web/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/dist/clients/web/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/dist/clients/web/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/dist/clients/web/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/dist/clients/web/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/dist/clients/web/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/dist/clients/web/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/dist/clients/web/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/dist/clients/web/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/dist/clients/web/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/dist/clients/web/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/dist/clients/web/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/dist/clients/web/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/dist/clients/web/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/dist/clients/web/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/dist/clients/web/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/dist/clients/web/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/dist/clients/web/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/dist/clients/web/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/dist/clients/web/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/dist/clients/web/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/dist/clients/web/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/dist/clients/web/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/dist/clients/web/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/dist/clients/web/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/dist/clients/web/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/dist/clients/web/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/dist/clients/web/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/dist/clients/web/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/dist/clients/web/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/dist/clients/web/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/dist/clients/web/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/dist/clients/web/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/dist/clients/web/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/dist/clients/web/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/dist/clients/web/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/dist/clients/web/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/dist/clients/web/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/dist/clients/web/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/dist/clients/web/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/dist/clients/web/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/dist/clients/web/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/dist/clients/web/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/dist/clients/web/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/dist/clients/web/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/dist/clients/web/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/dist/clients/web/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/dist/clients/web/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/dist/clients/web/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/dist/clients/web/assets/_baseUniq-BFIaUHWF.js +1 -0
- package/dist/clients/web/assets/arc-CX4sIPz0.js +1 -0
- package/dist/clients/web/assets/architectureDiagram-VXUJARFQ-ClAz1TdR.js +1 -0
- package/dist/clients/web/assets/blockDiagram-VD42YOAC-cXvv5Xme.js +1 -0
- package/dist/clients/web/assets/c4Diagram-YG6GDRKO-CrEaxiOQ.js +1 -0
- package/dist/clients/web/assets/channel-WvpFzh0S.js +1 -0
- package/dist/clients/web/assets/chunk-4BX2VUAB-Xr5eQ2jr.js +1 -0
- package/dist/clients/web/assets/chunk-55IACEB6-BrPAEmD2.js +1 -0
- package/dist/clients/web/assets/chunk-B4BG7PRW-Cja4muSQ.js +1 -0
- package/dist/clients/web/assets/chunk-DI55MBZ5-CO44EGwl.js +1 -0
- package/dist/clients/web/assets/chunk-FMBD7UC4-DHQTSncN.js +1 -0
- package/dist/clients/web/assets/chunk-QN33PNHL-C_u6j8ll.js +1 -0
- package/dist/clients/web/assets/chunk-QZHKN3VN-Baz9sG4a.js +1 -0
- package/dist/clients/web/assets/chunk-TZMSLE5B-BlXDqp8M.js +1 -0
- package/dist/clients/web/assets/classDiagram-2ON5EDUG-BGhuL3vX.js +1 -0
- package/dist/clients/web/assets/classDiagram-v2-WZHVMYZB-BGhuL3vX.js +1 -0
- package/dist/clients/web/assets/clone-BrjahQ2T.js +1 -0
- package/dist/clients/web/assets/cose-bilkent-S5V4N54A-DZWAEoy6.js +1 -0
- package/dist/clients/web/assets/cytoscape.esm-Cw0kmstm.js +9 -0
- package/dist/clients/web/assets/dagre-6UL2VRFP-qiPMpj-s.js +1 -0
- package/dist/clients/web/assets/defaultLocale-DK_abR1s.js +1 -0
- package/dist/clients/web/assets/diagram-PSM6KHXK-e6unNrWN.js +1 -0
- package/dist/clients/web/assets/diagram-QEK2KX5R-DMbTtJpL.js +1 -0
- package/dist/clients/web/assets/diagram-S2PKOQOG-DJzyjWuo.js +1 -0
- package/dist/clients/web/assets/erDiagram-Q2GNP2WA-X-nh9pp7.js +1 -0
- package/dist/clients/web/assets/flowDiagram-NV44I4VS-Cfyd4KjH.js +1 -0
- package/dist/clients/web/assets/ganttDiagram-JELNMOA3-Qr2DTISc.js +1 -0
- package/dist/clients/web/assets/gitGraphDiagram-NY62KEGX-D7fkew24.js +1 -0
- package/dist/clients/web/assets/graph-DbcIVQWO.js +1 -0
- package/dist/clients/web/assets/index-PxdJoyNn.js +27 -0
- package/dist/clients/web/assets/index-_TATy_re.css +1 -0
- package/dist/clients/web/assets/infoDiagram-WHAUD3N6-CIhYDMFh.js +1 -0
- package/dist/clients/web/assets/init-C9Lo50Hz.js +1 -0
- package/dist/clients/web/assets/journeyDiagram-XKPGCS4Q-D31lU2HV.js +1 -0
- package/dist/clients/web/assets/kanban-definition-3W4ZIXB7-Dld77aF_.js +1 -0
- package/dist/clients/web/assets/layout-DFoNjwYU.js +1 -0
- package/dist/clients/web/assets/linear-DhSwIfiB.js +1 -0
- package/dist/clients/web/assets/min-C_FjB4Pz.js +1 -0
- package/dist/clients/web/assets/mindmap-definition-VGOIOE7T-BZ6YN87L.js +1 -0
- package/dist/clients/web/assets/ordinal-2upbOM02.js +1 -0
- package/dist/clients/web/assets/pieDiagram-ADFJNKIX-DFxN-730.js +1 -0
- package/dist/clients/web/assets/quadrantDiagram-AYHSOK5B-qmd91frX.js +1 -0
- package/dist/clients/web/assets/requirementDiagram-UZGBJVZJ-DXXq7RCX.js +1 -0
- package/dist/clients/web/assets/sankeyDiagram-TZEHDZUN-BlyT9ih9.js +1 -0
- package/dist/clients/web/assets/sequenceDiagram-WL72ISMW-B07J5kyu.js +1 -0
- package/dist/clients/web/assets/stateDiagram-FKZM4ZOC-YrX5yZ-e.js +1 -0
- package/dist/clients/web/assets/stateDiagram-v2-4FDKWEC3-DkYEm35t.js +1 -0
- package/dist/clients/web/assets/timeline-definition-IT6M3QCI-bMWx8q5z.js +1 -0
- package/dist/clients/web/assets/treemap-KMMF4GRG-B8jlkm1c.js +1 -0
- package/dist/clients/web/assets/xychartDiagram-PRI3JC2R-38DLhcVC.js +1 -0
- package/dist/clients/web/index.html +16 -0
- package/package.json +4 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t;import{g as e}from"./chunk-55IACEB6-BrPAEmD2.js";import{s}from"./chunk-QN33PNHL-C_u6j8ll.js";import{_ as i,b as r,a as n,s as a,g as h,p as c,q as o,c as u,l,y as E,B as f,o as R,r as I,u as _}from"./index-PxdJoyNn.js";var S=function(){var t=i(function(t,e,s,i){for(s=s||{},i=t.length;i--;s[t[i]]=e);return s},"o"),e=[1,3],s=[1,4],r=[1,5],n=[1,6],a=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],h=[1,22],c=[2,7],o=[1,26],u=[1,27],l=[1,28],E=[1,29],f=[1,33],R=[1,34],I=[1,35],_=[1,36],S=[1,37],d=[1,38],b=[1,24],m=[1,31],T=[1,32],N=[1,30],k=[1,39],p=[1,40],v=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],y=[1,61],A=[89,90],L=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],C=[27,29],O=[1,70],g=[1,71],M=[1,72],q=[1,73],w=[1,74],D=[1,75],F=[1,76],P=[1,83],x=[1,80],U=[1,84],Y=[1,85],$=[1,86],V=[1,87],B=[1,88],Q=[1,89],H=[1,90],K=[1,91],j=[1,92],W=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],G=[63,64],z=[1,101],X=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],J=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Z=[1,110],tt=[1,106],et=[1,107],st=[1,108],it=[1,109],rt=[1,111],nt=[1,116],at=[1,117],ht=[1,114],ct=[1,115],ot={trace:i(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:i(function(t,e,s,i,r,n,a){var h=n.length-1;switch(r){case 4:this.$=n[h].trim(),i.setAccTitle(this.$);break;case 5:case 6:this.$=n[h].trim(),i.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:i.setDirection("TB");break;case 18:i.setDirection("BT");break;case 19:i.setDirection("RL");break;case 20:i.setDirection("LR");break;case 21:i.addRequirement(n[h-3],n[h-4]);break;case 22:i.addRequirement(n[h-5],n[h-6]),i.setClass([n[h-5]],n[h-3]);break;case 23:i.setNewReqId(n[h-2]);break;case 24:i.setNewReqText(n[h-2]);break;case 25:i.setNewReqRisk(n[h-2]);break;case 26:i.setNewReqVerifyMethod(n[h-2]);break;case 29:this.$=i.RequirementType.REQUIREMENT;break;case 30:this.$=i.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=i.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=i.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=i.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=i.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=i.RiskLevel.LOW_RISK;break;case 36:this.$=i.RiskLevel.MED_RISK;break;case 37:this.$=i.RiskLevel.HIGH_RISK;break;case 38:this.$=i.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=i.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=i.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=i.VerifyType.VERIFY_TEST;break;case 42:i.addElement(n[h-3]);break;case 43:i.addElement(n[h-5]),i.setClass([n[h-5]],n[h-3]);break;case 44:i.setNewElementType(n[h-2]);break;case 45:i.setNewElementDocRef(n[h-2]);break;case 48:i.addRelationship(n[h-2],n[h],n[h-4]);break;case 49:i.addRelationship(n[h-2],n[h-4],n[h]);break;case 50:this.$=i.Relationships.CONTAINS;break;case 51:this.$=i.Relationships.COPIES;break;case 52:this.$=i.Relationships.DERIVES;break;case 53:this.$=i.Relationships.SATISFIES;break;case 54:this.$=i.Relationships.VERIFIES;break;case 55:this.$=i.Relationships.REFINES;break;case 56:this.$=i.Relationships.TRACES;break;case 57:this.$=n[h-2],i.defineClass(n[h-1],n[h]);break;case 58:i.setClass(n[h-1],n[h]);break;case 59:i.setClass([n[h-2]],n[h]);break;case 60:case 62:case 65:this.$=[n[h]];break;case 61:case 63:this.$=n[h-2].concat([n[h]]);break;case 64:this.$=n[h-2],i.setCssStyle(n[h-1],n[h]);break;case 66:n[h-2].push(n[h]),this.$=n[h-2];break;case 68:this.$=n[h-1]+n[h]}},"anonymous"),table:[{3:1,4:2,6:e,9:s,11:r,13:n},{1:[3]},{3:8,4:2,5:[1,7],6:e,9:s,11:r,13:n},{5:[1,9]},{10:[1,10]},{12:[1,11]},t(a,[2,6]),{3:12,4:2,6:e,9:s,11:r,13:n},{1:[2,2]},{4:17,5:h,7:13,8:c,9:s,11:r,13:n,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:o,22:u,23:l,24:E,25:23,33:25,41:f,42:R,43:I,44:_,45:S,46:d,54:b,72:m,74:T,77:N,89:k,90:p},t(a,[2,4]),t(a,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:h,7:42,8:c,9:s,11:r,13:n,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:o,22:u,23:l,24:E,25:23,33:25,41:f,42:R,43:I,44:_,45:S,46:d,54:b,72:m,74:T,77:N,89:k,90:p},{4:17,5:h,7:43,8:c,9:s,11:r,13:n,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:o,22:u,23:l,24:E,25:23,33:25,41:f,42:R,43:I,44:_,45:S,46:d,54:b,72:m,74:T,77:N,89:k,90:p},{4:17,5:h,7:44,8:c,9:s,11:r,13:n,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:o,22:u,23:l,24:E,25:23,33:25,41:f,42:R,43:I,44:_,45:S,46:d,54:b,72:m,74:T,77:N,89:k,90:p},{4:17,5:h,7:45,8:c,9:s,11:r,13:n,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:o,22:u,23:l,24:E,25:23,33:25,41:f,42:R,43:I,44:_,45:S,46:d,54:b,72:m,74:T,77:N,89:k,90:p},{4:17,5:h,7:46,8:c,9:s,11:r,13:n,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:o,22:u,23:l,24:E,25:23,33:25,41:f,42:R,43:I,44:_,45:S,46:d,54:b,72:m,74:T,77:N,89:k,90:p},{4:17,5:h,7:47,8:c,9:s,11:r,13:n,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:o,22:u,23:l,24:E,25:23,33:25,41:f,42:R,43:I,44:_,45:S,46:d,54:b,72:m,74:T,77:N,89:k,90:p},{4:17,5:h,7:48,8:c,9:s,11:r,13:n,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:o,22:u,23:l,24:E,25:23,33:25,41:f,42:R,43:I,44:_,45:S,46:d,54:b,72:m,74:T,77:N,89:k,90:p},{4:17,5:h,7:49,8:c,9:s,11:r,13:n,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:o,22:u,23:l,24:E,25:23,33:25,41:f,42:R,43:I,44:_,45:S,46:d,54:b,72:m,74:T,77:N,89:k,90:p},{4:17,5:h,7:50,8:c,9:s,11:r,13:n,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:o,22:u,23:l,24:E,25:23,33:25,41:f,42:R,43:I,44:_,45:S,46:d,54:b,72:m,74:T,77:N,89:k,90:p},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},t(v,[2,17]),t(v,[2,18]),t(v,[2,19]),t(v,[2,20]),{30:60,33:62,75:y,89:k,90:p},{30:63,33:62,75:y,89:k,90:p},{30:64,33:62,75:y,89:k,90:p},t(A,[2,29]),t(A,[2,30]),t(A,[2,31]),t(A,[2,32]),t(A,[2,33]),t(A,[2,34]),t(L,[2,81]),t(L,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},t(C,[2,79]),t(C,[2,80]),{27:[1,67],29:[1,68]},t(C,[2,85]),t(C,[2,86]),{62:69,65:O,66:g,67:M,68:q,69:w,70:D,71:F},{62:77,65:O,66:g,67:M,68:q,69:w,70:D,71:F},{30:78,33:62,75:y,89:k,90:p},{73:79,75:P,76:x,78:81,79:82,80:U,81:Y,82:$,83:V,84:B,85:Q,86:H,87:K,88:j},t(W,[2,60]),t(W,[2,62]),{73:93,75:P,76:x,78:81,79:82,80:U,81:Y,82:$,83:V,84:B,85:Q,86:H,87:K,88:j},{30:94,33:62,75:y,76:x,89:k,90:p},{5:[1,95]},{30:96,33:62,75:y,89:k,90:p},{5:[1,97]},{30:98,33:62,75:y,89:k,90:p},{63:[1,99]},t(G,[2,50]),t(G,[2,51]),t(G,[2,52]),t(G,[2,53]),t(G,[2,54]),t(G,[2,55]),t(G,[2,56]),{64:[1,100]},t(v,[2,59],{76:x}),t(v,[2,64],{76:z}),{33:103,75:[1,102],89:k,90:p},t(X,[2,65],{79:104,75:P,80:U,81:Y,82:$,83:V,84:B,85:Q,86:H,87:K,88:j}),t(J,[2,67]),t(J,[2,69]),t(J,[2,70]),t(J,[2,71]),t(J,[2,72]),t(J,[2,73]),t(J,[2,74]),t(J,[2,75]),t(J,[2,76]),t(J,[2,77]),t(J,[2,78]),t(v,[2,57],{76:z}),t(v,[2,58],{76:x}),{5:Z,28:105,31:tt,34:et,36:st,38:it,40:rt},{27:[1,112],76:x},{5:nt,40:at,56:113,57:ht,59:ct},{27:[1,118],76:x},{33:119,89:k,90:p},{33:120,89:k,90:p},{75:P,78:121,79:82,80:U,81:Y,82:$,83:V,84:B,85:Q,86:H,87:K,88:j},t(W,[2,61]),t(W,[2,63]),t(J,[2,68]),t(v,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:Z,28:126,31:tt,34:et,36:st,38:it,40:rt},t(v,[2,28]),{5:[1,127]},t(v,[2,42]),{32:[1,128]},{32:[1,129]},{5:nt,40:at,56:130,57:ht,59:ct},t(v,[2,47]),{5:[1,131]},t(v,[2,48]),t(v,[2,49]),t(X,[2,66],{79:104,75:P,80:U,81:Y,82:$,83:V,84:B,85:Q,86:H,87:K,88:j}),{33:132,89:k,90:p},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},t(v,[2,27]),{5:Z,28:145,31:tt,34:et,36:st,38:it,40:rt},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},t(v,[2,46]),{5:nt,40:at,56:152,57:ht,59:ct},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},t(v,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},t(v,[2,43]),{5:Z,28:159,31:tt,34:et,36:st,38:it,40:rt},{5:Z,28:160,31:tt,34:et,36:st,38:it,40:rt},{5:Z,28:161,31:tt,34:et,36:st,38:it,40:rt},{5:Z,28:162,31:tt,34:et,36:st,38:it,40:rt},{5:nt,40:at,56:163,57:ht,59:ct},{5:nt,40:at,56:164,57:ht,59:ct},t(v,[2,23]),t(v,[2,24]),t(v,[2,25]),t(v,[2,26]),t(v,[2,44]),t(v,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:i(function(t,e){if(!e.recoverable){var s=new Error(t);throw s.hash=e,s}this.trace(t)},"parseError"),parse:i(function(t){var e=this,s=[0],r=[],n=[null],a=[],h=this.table,c="",o=0,u=0,l=a.slice.call(arguments,1),E=Object.create(this.lexer),f={yy:{}};for(var R in this.yy)Object.prototype.hasOwnProperty.call(this.yy,R)&&(f.yy[R]=this.yy[R]);E.setInput(t,f.yy),f.yy.lexer=E,f.yy.parser=this,void 0===E.yylloc&&(E.yylloc={});var I=E.yylloc;a.push(I);var _=E.options&&E.options.ranges;function S(){var t;return"number"!=typeof(t=r.pop()||E.lex()||1)&&(t instanceof Array&&(t=(r=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,i(function(t){s.length=s.length-2*t,n.length=n.length-t,a.length=a.length-t},"popStack"),i(S,"lex");for(var d,b,m,T,N,k,p,v,y={};;){if(b=s[s.length-1],this.defaultActions[b]?m=this.defaultActions[b]:(null==d&&(d=S()),m=h[b]&&h[b][d]),void 0===m||!m.length||!m[0]){var A="";for(N in v=[],h[b])this.terminals_[N]&&N>2&&v.push("'"+this.terminals_[N]+"'");A=E.showPosition?"Parse error on line "+(o+1)+":\n"+E.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[d]||d)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==d?"end of input":"'"+(this.terminals_[d]||d)+"'"),this.parseError(A,{text:E.match,token:this.terminals_[d]||d,line:E.yylineno,loc:I,expected:v})}if(m[0]instanceof Array&&m.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+d);switch(m[0]){case 1:s.push(d),n.push(E.yytext),a.push(E.yylloc),s.push(m[1]),d=null,u=E.yyleng,c=E.yytext,o=E.yylineno,I=E.yylloc;break;case 2:if(k=this.productions_[m[1]][1],y.$=n[n.length-k],y._$={first_line:a[a.length-(k||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(k||1)].first_column,last_column:a[a.length-1].last_column},_&&(y._$.range=[a[a.length-(k||1)].range[0],a[a.length-1].range[1]]),void 0!==(T=this.performAction.apply(y,[c,u,o,f.yy,m[1],n,a].concat(l))))return T;k&&(s=s.slice(0,-1*k*2),n=n.slice(0,-1*k),a=a.slice(0,-1*k)),s.push(this.productions_[m[1]][0]),n.push(y.$),a.push(y._$),p=h[s[s.length-2]][s[s.length-1]],s.push(p);break;case 3:return!0}}return!0},"parse")},ut=function(){return{EOF:1,parseError:i(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:i(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:i(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:i(function(t){var e=t.length,s=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),s.length-1&&(this.yylineno-=s.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:s?(s.length===i.length?this.yylloc.first_column:0)+i[i.length-s.length].length-s[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:i(function(){return this._more=!0,this},"more"),reject:i(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:i(function(t){this.unput(this.match.slice(t))},"less"),pastInput:i(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:i(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:i(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:i(function(t,e){var s,i,r;if(this.options.backtrack_lexer&&(r={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&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],s=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack){for(var n in r)this[n]=r[n];return!1}return!1},"test_match"),next:i(function(){if(this.done)return this.EOF;var t,e,s,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),n=0;n<r.length;n++)if((s=this._input.match(this.rules[r[n]]))&&(!e||s[0].length>e[0].length)){if(e=s,i=n,this.options.backtrack_lexer){if(!1!==(t=this.test_match(s,r[n])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:i(function(){var t=this.next();return t||this.lex()},"lex"),begin:i(function(t){this.conditionStack.push(t)},"begin"),popState:i(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:i(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:i(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:i(function(t){this.begin(t)},"pushState"),stateStackSize:i(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:i(function(t,e,s,i){switch(s){case 0:return"title";case 1:return this.begin("acc_title"),9;case 2:return this.popState(),"acc_title_value";case 3:return this.begin("acc_descr"),11;case 4:return this.popState(),"acc_descr_value";case 5:this.begin("acc_descr_multiline");break;case 6:case 58:case 65:this.popState();break;case 7:return"acc_descr_multiline_value";case 8:return 21;case 9:return 22;case 10:return 23;case 11:return 24;case 12:return 5;case 13:case 14:case 15:case 56:break;case 16:return 8;case 17:return 6;case 18:return 27;case 19:return 40;case 20:return 29;case 21:return 32;case 22:return 31;case 23:return 34;case 24:return 36;case 25:return 38;case 26:return 41;case 27:return 42;case 28:return 43;case 29:return 44;case 30:return 45;case 31:return 46;case 32:return 47;case 33:return 48;case 34:return 49;case 35:return 50;case 36:return 51;case 37:return 52;case 38:return 53;case 39:return 54;case 40:return 65;case 41:return 66;case 42:return 67;case 43:return 68;case 44:return 69;case 45:return 70;case 46:return 71;case 47:return 57;case 48:return 59;case 49:return this.begin("style"),77;case 50:case 68:return 75;case 51:return 81;case 52:return 88;case 53:return"PERCENT";case 54:return 86;case 55:return 84;case 57:case 64:this.begin("string");break;case 59:return this.begin("style"),72;case 60:return this.begin("style"),74;case 61:return 61;case 62:return 64;case 63:return 63;case 66:return"qString";case 67:return e.yytext=e.yytext.trim(),89;case 69:return 80;case 70:return 76}},"anonymous"),rules:[/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::{3})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:style\b)/i,/^(?:\w+)/i,/^(?::)/i,/^(?:;)/i,/^(?:%)/i,/^(?:-)/i,/^(?:#)/i,/^(?: )/i,/^(?:["])/i,/^(?:\n)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^:,\r\n\{\<\>\-\=]*)/i,/^(?:\w+)/i,/^(?:[0-9]+)/i,/^(?:,)/i],conditions:{acc_descr_multiline:{rules:[6,7,68,69,70],inclusive:!1},acc_descr:{rules:[4,68,69,70],inclusive:!1},acc_title:{rules:[2,68,69,70],inclusive:!1},style:{rules:[50,51,52,53,54,55,56,57,58,68,69,70],inclusive:!1},unqString:{rules:[68,69,70],inclusive:!1},token:{rules:[68,69,70],inclusive:!1},string:{rules:[65,66,68,69,70],inclusive:!1},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,59,60,61,62,63,64,67,68,69,70],inclusive:!0}}}}();function lt(){this.yy={}}return ot.lexer=ut,i(lt,"Parser"),lt.prototype=ot,ot.Parser=lt,new lt}();S.parser=S;var d=S,b=(i(t=class{constructor(){this.relations=[],this.latestRequirement=this.getInitialRequirement(),this.requirements=new Map,this.latestElement=this.getInitialElement(),this.elements=new Map,this.classes=new Map,this.direction="TB",this.RequirementType={REQUIREMENT:"Requirement",FUNCTIONAL_REQUIREMENT:"Functional Requirement",INTERFACE_REQUIREMENT:"Interface Requirement",PERFORMANCE_REQUIREMENT:"Performance Requirement",PHYSICAL_REQUIREMENT:"Physical Requirement",DESIGN_CONSTRAINT:"Design Constraint"},this.RiskLevel={LOW_RISK:"Low",MED_RISK:"Medium",HIGH_RISK:"High"},this.VerifyType={VERIFY_ANALYSIS:"Analysis",VERIFY_DEMONSTRATION:"Demonstration",VERIFY_INSPECTION:"Inspection",VERIFY_TEST:"Test"},this.Relationships={CONTAINS:"contains",COPIES:"copies",DERIVES:"derives",SATISFIES:"satisfies",VERIFIES:"verifies",REFINES:"refines",TRACES:"traces"},this.setAccTitle=r,this.getAccTitle=n,this.setAccDescription=a,this.getAccDescription=h,this.setDiagramTitle=c,this.getDiagramTitle=o,this.getConfig=i(()=>u().requirement,"getConfig"),this.clear(),this.setDirection=this.setDirection.bind(this),this.addRequirement=this.addRequirement.bind(this),this.setNewReqId=this.setNewReqId.bind(this),this.setNewReqRisk=this.setNewReqRisk.bind(this),this.setNewReqText=this.setNewReqText.bind(this),this.setNewReqVerifyMethod=this.setNewReqVerifyMethod.bind(this),this.addElement=this.addElement.bind(this),this.setNewElementType=this.setNewElementType.bind(this),this.setNewElementDocRef=this.setNewElementDocRef.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setCssStyle=this.setCssStyle.bind(this),this.setClass=this.setClass.bind(this),this.defineClass=this.defineClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}getDirection(){return this.direction}setDirection(t){this.direction=t}resetLatestRequirement(){this.latestRequirement=this.getInitialRequirement()}resetLatestElement(){this.latestElement=this.getInitialElement()}getInitialRequirement(){return{requirementId:"",text:"",risk:"",verifyMethod:"",name:"",type:"",cssStyles:[],classes:["default"]}}getInitialElement(){return{name:"",type:"",docRef:"",cssStyles:[],classes:["default"]}}addRequirement(t,e){return this.requirements.has(t)||this.requirements.set(t,{name:t,type:e,requirementId:this.latestRequirement.requirementId,text:this.latestRequirement.text,risk:this.latestRequirement.risk,verifyMethod:this.latestRequirement.verifyMethod,cssStyles:[],classes:["default"]}),this.resetLatestRequirement(),this.requirements.get(t)}getRequirements(){return this.requirements}setNewReqId(t){void 0!==this.latestRequirement&&(this.latestRequirement.requirementId=t)}setNewReqText(t){void 0!==this.latestRequirement&&(this.latestRequirement.text=t)}setNewReqRisk(t){void 0!==this.latestRequirement&&(this.latestRequirement.risk=t)}setNewReqVerifyMethod(t){void 0!==this.latestRequirement&&(this.latestRequirement.verifyMethod=t)}addElement(t){return this.elements.has(t)||(this.elements.set(t,{name:t,type:this.latestElement.type,docRef:this.latestElement.docRef,cssStyles:[],classes:["default"]}),l.info("Added new element: ",t)),this.resetLatestElement(),this.elements.get(t)}getElements(){return this.elements}setNewElementType(t){void 0!==this.latestElement&&(this.latestElement.type=t)}setNewElementDocRef(t){void 0!==this.latestElement&&(this.latestElement.docRef=t)}addRelationship(t,e,s){this.relations.push({type:t,src:e,dst:s})}getRelationships(){return this.relations}clear(){this.relations=[],this.resetLatestRequirement(),this.requirements=new Map,this.resetLatestElement(),this.elements=new Map,this.classes=new Map,E()}setCssStyle(t,e){for(const s of t){const t=this.requirements.get(s)??this.elements.get(s);if(!e||!t)return;for(const s of e)s.includes(",")?t.cssStyles.push(...s.split(",")):t.cssStyles.push(s)}}setClass(t,e){var s;for(const i of t){const t=this.requirements.get(i)??this.elements.get(i);if(t)for(const i of e){t.classes.push(i);const e=null==(s=this.classes.get(i))?void 0:s.styles;e&&t.cssStyles.push(...e)}}}defineClass(t,e){for(const s of t){let t=this.classes.get(s);void 0===t&&(t={id:s,styles:[],textStyles:[]},this.classes.set(s,t)),e&&e.forEach(function(e){if(/color/.exec(e)){const s=e.replace("fill","bgFill");t.textStyles.push(s)}t.styles.push(e)}),this.requirements.forEach(t=>{t.classes.includes(s)&&t.cssStyles.push(...e.flatMap(t=>t.split(",")))}),this.elements.forEach(t=>{t.classes.includes(s)&&t.cssStyles.push(...e.flatMap(t=>t.split(",")))})}}getClasses(){return this.classes}getData(){var t,e,s,i;const r=u(),n=[],a=[];for(const h of this.requirements.values()){const t=h;t.id=h.name,t.cssStyles=h.cssStyles,t.cssClasses=h.classes.join(" "),t.shape="requirementBox",t.look=r.look,n.push(t)}for(const h of this.elements.values()){const t=h;t.shape="requirementBox",t.look=r.look,t.id=h.name,t.cssStyles=h.cssStyles,t.cssClasses=h.classes.join(" "),n.push(t)}for(const h of this.relations){let n=0;const c=h.type===this.Relationships.CONTAINS,o={id:`${h.src}-${h.dst}-${n}`,start:(null==(t=this.requirements.get(h.src))?void 0:t.name)??(null==(e=this.elements.get(h.src))?void 0:e.name),end:(null==(s=this.requirements.get(h.dst))?void 0:s.name)??(null==(i=this.elements.get(h.dst))?void 0:i.name),label:`<<${h.type}>>`,classes:"relationshipLine",style:["fill:none",c?"":"stroke-dasharray: 10,7"],labelpos:"c",thickness:"normal",type:"normal",pattern:c?"normal":"dashed",arrowTypeStart:c?"requirement_contains":"",arrowTypeEnd:c?"":"requirement_arrow",look:r.look};a.push(o),n++}return{nodes:n,edges:a,other:{},config:r,direction:this.getDirection()}}},"RequirementDB"),t),m=i(t=>`\n\n marker {\n fill: ${t.relationColor};\n stroke: ${t.relationColor};\n }\n\n marker.cross {\n stroke: ${t.lineColor};\n }\n\n svg {\n font-family: ${t.fontFamily};\n font-size: ${t.fontSize};\n }\n\n .reqBox {\n fill: ${t.requirementBackground};\n fill-opacity: 1.0;\n stroke: ${t.requirementBorderColor};\n stroke-width: ${t.requirementBorderSize};\n }\n \n .reqTitle, .reqLabel{\n fill: ${t.requirementTextColor};\n }\n .reqLabelBox {\n fill: ${t.relationLabelBackground};\n fill-opacity: 1.0;\n }\n\n .req-title-line {\n stroke: ${t.requirementBorderColor};\n stroke-width: ${t.requirementBorderSize};\n }\n .relationshipLine {\n stroke: ${t.relationColor};\n stroke-width: 1;\n }\n .relationshipLabel {\n fill: ${t.relationLabelColor};\n }\n .divider {\n stroke: ${t.nodeBorder};\n stroke-width: 1;\n }\n .label {\n font-family: ${t.fontFamily};\n color: ${t.nodeTextColor||t.textColor};\n }\n .label text,span {\n fill: ${t.nodeTextColor||t.textColor};\n color: ${t.nodeTextColor||t.textColor};\n }\n .labelBkg {\n background-color: ${t.edgeLabelBackground};\n }\n\n`,"getStyles"),T={};f(T,{draw:()=>N});var N=i(async function(t,i,r,n){l.info("REF0:"),l.info("Drawing requirement diagram (unified)",i);const{securityLevel:a,state:h,layout:c}=u(),o=n.db.getData(),E=e(i,a);o.type=n.type,o.layoutAlgorithm=R(c),o.nodeSpacing=(null==h?void 0:h.nodeSpacing)??50,o.rankSpacing=(null==h?void 0:h.rankSpacing)??50,o.markers=["requirement_contains","requirement_arrow"],o.diagramId=i,await I(o,E);_.insertTitle(E,"requirementDiagramTitleText",(null==h?void 0:h.titleTopMargin)??25,n.db.getDiagramTitle()),s(E,8,"requirementDiagram",(null==h?void 0:h.useMaxWidth)??!0)},"draw"),k={parser:d,get db(){return new b},renderer:T,styles:m};export{k as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t,n,i;import{p as s,q as e,s as r,g as o,b as u,a as c,_ as h,c as f,z as a,d as l,V as d,y as p,k as v}from"./index-PxdJoyNn.js";import{o as g}from"./ordinal-2upbOM02.js";import"./init-C9Lo50Hz.js";const k=function(t){for(var n=t.length/6|0,i=new Array(n),s=0;s<n;)i[s]="#"+t.slice(6*s,6*++s);return i}("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function y(t,n){let i;if(void 0===n)for(const s of t)null!=s&&(i<s||void 0===i&&s>=s)&&(i=s);else{let s=-1;for(let e of t)null!=(e=n(e,++s,t))&&(i<e||void 0===i&&e>=e)&&(i=e)}return i}function w(t,n){let i;if(void 0===n)for(const s of t)null!=s&&(i>s||void 0===i&&s>=s)&&(i=s);else{let s=-1;for(let e of t)null!=(e=n(e,++s,t))&&(i>e||void 0===i&&e>=e)&&(i=e)}return i}function b(t,n){let i=0;if(void 0===n)for(let s of t)(s=+s)&&(i+=s);else{let s=-1;for(let e of t)(e=+n(e,++s,t))&&(i+=e)}return i}function m(t){return t.target.depth}function _(t,n){return t.sourceLinks.length?t.depth:n-1}function E(t){return function(){return t}}function x(t,n){return S(t.source,n.source)||t.index-n.index}function M(t,n){return S(t.target,n.target)||t.index-n.index}function S(t,n){return t.y0-n.y0}function A(t){return t.value}function L(t){return t.index}function T(t){return t.nodes}function N(t){return t.links}function I(t,n){const i=t.get(n);if(!i)throw new Error("missing: "+n);return i}function C({nodes:t}){for(const n of t){let t=n.y0,i=t;for(const s of n.sourceLinks)s.y0=t+s.width/2,t+=s.width;for(const s of n.targetLinks)s.y1=i+s.width/2,i+=s.width}}function O(){let t,n,i,s=0,e=0,r=1,o=1,u=24,c=8,h=L,f=_,a=T,l=N,d=6;function p(){const p={nodes:a.apply(null,arguments),links:l.apply(null,arguments)};return function({nodes:t,links:n}){for(const[i,e]of t.entries())e.index=i,e.sourceLinks=[],e.targetLinks=[];const s=new Map(t.map((n,i)=>[h(n,i,t),n]));for(const[i,e]of n.entries()){e.index=i;let{source:t,target:n}=e;"object"!=typeof t&&(t=e.source=I(s,t)),"object"!=typeof n&&(n=e.target=I(s,n)),t.sourceLinks.push(e),n.targetLinks.push(e)}if(null!=i)for(const{sourceLinks:e,targetLinks:r}of t)e.sort(i),r.sort(i)}(p),function({nodes:t}){for(const n of t)n.value=void 0===n.fixedValue?Math.max(b(n.sourceLinks,A),b(n.targetLinks,A)):n.fixedValue}(p),function({nodes:t}){const n=t.length;let i=new Set(t),s=new Set,e=0;for(;i.size;){for(const t of i){t.depth=e;for(const{target:n}of t.sourceLinks)s.add(n)}if(++e>n)throw new Error("circular link");i=s,s=new Set}}(p),function({nodes:t}){const n=t.length;let i=new Set(t),s=new Set,e=0;for(;i.size;){for(const t of i){t.height=e;for(const{source:n}of t.targetLinks)s.add(n)}if(++e>n)throw new Error("circular link");i=s,s=new Set}}(p),function(i){const h=function({nodes:t}){const i=y(t,t=>t.depth)+1,e=(r-s-u)/(i-1),o=new Array(i);for(const n of t){const t=Math.max(0,Math.min(i-1,Math.floor(f.call(null,n,i))));n.layer=t,n.x0=s+t*e,n.x1=n.x0+u,o[t]?o[t].push(n):o[t]=[n]}if(n)for(const s of o)s.sort(n);return o}(i);t=Math.min(c,(o-e)/(y(h,t=>t.length)-1)),function(n){const i=w(n,n=>(o-e-(n.length-1)*t)/b(n,A));for(const s of n){let n=e;for(const e of s){e.y0=n,e.y1=n+e.value*i,n=e.y1+t;for(const t of e.sourceLinks)t.width=t.value*i}n=(o-n+t)/(s.length+1);for(let t=0;t<s.length;++t){const i=s[t];i.y0+=n*(t+1),i.y1+=n*(t+1)}j(s)}}(h);for(let t=0;t<d;++t){const n=Math.pow(.99,t),i=Math.max(1-n,(t+1)/d);g(h,n,i),v(h,n,i)}}(p),C(p),p}function v(t,i,s){for(let e=1,r=t.length;e<r;++e){const r=t[e];for(const t of r){let n=0,s=0;for(const{source:i,value:r}of t.targetLinks){let e=r*(t.layer-i.layer);n+=P(i,t)*e,s+=e}if(!(s>0))continue;let e=(n/s-t.y0)*i;t.y0+=e,t.y1+=e,D(t)}void 0===n&&r.sort(S),k(r,s)}}function g(t,i,s){for(let e=t.length-2;e>=0;--e){const r=t[e];for(const t of r){let n=0,s=0;for(const{target:i,value:r}of t.sourceLinks){let e=r*(i.layer-t.layer);n+=$(t,i)*e,s+=e}if(!(s>0))continue;let e=(n/s-t.y0)*i;t.y0+=e,t.y1+=e,D(t)}void 0===n&&r.sort(S),k(r,s)}}function k(n,i){const s=n.length>>1,r=n[s];O(n,r.y0-t,s-1,i),m(n,r.y1+t,s+1,i),O(n,o,n.length-1,i),m(n,e,0,i)}function m(n,i,s,e){for(;s<n.length;++s){const r=n[s],o=(i-r.y0)*e;o>1e-6&&(r.y0+=o,r.y1+=o),i=r.y1+t}}function O(n,i,s,e){for(;s>=0;--s){const r=n[s],o=(r.y1-i)*e;o>1e-6&&(r.y0-=o,r.y1-=o),i=r.y0-t}}function D({sourceLinks:t,targetLinks:n}){if(void 0===i){for(const{source:{sourceLinks:t}}of n)t.sort(M);for(const{target:{targetLinks:n}}of t)n.sort(x)}}function j(t){if(void 0===i)for(const{sourceLinks:n,targetLinks:i}of t)n.sort(M),i.sort(x)}function P(n,i){let s=n.y0-(n.sourceLinks.length-1)*t/2;for(const{target:e,width:r}of n.sourceLinks){if(e===i)break;s+=r+t}for(const{source:t,width:e}of i.targetLinks){if(t===n)break;s-=e}return s}function $(n,i){let s=i.y0-(i.targetLinks.length-1)*t/2;for(const{source:e,width:r}of i.targetLinks){if(e===n)break;s+=r+t}for(const{target:t,width:e}of n.sourceLinks){if(t===i)break;s-=e}return s}return p.update=function(t){return C(t),t},p.nodeId=function(t){return arguments.length?(h="function"==typeof t?t:E(t),p):h},p.nodeAlign=function(t){return arguments.length?(f="function"==typeof t?t:E(t),p):f},p.nodeSort=function(t){return arguments.length?(n=t,p):n},p.nodeWidth=function(t){return arguments.length?(u=+t,p):u},p.nodePadding=function(n){return arguments.length?(c=t=+n,p):c},p.nodes=function(t){return arguments.length?(a="function"==typeof t?t:E(t),p):a},p.links=function(t){return arguments.length?(l="function"==typeof t?t:E(t),p):l},p.linkSort=function(t){return arguments.length?(i=t,p):i},p.size=function(t){return arguments.length?(s=e=0,r=+t[0],o=+t[1],p):[r-s,o-e]},p.extent=function(t){return arguments.length?(s=+t[0][0],r=+t[1][0],e=+t[0][1],o=+t[1][1],p):[[s,e],[r,o]]},p.iterations=function(t){return arguments.length?(d=+t,p):d},p}var D=Math.PI,j=2*D,P=1e-6,$=j-P;function U(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function z(){return new U}function F(t){return function(){return t}}function G(t){return t[0]}function X(t){return t[1]}U.prototype=z.prototype={constructor:U,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,i,s){this._+="Q"+ +t+","+ +n+","+(this._x1=+i)+","+(this._y1=+s)},bezierCurveTo:function(t,n,i,s,e,r){this._+="C"+ +t+","+ +n+","+ +i+","+ +s+","+(this._x1=+e)+","+(this._y1=+r)},arcTo:function(t,n,i,s,e){t=+t,n=+n,i=+i,s=+s,e=+e;var r=this._x1,o=this._y1,u=i-t,c=s-n,h=r-t,f=o-n,a=h*h+f*f;if(e<0)throw new Error("negative radius: "+e);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(a>P)if(Math.abs(f*u-c*h)>P&&e){var l=i-r,d=s-o,p=u*u+c*c,v=l*l+d*d,g=Math.sqrt(p),k=Math.sqrt(a),y=e*Math.tan((D-Math.acos((p+a-v)/(2*g*k)))/2),w=y/k,b=y/g;Math.abs(w-1)>P&&(this._+="L"+(t+w*h)+","+(n+w*f)),this._+="A"+e+","+e+",0,0,"+ +(f*l>h*d)+","+(this._x1=t+b*u)+","+(this._y1=n+b*c)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,n,i,s,e,r){t=+t,n=+n,r=!!r;var o=(i=+i)*Math.cos(s),u=i*Math.sin(s),c=t+o,h=n+u,f=1^r,a=r?s-e:e-s;if(i<0)throw new Error("negative radius: "+i);null===this._x1?this._+="M"+c+","+h:(Math.abs(this._x1-c)>P||Math.abs(this._y1-h)>P)&&(this._+="L"+c+","+h),i&&(a<0&&(a=a%j+j),a>$?this._+="A"+i+","+i+",0,1,"+f+","+(t-o)+","+(n-u)+"A"+i+","+i+",0,1,"+f+","+(this._x1=c)+","+(this._y1=h):a>P&&(this._+="A"+i+","+i+",0,"+ +(a>=D)+","+f+","+(this._x1=t+i*Math.cos(e))+","+(this._y1=n+i*Math.sin(e))))},rect:function(t,n,i,s){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +i+"v"+ +s+"h"+-i+"Z"},toString:function(){return this._}};var Q=Array.prototype.slice;function Y(t){return t.source}function q(t){return t.target}function B(t,n,i,s,e){t.moveTo(n,i),t.bezierCurveTo(n=(n+s)/2,i,n,e,s,e)}function K(){return function(t){var n=Y,i=q,s=G,e=X,r=null;function o(){var o,u=Q.call(arguments),c=n.apply(this,u),h=i.apply(this,u);if(r||(r=o=z()),t(r,+s.apply(this,(u[0]=c,u)),+e.apply(this,u),+s.apply(this,(u[0]=h,u)),+e.apply(this,u)),o)return r=null,o+""||null}return o.source=function(t){return arguments.length?(n=t,o):n},o.target=function(t){return arguments.length?(i=t,o):i},o.x=function(t){return arguments.length?(s="function"==typeof t?t:F(+t),o):s},o.y=function(t){return arguments.length?(e="function"==typeof t?t:F(+t),o):e},o.context=function(t){return arguments.length?(r=null==t?null:t,o):r},o}(B)}function R(t){return[t.source.x1,t.y0]}function W(t){return[t.target.x0,t.y1]}var Z=function(){var t=h(function(t,n,i,s){for(i=i||{},s=t.length;s--;i[t[s]]=n);return i},"o"),n=[1,9],i=[1,10],s=[1,5,10,12],e={trace:h(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:h(function(t,n,i,s,e,r,o){var u=r.length-1;switch(e){case 7:const t=s.findOrCreateNode(r[u-4].trim().replaceAll('""','"')),n=s.findOrCreateNode(r[u-2].trim().replaceAll('""','"')),i=parseFloat(r[u].trim());s.addLink(t,n,i);break;case 8:case 9:case 11:this.$=r[u];break;case 10:this.$=r[u-1]}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:n,20:i},{1:[2,6],7:11,10:[1,12]},t(i,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(s,[2,8]),t(s,[2,9]),{19:[1,16]},t(s,[2,11]),{1:[2,1]},{1:[2,5]},t(i,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:i},{15:18,16:7,17:8,18:n,20:i},{18:[1,19]},t(i,[2,3]),{12:[1,20]},t(s,[2,10]),{15:21,16:7,17:8,18:n,20:i},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:h(function(t,n){if(!n.recoverable){var i=new Error(t);throw i.hash=n,i}this.trace(t)},"parseError"),parse:h(function(t){var n=this,i=[0],s=[],e=[null],r=[],o=this.table,u="",c=0,f=0,a=r.slice.call(arguments,1),l=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);l.setInput(t,d.yy),d.yy.lexer=l,d.yy.parser=this,void 0===l.yylloc&&(l.yylloc={});var v=l.yylloc;r.push(v);var g=l.options&&l.options.ranges;function k(){var t;return"number"!=typeof(t=s.pop()||l.lex()||1)&&(t instanceof Array&&(t=(s=t).pop()),t=n.symbols_[t]||t),t}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,h(function(t){i.length=i.length-2*t,e.length=e.length-t,r.length=r.length-t},"popStack"),h(k,"lex");for(var y,w,b,m,_,E,x,M,S={};;){if(w=i[i.length-1],this.defaultActions[w]?b=this.defaultActions[w]:(null==y&&(y=k()),b=o[w]&&o[w][y]),void 0===b||!b.length||!b[0]){var A="";for(_ in M=[],o[w])this.terminals_[_]&&_>2&&M.push("'"+this.terminals_[_]+"'");A=l.showPosition?"Parse error on line "+(c+1)+":\n"+l.showPosition()+"\nExpecting "+M.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==y?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(A,{text:l.match,token:this.terminals_[y]||y,line:l.yylineno,loc:v,expected:M})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+w+", token: "+y);switch(b[0]){case 1:i.push(y),e.push(l.yytext),r.push(l.yylloc),i.push(b[1]),y=null,f=l.yyleng,u=l.yytext,c=l.yylineno,v=l.yylloc;break;case 2:if(E=this.productions_[b[1]][1],S.$=e[e.length-E],S._$={first_line:r[r.length-(E||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(E||1)].first_column,last_column:r[r.length-1].last_column},g&&(S._$.range=[r[r.length-(E||1)].range[0],r[r.length-1].range[1]]),void 0!==(m=this.performAction.apply(S,[u,f,c,d.yy,b[1],e,r].concat(a))))return m;E&&(i=i.slice(0,-1*E*2),e=e.slice(0,-1*E),r=r.slice(0,-1*E)),i.push(this.productions_[b[1]][0]),e.push(S.$),r.push(S._$),x=o[i[i.length-2]][i[i.length-1]],i.push(x);break;case 3:return!0}}return!0},"parse")},r=function(){return{EOF:1,parseError:h(function(t,n){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,n)},"parseError"),setInput:h(function(t,n){return this.yy=n||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:h(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:h(function(t){var n=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var s=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),i.length-1&&(this.yylineno-=i.length-1);var e=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:i?(i.length===s.length?this.yylloc.first_column:0)+s[s.length-i.length].length-i[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:h(function(){return this._more=!0,this},"more"),reject:h(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:h(function(t){this.unput(this.match.slice(t))},"less"),pastInput:h(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:h(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:h(function(){var t=this.pastInput(),n=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+n+"^"},"showPosition"),test_match:h(function(t,n){var i,s,e;if(this.options.backtrack_lexer&&(e={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&&(e.yylloc.range=this.yylloc.range.slice(0))),(s=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var r in e)this[r]=e[r];return!1}return!1},"test_match"),next:h(function(){if(this.done)return this.EOF;var t,n,i,s;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var e=this._currentRules(),r=0;r<e.length;r++)if((i=this._input.match(this.rules[e[r]]))&&(!n||i[0].length>n[0].length)){if(n=i,s=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,e[r])))return t;if(this._backtrack){n=!1;continue}return!1}if(!this.options.flex)break}return n?!1!==(t=this.test_match(n,e[s]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:h(function(){var t=this.next();return t||this.lex()},"lex"),begin:h(function(t){this.conditionStack.push(t)},"begin"),popState:h(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:h(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:h(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:h(function(t){this.begin(t)},"pushState"),stateStackSize:h(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:h(function(t,n,i,s){switch(i){case 0:case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}}}();function o(){this.yy={}}return e.lexer=r,h(o,"Parser"),o.prototype=e,e.Parser=o,new o}();Z.parser=Z;var V=Z,H=[],J=[],tt=new Map,nt=h(()=>{H=[],J=[],tt=new Map,p()},"clear"),it=(h(t=class{constructor(t,n,i=0){this.source=t,this.target=n,this.value=i}},"SankeyLink"),t),st=h((t,n,i)=>{H.push(new it(t,n,i))},"addLink"),et=(h(n=class{constructor(t){this.ID=t}},"SankeyNode"),n),rt=h(t=>{t=v.sanitizeText(t,f());let n=tt.get(t);return void 0===n&&(n=new et(t),tt.set(t,n),J.push(n)),n},"findOrCreateNode"),ot=h(()=>J,"getNodes"),ut=h(()=>H,"getLinks"),ct=h(()=>({nodes:J.map(t=>({id:t.ID})),links:H.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),ht={nodesMap:tt,getConfig:h(()=>f().sankey,"getConfig"),getNodes:ot,getLinks:ut,getGraph:ct,addLink:st,findOrCreateNode:rt,getAccTitle:c,setAccTitle:u,getAccDescription:o,setAccDescription:r,getDiagramTitle:e,setDiagramTitle:s,clear:nt},ft=(h(i=class{static next(t){return new i(t+ ++i.count)}constructor(t){this.id=t,this.href=`#${t}`}toString(){return"url("+this.href+")"}},"Uid"),i.count=0,i),at={left:function(t){return t.depth},right:function(t,n){return n-1-t.height},center:function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?w(t.sourceLinks,m)-1:0},justify:_},lt={draw:h(function(t,n,i,s){const{securityLevel:e,sankey:r}=f(),o=a.sankey;let u;"sandbox"===e&&(u=l("#i"+n));const c=l("sandbox"===e?u.nodes()[0].contentDocument.body:"body"),p="sandbox"===e?c.select(`[id="${n}"]`):l(`[id="${n}"]`),v=(null==r?void 0:r.width)??o.width,y=(null==r?void 0:r.height)??o.width,w=(null==r?void 0:r.useMaxWidth)??o.useMaxWidth,b=(null==r?void 0:r.nodeAlignment)??o.nodeAlignment,m=(null==r?void 0:r.prefix)??o.prefix,_=(null==r?void 0:r.suffix)??o.suffix,E=(null==r?void 0:r.showValues)??o.showValues,x=s.db.getGraph(),M=at[b];O().nodeId(t=>t.id).nodeWidth(10).nodePadding(10+(E?15:0)).nodeAlign(M).extent([[0,0],[v,y]])(x);const S=g(k);p.append("g").attr("class","nodes").selectAll(".node").data(x.nodes).join("g").attr("class","node").attr("id",t=>(t.uid=ft.next("node-")).id).attr("transform",function(t){return"translate("+t.x0+","+t.y0+")"}).attr("x",t=>t.x0).attr("y",t=>t.y0).append("rect").attr("height",t=>t.y1-t.y0).attr("width",t=>t.x1-t.x0).attr("fill",t=>S(t.id));const A=h(({id:t,value:n})=>E?`${t}\n${m}${Math.round(100*n)/100}${_}`:t,"getText");p.append("g").attr("class","node-labels").attr("font-size",14).selectAll("text").data(x.nodes).join("text").attr("x",t=>t.x0<v/2?t.x1+6:t.x0-6).attr("y",t=>(t.y1+t.y0)/2).attr("dy",(E?"0":"0.35")+"em").attr("text-anchor",t=>t.x0<v/2?"start":"end").text(A);const L=p.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(x.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),T=(null==r?void 0:r.linkColor)??"gradient";if("gradient"===T){const t=L.append("linearGradient").attr("id",t=>(t.uid=ft.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",t=>t.source.x1).attr("x2",t=>t.target.x0);t.append("stop").attr("offset","0%").attr("stop-color",t=>S(t.source.id)),t.append("stop").attr("offset","100%").attr("stop-color",t=>S(t.target.id))}let N;switch(T){case"gradient":N=h(t=>t.uid,"coloring");break;case"source":N=h(t=>S(t.source.id),"coloring");break;case"target":N=h(t=>S(t.target.id),"coloring");break;default:N=T}L.append("path").attr("d",K().source(R).target(W)).attr("stroke",N).attr("stroke-width",t=>Math.max(1,t.width)),d(void 0,p,0,w)},"draw")},dt=h(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,"\n").trim(),"prepareTextForParsing"),pt=h(t=>`.label {\n font-family: ${t.fontFamily};\n }`,"getStyles"),vt=V.parse.bind(V);V.parse=t=>vt(dt(t));var gt={styles:pt,parser:V,db:ht,renderer:lt};export{gt as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t;import{a as e,b as s,g as i,d as a,c as n,e as r}from"./chunk-TZMSLE5B-BlXDqp8M.js";import{_ as o,n as c,c as l,d as h,l as d,j as u,e as p,f,k as y,b,s as x,p as v,a as m,g as k,q as g,t as w,J as T,y as _,i as A,u as $,L as I,M as O,N as E,Z as L,O as S,P as N,F as D}from"./index-PxdJoyNn.js";import{I as M}from"./chunk-QZHKN3VN-Baz9sG4a.js";var P=function(){var t=o(function(t,e,s,i){for(s=s||{},i=t.length;i--;s[t[i]]=e);return s},"o"),e=[1,2],s=[1,3],i=[1,4],a=[2,4],n=[1,9],r=[1,11],c=[1,13],l=[1,14],h=[1,16],d=[1,17],u=[1,18],p=[1,24],f=[1,25],y=[1,26],b=[1,27],x=[1,28],v=[1,29],m=[1,30],k=[1,31],g=[1,32],w=[1,33],T=[1,34],_=[1,35],A=[1,36],$=[1,37],I=[1,38],O=[1,39],E=[1,41],L=[1,42],S=[1,43],N=[1,44],D=[1,45],M=[1,46],P=[1,4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,48,49,50,52,53,55,60,61,62,63,71],R=[2,71],C=[4,5,16,50,52,53],B=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,55,60,61,62,63,71],F=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,49,50,52,53,55,60,61,62,63,71],q=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,48,50,52,53,55,60,61,62,63,71],W=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,50,52,53,55,60,61,62,63,71],j=[69,70,71],z=[1,127],V={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,box_section:10,box_line:11,participant_statement:12,create:13,box:14,restOfLine:15,end:16,signal:17,autonumber:18,NUM:19,off:20,activate:21,actor:22,deactivate:23,note_statement:24,links_statement:25,link_statement:26,properties_statement:27,details_statement:28,title:29,legacy_title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,loop:36,rect:37,opt:38,alt:39,else_sections:40,par:41,par_sections:42,par_over:43,critical:44,option_sections:45,break:46,option:47,and:48,else:49,participant:50,AS:51,participant_actor:52,destroy:53,actor_with_config:54,note:55,placement:56,text2:57,over:58,actor_pair:59,links:60,link:61,properties:62,details:63,spaceList:64,",":65,left_of:66,right_of:67,signaltype:68,"+":69,"-":70,ACTOR:71,config_object:72,CONFIG_START:73,CONFIG_CONTENT:74,CONFIG_END:75,SOLID_OPEN_ARROW:76,DOTTED_OPEN_ARROW:77,SOLID_ARROW:78,BIDIRECTIONAL_SOLID_ARROW:79,DOTTED_ARROW:80,BIDIRECTIONAL_DOTTED_ARROW:81,SOLID_CROSS:82,DOTTED_CROSS:83,SOLID_POINT:84,DOTTED_POINT:85,TXT:86,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",13:"create",14:"box",15:"restOfLine",16:"end",18:"autonumber",19:"NUM",20:"off",21:"activate",23:"deactivate",29:"title",30:"legacy_title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"loop",37:"rect",38:"opt",39:"alt",41:"par",43:"par_over",44:"critical",46:"break",47:"option",48:"and",49:"else",50:"participant",51:"AS",52:"participant_actor",53:"destroy",55:"note",58:"over",60:"links",61:"link",62:"properties",63:"details",65:",",66:"left_of",67:"right_of",69:"+",70:"-",71:"ACTOR",73:"CONFIG_START",74:"CONFIG_CONTENT",75:"CONFIG_END",76:"SOLID_OPEN_ARROW",77:"DOTTED_OPEN_ARROW",78:"SOLID_ARROW",79:"BIDIRECTIONAL_SOLID_ARROW",80:"DOTTED_ARROW",81:"BIDIRECTIONAL_DOTTED_ARROW",82:"SOLID_CROSS",83:"DOTTED_CROSS",84:"SOLID_POINT",85:"DOTTED_POINT",86:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[10,0],[10,2],[11,2],[11,1],[11,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[45,1],[45,4],[42,1],[42,4],[40,1],[40,4],[12,5],[12,3],[12,5],[12,3],[12,3],[12,3],[24,4],[24,4],[25,3],[26,3],[27,3],[28,3],[64,2],[64,1],[59,3],[59,1],[56,1],[56,1],[17,5],[17,5],[17,4],[54,2],[72,3],[22,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[68,1],[57,1]],performAction:o(function(t,e,s,i,a,n,r){var o=n.length-1;switch(a){case 3:return i.apply(n[o]),n[o];case 4:case 9:case 8:case 13:this.$=[];break;case 5:case 10:n[o-1].push(n[o]),this.$=n[o-1];break;case 6:case 7:case 11:case 12:case 63:this.$=n[o];break;case 15:n[o].type="createParticipant",this.$=n[o];break;case 16:n[o-1].unshift({type:"boxStart",boxData:i.parseBoxData(n[o-2])}),n[o-1].push({type:"boxEnd",boxText:n[o-2]}),this.$=n[o-1];break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(n[o-2]),sequenceIndexStep:Number(n[o-1]),sequenceVisible:!0,signalType:i.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(n[o-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:i.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:i.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:i.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"activeStart",signalType:i.LINETYPE.ACTIVE_START,actor:n[o-1].actor};break;case 23:this.$={type:"activeEnd",signalType:i.LINETYPE.ACTIVE_END,actor:n[o-1].actor};break;case 29:i.setDiagramTitle(n[o].substring(6)),this.$=n[o].substring(6);break;case 30:i.setDiagramTitle(n[o].substring(7)),this.$=n[o].substring(7);break;case 31:this.$=n[o].trim(),i.setAccTitle(this.$);break;case 32:case 33:this.$=n[o].trim(),i.setAccDescription(this.$);break;case 34:n[o-1].unshift({type:"loopStart",loopText:i.parseMessage(n[o-2]),signalType:i.LINETYPE.LOOP_START}),n[o-1].push({type:"loopEnd",loopText:n[o-2],signalType:i.LINETYPE.LOOP_END}),this.$=n[o-1];break;case 35:n[o-1].unshift({type:"rectStart",color:i.parseMessage(n[o-2]),signalType:i.LINETYPE.RECT_START}),n[o-1].push({type:"rectEnd",color:i.parseMessage(n[o-2]),signalType:i.LINETYPE.RECT_END}),this.$=n[o-1];break;case 36:n[o-1].unshift({type:"optStart",optText:i.parseMessage(n[o-2]),signalType:i.LINETYPE.OPT_START}),n[o-1].push({type:"optEnd",optText:i.parseMessage(n[o-2]),signalType:i.LINETYPE.OPT_END}),this.$=n[o-1];break;case 37:n[o-1].unshift({type:"altStart",altText:i.parseMessage(n[o-2]),signalType:i.LINETYPE.ALT_START}),n[o-1].push({type:"altEnd",signalType:i.LINETYPE.ALT_END}),this.$=n[o-1];break;case 38:n[o-1].unshift({type:"parStart",parText:i.parseMessage(n[o-2]),signalType:i.LINETYPE.PAR_START}),n[o-1].push({type:"parEnd",signalType:i.LINETYPE.PAR_END}),this.$=n[o-1];break;case 39:n[o-1].unshift({type:"parStart",parText:i.parseMessage(n[o-2]),signalType:i.LINETYPE.PAR_OVER_START}),n[o-1].push({type:"parEnd",signalType:i.LINETYPE.PAR_END}),this.$=n[o-1];break;case 40:n[o-1].unshift({type:"criticalStart",criticalText:i.parseMessage(n[o-2]),signalType:i.LINETYPE.CRITICAL_START}),n[o-1].push({type:"criticalEnd",signalType:i.LINETYPE.CRITICAL_END}),this.$=n[o-1];break;case 41:n[o-1].unshift({type:"breakStart",breakText:i.parseMessage(n[o-2]),signalType:i.LINETYPE.BREAK_START}),n[o-1].push({type:"breakEnd",optText:i.parseMessage(n[o-2]),signalType:i.LINETYPE.BREAK_END}),this.$=n[o-1];break;case 43:this.$=n[o-3].concat([{type:"option",optionText:i.parseMessage(n[o-1]),signalType:i.LINETYPE.CRITICAL_OPTION},n[o]]);break;case 45:this.$=n[o-3].concat([{type:"and",parText:i.parseMessage(n[o-1]),signalType:i.LINETYPE.PAR_AND},n[o]]);break;case 47:this.$=n[o-3].concat([{type:"else",altText:i.parseMessage(n[o-1]),signalType:i.LINETYPE.ALT_ELSE},n[o]]);break;case 48:n[o-3].draw="participant",n[o-3].type="addParticipant",n[o-3].description=i.parseMessage(n[o-1]),this.$=n[o-3];break;case 49:case 53:n[o-1].draw="participant",n[o-1].type="addParticipant",this.$=n[o-1];break;case 50:n[o-3].draw="actor",n[o-3].type="addParticipant",n[o-3].description=i.parseMessage(n[o-1]),this.$=n[o-3];break;case 51:n[o-1].draw="actor",n[o-1].type="addParticipant",this.$=n[o-1];break;case 52:n[o-1].type="destroyParticipant",this.$=n[o-1];break;case 54:this.$=[n[o-1],{type:"addNote",placement:n[o-2],actor:n[o-1].actor,text:n[o]}];break;case 55:n[o-2]=[].concat(n[o-1],n[o-1]).slice(0,2),n[o-2][0]=n[o-2][0].actor,n[o-2][1]=n[o-2][1].actor,this.$=[n[o-1],{type:"addNote",placement:i.PLACEMENT.OVER,actor:n[o-2].slice(0,2),text:n[o]}];break;case 56:this.$=[n[o-1],{type:"addLinks",actor:n[o-1].actor,text:n[o]}];break;case 57:this.$=[n[o-1],{type:"addALink",actor:n[o-1].actor,text:n[o]}];break;case 58:this.$=[n[o-1],{type:"addProperties",actor:n[o-1].actor,text:n[o]}];break;case 59:this.$=[n[o-1],{type:"addDetails",actor:n[o-1].actor,text:n[o]}];break;case 62:this.$=[n[o-2],n[o]];break;case 64:this.$=i.PLACEMENT.LEFTOF;break;case 65:this.$=i.PLACEMENT.RIGHTOF;break;case 66:this.$=[n[o-4],n[o-1],{type:"addMessage",from:n[o-4].actor,to:n[o-1].actor,signalType:n[o-3],msg:n[o],activate:!0},{type:"activeStart",signalType:i.LINETYPE.ACTIVE_START,actor:n[o-1].actor}];break;case 67:this.$=[n[o-4],n[o-1],{type:"addMessage",from:n[o-4].actor,to:n[o-1].actor,signalType:n[o-3],msg:n[o]},{type:"activeEnd",signalType:i.LINETYPE.ACTIVE_END,actor:n[o-4].actor}];break;case 68:this.$=[n[o-3],n[o-1],{type:"addMessage",from:n[o-3].actor,to:n[o-1].actor,signalType:n[o-2],msg:n[o]}];break;case 69:this.$={type:"addParticipant",actor:n[o-1],config:n[o]};break;case 70:this.$=n[o-1].trim();break;case 71:this.$={type:"addParticipant",actor:n[o]};break;case 72:this.$=i.LINETYPE.SOLID_OPEN;break;case 73:this.$=i.LINETYPE.DOTTED_OPEN;break;case 74:this.$=i.LINETYPE.SOLID;break;case 75:this.$=i.LINETYPE.BIDIRECTIONAL_SOLID;break;case 76:this.$=i.LINETYPE.DOTTED;break;case 77:this.$=i.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 78:this.$=i.LINETYPE.SOLID_CROSS;break;case 79:this.$=i.LINETYPE.DOTTED_CROSS;break;case 80:this.$=i.LINETYPE.SOLID_POINT;break;case 81:this.$=i.LINETYPE.DOTTED_POINT;break;case 82:this.$=i.parseMessage(n[o].trim().substring(1))}},"anonymous"),table:[{3:1,4:e,5:s,6:i},{1:[3]},{3:5,4:e,5:s,6:i},{3:6,4:e,5:s,6:i},t([1,4,5,13,14,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,55,60,61,62,63,71],a,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:n,5:r,8:8,9:10,12:12,13:c,14:l,17:15,18:h,21:d,22:40,23:u,24:19,25:20,26:21,27:22,28:23,29:p,30:f,31:y,33:b,35:x,36:v,37:m,38:k,39:g,41:w,43:T,44:_,46:A,50:$,52:I,53:O,55:E,60:L,61:S,62:N,63:D,71:M},t(P,[2,5]),{9:47,12:12,13:c,14:l,17:15,18:h,21:d,22:40,23:u,24:19,25:20,26:21,27:22,28:23,29:p,30:f,31:y,33:b,35:x,36:v,37:m,38:k,39:g,41:w,43:T,44:_,46:A,50:$,52:I,53:O,55:E,60:L,61:S,62:N,63:D,71:M},t(P,[2,7]),t(P,[2,8]),t(P,[2,14]),{12:48,50:$,52:I,53:O},{15:[1,49]},{5:[1,50]},{5:[1,53],19:[1,51],20:[1,52]},{22:54,71:M},{22:55,71:M},{5:[1,56]},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},t(P,[2,29]),t(P,[2,30]),{32:[1,61]},{34:[1,62]},t(P,[2,33]),{15:[1,63]},{15:[1,64]},{15:[1,65]},{15:[1,66]},{15:[1,67]},{15:[1,68]},{15:[1,69]},{15:[1,70]},{22:71,54:72,71:[1,73]},{22:74,71:M},{22:75,71:M},{68:76,76:[1,77],77:[1,78],78:[1,79],79:[1,80],80:[1,81],81:[1,82],82:[1,83],83:[1,84],84:[1,85],85:[1,86]},{56:87,58:[1,88],66:[1,89],67:[1,90]},{22:91,71:M},{22:92,71:M},{22:93,71:M},{22:94,71:M},t([5,51,65,76,77,78,79,80,81,82,83,84,85,86],R),t(P,[2,6]),t(P,[2,15]),t(C,[2,9],{10:95}),t(P,[2,17]),{5:[1,97],19:[1,96]},{5:[1,98]},t(P,[2,21]),{5:[1,99]},{5:[1,100]},t(P,[2,24]),t(P,[2,25]),t(P,[2,26]),t(P,[2,27]),t(P,[2,28]),t(P,[2,31]),t(P,[2,32]),t(B,a,{7:101}),t(B,a,{7:102}),t(B,a,{7:103}),t(F,a,{40:104,7:105}),t(q,a,{42:106,7:107}),t(q,a,{7:107,42:108}),t(W,a,{45:109,7:110}),t(B,a,{7:111}),{5:[1,113],51:[1,112]},{5:[1,114]},t([5,51],R,{72:115,73:[1,116]}),{5:[1,118],51:[1,117]},{5:[1,119]},{22:122,69:[1,120],70:[1,121],71:M},t(j,[2,72]),t(j,[2,73]),t(j,[2,74]),t(j,[2,75]),t(j,[2,76]),t(j,[2,77]),t(j,[2,78]),t(j,[2,79]),t(j,[2,80]),t(j,[2,81]),{22:123,71:M},{22:125,59:124,71:M},{71:[2,64]},{71:[2,65]},{57:126,86:z},{57:128,86:z},{57:129,86:z},{57:130,86:z},{4:[1,133],5:[1,135],11:132,12:134,16:[1,131],50:$,52:I,53:O},{5:[1,136]},t(P,[2,19]),t(P,[2,20]),t(P,[2,22]),t(P,[2,23]),{4:n,5:r,8:8,9:10,12:12,13:c,14:l,16:[1,137],17:15,18:h,21:d,22:40,23:u,24:19,25:20,26:21,27:22,28:23,29:p,30:f,31:y,33:b,35:x,36:v,37:m,38:k,39:g,41:w,43:T,44:_,46:A,50:$,52:I,53:O,55:E,60:L,61:S,62:N,63:D,71:M},{4:n,5:r,8:8,9:10,12:12,13:c,14:l,16:[1,138],17:15,18:h,21:d,22:40,23:u,24:19,25:20,26:21,27:22,28:23,29:p,30:f,31:y,33:b,35:x,36:v,37:m,38:k,39:g,41:w,43:T,44:_,46:A,50:$,52:I,53:O,55:E,60:L,61:S,62:N,63:D,71:M},{4:n,5:r,8:8,9:10,12:12,13:c,14:l,16:[1,139],17:15,18:h,21:d,22:40,23:u,24:19,25:20,26:21,27:22,28:23,29:p,30:f,31:y,33:b,35:x,36:v,37:m,38:k,39:g,41:w,43:T,44:_,46:A,50:$,52:I,53:O,55:E,60:L,61:S,62:N,63:D,71:M},{16:[1,140]},{4:n,5:r,8:8,9:10,12:12,13:c,14:l,16:[2,46],17:15,18:h,21:d,22:40,23:u,24:19,25:20,26:21,27:22,28:23,29:p,30:f,31:y,33:b,35:x,36:v,37:m,38:k,39:g,41:w,43:T,44:_,46:A,49:[1,141],50:$,52:I,53:O,55:E,60:L,61:S,62:N,63:D,71:M},{16:[1,142]},{4:n,5:r,8:8,9:10,12:12,13:c,14:l,16:[2,44],17:15,18:h,21:d,22:40,23:u,24:19,25:20,26:21,27:22,28:23,29:p,30:f,31:y,33:b,35:x,36:v,37:m,38:k,39:g,41:w,43:T,44:_,46:A,48:[1,143],50:$,52:I,53:O,55:E,60:L,61:S,62:N,63:D,71:M},{16:[1,144]},{16:[1,145]},{4:n,5:r,8:8,9:10,12:12,13:c,14:l,16:[2,42],17:15,18:h,21:d,22:40,23:u,24:19,25:20,26:21,27:22,28:23,29:p,30:f,31:y,33:b,35:x,36:v,37:m,38:k,39:g,41:w,43:T,44:_,46:A,47:[1,146],50:$,52:I,53:O,55:E,60:L,61:S,62:N,63:D,71:M},{4:n,5:r,8:8,9:10,12:12,13:c,14:l,16:[1,147],17:15,18:h,21:d,22:40,23:u,24:19,25:20,26:21,27:22,28:23,29:p,30:f,31:y,33:b,35:x,36:v,37:m,38:k,39:g,41:w,43:T,44:_,46:A,50:$,52:I,53:O,55:E,60:L,61:S,62:N,63:D,71:M},{15:[1,148]},t(P,[2,49]),t(P,[2,53]),{5:[2,69]},{74:[1,149]},{15:[1,150]},t(P,[2,51]),t(P,[2,52]),{22:151,71:M},{22:152,71:M},{57:153,86:z},{57:154,86:z},{57:155,86:z},{65:[1,156],86:[2,63]},{5:[2,56]},{5:[2,82]},{5:[2,57]},{5:[2,58]},{5:[2,59]},t(P,[2,16]),t(C,[2,10]),{12:157,50:$,52:I,53:O},t(C,[2,12]),t(C,[2,13]),t(P,[2,18]),t(P,[2,34]),t(P,[2,35]),t(P,[2,36]),t(P,[2,37]),{15:[1,158]},t(P,[2,38]),{15:[1,159]},t(P,[2,39]),t(P,[2,40]),{15:[1,160]},t(P,[2,41]),{5:[1,161]},{75:[1,162]},{5:[1,163]},{57:164,86:z},{57:165,86:z},{5:[2,68]},{5:[2,54]},{5:[2,55]},{22:166,71:M},t(C,[2,11]),t(F,a,{7:105,40:167}),t(q,a,{7:107,42:168}),t(W,a,{7:110,45:169}),t(P,[2,48]),{5:[2,70]},t(P,[2,50]),{5:[2,66]},{5:[2,67]},{86:[2,62]},{16:[2,47]},{16:[2,45]},{16:[2,43]}],defaultActions:{5:[2,1],6:[2,2],89:[2,64],90:[2,65],115:[2,69],126:[2,56],127:[2,82],128:[2,57],129:[2,58],130:[2,59],153:[2,68],154:[2,54],155:[2,55],162:[2,70],164:[2,66],165:[2,67],166:[2,62],167:[2,47],168:[2,45],169:[2,43]},parseError:o(function(t,e){if(!e.recoverable){var s=new Error(t);throw s.hash=e,s}this.trace(t)},"parseError"),parse:o(function(t){var e=this,s=[0],i=[],a=[null],n=[],r=this.table,c="",l=0,h=0,d=n.slice.call(arguments,1),u=Object.create(this.lexer),p={yy:{}};for(var f in this.yy)Object.prototype.hasOwnProperty.call(this.yy,f)&&(p.yy[f]=this.yy[f]);u.setInput(t,p.yy),p.yy.lexer=u,p.yy.parser=this,void 0===u.yylloc&&(u.yylloc={});var y=u.yylloc;n.push(y);var b=u.options&&u.options.ranges;function x(){var t;return"number"!=typeof(t=i.pop()||u.lex()||1)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,o(function(t){s.length=s.length-2*t,a.length=a.length-t,n.length=n.length-t},"popStack"),o(x,"lex");for(var v,m,k,g,w,T,_,A,$={};;){if(m=s[s.length-1],this.defaultActions[m]?k=this.defaultActions[m]:(null==v&&(v=x()),k=r[m]&&r[m][v]),void 0===k||!k.length||!k[0]){var I="";for(w in A=[],r[m])this.terminals_[w]&&w>2&&A.push("'"+this.terminals_[w]+"'");I=u.showPosition?"Parse error on line "+(l+1)+":\n"+u.showPosition()+"\nExpecting "+A.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==v?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(I,{text:u.match,token:this.terminals_[v]||v,line:u.yylineno,loc:y,expected:A})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+m+", token: "+v);switch(k[0]){case 1:s.push(v),a.push(u.yytext),n.push(u.yylloc),s.push(k[1]),v=null,h=u.yyleng,c=u.yytext,l=u.yylineno,y=u.yylloc;break;case 2:if(T=this.productions_[k[1]][1],$.$=a[a.length-T],$._$={first_line:n[n.length-(T||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(T||1)].first_column,last_column:n[n.length-1].last_column},b&&($._$.range=[n[n.length-(T||1)].range[0],n[n.length-1].range[1]]),void 0!==(g=this.performAction.apply($,[c,h,l,p.yy,k[1],a,n].concat(d))))return g;T&&(s=s.slice(0,-1*T*2),a=a.slice(0,-1*T),n=n.slice(0,-1*T)),s.push(this.productions_[k[1]][0]),a.push($.$),n.push($._$),_=r[s[s.length-2]][s[s.length-1]],s.push(_);break;case 3:return!0}}return!0},"parse")},H=function(){return{EOF:1,parseError:o(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:o(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:o(function(t){var e=t.length,s=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),s.length-1&&(this.yylineno-=s.length-1);var a=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:s?(s.length===i.length?this.yylloc.first_column:0)+i[i.length-s.length].length-s[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[a[0],a[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:o(function(t){this.unput(this.match.slice(t))},"less"),pastInput:o(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:o(function(t,e){var s,i,a;if(this.options.backtrack_lexer&&(a={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(a.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],s=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack){for(var n in a)this[n]=a[n];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;var t,e,s,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var a=this._currentRules(),n=0;n<a.length;n++)if((s=this._input.match(this.rules[a[n]]))&&(!e||s[0].length>e[0].length)){if(e=s,i=n,this.options.backtrack_lexer){if(!1!==(t=this.test_match(s,a[n])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,a[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var t=this.next();return t||this.lex()},"lex"),begin:o(function(t){this.conditionStack.push(t)},"begin"),popState:o(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:o(function(t){this.begin(t)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(t,e,s,i){switch(s){case 0:case 56:case 72:return 5;case 1:case 2:case 3:case 4:case 5:break;case 6:return 19;case 7:return this.begin("CONFIG"),73;case 8:return 74;case 9:return this.popState(),this.popState(),75;case 10:case 57:return e.yytext=e.yytext.trim(),71;case 11:case 17:return e.yytext=e.yytext.trim(),this.begin("ALIAS"),71;case 12:return this.begin("LINE"),14;case 13:return this.begin("ID"),50;case 14:return this.begin("ID"),52;case 15:return 13;case 16:return this.begin("ID"),53;case 18:return this.popState(),this.popState(),this.begin("LINE"),51;case 19:return this.popState(),this.popState(),5;case 20:return this.begin("LINE"),36;case 21:return this.begin("LINE"),37;case 22:return this.begin("LINE"),38;case 23:return this.begin("LINE"),39;case 24:return this.begin("LINE"),49;case 25:return this.begin("LINE"),41;case 26:return this.begin("LINE"),43;case 27:return this.begin("LINE"),48;case 28:return this.begin("LINE"),44;case 29:return this.begin("LINE"),47;case 30:return this.begin("LINE"),46;case 31:return this.popState(),15;case 32:return 16;case 33:return 66;case 34:return 67;case 35:return 60;case 36:return 61;case 37:return 62;case 38:return 63;case 39:return 58;case 40:return 55;case 41:return this.begin("ID"),21;case 42:return this.begin("ID"),23;case 43:return 29;case 44:return 30;case 45:return this.begin("acc_title"),31;case 46:return this.popState(),"acc_title_value";case 47:return this.begin("acc_descr"),33;case 48:return this.popState(),"acc_descr_value";case 49:this.begin("acc_descr_multiline");break;case 50:this.popState();break;case 51:return"acc_descr_multiline_value";case 52:return 6;case 53:return 18;case 54:return 20;case 55:return 65;case 58:return 78;case 59:return 79;case 60:return 80;case 61:return 81;case 62:return 76;case 63:return 77;case 64:return 82;case 65:return 83;case 66:return 84;case 67:return 85;case 68:case 69:return 86;case 70:return 69;case 71:return 70;case 73:return"INVALID"}},"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:@\{)/i,/^(?:[^\}]+)/i,/^(?:\})/i,/^(?:[^\<->\->:\n,;@\s]+(?=@\{))/i,/^(?:[^\<->\->:\n,;@]+?([\-]*[^\<->\->:\n,;@]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:[^<\->\->:\n,;]+?([\-]*[^<\->\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^+<\->\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+<\->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?::(?:(?:no)?wrap)?[^#\n;]*)/i,/^(?::)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[50,51],inclusive:!1},acc_descr:{rules:[48],inclusive:!1},acc_title:{rules:[46],inclusive:!1},ID:{rules:[2,3,7,10,11,17],inclusive:!1},ALIAS:{rules:[2,3,18,19],inclusive:!1},LINE:{rules:[2,3,31],inclusive:!1},CONFIG:{rules:[8,9],inclusive:!1},CONFIG_DATA:{rules:[],inclusive:!1},INITIAL:{rules:[0,1,3,4,5,6,12,13,14,15,16,20,21,22,23,24,25,26,27,28,29,30,32,33,34,35,36,37,38,39,40,41,42,43,44,45,47,49,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73],inclusive:!0}}}}();function G(){this.yy={}}return V.lexer=H,o(G,"Parser"),G.prototype=V,V.Parser=G,new G}();P.parser=P;var R=P,C={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34},B={FILLED:0,OPEN:1},F={LEFTOF:0,RIGHTOF:1,OVER:2},q="actor",W="control",j="database",z="entity",V=(o(t=class{constructor(){this.state=new M(()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:!1,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})),this.setAccTitle=b,this.setAccDescription=x,this.setDiagramTitle=v,this.getAccTitle=m,this.getAccDescription=k,this.getDiagramTitle=g,this.apply=this.apply.bind(this),this.parseBoxData=this.parseBoxData.bind(this),this.parseMessage=this.parseMessage.bind(this),this.clear(),this.setWrap(l().wrap),this.LINETYPE=C,this.ARROWTYPE=B,this.PLACEMENT=F}addBox(t){this.state.records.boxes.push({name:t.text,wrap:t.wrap??this.autoWrap(),fill:t.color,actorKeys:[]}),this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(t,e,s,i,a){let n,r=this.state.records.currentBox;if(void 0!==a){let t;t=a.includes("\n")?a+"\n":"{\n"+a+"\n}",n=w(t,{schema:T})}i=(null==n?void 0:n.type)??i;const o=this.state.records.actors.get(t);if(o){if(this.state.records.currentBox&&o.box&&this.state.records.currentBox!==o.box)throw new Error(`A same participant should only be defined in one Box: ${o.name} can't be in '${o.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`);if(r=o.box?o.box:this.state.records.currentBox,o.box=r,o&&e===o.name&&null==s)return}if(null==(null==s?void 0:s.text)&&(s={text:e,type:i}),null!=i&&null!=s.text||(s={text:e,type:i}),this.state.records.actors.set(t,{box:r,name:e,description:s.text,wrap:s.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:i??"participant"}),this.state.records.prevActor){const e=this.state.records.actors.get(this.state.records.prevActor);e&&(e.nextActor=t)}this.state.records.currentBox&&this.state.records.currentBox.actorKeys.push(t),this.state.records.prevActor=t}activationCount(t){let e,s=0;if(!t)return 0;for(e=0;e<this.state.records.messages.length;e++)this.state.records.messages[e].type===this.LINETYPE.ACTIVE_START&&this.state.records.messages[e].from===t&&s++,this.state.records.messages[e].type===this.LINETYPE.ACTIVE_END&&this.state.records.messages[e].from===t&&s--;return s}addMessage(t,e,s,i){this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:e,message:s.text,wrap:s.wrap??this.autoWrap(),answer:i})}addSignal(t,e,s,i,a=!1){if(i===this.LINETYPE.ACTIVE_END){if(this.activationCount(t??"")<1){const e=new Error("Trying to inactivate an inactive participant ("+t+")");throw e.hash={text:"->>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]},e}}return this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:e,message:(null==s?void 0:s.text)??"",wrap:(null==s?void 0:s.wrap)??this.autoWrap(),type:i,activate:a}),!0}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some(t=>t.name)}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(t){return this.state.records.actors.get(t)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!0}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=!1}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(t){this.state.records.wrapEnabled=t}extractWrap(t){if(void 0===t)return{};t=t.trim();const e=null!==/^:?wrap:/.exec(t)||null===/^:?nowrap:/.exec(t)&&void 0;return{cleanedText:(void 0===e?t:t.replace(/^:?(?:no)?wrap:/,"")).trim(),wrap:e}}autoWrap(){var t;return void 0!==this.state.records.wrapEnabled?this.state.records.wrapEnabled:(null==(t=l().sequence)?void 0:t.wrap)??!1}clear(){this.state.reset(),_()}parseMessage(t){const e=t.trim(),{wrap:s,cleanedText:i}=this.extractWrap(e),a={text:i,wrap:s};return d.debug(`parseMessage: ${JSON.stringify(a)}`),a}parseBoxData(t){const e=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t);let s=(null==e?void 0:e[1])?e[1].trim():"transparent",i=(null==e?void 0:e[2])?e[2].trim():void 0;if(null==window?void 0:window.CSS)window.CSS.supports("color",s)||(s="transparent",i=t.trim());else{const e=(new Option).style;e.color=s,e.color!==s&&(s="transparent",i=t.trim())}const{wrap:a,cleanedText:n}=this.extractWrap(i);return{text:n?A(n,l()):void 0,color:s,wrap:a}}addNote(t,e,s){const i={actor:t,placement:e,message:s.text,wrap:s.wrap??this.autoWrap()},a=[].concat(t,t);this.state.records.notes.push(i),this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:a[0],to:a[1],message:s.text,wrap:s.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:e})}addLinks(t,e){const s=this.getActor(t);try{let t=A(e.text,l());t=t.replace(/=/g,"="),t=t.replace(/&/g,"&");const i=JSON.parse(t);this.insertLinks(s,i)}catch(i){d.error("error while parsing actor link text",i)}}addALink(t,e){const s=this.getActor(t);try{const t={};let i=A(e.text,l());const a=i.indexOf("@");i=i.replace(/=/g,"="),i=i.replace(/&/g,"&");const n=i.slice(0,a-1).trim(),r=i.slice(a+1).trim();t[n]=r,this.insertLinks(s,t)}catch(i){d.error("error while parsing actor link text",i)}}insertLinks(t,e){if(null==t.links)t.links=e;else for(const s in e)t.links[s]=e[s]}addProperties(t,e){const s=this.getActor(t);try{const t=A(e.text,l()),i=JSON.parse(t);this.insertProperties(s,i)}catch(i){d.error("error while parsing actor properties text",i)}}insertProperties(t,e){if(null==t.properties)t.properties=e;else for(const s in e)t.properties[s]=e[s]}boxEnd(){this.state.records.currentBox=void 0}addDetails(t,e){const s=this.getActor(t),i=document.getElementById(e.text);try{const t=i.innerHTML,e=JSON.parse(t);e.properties&&this.insertProperties(s,e.properties),e.links&&this.insertLinks(s,e.links)}catch(a){d.error("error while parsing actor details text",a)}}getActorProperty(t,e){if(void 0!==(null==t?void 0:t.properties))return t.properties[e]}apply(t){if(Array.isArray(t))t.forEach(t=>{this.apply(t)});else switch(t.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:t.sequenceIndex,step:t.sequenceIndexStep,visible:t.sequenceVisible},wrap:!1,type:t.signalType});break;case"addParticipant":this.addActor(t.actor,t.actor,t.description,t.draw,t.config);break;case"createParticipant":if(this.state.records.actors.has(t.actor))throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior");this.state.records.lastCreated=t.actor,this.addActor(t.actor,t.actor,t.description,t.draw,t.config),this.state.records.createdActors.set(t.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=t.actor,this.state.records.destroyedActors.set(t.actor,this.state.records.messages.length);break;case"activeStart":case"activeEnd":this.addSignal(t.actor,void 0,void 0,t.signalType);break;case"addNote":this.addNote(t.actor,t.placement,t.text);break;case"addLinks":this.addLinks(t.actor,t.text);break;case"addALink":this.addALink(t.actor,t.text);break;case"addProperties":this.addProperties(t.actor,t.text);break;case"addDetails":this.addDetails(t.actor,t.text);break;case"addMessage":if(this.state.records.lastCreated){if(t.to!==this.state.records.lastCreated)throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.");this.state.records.lastCreated=void 0}else if(this.state.records.lastDestroyed){if(t.to!==this.state.records.lastDestroyed&&t.from!==this.state.records.lastDestroyed)throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.");this.state.records.lastDestroyed=void 0}this.addSignal(t.from,t.to,t.msg,t.signalType,t.activate);break;case"boxStart":this.addBox(t.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":case"rectEnd":case"optEnd":case"altEnd":case"parEnd":case"criticalEnd":case"breakEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"rectStart":this.addSignal(void 0,void 0,t.color,t.signalType);break;case"optStart":this.addSignal(void 0,void 0,t.optText,t.signalType);break;case"altStart":case"else":this.addSignal(void 0,void 0,t.altText,t.signalType);break;case"setAccTitle":b(t.text);break;case"parStart":case"and":this.addSignal(void 0,void 0,t.parText,t.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,t.criticalText,t.signalType);break;case"option":this.addSignal(void 0,void 0,t.optionText,t.signalType);break;case"breakStart":this.addSignal(void 0,void 0,t.breakText,t.signalType)}}getConfig(){return l().sequence}},"SequenceDB"),t),H=o(t=>`.actor {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n }\n\n text.actor > tspan {\n fill: ${t.actorTextColor};\n stroke: none;\n }\n\n .actor-line {\n stroke: ${t.actorLineColor};\n }\n \n .innerArc {\n stroke-width: 1.5;\n stroke-dasharray: none;\n }\n\n .messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: none;\n stroke: ${t.signalColor};\n }\n\n .messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: 2, 2;\n stroke: ${t.signalColor};\n }\n\n #arrowhead path {\n fill: ${t.signalColor};\n stroke: ${t.signalColor};\n }\n\n .sequenceNumber {\n fill: ${t.sequenceNumberColor};\n }\n\n #sequencenumber {\n fill: ${t.signalColor};\n }\n\n #crosshead path {\n fill: ${t.signalColor};\n stroke: ${t.signalColor};\n }\n\n .messageText {\n fill: ${t.signalTextColor};\n stroke: none;\n }\n\n .labelBox {\n stroke: ${t.labelBoxBorderColor};\n fill: ${t.labelBoxBkgColor};\n }\n\n .labelText, .labelText > tspan {\n fill: ${t.labelTextColor};\n stroke: none;\n }\n\n .loopText, .loopText > tspan {\n fill: ${t.loopTextColor};\n stroke: none;\n }\n\n .loopLine {\n stroke-width: 2px;\n stroke-dasharray: 2, 2;\n stroke: ${t.labelBoxBorderColor};\n fill: ${t.labelBoxBorderColor};\n }\n\n .note {\n //stroke: #decc93;\n stroke: ${t.noteBorderColor};\n fill: ${t.noteBkgColor};\n }\n\n .noteText, .noteText > tspan {\n fill: ${t.noteTextColor};\n stroke: none;\n }\n\n .activation0 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .activation1 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .activation2 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .actorPopupMenu {\n position: absolute;\n }\n\n .actorPopupMenuPanel {\n position: absolute;\n fill: ${t.actorBkg};\n box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);\n filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));\n}\n .actor-man line {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n }\n .actor-man circle, line {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n stroke-width: 2px;\n }\n\n`,"getStyles"),G="actor-top",U="actor-bottom",K="actor-box",X="actor-man",Y=o(function(t,e){return a(t,e)},"drawRect"),Z=o(function(t,e,s,i,a){if(void 0===e.links||null===e.links||0===Object.keys(e.links).length)return{height:0,width:0};const n=e.links,r=e.actorCnt,o=e.rectData;var c="none";a&&(c="block !important");const l=t.append("g");l.attr("id","actor"+r+"_popup"),l.attr("class","actorPopupMenu"),l.attr("display",c);var h="";void 0!==o.class&&(h=" "+o.class);let d=o.width>s?o.width:s;const p=l.append("rect");if(p.attr("class","actorPopupMenuPanel"+h),p.attr("x",o.x),p.attr("y",o.height),p.attr("fill",o.fill),p.attr("stroke",o.stroke),p.attr("width",d),p.attr("height",o.height),p.attr("rx",o.rx),p.attr("ry",o.ry),null!=n){var f=20;for(let t in n){var y=l.append("a"),b=u.sanitizeUrl(n[t]);y.attr("xlink:href",b),y.attr("target","_blank"),Ot(i)(t,y,o.x+10,o.height+f,d,20,{class:"actor"},i),f+=30}}return p.attr("height",f),{height:o.height+f,width:d}},"drawPopup"),J=o(function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"},"popupMenuToggle"),Q=o(async function(t,e,s=null){let i=t.append("foreignObject");const a=await N(e.text,D()),n=i.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(a).node().getBoundingClientRect();if(i.attr("height",Math.round(n.height)).attr("width",Math.round(n.width)),"noteText"===e.class){const s=t.node().firstChild;s.setAttribute("height",n.height+2*e.textMargin);const a=s.getBBox();i.attr("x",Math.round(a.x+a.width/2-n.width/2)).attr("y",Math.round(a.y+a.height/2-n.height/2))}else if(s){let{startx:t,stopx:a,starty:r}=s;if(t>a){const e=t;t=a,a=e}i.attr("x",Math.round(t+Math.abs(t-a)/2-n.width/2)),"loopText"===e.class?i.attr("y",Math.round(r)):i.attr("y",Math.round(r-n.height))}return[i]},"drawKatex"),tt=o(function(t,e){let s=0,i=0;const a=e.text.split(y.lineBreakRegex),[n,r]=E(e.fontSize);let c=[],l=0,h=o(()=>e.y,"yfunc");if(void 0!==e.valign&&void 0!==e.textMargin&&e.textMargin>0)switch(e.valign){case"top":case"start":h=o(()=>Math.round(e.y+e.textMargin),"yfunc");break;case"middle":case"center":h=o(()=>Math.round(e.y+(s+i+e.textMargin)/2),"yfunc");break;case"bottom":case"end":h=o(()=>Math.round(e.y+(s+i+2*e.textMargin)-e.textMargin),"yfunc")}if(void 0!==e.anchor&&void 0!==e.textMargin&&void 0!==e.width)switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin),e.anchor="start",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2),e.anchor="middle",e.dominantBaseline="middle",e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin),e.anchor="end",e.dominantBaseline="middle",e.alignmentBaseline="middle"}for(let[o,d]of a.entries()){void 0!==e.textMargin&&0===e.textMargin&&void 0!==n&&(l=o*n);const a=t.append("text");a.attr("x",e.x),a.attr("y",h()),void 0!==e.anchor&&a.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline),void 0!==e.fontFamily&&a.style("font-family",e.fontFamily),void 0!==r&&a.style("font-size",r),void 0!==e.fontWeight&&a.style("font-weight",e.fontWeight),void 0!==e.fill&&a.attr("fill",e.fill),void 0!==e.class&&a.attr("class",e.class),void 0!==e.dy?a.attr("dy",e.dy):0!==l&&a.attr("dy",l);const u=d||L;if(e.tspan){const t=a.append("tspan");t.attr("x",e.x),void 0!==e.fill&&t.attr("fill",e.fill),t.text(u)}else a.text(u);void 0!==e.valign&&void 0!==e.textMargin&&e.textMargin>0&&(i+=(a._groups||a)[0][0].getBBox().height,s=i),c.push(a)}return c},"drawText"),et=o(function(t,e){function s(t,e,s,i,a){return t+","+e+" "+(t+s)+","+e+" "+(t+s)+","+(e+i-a)+" "+(t+s-1.2*a)+","+(e+i)+" "+t+","+(e+i)}o(s,"genPoints");const i=t.append("polygon");return i.attr("points",s(e.x,e.y,e.width,e.height,7)),i.attr("class","labelBox"),e.y=e.y+e.height/2,tt(t,e),i},"drawLabel"),st=-1,it=o((t,e,s,i)=>{t.select&&s.forEach(s=>{const a=e.get(s),n=t.select("#actor"+a.actorCnt);!i.mirrorActors&&a.stopy?n.attr("y2",a.stopy+a.height/2):i.mirrorActors&&n.attr("y2",a.stopy)})},"fixLifeLineHeights"),at=o(function(t,e,s,a){var o,c;const l=a?e.stopy:e.starty,h=e.x+e.width/2,d=l+e.height,u=t.append("g").lower();var p=u;a||(st++,Object.keys(e.links||{}).length&&!s.forceMenus&&p.attr("onclick",J(`actor${st}_popup`)).attr("cursor","pointer"),p.append("line").attr("id","actor"+st).attr("x1",h).attr("y1",d).attr("x2",h).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),p=u.append("g"),e.actorCnt=st,null!=e.links&&p.attr("id","root-"+st));const f=i();var y="actor";(null==(o=e.properties)?void 0:o.class)?y=e.properties.class:f.fill="#eaeaea",y+=a?` ${U}`:` ${G}`,f.x=e.x,f.y=l,f.width=e.width,f.height=e.height,f.class=y,f.rx=3,f.ry=3,f.name=e.name;const b=Y(p,f);if(e.rectData=f,null==(c=e.properties)?void 0:c.icon){const t=e.properties.icon.trim();"@"===t.charAt(0)?n(p,f.x+f.width-20,f.y+10,t.substr(1)):r(p,f.x+f.width-20,f.y+10,t)}It(s,I(e.description))(e.description,p,f.x,f.y,f.width,f.height,{class:`actor ${K}`},s);let x=e.height;if(b.node){const t=b.node().getBBox();e.height=t.height,x=t.height}return x},"drawActorTypeParticipant"),nt=o(function(t,e,s,a){var o,c;const l=a?e.stopy:e.starty,h=e.x+e.width/2,d=l+e.height,u=t.append("g").lower();var p=u;a||(st++,Object.keys(e.links||{}).length&&!s.forceMenus&&p.attr("onclick",J(`actor${st}_popup`)).attr("cursor","pointer"),p.append("line").attr("id","actor"+st).attr("x1",h).attr("y1",d).attr("x2",h).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),p=u.append("g"),e.actorCnt=st,null!=e.links&&p.attr("id","root-"+st));const f=i();var y="actor";(null==(o=e.properties)?void 0:o.class)?y=e.properties.class:f.fill="#eaeaea",y+=a?` ${U}`:` ${G}`,f.x=e.x,f.y=l,f.width=e.width,f.height=e.height,f.class=y,f.name=e.name;const b={...f,x:f.x+-6,y:f.y+6,class:"actor"},x=Y(p,f);if(Y(p,b),e.rectData=f,null==(c=e.properties)?void 0:c.icon){const t=e.properties.icon.trim();"@"===t.charAt(0)?n(p,f.x+f.width-20,f.y+10,t.substr(1)):r(p,f.x+f.width-20,f.y+10,t)}It(s,I(e.description))(e.description,p,f.x-6,f.y+6,f.width,f.height,{class:`actor ${K}`},s);let v=e.height;if(x.node){const t=x.node().getBBox();e.height=t.height,v=t.height}return v},"drawActorTypeCollections"),rt=o(function(t,e,s,a){var o,c;const l=a?e.stopy:e.starty,h=e.x+e.width/2,d=l+e.height,u=t.append("g").lower();let p=u;a||(st++,Object.keys(e.links||{}).length&&!s.forceMenus&&p.attr("onclick",J(`actor${st}_popup`)).attr("cursor","pointer"),p.append("line").attr("id","actor"+st).attr("x1",h).attr("y1",d).attr("x2",h).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),p=u.append("g"),e.actorCnt=st,null!=e.links&&p.attr("id","root-"+st));const f=i();let y="actor";(null==(o=e.properties)?void 0:o.class)?y=e.properties.class:f.fill="#eaeaea",y+=a?` ${U}`:` ${G}`,f.x=e.x,f.y=l,f.width=e.width,f.height=e.height,f.class=y,f.name=e.name;const b=f.height/2,x=b/(2.5+f.height/50),v=p.append("g"),m=p.append("g");if(v.append("path").attr("d",`M ${f.x},${f.y+b}\n a ${x},${b} 0 0 0 0,${f.height}\n h ${f.width-2*x}\n a ${x},${b} 0 0 0 0,-${f.height}\n Z\n `).attr("class",y),m.append("path").attr("d",`M ${f.x},${f.y+b}\n a ${x},${b} 0 0 0 0,${f.height}`).attr("stroke","#666").attr("stroke-width","1px").attr("class",y),v.attr("transform",`translate(${x}, ${-f.height/2})`),m.attr("transform",`translate(${f.width-x}, ${-f.height/2})`),e.rectData=f,null==(c=e.properties)?void 0:c.icon){const t=e.properties.icon.trim(),s=f.x+f.width-20,i=f.y+10;"@"===t.charAt(0)?n(p,s,i,t.substr(1)):r(p,s,i,t)}It(s,I(e.description))(e.description,p,f.x,f.y,f.width,f.height,{class:`actor ${K}`},s);let k=e.height;const g=v.select("path:last-child");if(g.node()){const t=g.node().getBBox();e.height=t.height,k=t.height}return k},"drawActorTypeQueue"),ot=o(function(t,e,s,a){var n;const r=a?e.stopy:e.starty,o=e.x+e.width/2,c=r+75,l=t.append("g").lower();a||(st++,l.append("line").attr("id","actor"+st).attr("x1",o).attr("y1",c).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),e.actorCnt=st);const h=t.append("g");let d=X;d+=a?` ${U}`:` ${G}`,h.attr("class",d),h.attr("name",e.name);const u=i();u.x=e.x,u.y=r,u.fill="#eaeaea",u.width=e.width,u.height=e.height,u.class="actor";const p=e.x+e.width/2,f=r+30;h.append("defs").append("marker").attr("id","filled-head-control").attr("refX",11).attr("refY",5.8).attr("markerWidth",20).attr("markerHeight",28).attr("orient","172.5").append("path").attr("d","M 14.4 5.6 L 7.2 10.4 L 8.8 5.6 L 7.2 0.8 Z"),h.append("circle").attr("cx",p).attr("cy",f).attr("r",18).attr("fill","#eaeaf7").attr("stroke","#666").attr("stroke-width",1.2),h.append("line").attr("marker-end","url(#filled-head-control)").attr("transform",`translate(${p}, ${f-18})`);const y=h.node().getBBox();return e.height=y.height+2*((null==(n=null==s?void 0:s.sequence)?void 0:n.labelBoxHeight)??0),It(s,I(e.description))(e.description,h,u.x,u.y+18+(a?5:10),u.width,u.height,{class:`actor ${X}`},s),e.height},"drawActorTypeControl"),ct=o(function(t,e,s,a){var n;const r=a?e.stopy:e.starty,o=e.x+e.width/2,c=r+75,l=t.append("g").lower(),h=t.append("g");let d=X;d+=a?` ${U}`:` ${G}`,h.attr("class",d),h.attr("name",e.name);const u=i();u.x=e.x,u.y=r,u.fill="#eaeaea",u.width=e.width,u.height=e.height,u.class="actor";const p=e.x+e.width/2,f=r+(a?10:25),y=18;h.append("circle").attr("cx",p).attr("cy",f).attr("r",y).attr("width",e.width).attr("height",e.height),h.append("line").attr("x1",p-y).attr("x2",p+y).attr("y1",f+y).attr("y2",f+y).attr("stroke","#333").attr("stroke-width",2);const b=h.node().getBBox();return e.height=b.height+((null==(n=null==s?void 0:s.sequence)?void 0:n.labelBoxHeight)??0),a||(st++,l.append("line").attr("id","actor"+st).attr("x1",o).attr("y1",c).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),e.actorCnt=st),It(s,I(e.description))(e.description,h,u.x,u.y+(a?(f-r+y-5)/2:(f+y-r)/2),u.width,u.height,{class:`actor ${X}`},s),h.attr("transform","translate(0, 9)"),e.height},"drawActorTypeEntity"),lt=o(function(t,e,s,a){var n;const r=a?e.stopy:e.starty,o=e.x+e.width/2,c=r+e.height+2*s.boxTextMargin,l=t.append("g").lower();let h=l;a||(st++,Object.keys(e.links||{}).length&&!s.forceMenus&&h.attr("onclick",J(`actor${st}_popup`)).attr("cursor","pointer"),h.append("line").attr("id","actor"+st).attr("x1",o).attr("y1",c).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),h=l.append("g"),e.actorCnt=st,null!=e.links&&h.attr("id","root-"+st));const d=i();let u="actor";(null==(n=e.properties)?void 0:n.class)?u=e.properties.class:d.fill="#eaeaea",u+=a?` ${U}`:` ${G}`,d.x=e.x,d.y=r,d.width=e.width,d.height=e.height,d.class=u,d.name=e.name,d.x=e.x,d.y=r;const p=d.width/4,f=d.width/4,y=p/2,b=y/(2.5+p/50),x=h.append("g"),v=`\n M ${d.x},${d.y+b}\n a ${y},${b} 0 0 0 ${p},0\n a ${y},${b} 0 0 0 -${p},0\n l 0,${f-2*b}\n a ${y},${b} 0 0 0 ${p},0\n l 0,-${f-2*b}\n`;x.append("path").attr("d",v).attr("fill","#eaeaea").attr("stroke","#000").attr("stroke-width",1).attr("class",u),a?x.attr("transform",`translate(${1.5*p}, ${d.height/4-2*b})`):x.attr("transform",`translate(${1.5*p}, ${(d.height+b)/4})`),e.rectData=d,It(s,I(e.description))(e.description,h,d.x,d.y+(a?(d.height+f)/4:(d.height+b)/2),d.width,d.height,{class:`actor ${K}`},s);const m=x.select("path:last-child");if(m.node()){const t=m.node().getBBox();e.height=t.height+(s.sequence.labelBoxHeight??0)}return e.height},"drawActorTypeDatabase"),ht=o(function(t,e,s,a){const n=a?e.stopy:e.starty,r=e.x+e.width/2,o=n+80,c=30,l=t.append("g").lower();a||(st++,l.append("line").attr("id","actor"+st).attr("x1",r).attr("y1",o).attr("x2",r).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),e.actorCnt=st);const h=t.append("g");let d=X;d+=a?` ${U}`:` ${G}`,h.attr("class",d),h.attr("name",e.name);const u=i();u.x=e.x,u.y=n,u.fill="#eaeaea",u.width=e.width,u.height=e.height,u.class="actor",h.append("line").attr("id","actor-man-torso"+st).attr("x1",e.x+e.width/2-75).attr("y1",n+10).attr("x2",e.x+e.width/2-15).attr("y2",n+10),h.append("line").attr("id","actor-man-arms"+st).attr("x1",e.x+e.width/2-75).attr("y1",n+0).attr("x2",e.x+e.width/2-75).attr("y2",n+20),h.append("circle").attr("cx",e.x+e.width/2).attr("cy",n+10).attr("r",c);const p=h.node().getBBox();return e.height=p.height+(s.sequence.labelBoxHeight??0),It(s,I(e.description))(e.description,h,u.x,u.y+(a?11:18),u.width,u.height,{class:`actor ${X}`},s),h.attr("transform","translate(0,22)"),e.height},"drawActorTypeBoundary"),dt=o(function(t,e,s,a){const n=a?e.stopy:e.starty,r=e.x+e.width/2,o=n+80,c=t.append("g").lower();a||(st++,c.append("line").attr("id","actor"+st).attr("x1",r).attr("y1",o).attr("x2",r).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name),e.actorCnt=st);const l=t.append("g");let h=X;h+=a?` ${U}`:` ${G}`,l.attr("class",h),l.attr("name",e.name);const d=i();d.x=e.x,d.y=n,d.fill="#eaeaea",d.width=e.width,d.height=e.height,d.class="actor",d.rx=3,d.ry=3,l.append("line").attr("id","actor-man-torso"+st).attr("x1",r).attr("y1",n+25).attr("x2",r).attr("y2",n+45),l.append("line").attr("id","actor-man-arms"+st).attr("x1",r-18).attr("y1",n+33).attr("x2",r+18).attr("y2",n+33),l.append("line").attr("x1",r-18).attr("y1",n+60).attr("x2",r).attr("y2",n+45),l.append("line").attr("x1",r).attr("y1",n+45).attr("x2",r+18-2).attr("y2",n+60);const u=l.append("circle");u.attr("cx",e.x+e.width/2),u.attr("cy",n+10),u.attr("r",15),u.attr("width",e.width),u.attr("height",e.height);const p=l.node().getBBox();return e.height=p.height,It(s,I(e.description))(e.description,l,d.x,d.y+35,d.width,d.height,{class:`actor ${X}`},s),e.height},"drawActorTypeActor"),ut=o(async function(t,e,s,i){switch(e.type){case"actor":return await dt(t,e,s,i);case"participant":return await at(t,e,s,i);case"boundary":return await ht(t,e,s,i);case"control":return await ot(t,e,s,i);case"entity":return await ct(t,e,s,i);case"database":return await lt(t,e,s,i);case"collections":return await nt(t,e,s,i);case"queue":return await rt(t,e,s,i)}},"drawActor"),pt=o(function(t,e,s){const i=t.append("g");xt(i,e),e.name&&It(s)(e.name,i,e.x,e.y+s.boxTextMargin+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},s),i.lower()},"drawBox"),ft=o(function(t){return t.append("g")},"anchorElement"),yt=o(function(t,e,s,a,n){const r=i(),o=e.anchored;r.x=e.startx,r.y=e.starty,r.class="activation"+n%3,r.width=e.stopx-e.startx,r.height=s-e.starty,Y(o,r)},"drawActivation"),bt=o(async function(t,e,i,a){const{boxMargin:n,boxTextMargin:r,labelBoxHeight:c,labelBoxWidth:l,messageFontFamily:h,messageFontSize:d,messageFontWeight:u}=a,p=t.append("g"),f=o(function(t,e,s,i){return p.append("line").attr("x1",t).attr("y1",e).attr("x2",s).attr("y2",i).attr("class","loopLine")},"drawLoopLine");f(e.startx,e.starty,e.stopx,e.starty),f(e.stopx,e.starty,e.stopx,e.stopy),f(e.startx,e.stopy,e.stopx,e.stopy),f(e.startx,e.starty,e.startx,e.stopy),void 0!==e.sections&&e.sections.forEach(function(t){f(e.startx,t.y,e.stopx,t.y).style("stroke-dasharray","3, 3")});let y=s();y.text=i,y.x=e.startx,y.y=e.starty,y.fontFamily=h,y.fontSize=d,y.fontWeight=u,y.anchor="middle",y.valign="middle",y.tspan=!1,y.width=l||50,y.height=c||20,y.textMargin=r,y.class="labelText",et(p,y),y=At(),y.text=e.title,y.x=e.startx+l/2+(e.stopx-e.startx)/2,y.y=e.starty+n+r,y.anchor="middle",y.valign="middle",y.textMargin=r,y.class="loopText",y.fontFamily=h,y.fontSize=d,y.fontWeight=u,y.wrap=!0;let b=I(y.text)?await Q(p,y,e):tt(p,y);if(void 0!==e.sectionTitles)for(const[s,o]of Object.entries(e.sectionTitles))if(o.message){y.text=o.message,y.x=e.startx+(e.stopx-e.startx)/2,y.y=e.sections[s].y+n+r,y.class="loopText",y.anchor="middle",y.valign="middle",y.tspan=!1,y.fontFamily=h,y.fontSize=d,y.fontWeight=u,y.wrap=e.wrap,I(y.text)?(e.starty=e.sections[s].y,await Q(p,y,e)):tt(p,y);let t=Math.round(b.map(t=>(t._groups||t)[0][0].getBBox().height).reduce((t,e)=>t+e));e.sections[s].height+=t-(n+r)}return e.height=Math.round(e.stopy-e.starty),p},"drawLoop"),xt=o(function(t,s){e(t,s)},"drawBackgroundRect"),vt=o(function(t){t.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")},"insertDatabaseIcon"),mt=o(function(t){t.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")},"insertComputerIcon"),kt=o(function(t){t.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")},"insertClockIcon"),gt=o(function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")},"insertArrowHead"),wt=o(function(t){t.append("defs").append("marker").attr("id","filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"insertArrowFilledHead"),Tt=o(function(t){t.append("defs").append("marker").attr("id","sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)},"insertSequenceNumber"),_t=o(function(t){t.append("defs").append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5).append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")},"insertArrowCrossHead"),At=o(function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:!0,valign:void 0}},"getTextObj"),$t=o(function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),It=function(){function t(t,e,s,i,n,r,o){a(e.append("text").attr("x",s+n/2).attr("y",i+r/2+5).style("text-anchor","middle").text(t),o)}function e(t,e,s,i,n,r,o,c){const{actorFontSize:l,actorFontFamily:h,actorFontWeight:d}=c,[u,p]=E(l),f=t.split(y.lineBreakRegex);for(let y=0;y<f.length;y++){const t=y*u-u*(f.length-1)/2,c=e.append("text").attr("x",s+n/2).attr("y",i).style("text-anchor","middle").style("font-size",p).style("font-weight",d).style("font-family",h);c.append("tspan").attr("x",s+n/2).attr("dy",t).text(f[y]),c.attr("y",i+r/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),a(c,o)}}function s(t,s,i,n,r,o,c,l){const h=s.append("switch"),d=h.append("foreignObject").attr("x",i).attr("y",n).attr("width",r).attr("height",o).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");d.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,h,i,n,r,o,c,l),a(d,c)}async function i(t,s,i,n,r,o,c,l){const h=await O(t,D()),d=s.append("switch"),u=d.append("foreignObject").attr("x",i+r/2-h.width/2).attr("y",n+o/2-h.height/2).attr("width",h.width).attr("height",h.height).append("xhtml:div").style("height","100%").style("width","100%");u.append("div").style("text-align","center").style("vertical-align","middle").html(await N(t,D())),e(t,d,i,n,r,o,c,l),a(u,c)}function a(t,e){for(const s in e)e.hasOwnProperty(s)&&t.attr(s,e[s])}return o(t,"byText"),o(e,"byTspan"),o(s,"byFo"),o(i,"byKatex"),o(a,"_setTextAttrs"),function(a,n=!1){return n?i:"fo"===a.textPlacement?s:"old"===a.textPlacement?t:e}}(),Ot=function(){function t(t,e,s,a,n,r,o){i(e.append("text").attr("x",s).attr("y",a).style("text-anchor","start").text(t),o)}function e(t,e,s,a,n,r,o,c){const{actorFontSize:l,actorFontFamily:h,actorFontWeight:d}=c,u=t.split(y.lineBreakRegex);for(let p=0;p<u.length;p++){const t=p*l-l*(u.length-1)/2,n=e.append("text").attr("x",s).attr("y",a).style("text-anchor","start").style("font-size",l).style("font-weight",d).style("font-family",h);n.append("tspan").attr("x",s).attr("dy",t).text(u[p]),n.attr("y",a+r/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(n,o)}}function s(t,s,a,n,r,o,c,l){const h=s.append("switch"),d=h.append("foreignObject").attr("x",a).attr("y",n).attr("width",r).attr("height",o).append("xhtml:div").style("display","table").style("height","100%").style("width","100%");d.append("div").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,h,a,n,0,o,c,l),i(d,c)}function i(t,e){for(const s in e)e.hasOwnProperty(s)&&t.attr(s,e[s])}return o(t,"byText"),o(e,"byTspan"),o(s,"byFo"),o(i,"_setTextAttrs"),function(i){return"fo"===i.textPlacement?s:"old"===i.textPlacement?t:e}}(),Et={drawRect:Y,drawText:tt,drawLabel:et,drawActor:ut,drawBox:pt,drawPopup:Z,anchorElement:ft,drawActivation:yt,drawLoop:bt,drawBackgroundRect:xt,insertArrowHead:gt,insertArrowFilledHead:wt,insertSequenceNumber:Tt,insertArrowCrossHead:_t,insertDatabaseIcon:vt,insertComputerIcon:mt,insertClockIcon:kt,getTextObj:At,getNoteRect:$t,fixLifeLineHeights:it,sanitizeUrl:u.sanitizeUrl},Lt={},St={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],activations:[],models:{getHeight:o(function(){return Math.max.apply(null,0===this.actors.length?[0]:this.actors.map(t=>t.height||0))+(0===this.loops.length?0:this.loops.map(t=>t.height||0).reduce((t,e)=>t+e))+(0===this.messages.length?0:this.messages.map(t=>t.height||0).reduce((t,e)=>t+e))+(0===this.notes.length?0:this.notes.map(t=>t.height||0).reduce((t,e)=>t+e))},"getHeight"),clear:o(function(){this.actors=[],this.boxes=[],this.loops=[],this.messages=[],this.notes=[]},"clear"),addBox:o(function(t){this.boxes.push(t)},"addBox"),addActor:o(function(t){this.actors.push(t)},"addActor"),addLoop:o(function(t){this.loops.push(t)},"addLoop"),addMessage:o(function(t){this.messages.push(t)},"addMessage"),addNote:o(function(t){this.notes.push(t)},"addNote"),lastActor:o(function(){return this.actors[this.actors.length-1]},"lastActor"),lastLoop:o(function(){return this.loops[this.loops.length-1]},"lastLoop"),lastMessage:o(function(){return this.messages[this.messages.length-1]},"lastMessage"),lastNote:o(function(){return this.notes[this.notes.length-1]},"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:o(function(){this.sequenceItems=[],this.activations=[],this.models.clear(),this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0,Wt(l())},"init"),updateVal:o(function(t,e,s,i){void 0===t[e]?t[e]=s:t[e]=i(s,t[e])},"updateVal"),updateBounds:o(function(t,e,s,i){const a=this;let n=0;function r(r){return o(function(o){n++;const c=a.sequenceItems.length-n+1;a.updateVal(o,"starty",e-c*Lt.boxMargin,Math.min),a.updateVal(o,"stopy",i+c*Lt.boxMargin,Math.max),a.updateVal(St.data,"startx",t-c*Lt.boxMargin,Math.min),a.updateVal(St.data,"stopx",s+c*Lt.boxMargin,Math.max),"activation"!==r&&(a.updateVal(o,"startx",t-c*Lt.boxMargin,Math.min),a.updateVal(o,"stopx",s+c*Lt.boxMargin,Math.max),a.updateVal(St.data,"starty",e-c*Lt.boxMargin,Math.min),a.updateVal(St.data,"stopy",i+c*Lt.boxMargin,Math.max))},"updateItemBounds")}o(r,"updateFn"),this.sequenceItems.forEach(r()),this.activations.forEach(r("activation"))},"updateBounds"),insert:o(function(t,e,s,i){const a=y.getMin(t,s),n=y.getMax(t,s),r=y.getMin(e,i),o=y.getMax(e,i);this.updateVal(St.data,"startx",a,Math.min),this.updateVal(St.data,"starty",r,Math.min),this.updateVal(St.data,"stopx",n,Math.max),this.updateVal(St.data,"stopy",o,Math.max),this.updateBounds(a,r,n,o)},"insert"),newActivation:o(function(t,e,s){const i=s.get(t.from),a=jt(t.from).length||0,n=i.x+i.width/2+(a-1)*Lt.activationWidth/2;this.activations.push({startx:n,starty:this.verticalPos+2,stopx:n+Lt.activationWidth,stopy:void 0,actor:t.from,anchored:Et.anchorElement(e)})},"newActivation"),endActivation:o(function(t){const e=this.activations.map(function(t){return t.actor}).lastIndexOf(t.from);return this.activations.splice(e,1)[0]},"endActivation"),createLoop:o(function(t={message:void 0,wrap:!1,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}},"createLoop"),newLoop:o(function(t={message:void 0,wrap:!1,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))},"newLoop"),endLoop:o(function(){return this.sequenceItems.pop()},"endLoop"),isLoopOverlap:o(function(){return!!this.sequenceItems.length&&this.sequenceItems[this.sequenceItems.length-1].overlap},"isLoopOverlap"),addSectionToLoop:o(function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[],e.sectionTitles=e.sectionTitles||[],e.sections.push({y:St.getVerticalPos(),height:0}),e.sectionTitles.push(t),this.sequenceItems.push(e)},"addSectionToLoop"),saveVerticalPos:o(function(){this.isLoopOverlap()&&(this.savedVerticalPos=this.verticalPos)},"saveVerticalPos"),resetVerticalPos:o(function(){this.isLoopOverlap()&&(this.verticalPos=this.savedVerticalPos)},"resetVerticalPos"),bumpVerticalPos:o(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=y.getMax(this.data.stopy,this.verticalPos)},"bumpVerticalPos"),getVerticalPos:o(function(){return this.verticalPos},"getVerticalPos"),getBounds:o(function(){return{bounds:this.data,models:this.models}},"getBounds")},Nt=o(async function(t,e){St.bumpVerticalPos(Lt.boxMargin),e.height=Lt.boxMargin,e.starty=St.getVerticalPos();const a=i();a.x=e.startx,a.y=e.starty,a.width=e.width||Lt.width,a.class="note";const n=t.append("g"),r=Et.drawRect(n,a),o=s();o.x=e.startx,o.y=e.starty,o.width=a.width,o.dy="1em",o.text=e.message,o.class="noteText",o.fontFamily=Lt.noteFontFamily,o.fontSize=Lt.noteFontSize,o.fontWeight=Lt.noteFontWeight,o.anchor=Lt.noteAlign,o.textMargin=Lt.noteMargin,o.valign="center";const c=I(o.text)?await Q(n,o):tt(n,o),l=Math.round(c.map(t=>(t._groups||t)[0][0].getBBox().height).reduce((t,e)=>t+e));r.attr("height",l+2*Lt.noteMargin),e.height+=l+2*Lt.noteMargin,St.bumpVerticalPos(l+2*Lt.noteMargin),e.stopy=e.starty+l+2*Lt.noteMargin,e.stopx=e.startx+a.width,St.insert(e.startx,e.starty,e.stopx,e.stopy),St.models.addNote(e)},"drawNote"),Dt=o(t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight}),"messageFont"),Mt=o(t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight}),"noteFont"),Pt=o(t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight}),"actorFont");async function Rt(t,e){St.bumpVerticalPos(10);const{startx:s,stopx:i,message:a}=e,n=y.splitBreaks(a).length,r=I(a),o=r?await O(a,l()):$.calculateTextDimensions(a,Dt(Lt));if(!r){const t=o.height/n;e.height+=t,St.bumpVerticalPos(t)}let c,h=o.height-10;const d=o.width;if(s===i){c=St.getVerticalPos()+h,Lt.rightAngles||(h+=Lt.boxMargin,c=St.getVerticalPos()+h),h+=30;const t=y.getMax(d/2,Lt.width/2);St.insert(s-t,St.getVerticalPos()-10+h,i+t,St.getVerticalPos()+30+h)}else h+=Lt.boxMargin,c=St.getVerticalPos()+h,St.insert(s,c-10,i,c);return St.bumpVerticalPos(h),e.height+=h,e.stopy=e.starty+e.height,St.insert(e.fromBounds,e.starty,e.toBounds,e.stopy),c}o(Rt,"boundMessage");var Ct=o(async function(t,e,i,a){const{startx:n,stopx:r,starty:o,message:c,type:l,sequenceIndex:h,sequenceVisible:d}=e,u=$.calculateTextDimensions(c,Dt(Lt)),p=s();p.x=n,p.y=o+10,p.width=r-n,p.class="messageText",p.dy="1em",p.text=c,p.fontFamily=Lt.messageFontFamily,p.fontSize=Lt.messageFontSize,p.fontWeight=Lt.messageFontWeight,p.anchor=Lt.messageAlign,p.valign="center",p.textMargin=Lt.wrapPadding,p.tspan=!1,I(p.text)?await Q(t,p,{startx:n,stopx:r,starty:i}):tt(t,p);const f=u.width;let b;n===r?b=Lt.rightAngles?t.append("path").attr("d",`M ${n},${i} H ${n+y.getMax(Lt.width/2,f/2)} V ${i+25} H ${n}`):t.append("path").attr("d","M "+n+","+i+" C "+(n+60)+","+(i-10)+" "+(n+60)+","+(i+30)+" "+n+","+(i+20)):(b=t.append("line"),b.attr("x1",n),b.attr("y1",i),b.attr("x2",r),b.attr("y2",i)),l===a.db.LINETYPE.DOTTED||l===a.db.LINETYPE.DOTTED_CROSS||l===a.db.LINETYPE.DOTTED_POINT||l===a.db.LINETYPE.DOTTED_OPEN||l===a.db.LINETYPE.BIDIRECTIONAL_DOTTED?(b.style("stroke-dasharray","3, 3"),b.attr("class","messageLine1")):b.attr("class","messageLine0");let x="";if(Lt.arrowMarkerAbsolute&&(x=S(!0)),b.attr("stroke-width",2),b.attr("stroke","none"),b.style("fill","none"),l!==a.db.LINETYPE.SOLID&&l!==a.db.LINETYPE.DOTTED||b.attr("marker-end","url("+x+"#arrowhead)"),l!==a.db.LINETYPE.BIDIRECTIONAL_SOLID&&l!==a.db.LINETYPE.BIDIRECTIONAL_DOTTED||(b.attr("marker-start","url("+x+"#arrowhead)"),b.attr("marker-end","url("+x+"#arrowhead)")),l!==a.db.LINETYPE.SOLID_POINT&&l!==a.db.LINETYPE.DOTTED_POINT||b.attr("marker-end","url("+x+"#filled-head)"),l!==a.db.LINETYPE.SOLID_CROSS&&l!==a.db.LINETYPE.DOTTED_CROSS||b.attr("marker-end","url("+x+"#crosshead)"),d||Lt.showSequenceNumbers){if(l===a.db.LINETYPE.BIDIRECTIONAL_SOLID||l===a.db.LINETYPE.BIDIRECTIONAL_DOTTED){const t=6;n<r?b.attr("x1",n+2*t):b.attr("x1",n+t)}t.append("line").attr("x1",n).attr("y1",i).attr("x2",n).attr("y2",i).attr("stroke-width",0).attr("marker-start","url("+x+"#sequencenumber)"),t.append("text").attr("x",n).attr("y",i+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(h)}},"drawMessage"),Bt=o(function(t,e,s,i,a,n,r){let o,c=0,l=0,h=0;for(const d of i){const t=e.get(d),i=t.box;o&&o!=i&&(r||St.models.addBox(o),l+=Lt.boxMargin+o.margin),i&&i!=o&&(r||(i.x=c+l,i.y=a),l+=i.margin),t.width=t.width||Lt.width,t.height=y.getMax(t.height||Lt.height,Lt.height),t.margin=t.margin||Lt.actorMargin,h=y.getMax(h,t.height),s.get(t.name)&&(l+=t.width/2),t.x=c+l,t.starty=St.getVerticalPos(),St.insert(t.x,a,t.x+t.width,t.height),c+=t.width+l,t.box&&(t.box.width=c+i.margin-t.box.x),l=t.margin,o=t.box,St.models.addActor(t)}o&&!r&&St.models.addBox(o),St.bumpVerticalPos(h)},"addActorRenderingData"),Ft=o(async function(t,e,s,i){if(i){let i=0;St.bumpVerticalPos(2*Lt.boxMargin);for(const a of s){const s=e.get(a);s.stopy||(s.stopy=St.getVerticalPos());const n=await Et.drawActor(t,s,Lt,!0);i=y.getMax(i,n)}St.bumpVerticalPos(i+Lt.boxMargin)}else for(const a of s){const s=e.get(a);await Et.drawActor(t,s,Lt,!1)}},"drawActors"),qt=o(function(t,e,s,i){let a=0,n=0;for(const r of s){const s=e.get(r),o=Kt(s),c=Et.drawPopup(t,s,o,Lt,Lt.forceMenus,i);c.height>a&&(a=c.height),c.width+s.x>n&&(n=c.width+s.x)}return{maxHeight:a,maxWidth:n}},"drawActorsPopup"),Wt=o(function(t){f(Lt,t),t.fontFamily&&(Lt.actorFontFamily=Lt.noteFontFamily=Lt.messageFontFamily=t.fontFamily),t.fontSize&&(Lt.actorFontSize=Lt.noteFontSize=Lt.messageFontSize=t.fontSize),t.fontWeight&&(Lt.actorFontWeight=Lt.noteFontWeight=Lt.messageFontWeight=t.fontWeight)},"setConf"),jt=o(function(t){return St.activations.filter(function(e){return e.actor===t})},"actorActivations"),zt=o(function(t,e){const s=e.get(t),i=jt(t);return[i.reduce(function(t,e){return y.getMin(t,e.startx)},s.x+s.width/2-1),i.reduce(function(t,e){return y.getMax(t,e.stopx)},s.x+s.width/2+1)]},"activationBounds");function Vt(t,e,s,i,a){St.bumpVerticalPos(s);let n=i;if(e.id&&e.message&&t[e.id]){const s=t[e.id].width,a=Dt(Lt);e.message=$.wrapLabel(`[${e.message}]`,s-2*Lt.wrapPadding,a),e.width=s,e.wrap=!0;const r=$.calculateTextDimensions(e.message,a),o=y.getMax(r.height,Lt.labelBoxHeight);n=i+o,d.debug(`${o} - ${e.message}`)}a(e),St.bumpVerticalPos(n)}function Ht(t,e,s,i,a,n,r){function c(s,i){s.x<a.get(t.from).x?(St.insert(e.stopx-i,e.starty,e.startx,e.stopy+s.height/2+Lt.noteMargin),e.stopx=e.stopx+i):(St.insert(e.startx,e.starty,e.stopx+i,e.stopy+s.height/2+Lt.noteMargin),e.stopx=e.stopx-i)}function l(s,i){s.x<a.get(t.to).x?(St.insert(e.startx-i,e.starty,e.stopx,e.stopy+s.height/2+Lt.noteMargin),e.startx=e.startx+i):(St.insert(e.stopx,e.starty,e.startx+i,e.stopy+s.height/2+Lt.noteMargin),e.startx=e.startx-i)}o(c,"receiverAdjustment"),o(l,"senderAdjustment");const h=[q,W,z,j];if(n.get(t.to)==i){const e=a.get(t.to);c(e,h.includes(e.type)?21:e.width/2+3),e.starty=s-e.height/2,St.bumpVerticalPos(e.height/2)}else if(r.get(t.from)==i){const e=a.get(t.from);if(Lt.mirrorActors){l(e,h.includes(e.type)?18:e.width/2)}e.stopy=s-e.height/2,St.bumpVerticalPos(e.height/2)}else if(r.get(t.to)==i){const e=a.get(t.to);if(Lt.mirrorActors){c(e,h.includes(e.type)?21:e.width/2+3)}e.stopy=s-e.height/2,St.bumpVerticalPos(e.height/2)}}o(Vt,"adjustLoopHeightForWrap"),o(Ht,"adjustCreatedDestroyedData");var Gt=o(async function(t,e,s,i){const{securityLevel:a,sequence:n}=l();let r;Lt=n,"sandbox"===a&&(r=h("#i"+e));const c=h("sandbox"===a?r.nodes()[0].contentDocument.body:"body"),u="sandbox"===a?r.nodes()[0].contentDocument:document;St.init(),d.debug(i.db);const f="sandbox"===a?c.select(`[id="${e}"]`):h(`[id="${e}"]`),y=i.db.getActors(),b=i.db.getCreatedActors(),x=i.db.getDestroyedActors(),v=i.db.getBoxes();let m=i.db.getActorKeys();const k=i.db.getMessages(),g=i.db.getDiagramTitle(),w=i.db.hasAtLeastOneBox(),T=i.db.hasAtLeastOneBoxWithTitle(),_=await Ut(y,k,i);if(Lt.height=await Xt(y,_,v),Et.insertComputerIcon(f),Et.insertDatabaseIcon(f),Et.insertClockIcon(f),w&&(St.bumpVerticalPos(Lt.boxMargin),T&&St.bumpVerticalPos(v[0].textMaxHeight)),!0===Lt.hideUnusedParticipants){const t=new Set;k.forEach(e=>{t.add(e.from),t.add(e.to)}),m=m.filter(e=>t.has(e))}Bt(f,y,b,m,0,k,!1);const A=await Jt(k,y,_,i);function $(t,e){const s=St.endActivation(t);s.starty+18>e&&(s.starty=e-6,e+=12),Et.drawActivation(f,s,e,Lt,jt(t.from).length),St.insert(s.startx,e-10,s.stopx,e)}Et.insertArrowHead(f),Et.insertArrowCrossHead(f),Et.insertArrowFilledHead(f),Et.insertSequenceNumber(f),o($,"activeEnd");let I=1,O=1;const E=[],L=[];let S=0;for(const o of k){let t,e,s;switch(o.type){case i.db.LINETYPE.NOTE:St.resetVerticalPos(),e=o.noteModel,await Nt(f,e);break;case i.db.LINETYPE.ACTIVE_START:St.newActivation(o,f,y);break;case i.db.LINETYPE.ACTIVE_END:$(o,St.getVerticalPos());break;case i.db.LINETYPE.LOOP_START:Vt(A,o,Lt.boxMargin,Lt.boxMargin+Lt.boxTextMargin,t=>St.newLoop(t));break;case i.db.LINETYPE.LOOP_END:t=St.endLoop(),await Et.drawLoop(f,t,"loop",Lt),St.bumpVerticalPos(t.stopy-St.getVerticalPos()),St.models.addLoop(t);break;case i.db.LINETYPE.RECT_START:Vt(A,o,Lt.boxMargin,Lt.boxMargin,t=>St.newLoop(void 0,t.message));break;case i.db.LINETYPE.RECT_END:t=St.endLoop(),L.push(t),St.models.addLoop(t),St.bumpVerticalPos(t.stopy-St.getVerticalPos());break;case i.db.LINETYPE.OPT_START:Vt(A,o,Lt.boxMargin,Lt.boxMargin+Lt.boxTextMargin,t=>St.newLoop(t));break;case i.db.LINETYPE.OPT_END:t=St.endLoop(),await Et.drawLoop(f,t,"opt",Lt),St.bumpVerticalPos(t.stopy-St.getVerticalPos()),St.models.addLoop(t);break;case i.db.LINETYPE.ALT_START:Vt(A,o,Lt.boxMargin,Lt.boxMargin+Lt.boxTextMargin,t=>St.newLoop(t));break;case i.db.LINETYPE.ALT_ELSE:Vt(A,o,Lt.boxMargin+Lt.boxTextMargin,Lt.boxMargin,t=>St.addSectionToLoop(t));break;case i.db.LINETYPE.ALT_END:t=St.endLoop(),await Et.drawLoop(f,t,"alt",Lt),St.bumpVerticalPos(t.stopy-St.getVerticalPos()),St.models.addLoop(t);break;case i.db.LINETYPE.PAR_START:case i.db.LINETYPE.PAR_OVER_START:Vt(A,o,Lt.boxMargin,Lt.boxMargin+Lt.boxTextMargin,t=>St.newLoop(t)),St.saveVerticalPos();break;case i.db.LINETYPE.PAR_AND:Vt(A,o,Lt.boxMargin+Lt.boxTextMargin,Lt.boxMargin,t=>St.addSectionToLoop(t));break;case i.db.LINETYPE.PAR_END:t=St.endLoop(),await Et.drawLoop(f,t,"par",Lt),St.bumpVerticalPos(t.stopy-St.getVerticalPos()),St.models.addLoop(t);break;case i.db.LINETYPE.AUTONUMBER:I=o.message.start||I,O=o.message.step||O,o.message.visible?i.db.enableSequenceNumbers():i.db.disableSequenceNumbers();break;case i.db.LINETYPE.CRITICAL_START:Vt(A,o,Lt.boxMargin,Lt.boxMargin+Lt.boxTextMargin,t=>St.newLoop(t));break;case i.db.LINETYPE.CRITICAL_OPTION:Vt(A,o,Lt.boxMargin+Lt.boxTextMargin,Lt.boxMargin,t=>St.addSectionToLoop(t));break;case i.db.LINETYPE.CRITICAL_END:t=St.endLoop(),await Et.drawLoop(f,t,"critical",Lt),St.bumpVerticalPos(t.stopy-St.getVerticalPos()),St.models.addLoop(t);break;case i.db.LINETYPE.BREAK_START:Vt(A,o,Lt.boxMargin,Lt.boxMargin+Lt.boxTextMargin,t=>St.newLoop(t));break;case i.db.LINETYPE.BREAK_END:t=St.endLoop(),await Et.drawLoop(f,t,"break",Lt),St.bumpVerticalPos(t.stopy-St.getVerticalPos()),St.models.addLoop(t);break;default:try{s=o.msgModel,s.starty=St.getVerticalPos(),s.sequenceIndex=I,s.sequenceVisible=i.db.showSequenceNumbers();const t=await Rt(0,s);Ht(o,s,t,S,y,b,x),E.push({messageModel:s,lineStartY:t}),St.models.addMessage(s)}catch(F){d.error("error while drawing message",F)}}[i.db.LINETYPE.SOLID_OPEN,i.db.LINETYPE.DOTTED_OPEN,i.db.LINETYPE.SOLID,i.db.LINETYPE.DOTTED,i.db.LINETYPE.SOLID_CROSS,i.db.LINETYPE.DOTTED_CROSS,i.db.LINETYPE.SOLID_POINT,i.db.LINETYPE.DOTTED_POINT,i.db.LINETYPE.BIDIRECTIONAL_SOLID,i.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(o.type)&&(I+=O),S++}d.debug("createdActors",b),d.debug("destroyedActors",x),await Ft(f,y,m,!1);for(const o of E)await Ct(f,o.messageModel,o.lineStartY,i);Lt.mirrorActors&&await Ft(f,y,m,!0),L.forEach(t=>Et.drawBackgroundRect(f,t)),it(f,y,m,Lt);for(const o of St.models.boxes){o.height=St.getVerticalPos()-o.y,St.insert(o.x,o.y,o.x+o.width,o.height);const t=2*Lt.boxMargin;o.startx=o.x-t,o.starty=o.y-.25*t,o.stopx=o.startx+o.width+2*t,o.stopy=o.starty+o.height+.75*t,o.stroke="rgb(0,0,0, 0.5)",Et.drawBox(f,o,Lt)}w&&St.bumpVerticalPos(Lt.boxMargin);const N=qt(f,y,m,u),{bounds:D}=St.getBounds();void 0===D.startx&&(D.startx=0),void 0===D.starty&&(D.starty=0),void 0===D.stopx&&(D.stopx=0),void 0===D.stopy&&(D.stopy=0);let M=D.stopy-D.starty;M<N.maxHeight&&(M=N.maxHeight);let P=M+2*Lt.diagramMarginY;Lt.mirrorActors&&(P=P-Lt.boxMargin+Lt.bottomMarginAdj);let R=D.stopx-D.startx;R<N.maxWidth&&(R=N.maxWidth);const C=R+2*Lt.diagramMarginX;g&&f.append("text").text(g).attr("x",(D.stopx-D.startx)/2-2*Lt.diagramMarginX).attr("y",-25),p(f,P,C,Lt.useMaxWidth);const B=g?40:0;f.attr("viewBox",D.startx-Lt.diagramMarginX+" -"+(Lt.diagramMarginY+B)+" "+C+" "+(P+B)),d.debug("models:",St.models)},"draw");async function Ut(t,e,s){const i={};for(const a of e)if(t.get(a.to)&&t.get(a.from)){const e=t.get(a.to);if(a.placement===s.db.PLACEMENT.LEFTOF&&!e.prevActor)continue;if(a.placement===s.db.PLACEMENT.RIGHTOF&&!e.nextActor)continue;const n=void 0!==a.placement,r=!n,o=n?Mt(Lt):Dt(Lt),c=a.wrap?$.wrapLabel(a.message,Lt.width-2*Lt.wrapPadding,o):a.message,h=(I(c)?await O(a.message,l()):$.calculateTextDimensions(c,o)).width+2*Lt.wrapPadding;r&&a.from===e.nextActor?i[a.to]=y.getMax(i[a.to]||0,h):r&&a.from===e.prevActor?i[a.from]=y.getMax(i[a.from]||0,h):r&&a.from===a.to?(i[a.from]=y.getMax(i[a.from]||0,h/2),i[a.to]=y.getMax(i[a.to]||0,h/2)):a.placement===s.db.PLACEMENT.RIGHTOF?i[a.from]=y.getMax(i[a.from]||0,h):a.placement===s.db.PLACEMENT.LEFTOF?i[e.prevActor]=y.getMax(i[e.prevActor]||0,h):a.placement===s.db.PLACEMENT.OVER&&(e.prevActor&&(i[e.prevActor]=y.getMax(i[e.prevActor]||0,h/2)),e.nextActor&&(i[a.from]=y.getMax(i[a.from]||0,h/2)))}return d.debug("maxMessageWidthPerActor:",i),i}o(Ut,"getMaxMessageWidthPerActor");var Kt=o(function(t){let e=0;const s=Pt(Lt);for(const i in t.links){const t=$.calculateTextDimensions(i,s).width+2*Lt.wrapPadding+2*Lt.boxMargin;e<t&&(e=t)}return e},"getRequiredPopupWidth");async function Xt(t,e,s){let i=0;for(const n of t.keys()){const e=t.get(n);e.wrap&&(e.description=$.wrapLabel(e.description,Lt.width-2*Lt.wrapPadding,Pt(Lt)));const s=I(e.description)?await O(e.description,l()):$.calculateTextDimensions(e.description,Pt(Lt));e.width=e.wrap?Lt.width:y.getMax(Lt.width,s.width+2*Lt.wrapPadding),e.height=e.wrap?y.getMax(s.height,Lt.height):Lt.height,i=y.getMax(i,e.height)}for(const n in e){const s=t.get(n);if(!s)continue;const i=t.get(s.nextActor);if(!i){const t=e[n]+Lt.actorMargin-s.width/2;s.margin=y.getMax(t,Lt.actorMargin);continue}const a=e[n]+Lt.actorMargin-s.width/2-i.width/2;s.margin=y.getMax(a,Lt.actorMargin)}let a=0;return s.forEach(e=>{const s=Dt(Lt);let i=e.actorKeys.reduce((e,s)=>e+(t.get(s).width+(t.get(s).margin||0)),0);i+=8*Lt.boxMargin,i-=2*Lt.boxTextMargin,e.wrap&&(e.name=$.wrapLabel(e.name,i-2*Lt.wrapPadding,s));const n=$.calculateTextDimensions(e.name,s);a=y.getMax(n.height,a);const r=y.getMax(i,n.width+2*Lt.wrapPadding);if(e.margin=Lt.boxTextMargin,i<r){const t=(r-i)/2;e.margin+=t}}),s.forEach(t=>t.textMaxHeight=a),y.getMax(i,Lt.height)}o(Xt,"calculateActorMargins");var Yt=o(async function(t,e,s){const i=e.get(t.from),a=e.get(t.to),n=i.x,r=a.x,o=t.wrap&&t.message;let c=I(t.message)?await O(t.message,l()):$.calculateTextDimensions(o?$.wrapLabel(t.message,Lt.width,Mt(Lt)):t.message,Mt(Lt));const h={width:o?Lt.width:y.getMax(Lt.width,c.width+2*Lt.noteMargin),height:0,startx:i.x,stopx:0,starty:0,stopy:0,message:t.message};return t.placement===s.db.PLACEMENT.RIGHTOF?(h.width=o?y.getMax(Lt.width,c.width):y.getMax(i.width/2+a.width/2,c.width+2*Lt.noteMargin),h.startx=n+(i.width+Lt.actorMargin)/2):t.placement===s.db.PLACEMENT.LEFTOF?(h.width=o?y.getMax(Lt.width,c.width+2*Lt.noteMargin):y.getMax(i.width/2+a.width/2,c.width+2*Lt.noteMargin),h.startx=n-h.width+(i.width-Lt.actorMargin)/2):t.to===t.from?(c=$.calculateTextDimensions(o?$.wrapLabel(t.message,y.getMax(Lt.width,i.width),Mt(Lt)):t.message,Mt(Lt)),h.width=o?y.getMax(Lt.width,i.width):y.getMax(i.width,Lt.width,c.width+2*Lt.noteMargin),h.startx=n+(i.width-h.width)/2):(h.width=Math.abs(n+i.width/2-(r+a.width/2))+Lt.actorMargin,h.startx=n<r?n+i.width/2-Lt.actorMargin/2:r+a.width/2-Lt.actorMargin/2),o&&(h.message=$.wrapLabel(t.message,h.width-2*Lt.wrapPadding,Mt(Lt))),d.debug(`NM:[${h.startx},${h.stopx},${h.starty},${h.stopy}:${h.width},${h.height}=${t.message}]`),h},"buildNoteModel"),Zt=o(function(t,e,s){if(![s.db.LINETYPE.SOLID_OPEN,s.db.LINETYPE.DOTTED_OPEN,s.db.LINETYPE.SOLID,s.db.LINETYPE.DOTTED,s.db.LINETYPE.SOLID_CROSS,s.db.LINETYPE.DOTTED_CROSS,s.db.LINETYPE.SOLID_POINT,s.db.LINETYPE.DOTTED_POINT,s.db.LINETYPE.BIDIRECTIONAL_SOLID,s.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type))return{};const[i,a]=zt(t.from,e),[n,r]=zt(t.to,e),c=i<=n;let l=c?a:i,h=c?n:r;const d=Math.abs(n-r)>2,u=o(t=>c?-t:t,"adjustValue");t.from===t.to?h=l:(t.activate&&!d&&(h+=u(Lt.activationWidth/2-1)),[s.db.LINETYPE.SOLID_OPEN,s.db.LINETYPE.DOTTED_OPEN].includes(t.type)||(h+=u(3)),[s.db.LINETYPE.BIDIRECTIONAL_SOLID,s.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type)&&(l-=u(3)));const p=[i,a,n,r],f=Math.abs(l-h);t.wrap&&t.message&&(t.message=$.wrapLabel(t.message,y.getMax(f+2*Lt.wrapPadding,Lt.width),Dt(Lt)));const b=$.calculateTextDimensions(t.message,Dt(Lt));return{width:y.getMax(t.wrap?0:b.width+2*Lt.wrapPadding,f+2*Lt.wrapPadding,Lt.width),height:0,startx:l,stopx:h,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,p),toBounds:Math.max.apply(null,p)}},"buildMessageModel"),Jt=o(async function(t,e,s,i){const a={},n=[];let r,o,c;for(const l of t){switch(l.type){case i.db.LINETYPE.LOOP_START:case i.db.LINETYPE.ALT_START:case i.db.LINETYPE.OPT_START:case i.db.LINETYPE.PAR_START:case i.db.LINETYPE.PAR_OVER_START:case i.db.LINETYPE.CRITICAL_START:case i.db.LINETYPE.BREAK_START:n.push({id:l.id,msg:l.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case i.db.LINETYPE.ALT_ELSE:case i.db.LINETYPE.PAR_AND:case i.db.LINETYPE.CRITICAL_OPTION:l.message&&(r=n.pop(),a[r.id]=r,a[l.id]=r,n.push(r));break;case i.db.LINETYPE.LOOP_END:case i.db.LINETYPE.ALT_END:case i.db.LINETYPE.OPT_END:case i.db.LINETYPE.PAR_END:case i.db.LINETYPE.CRITICAL_END:case i.db.LINETYPE.BREAK_END:r=n.pop(),a[r.id]=r;break;case i.db.LINETYPE.ACTIVE_START:{const t=e.get(l.from?l.from:l.to.actor),s=jt(l.from?l.from:l.to.actor).length,i=t.x+t.width/2+(s-1)*Lt.activationWidth/2,a={startx:i,stopx:i+Lt.activationWidth,actor:l.from,enabled:!0};St.activations.push(a)}break;case i.db.LINETYPE.ACTIVE_END:{const t=St.activations.map(t=>t.actor).lastIndexOf(l.from);St.activations.splice(t,1).splice(0,1)}}void 0!==l.placement?(o=await Yt(l,e,i),l.noteModel=o,n.forEach(t=>{r=t,r.from=y.getMin(r.from,o.startx),r.to=y.getMax(r.to,o.startx+o.width),r.width=y.getMax(r.width,Math.abs(r.from-r.to))-Lt.labelBoxWidth})):(c=Zt(l,e,i),l.msgModel=c,c.startx&&c.stopx&&n.length>0&&n.forEach(t=>{if(r=t,c.startx===c.stopx){const t=e.get(l.from),s=e.get(l.to);r.from=y.getMin(t.x-c.width/2,t.x-t.width/2,r.from),r.to=y.getMax(s.x+c.width/2,s.x+t.width/2,r.to),r.width=y.getMax(r.width,Math.abs(r.to-r.from))-Lt.labelBoxWidth}else r.from=y.getMin(c.startx,r.from),r.to=y.getMax(c.stopx,r.to),r.width=y.getMax(r.width,c.width)-Lt.labelBoxWidth}))}return St.activations=[],d.debug("Loop type widths:",a),a},"calculateLoopBounds"),Qt={bounds:St,drawActors:Ft,drawActorsPopup:qt,setConf:Wt,draw:Gt},te={parser:R,get db(){return new V},renderer:Qt,styles:H,init:o(t=>{t.sequence||(t.sequence={}),t.wrap&&(t.sequence.wrap=t.wrap,c({sequence:{wrap:t.wrap}}))},"init")};export{te as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as t,a as e,S as r}from"./chunk-DI55MBZ5-CO44EGwl.js";import{_ as n,c as s,d as i,l as o,e as a,k as c,R as d,S as l,O as h,u as f}from"./index-PxdJoyNn.js";import{G as u}from"./graph-DbcIVQWO.js";import{l as x}from"./layout-DFoNjwYU.js";import"./chunk-55IACEB6-BrPAEmD2.js";import"./chunk-QN33PNHL-C_u6j8ll.js";import"./_baseUniq-BFIaUHWF.js";import"./min-C_FjB4Pz.js";var p,g=n(t=>t.append("circle").attr("class","start-state").attr("r",s().state.sizeUnit).attr("cx",s().state.padding+s().state.sizeUnit).attr("cy",s().state.padding+s().state.sizeUnit),"drawStartState"),y=n(t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",s().state.textHeight).attr("class","divider").attr("x2",2*s().state.textHeight).attr("y1",0).attr("y2",0),"drawDivider"),m=n((t,e)=>{const r=t.append("text").attr("x",2*s().state.padding).attr("y",s().state.textHeight+2*s().state.padding).attr("font-size",s().state.fontSize).attr("class","state-title").text(e.id),n=r.node().getBBox();return t.insert("rect",":first-child").attr("x",s().state.padding).attr("y",s().state.padding).attr("width",n.width+2*s().state.padding).attr("height",n.height+2*s().state.padding).attr("rx",s().state.radius),r},"drawSimpleState"),w=n((t,e)=>{const r=n(function(t,e,r){const n=t.append("tspan").attr("x",2*s().state.padding).text(e);r||n.attr("dy",s().state.textHeight)},"addTspan"),i=t.append("text").attr("x",2*s().state.padding).attr("y",s().state.textHeight+1.3*s().state.padding).attr("font-size",s().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),o=i.height,a=t.append("text").attr("x",s().state.padding).attr("y",o+.4*s().state.padding+s().state.dividerMargin+s().state.textHeight).attr("class","state-description");let c=!0,d=!0;e.descriptions.forEach(function(t){c||(r(a,t,d),d=!1),c=!1});const l=t.append("line").attr("x1",s().state.padding).attr("y1",s().state.padding+o+s().state.dividerMargin/2).attr("y2",s().state.padding+o+s().state.dividerMargin/2).attr("class","descr-divider"),h=a.node().getBBox(),f=Math.max(h.width,i.width);return l.attr("x2",f+3*s().state.padding),t.insert("rect",":first-child").attr("x",s().state.padding).attr("y",s().state.padding).attr("width",f+2*s().state.padding).attr("height",h.height+o+2*s().state.padding).attr("rx",s().state.radius),t},"drawDescrState"),k=n((t,e,r)=>{const n=s().state.padding,i=2*s().state.padding,o=t.node().getBBox(),a=o.width,c=o.x,d=t.append("text").attr("x",0).attr("y",s().state.titleShift).attr("font-size",s().state.fontSize).attr("class","state-title").text(e.id),l=d.node().getBBox().width+i;let h,f=Math.max(l,a);f===a&&(f+=i);const u=t.node().getBBox();e.doc,h=c-n,l>a&&(h=(a-f)/2+n),Math.abs(c-u.x)<n&&l>a&&(h=c-(l-a)/2);const x=1-s().state.textHeight;return t.insert("rect",":first-child").attr("x",h).attr("y",x).attr("class",r?"alt-composit":"composit").attr("width",f).attr("height",u.height+s().state.textHeight+s().state.titleShift+1).attr("rx","0"),d.attr("x",h+n),l<=a&&d.attr("x",c+(f-i)/2-l/2+n),t.insert("rect",":first-child").attr("x",h).attr("y",s().state.titleShift-s().state.textHeight-s().state.padding).attr("width",f).attr("height",3*s().state.textHeight).attr("rx",s().state.radius),t.insert("rect",":first-child").attr("x",h).attr("y",s().state.titleShift-s().state.textHeight-s().state.padding).attr("width",f).attr("height",u.height+3+2*s().state.textHeight).attr("rx",s().state.radius),t},"addTitleAndBox"),b=n(t=>(t.append("circle").attr("class","end-state-outer").attr("r",s().state.sizeUnit+s().state.miniPadding).attr("cx",s().state.padding+s().state.sizeUnit+s().state.miniPadding).attr("cy",s().state.padding+s().state.sizeUnit+s().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",s().state.sizeUnit).attr("cx",s().state.padding+s().state.sizeUnit+2).attr("cy",s().state.padding+s().state.sizeUnit+2)),"drawEndState"),S=n((t,e)=>{let r=s().state.forkWidth,n=s().state.forkHeight;if(e.parentId){let t=r;r=n,n=t}return t.append("rect").style("stroke","black").style("fill","black").attr("width",r).attr("height",n).attr("x",s().state.padding).attr("y",s().state.padding)},"drawForkJoinState"),v=n((t,e,r,n)=>{let i=0;const o=n.append("text");o.style("text-anchor","start"),o.attr("class","noteText");let a=t.replace(/\r\n/g,"<br/>");a=a.replace(/\n/g,"<br/>");const d=a.split(c.lineBreakRegex);let l=1.25*s().state.noteMargin;for(const c of d){const t=c.trim();if(t.length>0){const n=o.append("tspan");if(n.text(t),0===l){l+=n.node().getBBox().height}i+=l,n.attr("x",e+s().state.noteMargin),n.attr("y",r+i+1.25*s().state.noteMargin)}}return{textWidth:o.node().getBBox().width,textHeight:i}},"_drawLongText"),N=n((t,e)=>{e.attr("class","state-note");const r=e.append("rect").attr("x",0).attr("y",s().state.padding),n=e.append("g"),{textWidth:i,textHeight:o}=v(t,0,0,n);return r.attr("height",o+2*s().state.noteMargin),r.attr("width",i+2*s().state.noteMargin),r},"drawNote"),j=n(function(t,e){const r=e.id,n={id:r,label:e.id,width:0,height:0},i=t.append("g").attr("id",r).attr("class","stateGroup");"start"===e.type&&g(i),"end"===e.type&&b(i),"fork"!==e.type&&"join"!==e.type||S(i,e),"note"===e.type&&N(e.note.text,i),"divider"===e.type&&y(i),"default"===e.type&&0===e.descriptions.length&&m(i,e),"default"===e.type&&e.descriptions.length>0&&w(i,e);const o=i.node().getBBox();return n.width=o.width+2*s().state.padding,n.height=o.height+2*s().state.padding,n},"drawState"),M=0,L=n(function(t,e,i){const a=n(function(t){switch(t){case r.relationType.AGGREGATION:return"aggregation";case r.relationType.EXTENSION:return"extension";case r.relationType.COMPOSITION:return"composition";case r.relationType.DEPENDENCY:return"dependency"}},"getRelationType");e.points=e.points.filter(t=>!Number.isNaN(t.y));const u=e.points,x=d().x(function(t){return t.x}).y(function(t){return t.y}).curve(l),p=t.append("path").attr("d",x(u)).attr("id","edge"+M).attr("class","transition");let g="";if(s().state.arrowMarkerAbsolute&&(g=h(!0)),p.attr("marker-end","url("+g+"#"+a(r.relationType.DEPENDENCY)+"End)"),void 0!==i.title){const r=t.append("g").attr("class","stateLabel"),{x:n,y:a}=f.calcLabelPosition(e.points),d=c.getRows(i.title);let l=0;const h=[];let u=0,x=0;for(let t=0;t<=d.length;t++){const e=r.append("text").attr("text-anchor","middle").text(d[t]).attr("x",n).attr("y",a+l),s=e.node().getBBox();if(u=Math.max(u,s.width),x=Math.min(x,s.x),o.info(s.x,n,a+l),0===l){const t=e.node().getBBox();l=t.height,o.info("Title height",l,a)}h.push(e)}let p=l*d.length;if(d.length>1){const t=(d.length-1)*l*.5;h.forEach((e,r)=>e.attr("y",a+r*l-t)),p=l*d.length}const g=r.node().getBBox();r.insert("rect",":first-child").attr("class","box").attr("x",n-u/2-s().state.padding/2).attr("y",a-p/2-s().state.padding/2-3.5).attr("width",u+s().state.padding).attr("height",p+s().state.padding),o.info(g)}M++},"drawEdge"),T={},E=n(function(){},"setConf"),G=n(function(t){t.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),B=n(function(t,e,r,n){p=s().state;const c=s().securityLevel;let d;"sandbox"===c&&(d=i("#i"+e));const l=i("sandbox"===c?d.nodes()[0].contentDocument.body:"body"),h="sandbox"===c?d.nodes()[0].contentDocument:document;o.debug("Rendering diagram "+t);const f=l.select(`[id='${e}']`);G(f);const u=n.db.getRootDoc();O(u,f,void 0,!1,l,h,n);const x=p.padding,g=f.node().getBBox(),y=g.width+2*x,m=g.height+2*x;a(f,m,1.75*y,p.useMaxWidth),f.attr("viewBox",`${g.x-p.padding} ${g.y-p.padding} `+y+" "+m)},"draw"),D=n(t=>t?t.length*p.fontSizeFactor:1,"getLabelWidth"),O=n((t,e,r,n,s,i,a)=>{const d=new u({compound:!0,multigraph:!0});let l,h=!0;for(l=0;l<t.length;l++)if("relation"===t[l].stmt){h=!1;break}r?d.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:h?1:p.edgeLengthFactor,nodeSep:h?1:50,isMultiGraph:!0}):d.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:h?1:p.edgeLengthFactor,nodeSep:h?1:50,ranker:"tight-tree",isMultiGraph:!0}),d.setDefaultEdgeLabel(function(){return{}});const f=a.db.getStates(),g=a.db.getRelations(),y=Object.keys(f);for(const o of y){const t=f[o];let c;if(r&&(t.parentId=r),t.doc){let r=e.append("g").attr("id",t.id).attr("class","stateGroup");c=O(t.doc,r,t.id,!n,s,i,a);{r=k(r,t,n);let e=r.node().getBBox();c.width=e.width,c.height=e.height+p.padding/2,T[t.id]={y:p.compositTitleSize}}}else c=j(e,t,d);if(t.note){const r={descriptions:[],id:t.id+"-note",note:t.note,type:"note"},n=j(e,r,d);"left of"===t.note.position?(d.setNode(c.id+"-note",n),d.setNode(c.id,c)):(d.setNode(c.id,c),d.setNode(c.id+"-note",n)),d.setParent(c.id,c.id+"-group"),d.setParent(c.id+"-note",c.id+"-group")}else d.setNode(c.id,c)}o.debug("Count=",d.nodeCount(),d);let m=0;g.forEach(function(t){m++,o.debug("Setting edge",t),d.setEdge(t.id1,t.id2,{relation:t,width:D(t.title),height:p.labelHeight*c.getRows(t.title).length,labelpos:"c"},"id"+m)}),x(d),o.debug("Graph after layout",d.nodes());const w=e.node();d.nodes().forEach(function(t){if(void 0!==t&&void 0!==d.node(t)){o.warn("Node "+t+": "+JSON.stringify(d.node(t))),s.select("#"+w.id+" #"+t).attr("transform","translate("+(d.node(t).x-d.node(t).width/2)+","+(d.node(t).y+(T[t]?T[t].y:0)-d.node(t).height/2)+" )"),s.select("#"+w.id+" #"+t).attr("data-x-shift",d.node(t).x-d.node(t).width/2);i.querySelectorAll("#"+w.id+" #"+t+" .divider").forEach(t=>{const e=t.parentElement;let r=0,n=0;e&&(e.parentElement&&(r=e.parentElement.getBBox().width),n=parseInt(e.getAttribute("data-x-shift"),10),Number.isNaN(n)&&(n=0)),t.setAttribute("x1",0-n+8),t.setAttribute("x2",r-n-8)})}else o.debug("No Node "+t+": "+JSON.stringify(d.node(t)))});let b=w.getBBox();d.edges().forEach(function(t){void 0!==t&&void 0!==d.edge(t)&&(o.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(d.edge(t))),L(e,d.edge(t),d.edge(t).relation))}),b=w.getBBox();const S={id:r||"root",label:r||"root",width:0,height:0};return S.width=b.width+2*p.padding,S.height=b.height+2*p.padding,o.debug("Doc rendered",S,d),S},"renderDoc"),C={setConf:E,draw:B},H={parser:e,get db(){return new r(1)},renderer:C,styles:t,init:n(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{H as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as r,b as s,a as e,S as t}from"./chunk-DI55MBZ5-CO44EGwl.js";import{_ as i}from"./index-PxdJoyNn.js";import"./chunk-55IACEB6-BrPAEmD2.js";import"./chunk-QN33PNHL-C_u6j8ll.js";var n={parser:e,get db(){return new t(2)},renderer:s,styles:r,init:i(r=>{r.state||(r.state={}),r.state.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as t,c as e,l as i,d as n,V as s,W as r,X as a,Y as o,B as c,$ as l,y as h}from"./index-PxdJoyNn.js";import{d as u}from"./arc-CX4sIPz0.js";var d=function(){var e=t(function(t,e,i,n){for(i=i||{},n=t.length;n--;i[t[n]]=e);return i},"o"),i=[6,8,10,11,12,14,16,17,20,21],n=[1,9],s=[1,10],r=[1,11],a=[1,12],o=[1,13],c=[1,16],l=[1,17],h={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,period_statement:18,event_statement:19,period:20,event:21,$accept:0,$end:1},terminals_:{2:"error",4:"timeline",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",20:"period",21:"event"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[18,1],[19,1]],performAction:t(function(t,e,i,n,s,r,a){var o=r.length-1;switch(s){case 1:return r[o-1];case 2:case 6:case 7:this.$=[];break;case 3:r[o-1].push(r[o]),this.$=r[o-1];break;case 4:case 5:this.$=r[o];break;case 8:n.getCommonDb().setDiagramTitle(r[o].substr(6)),this.$=r[o].substr(6);break;case 9:this.$=r[o].trim(),n.getCommonDb().setAccTitle(this.$);break;case 10:case 11:this.$=r[o].trim(),n.getCommonDb().setAccDescription(this.$);break;case 12:n.addSection(r[o].substr(8)),this.$=r[o].substr(8);break;case 15:n.addTask(r[o],0,""),this.$=r[o];break;case 16:n.addEvent(r[o].substr(2)),this.$=r[o]}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},e(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:n,12:s,14:r,16:a,17:o,18:14,19:15,20:c,21:l},e(i,[2,7],{1:[2,1]}),e(i,[2,3]),{9:18,11:n,12:s,14:r,16:a,17:o,18:14,19:15,20:c,21:l},e(i,[2,5]),e(i,[2,6]),e(i,[2,8]),{13:[1,19]},{15:[1,20]},e(i,[2,11]),e(i,[2,12]),e(i,[2,13]),e(i,[2,14]),e(i,[2,15]),e(i,[2,16]),e(i,[2,4]),e(i,[2,9]),e(i,[2,10])],defaultActions:{},parseError:t(function(t,e){if(!e.recoverable){var i=new Error(t);throw i.hash=e,i}this.trace(t)},"parseError"),parse:t(function(e){var i=this,n=[0],s=[],r=[null],a=[],o=this.table,c="",l=0,h=0,u=a.slice.call(arguments,1),d=Object.create(this.lexer),f={yy:{}};for(var m in this.yy)Object.prototype.hasOwnProperty.call(this.yy,m)&&(f.yy[m]=this.yy[m]);d.setInput(e,f.yy),f.yy.lexer=d,f.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var p=d.yylloc;a.push(p);var g=d.options&&d.options.ranges;function x(){var t;return"number"!=typeof(t=s.pop()||d.lex()||1)&&(t instanceof Array&&(t=(s=t).pop()),t=i.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,t(function(t){n.length=n.length-2*t,r.length=r.length-t,a.length=a.length-t},"popStack"),t(x,"lex");for(var k,y,v,b,w,_,S,$,T={};;){if(y=n[n.length-1],this.defaultActions[y]?v=this.defaultActions[y]:(null==k&&(k=x()),v=o[y]&&o[y][k]),void 0===v||!v.length||!v[0]){var E="";for(w in $=[],o[y])this.terminals_[w]&&w>2&&$.push("'"+this.terminals_[w]+"'");E=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+$.join(", ")+", got '"+(this.terminals_[k]||k)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==k?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(E,{text:d.match,token:this.terminals_[k]||k,line:d.yylineno,loc:p,expected:$})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+y+", token: "+k);switch(v[0]){case 1:n.push(k),r.push(d.yytext),a.push(d.yylloc),n.push(v[1]),k=null,h=d.yyleng,c=d.yytext,l=d.yylineno,p=d.yylloc;break;case 2:if(_=this.productions_[v[1]][1],T.$=r[r.length-_],T._$={first_line:a[a.length-(_||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(_||1)].first_column,last_column:a[a.length-1].last_column},g&&(T._$.range=[a[a.length-(_||1)].range[0],a[a.length-1].range[1]]),void 0!==(b=this.performAction.apply(T,[c,h,l,f.yy,v[1],r,a].concat(u))))return b;_&&(n=n.slice(0,-1*_*2),r=r.slice(0,-1*_),a=a.slice(0,-1*_)),n.push(this.productions_[v[1]][0]),r.push(T.$),a.push(T._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0},"parse")},u=function(){return{EOF:1,parseError:t(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:t(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:t(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:t(function(t){var e=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=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),i.length-1&&(this.yylineno-=i.length-1);var s=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===n.length?this.yylloc.first_column:0)+n[n.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:t(function(t){this.unput(this.match.slice(t))},"less"),pastInput:t(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:t(function(t,e){var i,n,s;if(this.options.backtrack_lexer&&(s={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(s.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var r in s)this[r]=s[r];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;var t,e,i,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),r=0;r<s.length;r++)if((i=this._input.match(this.rules[s[r]]))&&(!e||i[0].length>e[0].length)){if(e=i,n=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,s[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:t(function(){var t=this.next();return t||this.lex()},"lex"),begin:t(function(t){this.conditionStack.push(t)},"begin"),popState:t(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:t(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:t(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:t(function(t){this.begin(t)},"pushState"),stateStackSize:t(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:t(function(t,e,i,n){switch(i){case 0:case 1:case 3:case 4:break;case 2:return 10;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 21;case 16:return 20;case 17:return 6;case 18:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline\b)/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,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18],inclusive:!0}}}}();function d(){this.yy={}}return h.lexer=u,t(d,"Parser"),d.prototype=h,h.Parser=d,new d}();d.parser=d;var f=d,m={};c(m,{addEvent:()=>T,addSection:()=>w,addTask:()=>$,addTaskOrg:()=>E,clear:()=>b,default:()=>N,getCommonDb:()=>v,getSections:()=>_,getTasks:()=>S});var p="",g=0,x=[],k=[],y=[],v=t(()=>l,"getCommonDb"),b=t(function(){x.length=0,k.length=0,p="",y.length=0,h()},"clear"),w=t(function(t){p=t,x.push(t)},"addSection"),_=t(function(){return x},"getSections"),S=t(function(){let t=I();let e=0;for(;!t&&e<100;)t=I(),e++;return k.push(...y),k},"getTasks"),$=t(function(t,e,i){const n={id:g++,section:p,type:p,task:t,score:e||0,events:i?[i]:[]};y.push(n)},"addTask"),T=t(function(t){y.find(t=>t.id===g-1).events.push(t)},"addEvent"),E=t(function(t){const e={section:p,type:p,description:t,task:t,classes:[]};k.push(e)},"addTaskOrg"),I=t(function(){const e=t(function(t){return y[t].processed},"compileTask");let i=!0;for(const[t,n]of y.entries())e(t),i=i&&n.processed;return i},"compileTasks"),N={clear:b,getCommonDb:v,addSection:w,getSections:_,getTasks:S,addTask:$,addTaskOrg:E,addEvent:T},C=t(function(t,e){const i=t.append("rect");return i.attr("x",e.x),i.attr("y",e.y),i.attr("fill",e.fill),i.attr("stroke",e.stroke),i.attr("width",e.width),i.attr("height",e.height),i.attr("rx",e.rx),i.attr("ry",e.ry),void 0!==e.class&&i.attr("class",e.class),i},"drawRect"),M=t(function(e,i){const n=15,s=e.append("circle").attr("cx",i.cx).attr("cy",i.cy).attr("class","face").attr("r",n).attr("stroke-width",2).attr("overflow","visible"),r=e.append("g");function a(t){const e=u().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(n/2.2);t.append("path").attr("class","mouth").attr("d",e).attr("transform","translate("+i.cx+","+(i.cy+2)+")")}function o(t){const e=u().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(n/2.2);t.append("path").attr("class","mouth").attr("d",e).attr("transform","translate("+i.cx+","+(i.cy+7)+")")}function c(t){t.append("line").attr("class","mouth").attr("stroke",2).attr("x1",i.cx-5).attr("y1",i.cy+7).attr("x2",i.cx+5).attr("y2",i.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return r.append("circle").attr("cx",i.cx-5).attr("cy",i.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),r.append("circle").attr("cx",i.cx+5).attr("cy",i.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),t(a,"smile"),t(o,"sad"),t(c,"ambivalent"),i.score>3?a(r):i.score<3?o(r):c(r),s},"drawFace"),H=t(function(t,e){const i=t.append("circle");return i.attr("cx",e.cx),i.attr("cy",e.cy),i.attr("class","actor-"+e.pos),i.attr("fill",e.fill),i.attr("stroke",e.stroke),i.attr("r",e.r),void 0!==i.class&&i.attr("class",i.class),void 0!==e.title&&i.append("title").text(e.title),i},"drawCircle"),j=t(function(t,e){const i=e.text.replace(/<br\s*\/?>/gi," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),void 0!==e.class&&n.attr("class",e.class);const s=n.append("tspan");return s.attr("x",e.x+2*e.textMargin),s.text(i),n},"drawText"),L=t(function(e,i){function n(t,e,i,n,s){return t+","+e+" "+(t+i)+","+e+" "+(t+i)+","+(e+n-s)+" "+(t+i-1.2*s)+","+(e+n)+" "+t+","+(e+n)}t(n,"genPoints");const s=e.append("polygon");s.attr("points",n(i.x,i.y,50,20,7)),s.attr("class","labelBox"),i.y=i.y+i.labelMargin,i.x=i.x+.5*i.labelMargin,j(e,i)},"drawLabel"),A=t(function(t,e,i){const n=t.append("g"),s=R();s.x=e.x,s.y=e.y,s.fill=e.fill,s.width=i.width,s.height=i.height,s.class="journey-section section-type-"+e.num,s.rx=3,s.ry=3,C(n,s),z(i)(e.text,n,s.x,s.y,s.width,s.height,{class:"journey-section section-type-"+e.num},i,e.colour)},"drawSection"),O=-1,W=t(function(t,e,i){const n=e.x+i.width/2,s=t.append("g");O++;s.append("line").attr("id","task"+O).attr("x1",n).attr("y1",e.y).attr("x2",n).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),M(s,{cx:n,cy:300+30*(5-e.score),score:e.score});const r=R();r.x=e.x,r.y=e.y,r.fill=e.fill,r.width=i.width,r.height=i.height,r.class="task task-type-"+e.num,r.rx=3,r.ry=3,C(s,r),z(i)(e.task,s,r.x,r.y,r.width,r.height,{class:"task"},i,e.colour)},"drawTask"),F=t(function(t,e){C(t,{x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,class:"rect"}).lower()},"drawBackgroundRect"),P=t(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),R=t(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),z=function(){function e(t,e,i,n,r,a,o,c){s(e.append("text").attr("x",i+r/2).attr("y",n+a/2+5).style("font-color",c).style("text-anchor","middle").text(t),o)}function i(t,e,i,n,r,a,o,c,l){const{taskFontSize:h,taskFontFamily:u}=c,d=t.split(/<br\s*\/?>/gi);for(let f=0;f<d.length;f++){const t=f*h-h*(d.length-1)/2,c=e.append("text").attr("x",i+r/2).attr("y",n).attr("fill",l).style("text-anchor","middle").style("font-size",h).style("font-family",u);c.append("tspan").attr("x",i+r/2).attr("dy",t).text(d[f]),c.attr("y",n+a/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),s(c,o)}}function n(t,e,n,r,a,o,c,l){const h=e.append("switch"),u=h.append("foreignObject").attr("x",n).attr("y",r).attr("width",a).attr("height",o).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");u.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),i(t,h,n,r,a,o,c,l),s(u,c)}function s(t,e){for(const i in e)i in e&&t.attr(i,e[i])}return t(e,"byText"),t(i,"byTspan"),t(n,"byFo"),t(s,"_setTextAttrs"),function(t){return"fo"===t.textPlacement?n:"old"===t.textPlacement?e:i}}(),D=t(function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics");function B(t,e){t.each(function(){var t,i=n(this),s=i.text().split(/(\s+|<br>)/).reverse(),r=[],a=i.attr("y"),o=parseFloat(i.attr("dy")),c=i.text(null).append("tspan").attr("x",0).attr("y",a).attr("dy",o+"em");for(let n=0;n<s.length;n++)t=s[s.length-1-n],r.push(t),c.text(r.join(" ").trim()),(c.node().getComputedTextLength()>e||"<br>"===t)&&(r.pop(),c.text(r.join(" ").trim()),r="<br>"===t?[""]:[t],c=i.append("tspan").attr("x",0).attr("y",a).attr("dy","1.1em").text(t))})}t(B,"wrap");var V=t(function(t,e,i,n){var s;const r=i%12-1,a=t.append("g");e.section=r,a.attr("class",(e.class?e.class+" ":"")+"timeline-node section-"+r);const o=a.append("g"),c=a.append("g"),l=c.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(B,e.width).node().getBBox(),h=(null==(s=n.fontSize)?void 0:s.replace)?n.fontSize.replace("px",""):n.fontSize;return e.height=l.height+1.1*h*.5+e.padding,e.height=Math.max(e.height,e.maxHeight),e.width=e.width+2*e.padding,c.attr("transform","translate("+e.width/2+", "+e.padding/2+")"),q(o,e,r,n),e},"drawNode"),Y=t(function(t,e,i){var n;const s=t.append("g"),r=s.append("text").text(e.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(B,e.width).node().getBBox(),a=(null==(n=i.fontSize)?void 0:n.replace)?i.fontSize.replace("px",""):i.fontSize;return s.remove(),r.height+1.1*a*.5+e.padding},"getVirtualNodeHeight"),q=t(function(t,e,i){t.append("path").attr("id","node-"+e.id).attr("class","node-bkg node-"+e.type).attr("d",`M0 ${e.height-5} v${10-e.height} q0,-5 5,-5 h${e.width-10} q5,0 5,5 v${e.height-5} H0 Z`),t.append("line").attr("class","node-line-"+i).attr("x1",0).attr("y1",e.height).attr("x2",e.width).attr("y2",e.height)},"defaultBkg"),G={drawRect:C,drawCircle:H,drawSection:A,drawText:j,drawLabel:L,drawTask:W,drawBackgroundRect:F,getTextObj:P,getNoteRect:R,initGraphics:D,drawNode:V,getVirtualNodeHeight:Y},U=t(function(t,r,a,o){var c,l,h;const u=e(),d=(null==(c=u.timeline)?void 0:c.leftMargin)??50;i.debug("timeline",o.db);const f=u.securityLevel;let m;"sandbox"===f&&(m=n("#i"+r));const p=n("sandbox"===f?m.nodes()[0].contentDocument.body:"body").select("#"+r);p.append("g");const g=o.db.getTasks(),x=o.db.getCommonDb().getDiagramTitle();i.debug("task",g),G.initGraphics(p);const k=o.db.getSections();i.debug("sections",k);let y=0,v=0,b=0,w=0,_=50+d,S=50;w=50;let $=0,T=!0;k.forEach(function(t){const e={number:$,descr:t,section:$,width:150,padding:20,maxHeight:y},n=G.getVirtualNodeHeight(p,e,u);i.debug("sectionHeight before draw",n),y=Math.max(y,n+20)});let E=0,I=0;i.debug("tasks.length",g.length);for(const[e,n]of g.entries()){const t={number:e,descr:n,section:n.section,width:150,padding:20,maxHeight:v},s=G.getVirtualNodeHeight(p,t,u);i.debug("taskHeight before draw",s),v=Math.max(v,s+20),E=Math.max(E,n.events.length);let r=0;for(const e of n.events){const t={descr:e,section:n.section,number:n.section,width:150,padding:20,maxHeight:50};r+=G.getVirtualNodeHeight(p,t,u)}n.events.length>0&&(r+=10*(n.events.length-1)),I=Math.max(I,r)}i.debug("maxSectionHeight before draw",y),i.debug("maxTaskHeight before draw",v),k&&k.length>0?k.forEach(t=>{const e=g.filter(e=>e.section===t),n={number:$,descr:t,section:$,width:200*Math.max(e.length,1)-50,padding:20,maxHeight:y};i.debug("sectionNode",n);const s=p.append("g"),r=G.drawNode(s,n,$,u);i.debug("sectionNode output",r),s.attr("transform",`translate(${_}, 50)`),S+=y+50,e.length>0&&X(p,e,$,_,S,v,u,E,I,y,!1),_+=200*Math.max(e.length,1),S=50,$++}):(T=!1,X(p,g,$,_,S,v,u,E,I,y,!0));const N=p.node().getBBox();i.debug("bounds",N),x&&p.append("text").text(x).attr("x",N.width/2-d).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),b=T?y+v+150:v+100;p.append("g").attr("class","lineWrapper").append("line").attr("x1",d).attr("y1",b).attr("x2",N.width+3*d).attr("y2",b).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),s(void 0,p,(null==(l=u.timeline)?void 0:l.padding)??50,(null==(h=u.timeline)?void 0:h.useMaxWidth)??!1)},"draw"),X=t(function(t,e,n,s,r,a,o,c,l,h,u){var d;for(const f of e){const e={descr:f.task,section:n,number:n,width:150,padding:20,maxHeight:a};i.debug("taskNode",e);const c=t.append("g").attr("class","taskWrapper"),h=G.drawNode(c,e,n,o).height;if(i.debug("taskHeight after draw",h),c.attr("transform",`translate(${s}, ${r})`),a=Math.max(a,h),f.events){const e=t.append("g").attr("class","lineWrapper");let i=a;r+=100,i+=Z(t,f.events,n,s,r,o),r-=100,e.append("line").attr("x1",s+95).attr("y1",r+a).attr("x2",s+95).attr("y2",r+a+100+l+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5")}s+=200,u&&!(null==(d=o.timeline)?void 0:d.disableMulticolor)&&n++}r-=10},"drawTasks"),Z=t(function(t,e,n,s,r,a){let o=0;const c=r;r+=100;for(const l of e){const e={descr:l,section:n,number:n,width:150,padding:20,maxHeight:50};i.debug("eventNode",e);const c=t.append("g").attr("class","eventWrapper"),h=G.drawNode(c,e,n,a).height;o+=h,c.attr("transform",`translate(${s}, ${r})`),r=r+10+h}return r=c,o},"drawEvents"),J={setConf:t(()=>{},"setConf"),draw:U},K=t(t=>{let e="";for(let i=0;i<t.THEME_COLOR_LIMIT;i++)t["lineColor"+i]=t["lineColor"+i]||t["cScaleInv"+i],r(t["lineColor"+i])?t["lineColor"+i]=a(t["lineColor"+i],20):t["lineColor"+i]=o(t["lineColor"+i],20);for(let i=0;i<t.THEME_COLOR_LIMIT;i++){const n=""+(17-3*i);e+=`\n .section-${i-1} rect, .section-${i-1} path, .section-${i-1} circle, .section-${i-1} path {\n fill: ${t["cScale"+i]};\n }\n .section-${i-1} text {\n fill: ${t["cScaleLabel"+i]};\n }\n .node-icon-${i-1} {\n font-size: 40px;\n color: ${t["cScaleLabel"+i]};\n }\n .section-edge-${i-1}{\n stroke: ${t["cScale"+i]};\n }\n .edge-depth-${i-1}{\n stroke-width: ${n};\n }\n .section-${i-1} line {\n stroke: ${t["cScaleInv"+i]} ;\n stroke-width: 3;\n }\n\n .lineWrapper line{\n stroke: ${t["cScaleLabel"+i]} ;\n }\n\n .disabled, .disabled circle, .disabled text {\n fill: lightgray;\n }\n .disabled text {\n fill: #efefef;\n }\n `}return e},"genSections"),Q={db:m,renderer:J,parser:f,styles:t(t=>`\n .edge {\n stroke-width: 3;\n }\n ${K(t)}\n .section-root rect, .section-root path, .section-root circle {\n fill: ${t.git0};\n }\n .section-root text {\n fill: ${t.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .eventWrapper {\n filter: brightness(120%);\n }\n`,"getStyles")};export{Q as diagram};
|