orbitchat 2.2.8 → 2.2.10
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/bin/orbitchat.js +45 -36
- package/dist/assets/_basePickBy-0t-1TdXj-DH4J1m8V.js +1 -0
- package/dist/assets/_baseUniq-DZ7Bpu3I-Co9egLVD.js +1 -0
- package/dist/assets/{api-L84wIOvt.js → api-0NuHuopb.js} +1 -1
- package/dist/assets/arc-CsV8WDj2-C9VadXC6.js +1 -0
- package/dist/assets/{architectureDiagram-VXUJARFQ-BuSDV2Do-_okKpoAJ.js → architectureDiagram-VXUJARFQ-5Jt_APG9-BoVNR4UV.js} +3 -3
- package/dist/assets/{blockDiagram-VD42YOAC-jQHtez-j-rtzBv-vF.js → blockDiagram-VD42YOAC-DTiW7a-n-CSp1ALjf.js} +4 -4
- package/dist/assets/{c4Diagram-YG6GDRKO-_5giM-EA-DjRoFacG.js → c4Diagram-YG6GDRKO-DfrzrMnC-CkCuHyrT.js} +4 -4
- package/dist/assets/channel-C1GZ9yWj-DYugq-sa.js +1 -0
- package/dist/assets/{chunk-4BX2VUAB-BeuiUsbc-DN2rdYji.js → chunk-4BX2VUAB-DP6WsS5b-DmFzjHyq.js} +1 -1
- package/dist/assets/chunk-55IACEB6-DcZAWW2t-DPyoMeFz.js +1 -0
- package/dist/assets/{chunk-B4BG7PRW-CnUkcto7-DHe7ngzh.js → chunk-B4BG7PRW-BVaRFjbY-BdpIBFL7.js} +3 -3
- package/dist/assets/{chunk-DI55MBZ5-CSd59tsh-DFg8M9sN.js → chunk-DI55MBZ5-NwybRWU6-D93ibRgN.js} +4 -4
- package/dist/assets/{chunk-FMBD7UC4-C6VImbBX-ip_5_GPo.js → chunk-FMBD7UC4-D0AjqgJd-BqUKvjQH.js} +1 -1
- package/dist/assets/{chunk-QN33PNHL-DrWWTLTH-tpIkWiz1.js → chunk-QN33PNHL-cmS1bOzt-B1tGHIDu.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-C6_I39By-ZQp0I6tE.js → chunk-QZHKN3VN-DehtyeGo-BsFo-AuY.js} +1 -1
- package/dist/assets/chunk-TZMSLE5B-BILiPuwH-DOft2nRu.js +1 -0
- package/dist/assets/classDiagram-2ON5EDUG-_7dtGwsA-C3Nhy3w6.js +1 -0
- package/dist/assets/classDiagram-v2-WZHVMYZB-_7dtGwsA-C3Nhy3w6.js +1 -0
- package/dist/assets/clone-D8_vOzkg-D9aZREI4.js +1 -0
- package/dist/assets/{cose-bilkent-S5V4N54A-DcyCVH6S-zMMT3oqX.js → cose-bilkent-S5V4N54A-CDJ5hD7Q-BcxkEWNp.js} +1 -1
- package/dist/assets/{dagre-6UL2VRFP-B799wmhr-DuXOlM7I.js → dagre-6UL2VRFP-D6cOp6Da-xpk1mIcg.js} +2 -2
- package/dist/assets/{diagram-PSM6KHXK-Dxp2wzKk-CmF_yeQm.js → diagram-PSM6KHXK-C0ItMhu6-BHHxSZE4.js} +1 -1
- package/dist/assets/diagram-QEK2KX5R-CEsgotfL-F-1j8qO7.js +43 -0
- package/dist/assets/{diagram-S2PKOQOG-tSpHqt0k-Dhi7ufxY.js → diagram-S2PKOQOG-B6d1S6_G-Zzv-O9xk.js} +1 -1
- package/dist/assets/{erDiagram-Q2GNP2WA-DF6ylQ7o-CjIoFnUJ.js → erDiagram-Q2GNP2WA-B-w3sS7V-2nanwMJ6.js} +4 -4
- package/dist/assets/{flowDiagram-NV44I4VS-BQUYJeB--D2fTwlvO.js → flowDiagram-NV44I4VS-DssRq_2c-BffMgd28.js} +7 -7
- package/dist/assets/ganttDiagram-JELNMOA3-IIlGW_kJ-Dxu3SgAH.js +267 -0
- package/dist/assets/gitGraphDiagram-NY62KEGX-D9Tl4KHH--tnJGvul.js +65 -0
- package/dist/assets/{graph-aRt77rZZ-Dq9dkNsk.js → graph-BZqzM_VI-BBLTPB3S.js} +1 -1
- package/dist/assets/{index-p0knuDQ9.js → index-DodYl3VC.js} +194 -166
- package/dist/assets/index-V1hWOL-o.css +1 -0
- package/dist/assets/{index-rW5EEHFR-Cm6Gxbor.js → index-rkYlv_42-Bg0V1tPP.js} +1 -1
- package/dist/assets/{infoDiagram-ER5ION4S-ozjqEnsq-D0PwL9B_.js → infoDiagram-WHAUD3N6-CjmJiQNf-YInQHfWX.js} +1 -1
- package/dist/assets/{journeyDiagram-XKPGCS4Q-C6JuEafR-BSuib8Wf.js → journeyDiagram-XKPGCS4Q-D6S72Oe9-iYQx9Mof.js} +3 -3
- package/dist/assets/{kanban-definition-3W4ZIXB7-Ci4U3NR--Bxb6Yi8G.js → kanban-definition-3W4ZIXB7--JZpAUKg-C2LOftDm.js} +6 -6
- package/dist/assets/{layout-BKjRgLFe-WihuzEZg.js → layout-DHdXRoe5-CY2O2SIL.js} +1 -1
- package/dist/assets/{mindmap-definition-VGOIOE7T-DveejCtl-DXLxEnp4.js → mindmap-definition-VGOIOE7T-I33kejqp-b66KO8Rt.js} +3 -3
- package/dist/assets/{pieDiagram-ADFJNKIX-DAbSGtae-BruonBFZ.js → pieDiagram-ADFJNKIX-69ywrIzx-ceXn0a9Q.js} +3 -3
- package/dist/assets/{quadrantDiagram-AYHSOK5B-DnnzUQMW-DzWXEz5-.js → quadrantDiagram-AYHSOK5B-CySBol3o-CltGpVzM.js} +4 -4
- package/dist/assets/{requirementDiagram-UZGBJVZJ-BB9jagBx-q21wBQ9N.js → requirementDiagram-UZGBJVZJ-BL-LwQUQ-DM_SSY8F.js} +4 -4
- package/dist/assets/{sankeyDiagram-TZEHDZUN-BttZx2-h-Cr53tHP7.js → sankeyDiagram-TZEHDZUN-D3rAZVzY-BAAQukCD.js} +1 -1
- package/dist/assets/{sequenceDiagram-WL72ISMW-DA6yVs26-B4W8xwkp.js → sequenceDiagram-WL72ISMW-BfBBVBjh-C993xDQ0.js} +1 -1
- package/dist/assets/{stateDiagram-FKZM4ZOC-BD8xEcbc-BWOiPxZu.js → stateDiagram-FKZM4ZOC-CioTL1ci-eXs9ZVMI.js} +1 -1
- package/dist/assets/stateDiagram-v2-4FDKWEC3-CNXUSYFj-C88PWSf5.js +1 -0
- package/dist/assets/{timeline-definition-IT6M3QCI-XN-D5T3b-l0nKzR1k.js → timeline-definition-IT6M3QCI-DJ1oTa68-Cp1nvAUx.js} +4 -4
- package/dist/assets/{treemap-KMMF4GRG-C4GHjB3F-_nPgBK22.js → treemap-KMMF4GRG-BLuW6hva-CvNDnceM.js} +1 -1
- package/dist/assets/{xychartDiagram-PRI3JC2R-BL53__6J-XcAq-Lxf.js → xychartDiagram-PRI3JC2R-BahWB4u4-B6_eZy6F.js} +5 -5
- package/dist/index.html +2 -2
- package/package.json +2 -2
- package/dist/assets/_basePickBy-1MakYQmz-ydNwd1l_.js +0 -1
- package/dist/assets/_baseUniq-Cd4llU-Q-Cdw60MU4.js +0 -1
- package/dist/assets/arc-b8oyw-lz-1LLYREoj.js +0 -1
- package/dist/assets/channel-BLPbvVT2-CnJJPuZ5.js +0 -1
- package/dist/assets/chunk-55IACEB6-C4OH5_NF-DrgL4Tv-.js +0 -1
- package/dist/assets/chunk-TZMSLE5B-DGddLgNl-CifiGjd6.js +0 -1
- package/dist/assets/classDiagram-2ON5EDUG-BngjTxOv-2Y-76rXt.js +0 -1
- package/dist/assets/classDiagram-v2-WZHVMYZB-BngjTxOv-2Y-76rXt.js +0 -1
- package/dist/assets/clone-DH1Kq5Y6-DxQT_fR1.js +0 -1
- package/dist/assets/diagram-QEK2KX5R-Km_liL9n-DiDvLC9k.js +0 -43
- package/dist/assets/ganttDiagram-LVOFAZNH-BidPm1xz-D_x48jVE.js +0 -267
- package/dist/assets/gitGraphDiagram-NY62KEGX-zbMOFVrv-DTVFadEr.js +0 -65
- package/dist/assets/index-42QQgFVq.css +0 -1
- package/dist/assets/stateDiagram-v2-4FDKWEC3-DINzAoyF-DshiRv7Q.js +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{l as ce}from"./chunk-FMBD7UC4-
|
|
1
|
+
import{l as ce}from"./chunk-FMBD7UC4-D0AjqgJd-BqUKvjQH.js";import{R as g,M as at,d as B,B as he,O as w,F as ue,G as ge,ba as ye,aw as pe,aD as be,g as R,aA as xe,bb as G,bc as Wt,a as fe,v as tt,x as me,bd as we,be as bt,S as xt,bf as Le}from"./index-DodYl3VC.js";import{a as Se}from"./clone-D8_vOzkg-D9aZREI4.js";import{L as ke}from"./graph-BZqzM_VI-BBLTPB3S.js";import{t as _e}from"./channel-C1GZ9yWj-DYugq-sa.js";import"./_baseUniq-DZ7Bpu3I-Co9egLVD.js";var ft=function(){var e=g(function(D,c,p,f){for(p=p||{},f=D.length;f--;p[D[f]]=c);return p},"o"),t=[1,15],s=[1,7],i=[1,13],l=[1,14],a=[1,19],r=[1,16],n=[1,17],o=[1,18],u=[8,30],y=[8,10,21,28,29,30,31,39,43,46],b=[1,23],x=[1,24],S=[8,10,15,16,21,28,29,30,31,39,43,46],L=[8,10,15,16,21,27,28,29,30,31,39,43,46],_=[1,49],k={trace:g(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:g(function(D,c,p,f,E,d,m){var h=d.length-1;switch(E){case 4:f.getLogger().debug("Rule: separator (NL) ");break;case 5:f.getLogger().debug("Rule: separator (Space) ");break;case 6:f.getLogger().debug("Rule: separator (EOF) ");break;case 7:f.getLogger().debug("Rule: hierarchy: ",d[h-1]),f.setHierarchy(d[h-1]);break;case 8:f.getLogger().debug("Stop NL ");break;case 9:f.getLogger().debug("Stop EOF ");break;case 10:f.getLogger().debug("Stop NL2 ");break;case 11:f.getLogger().debug("Stop EOF2 ");break;case 12:f.getLogger().debug("Rule: statement: ",d[h]),typeof d[h].length=="number"?this.$=d[h]:this.$=[d[h]];break;case 13:f.getLogger().debug("Rule: statement #2: ",d[h-1]),this.$=[d[h-1]].concat(d[h]);break;case 14:f.getLogger().debug("Rule: link: ",d[h],D),this.$={edgeTypeStr:d[h],label:""};break;case 15:f.getLogger().debug("Rule: LABEL link: ",d[h-3],d[h-1],d[h]),this.$={edgeTypeStr:d[h],label:d[h-1]};break;case 18:const O=parseInt(d[h]),M=f.generateId();this.$={id:M,type:"space",label:"",width:O,children:[]};break;case 23:f.getLogger().debug("Rule: (nodeStatement link node) ",d[h-2],d[h-1],d[h]," typestr: ",d[h-1].edgeTypeStr);const z=f.edgeStrToEdgeData(d[h-1].edgeTypeStr);this.$=[{id:d[h-2].id,label:d[h-2].label,type:d[h-2].type,directions:d[h-2].directions},{id:d[h-2].id+"-"+d[h].id,start:d[h-2].id,end:d[h].id,label:d[h-1].label,type:"edge",directions:d[h].directions,arrowTypeEnd:z,arrowTypeStart:"arrow_open"},{id:d[h].id,label:d[h].label,type:f.typeStr2Type(d[h].typeStr),directions:d[h].directions}];break;case 24:f.getLogger().debug("Rule: nodeStatement (abc88 node size) ",d[h-1],d[h]),this.$={id:d[h-1].id,label:d[h-1].label,type:f.typeStr2Type(d[h-1].typeStr),directions:d[h-1].directions,widthInColumns:parseInt(d[h],10)};break;case 25:f.getLogger().debug("Rule: nodeStatement (node) ",d[h]),this.$={id:d[h].id,label:d[h].label,type:f.typeStr2Type(d[h].typeStr),directions:d[h].directions,widthInColumns:1};break;case 26:f.getLogger().debug("APA123",this?this:"na"),f.getLogger().debug("COLUMNS: ",d[h]),this.$={type:"column-setting",columns:d[h]==="auto"?-1:parseInt(d[h])};break;case 27:f.getLogger().debug("Rule: id-block statement : ",d[h-2],d[h-1]),f.generateId(),this.$={...d[h-2],type:"composite",children:d[h-1]};break;case 28:f.getLogger().debug("Rule: blockStatement : ",d[h-2],d[h-1],d[h]);const W=f.generateId();this.$={id:W,type:"composite",label:"",children:d[h-1]};break;case 29:f.getLogger().debug("Rule: node (NODE_ID separator): ",d[h]),this.$={id:d[h]};break;case 30:f.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",d[h-1],d[h]),this.$={id:d[h-1],label:d[h].label,typeStr:d[h].typeStr,directions:d[h].directions};break;case 31:f.getLogger().debug("Rule: dirList: ",d[h]),this.$=[d[h]];break;case 32:f.getLogger().debug("Rule: dirList: ",d[h-1],d[h]),this.$=[d[h-1]].concat(d[h]);break;case 33:f.getLogger().debug("Rule: nodeShapeNLabel: ",d[h-2],d[h-1],d[h]),this.$={typeStr:d[h-2]+d[h],label:d[h-1]};break;case 34:f.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",d[h-3],d[h-2]," #3:",d[h-1],d[h]),this.$={typeStr:d[h-3]+d[h],label:d[h-2],directions:d[h-1]};break;case 35:case 36:this.$={type:"classDef",id:d[h-1].trim(),css:d[h].trim()};break;case 37:this.$={type:"applyClass",id:d[h-1].trim(),styleClass:d[h].trim()};break;case 38:this.$={type:"applyStyles",id:d[h-1].trim(),stylesStr:d[h].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:s,22:8,23:9,24:10,25:11,26:12,28:i,29:l,31:a,39:r,43:n,46:o},{8:[1,20]},e(u,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:s,28:i,29:l,31:a,39:r,43:n,46:o}),e(y,[2,16],{14:22,15:b,16:x}),e(y,[2,17]),e(y,[2,18]),e(y,[2,19]),e(y,[2,20]),e(y,[2,21]),e(y,[2,22]),e(S,[2,25],{27:[1,25]}),e(y,[2,26]),{19:26,26:12,31:a},{10:t,11:27,13:4,19:5,20:6,21:s,22:8,23:9,24:10,25:11,26:12,28:i,29:l,31:a,39:r,43:n,46:o},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(L,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(u,[2,13]),{26:35,31:a},{31:[2,14]},{17:[1,36]},e(S,[2,24]),{10:t,11:37,13:4,14:22,15:b,16:x,19:5,20:6,21:s,22:8,23:9,24:10,25:11,26:12,28:i,29:l,31:a,39:r,43:n,46:o},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(L,[2,30]),{18:[1,43]},{18:[1,44]},e(S,[2,23]),{18:[1,45]},{30:[1,46]},e(y,[2,28]),e(y,[2,35]),e(y,[2,36]),e(y,[2,37]),e(y,[2,38]),{36:[1,47]},{33:48,34:_},{15:[1,50]},e(y,[2,27]),e(L,[2,33]),{38:[1,51]},{33:52,34:_,38:[2,31]},{31:[2,15]},e(L,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:g(function(D,c){if(c.recoverable)this.trace(D);else{var p=new Error(D);throw p.hash=c,p}},"parseError"),parse:g(function(D){var c=this,p=[0],f=[],E=[null],d=[],m=this.table,h="",O=0,M=0,z=2,W=1,j=d.slice.call(arguments,1),T=Object.create(this.lexer),q={yy:{}};for(var ut in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ut)&&(q.yy[ut]=this.yy[ut]);T.setInput(D,q.yy),q.yy.lexer=T,q.yy.parser=this,typeof T.yylloc>"u"&&(T.yylloc={});var gt=T.yylloc;d.push(gt);var oe=T.options&&T.options.ranges;typeof q.yy.parseError=="function"?this.parseError=q.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function de(F){p.length=p.length-2*F,E.length=E.length-F,d.length=d.length-F}g(de,"popStack");function Nt(){var F;return F=f.pop()||T.lex()||W,typeof F!="number"&&(F instanceof Array&&(f=F,F=f.pop()),F=c.symbols_[F]||F),F}g(Nt,"lex");for(var X,V,K,yt,Q={},st,J,Tt,it;;){if(V=p[p.length-1],this.defaultActions[V]?K=this.defaultActions[V]:((X===null||typeof X>"u")&&(X=Nt()),K=m[V]&&m[V][X]),typeof K>"u"||!K.length||!K[0]){var pt="";it=[];for(st in m[V])this.terminals_[st]&&st>z&&it.push("'"+this.terminals_[st]+"'");T.showPosition?pt="Parse error on line "+(O+1)+`:
|
|
2
2
|
`+T.showPosition()+`
|
|
3
3
|
Expecting `+it.join(", ")+", got '"+(this.terminals_[X]||X)+"'":pt="Parse error on line "+(O+1)+": Unexpected "+(X==W?"end of input":"'"+(this.terminals_[X]||X)+"'"),this.parseError(pt,{text:T.match,token:this.terminals_[X]||X,line:T.yylineno,loc:gt,expected:it})}if(K[0]instanceof Array&&K.length>1)throw new Error("Parse Error: multiple actions possible at state: "+V+", token: "+X);switch(K[0]){case 1:p.push(X),E.push(T.yytext),d.push(T.yylloc),p.push(K[1]),X=null,M=T.yyleng,h=T.yytext,O=T.yylineno,gt=T.yylloc;break;case 2:if(J=this.productions_[K[1]][1],Q.$=E[E.length-J],Q._$={first_line:d[d.length-(J||1)].first_line,last_line:d[d.length-1].last_line,first_column:d[d.length-(J||1)].first_column,last_column:d[d.length-1].last_column},oe&&(Q._$.range=[d[d.length-(J||1)].range[0],d[d.length-1].range[1]]),yt=this.performAction.apply(Q,[h,M,O,q.yy,K[1],E,d].concat(j)),typeof yt<"u")return yt;J&&(p=p.slice(0,-1*J*2),E=E.slice(0,-1*J),d=d.slice(0,-1*J)),p.push(this.productions_[K[1]][0]),E.push(Q.$),d.push(Q._$),Tt=m[p[p.length-2]][p[p.length-1]],p.push(Tt);break;case 3:return!0}}return!0},"parse")},N=function(){var D={EOF:1,parseError:g(function(c,p){if(this.yy.parser)this.yy.parser.parseError(c,p);else throw new Error(c)},"parseError"),setInput:g(function(c,p){return this.yy=p||this.yy||{},this._input=c,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:g(function(){var c=this._input[0];this.yytext+=c,this.yyleng++,this.offset++,this.match+=c,this.matched+=c;var p=c.match(/(?:\r\n?|\n).*/g);return p?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),c},"input"),unput:g(function(c){var p=c.length,f=c.split(/(?:\r\n?|\n)/g);this._input=c+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p),this.offset-=p;var E=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),f.length-1&&(this.yylineno-=f.length-1);var d=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:f?(f.length===E.length?this.yylloc.first_column:0)+E[E.length-f.length].length-f[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},"unput"),more:g(function(){return this._more=!0,this},"more"),reject:g(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:g(function(c){this.unput(this.match.slice(c))},"less"),pastInput:g(function(){var c=this.matched.substr(0,this.matched.length-this.match.length);return(c.length>20?"...":"")+c.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:g(function(){var c=this.match;return c.length<20&&(c+=this._input.substr(0,20-c.length)),(c.substr(0,20)+(c.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:g(function(){var c=this.pastInput(),p=new Array(c.length+1).join("-");return c+this.upcomingInput()+`
|
|
5
5
|
`+p+"^"},"showPosition"),test_match:g(function(c,p){var f,E,d;if(this.options.backtrack_lexer&&(d={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(d.yylloc.range=this.yylloc.range.slice(0))),E=c[0].match(/(?:\r\n?|\n).*/g),E&&(this.yylineno+=E.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:E?E[E.length-1].length-E[E.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+c[0].length},this.yytext+=c[0],this.match+=c[0],this.matches=c,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(c[0].length),this.matched+=c[0],f=this.performAction.call(this,this.yy,this,p,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),f)return f;if(this._backtrack){for(var m in d)this[m]=d[m];return!1}return!1},"test_match"),next:g(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var c,p,f,E;this._more||(this.yytext="",this.match="");for(var d=this._currentRules(),m=0;m<d.length;m++)if(f=this._input.match(this.rules[d[m]]),f&&(!p||f[0].length>p[0].length)){if(p=f,E=m,this.options.backtrack_lexer){if(c=this.test_match(f,d[m]),c!==!1)return c;if(this._backtrack){p=!1;continue}else return!1}else if(!this.options.flex)break}return p?(c=this.test_match(p,d[E]),c!==!1?c:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:g(function(){var c=this.next();return c||this.lex()},"lex"),begin:g(function(c){this.conditionStack.push(c)},"begin"),popState:g(function(){var c=this.conditionStack.length-1;return c>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:g(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:g(function(c){return c=this.conditionStack.length-1-Math.abs(c||0),c>=0?this.conditionStack[c]:"INITIAL"},"topState"),pushState:g(function(c){this.begin(c)},"pushState"),stateStackSize:g(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:g(function(c,p,f,E){switch(f){case 0:return c.getLogger().debug("Found block-beta"),10;case 1:return c.getLogger().debug("Found id-block"),29;case 2:return c.getLogger().debug("Found block"),10;case 3:c.getLogger().debug(".",p.yytext);break;case 4:c.getLogger().debug("_",p.yytext);break;case 5:return 5;case 6:return p.yytext=-1,28;case 7:return p.yytext=p.yytext.replace(/columns\s+/,""),c.getLogger().debug("COLUMNS (LEX)",p.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:c.getLogger().debug("LEX: POPPING STR:",p.yytext),this.popState();break;case 13:return c.getLogger().debug("LEX: STR end:",p.yytext),"STR";case 14:return p.yytext=p.yytext.replace(/space\:/,""),c.getLogger().debug("SPACE NUM (LEX)",p.yytext),21;case 15:return p.yytext="1",c.getLogger().debug("COLUMNS (LEX)",p.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),c.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),c.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),c.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),c.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),c.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),c.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),c.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),c.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),c.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),c.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),c.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),c.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),c.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),c.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),c.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),c.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),c.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return c.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return c.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return c.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return c.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return c.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return c.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return c.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return c.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return c.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return c.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return c.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.pushState("NODE"),35;case 72:return c.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),c.getLogger().debug("LEX ARR START"),37;case 74:return c.getLogger().debug("Lex: NODE_ID",p.yytext),31;case 75:return c.getLogger().debug("Lex: EOF",p.yytext),8;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:c.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:c.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return c.getLogger().debug("LEX: NODE_DESCR:",p.yytext),"NODE_DESCR";case 83:c.getLogger().debug("LEX POPPING"),this.popState();break;case 84:c.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return p.yytext=p.yytext.replace(/^,\s*/,""),c.getLogger().debug("Lex (right): dir:",p.yytext),"DIR";case 86:return p.yytext=p.yytext.replace(/^,\s*/,""),c.getLogger().debug("Lex (left):",p.yytext),"DIR";case 87:return p.yytext=p.yytext.replace(/^,\s*/,""),c.getLogger().debug("Lex (x):",p.yytext),"DIR";case 88:return p.yytext=p.yytext.replace(/^,\s*/,""),c.getLogger().debug("Lex (y):",p.yytext),"DIR";case 89:return p.yytext=p.yytext.replace(/^,\s*/,""),c.getLogger().debug("Lex (up):",p.yytext),"DIR";case 90:return p.yytext=p.yytext.replace(/^,\s*/,""),c.getLogger().debug("Lex (down):",p.yytext),"DIR";case 91:return p.yytext="]>",c.getLogger().debug("Lex (ARROW_DIR end):",p.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return c.getLogger().debug("Lex: LINK","#"+p.yytext+"#"),15;case 93:return c.getLogger().debug("Lex: LINK",p.yytext),15;case 94:return c.getLogger().debug("Lex: LINK",p.yytext),15;case 95:return c.getLogger().debug("Lex: LINK",p.yytext),15;case 96:return c.getLogger().debug("Lex: START_LINK",p.yytext),this.pushState("LLABEL"),16;case 97:return c.getLogger().debug("Lex: START_LINK",p.yytext),this.pushState("LLABEL"),16;case 98:return c.getLogger().debug("Lex: START_LINK",p.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return c.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),c.getLogger().debug("Lex: LINK","#"+p.yytext+"#"),15;case 102:return this.popState(),c.getLogger().debug("Lex: LINK",p.yytext),15;case 103:return this.popState(),c.getLogger().debug("Lex: LINK",p.yytext),15;case 104:return c.getLogger().debug("Lex: COLON",p.yytext),p.yytext=p.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return D}();k.lexer=N;function v(){this.yy={}}return g(v,"Parser"),v.prototype=k,k.Parser=v,new v}();ft.parser=ft;var ve=ft,U=new Map,kt=[],mt=new Map,$t="color",Ct="fill",Ee="bgFill",Ft=",",De=A(),ot=new Map,Ne=g(e=>me.sanitizeText(e,De),"sanitizeText"),Te=g(function(e,t=""){let s=ot.get(e);s||(s={id:e,styles:[],textStyles:[]},ot.set(e,s)),t!=null&&t.split(Ft).forEach(i=>{const l=i.replace(/([^;]*);/,"$1").trim();if(RegExp($t).exec(i)){const a=l.replace(Ct,Ee).replace($t,Ct);s.textStyles.push(a)}s.styles.push(l)})},"addStyleClass"),$e=g(function(e,t=""){const s=U.get(e);t!=null&&(s.styles=t.split(Ft))},"addStyle2Node"),Ce=g(function(e,t){e.split(",").forEach(function(s){let i=U.get(s);if(i===void 0){const l=s.trim();i={id:l,type:"na",children:[]},U.set(l,i)}i.classes||(i.classes=[]),i.classes.push(t)})},"setCssClass"),Yt=g((e,t)=>{const s=e.flat(),i=[],l=s.find(r=>(r==null?void 0:r.type)==="column-setting"),a=(l==null?void 0:l.columns)??-1;for(const r of s){if(typeof a=="number"&&a>0&&r.type!=="column-setting"&&typeof r.widthInColumns=="number"&&r.widthInColumns>a&&w.warn(`Block ${r.id} width ${r.widthInColumns} exceeds configured column width ${a}`),r.label&&(r.label=Ne(r.label)),r.type==="classDef"){Te(r.id,r.css);continue}if(r.type==="applyClass"){Ce(r.id,(r==null?void 0:r.styleClass)??"");continue}if(r.type==="applyStyles"){r!=null&&r.stylesStr&&$e(r.id,r==null?void 0:r.stylesStr);continue}if(r.type==="column-setting")t.columns=r.columns??-1;else if(r.type==="edge"){const n=(mt.get(r.id)??0)+1;mt.set(r.id,n),r.id=n+"-"+r.id,kt.push(r)}else{r.label||(r.type==="composite"?r.label="":r.label=r.id);const n=U.get(r.id);if(n===void 0?U.set(r.id,r):(r.type!=="na"&&(n.type=r.type),r.label!==r.id&&(n.label=r.label)),r.children&&Yt(r.children,r),r.type==="space"){const o=r.width??1;for(let u=0;u<o;u++){const y=Se(r);y.id=y.id+"-"+u,U.set(y.id,y),i.push(y)}}else n===void 0&&i.push(r)}}t.children=i},"populateBlockDatabase"),_t=[],rt={id:"root",type:"composite",children:[],columns:-1},Ie=g(()=>{w.debug("Clear called"),ue(),rt={id:"root",type:"composite",children:[],columns:-1},U=new Map([["root",rt]]),_t=[],ot=new Map,kt=[],mt=new Map},"clear");function Kt(e){switch(w.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return w.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}g(Kt,"typeStr2Type");function Ht(e){switch(w.debug("typeStr2Type",e),e){case"==":return"thick";default:return"normal"}}g(Ht,"edgeTypeStr2Type");function jt(e){switch(e.replace(/^[\s-]+|[\s-]+$/g,"")){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}g(jt,"edgeStrToEdgeData");var It=0,Oe=g(()=>(It++,"id-"+Math.random().toString(36).substr(2,12)+"-"+It),"generateId"),Be=g(e=>{rt.children=e,Yt(e,rt),_t=rt.children},"setHierarchy"),Ae=g(e=>{const t=U.get(e);return t?t.columns?t.columns:t.children?t.children.length:-1:-1},"getColumns"),Re=g(()=>[...U.values()],"getBlocksFlat"),ze=g(()=>_t||[],"getBlocks"),Me=g(()=>kt,"getEdges"),Pe=g(e=>U.get(e),"getBlock"),Xe=g(e=>{U.set(e.id,e)},"setBlock"),We=g(()=>w,"getLogger"),Fe=g(function(){return ot},"getClasses"),Ye={getConfig:g(()=>at().block,"getConfig"),typeStr2Type:Kt,edgeTypeStr2Type:Ht,edgeStrToEdgeData:jt,getLogger:We,getBlocksFlat:Re,getBlocks:ze,getEdges:Me,setHierarchy:Be,getBlock:Pe,setBlock:Xe,getColumns:Ae,getClasses:Fe,clear:Ie,generateId:Oe},Ke=Ye,nt=g((e,t)=>{const s=_e,i=s(e,"r"),l=s(e,"g"),a=s(e,"b");return ge(i,l,a,t)},"fade"),He=g(e=>`.label {
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:g(function(){var c=this.next();return c||this.lex()},"lex"),begin:g(function(c){this.conditionStack.push(c)},"begin"),popState:g(function(){var c=this.conditionStack.length-1;return c>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:g(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:g(function(c){return c=this.conditionStack.length-1-Math.abs(c||0),c>=0?this.conditionStack[c]:"INITIAL"},"topState"),pushState:g(function(c){this.begin(c)},"pushState"),stateStackSize:g(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:g(function(c,p,f,E){switch(f){case 0:return c.getLogger().debug("Found block-beta"),10;case 1:return c.getLogger().debug("Found id-block"),29;case 2:return c.getLogger().debug("Found block"),10;case 3:c.getLogger().debug(".",p.yytext);break;case 4:c.getLogger().debug("_",p.yytext);break;case 5:return 5;case 6:return p.yytext=-1,28;case 7:return p.yytext=p.yytext.replace(/columns\s+/,""),c.getLogger().debug("COLUMNS (LEX)",p.yytext),28;case 8:this.pushState("md_string");break;case 9:return"MD_STR";case 10:this.popState();break;case 11:this.pushState("string");break;case 12:c.getLogger().debug("LEX: POPPING STR:",p.yytext),this.popState();break;case 13:return c.getLogger().debug("LEX: STR end:",p.yytext),"STR";case 14:return p.yytext=p.yytext.replace(/space\:/,""),c.getLogger().debug("SPACE NUM (LEX)",p.yytext),21;case 15:return p.yytext="1",c.getLogger().debug("COLUMNS (LEX)",p.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 34:this.popState();break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:return this.popState(),c.getLogger().debug("Lex: (("),"NODE_DEND";case 38:return this.popState(),c.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),c.getLogger().debug("Lex: ))"),"NODE_DEND";case 40:return this.popState(),c.getLogger().debug("Lex: (("),"NODE_DEND";case 41:return this.popState(),c.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),c.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),c.getLogger().debug("Lex: -)"),"NODE_DEND";case 44:return this.popState(),c.getLogger().debug("Lex: (("),"NODE_DEND";case 45:return this.popState(),c.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),c.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),c.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:return this.popState(),c.getLogger().debug("Lex: /]"),"NODE_DEND";case 49:return this.popState(),c.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),c.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),c.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),c.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),c.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return c.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return c.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return c.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:return c.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return c.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 59:return c.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 60:return c.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 61:return c.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 62:return c.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return c.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 64:return c.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 65:return this.pushState("NODE"),35;case 66:return this.pushState("NODE"),35;case 67:return this.pushState("NODE"),35;case 68:return this.pushState("NODE"),35;case 69:return this.pushState("NODE"),35;case 70:return this.pushState("NODE"),35;case 71:return this.pushState("NODE"),35;case 72:return c.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),c.getLogger().debug("LEX ARR START"),37;case 74:return c.getLogger().debug("Lex: NODE_ID",p.yytext),31;case 75:return c.getLogger().debug("Lex: EOF",p.yytext),8;case 76:this.pushState("md_string");break;case 77:this.pushState("md_string");break;case 78:return"NODE_DESCR";case 79:this.popState();break;case 80:c.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:c.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return c.getLogger().debug("LEX: NODE_DESCR:",p.yytext),"NODE_DESCR";case 83:c.getLogger().debug("LEX POPPING"),this.popState();break;case 84:c.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return p.yytext=p.yytext.replace(/^,\s*/,""),c.getLogger().debug("Lex (right): dir:",p.yytext),"DIR";case 86:return p.yytext=p.yytext.replace(/^,\s*/,""),c.getLogger().debug("Lex (left):",p.yytext),"DIR";case 87:return p.yytext=p.yytext.replace(/^,\s*/,""),c.getLogger().debug("Lex (x):",p.yytext),"DIR";case 88:return p.yytext=p.yytext.replace(/^,\s*/,""),c.getLogger().debug("Lex (y):",p.yytext),"DIR";case 89:return p.yytext=p.yytext.replace(/^,\s*/,""),c.getLogger().debug("Lex (up):",p.yytext),"DIR";case 90:return p.yytext=p.yytext.replace(/^,\s*/,""),c.getLogger().debug("Lex (down):",p.yytext),"DIR";case 91:return p.yytext="]>",c.getLogger().debug("Lex (ARROW_DIR end):",p.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return c.getLogger().debug("Lex: LINK","#"+p.yytext+"#"),15;case 93:return c.getLogger().debug("Lex: LINK",p.yytext),15;case 94:return c.getLogger().debug("Lex: LINK",p.yytext),15;case 95:return c.getLogger().debug("Lex: LINK",p.yytext),15;case 96:return c.getLogger().debug("Lex: START_LINK",p.yytext),this.pushState("LLABEL"),16;case 97:return c.getLogger().debug("Lex: START_LINK",p.yytext),this.pushState("LLABEL"),16;case 98:return c.getLogger().debug("Lex: START_LINK",p.yytext),this.pushState("LLABEL"),16;case 99:this.pushState("md_string");break;case 100:return c.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),c.getLogger().debug("Lex: LINK","#"+p.yytext+"#"),15;case 102:return this.popState(),c.getLogger().debug("Lex: LINK",p.yytext),15;case 103:return this.popState(),c.getLogger().debug("Lex: LINK",p.yytext),15;case 104:return c.getLogger().debug("Lex: COLON",p.yytext),p.yytext=p.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}};return D}();k.lexer=N;function v(){this.yy={}}return g(v,"Parser"),v.prototype=k,k.Parser=v,new v}();ft.parser=ft;var ve=ft,U=new Map,kt=[],mt=new Map,$t="color",Ct="fill",Ee="bgFill",Ft=",",De=R(),ot=new Map,Ne=g(e=>me.sanitizeText(e,De),"sanitizeText"),Te=g(function(e,t=""){let s=ot.get(e);s||(s={id:e,styles:[],textStyles:[]},ot.set(e,s)),t!=null&&t.split(Ft).forEach(i=>{const l=i.replace(/([^;]*);/,"$1").trim();if(RegExp($t).exec(i)){const a=l.replace(Ct,Ee).replace($t,Ct);s.textStyles.push(a)}s.styles.push(l)})},"addStyleClass"),$e=g(function(e,t=""){const s=U.get(e);t!=null&&(s.styles=t.split(Ft))},"addStyle2Node"),Ce=g(function(e,t){e.split(",").forEach(function(s){let i=U.get(s);if(i===void 0){const l=s.trim();i={id:l,type:"na",children:[]},U.set(l,i)}i.classes||(i.classes=[]),i.classes.push(t)})},"setCssClass"),Yt=g((e,t)=>{const s=e.flat(),i=[],l=s.find(r=>(r==null?void 0:r.type)==="column-setting"),a=(l==null?void 0:l.columns)??-1;for(const r of s){if(typeof a=="number"&&a>0&&r.type!=="column-setting"&&typeof r.widthInColumns=="number"&&r.widthInColumns>a&&w.warn(`Block ${r.id} width ${r.widthInColumns} exceeds configured column width ${a}`),r.label&&(r.label=Ne(r.label)),r.type==="classDef"){Te(r.id,r.css);continue}if(r.type==="applyClass"){Ce(r.id,(r==null?void 0:r.styleClass)??"");continue}if(r.type==="applyStyles"){r!=null&&r.stylesStr&&$e(r.id,r==null?void 0:r.stylesStr);continue}if(r.type==="column-setting")t.columns=r.columns??-1;else if(r.type==="edge"){const n=(mt.get(r.id)??0)+1;mt.set(r.id,n),r.id=n+"-"+r.id,kt.push(r)}else{r.label||(r.type==="composite"?r.label="":r.label=r.id);const n=U.get(r.id);if(n===void 0?U.set(r.id,r):(r.type!=="na"&&(n.type=r.type),r.label!==r.id&&(n.label=r.label)),r.children&&Yt(r.children,r),r.type==="space"){const o=r.width??1;for(let u=0;u<o;u++){const y=Se(r);y.id=y.id+"-"+u,U.set(y.id,y),i.push(y)}}else n===void 0&&i.push(r)}}t.children=i},"populateBlockDatabase"),_t=[],rt={id:"root",type:"composite",children:[],columns:-1},Ie=g(()=>{w.debug("Clear called"),ue(),rt={id:"root",type:"composite",children:[],columns:-1},U=new Map([["root",rt]]),_t=[],ot=new Map,kt=[],mt=new Map},"clear");function Kt(e){switch(w.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return w.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}g(Kt,"typeStr2Type");function Ht(e){switch(w.debug("typeStr2Type",e),e){case"==":return"thick";default:return"normal"}}g(Ht,"edgeTypeStr2Type");function jt(e){switch(e.replace(/^[\s-]+|[\s-]+$/g,"")){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}g(jt,"edgeStrToEdgeData");var It=0,Oe=g(()=>(It++,"id-"+Math.random().toString(36).substr(2,12)+"-"+It),"generateId"),Be=g(e=>{rt.children=e,Yt(e,rt),_t=rt.children},"setHierarchy"),Re=g(e=>{const t=U.get(e);return t?t.columns?t.columns:t.children?t.children.length:-1:-1},"getColumns"),ze=g(()=>[...U.values()],"getBlocksFlat"),Ae=g(()=>_t||[],"getBlocks"),Me=g(()=>kt,"getEdges"),Pe=g(e=>U.get(e),"getBlock"),Xe=g(e=>{U.set(e.id,e)},"setBlock"),We=g(()=>w,"getLogger"),Fe=g(function(){return ot},"getClasses"),Ye={getConfig:g(()=>at().block,"getConfig"),typeStr2Type:Kt,edgeTypeStr2Type:Ht,edgeStrToEdgeData:jt,getLogger:We,getBlocksFlat:ze,getBlocks:Ae,getEdges:Me,setHierarchy:Be,getBlock:Pe,setBlock:Xe,getColumns:Re,getClasses:Fe,clear:Ie,generateId:Oe},Ke=Ye,nt=g((e,t)=>{const s=_e,i=s(e,"r"),l=s(e,"g"),a=s(e,"b");return ge(i,l,a,t)},"fade"),He=g(e=>`.label {
|
|
7
7
|
font-family: ${e.fontFamily};
|
|
8
8
|
color: ${e.nodeTextColor||e.textColor};
|
|
9
9
|
}
|
|
@@ -116,7 +116,7 @@ Expecting `+it.join(", ")+", got '"+(this.terminals_[X]||X)+"'":pt="Parse error
|
|
|
116
116
|
fill: ${e.textColor};
|
|
117
117
|
}
|
|
118
118
|
${ce()}
|
|
119
|
-
`,"getStyles"),je=He,Ue=g((e,t,s,i)=>{t.forEach(l=>{ar[l](e,s,i)})},"insertMarkers"),Ze=g((e,t,s)=>{w.trace("Making markers for ",s),e.append("defs").append("marker").attr("id",s+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",s+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),Ge=g((e,t,s)=>{e.append("defs").append("marker").attr("id",s+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",s+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),Je=g((e,t,s)=>{e.append("defs").append("marker").attr("id",s+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",s+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),qe=g((e,t,s)=>{e.append("defs").append("marker").attr("id",s+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",s+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).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")},"dependency"),Ve=g((e,t,s)=>{e.append("defs").append("marker").attr("id",s+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",s+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),Qe=g((e,t,s)=>{e.append("marker").attr("id",s+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",s+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),tr=g((e,t,s)=>{e.append("marker").attr("id",s+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",s+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),er=g((e,t,s)=>{e.append("marker").attr("id",s+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",s+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),rr=g((e,t,s)=>{e.append("defs").append("marker").attr("id",s+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),ar={extension:Ze,composition:Ge,aggregation:Je,dependency:qe,lollipop:Ve,point:Qe,circle:tr,cross:er,barb:rr},sr=Ue,Ot,Bt,I=((Bt=(Ot=A())==null?void 0:Ot.block)==null?void 0:Bt.padding)??8;function Ut(e,t){if(e===0||!Number.isInteger(e))throw new Error("Columns must be an integer !== 0.");if(t<0||!Number.isInteger(t))throw new Error("Position must be a non-negative integer."+t);if(e<0)return{px:t,py:0};if(e===1)return{px:0,py:t};const s=t%e,i=Math.floor(t/e);return{px:s,py:i}}g(Ut,"calculateBlockPosition");var ir=g(e=>{let t=0,s=0;for(const i of e.children){const{width:l,height:a,x:r,y:n}=i.size??{width:0,height:0,x:0,y:0};w.debug("getMaxChildSize abc95 child:",i.id,"width:",l,"height:",a,"x:",r,"y:",n,i.type),i.type!=="space"&&(l>t&&(t=l/(e.widthInColumns??1)),a>s&&(s=a))}return{width:t,height:s}},"getMaxChildSize");function dt(e,t,s=0,i=0){var l,a,r,n,o,u,y,b,x,S,L;w.debug("setBlockSizes abc95 (start)",e.id,(l=e==null?void 0:e.size)==null?void 0:l.x,"block width =",e==null?void 0:e.size,"siblingWidth",s),(a=e==null?void 0:e.size)!=null&&a.width||(e.size={width:s,height:i,x:0,y:0});let _=0,k=0;if(((r=e.children)==null?void 0:r.length)>0){for(const d of e.children)dt(d,t);const N=ir(e);_=N.width,k=N.height,w.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",_,k);for(const d of e.children)d.size&&(w.debug(`abc95 Setting size of children of ${e.id} id=${d.id} ${_} ${k} ${JSON.stringify(d.size)}`),d.size.width=_*(d.widthInColumns??1)+I*((d.widthInColumns??1)-1),d.size.height=k,d.size.x=0,d.size.y=0,w.debug(`abc95 updating size of ${e.id} children child:${d.id} maxWidth:${_} maxHeight:${k}`));for(const d of e.children)dt(d,t,_,k);const v=e.columns??-1;let D=0;for(const d of e.children)D+=d.widthInColumns??1;let c=e.children.length;v>0&&v<D&&(c=v);const p=Math.ceil(D/c);let f=c*(_+I)+I,E=p*(k+I)+I;if(f<s){w.debug(`Detected to small sibling: abc95 ${e.id} siblingWidth ${s} siblingHeight ${i} width ${f}`),f=s,E=i;const d=(s-c*I-I)/c,m=(i-p*I-I)/p;w.debug("Size indata abc88",e.id,"childWidth",d,"maxWidth",_),w.debug("Size indata abc88",e.id,"childHeight",m,"maxHeight",k),w.debug("Size indata abc88 xSize",c,"padding",I);for(const h of e.children)h.size&&(h.size.width=d,h.size.height=m,h.size.x=0,h.size.y=0)}if(w.debug(`abc95 (finale calc) ${e.id} xSize ${c} ySize ${p} columns ${v}${e.children.length} width=${Math.max(f,((n=e.size)==null?void 0:n.width)||0)}`),f<(((o=e==null?void 0:e.size)==null?void 0:o.width)||0)){f=((u=e==null?void 0:e.size)==null?void 0:u.width)||0;const d=v>0?Math.min(e.children.length,v):e.children.length;if(d>0){const m=(f-d*I-I)/d;w.debug("abc95 (growing to fit) width",e.id,f,(y=e.size)==null?void 0:y.width,m);for(const h of e.children)h.size&&(h.size.width=m)}}e.size={width:f,height:E,x:0,y:0}}w.debug("setBlockSizes abc94 (done)",e.id,(b=e==null?void 0:e.size)==null?void 0:b.x,(x=e==null?void 0:e.size)==null?void 0:x.width,(S=e==null?void 0:e.size)==null?void 0:S.y,(L=e==null?void 0:e.size)==null?void 0:L.height)}g(dt,"setBlockSizes");function vt(e,t){var s,i,l,a,r,n,o,u,y,b,x,S,L,_,k,N,v;w.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${(s=e==null?void 0:e.size)==null?void 0:s.x} y: ${(i=e==null?void 0:e.size)==null?void 0:i.y} width: ${(l=e==null?void 0:e.size)==null?void 0:l.width}`);const D=e.columns??-1;if(w.debug("layoutBlocks columns abc95",e.id,"=>",D,e),e.children&&e.children.length>0){const c=((r=(a=e==null?void 0:e.children[0])==null?void 0:a.size)==null?void 0:r.width)??0,p=e.children.length*c+(e.children.length-1)*I;w.debug("widthOfChildren 88",p,"posX");let f=0;w.debug("abc91 block?.size?.x",e.id,(n=e==null?void 0:e.size)==null?void 0:n.x);let E=(o=e==null?void 0:e.size)!=null&&o.x?((u=e==null?void 0:e.size)==null?void 0:u.x)+(-((y=e==null?void 0:e.size)==null?void 0:y.width)/2||0):-I,d=0;for(const m of e.children){const h=e;if(!m.size)continue;const{width:O,height:M}=m.size,{px:R,py:W}=Ut(D,f);if(W!=d&&(d=W,E=(b=e==null?void 0:e.size)!=null&&b.x?((x=e==null?void 0:e.size)==null?void 0:x.x)+(-((S=e==null?void 0:e.size)==null?void 0:S.width)/2||0):-I,w.debug("New row in layout for block",e.id," and child ",m.id,d)),w.debug(`abc89 layout blocks (child) id: ${m.id} Pos: ${f} (px, py) ${R},${W} (${(L=h==null?void 0:h.size)==null?void 0:L.x},${(_=h==null?void 0:h.size)==null?void 0:_.y}) parent: ${h.id} width: ${O}${I}`),h.size){const T=O/2;m.size.x=E+I+T,w.debug(`abc91 layout blocks (calc) px, pyid:${m.id} startingPos=X${E} new startingPosX${m.size.x} ${T} padding=${I} width=${O} halfWidth=${T} => x:${m.size.x} y:${m.size.y} ${m.widthInColumns} (width * (child?.w || 1)) / 2 ${O*((m==null?void 0:m.widthInColumns)??1)/2}`),E=m.size.x+T,m.size.y=h.size.y-h.size.height/2+W*(M+I)+M/2+I,w.debug(`abc88 layout blocks (calc) px, pyid:${m.id}startingPosX${E}${I}${T}=>x:${m.size.x}y:${m.size.y}${m.widthInColumns}(width * (child?.w || 1)) / 2${O*((m==null?void 0:m.widthInColumns)??1)/2}`)}m.children&&vt(m);let j=(m==null?void 0:m.widthInColumns)??1;D>0&&(j=Math.min(j,D-f%D)),f+=j,w.debug("abc88 columnsPos",m,f)}}w.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${(k=e==null?void 0:e.size)==null?void 0:k.x} y: ${(N=e==null?void 0:e.size)==null?void 0:N.y} width: ${(v=e==null?void 0:e.size)==null?void 0:v.width}`)}g(vt,"layoutBlocks");function Et(e,{minX:t,minY:s,maxX:i,maxY:l}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!=="root"){const{x:a,y:r,width:n,height:o}=e.size;a-n/2<t&&(t=a-n/2),r-o/2<s&&(s=r-o/2),a+n/2>i&&(i=a+n/2),r+o/2>l&&(l=r+o/2)}if(e.children)for(const a of e.children)({minX:t,minY:s,maxX:i,maxY:l}=Et(a,{minX:t,minY:s,maxX:i,maxY:l}));return{minX:t,minY:s,maxX:i,maxY:l}}g(Et,"findBounds");function Zt(e){const t=e.getBlock("root");if(!t)return;dt(t,e,0,0),vt(t),w.debug("getBlocks",JSON.stringify(t,null,2));const{minX:s,minY:i,maxX:l,maxY:a}=Et(t),r=a-i,n=l-s;return{x:s,y:i,width:n,height:r}}g(Zt,"layout");function wt(e,t){t&&e.attr("style",t)}g(wt,"applyStyle");function Gt(e,t){const s=B(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),i=s.append("xhtml:div"),l=e.label,a=e.isNode?"nodeLabel":"edgeLabel",r=i.append("span");return r.html(xt(l,t)),wt(r,e.labelStyle),r.attr("class",a),wt(i,e.labelStyle),i.style("display","inline-block"),i.style("white-space","nowrap"),i.attr("xmlns","http://www.w3.org/1999/xhtml"),s.node()}g(Gt,"addHtmlLabel");var nr=g(async(e,t,s,i)=>{let l=e||"";typeof l=="object"&&(l=l[0]);const a=A();if(G(a.flowchart.htmlLabels)){l=l.replace(/\\n|\n/g,"<br />"),w.debug("vertexText"+l);const r=await we(bt(l)),n={isNode:i,label:r,labelStyle:t.replace("fill:","color:")};return Gt(n,a)}else{const r=document.createElementNS("http://www.w3.org/2000/svg","text");r.setAttribute("style",t.replace("color:","fill:"));let n=[];typeof l=="string"?n=l.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(l)?n=l:n=[];for(const o of n){const u=document.createElementNS("http://www.w3.org/2000/svg","tspan");u.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),u.setAttribute("dy","1em"),u.setAttribute("x","0"),s?u.setAttribute("class","title-row"):u.setAttribute("class","row"),u.textContent=o.trim(),r.appendChild(u)}return r}},"createLabel"),H=nr,lr=g((e,t,s,i,l)=>{t.arrowTypeStart&&At(e,"start",t.arrowTypeStart,s,i,l),t.arrowTypeEnd&&At(e,"end",t.arrowTypeEnd,s,i,l)},"addEdgeMarkers"),or={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},At=g((e,t,s,i,l,a)=>{const r=or[s];if(!r){w.warn(`Unknown arrow type: ${s}`);return}const n=t==="start"?"Start":"End";e.attr(`marker-${t}`,`url(${i}#${l}_${a}-${r}${n})`)},"addEdgeMarker"),Lt={},P={},dr=g(async(e,t)=>{const s=A(),i=G(s.flowchart.htmlLabels),l=t.labelType==="markdown"?Wt(e,t.label,{style:t.labelStyle,useHtmlLabels:i,addSvgBackground:!0},s):await H(t.label,t.labelStyle),a=e.insert("g").attr("class","edgeLabel"),r=a.insert("g").attr("class","label");r.node().appendChild(l);let n=l.getBBox();if(i){const u=l.children[0],y=B(l);n=u.getBoundingClientRect(),y.attr("width",n.width),y.attr("height",n.height)}r.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"),Lt[t.id]=a,t.width=n.width,t.height=n.height;let o;if(t.startLabelLeft){const u=await H(t.startLabelLeft,t.labelStyle),y=e.insert("g").attr("class","edgeTerminals"),b=y.insert("g").attr("class","inner");o=b.node().appendChild(u);const x=u.getBBox();b.attr("transform","translate("+-x.width/2+", "+-x.height/2+")"),P[t.id]||(P[t.id]={}),P[t.id].startLeft=y,et(o,t.startLabelLeft)}if(t.startLabelRight){const u=await H(t.startLabelRight,t.labelStyle),y=e.insert("g").attr("class","edgeTerminals"),b=y.insert("g").attr("class","inner");o=y.node().appendChild(u),b.node().appendChild(u);const x=u.getBBox();b.attr("transform","translate("+-x.width/2+", "+-x.height/2+")"),P[t.id]||(P[t.id]={}),P[t.id].startRight=y,et(o,t.startLabelRight)}if(t.endLabelLeft){const u=await H(t.endLabelLeft,t.labelStyle),y=e.insert("g").attr("class","edgeTerminals"),b=y.insert("g").attr("class","inner");o=b.node().appendChild(u);const x=u.getBBox();b.attr("transform","translate("+-x.width/2+", "+-x.height/2+")"),y.node().appendChild(u),P[t.id]||(P[t.id]={}),P[t.id].endLeft=y,et(o,t.endLabelLeft)}if(t.endLabelRight){const u=await H(t.endLabelRight,t.labelStyle),y=e.insert("g").attr("class","edgeTerminals"),b=y.insert("g").attr("class","inner");o=b.node().appendChild(u);const x=u.getBBox();b.attr("transform","translate("+-x.width/2+", "+-x.height/2+")"),y.node().appendChild(u),P[t.id]||(P[t.id]={}),P[t.id].endRight=y,et(o,t.endLabelRight)}return l},"insertEdgeLabel");function et(e,t){A().flowchart.htmlLabels&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}g(et,"setTerminalWidth");var cr=g((e,t)=>{w.debug("Moving label abc88 ",e.id,e.label,Lt[e.id],t);let s=t.updatedPath?t.updatedPath:t.originalPath;const i=A(),{subGraphTitleTotalMargin:l}=fe(i);if(e.label){const a=Lt[e.id];let r=e.x,n=e.y;if(s){const o=tt.calcLabelPosition(s);w.debug("Moving label "+e.label+" from (",r,",",n,") to (",o.x,",",o.y,") abc88"),t.updatedPath&&(r=o.x,n=o.y)}a.attr("transform",`translate(${r}, ${n+l/2})`)}if(e.startLabelLeft){const a=P[e.id].startLeft;let r=e.x,n=e.y;if(s){const o=tt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",s);r=o.x,n=o.y}a.attr("transform",`translate(${r}, ${n})`)}if(e.startLabelRight){const a=P[e.id].startRight;let r=e.x,n=e.y;if(s){const o=tt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",s);r=o.x,n=o.y}a.attr("transform",`translate(${r}, ${n})`)}if(e.endLabelLeft){const a=P[e.id].endLeft;let r=e.x,n=e.y;if(s){const o=tt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",s);r=o.x,n=o.y}a.attr("transform",`translate(${r}, ${n})`)}if(e.endLabelRight){const a=P[e.id].endRight;let r=e.x,n=e.y;if(s){const o=tt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",s);r=o.x,n=o.y}a.attr("transform",`translate(${r}, ${n})`)}},"positionEdgeLabel"),hr=g((e,t)=>{const s=e.x,i=e.y,l=Math.abs(t.x-s),a=Math.abs(t.y-i),r=e.width/2,n=e.height/2;return l>=r||a>=n},"outsideNode"),ur=g((e,t,s)=>{w.debug(`intersection calc abc89:
|
|
119
|
+
`,"getStyles"),je=He,Ue=g((e,t,s,i)=>{t.forEach(l=>{ar[l](e,s,i)})},"insertMarkers"),Ze=g((e,t,s)=>{w.trace("Making markers for ",s),e.append("defs").append("marker").attr("id",s+"_"+t+"-extensionStart").attr("class","marker extension "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",s+"_"+t+"-extensionEnd").attr("class","marker extension "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),Ge=g((e,t,s)=>{e.append("defs").append("marker").attr("id",s+"_"+t+"-compositionStart").attr("class","marker composition "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",s+"_"+t+"-compositionEnd").attr("class","marker composition "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),Je=g((e,t,s)=>{e.append("defs").append("marker").attr("id",s+"_"+t+"-aggregationStart").attr("class","marker aggregation "+t).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",s+"_"+t+"-aggregationEnd").attr("class","marker aggregation "+t).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),qe=g((e,t,s)=>{e.append("defs").append("marker").attr("id",s+"_"+t+"-dependencyStart").attr("class","marker dependency "+t).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",s+"_"+t+"-dependencyEnd").attr("class","marker dependency "+t).attr("refX",13).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")},"dependency"),Ve=g((e,t,s)=>{e.append("defs").append("marker").attr("id",s+"_"+t+"-lollipopStart").attr("class","marker lollipop "+t).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",s+"_"+t+"-lollipopEnd").attr("class","marker lollipop "+t).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),Qe=g((e,t,s)=>{e.append("marker").attr("id",s+"_"+t+"-pointEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",s+"_"+t+"-pointStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),tr=g((e,t,s)=>{e.append("marker").attr("id",s+"_"+t+"-circleEnd").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",s+"_"+t+"-circleStart").attr("class","marker "+t).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),er=g((e,t,s)=>{e.append("marker").attr("id",s+"_"+t+"-crossEnd").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",s+"_"+t+"-crossStart").attr("class","marker cross "+t).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),rr=g((e,t,s)=>{e.append("defs").append("marker").attr("id",s+"_"+t+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),ar={extension:Ze,composition:Ge,aggregation:Je,dependency:qe,lollipop:Ve,point:Qe,circle:tr,cross:er,barb:rr},sr=Ue,Ot,Bt,I=((Bt=(Ot=R())==null?void 0:Ot.block)==null?void 0:Bt.padding)??8;function Ut(e,t){if(e===0||!Number.isInteger(e))throw new Error("Columns must be an integer !== 0.");if(t<0||!Number.isInteger(t))throw new Error("Position must be a non-negative integer."+t);if(e<0)return{px:t,py:0};if(e===1)return{px:0,py:t};const s=t%e,i=Math.floor(t/e);return{px:s,py:i}}g(Ut,"calculateBlockPosition");var ir=g(e=>{let t=0,s=0;for(const i of e.children){const{width:l,height:a,x:r,y:n}=i.size??{width:0,height:0,x:0,y:0};w.debug("getMaxChildSize abc95 child:",i.id,"width:",l,"height:",a,"x:",r,"y:",n,i.type),i.type!=="space"&&(l>t&&(t=l/(e.widthInColumns??1)),a>s&&(s=a))}return{width:t,height:s}},"getMaxChildSize");function dt(e,t,s=0,i=0){var l,a,r,n,o,u,y,b,x,S,L;w.debug("setBlockSizes abc95 (start)",e.id,(l=e==null?void 0:e.size)==null?void 0:l.x,"block width =",e==null?void 0:e.size,"siblingWidth",s),(a=e==null?void 0:e.size)!=null&&a.width||(e.size={width:s,height:i,x:0,y:0});let _=0,k=0;if(((r=e.children)==null?void 0:r.length)>0){for(const d of e.children)dt(d,t);const N=ir(e);_=N.width,k=N.height,w.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",_,k);for(const d of e.children)d.size&&(w.debug(`abc95 Setting size of children of ${e.id} id=${d.id} ${_} ${k} ${JSON.stringify(d.size)}`),d.size.width=_*(d.widthInColumns??1)+I*((d.widthInColumns??1)-1),d.size.height=k,d.size.x=0,d.size.y=0,w.debug(`abc95 updating size of ${e.id} children child:${d.id} maxWidth:${_} maxHeight:${k}`));for(const d of e.children)dt(d,t,_,k);const v=e.columns??-1;let D=0;for(const d of e.children)D+=d.widthInColumns??1;let c=e.children.length;v>0&&v<D&&(c=v);const p=Math.ceil(D/c);let f=c*(_+I)+I,E=p*(k+I)+I;if(f<s){w.debug(`Detected to small sibling: abc95 ${e.id} siblingWidth ${s} siblingHeight ${i} width ${f}`),f=s,E=i;const d=(s-c*I-I)/c,m=(i-p*I-I)/p;w.debug("Size indata abc88",e.id,"childWidth",d,"maxWidth",_),w.debug("Size indata abc88",e.id,"childHeight",m,"maxHeight",k),w.debug("Size indata abc88 xSize",c,"padding",I);for(const h of e.children)h.size&&(h.size.width=d,h.size.height=m,h.size.x=0,h.size.y=0)}if(w.debug(`abc95 (finale calc) ${e.id} xSize ${c} ySize ${p} columns ${v}${e.children.length} width=${Math.max(f,((n=e.size)==null?void 0:n.width)||0)}`),f<(((o=e==null?void 0:e.size)==null?void 0:o.width)||0)){f=((u=e==null?void 0:e.size)==null?void 0:u.width)||0;const d=v>0?Math.min(e.children.length,v):e.children.length;if(d>0){const m=(f-d*I-I)/d;w.debug("abc95 (growing to fit) width",e.id,f,(y=e.size)==null?void 0:y.width,m);for(const h of e.children)h.size&&(h.size.width=m)}}e.size={width:f,height:E,x:0,y:0}}w.debug("setBlockSizes abc94 (done)",e.id,(b=e==null?void 0:e.size)==null?void 0:b.x,(x=e==null?void 0:e.size)==null?void 0:x.width,(S=e==null?void 0:e.size)==null?void 0:S.y,(L=e==null?void 0:e.size)==null?void 0:L.height)}g(dt,"setBlockSizes");function vt(e,t){var s,i,l,a,r,n,o,u,y,b,x,S,L,_,k,N,v;w.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${(s=e==null?void 0:e.size)==null?void 0:s.x} y: ${(i=e==null?void 0:e.size)==null?void 0:i.y} width: ${(l=e==null?void 0:e.size)==null?void 0:l.width}`);const D=e.columns??-1;if(w.debug("layoutBlocks columns abc95",e.id,"=>",D,e),e.children&&e.children.length>0){const c=((r=(a=e==null?void 0:e.children[0])==null?void 0:a.size)==null?void 0:r.width)??0,p=e.children.length*c+(e.children.length-1)*I;w.debug("widthOfChildren 88",p,"posX");let f=0;w.debug("abc91 block?.size?.x",e.id,(n=e==null?void 0:e.size)==null?void 0:n.x);let E=(o=e==null?void 0:e.size)!=null&&o.x?((u=e==null?void 0:e.size)==null?void 0:u.x)+(-((y=e==null?void 0:e.size)==null?void 0:y.width)/2||0):-I,d=0;for(const m of e.children){const h=e;if(!m.size)continue;const{width:O,height:M}=m.size,{px:z,py:W}=Ut(D,f);if(W!=d&&(d=W,E=(b=e==null?void 0:e.size)!=null&&b.x?((x=e==null?void 0:e.size)==null?void 0:x.x)+(-((S=e==null?void 0:e.size)==null?void 0:S.width)/2||0):-I,w.debug("New row in layout for block",e.id," and child ",m.id,d)),w.debug(`abc89 layout blocks (child) id: ${m.id} Pos: ${f} (px, py) ${z},${W} (${(L=h==null?void 0:h.size)==null?void 0:L.x},${(_=h==null?void 0:h.size)==null?void 0:_.y}) parent: ${h.id} width: ${O}${I}`),h.size){const T=O/2;m.size.x=E+I+T,w.debug(`abc91 layout blocks (calc) px, pyid:${m.id} startingPos=X${E} new startingPosX${m.size.x} ${T} padding=${I} width=${O} halfWidth=${T} => x:${m.size.x} y:${m.size.y} ${m.widthInColumns} (width * (child?.w || 1)) / 2 ${O*((m==null?void 0:m.widthInColumns)??1)/2}`),E=m.size.x+T,m.size.y=h.size.y-h.size.height/2+W*(M+I)+M/2+I,w.debug(`abc88 layout blocks (calc) px, pyid:${m.id}startingPosX${E}${I}${T}=>x:${m.size.x}y:${m.size.y}${m.widthInColumns}(width * (child?.w || 1)) / 2${O*((m==null?void 0:m.widthInColumns)??1)/2}`)}m.children&&vt(m);let j=(m==null?void 0:m.widthInColumns)??1;D>0&&(j=Math.min(j,D-f%D)),f+=j,w.debug("abc88 columnsPos",m,f)}}w.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${(k=e==null?void 0:e.size)==null?void 0:k.x} y: ${(N=e==null?void 0:e.size)==null?void 0:N.y} width: ${(v=e==null?void 0:e.size)==null?void 0:v.width}`)}g(vt,"layoutBlocks");function Et(e,{minX:t,minY:s,maxX:i,maxY:l}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!=="root"){const{x:a,y:r,width:n,height:o}=e.size;a-n/2<t&&(t=a-n/2),r-o/2<s&&(s=r-o/2),a+n/2>i&&(i=a+n/2),r+o/2>l&&(l=r+o/2)}if(e.children)for(const a of e.children)({minX:t,minY:s,maxX:i,maxY:l}=Et(a,{minX:t,minY:s,maxX:i,maxY:l}));return{minX:t,minY:s,maxX:i,maxY:l}}g(Et,"findBounds");function Zt(e){const t=e.getBlock("root");if(!t)return;dt(t,e,0,0),vt(t),w.debug("getBlocks",JSON.stringify(t,null,2));const{minX:s,minY:i,maxX:l,maxY:a}=Et(t),r=a-i,n=l-s;return{x:s,y:i,width:n,height:r}}g(Zt,"layout");function wt(e,t){t&&e.attr("style",t)}g(wt,"applyStyle");function Gt(e,t){const s=B(document.createElementNS("http://www.w3.org/2000/svg","foreignObject")),i=s.append("xhtml:div"),l=e.label,a=e.isNode?"nodeLabel":"edgeLabel",r=i.append("span");return r.html(xt(l,t)),wt(r,e.labelStyle),r.attr("class",a),wt(i,e.labelStyle),i.style("display","inline-block"),i.style("white-space","nowrap"),i.attr("xmlns","http://www.w3.org/1999/xhtml"),s.node()}g(Gt,"addHtmlLabel");var nr=g(async(e,t,s,i)=>{let l=e||"";typeof l=="object"&&(l=l[0]);const a=R();if(G(a.flowchart.htmlLabels)){l=l.replace(/\\n|\n/g,"<br />"),w.debug("vertexText"+l);const r=await we(bt(l)),n={isNode:i,label:r,labelStyle:t.replace("fill:","color:")};return Gt(n,a)}else{const r=document.createElementNS("http://www.w3.org/2000/svg","text");r.setAttribute("style",t.replace("color:","fill:"));let n=[];typeof l=="string"?n=l.split(/\\n|\n|<br\s*\/?>/gi):Array.isArray(l)?n=l:n=[];for(const o of n){const u=document.createElementNS("http://www.w3.org/2000/svg","tspan");u.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),u.setAttribute("dy","1em"),u.setAttribute("x","0"),s?u.setAttribute("class","title-row"):u.setAttribute("class","row"),u.textContent=o.trim(),r.appendChild(u)}return r}},"createLabel"),H=nr,lr=g((e,t,s,i,l)=>{t.arrowTypeStart&&Rt(e,"start",t.arrowTypeStart,s,i,l),t.arrowTypeEnd&&Rt(e,"end",t.arrowTypeEnd,s,i,l)},"addEdgeMarkers"),or={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},Rt=g((e,t,s,i,l,a)=>{const r=or[s];if(!r){w.warn(`Unknown arrow type: ${s}`);return}const n=t==="start"?"Start":"End";e.attr(`marker-${t}`,`url(${i}#${l}_${a}-${r}${n})`)},"addEdgeMarker"),Lt={},P={},dr=g(async(e,t)=>{const s=R(),i=G(s.flowchart.htmlLabels),l=t.labelType==="markdown"?Wt(e,t.label,{style:t.labelStyle,useHtmlLabels:i,addSvgBackground:!0},s):await H(t.label,t.labelStyle),a=e.insert("g").attr("class","edgeLabel"),r=a.insert("g").attr("class","label");r.node().appendChild(l);let n=l.getBBox();if(i){const u=l.children[0],y=B(l);n=u.getBoundingClientRect(),y.attr("width",n.width),y.attr("height",n.height)}r.attr("transform","translate("+-n.width/2+", "+-n.height/2+")"),Lt[t.id]=a,t.width=n.width,t.height=n.height;let o;if(t.startLabelLeft){const u=await H(t.startLabelLeft,t.labelStyle),y=e.insert("g").attr("class","edgeTerminals"),b=y.insert("g").attr("class","inner");o=b.node().appendChild(u);const x=u.getBBox();b.attr("transform","translate("+-x.width/2+", "+-x.height/2+")"),P[t.id]||(P[t.id]={}),P[t.id].startLeft=y,et(o,t.startLabelLeft)}if(t.startLabelRight){const u=await H(t.startLabelRight,t.labelStyle),y=e.insert("g").attr("class","edgeTerminals"),b=y.insert("g").attr("class","inner");o=y.node().appendChild(u),b.node().appendChild(u);const x=u.getBBox();b.attr("transform","translate("+-x.width/2+", "+-x.height/2+")"),P[t.id]||(P[t.id]={}),P[t.id].startRight=y,et(o,t.startLabelRight)}if(t.endLabelLeft){const u=await H(t.endLabelLeft,t.labelStyle),y=e.insert("g").attr("class","edgeTerminals"),b=y.insert("g").attr("class","inner");o=b.node().appendChild(u);const x=u.getBBox();b.attr("transform","translate("+-x.width/2+", "+-x.height/2+")"),y.node().appendChild(u),P[t.id]||(P[t.id]={}),P[t.id].endLeft=y,et(o,t.endLabelLeft)}if(t.endLabelRight){const u=await H(t.endLabelRight,t.labelStyle),y=e.insert("g").attr("class","edgeTerminals"),b=y.insert("g").attr("class","inner");o=b.node().appendChild(u);const x=u.getBBox();b.attr("transform","translate("+-x.width/2+", "+-x.height/2+")"),y.node().appendChild(u),P[t.id]||(P[t.id]={}),P[t.id].endRight=y,et(o,t.endLabelRight)}return l},"insertEdgeLabel");function et(e,t){R().flowchart.htmlLabels&&e&&(e.style.width=t.length*9+"px",e.style.height="12px")}g(et,"setTerminalWidth");var cr=g((e,t)=>{w.debug("Moving label abc88 ",e.id,e.label,Lt[e.id],t);let s=t.updatedPath?t.updatedPath:t.originalPath;const i=R(),{subGraphTitleTotalMargin:l}=fe(i);if(e.label){const a=Lt[e.id];let r=e.x,n=e.y;if(s){const o=tt.calcLabelPosition(s);w.debug("Moving label "+e.label+" from (",r,",",n,") to (",o.x,",",o.y,") abc88"),t.updatedPath&&(r=o.x,n=o.y)}a.attr("transform",`translate(${r}, ${n+l/2})`)}if(e.startLabelLeft){const a=P[e.id].startLeft;let r=e.x,n=e.y;if(s){const o=tt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_left",s);r=o.x,n=o.y}a.attr("transform",`translate(${r}, ${n})`)}if(e.startLabelRight){const a=P[e.id].startRight;let r=e.x,n=e.y;if(s){const o=tt.calcTerminalLabelPosition(e.arrowTypeStart?10:0,"start_right",s);r=o.x,n=o.y}a.attr("transform",`translate(${r}, ${n})`)}if(e.endLabelLeft){const a=P[e.id].endLeft;let r=e.x,n=e.y;if(s){const o=tt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_left",s);r=o.x,n=o.y}a.attr("transform",`translate(${r}, ${n})`)}if(e.endLabelRight){const a=P[e.id].endRight;let r=e.x,n=e.y;if(s){const o=tt.calcTerminalLabelPosition(e.arrowTypeEnd?10:0,"end_right",s);r=o.x,n=o.y}a.attr("transform",`translate(${r}, ${n})`)}},"positionEdgeLabel"),hr=g((e,t)=>{const s=e.x,i=e.y,l=Math.abs(t.x-s),a=Math.abs(t.y-i),r=e.width/2,n=e.height/2;return l>=r||a>=n},"outsideNode"),ur=g((e,t,s)=>{w.debug(`intersection calc abc89:
|
|
120
120
|
outsidePoint: ${JSON.stringify(t)}
|
|
121
121
|
insidePoint : ${JSON.stringify(s)}
|
|
122
|
-
node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,l=e.y,a=Math.abs(i-s.x),r=e.width/2;let n=s.x<t.x?r-a:r+a;const o=e.height/2,u=Math.abs(t.y-s.y),y=Math.abs(t.x-s.x);if(Math.abs(l-t.y)*r>Math.abs(i-t.x)*o){let b=s.y<t.y?t.y-o-l:l-o-t.y;n=y*b/u;const x={x:s.x<t.x?s.x+n:s.x-y+n,y:s.y<t.y?s.y+u-b:s.y-u+b};return n===0&&(x.x=t.x,x.y=t.y),y===0&&(x.x=t.x),u===0&&(x.y=t.y),w.debug(`abc89 topp/bott calc, Q ${u}, q ${b}, R ${y}, r ${n}`,x),x}else{s.x<t.x?n=t.x-r-i:n=i-r-t.x;let b=u*n/y,x=s.x<t.x?s.x+y-n:s.x-y+n,S=s.y<t.y?s.y+b:s.y-b;return w.debug(`sides calc abc89, Q ${u}, q ${b}, R ${y}, r ${n}`,{_x:x,_y:S}),n===0&&(x=t.x,S=t.y),y===0&&(x=t.x),u===0&&(S=t.y),{x,y:S}}},"intersection"),Rt=g((e,t)=>{w.debug("abc88 cutPathAtIntersect",e,t);let s=[],i=e[0],l=!1;return e.forEach(a=>{if(!hr(t,a)&&!l){const r=ur(t,i,a);let n=!1;s.forEach(o=>{n=n||o.x===r.x&&o.y===r.y}),s.some(o=>o.x===r.x&&o.y===r.y)||s.push(r),l=!0}else i=a,l||s.push(a)}),s},"cutPathAtIntersect"),gr=g(function(e,t,s,i,l,a,r){let n=s.points;w.debug("abc88 InsertEdge: edge=",s,"e=",t);let o=!1;const u=a.node(t.v);var y=a.node(t.w);y!=null&&y.intersect&&u!=null&&u.intersect&&(n=n.slice(1,s.points.length-1),n.unshift(u.intersect(n[0])),n.push(y.intersect(n[n.length-1]))),s.toCluster&&(w.debug("to cluster abc88",i[s.toCluster]),n=Rt(s.points,i[s.toCluster].node),o=!0),s.fromCluster&&(w.debug("from cluster abc88",i[s.fromCluster]),n=Rt(n.reverse(),i[s.fromCluster].node).reverse(),o=!0);const b=n.filter(c=>!Number.isNaN(c.y));let x=be;s.curve&&(l==="graph"||l==="flowchart")&&(x=s.curve);const{x:S,y:L}=ye(s),_=pe().x(S).y(L).curve(x);let k;switch(s.thickness){case"normal":k="edge-thickness-normal";break;case"thick":k="edge-thickness-thick";break;case"invisible":k="edge-thickness-thick";break;default:k=""}switch(s.pattern){case"solid":k+=" edge-pattern-solid";break;case"dotted":k+=" edge-pattern-dotted";break;case"dashed":k+=" edge-pattern-dashed";break}const N=e.append("path").attr("d",_(b)).attr("id",s.id).attr("class"," "+k+(s.classes?" "+s.classes:"")).attr("style",s.style);let v="";(A().flowchart.arrowMarkerAbsolute||A().state.arrowMarkerAbsolute)&&(v=xe(!0)),lr(N,s,v,r,l);let D={};return o&&(D.updatedPath=n),D.originalPath=s.points,D},"insertEdge"),yr=g(e=>{const t=new Set;for(const s of e)switch(s){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(s);break}return t},"expandAndDeduplicateDirections"),pr=g((e,t,s)=>{const i=yr(e),l=2,a=t.height+2*s.padding,r=a/l,n=t.width+2*r+s.padding,o=s.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:r,y:0},{x:n/2,y:2*o},{x:n-r,y:0},{x:n,y:0},{x:n,y:-a/3},{x:n+2*o,y:-a/2},{x:n,y:-2*a/3},{x:n,y:-a},{x:n-r,y:-a},{x:n/2,y:-a-2*o},{x:r,y:-a},{x:0,y:-a},{x:0,y:-2*a/3},{x:-2*o,y:-a/2},{x:0,y:-a/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:r,y:0},{x:n-r,y:0},{x:n,y:-a/2},{x:n-r,y:-a},{x:r,y:-a},{x:0,y:-a/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:r,y:-a},{x:n-r,y:-a},{x:n,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:n,y:-r},{x:n,y:-a+r},{x:0,y:-a}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:n,y:0},{x:0,y:-r},{x:0,y:-a+r},{x:n,y:-a}]:i.has("right")&&i.has("left")?[{x:r,y:0},{x:r,y:-o},{x:n-r,y:-o},{x:n-r,y:0},{x:n,y:-a/2},{x:n-r,y:-a},{x:n-r,y:-a+o},{x:r,y:-a+o},{x:r,y:-a},{x:0,y:-a/2}]:i.has("up")&&i.has("down")?[{x:n/2,y:0},{x:0,y:-o},{x:r,y:-o},{x:r,y:-a+o},{x:0,y:-a+o},{x:n/2,y:-a},{x:n,y:-a+o},{x:n-r,y:-a+o},{x:n-r,y:-o},{x:n,y:-o}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:n,y:-r},{x:0,y:-a}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:n,y:0},{x:0,y:-a}]:i.has("left")&&i.has("up")?[{x:n,y:0},{x:0,y:-r},{x:n,y:-a}]:i.has("left")&&i.has("down")?[{x:n,y:0},{x:0,y:0},{x:n,y:-a}]:i.has("right")?[{x:r,y:-o},{x:r,y:-o},{x:n-r,y:-o},{x:n-r,y:0},{x:n,y:-a/2},{x:n-r,y:-a},{x:n-r,y:-a+o},{x:r,y:-a+o},{x:r,y:-a+o}]:i.has("left")?[{x:r,y:0},{x:r,y:-o},{x:n-r,y:-o},{x:n-r,y:-a+o},{x:r,y:-a+o},{x:r,y:-a},{x:0,y:-a/2}]:i.has("up")?[{x:r,y:-o},{x:r,y:-a+o},{x:0,y:-a+o},{x:n/2,y:-a},{x:n,y:-a+o},{x:n-r,y:-a+o},{x:n-r,y:-o}]:i.has("down")?[{x:n/2,y:0},{x:0,y:-o},{x:r,y:-o},{x:r,y:-a+o},{x:n-r,y:-a+o},{x:n-r,y:-o},{x:n,y:-o}]:[{x:0,y:0}]},"getArrowPoints");function Jt(e,t){return e.intersect(t)}g(Jt,"intersectNode");var br=Jt;function qt(e,t,s,i){var l=e.x,a=e.y,r=l-i.x,n=a-i.y,o=Math.sqrt(t*t*n*n+s*s*r*r),u=Math.abs(t*s*r/o);i.x<l&&(u=-u);var y=Math.abs(t*s*n/o);return i.y<a&&(y=-y),{x:l+u,y:a+y}}g(qt,"intersectEllipse");var Vt=qt;function Qt(e,t,s){return Vt(e,t,t,s)}g(Qt,"intersectCircle");var xr=Qt;function te(e,t,s,i){var l,a,r,n,o,u,y,b,x,S,L,_,k,N,v;if(l=t.y-e.y,r=e.x-t.x,o=t.x*e.y-e.x*t.y,x=l*s.x+r*s.y+o,S=l*i.x+r*i.y+o,!(x!==0&&S!==0&&St(x,S))&&(a=i.y-s.y,n=s.x-i.x,u=i.x*s.y-s.x*i.y,y=a*e.x+n*e.y+u,b=a*t.x+n*t.y+u,!(y!==0&&b!==0&&St(y,b))&&(L=l*n-a*r,L!==0)))return _=Math.abs(L/2),k=r*u-n*o,N=k<0?(k-_)/L:(k+_)/L,k=a*o-l*u,v=k<0?(k-_)/L:(k+_)/L,{x:N,y:v}}g(te,"intersectLine");function St(e,t){return e*t>0}g(St,"sameSign");var fr=te,mr=ee;function ee(e,t,s){var i=e.x,l=e.y,a=[],r=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(L){r=Math.min(r,L.x),n=Math.min(n,L.y)}):(r=Math.min(r,t.x),n=Math.min(n,t.y));for(var o=i-e.width/2-r,u=l-e.height/2-n,y=0;y<t.length;y++){var b=t[y],x=t[y<t.length-1?y+1:0],S=fr(e,s,{x:o+b.x,y:u+b.y},{x:o+x.x,y:u+x.y});S&&a.push(S)}return a.length?(a.length>1&&a.sort(function(L,_){var k=L.x-s.x,N=L.y-s.y,v=Math.sqrt(k*k+N*N),D=_.x-s.x,c=_.y-s.y,p=Math.sqrt(D*D+c*c);return v<p?-1:v===p?0:1}),a[0]):e}g(ee,"intersectPolygon");var wr=g((e,t)=>{var s=e.x,i=e.y,l=t.x-s,a=t.y-i,r=e.width/2,n=e.height/2,o,u;return Math.abs(a)*r>Math.abs(l)*n?(a<0&&(n=-n),o=a===0?0:n*l/a,u=n):(l<0&&(r=-r),o=r,u=l===0?0:r*a/l),{x:s+o,y:i+u}},"intersectRect"),Lr=wr,$={node:br,circle:xr,ellipse:Vt,polygon:mr,rect:Lr},z=g(async(e,t,s,i)=>{const l=A();let a;const r=t.useHtmlLabels||G(l.flowchart.htmlLabels);s?a=s:a="node default";const n=e.insert("g").attr("class",a).attr("id",t.domId||t.id),o=n.insert("g").attr("class","label").attr("style",t.labelStyle);let u;t.labelText===void 0?u="":u=typeof t.labelText=="string"?t.labelText:t.labelText[0];const y=o.node();let b;t.labelType==="markdown"?b=Wt(o,xt(bt(u),l),{useHtmlLabels:r,width:t.width||l.flowchart.wrappingWidth,classes:"markdown-node-label"},l):b=y.appendChild(await H(xt(bt(u),l),t.labelStyle,!1,i));let x=b.getBBox();const S=t.padding/2;if(G(l.flowchart.htmlLabels)){const L=b.children[0],_=B(b),k=L.getElementsByTagName("img");if(k){const N=u.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...k].map(v=>new Promise(D=>{function c(){if(v.style.display="flex",v.style.flexDirection="column",N){const p=l.fontSize?l.fontSize:window.getComputedStyle(document.body).fontSize,f=parseInt(p,10)*5+"px";v.style.minWidth=f,v.style.maxWidth=f}else v.style.width="100%";D(v)}g(c,"setupImage"),setTimeout(()=>{v.complete&&c()}),v.addEventListener("error",c),v.addEventListener("load",c)})))}x=L.getBoundingClientRect(),_.attr("width",x.width),_.attr("height",x.height)}return r?o.attr("transform","translate("+-x.width/2+", "+-x.height/2+")"):o.attr("transform","translate(0, "+-x.height/2+")"),t.centerLabel&&o.attr("transform","translate("+-x.width/2+", "+-x.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:n,bbox:x,halfPadding:S,label:o}},"labelHelper"),C=g((e,t)=>{const s=t.node().getBBox();e.width=s.width,e.height=s.height},"updateNodeBounds");function Z(e,t,s,i){return e.insert("polygon",":first-child").attr("points",i.map(function(l){return l.x+","+l.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+s/2+")")}g(Z,"insertPolygonShape");var Sr=g(async(e,t)=>{t.useHtmlLabels||A().flowchart.htmlLabels||(t.centerLabel=!0);const{shapeSvg:s,bbox:i,halfPadding:l}=await z(e,t,"node "+t.classes,!0);w.info("Classes = ",t.classes);const a=s.insert("rect",":first-child");return a.attr("rx",t.rx).attr("ry",t.ry).attr("x",-i.width/2-l).attr("y",-i.height/2-l).attr("width",i.width+t.padding).attr("height",i.height+t.padding),C(t,a),t.intersect=function(r){return $.rect(t,r)},s},"note"),kr=Sr,zt=g(e=>e?" "+e:"","formatClass"),Y=g((e,t)=>`${t||"node default"}${zt(e.classes)} ${zt(e.class)}`,"getClassesFromNode"),Mt=g(async(e,t)=>{const{shapeSvg:s,bbox:i}=await z(e,t,Y(t,void 0),!0),l=i.width+t.padding,a=i.height+t.padding,r=l+a,n=[{x:r/2,y:0},{x:r,y:-r/2},{x:r/2,y:-r},{x:0,y:-r/2}];w.info("Question main (Circle)");const o=Z(s,r,r,n);return o.attr("style",t.style),C(t,o),t.intersect=function(u){return w.warn("Intersect called"),$.polygon(t,n,u)},s},"question"),_r=g((e,t)=>{const s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),i=28,l=[{x:0,y:i/2},{x:i/2,y:0},{x:0,y:-i/2},{x:-i/2,y:0}];return s.insert("polygon",":first-child").attr("points",l.map(function(a){return a.x+","+a.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),t.width=28,t.height=28,t.intersect=function(a){return $.circle(t,14,a)},s},"choice"),vr=g(async(e,t)=>{const{shapeSvg:s,bbox:i}=await z(e,t,Y(t,void 0),!0),l=4,a=i.height+t.padding,r=a/l,n=i.width+2*r+t.padding,o=[{x:r,y:0},{x:n-r,y:0},{x:n,y:-a/2},{x:n-r,y:-a},{x:r,y:-a},{x:0,y:-a/2}],u=Z(s,n,a,o);return u.attr("style",t.style),C(t,u),t.intersect=function(y){return $.polygon(t,o,y)},s},"hexagon"),Er=g(async(e,t)=>{const{shapeSvg:s,bbox:i}=await z(e,t,void 0,!0),l=2,a=i.height+2*t.padding,r=a/l,n=i.width+2*r+t.padding,o=pr(t.directions,i,t),u=Z(s,n,a,o);return u.attr("style",t.style),C(t,u),t.intersect=function(y){return $.polygon(t,o,y)},s},"block_arrow"),Dr=g(async(e,t)=>{const{shapeSvg:s,bbox:i}=await z(e,t,Y(t,void 0),!0),l=i.width+t.padding,a=i.height+t.padding,r=[{x:-a/2,y:0},{x:l,y:0},{x:l,y:-a},{x:-a/2,y:-a},{x:0,y:-a/2}];return Z(s,l,a,r).attr("style",t.style),t.width=l+a,t.height=a,t.intersect=function(n){return $.polygon(t,r,n)},s},"rect_left_inv_arrow"),Nr=g(async(e,t)=>{const{shapeSvg:s,bbox:i}=await z(e,t,Y(t),!0),l=i.width+t.padding,a=i.height+t.padding,r=[{x:-2*a/6,y:0},{x:l-a/6,y:0},{x:l+2*a/6,y:-a},{x:a/6,y:-a}],n=Z(s,l,a,r);return n.attr("style",t.style),C(t,n),t.intersect=function(o){return $.polygon(t,r,o)},s},"lean_right"),Tr=g(async(e,t)=>{const{shapeSvg:s,bbox:i}=await z(e,t,Y(t,void 0),!0),l=i.width+t.padding,a=i.height+t.padding,r=[{x:2*a/6,y:0},{x:l+a/6,y:0},{x:l-2*a/6,y:-a},{x:-a/6,y:-a}],n=Z(s,l,a,r);return n.attr("style",t.style),C(t,n),t.intersect=function(o){return $.polygon(t,r,o)},s},"lean_left"),$r=g(async(e,t)=>{const{shapeSvg:s,bbox:i}=await z(e,t,Y(t,void 0),!0),l=i.width+t.padding,a=i.height+t.padding,r=[{x:-2*a/6,y:0},{x:l+2*a/6,y:0},{x:l-a/6,y:-a},{x:a/6,y:-a}],n=Z(s,l,a,r);return n.attr("style",t.style),C(t,n),t.intersect=function(o){return $.polygon(t,r,o)},s},"trapezoid"),Cr=g(async(e,t)=>{const{shapeSvg:s,bbox:i}=await z(e,t,Y(t,void 0),!0),l=i.width+t.padding,a=i.height+t.padding,r=[{x:a/6,y:0},{x:l-a/6,y:0},{x:l+2*a/6,y:-a},{x:-2*a/6,y:-a}],n=Z(s,l,a,r);return n.attr("style",t.style),C(t,n),t.intersect=function(o){return $.polygon(t,r,o)},s},"inv_trapezoid"),Ir=g(async(e,t)=>{const{shapeSvg:s,bbox:i}=await z(e,t,Y(t,void 0),!0),l=i.width+t.padding,a=i.height+t.padding,r=[{x:0,y:0},{x:l+a/2,y:0},{x:l,y:-a/2},{x:l+a/2,y:-a},{x:0,y:-a}],n=Z(s,l,a,r);return n.attr("style",t.style),C(t,n),t.intersect=function(o){return $.polygon(t,r,o)},s},"rect_right_inv_arrow"),Or=g(async(e,t)=>{const{shapeSvg:s,bbox:i}=await z(e,t,Y(t,void 0),!0),l=i.width+t.padding,a=l/2,r=a/(2.5+l/50),n=i.height+r+t.padding,o="M 0,"+r+" a "+a+","+r+" 0,0,0 "+l+" 0 a "+a+","+r+" 0,0,0 "+-l+" 0 l 0,"+n+" a "+a+","+r+" 0,0,0 "+l+" 0 l 0,"+-n,u=s.attr("label-offset-y",r).insert("path",":first-child").attr("style",t.style).attr("d",o).attr("transform","translate("+-l/2+","+-(n/2+r)+")");return C(t,u),t.intersect=function(y){const b=$.rect(t,y),x=b.x-t.x;if(a!=0&&(Math.abs(x)<t.width/2||Math.abs(x)==t.width/2&&Math.abs(b.y-t.y)>t.height/2-r)){let S=r*r*(1-x*x/(a*a));S!=0&&(S=Math.sqrt(S)),S=r-S,y.y-t.y>0&&(S=-S),b.y+=S}return b},s},"cylinder"),Br=g(async(e,t)=>{const{shapeSvg:s,bbox:i,halfPadding:l}=await z(e,t,"node "+t.classes+" "+t.class,!0),a=s.insert("rect",":first-child"),r=t.positioned?t.width:i.width+t.padding,n=t.positioned?t.height:i.height+t.padding,o=t.positioned?-r/2:-i.width/2-l,u=t.positioned?-n/2:-i.height/2-l;if(a.attr("class","basic label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",o).attr("y",u).attr("width",r).attr("height",n),t.props){const y=new Set(Object.keys(t.props));t.props.borders&&(ct(a,t.props.borders,r,n),y.delete("borders")),y.forEach(b=>{w.warn(`Unknown node property ${b}`)})}return C(t,a),t.intersect=function(y){return $.rect(t,y)},s},"rect"),Ar=g(async(e,t)=>{const{shapeSvg:s,bbox:i,halfPadding:l}=await z(e,t,"node "+t.classes,!0),a=s.insert("rect",":first-child"),r=t.positioned?t.width:i.width+t.padding,n=t.positioned?t.height:i.height+t.padding,o=t.positioned?-r/2:-i.width/2-l,u=t.positioned?-n/2:-i.height/2-l;if(a.attr("class","basic cluster composite label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",o).attr("y",u).attr("width",r).attr("height",n),t.props){const y=new Set(Object.keys(t.props));t.props.borders&&(ct(a,t.props.borders,r,n),y.delete("borders")),y.forEach(b=>{w.warn(`Unknown node property ${b}`)})}return C(t,a),t.intersect=function(y){return $.rect(t,y)},s},"composite"),Rr=g(async(e,t)=>{const{shapeSvg:s}=await z(e,t,"label",!0);w.trace("Classes = ",t.class);const i=s.insert("rect",":first-child"),l=0,a=0;if(i.attr("width",l).attr("height",a),s.attr("class","label edgeLabel"),t.props){const r=new Set(Object.keys(t.props));t.props.borders&&(ct(i,t.props.borders,l,a),r.delete("borders")),r.forEach(n=>{w.warn(`Unknown node property ${n}`)})}return C(t,i),t.intersect=function(r){return $.rect(t,r)},s},"labelRect");function ct(e,t,s,i){const l=[],a=g(n=>{l.push(n,0)},"addBorder"),r=g(n=>{l.push(0,n)},"skipBorder");t.includes("t")?(w.debug("add top border"),a(s)):r(s),t.includes("r")?(w.debug("add right border"),a(i)):r(i),t.includes("b")?(w.debug("add bottom border"),a(s)):r(s),t.includes("l")?(w.debug("add left border"),a(i)):r(i),e.attr("stroke-dasharray",l.join(" "))}g(ct,"applyNodePropertyBorders");var zr=g(async(e,t)=>{let s;t.classes?s="node "+t.classes:s="node default";const i=e.insert("g").attr("class",s).attr("id",t.domId||t.id),l=i.insert("rect",":first-child"),a=i.insert("line"),r=i.insert("g").attr("class","label"),n=t.labelText.flat?t.labelText.flat():t.labelText;let o="";typeof n=="object"?o=n[0]:o=n,w.info("Label text abc79",o,n,typeof n=="object");const u=r.node().appendChild(await H(o,t.labelStyle,!0,!0));let y={width:0,height:0};if(G(A().flowchart.htmlLabels)){const _=u.children[0],k=B(u);y=_.getBoundingClientRect(),k.attr("width",y.width),k.attr("height",y.height)}w.info("Text 2",n);const b=n.slice(1,n.length);let x=u.getBBox();const S=r.node().appendChild(await H(b.join?b.join("<br/>"):b,t.labelStyle,!0,!0));if(G(A().flowchart.htmlLabels)){const _=S.children[0],k=B(S);y=_.getBoundingClientRect(),k.attr("width",y.width),k.attr("height",y.height)}const L=t.padding/2;return B(S).attr("transform","translate( "+(y.width>x.width?0:(x.width-y.width)/2)+", "+(x.height+L+5)+")"),B(u).attr("transform","translate( "+(y.width<x.width?0:-(x.width-y.width)/2)+", 0)"),y=r.node().getBBox(),r.attr("transform","translate("+-y.width/2+", "+(-y.height/2-L+3)+")"),l.attr("class","outer title-state").attr("x",-y.width/2-L).attr("y",-y.height/2-L).attr("width",y.width+t.padding).attr("height",y.height+t.padding),a.attr("class","divider").attr("x1",-y.width/2-L).attr("x2",y.width/2+L).attr("y1",-y.height/2-L+x.height+L).attr("y2",-y.height/2-L+x.height+L),C(t,l),t.intersect=function(_){return $.rect(t,_)},i},"rectWithTitle"),Mr=g(async(e,t)=>{const{shapeSvg:s,bbox:i}=await z(e,t,Y(t,void 0),!0),l=i.height+t.padding,a=i.width+l/4+t.padding,r=s.insert("rect",":first-child").attr("style",t.style).attr("rx",l/2).attr("ry",l/2).attr("x",-a/2).attr("y",-l/2).attr("width",a).attr("height",l);return C(t,r),t.intersect=function(n){return $.rect(t,n)},s},"stadium"),Pr=g(async(e,t)=>{const{shapeSvg:s,bbox:i,halfPadding:l}=await z(e,t,Y(t,void 0),!0),a=s.insert("circle",":first-child");return a.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",i.width/2+l).attr("width",i.width+t.padding).attr("height",i.height+t.padding),w.info("Circle main"),C(t,a),t.intersect=function(r){return w.info("Circle intersect",t,i.width/2+l,r),$.circle(t,i.width/2+l,r)},s},"circle"),Xr=g(async(e,t)=>{const{shapeSvg:s,bbox:i,halfPadding:l}=await z(e,t,Y(t,void 0),!0),a=5,r=s.insert("g",":first-child"),n=r.insert("circle"),o=r.insert("circle");return r.attr("class",t.class),n.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",i.width/2+l+a).attr("width",i.width+t.padding+a*2).attr("height",i.height+t.padding+a*2),o.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",i.width/2+l).attr("width",i.width+t.padding).attr("height",i.height+t.padding),w.info("DoubleCircle main"),C(t,n),t.intersect=function(u){return w.info("DoubleCircle intersect",t,i.width/2+l+a,u),$.circle(t,i.width/2+l+a,u)},s},"doublecircle"),Wr=g(async(e,t)=>{const{shapeSvg:s,bbox:i}=await z(e,t,Y(t,void 0),!0),l=i.width+t.padding,a=i.height+t.padding,r=[{x:0,y:0},{x:l,y:0},{x:l,y:-a},{x:0,y:-a},{x:0,y:0},{x:-8,y:0},{x:l+8,y:0},{x:l+8,y:-a},{x:-8,y:-a},{x:-8,y:0}],n=Z(s,l,a,r);return n.attr("style",t.style),C(t,n),t.intersect=function(o){return $.polygon(t,r,o)},s},"subroutine"),Fr=g((e,t)=>{const s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),i=s.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),C(t,i),t.intersect=function(l){return $.circle(t,7,l)},s},"start"),Pt=g((e,t,s)=>{const i=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let l=70,a=10;s==="LR"&&(l=10,a=70);const r=i.append("rect").attr("x",-1*l/2).attr("y",-1*a/2).attr("width",l).attr("height",a).attr("class","fork-join");return C(t,r),t.height=t.height+t.padding/2,t.width=t.width+t.padding/2,t.intersect=function(n){return $.rect(t,n)},i},"forkJoin"),Yr=g((e,t)=>{const s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),i=s.insert("circle",":first-child"),l=s.insert("circle",":first-child");return l.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),i.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),C(t,l),t.intersect=function(a){return $.circle(t,7,a)},s},"end"),Kr=g(async(e,t)=>{var s;const i=t.padding/2,l=4,a=8;let r;t.classes?r="node "+t.classes:r="node default";const n=e.insert("g").attr("class",r).attr("id",t.domId||t.id),o=n.insert("rect",":first-child"),u=n.insert("line"),y=n.insert("line");let b=0,x=l;const S=n.insert("g").attr("class","label");let L=0;const _=(s=t.classData.annotations)==null?void 0:s[0],k=t.classData.annotations[0]?"«"+t.classData.annotations[0]+"»":"",N=S.node().appendChild(await H(k,t.labelStyle,!0,!0));let v=N.getBBox();if(G(A().flowchart.htmlLabels)){const m=N.children[0],h=B(N);v=m.getBoundingClientRect(),h.attr("width",v.width),h.attr("height",v.height)}t.classData.annotations[0]&&(x+=v.height+l,b+=v.width);let D=t.classData.label;t.classData.type!==void 0&&t.classData.type!==""&&(A().flowchart.htmlLabels?D+="<"+t.classData.type+">":D+="<"+t.classData.type+">");const c=S.node().appendChild(await H(D,t.labelStyle,!0,!0));B(c).attr("class","classTitle");let p=c.getBBox();if(G(A().flowchart.htmlLabels)){const m=c.children[0],h=B(c);p=m.getBoundingClientRect(),h.attr("width",p.width),h.attr("height",p.height)}x+=p.height+l,p.width>b&&(b=p.width);const f=[];t.classData.members.forEach(async m=>{const h=m.getDisplayDetails();let O=h.displayText;A().flowchart.htmlLabels&&(O=O.replace(/</g,"<").replace(/>/g,">"));const M=S.node().appendChild(await H(O,h.cssStyle?h.cssStyle:t.labelStyle,!0,!0));let R=M.getBBox();if(G(A().flowchart.htmlLabels)){const W=M.children[0],j=B(M);R=W.getBoundingClientRect(),j.attr("width",R.width),j.attr("height",R.height)}R.width>b&&(b=R.width),x+=R.height+l,f.push(M)}),x+=a;const E=[];if(t.classData.methods.forEach(async m=>{const h=m.getDisplayDetails();let O=h.displayText;A().flowchart.htmlLabels&&(O=O.replace(/</g,"<").replace(/>/g,">"));const M=S.node().appendChild(await H(O,h.cssStyle?h.cssStyle:t.labelStyle,!0,!0));let R=M.getBBox();if(G(A().flowchart.htmlLabels)){const W=M.children[0],j=B(M);R=W.getBoundingClientRect(),j.attr("width",R.width),j.attr("height",R.height)}R.width>b&&(b=R.width),x+=R.height+l,E.push(M)}),x+=a,_){let m=(b-v.width)/2;B(N).attr("transform","translate( "+(-1*b/2+m)+", "+-1*x/2+")"),L=v.height+l}let d=(b-p.width)/2;return B(c).attr("transform","translate( "+(-1*b/2+d)+", "+(-1*x/2+L)+")"),L+=p.height+l,u.attr("class","divider").attr("x1",-b/2-i).attr("x2",b/2+i).attr("y1",-x/2-i+a+L).attr("y2",-x/2-i+a+L),L+=a,f.forEach(m=>{B(m).attr("transform","translate( "+-b/2+", "+(-1*x/2+L+a/2)+")");const h=m==null?void 0:m.getBBox();L+=((h==null?void 0:h.height)??0)+l}),L+=a,y.attr("class","divider").attr("x1",-b/2-i).attr("x2",b/2+i).attr("y1",-x/2-i+a+L).attr("y2",-x/2-i+a+L),L+=a,E.forEach(m=>{B(m).attr("transform","translate( "+-b/2+", "+(-1*x/2+L)+")");const h=m==null?void 0:m.getBBox();L+=((h==null?void 0:h.height)??0)+l}),o.attr("style",t.style).attr("class","outer title-state").attr("x",-b/2-i).attr("y",-(x/2)-i).attr("width",b+t.padding).attr("height",x+t.padding),C(t,o),t.intersect=function(m){return $.rect(t,m)},n},"class_box"),Xt={rhombus:Mt,composite:Ar,question:Mt,rect:Br,labelRect:Rr,rectWithTitle:zr,choice:_r,circle:Pr,doublecircle:Xr,stadium:Mr,hexagon:vr,block_arrow:Er,rect_left_inv_arrow:Dr,lean_right:Nr,lean_left:Tr,trapezoid:$r,inv_trapezoid:Cr,rect_right_inv_arrow:Ir,cylinder:Or,start:Fr,end:Yr,note:kr,subroutine:Wr,fork:Pt,join:Pt,class_box:Kr},lt={},re=g(async(e,t,s)=>{let i,l;if(t.link){let a;A().securityLevel==="sandbox"?a="_top":t.linkTarget&&(a=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",a),l=await Xt[t.shape](i,t,s)}else l=await Xt[t.shape](e,t,s),i=l;return t.tooltip&&l.attr("title",t.tooltip),t.class&&l.attr("class","node default "+t.class),lt[t.id]=i,t.haveCallback&<[t.id].attr("class",lt[t.id].attr("class")+" clickable"),i},"insertNode"),Hr=g(e=>{const t=lt[e.id];w.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const s=8,i=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+i-e.width/2)+", "+(e.y-e.height/2-s)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),i},"positionNode");function Dt(e,t,s=!1){var i,l,a;const r=e;let n="default";(((i=r==null?void 0:r.classes)==null?void 0:i.length)||0)>0&&(n=((r==null?void 0:r.classes)??[]).join(" ")),n=n+" flowchart-label";let o=0,u="",y;switch(r.type){case"round":o=5,u="rect";break;case"composite":o=0,u="composite",y=0;break;case"square":u="rect";break;case"diamond":u="question";break;case"hexagon":u="hexagon";break;case"block_arrow":u="block_arrow";break;case"odd":u="rect_left_inv_arrow";break;case"lean_right":u="lean_right";break;case"lean_left":u="lean_left";break;case"trapezoid":u="trapezoid";break;case"inv_trapezoid":u="inv_trapezoid";break;case"rect_left_inv_arrow":u="rect_left_inv_arrow";break;case"circle":u="circle";break;case"ellipse":u="ellipse";break;case"stadium":u="stadium";break;case"subroutine":u="subroutine";break;case"cylinder":u="cylinder";break;case"group":u="rect";break;case"doublecircle":u="doublecircle";break;default:u="rect"}const b=Le((r==null?void 0:r.styles)??[]),x=r.label,S=r.size??{width:0,height:0,x:0,y:0};return{labelStyle:b.labelStyle,shape:u,labelText:x,rx:o,ry:o,class:n,style:b.style,id:r.id,directions:r.directions,width:S.width,height:S.height,x:S.x,y:S.y,positioned:s,intersect:void 0,type:r.type,padding:y??((a=(l=at())==null?void 0:l.block)==null?void 0:a.padding)??0}}g(Dt,"getNodeFromBlock");async function ae(e,t,s){const i=Dt(t,s,!1);if(i.type==="group")return;const l=at(),a=await re(e,i,{config:l}),r=a.node().getBBox(),n=s.getBlock(i.id);n.size={width:r.width,height:r.height,x:0,y:0,node:a},s.setBlock(n),a.remove()}g(ae,"calculateBlockSize");async function se(e,t,s){const i=Dt(t,s,!0);if(s.getBlock(i.id).type!=="space"){const l=at();await re(e,i,{config:l}),t.intersect=i==null?void 0:i.intersect,Hr(i)}}g(se,"insertBlockPositioned");async function ht(e,t,s,i){for(const l of t)await i(e,l,s),l.children&&await ht(e,l.children,s,i)}g(ht,"performOperations");async function ie(e,t,s){await ht(e,t,s,ae)}g(ie,"calculateBlockSizes");async function ne(e,t,s){await ht(e,t,s,se)}g(ne,"insertBlocks");async function le(e,t,s,i,l){const a=new ke({multigraph:!0,compound:!0});a.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const r of s)r.size&&a.setNode(r.id,{width:r.size.width,height:r.size.height,intersect:r.intersect});for(const r of t)if(r.start&&r.end){const n=i.getBlock(r.start),o=i.getBlock(r.end);if(n!=null&&n.size&&o!=null&&o.size){const u=n.size,y=o.size,b=[{x:u.x,y:u.y},{x:u.x+(y.x-u.x)/2,y:u.y+(y.y-u.y)/2},{x:y.x,y:y.y}];gr(e,{v:r.start,w:r.end,name:r.id},{...r,arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:b,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"},void 0,"block",a,l),r.label&&(await dr(e,{...r,label:r.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:b,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"}),cr({...r,x:b[1].x,y:b[1].y},{originalPath:b}))}}}g(le,"insertEdges");var jr=g(function(e,t){return t.db.getClasses()},"getClasses"),Ur=g(async function(e,t,s,i){const{securityLevel:l,block:a}=at(),r=i.db;let n;l==="sandbox"&&(n=B("#i"+t));const o=l==="sandbox"?B(n.nodes()[0].contentDocument.body):B("body"),u=l==="sandbox"?o.select(`[id="${t}"]`):B(`[id="${t}"]`);sr(u,["point","circle","cross"],i.type,t);const y=r.getBlocks(),b=r.getBlocksFlat(),x=r.getEdges(),S=u.insert("g").attr("class","block");await ie(S,y,r);const L=Zt(r);if(await ne(S,y,r),await le(S,x,b,r,t),L){const _=L,k=Math.max(1,Math.round(.125*(_.width/_.height))),N=_.height+k+10,v=_.width+10,{useMaxWidth:D}=a;he(u,N,v,!!D),w.debug("Here Bounds",L,_),u.attr("viewBox",`${_.x-5} ${_.y-5} ${_.width+10} ${_.height+10}`)}},"draw"),Zr={draw:Ur,getClasses:jr},ea={parser:ve,db:Ke,renderer:Zr,styles:je};export{ea as diagram};
|
|
122
|
+
node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,l=e.y,a=Math.abs(i-s.x),r=e.width/2;let n=s.x<t.x?r-a:r+a;const o=e.height/2,u=Math.abs(t.y-s.y),y=Math.abs(t.x-s.x);if(Math.abs(l-t.y)*r>Math.abs(i-t.x)*o){let b=s.y<t.y?t.y-o-l:l-o-t.y;n=y*b/u;const x={x:s.x<t.x?s.x+n:s.x-y+n,y:s.y<t.y?s.y+u-b:s.y-u+b};return n===0&&(x.x=t.x,x.y=t.y),y===0&&(x.x=t.x),u===0&&(x.y=t.y),w.debug(`abc89 topp/bott calc, Q ${u}, q ${b}, R ${y}, r ${n}`,x),x}else{s.x<t.x?n=t.x-r-i:n=i-r-t.x;let b=u*n/y,x=s.x<t.x?s.x+y-n:s.x-y+n,S=s.y<t.y?s.y+b:s.y-b;return w.debug(`sides calc abc89, Q ${u}, q ${b}, R ${y}, r ${n}`,{_x:x,_y:S}),n===0&&(x=t.x,S=t.y),y===0&&(x=t.x),u===0&&(S=t.y),{x,y:S}}},"intersection"),zt=g((e,t)=>{w.debug("abc88 cutPathAtIntersect",e,t);let s=[],i=e[0],l=!1;return e.forEach(a=>{if(!hr(t,a)&&!l){const r=ur(t,i,a);let n=!1;s.forEach(o=>{n=n||o.x===r.x&&o.y===r.y}),s.some(o=>o.x===r.x&&o.y===r.y)||s.push(r),l=!0}else i=a,l||s.push(a)}),s},"cutPathAtIntersect"),gr=g(function(e,t,s,i,l,a,r){let n=s.points;w.debug("abc88 InsertEdge: edge=",s,"e=",t);let o=!1;const u=a.node(t.v);var y=a.node(t.w);y!=null&&y.intersect&&u!=null&&u.intersect&&(n=n.slice(1,s.points.length-1),n.unshift(u.intersect(n[0])),n.push(y.intersect(n[n.length-1]))),s.toCluster&&(w.debug("to cluster abc88",i[s.toCluster]),n=zt(s.points,i[s.toCluster].node),o=!0),s.fromCluster&&(w.debug("from cluster abc88",i[s.fromCluster]),n=zt(n.reverse(),i[s.fromCluster].node).reverse(),o=!0);const b=n.filter(c=>!Number.isNaN(c.y));let x=be;s.curve&&(l==="graph"||l==="flowchart")&&(x=s.curve);const{x:S,y:L}=ye(s),_=pe().x(S).y(L).curve(x);let k;switch(s.thickness){case"normal":k="edge-thickness-normal";break;case"thick":k="edge-thickness-thick";break;case"invisible":k="edge-thickness-thick";break;default:k=""}switch(s.pattern){case"solid":k+=" edge-pattern-solid";break;case"dotted":k+=" edge-pattern-dotted";break;case"dashed":k+=" edge-pattern-dashed";break}const N=e.append("path").attr("d",_(b)).attr("id",s.id).attr("class"," "+k+(s.classes?" "+s.classes:"")).attr("style",s.style);let v="";(R().flowchart.arrowMarkerAbsolute||R().state.arrowMarkerAbsolute)&&(v=xe(!0)),lr(N,s,v,r,l);let D={};return o&&(D.updatedPath=n),D.originalPath=s.points,D},"insertEdge"),yr=g(e=>{const t=new Set;for(const s of e)switch(s){case"x":t.add("right"),t.add("left");break;case"y":t.add("up"),t.add("down");break;default:t.add(s);break}return t},"expandAndDeduplicateDirections"),pr=g((e,t,s)=>{const i=yr(e),l=2,a=t.height+2*s.padding,r=a/l,n=t.width+2*r+s.padding,o=s.padding/2;return i.has("right")&&i.has("left")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:r,y:0},{x:n/2,y:2*o},{x:n-r,y:0},{x:n,y:0},{x:n,y:-a/3},{x:n+2*o,y:-a/2},{x:n,y:-2*a/3},{x:n,y:-a},{x:n-r,y:-a},{x:n/2,y:-a-2*o},{x:r,y:-a},{x:0,y:-a},{x:0,y:-2*a/3},{x:-2*o,y:-a/2},{x:0,y:-a/3}]:i.has("right")&&i.has("left")&&i.has("up")?[{x:r,y:0},{x:n-r,y:0},{x:n,y:-a/2},{x:n-r,y:-a},{x:r,y:-a},{x:0,y:-a/2}]:i.has("right")&&i.has("left")&&i.has("down")?[{x:0,y:0},{x:r,y:-a},{x:n-r,y:-a},{x:n,y:0}]:i.has("right")&&i.has("up")&&i.has("down")?[{x:0,y:0},{x:n,y:-r},{x:n,y:-a+r},{x:0,y:-a}]:i.has("left")&&i.has("up")&&i.has("down")?[{x:n,y:0},{x:0,y:-r},{x:0,y:-a+r},{x:n,y:-a}]:i.has("right")&&i.has("left")?[{x:r,y:0},{x:r,y:-o},{x:n-r,y:-o},{x:n-r,y:0},{x:n,y:-a/2},{x:n-r,y:-a},{x:n-r,y:-a+o},{x:r,y:-a+o},{x:r,y:-a},{x:0,y:-a/2}]:i.has("up")&&i.has("down")?[{x:n/2,y:0},{x:0,y:-o},{x:r,y:-o},{x:r,y:-a+o},{x:0,y:-a+o},{x:n/2,y:-a},{x:n,y:-a+o},{x:n-r,y:-a+o},{x:n-r,y:-o},{x:n,y:-o}]:i.has("right")&&i.has("up")?[{x:0,y:0},{x:n,y:-r},{x:0,y:-a}]:i.has("right")&&i.has("down")?[{x:0,y:0},{x:n,y:0},{x:0,y:-a}]:i.has("left")&&i.has("up")?[{x:n,y:0},{x:0,y:-r},{x:n,y:-a}]:i.has("left")&&i.has("down")?[{x:n,y:0},{x:0,y:0},{x:n,y:-a}]:i.has("right")?[{x:r,y:-o},{x:r,y:-o},{x:n-r,y:-o},{x:n-r,y:0},{x:n,y:-a/2},{x:n-r,y:-a},{x:n-r,y:-a+o},{x:r,y:-a+o},{x:r,y:-a+o}]:i.has("left")?[{x:r,y:0},{x:r,y:-o},{x:n-r,y:-o},{x:n-r,y:-a+o},{x:r,y:-a+o},{x:r,y:-a},{x:0,y:-a/2}]:i.has("up")?[{x:r,y:-o},{x:r,y:-a+o},{x:0,y:-a+o},{x:n/2,y:-a},{x:n,y:-a+o},{x:n-r,y:-a+o},{x:n-r,y:-o}]:i.has("down")?[{x:n/2,y:0},{x:0,y:-o},{x:r,y:-o},{x:r,y:-a+o},{x:n-r,y:-a+o},{x:n-r,y:-o},{x:n,y:-o}]:[{x:0,y:0}]},"getArrowPoints");function Jt(e,t){return e.intersect(t)}g(Jt,"intersectNode");var br=Jt;function qt(e,t,s,i){var l=e.x,a=e.y,r=l-i.x,n=a-i.y,o=Math.sqrt(t*t*n*n+s*s*r*r),u=Math.abs(t*s*r/o);i.x<l&&(u=-u);var y=Math.abs(t*s*n/o);return i.y<a&&(y=-y),{x:l+u,y:a+y}}g(qt,"intersectEllipse");var Vt=qt;function Qt(e,t,s){return Vt(e,t,t,s)}g(Qt,"intersectCircle");var xr=Qt;function te(e,t,s,i){var l,a,r,n,o,u,y,b,x,S,L,_,k,N,v;if(l=t.y-e.y,r=e.x-t.x,o=t.x*e.y-e.x*t.y,x=l*s.x+r*s.y+o,S=l*i.x+r*i.y+o,!(x!==0&&S!==0&&St(x,S))&&(a=i.y-s.y,n=s.x-i.x,u=i.x*s.y-s.x*i.y,y=a*e.x+n*e.y+u,b=a*t.x+n*t.y+u,!(y!==0&&b!==0&&St(y,b))&&(L=l*n-a*r,L!==0)))return _=Math.abs(L/2),k=r*u-n*o,N=k<0?(k-_)/L:(k+_)/L,k=a*o-l*u,v=k<0?(k-_)/L:(k+_)/L,{x:N,y:v}}g(te,"intersectLine");function St(e,t){return e*t>0}g(St,"sameSign");var fr=te,mr=ee;function ee(e,t,s){var i=e.x,l=e.y,a=[],r=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;typeof t.forEach=="function"?t.forEach(function(L){r=Math.min(r,L.x),n=Math.min(n,L.y)}):(r=Math.min(r,t.x),n=Math.min(n,t.y));for(var o=i-e.width/2-r,u=l-e.height/2-n,y=0;y<t.length;y++){var b=t[y],x=t[y<t.length-1?y+1:0],S=fr(e,s,{x:o+b.x,y:u+b.y},{x:o+x.x,y:u+x.y});S&&a.push(S)}return a.length?(a.length>1&&a.sort(function(L,_){var k=L.x-s.x,N=L.y-s.y,v=Math.sqrt(k*k+N*N),D=_.x-s.x,c=_.y-s.y,p=Math.sqrt(D*D+c*c);return v<p?-1:v===p?0:1}),a[0]):e}g(ee,"intersectPolygon");var wr=g((e,t)=>{var s=e.x,i=e.y,l=t.x-s,a=t.y-i,r=e.width/2,n=e.height/2,o,u;return Math.abs(a)*r>Math.abs(l)*n?(a<0&&(n=-n),o=a===0?0:n*l/a,u=n):(l<0&&(r=-r),o=r,u=l===0?0:r*a/l),{x:s+o,y:i+u}},"intersectRect"),Lr=wr,$={node:br,circle:xr,ellipse:Vt,polygon:mr,rect:Lr},A=g(async(e,t,s,i)=>{const l=R();let a;const r=t.useHtmlLabels||G(l.flowchart.htmlLabels);s?a=s:a="node default";const n=e.insert("g").attr("class",a).attr("id",t.domId||t.id),o=n.insert("g").attr("class","label").attr("style",t.labelStyle);let u;t.labelText===void 0?u="":u=typeof t.labelText=="string"?t.labelText:t.labelText[0];const y=o.node();let b;t.labelType==="markdown"?b=Wt(o,xt(bt(u),l),{useHtmlLabels:r,width:t.width||l.flowchart.wrappingWidth,classes:"markdown-node-label"},l):b=y.appendChild(await H(xt(bt(u),l),t.labelStyle,!1,i));let x=b.getBBox();const S=t.padding/2;if(G(l.flowchart.htmlLabels)){const L=b.children[0],_=B(b),k=L.getElementsByTagName("img");if(k){const N=u.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...k].map(v=>new Promise(D=>{function c(){if(v.style.display="flex",v.style.flexDirection="column",N){const p=l.fontSize?l.fontSize:window.getComputedStyle(document.body).fontSize,f=parseInt(p,10)*5+"px";v.style.minWidth=f,v.style.maxWidth=f}else v.style.width="100%";D(v)}g(c,"setupImage"),setTimeout(()=>{v.complete&&c()}),v.addEventListener("error",c),v.addEventListener("load",c)})))}x=L.getBoundingClientRect(),_.attr("width",x.width),_.attr("height",x.height)}return r?o.attr("transform","translate("+-x.width/2+", "+-x.height/2+")"):o.attr("transform","translate(0, "+-x.height/2+")"),t.centerLabel&&o.attr("transform","translate("+-x.width/2+", "+-x.height/2+")"),o.insert("rect",":first-child"),{shapeSvg:n,bbox:x,halfPadding:S,label:o}},"labelHelper"),C=g((e,t)=>{const s=t.node().getBBox();e.width=s.width,e.height=s.height},"updateNodeBounds");function Z(e,t,s,i){return e.insert("polygon",":first-child").attr("points",i.map(function(l){return l.x+","+l.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-t/2+","+s/2+")")}g(Z,"insertPolygonShape");var Sr=g(async(e,t)=>{t.useHtmlLabels||R().flowchart.htmlLabels||(t.centerLabel=!0);const{shapeSvg:s,bbox:i,halfPadding:l}=await A(e,t,"node "+t.classes,!0);w.info("Classes = ",t.classes);const a=s.insert("rect",":first-child");return a.attr("rx",t.rx).attr("ry",t.ry).attr("x",-i.width/2-l).attr("y",-i.height/2-l).attr("width",i.width+t.padding).attr("height",i.height+t.padding),C(t,a),t.intersect=function(r){return $.rect(t,r)},s},"note"),kr=Sr,At=g(e=>e?" "+e:"","formatClass"),Y=g((e,t)=>`${t||"node default"}${At(e.classes)} ${At(e.class)}`,"getClassesFromNode"),Mt=g(async(e,t)=>{const{shapeSvg:s,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,a=i.height+t.padding,r=l+a,n=[{x:r/2,y:0},{x:r,y:-r/2},{x:r/2,y:-r},{x:0,y:-r/2}];w.info("Question main (Circle)");const o=Z(s,r,r,n);return o.attr("style",t.style),C(t,o),t.intersect=function(u){return w.warn("Intersect called"),$.polygon(t,n,u)},s},"question"),_r=g((e,t)=>{const s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),i=28,l=[{x:0,y:i/2},{x:i/2,y:0},{x:0,y:-i/2},{x:-i/2,y:0}];return s.insert("polygon",":first-child").attr("points",l.map(function(a){return a.x+","+a.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),t.width=28,t.height=28,t.intersect=function(a){return $.circle(t,14,a)},s},"choice"),vr=g(async(e,t)=>{const{shapeSvg:s,bbox:i}=await A(e,t,Y(t,void 0),!0),l=4,a=i.height+t.padding,r=a/l,n=i.width+2*r+t.padding,o=[{x:r,y:0},{x:n-r,y:0},{x:n,y:-a/2},{x:n-r,y:-a},{x:r,y:-a},{x:0,y:-a/2}],u=Z(s,n,a,o);return u.attr("style",t.style),C(t,u),t.intersect=function(y){return $.polygon(t,o,y)},s},"hexagon"),Er=g(async(e,t)=>{const{shapeSvg:s,bbox:i}=await A(e,t,void 0,!0),l=2,a=i.height+2*t.padding,r=a/l,n=i.width+2*r+t.padding,o=pr(t.directions,i,t),u=Z(s,n,a,o);return u.attr("style",t.style),C(t,u),t.intersect=function(y){return $.polygon(t,o,y)},s},"block_arrow"),Dr=g(async(e,t)=>{const{shapeSvg:s,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,a=i.height+t.padding,r=[{x:-a/2,y:0},{x:l,y:0},{x:l,y:-a},{x:-a/2,y:-a},{x:0,y:-a/2}];return Z(s,l,a,r).attr("style",t.style),t.width=l+a,t.height=a,t.intersect=function(n){return $.polygon(t,r,n)},s},"rect_left_inv_arrow"),Nr=g(async(e,t)=>{const{shapeSvg:s,bbox:i}=await A(e,t,Y(t),!0),l=i.width+t.padding,a=i.height+t.padding,r=[{x:-2*a/6,y:0},{x:l-a/6,y:0},{x:l+2*a/6,y:-a},{x:a/6,y:-a}],n=Z(s,l,a,r);return n.attr("style",t.style),C(t,n),t.intersect=function(o){return $.polygon(t,r,o)},s},"lean_right"),Tr=g(async(e,t)=>{const{shapeSvg:s,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,a=i.height+t.padding,r=[{x:2*a/6,y:0},{x:l+a/6,y:0},{x:l-2*a/6,y:-a},{x:-a/6,y:-a}],n=Z(s,l,a,r);return n.attr("style",t.style),C(t,n),t.intersect=function(o){return $.polygon(t,r,o)},s},"lean_left"),$r=g(async(e,t)=>{const{shapeSvg:s,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,a=i.height+t.padding,r=[{x:-2*a/6,y:0},{x:l+2*a/6,y:0},{x:l-a/6,y:-a},{x:a/6,y:-a}],n=Z(s,l,a,r);return n.attr("style",t.style),C(t,n),t.intersect=function(o){return $.polygon(t,r,o)},s},"trapezoid"),Cr=g(async(e,t)=>{const{shapeSvg:s,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,a=i.height+t.padding,r=[{x:a/6,y:0},{x:l-a/6,y:0},{x:l+2*a/6,y:-a},{x:-2*a/6,y:-a}],n=Z(s,l,a,r);return n.attr("style",t.style),C(t,n),t.intersect=function(o){return $.polygon(t,r,o)},s},"inv_trapezoid"),Ir=g(async(e,t)=>{const{shapeSvg:s,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,a=i.height+t.padding,r=[{x:0,y:0},{x:l+a/2,y:0},{x:l,y:-a/2},{x:l+a/2,y:-a},{x:0,y:-a}],n=Z(s,l,a,r);return n.attr("style",t.style),C(t,n),t.intersect=function(o){return $.polygon(t,r,o)},s},"rect_right_inv_arrow"),Or=g(async(e,t)=>{const{shapeSvg:s,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,a=l/2,r=a/(2.5+l/50),n=i.height+r+t.padding,o="M 0,"+r+" a "+a+","+r+" 0,0,0 "+l+" 0 a "+a+","+r+" 0,0,0 "+-l+" 0 l 0,"+n+" a "+a+","+r+" 0,0,0 "+l+" 0 l 0,"+-n,u=s.attr("label-offset-y",r).insert("path",":first-child").attr("style",t.style).attr("d",o).attr("transform","translate("+-l/2+","+-(n/2+r)+")");return C(t,u),t.intersect=function(y){const b=$.rect(t,y),x=b.x-t.x;if(a!=0&&(Math.abs(x)<t.width/2||Math.abs(x)==t.width/2&&Math.abs(b.y-t.y)>t.height/2-r)){let S=r*r*(1-x*x/(a*a));S!=0&&(S=Math.sqrt(S)),S=r-S,y.y-t.y>0&&(S=-S),b.y+=S}return b},s},"cylinder"),Br=g(async(e,t)=>{const{shapeSvg:s,bbox:i,halfPadding:l}=await A(e,t,"node "+t.classes+" "+t.class,!0),a=s.insert("rect",":first-child"),r=t.positioned?t.width:i.width+t.padding,n=t.positioned?t.height:i.height+t.padding,o=t.positioned?-r/2:-i.width/2-l,u=t.positioned?-n/2:-i.height/2-l;if(a.attr("class","basic label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",o).attr("y",u).attr("width",r).attr("height",n),t.props){const y=new Set(Object.keys(t.props));t.props.borders&&(ct(a,t.props.borders,r,n),y.delete("borders")),y.forEach(b=>{w.warn(`Unknown node property ${b}`)})}return C(t,a),t.intersect=function(y){return $.rect(t,y)},s},"rect"),Rr=g(async(e,t)=>{const{shapeSvg:s,bbox:i,halfPadding:l}=await A(e,t,"node "+t.classes,!0),a=s.insert("rect",":first-child"),r=t.positioned?t.width:i.width+t.padding,n=t.positioned?t.height:i.height+t.padding,o=t.positioned?-r/2:-i.width/2-l,u=t.positioned?-n/2:-i.height/2-l;if(a.attr("class","basic cluster composite label-container").attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",o).attr("y",u).attr("width",r).attr("height",n),t.props){const y=new Set(Object.keys(t.props));t.props.borders&&(ct(a,t.props.borders,r,n),y.delete("borders")),y.forEach(b=>{w.warn(`Unknown node property ${b}`)})}return C(t,a),t.intersect=function(y){return $.rect(t,y)},s},"composite"),zr=g(async(e,t)=>{const{shapeSvg:s}=await A(e,t,"label",!0);w.trace("Classes = ",t.class);const i=s.insert("rect",":first-child"),l=0,a=0;if(i.attr("width",l).attr("height",a),s.attr("class","label edgeLabel"),t.props){const r=new Set(Object.keys(t.props));t.props.borders&&(ct(i,t.props.borders,l,a),r.delete("borders")),r.forEach(n=>{w.warn(`Unknown node property ${n}`)})}return C(t,i),t.intersect=function(r){return $.rect(t,r)},s},"labelRect");function ct(e,t,s,i){const l=[],a=g(n=>{l.push(n,0)},"addBorder"),r=g(n=>{l.push(0,n)},"skipBorder");t.includes("t")?(w.debug("add top border"),a(s)):r(s),t.includes("r")?(w.debug("add right border"),a(i)):r(i),t.includes("b")?(w.debug("add bottom border"),a(s)):r(s),t.includes("l")?(w.debug("add left border"),a(i)):r(i),e.attr("stroke-dasharray",l.join(" "))}g(ct,"applyNodePropertyBorders");var Ar=g(async(e,t)=>{let s;t.classes?s="node "+t.classes:s="node default";const i=e.insert("g").attr("class",s).attr("id",t.domId||t.id),l=i.insert("rect",":first-child"),a=i.insert("line"),r=i.insert("g").attr("class","label"),n=t.labelText.flat?t.labelText.flat():t.labelText;let o="";typeof n=="object"?o=n[0]:o=n,w.info("Label text abc79",o,n,typeof n=="object");const u=r.node().appendChild(await H(o,t.labelStyle,!0,!0));let y={width:0,height:0};if(G(R().flowchart.htmlLabels)){const _=u.children[0],k=B(u);y=_.getBoundingClientRect(),k.attr("width",y.width),k.attr("height",y.height)}w.info("Text 2",n);const b=n.slice(1,n.length);let x=u.getBBox();const S=r.node().appendChild(await H(b.join?b.join("<br/>"):b,t.labelStyle,!0,!0));if(G(R().flowchart.htmlLabels)){const _=S.children[0],k=B(S);y=_.getBoundingClientRect(),k.attr("width",y.width),k.attr("height",y.height)}const L=t.padding/2;return B(S).attr("transform","translate( "+(y.width>x.width?0:(x.width-y.width)/2)+", "+(x.height+L+5)+")"),B(u).attr("transform","translate( "+(y.width<x.width?0:-(x.width-y.width)/2)+", 0)"),y=r.node().getBBox(),r.attr("transform","translate("+-y.width/2+", "+(-y.height/2-L+3)+")"),l.attr("class","outer title-state").attr("x",-y.width/2-L).attr("y",-y.height/2-L).attr("width",y.width+t.padding).attr("height",y.height+t.padding),a.attr("class","divider").attr("x1",-y.width/2-L).attr("x2",y.width/2+L).attr("y1",-y.height/2-L+x.height+L).attr("y2",-y.height/2-L+x.height+L),C(t,l),t.intersect=function(_){return $.rect(t,_)},i},"rectWithTitle"),Mr=g(async(e,t)=>{const{shapeSvg:s,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.height+t.padding,a=i.width+l/4+t.padding,r=s.insert("rect",":first-child").attr("style",t.style).attr("rx",l/2).attr("ry",l/2).attr("x",-a/2).attr("y",-l/2).attr("width",a).attr("height",l);return C(t,r),t.intersect=function(n){return $.rect(t,n)},s},"stadium"),Pr=g(async(e,t)=>{const{shapeSvg:s,bbox:i,halfPadding:l}=await A(e,t,Y(t,void 0),!0),a=s.insert("circle",":first-child");return a.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",i.width/2+l).attr("width",i.width+t.padding).attr("height",i.height+t.padding),w.info("Circle main"),C(t,a),t.intersect=function(r){return w.info("Circle intersect",t,i.width/2+l,r),$.circle(t,i.width/2+l,r)},s},"circle"),Xr=g(async(e,t)=>{const{shapeSvg:s,bbox:i,halfPadding:l}=await A(e,t,Y(t,void 0),!0),a=5,r=s.insert("g",":first-child"),n=r.insert("circle"),o=r.insert("circle");return r.attr("class",t.class),n.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",i.width/2+l+a).attr("width",i.width+t.padding+a*2).attr("height",i.height+t.padding+a*2),o.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("r",i.width/2+l).attr("width",i.width+t.padding).attr("height",i.height+t.padding),w.info("DoubleCircle main"),C(t,n),t.intersect=function(u){return w.info("DoubleCircle intersect",t,i.width/2+l+a,u),$.circle(t,i.width/2+l+a,u)},s},"doublecircle"),Wr=g(async(e,t)=>{const{shapeSvg:s,bbox:i}=await A(e,t,Y(t,void 0),!0),l=i.width+t.padding,a=i.height+t.padding,r=[{x:0,y:0},{x:l,y:0},{x:l,y:-a},{x:0,y:-a},{x:0,y:0},{x:-8,y:0},{x:l+8,y:0},{x:l+8,y:-a},{x:-8,y:-a},{x:-8,y:0}],n=Z(s,l,a,r);return n.attr("style",t.style),C(t,n),t.intersect=function(o){return $.polygon(t,r,o)},s},"subroutine"),Fr=g((e,t)=>{const s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),i=s.insert("circle",":first-child");return i.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),C(t,i),t.intersect=function(l){return $.circle(t,7,l)},s},"start"),Pt=g((e,t,s)=>{const i=e.insert("g").attr("class","node default").attr("id",t.domId||t.id);let l=70,a=10;s==="LR"&&(l=10,a=70);const r=i.append("rect").attr("x",-1*l/2).attr("y",-1*a/2).attr("width",l).attr("height",a).attr("class","fork-join");return C(t,r),t.height=t.height+t.padding/2,t.width=t.width+t.padding/2,t.intersect=function(n){return $.rect(t,n)},i},"forkJoin"),Yr=g((e,t)=>{const s=e.insert("g").attr("class","node default").attr("id",t.domId||t.id),i=s.insert("circle",":first-child"),l=s.insert("circle",":first-child");return l.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),i.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),C(t,l),t.intersect=function(a){return $.circle(t,7,a)},s},"end"),Kr=g(async(e,t)=>{var s;const i=t.padding/2,l=4,a=8;let r;t.classes?r="node "+t.classes:r="node default";const n=e.insert("g").attr("class",r).attr("id",t.domId||t.id),o=n.insert("rect",":first-child"),u=n.insert("line"),y=n.insert("line");let b=0,x=l;const S=n.insert("g").attr("class","label");let L=0;const _=(s=t.classData.annotations)==null?void 0:s[0],k=t.classData.annotations[0]?"«"+t.classData.annotations[0]+"»":"",N=S.node().appendChild(await H(k,t.labelStyle,!0,!0));let v=N.getBBox();if(G(R().flowchart.htmlLabels)){const m=N.children[0],h=B(N);v=m.getBoundingClientRect(),h.attr("width",v.width),h.attr("height",v.height)}t.classData.annotations[0]&&(x+=v.height+l,b+=v.width);let D=t.classData.label;t.classData.type!==void 0&&t.classData.type!==""&&(R().flowchart.htmlLabels?D+="<"+t.classData.type+">":D+="<"+t.classData.type+">");const c=S.node().appendChild(await H(D,t.labelStyle,!0,!0));B(c).attr("class","classTitle");let p=c.getBBox();if(G(R().flowchart.htmlLabels)){const m=c.children[0],h=B(c);p=m.getBoundingClientRect(),h.attr("width",p.width),h.attr("height",p.height)}x+=p.height+l,p.width>b&&(b=p.width);const f=[];t.classData.members.forEach(async m=>{const h=m.getDisplayDetails();let O=h.displayText;R().flowchart.htmlLabels&&(O=O.replace(/</g,"<").replace(/>/g,">"));const M=S.node().appendChild(await H(O,h.cssStyle?h.cssStyle:t.labelStyle,!0,!0));let z=M.getBBox();if(G(R().flowchart.htmlLabels)){const W=M.children[0],j=B(M);z=W.getBoundingClientRect(),j.attr("width",z.width),j.attr("height",z.height)}z.width>b&&(b=z.width),x+=z.height+l,f.push(M)}),x+=a;const E=[];if(t.classData.methods.forEach(async m=>{const h=m.getDisplayDetails();let O=h.displayText;R().flowchart.htmlLabels&&(O=O.replace(/</g,"<").replace(/>/g,">"));const M=S.node().appendChild(await H(O,h.cssStyle?h.cssStyle:t.labelStyle,!0,!0));let z=M.getBBox();if(G(R().flowchart.htmlLabels)){const W=M.children[0],j=B(M);z=W.getBoundingClientRect(),j.attr("width",z.width),j.attr("height",z.height)}z.width>b&&(b=z.width),x+=z.height+l,E.push(M)}),x+=a,_){let m=(b-v.width)/2;B(N).attr("transform","translate( "+(-1*b/2+m)+", "+-1*x/2+")"),L=v.height+l}let d=(b-p.width)/2;return B(c).attr("transform","translate( "+(-1*b/2+d)+", "+(-1*x/2+L)+")"),L+=p.height+l,u.attr("class","divider").attr("x1",-b/2-i).attr("x2",b/2+i).attr("y1",-x/2-i+a+L).attr("y2",-x/2-i+a+L),L+=a,f.forEach(m=>{B(m).attr("transform","translate( "+-b/2+", "+(-1*x/2+L+a/2)+")");const h=m==null?void 0:m.getBBox();L+=((h==null?void 0:h.height)??0)+l}),L+=a,y.attr("class","divider").attr("x1",-b/2-i).attr("x2",b/2+i).attr("y1",-x/2-i+a+L).attr("y2",-x/2-i+a+L),L+=a,E.forEach(m=>{B(m).attr("transform","translate( "+-b/2+", "+(-1*x/2+L)+")");const h=m==null?void 0:m.getBBox();L+=((h==null?void 0:h.height)??0)+l}),o.attr("style",t.style).attr("class","outer title-state").attr("x",-b/2-i).attr("y",-(x/2)-i).attr("width",b+t.padding).attr("height",x+t.padding),C(t,o),t.intersect=function(m){return $.rect(t,m)},n},"class_box"),Xt={rhombus:Mt,composite:Rr,question:Mt,rect:Br,labelRect:zr,rectWithTitle:Ar,choice:_r,circle:Pr,doublecircle:Xr,stadium:Mr,hexagon:vr,block_arrow:Er,rect_left_inv_arrow:Dr,lean_right:Nr,lean_left:Tr,trapezoid:$r,inv_trapezoid:Cr,rect_right_inv_arrow:Ir,cylinder:Or,start:Fr,end:Yr,note:kr,subroutine:Wr,fork:Pt,join:Pt,class_box:Kr},lt={},re=g(async(e,t,s)=>{let i,l;if(t.link){let a;R().securityLevel==="sandbox"?a="_top":t.linkTarget&&(a=t.linkTarget||"_blank"),i=e.insert("svg:a").attr("xlink:href",t.link).attr("target",a),l=await Xt[t.shape](i,t,s)}else l=await Xt[t.shape](e,t,s),i=l;return t.tooltip&&l.attr("title",t.tooltip),t.class&&l.attr("class","node default "+t.class),lt[t.id]=i,t.haveCallback&<[t.id].attr("class",lt[t.id].attr("class")+" clickable"),i},"insertNode"),Hr=g(e=>{const t=lt[e.id];w.trace("Transforming node",e.diff,e,"translate("+(e.x-e.width/2-5)+", "+e.width/2+")");const s=8,i=e.diff||0;return e.clusterNode?t.attr("transform","translate("+(e.x+i-e.width/2)+", "+(e.y-e.height/2-s)+")"):t.attr("transform","translate("+e.x+", "+e.y+")"),i},"positionNode");function Dt(e,t,s=!1){var i,l,a;const r=e;let n="default";(((i=r==null?void 0:r.classes)==null?void 0:i.length)||0)>0&&(n=((r==null?void 0:r.classes)??[]).join(" ")),n=n+" flowchart-label";let o=0,u="",y;switch(r.type){case"round":o=5,u="rect";break;case"composite":o=0,u="composite",y=0;break;case"square":u="rect";break;case"diamond":u="question";break;case"hexagon":u="hexagon";break;case"block_arrow":u="block_arrow";break;case"odd":u="rect_left_inv_arrow";break;case"lean_right":u="lean_right";break;case"lean_left":u="lean_left";break;case"trapezoid":u="trapezoid";break;case"inv_trapezoid":u="inv_trapezoid";break;case"rect_left_inv_arrow":u="rect_left_inv_arrow";break;case"circle":u="circle";break;case"ellipse":u="ellipse";break;case"stadium":u="stadium";break;case"subroutine":u="subroutine";break;case"cylinder":u="cylinder";break;case"group":u="rect";break;case"doublecircle":u="doublecircle";break;default:u="rect"}const b=Le((r==null?void 0:r.styles)??[]),x=r.label,S=r.size??{width:0,height:0,x:0,y:0};return{labelStyle:b.labelStyle,shape:u,labelText:x,rx:o,ry:o,class:n,style:b.style,id:r.id,directions:r.directions,width:S.width,height:S.height,x:S.x,y:S.y,positioned:s,intersect:void 0,type:r.type,padding:y??((a=(l=at())==null?void 0:l.block)==null?void 0:a.padding)??0}}g(Dt,"getNodeFromBlock");async function ae(e,t,s){const i=Dt(t,s,!1);if(i.type==="group")return;const l=at(),a=await re(e,i,{config:l}),r=a.node().getBBox(),n=s.getBlock(i.id);n.size={width:r.width,height:r.height,x:0,y:0,node:a},s.setBlock(n),a.remove()}g(ae,"calculateBlockSize");async function se(e,t,s){const i=Dt(t,s,!0);if(s.getBlock(i.id).type!=="space"){const l=at();await re(e,i,{config:l}),t.intersect=i==null?void 0:i.intersect,Hr(i)}}g(se,"insertBlockPositioned");async function ht(e,t,s,i){for(const l of t)await i(e,l,s),l.children&&await ht(e,l.children,s,i)}g(ht,"performOperations");async function ie(e,t,s){await ht(e,t,s,ae)}g(ie,"calculateBlockSizes");async function ne(e,t,s){await ht(e,t,s,se)}g(ne,"insertBlocks");async function le(e,t,s,i,l){const a=new ke({multigraph:!0,compound:!0});a.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const r of s)r.size&&a.setNode(r.id,{width:r.size.width,height:r.size.height,intersect:r.intersect});for(const r of t)if(r.start&&r.end){const n=i.getBlock(r.start),o=i.getBlock(r.end);if(n!=null&&n.size&&o!=null&&o.size){const u=n.size,y=o.size,b=[{x:u.x,y:u.y},{x:u.x+(y.x-u.x)/2,y:u.y+(y.y-u.y)/2},{x:y.x,y:y.y}];gr(e,{v:r.start,w:r.end,name:r.id},{...r,arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:b,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"},void 0,"block",a,l),r.label&&(await dr(e,{...r,label:r.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:b,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"}),cr({...r,x:b[1].x,y:b[1].y},{originalPath:b}))}}}g(le,"insertEdges");var jr=g(function(e,t){return t.db.getClasses()},"getClasses"),Ur=g(async function(e,t,s,i){const{securityLevel:l,block:a}=at(),r=i.db;let n;l==="sandbox"&&(n=B("#i"+t));const o=l==="sandbox"?B(n.nodes()[0].contentDocument.body):B("body"),u=l==="sandbox"?o.select(`[id="${t}"]`):B(`[id="${t}"]`);sr(u,["point","circle","cross"],i.type,t);const y=r.getBlocks(),b=r.getBlocksFlat(),x=r.getEdges(),S=u.insert("g").attr("class","block");await ie(S,y,r);const L=Zt(r);if(await ne(S,y,r),await le(S,x,b,r,t),L){const _=L,k=Math.max(1,Math.round(.125*(_.width/_.height))),N=_.height+k+10,v=_.width+10,{useMaxWidth:D}=a;he(u,N,v,!!D),w.debug("Here Bounds",L,_),u.attr("viewBox",`${_.x-5} ${_.y-5} ${_.width+10} ${_.height+10}`)}},"draw"),Zr={draw:Ur,getClasses:jr},ea={parser:ve,db:Ke,renderer:Zr,styles:je};export{ea as diagram};
|